1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/heroImageCleanup-wRZ9v20c.js","assets/vendor-DZFBK4sO.js","assets/supabase-BVEOgzF4.js","assets/stripe-Dfea-eCh.js","assets/index.es-D1qSwV50.js"])))=>i.map(i=>d[i]); 2var SG=Object.defineProperty;var tE=t=>{throw TypeError(t)};var CG=(t,e,r)=>e in t?SG(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var sr=(t,e,r)=>CG(t,typeof e!="symbol"?e+"":e,r),m2=(t,e,r)=>e.has(t)||tE("Cannot "+r);var Te=(t,e,r)=>(m2(t,e,"read from private field"),r?r.call(t):e.get(t)),kr=(t,e,r)=>e.has(t)?tE("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),er=(t,e,r,n)=>(m2(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),hs=(t,e,r)=>(m2(t,e,"access private method"),r);var Xb=(t,e,r,n)=>({set _(a){er(t,e,a,r)},get _(){return Te(t,e,n)}});import{r as x,a as bx,R as Oe,b as cw,c as uw,g as iC,d as io}from"./vendor-DZFBK4sO.js";import{c as vM,_ as Sh,a as wM,b as kG}from"./supabase-BVEOgzF4.js";import{l as _G}from"./stripe-Dfea-eCh.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var jM={exports:{}},dw={};/** 3 * @license React 4 * react-jsx-runtime.production.min.js 5 * 6 * Copyright (c) Facebook, Inc. and its affiliates. 7 * 8 * This source code is licensed under the MIT license found in the 9 * LICENSE file in the root directory of this source tree. 10 */var EG=x,AG=Symbol.for("react.element"),DG=Symbol.for("react.fragment"),TG=Object.prototype.hasOwnProperty,MG=EG.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,PG={key:!0,ref:!0,__self:!0,__source:!0};function NM(t,e,r){var n,a={},i=null,o=null;r!==void 0&&(i=""+r),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(o=e.ref);for(n in e)TG.call(e,n)&&!PG.hasOwnProperty(n)&&(a[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)a[n]===void 0&&(a[n]=e[n]);return{$$typeof:AG,type:t,key:i,ref:o,props:a,_owner:MG.current}}dw.Fragment=DG;dw.jsx=NM;dw.jsxs=NM;jM.exports=dw;var s=jM.exports,tF={},rE=bx;tF.createRoot=rE.createRoot,tF.hydrateRoot=rE.hydrateRoot;const RG=1,BG=1e6;let f2=0;function LG(){return f2=(f2+1)%Number.MAX_SAFE_INTEGER,f2.toString()}const p2=new Map,sE=t=>{if(p2.has(t))return;const e=setTimeout(()=>{p2.delete(t),My({type:"REMOVE_TOAST",toastId:t})},BG);p2.set(t,e)},IG=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,RG)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(r=>r.id===e.toast.id?{...r,...e.toast}:r)};case"DISMISS_TOAST":{const{toastId:r}=e;return r?sE(r):t.toasts.forEach(n=>{sE(n.id)}),{...t,toasts:t.toasts.map(n=>
vendor: 10,649 bytes, line 10
10n.id===r||r===void 0?{...n,open:!1}:n)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(r=>r.id!==e.toastId)}}},zv=[];let Uv={toasts:[]};function My(t){Uv=IG(Uv,t),zv.forEach(e=>{e(Uv)})}function OG({...t}){const e=LG(),r=a=>My({type:"UPDATE_TOAST",toast:{...a,id:e}}),n=()=>My({type:"DISMISS_TOAST",toastId:e});return My({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:a=>{a||n()}}}),{id:e,dismiss:n,update:r}}function St(){const[t,e]=x.useState(Uv);return x.useEffect(()=>(zv.push(e),()=>{const r=zv.indexOf(e);r>-1&&zv.splice(r,1)}),[t]),{...t,toast:OG,dismiss:r=>My({type:"DISMISS_TOAST",toastId:r})}}function gt(t,e,{checkForDefaultPrevented:r=!0}={}){return function(a){if(t==null||t(a),r===!1||!a.defaultPrevented)return e==null?void 0:e(a)}}function nE(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function vx(...t){return e=>{let r=!1;const n=t.map(a=>{const i=nE(a,e);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let a=0;a<n.length;a++){const i=n[a];typeof i=="function"?i():nE(t[a],null)}}}}function Cr(...t){return x.useCallback(vx(...t),t)}function zG(t,e){const r=x.createContext(e),n=i=>{const{children:o,...l}=i,c=x.useMemo(()=>l,Object.values(l));return s.jsx(r.Provider,{value:c,children:o})};n.displayName=t+"Provider";function a(i){const o=x.useContext(r);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[n,a]}function li(t,e=[]){let r=[];function n(i,o){const l=x.createContext(o),c=r.length;r=[...r,o];const u=h=>{var w;const{scope:f,children:m,...g}=h,y=((w=f==null?void 0:f[t])==null?void 0:w[c])||l,b=x.useMemo(()=>g,Object.values(g));return s.jsx(y.Provider,{value:b,children:m})};u.displayName=i+"Provider";function d(h,f){var y;const m=((y=f==null?void 0:f[t])==null?void 0:y[c])||l,g=x.useContext(m);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${i}\``)}return[u,d]}const a=()=>{const i=r.map(o=>x.createContext(o));return function(l){const c=(l==null?void 0:l[t])||i;return x.useMemo(()=>({[`__scope${t}`]:{...l,[t]:c}}),[l,c])}};return a.scopeName=t,[n,UG(a,...e)]}function UG(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((l,{useScope:c,scopeName:u})=>{const h=c(i)[`__scope${u}`];return{...l,...h}},{});return x.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}function Vg(t){const e=HG(t),r=x.forwardRef((n,a)=>{const{children:i,...o}=n,l=x.Children.toArray(i),c=l.find($G);if(c){const u=c.props.children,d=l.map(h=>h===c?x.Children.count(u)>1?x.Children.only(null):x.isValidElement(u)?u.props.children:null:h);return s.jsx(e,{...o,ref:a,children:x.isValidElement(u)?x.cloneElement(u,void 0,d):null})}return s.jsx(e,{...o,ref:a,children:i})});return r.displayName=`${t}.Slot`,r}function HG(t){const e=x.forwardRef((r,n)=>{const{children:a,...i}=r;if(x.isValidElement(a)){const o=qG(a),l=WG(i,a.props);return a.type!==x.Fragment&&(l.ref=n?vx(n,o):o),x.cloneElement(a,l)}return x.Children.count(a)>1?x.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var FM=Symbol("radix.slottable");function SM(t){const e=({children:r})=>s.jsx(s.Fragment,{children:r});return e.displayName=`${t}.Slottable`,e.__radixId=FM,e}function $G(t){return x.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===FM}function WG(t,e){const r={...e};for(const n in e){const a=t[n],i=e[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...l)=>{const c=i(...l);return a(...l),c}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...t,...r}}function qG(t){var n,a;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(a=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:a.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}function op(t){const e=t+"CollectionProvider",[r,n]=li(e),[a,i]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=y=>{const{scope:b,children:w}=y,j=Oe.useRef(null),N=Oe.useRef(new Map).current;return s.jsx(a,{scope:b,itemMap:N,collectionRef:j,children:w})};o.displayName=e;const l=t+"CollectionSlot",c=Vg(l),u=Oe.forwardRef((y,b)=>{const{scope:w,children:j}=y,N=i(l,w),S=Cr(b,N.collectionRef);return s.jsx(c,{ref:S,children:j})});u.displayName=l;const d=t+"CollectionItemSlot",h="data-radix-collection-item",f=Vg(d),m=Oe.forwardRef((y,b)=>{const{scope:w,children:j,...N}=y,S=Oe.useRef(null),E=Cr(b,S),C=i(d,w);return Oe.useEffect(()=>(C.itemMap.set(S,{ref:S,...N}),()=>void C.itemMap.delete(S))),s.jsx(f,{[h]:"",ref:E,children:j})});m.displayName=d;function g(y){const b=i(t+"CollectionConsumer",y);return Oe.useCallback(()=>{const j=b.collectionRef.current;if(!j)return[];const N=Array.from(j.querySelectorAll(`[${h}]`));return Array.from(b.itemMap.values()).sort((C,T)=>N.indexOf(C.ref.current)-N.indexOf(T.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:o,Slot:u,ItemSlot:m},g,n]}var GG=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Zt=GG.reduce((t,e)=>{const r=Vg(`Primitive.${e}`),n=x.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Ky(t,e){t&&bx.flushSync(()=>t.dispatchEvent(e))}function Zs(t){const e=x.useRef(t);return x.useEffect(()=>{e.current=t}),x.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}function VG(t,e=globalThis==null?void 0:globalThis.document){const r=Zs(t);x.useEffect(()=>{const n=a=>{a.key==="Escape"&&r(a)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e])}var KG="DismissableLayer",rF="dismissableLayer.update",JG="dismissableLayer.pointerDownOutside",YG="dismissableLayer.focusOutside",aE,CM=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),lp=x.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=t,u=x.useContext(CM),[d,h]=x.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=x.useState({}),g=Cr(e,T=>h(T)),y=Array.from(u.layers),[b]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=y.indexOf(b),j=d?y.indexOf(d):-1,N=u.layersWithOutsidePointerEventsDisabled.size>0,S=j>=w,E=XG(T=>{const D=T.target,A=[...u.branches].some(R=>R.contains(D));!S||A||(a==null||a(T),o==null||o(T),T.defaultPrevented||l==null||l())},f),C=QG(T=>{const D=T.target;[...u.branches].some(R=>R.contains(D))||(i==null||i(T),o==null||o(T),T.defaultPrevented||l==null||l())},f);return VG(T=>{j===u.layers.size-1&&(n==null||n(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},f),x.useEffect(()=>{if(d)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(aE=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),iE(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=aE)}},[d,f,r,u]),x.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),iE())},[d,u]),x.useEffect(()=>{const T=()=>m({});return document.addEventListener(rF,T),()=>document.removeEventListener(rF,T)},[]),s.jsx(Zt.div,{...c,ref:g,style:{pointerEvents:N?S?"auto":"none":void 0,...t.style},onFocusCapture:gt(t.onFocusCapture,C.onFocusCapture),onBlurCapture:gt(t.onBlurCapture,C.onBlurCapture),onPointerDownCapture:gt(t.onPointerDownCapture,E.onPointerDownCapture)})});lp.displayName=KG;var ZG="DismissableLayerBranch",kM=x.forwardRef((t,e)=>{const r=x.useContext(CM),n=x.useRef(null),a=Cr(e,n);return x.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),s.jsx(Zt.div,{...t,ref:a})});kM.displayName=ZG;function XG(t,e=globalThis==null?void 0:globalThis.document){const r=Zs(t),n=x.useRef(!1),a=x.useRef(()=>{});return x.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let c=function(){_M(JG,r,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(e.removeEventListener("click",a.current),a.current=c,e.addEventListener("click",a.current,{once:!0})):c()}else e.removeEventListener("click",a.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",i),e.removeEventListener("click",a.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function QG(t,e=globalThis==null?void 0:globalThis.document){const r=Zs(t),n=x.useRef(!1);return x.useEffect(()=>{const a=i=>{i.target&&!n.current&&_M(YG,r,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",a),()=>e.removeEventListener("focusin",a)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function iE(){const t=new CustomEvent(rF);document.dispatchEvent(t)}function _M(t,e,r,{discrete:n}){const a=r.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&a.addEventListener(t,e,{once:!0}),n?Ky(a,i):a.dispatchEvent(i)}var eV=lp,tV=kM,En=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},rV="Portal",B0=x.forwardRef((t,e)=>{var l;const{container:r,...n}=t,[a,i]=x.useState(!1);En(()=>i(!0),[]);const o=r||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?cw.createPortal(s.jsx(Zt.div,{...n,ref:e}),o):null});B0.displayName=rV;function sV(t,e){return x.useReducer((r,n)=>e[r][n]??r,t)}var fa=t=>{const{present:e,children:r}=t,n=nV(e),a=typeof r=="function"?r({present:n.isPresent}):x.Children.only(r),i=Cr(n.ref,aV(a));return typeof r=="function"||n.isPresent?x.cloneElement(a,{ref:i}):null};fa.displayName="Presence";function nV(t){const[e,r]=x.useState(),n=x.useRef(null),a=x.useRef(t),i=x.useRef("none"),o=t?"mounted":"unmounted",[l,c]=sV(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const u=Qb(n.current);i.current=l==="mounted"?u:"none"},[l]),En(()=>{const u=n.current,d=a.current;if(d!==t){const f=i.current,m=Qb(u);t?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&f!==m?"ANIMATION_OUT":"UNMOUNT"),a.current=t}},[t,c]),En(()=>
10{if(e){let u;const d=e.ownerDocument.defaultView??window,h=m=>{const y=Qb(n.current).includes(CSS.escape(m.animationName));if(m.target===e&&y&&(c("ANIMATION_END"),!a.current)){const b=e.style.animationFillMode;e.style.animationFillMode="forwards",u=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=b)})}},f=m=>{m.target===e&&(i.current=Qb(n.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{d.clearTimeout(u),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function Qb(t){return(t==null?void 0:t.animationName)||"none"}function aV(t){var n,a;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(a=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:a.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var iV=uw[" useInsertionEffect ".trim().toString()]||En;function Lo({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){const[a,i,o]=oV({defaultProp:e,onChange:r}),l=t!==void 0,c=l?t:a;{const d=x.useRef(t!==void 0);x.useEffect(()=>{const h=d.current;h!==l&&console.warn(`${n} is changing from ${h?"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.`),d.current=l},[l,n])}const u=x.useCallback(d=>{var h;if(l){const f=lV(d)?d(t):d;f!==t&&((h=o.current)==null||h.call(o,f))}else i(d)},[l,t,i,o]);return[c,u]}function oV({defaultProp:t,onChange:e}){const[r,n]=x.useState(t),a=x.useRef(r),i=x.useRef(e);return iV(()=>{i.current=e},[e]),x.useEffect(()=>{var o;a.current!==r&&((o=i.current)==null||o.call(i,r),a.current=r)},[r,a]),[r,n,i]}function lV(t){return typeof t=="function"}var EM=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"}),cV="VisuallyHidden",hw=x.forwardRef((t,e)=>s.jsx(Zt.span,{...t,ref:e,style:{...EM,...t.style}}));hw.displayName=cV;var AM=hw,oC="ToastProvider",[lC,uV,dV]=op("Toast"),[DM]=li("Toast",[dV]),[hV,mw]=DM(oC),TM=t=>{const{__scopeToast:e,label:r="Notification",duration:n=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:o}=t,[l,c]=x.useState(null),[u,d]=x.useState(0),h=x.useRef(!1),f=x.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${oC}\`. Expected non-empty \`string\`.`),s.jsx(lC.Provider,{scope:e,children:s.jsx(hV,{scope:e,label:r,duration:n,swipeDirection:a,swipeThreshold:i,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:x.useCallback(()=>d(m=>m+1),[]),onToastRemove:x.useCallback(()=>d(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:f,children:o})})};TM.displayName=oC;var MM="ToastViewport",mV=["F8"],sF="toast.viewportPause",nF="toast.viewportResume",PM=x.forwardRef((t,e)=>{const{__scopeToast:r,hotkey:n=mV,label:a="Notifications ({hotkey})",...i}=t,o=mw(MM,r),l=uV(r),c=x.useRef(null),u=x.useRef(null),d=x.useRef(null),h=x.useRef(null),f=Cr(e,h,o.onViewportChange),m=n.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=o.toastCount>0;x.useEffect(()=>{const b=w=>{var N;n.length!==0&&n.every(S=>w[S]||w.code===S)&&((N=h.current)==null||N.focus())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[n]),x.useEffect(()=>{const b=c.current,w=h.current;if(g&&b&&w){const j=()=>
10{if(!o.isClosePausedRef.current){const C=new CustomEvent(sF);w.dispatchEvent(C),o.isClosePausedRef.current=!0}},N=()=>{if(o.isClosePausedRef.current){const C=new CustomEvent(nF);w.dispatchEvent(C),o.isClosePausedRef.current=!1}},S=C=>{!b.contains(C.relatedTarget)&&N()},E=()=>{b.contains(document.activeElement)||N()};return b.addEventListener("focusin",j),b.addEventListener("focusout",S),b.addEventListener("pointermove",j),b.addEventListener("pointerleave",E),window.addEventListener("blur",j),window.addEventListener("focus",N),()=>{b.removeEventListener("focusin",j),b.removeEventListener("focusout",S),b.removeEventListener("pointermove",j),b.removeEventListener("pointerleave",E),window.removeEventListener("blur",j),window.removeEventListener("focus",N)}}},[g,o.isClosePausedRef]);const y=x.useCallback(({tabbingDirection:b})=>{const j=l().map(N=>{const S=N.ref.current,E=[S,...CV(S)];return b==="forwards"?E:E.reverse()});return(b==="forwards"?j.reverse():j).flat()},[l]);return x.useEffect(()=>{const b=h.current;if(b){const w=j=>{var E,C,T;const N=j.altKey||j.ctrlKey||j.metaKey;if(j.key==="Tab"&&!N){const D=document.activeElement,A=j.shiftKey;if(j.target===b&&A){(E=u.current)==null||E.focus();return}const P=y({tabbingDirection:A?"backwards":"forwards"}),U=P.findIndex(I=>I===D);g2(P.slice(U+1))?j.preventDefault():A?(C=u.current)==null||C.focus():(T=d.current)==null||T.focus()}};return b.addEventListener("keydown",w),()=>b.removeEventListener("keydown",w)}},[l,y]),s.jsxs(tV,{ref:c,role:"region","aria-label":a.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&s.jsx(aF,{ref:u,onFocusFromOutsideViewport:()=>{const b=y({tabbingDirection:"forwards"});g2(b)}}),s.jsx(lC.Slot,{scope:r,children:s.jsx(Zt.ol,{tabIndex:-1,...i,ref:f})}),g&&s.jsx(aF,{ref:d,onFocusFromOutsideViewport:()=>{const b=y({tabbingDirection:"backwards"});g2(b)}})]})});PM.displayName=MM;var RM="ToastFocusProxy",aF=x.forwardRef((t,e)=>{const{__scopeToast:r,onFocusFromOutsideViewport:n,...a}=t,i=mw(RM,r);return s.jsx(hw,{tabIndex:0,...a,ref:e,style:{position:"fixed"},onFocus:o=>{var u;const l=o.relatedTarget;!((u=i.viewport)!=null&&u.contains(l))&&n()}})});aF.displayName=RM;var L0="Toast",fV="toast.swipeStart",pV="toast.swipeMove",gV="toast.swipeCancel",xV="toast.swipeEnd",BM=x.forwardRef((t,e)=>{const{forceMount:r,open:n,defaultOpen:a,onOpenChange:i,...o}=t,[l,c]=Lo({prop:n,defaultProp:a??!0,onChange:i,caller:L0});return s.jsx(fa,{present:r||l,children:s.jsx(vV,{open:l,...o,ref:e,onClose:()=>c(!1),onPause:Zs(t.onPause),onResume:Zs(t.onResume),onSwipeStart:gt(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:gt(t.onSwipeMove,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:gt(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:gt(t.onSwipeEnd,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),c(!1)})})})});BM.displayName=L0;var[yV,bV]=DM(L0,{onClose(){}}),vV=x.forwardRef((t,e)=>{const{__scopeToast:r,type:n="foreground",duration:a,open:i,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:h,onSwipeCancel:f,onSwipeEnd:m,...g}=t,y=mw(L0,r),[b,w]=x.useState(null),j=Cr(e,I=>w(I)),N=x.useRef(null),S=x.useRef(null),E=a||y.duration,C=x.useRef(0),T=x.useRef(E),D=x.useRef(0),{onToastAdd:A,onToastRemove:R}=y,M=Zs(()=>{var O;(b==null?void 0:b.contains(document.activeElement))&&((O=y.viewport)==null||O.focus()),o()}),P=x.useCallback(I=>
10{!I||I===1/0||(window.clearTimeout(D.current),C.current=new Date().getTime(),D.current=window.setTimeout(M,I))},[M]);x.useEffect(()=>{const I=y.viewport;if(I){const O=()=>{P(T.current),u==null||u()},V=()=>{const G=new Date().getTime()-C.current;T.current=T.current-G,window.clearTimeout(D.current),c==null||c()};return I.addEventListener(sF,V),I.addEventListener(nF,O),()=>{I.removeEventListener(sF,V),I.removeEventListener(nF,O)}}},[y.viewport,E,c,u,P]),x.useEffect(()=>{i&&!y.isClosePausedRef.current&&P(E)},[i,E,y.isClosePausedRef,P]),x.useEffect(()=>(A(),()=>R()),[A,R]);const U=x.useMemo(()=>b?$M(b):null,[b]);return y.viewport?s.jsxs(s.Fragment,{children:[U&&s.jsx(wV,{__scopeToast:r,role:"status","aria-live":n==="foreground"?"assertive":"polite",children:U}),s.jsx(yV,{scope:r,onClose:M,children:bx.createPortal(s.jsx(lC.ItemSlot,{scope:r,children:s.jsx(eV,{asChild:!0,onEscapeKeyDown:gt(l,()=>{y.isFocusedToastEscapeKeyDownRef.current||M(),y.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(Zt.li,{tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":y.swipeDirection,...g,ref:j,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:gt(t.onKeyDown,I=>{I.key==="Escape"&&(l==null||l(I.nativeEvent),I.nativeEvent.defaultPrevented||(y.isFocusedToastEscapeKeyDownRef.current=!0,M()))}),onPointerDown:gt(t.onPointerDown,I=>{I.button===0&&(N.current={x:I.clientX,y:I.clientY})}),onPointerMove:gt(t.onPointerMove,I=>{if(!N.current)return;const O=I.clientX-N.current.x,V=I.clientY-N.current.y,G=!!S.current,B=["left","right"].includes(y.swipeDirection),$=["left","up"].includes(y.swipeDirection)?Math.min:Math.max,W=B?$(0,O):0,oe=B?0:$(0,V),K=I.pointerType==="touch"?10:2,H={x:W,y:oe},X={originalEvent:I,delta:H};G?(S.current=H,ev(pV,h,X,{discrete:!1})):oE(H,y.swipeDirection,K)?(S.current=H,ev(fV,d,X,{discrete:!1}),I.target.setPointerCapture(I.pointerId)):(Math.abs(O)>K||Math.abs(V)>K)&&(N.current=null)}),onPointerUp:gt(t.onPointerUp,I=>{const O=S.current,V=I.target;if(V.hasPointerCapture(I.pointerId)&&V.releasePointerCapture(I.pointerId),S.current=null,N.current=null,O){const G=I.currentTarget,B={originalEvent:I,delta:O};oE(O,y.swipeDirection,y.swipeThreshold)?ev(xV,m,B,{discrete:!0}):ev(gV,f,B,{discrete:!0}),G.addEventListener("click",$=>$.preventDefault(),{once:!0})}})})})}),y.viewport)})]}):null}),wV=t=>{const{__scopeToast:e,children:r,...n}=t,a=mw(L0,e),[i,o]=x.useState(!1),[l,c]=x.useState(!1);return FV(()=>o(!0)),x.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:s.jsx(B0,{asChild:!0,children:s.jsx(hw,{...n,children:i&&s.jsxs(s.Fragment,{children:[a.label," ",r]})})})},jV="ToastTitle",LM=x.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return s.jsx(Zt.div,{...n,ref:e})});LM.displayName=jV;var NV="ToastDescription",IM=x.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t;return s.jsx(Zt.div,{...n,ref:e})});IM.displayName=NV;var OM="ToastAction",zM=x.forwardRef((t,e)=>{const{altText:r,...n}=t;return r.trim()?s.jsx(HM,{altText:r,asChild:!0,children:s.jsx(cC,{...n,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${OM}\`. Expected non-empty \`string\`.`),null)});zM.displayName=OM;var UM="ToastClose",cC=x.forwardRef((t,e)=>{const{__scopeToast:r,...n}=t,a=bV(UM,r);return s.jsx(HM,{asChild:!0,children:s.jsx(Zt.button,{type:"button",...n,ref:e,onClick:gt(t.onClick,a.onClose)})})});cC.displayName=UM;var HM=x.forwardRef((t,e)=>{const{__scopeToast:r,altText:n,...a}=t;return s.jsx(Zt.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":n||void 0,...a,ref:e})});function $M(t){const e=[];return Array.from(t.childNodes).forEach(n=>{if(n.nodeType===n.TEXT_NODE&&n.textContent&&e.push(n.textContent),SV(n)){const a=n.ariaHidden||n.hidden||n.style.display==="none",i=n.dataset.radixToastAnnounceExclude==="";if(!a)if(i){const o=n.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...$M(n))}}),e}function ev(t,e,r,{discrete:n}){const a=r.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r});e&&a.addEventListener(t,e,{once:!0}),n?Ky(a,i):a.dispatchEvent(i)}var oE=(t,e,r=0)=>{const n=Math.abs(t.x),a=Math.abs(t.y),i=n>a;return e==="left"||e==="right"?i&&n>r:!i&&a>r};function FV(t=()=>{}){const e=Zs(t);En(()=>{let r=0,n=0;return r=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(n)}},[e])}function SV(t){return t.nodeType===t.ELEMENT_NODE}function CV(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function g2(t){const e=document.activeElement;return t.some(r=>r===e?!0:(r.focus(),document.activeElement!==e))}var kV=TM,WM=PM,qM=BM,GM=LM,VM=IM,KM=zM,JM=cC;function YM(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(r=YM(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function ZM(){for(var t,e,r=0,n="",a=arguments.length;r<a;r++)(t=arguments[r])&&(e=YM(t))&&(n&&(n+=" "),n+=e);return n}const lE=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,cE=ZM,cp=(t,e)=>r=>{var n;if((e==null?void 0:e.variants)==null)return cE(t,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:a,defaultVariants:i}=e,o=Object.keys(a).map(u=>{const d=r==null?void 0:r[u],h=i==null?void 0:i[u];if(d===null)return null;const f=lE(d)||lE(h);return a[u][f]}),l=r&&Object.entries(r).reduce((u,d)=>{let[h,f]=d;return f===void 0||(u[h]=f),u},{}),c=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((u,d)=>{let{class:h,className:f,...m}=d;return Object.entries(m).every(g=>{let[y,b]=g;return Array.isArray(b)?b.includes({...i,...l}[y]):{...i,...l}[y]===b})?[...u,h,f]:u},[]);return cE(t,o,c,r==null?void 0:r.class,r==null?void 0:r.className)};/** 11 * @license lucide-react v0.462.0 - ISC 12 * 13 * This source code is licensed under the ISC license. 14 * See the LICENSE file in the root directory of this source tree. 15 */const _V=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),XM=(...t)=>t.filter((e,r,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===r).join(" ").trim();/** 16 * @license lucide-react v0.462.0 - ISC 17 * 18 * This source code is licensed under the ISC license. 19 * See the LICENSE file in the root directory of this source tree. 20 */var EV={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"};/** 21 * @license lucide-react v0.462.0 - ISC 22 * 23 * This source code is licensed under the ISC license. 24 * See the LICENSE file in the root directory of this source tree. 25 */const AV=x.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:i,iconNode:o,...l},c)=>x.createElement("svg",{ref:c,...EV,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:XM("lucide",a),...l},[...o.map(([u,d])=>x.createElement(u,d)),...Array.isArray(i)?i:[i]]));/** 26 * @license lucide-react v0.462.0 - ISC 27 * 28 * This source code is licensed under the ISC license. 29 * See the LICENSE file in the root directory of this source tree. 30 */const vt=(t,e)=>{const r=x.forwardRef(({className:n,...a},i)=>x.createElement(AV,{ref:i,iconNode:e,className:XM(`lucide-${_V(t)}`,n),...a}
30));return r.displayName=`${t}`,r};/** 31 * @license lucide-react v0.462.0 - ISC 32 * 33 * This source code is licensed under the ISC license. 34 * See the LICENSE file in the root directory of this source tree. 35 */const uC=vt("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** 36 * @license lucide-react v0.462.0 - ISC 37 * 38 * This source code is licensed under the ISC license. 39 * See the LICENSE file in the root directory of this source tree. 40 */const pn=vt("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 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 ul=vt("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 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 */const DV=vt("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/** 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 dC=vt("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** 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 Jy=vt("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"}]]);/** 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 TV=vt("Badge",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}]]);/** 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 MV=vt("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"}]]);/** 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 PV=vt("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/** 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 RV=vt("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"}]]);/** 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 Ll=vt("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"}]]);/** 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 up=vt("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}
90],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** 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 ka=vt("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]]);/** 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 o1=vt("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"}]]);/** 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 BV=vt("CalendarPlus",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 13V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8",key:"3spt84"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M16 19h6",key:"xwg31i"}],["path",{d:"M19 16v6",key:"tddt3s"}]]);/** 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 Br=vt("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"}]]);/** 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 un=vt("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 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 fd=vt("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 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 hC=vt("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** 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 Ih=vt("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 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 LV=vt("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 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 Ts=vt("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** 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 Or=vt("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 IV=vt("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"}]]);/** 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 Kg=vt("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"}]]);/** 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 Yy=vt("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/** 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 Hl=vt("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 QM=vt("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 rn=vt("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 tv=vt("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** 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 Ii=vt("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/** 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 Jg=vt("Crop",[["path",{d:"M6 2v14a2 2 0 0 0 2 2h14",key:"ron5a4"}],["path",{d:"M18 22V8a2 2 0 0 0-2-2H2",key:"7s9ehn"}]]);/** 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 OV=vt("DatabaseBackup",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 12a9 3 0 0 0 5 2.69",key:"1ui2ym"}],["path",{d:"M21 9.3V5",key:"6k6cib"}],["path",{d:"M3 5v14a9 3 0 0 0 6.47 2.88",key:"i62tjy"}],["path",{d:"M12 12v4h4",key:"1bxaet"}],["path",{d:"M13 20a5 5 0 0 0 9-3 4.5 4.5 0 0 0-4.5-4.5c-1.33 0-2.54.54-3.41 1.41L12 16",key:"1f4ei9"}]]);/** 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 zV=vt("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** 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 yu=vt("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/** 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 e6=vt("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"}]]);/** 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 mC=vt("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** 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 wx=vt("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"}]]);/** 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 Py=vt("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"}]]);/** 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 Xs=vt("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"}]]);/** 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 fw=vt("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]);/** 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 x2=vt("FileSpreadsheet",[["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:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]);/** 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 ti=vt("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"}]]);/** 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 Yg=vt("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** 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 Io=vt("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]);/** 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 Bc=vt("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"}]]);/** 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 Zy=vt("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"}]]);/** 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 t6=vt("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** 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 iF=vt("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"}]]);/** 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 r6=vt("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"}]]);/** 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 UV=vt("ImagePlus",[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]);/** 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 vi=vt("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** 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 s6=vt("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** 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 fC=vt("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);/** 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 HV=vt("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/** 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 $V=vt("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** 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 dp=vt("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/** 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 pC=vt("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]);/** 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 WV=vt("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/** 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 Mt=vt("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 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 Xy=vt("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"}]]);/** 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 gC=vt("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"}]]);/** 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 xC=vt("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"}]]);/** 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 fs=vt("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"}]]);/** 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 _n=vt("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"}]]);/** 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 qV=vt("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"}]]);/** 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 n6=vt("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"}]]);/** 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 pw=vt("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"}]]);/** 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 yC=vt("Newspaper",[["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2",key:"7pis2x"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M10 6h8v4h-8V6Z",key:"smlsk5"}]]);/** 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 bu=vt("Pen",[["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"}]]);/** 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 l1=vt("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"}]]);/** 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 a6=vt("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]);/** 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 wi=vt("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** 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 vs=vt("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** 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 uE=vt("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"}]]);/** 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 Pl=vt("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"}]]);/** 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 dE=vt("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"}]]);/** 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 hp=vt("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"}]]);/** 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 GV=vt("School",[["path",{d:"M14 22v-4a2 2 0 1 0-4 0v4",key:"hhkicm"}],["path",{d:"m18 10 3.447 1.724a1 1 0 0 1 .553.894V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-7.382a1 1 0 0 1 .553-.894L6 10",key:"1xqip1"}],["path",{d:"M18 5v17",key:"1sw6gf"}],["path",{d:"m4 6 7.106-3.553a2 2 0 0 1 1.788 0L20 6",key:"9d2ml
425k"}],["path",{d:"M6 5v17",key:"1xfsm0"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}]]);/** 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 zl=vt("Scissors",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]);/** 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 VV=vt("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/** 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 KV=vt("SearchX",[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 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 Uc=vt("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 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 y2=vt("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"}]]);/** 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 jd=vt("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"}]]);/** 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 bC=vt("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"}]]);/** 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 JV=vt("ShieldCheck",[["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",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 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 YV=vt("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
470y:"oel41y"}]]);/** 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 i6=vt("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]);/** 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 zs=vt("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** 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 ri=vt("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/** 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 ji=vt("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"}]]);/** 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 ZV=vt("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** 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 vr=vt("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"}]]);/** 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 XV=vt("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"}]]);/** 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 yd=vt("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"}]]);/** 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 gw=vt("Twitter",[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]]);/** 516 * @license lucide-react v0.462.0 - ISC 517 * 518 * This source code is licensed under the ISC license. 519 * See the LICENSE file in the root directory of this source tree. 520 */const QV=vt("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);/** 521 * @license lucide-react v0.462.0 - ISC 522 * 523 * This source code is licensed under the ISC license. 524 * See the LICENSE file in the root directory of this source tree. 525 */const vn=vt("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"}]]);/** 526 * @license lucide-react v0.462.0 - ISC 527 * 528 * This source code is licensed under the ISC license. 529 * See the LICENSE file in the root directory of this source tree. 530 */const o6=vt("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,469 bytes, lines 530-570
530],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/** 531 * @license lucide-react v0.462.0 - ISC 532 * 533 * This source code is licensed under the ISC license. 534 * See the LICENSE file in the root directory of this source tree. 535 */const vC=vt("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"}]]);/** 536 * @license lucide-react v0.462.0 - ISC 537 * 538 * This source code is licensed under the ISC license. 539 * See the LICENSE file in the root directory of this source tree. 540 */const eK=vt("UserX",[["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:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]);/** 541 * @license lucide-react v0.462.0 - ISC 542 * 543 * This source code is licensed under the ISC license. 544 * See the LICENSE file in the root directory of this source tree. 545 */const ma=vt("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"}]]);/** 546 * @license lucide-react v0.462.0 - ISC 547 * 548 * This source code is licensed under the ISC license. 549 * See the LICENSE file in the root directory of this source tree. 550 */const Os=vt("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"}]]);/** 551 * @license lucide-react v0.462.0 - ISC 552 * 553 * This source code is licensed under the ISC license. 554 * See the LICENSE file in the root directory of this source tree. 555 */const tK=vt("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** 556 * @license lucide-react v0.462.0 - ISC 557 * 558 * This source code is licensed under the ISC license. 559 * See the LICENSE file in the root directory of this source tree. 560 */const Ir=vt("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** 561 * @license lucide-react v0.462.0 - ISC 562 * 563 * This source code is licensed under the ISC license. 564 * See the LICENSE file in the root directory of this source tree. 565 */const rK=vt("Youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]);/** 566 * @license lucide-react v0.462.0 - ISC 567 * 568 * This source code is licensed under the ISC license. 569 * See the LICENSE file in the root directory of this source tree. 570 */const sK=vt("ZoomIn",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),wC="-",nK=t=>{const e=iK(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:o=>{const l=o.split(wC);return l[0]===""&&l.length!==1&&l.shift(),l6(l,e)||aK(o)},getConflictingClassGroupIds:(o,l)=>{const c=r[o]||[];return l&&n[o]?[...c,...n[o]]:c}}},l6=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const r=t[0],n=e.nextPart.get(r),a=n?l6(t.slice(1),n):void 0;if(a)return a;if(e.validators.length===0)return;const i=t.join(wC);return(o=e.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},hE=/^\[(.+)\]$/,aK=t=>{if(hE.test(t)){const e=hE.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},iK=t=>{const{theme:e,prefix:r}=t,n={nextPart:new Map,validators:[]};return lK(Object.entries(t.classGroups),r).forEach(([i,o])=>{oF(o,n,i,e)}),n},oF=(t,e,r,n)=>{t.forEach(a=>{if(typeof a=="string"){const i=a===""?e:mE(e,a);i.classGroupId=r;return}if(typeof a=="function"){if(oK(a)){oF(a(n),e,r,n);return}e.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([i,o])=>{oF(o,mE(e,i),r,n)})})},mE=(t,e)=>{let r=t;return e.split(wC).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},oK=t=>t.isThemeGetter,lK=(t,e)=>e?t.map(([r,n])=>{const a=n.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[e+o,l])):i);return[r,a]}):t,cK=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,n=new Map;const a=(i,o)=>{r.set(i,o),e++,e>t&&(e=0,n=r,r=new Map)};return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return a(i,o),o},set(i,o){r.has(i)?r.set(i,o):a(i,o)}}},c6="!",uK=t=>{const{separator:e,experimentalParseClassName:r}=t,n=e.length===1,a=e[0],i=e.length,o=l=>{const c=[];let u=0,d=0,h;for(let b=0;b<l.length;b++){let w=l[b];if(u===0){if(w===a&&(n||l.slice(b,b+i)===e)){c.push(l.slice(d,b)),d=b+i;continue}if(w==="/"){h=b;continue}}w==="["?u++:w==="]"&&u--}const f=c.length===0?l:l.substring(d),m=f.startsWith(c6),g=m?f.substring(1):f,y=h&&h>d?h-d:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:y}};return r?l=>r({className:l,parseClassName:o}):o},dK=t=>{if(t.length<=1)return t;const e=[];let r=[];return t.forEach(n=>{n[0]==="["?(e.push(...r.sort(),n),r=[]):r.push(n)}),e.push(...r.sort()),e},hK=t=>({cache:cK(t.cacheSize),parseClassName:uK(t),...nK(t)}),mK=/\s+/,fK=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a}=e,i=[],o=t.trim().split(mK);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:d,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:m}=r(u);let g=!!m,y=n(g?f.substring(0,m):f);if(!y){if(!g){l=u+(l.length>0?" "+l:l);continue}if(y=n(f),!y){l=u+(l.length>0?" "+l:l);continue}g=!1}const b=dK(d).join(":"),w=h?b+c6:b,j=w+y;if(i.includes(j))continue;i.push(j);const N=a(y,g);for(let S=0;S<N.length;++S){const E=N[S];i.push(w+E)}l=u+(l.length>0?" "+l:l)}return l};function pK(){let t=0,e,r,n="";for(;t<arguments.length;)(e=arguments[t++])&&(r=u6(e))&&(n&&(n+=" "),n+=r);return n}const u6=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=u6(t[n]))&&(r&&(r+=" "),r+=e);return r};function gK(t,...e){let r,n,a,i=o;function o(c){const u=e.reduce((d,h)=>h(d),t());return r=hK(u),n=r.cache.get,a=r.cache.set,i=l,l(c)}function l(c){const u=n(c);if(u)return u;const d=fK(c,r);return a(c,d),d}return function(){return i(pK.apply(null,arguments))}}const yn=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},d6=/^\[(?:([a-z-]+):)?(.+)\]$/i,xK=/^\d+\/\d+$/,yK=new Set(["px","full","screen"]),bK=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,vK=/\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$/,wK=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,jK=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,NK=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ed=t=>Ng(t)||yK.has(t)||xK.test(t),uh=t=>jx(t,"length",DK),Ng=t=>!!t&&!Number.isNaN(Number(t)),b2=t=>jx(t,"number",Ng),cy=t=>!!t&&Number.isInteger(Number(t)),FK=t=>t.endsWith("%")&&Ng(t.slice(0,-1)),is=t=>d6.test(t),dh=t=>bK.test(t),SK=new Set(["length","size","percentage"]),CK=t=>jx(t,SK,h6),kK=t=>jx(t,"position",h6),_K=new Set(["image","url"]),EK=t=>jx(t,_K,MK),AK=t=>jx(t,"",TK),uy=()=>!0,jx=(t,e,r)=>{const n=d6.exec(t);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):r(n[2]):!1},DK=t=>vK.test(t)&&!wK.test(t),h6=()=>!1,TK=t=>jK.test(t),MK=t=>NK.test(t),PK=()=>{const t=yn("colors"),e=yn("spacing"),r=yn("blur"),n=yn("brightness"),a=yn("borderColor"),i=yn("borderRadius"),o=yn("borderSpacing"),l=yn("borderWidth"),c=yn("contrast"),u=yn("grayscale"),d=yn("hueRotate"),h=yn("invert"),f=yn("gap"),m=yn("gradientColorStops"),g=yn("gradientColorStopPositions"),y=yn("inset"),b=yn("margin"),w=yn("opacity"),j=yn("padding"),N=yn("saturate"),S=yn("scale"),E=yn("sepia"),C=yn("skew"),T=yn("space"),D=yn("translate"),A=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",is,e],P=()=>[is,e],U=()=>["",ed,uh],I=()=>["auto",Ng,is],O=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],
vendor: 12,547 bytes, line 570
570V=()=>["solid","dashed","dotted","double","none"],G=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],B=()=>["start","end","center","between","around","evenly","stretch"],$=()=>["","0",is],W=()=>["auto","avoid","all","avoid-page","page","left","right","column"],oe=()=>[Ng,is];return{cacheSize:500,separator:":",theme:{colors:[uy],spacing:[ed,uh],blur:["none","",dh,is],brightness:oe(),borderColor:[t],borderRadius:["none","","full",dh,is],borderSpacing:P(),borderWidth:U(),contrast:oe(),grayscale:$(),hueRotate:oe(),invert:$(),gap:P(),gradientColorStops:[t],gradientColorStopPositions:[FK,uh],inset:M(),margin:M(),opacity:oe(),padding:P(),saturate:oe(),scale:oe(),sepia:$(),skew:oe(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",is]}],container:["container"],columns:[{columns:[dh]}],"break-after":[{"break-after":W()}],"break-before":[{"break-before":W()}],"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:[...O(),is]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",cy,is]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",is]}],grow:[{grow:$()}],shrink:[{shrink:$()}],order:[{order:["first","last","none",cy,is]}],"grid-cols":[{"grid-cols":[uy]}],"col-start-end":[{col:["auto",{span:["full",cy,is]},is]}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":[uy]}],"row-start-end":[{row:["auto",{span:[cy,is]},is]}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",is]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",is]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...B()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...B(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...B(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[j]}],px:[{px:[j]}],py:[{py:[j]}],ps:[{ps:[j]}],pe:[{pe:[j]}],pt:[{pt:[j]}],pr:[{pr:[j]}],pb:[{pb:[j]}],pl:[{pl:[j]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"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",is,e]}],"min-w":[{"min-w":[is,e,"min","max","fit"]}],"max-w":[{"max-w":[is,e,"none","full","min","max","fit","prose",{screen:[dh]},dh]}],h:[{h:[is,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[is,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[is,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[is,e,"auto","min","max","fit"]}],"font-size":[{text:["base",dh,uh]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",b2]}],"font-family":[{font:[uy]}],"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",is]}],"line-clamp":[{"line-clamp":["none",Ng,b2]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ed,is]}],"list-image":[{"list-image":["none",is]}],"list-style-type":[{list:["none","disc","decimal",is]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...V(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ed,uh]}],"underline-offset":[{"underline-offset":["auto",ed,is]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",is]}],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",is]}],"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:[...O(),kK]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",CK]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},EK]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"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:[...V(),"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:V()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...V()]}],"outline-offset":[{"outline-offset":[ed,is]}],"outline-w":[{outline:[ed,uh]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[ed,uh]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",dh,AK]}],"shadow-color":[{shadow:[uy]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...G(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":G()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",dh,is]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[N]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[N]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",is]}],duration:[{duration:oe()}],ease:[{ease:["linear","in","out","in-out",is]}],delay:[{delay:oe()}],animate:[{animate:["none","spin","ping","pulse","bounce",is]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[S]}],"scale-x":[{"scale-x":[S]}],"scale-y":[{"scale-y":[S]}],rotate:[{rotate:[cy,is]}],"translate-x":[{"translate-x":[D]}],"translate-y":[{"translate-y":[D]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",is]}],accent:[{accent:["auto",t]}],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",is]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"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"]}],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",is]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[ed,uh,b2]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","
570none"]}]},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"]}}},RK=gK(PK);function xt(...t){return RK(ZM(t))}const BK=kV,m6=x.forwardRef(({className:t,...e},r)=>s.jsx(WM,{ref:r,className:xt("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]",t),...e}));m6.displayName=WM.displayName;const LK=cp("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"}}),f6=x.forwardRef(({className:t,variant:e,...r},n)=>s.jsx(qM,{ref:n,className:xt(LK({variant:e}),t),...r}));f6.displayName=qM.displayName;const IK=x.forwardRef(({className:t,...e},r)=>s.jsx(KM,{ref:r,className:xt("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 hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...e}));IK.displayName=KM.displayName;const p6=x.forwardRef(({className:t,...e},r)=>s.jsx(JM,{ref:r,className:xt("absolute right-2 top-2 rounded-md p-1 text-foreground
570/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:s.jsx(Ir,{className:"h-4 w-4"})}));p6.displayName=JM.displayName;const g6=x.forwardRef(({className:t,...e},r)=>s.jsx(GM,{ref:r,className:xt("text-sm font-semibold",t),...e}));g6.displayName=GM.displayName;const x6=x.forwardRef(({className:t,...e},r)=>s.jsx(VM,{ref:r,className:xt("text-sm opacity-90",t),...e}));x6.displayName=VM.displayName;function OK(){const{toasts:t}=St();return s.jsxs(BK,{children:[t.map(function({id:e,title:r,description:n,action:a,...i}){return s.jsxs(f6,{...i,children:[s.jsxs("div",{className:"grid gap-1",children:[r&&s.jsx(g6,{children:r}),n&&s.jsx(x6,{children:n})]}),a,s.jsx(p6,{})]},e)}),s.jsx(m6,{})]})}var fE=["light","dark"],zK="(prefers-color-scheme: dark)",UK=x.createContext(void 0),HK={setTheme:t=>{},themes:[]},$K=()=>{var t;return(t=x.useContext(UK))!=null?t:HK};x.memo(({forcedTheme:t,storageKey:e,attribute:r,enableSystem:n,enableColorScheme:a,defaultTheme:i,value:o,attrs:l,nonce:c})=>{let u=i==="system",d=r==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(g=>`'${g}'`).join(",")})`};`:`var d=document.documentElement,n='${r}',s='setAttribute';`,h=a?fE.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(g,y=!1,b=!0)=>{let w=o?o[g]:g,j=y?g+"|| ''":`'${w}'`,N="";return a&&b&&!y&&fE.includes(g)&&(N+=`d.style.colorScheme = '${g}';`),r==="class"?y||w?N+=`c.add(${j})`:N+="null":w&&(N+=`d[s](n,${j})`),N},m=t?`!function(){${d}${f(t)}}()`:n?`!function(){try{${d}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${u})){var t='${zK}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}${u?"":"else{"+f(i,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${e}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}else{${f(i,!1,!1)};}${h}}catch(t){}}();`;return x.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:m}})});var WK=t=>{switch(t){case"success":return VK;case"info":return JK;case"warning":return KK;case"error":return YK;default:return null}},qK=Array(12).fill(0),GK=({visible:t,className:e})=>Oe.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},Oe.createElement("div",{className:"sonner-spinner"},qK.map((r,n)=>Oe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),VK=Oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Oe.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"})),KK=Oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Oe.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"})),JK=Oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Oe.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"})),YK=Oe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Oe.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"})),ZK=Oe.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"},Oe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Oe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),XK=()=>{let[t,e]=Oe.useState(document.hidden);return Oe.useEffect(()=>{let r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t},lF=1,QK=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let r=this.subscribers.indexOf(e);this.subscribers.splice(r,1)}),this.publish=e=>
570{this.subscribers.forEach(r=>r(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var r;let{message:n,...a}=e,i=typeof(e==null?void 0:e.id)=="number"||((r=e.id)==null?void 0:r.length)>0?e.id:lF++,o=this.toasts.find(c=>c.id===i),l=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),o?this.toasts=this.toasts.map(c=>c.id===i?(this.publish({...c,...e,id:i,title:n}),{...c,...e,id:i,dismissible:l,title:n}):c):this.addToast({title:n,...a,dismissible:l,id:i}),i},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),this.subscribers.forEach(r=>r({id:e,dismiss:!0})),e),this.message=(e,r)=>this.create({...r,message:e}),this.error=(e,r)=>this.create({...r,message:e,type:"error"}),this.success=(e,r)=>this.create({...r,type:"success",message:e}),this.info=(e,r)=>this.create({...r,type:"info",message:e}),this.warning=(e,r)=>this.create({...r,type:"warning",message:e}),this.loading=(e,r)=>this.create({...r,type:"loading",message:e}),this.promise=(e,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:e,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));let a=e instanceof Promise?e:e(),i=n!==void 0,o,l=a.then(async u=>{if(o=["resolve",u],Oe.isValidElement(u))i=!1,this.create({id:n,type:"default",message:u});else if(tJ(u)&&!u.ok){i=!1;let d=typeof r.error=="function"?await r.error(`HTTP error! status: ${u.status}`):r.error,h=typeof r.description=="function"?await r.description(`HTTP error! status: ${u.status}`):r.description;this.create({id:n,type:"error",message:d,description:h})}else if(r.success!==void 0){i=!1;let d=typeof r.success=="function"?await r.success(u):r.success,h=typeof r.description=="function"?await r.description(u):r.description;this.create({id:n,type:"success",message:d,description:h})}}).catch(async u=>{if(o=["reject",u],r.error!==void 0){i=!1;let d=typeof r.error=="function"?await r.error(u):r.error,h=typeof r.description=="function"?await r.description(u):r.description;this.create({id:n,type:"error",message:d,description:h})}}).finally(()=>{var u;i&&(this.dismiss(n),n=void 0),(u=r.finally)==null||u.call(r)}),c=()=>new Promise((u,d)=>l.then(()=>o[0]==="reject"?d(o[1]):u(o[1])).catch(d));return typeof n!="string"&&typeof n!="number"?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,r)=>{let n=(r==null?void 0:r.id)||lF++;return this.create({jsx:e(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},To=new QK,eJ=(t,e)=>{let r=(e==null?void 0:e.id)||lF++;return To.addToast({title:t,...e,id:r}),r},tJ=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",rJ=eJ,sJ=()=>To.toasts,nJ=()=>To.getActiveToasts(),ct=Object.assign(rJ,{success:To.success,info:To.info,warning:To.warning,error:To.error,custom:To.custom,message:To.message,promise:To.promise,dismiss:To.dismiss,loading:To.loading},{getHistory:sJ,getToasts:nJ});function aJ(t,{insertAt:e}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}aJ(`: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;
570left: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}
570: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%);
570--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%)} 571`);function rv(t){return t.label!==void 0}var iJ=3,oJ="32px",lJ="16px",pE=4e3,cJ=356,uJ=14,dJ=20,hJ=200;function Nc(...t){return t.filter(Boolean).join(" ")}function mJ(t){let[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}var fJ=t=>{var e,r,n,a,i,o,l,c,u,d,h;let{invert:f,toast:m,unstyled:g,interacting:y,setHeights:b,visibleToasts:w,heights:j,index:N,toasts:S,expanded:E,removeToast:C,defaultRichColors:T,closeButton:D,style:A,cancelButtonStyle:R,actionButtonStyle:M,className:P="",descriptionClassName:U="",duration:I,position:O,gap:V,loadingIcon:G,expandByDefault:B,classNames:$,icons:W,closeButtonAriaLabel:oe="Close toast",pauseWhenPageIsHidden:K}=t,[H,X]=Oe.useState(null),[me,ie]=Oe.useState(null),[ee,he]=Oe.useState(!1),[ve,Ce]=Oe.useState(!1),[re,we]=Oe.useState(!1),[Ee,Me]=Oe.useState(!1),[ae,ze]=Oe.useState(!1),[mt,tt]=Oe.useState(0),[Xe,Ft]=Oe.useState(0),ce=Oe.useRef(m.duration||I||pE),fe=Oe.useRef(null),ge=Oe.useRef(null),Ge=N===0,Je=N+1<=w,be=m.type,Pe=m.dismissible!==!1,qe=m.className||"",Qe=m.descriptionClassName||"",We=Oe.useMemo(()=>j.findIndex(Er=>Er.toastId===m.id)||0,[j,m.id]),dt=Oe.useMemo(()=>{var Er;return(Er=m.closeButton)!=null?Er:D},[m.closeButton,D]),Bt=Oe.useMemo(()=>m.duration||I||pE,[m.duration,I]),Lt=Oe.useRef(0),Vt=Oe.useRef(0),cr=Oe.useRef(0),wr=Oe.useRef(null),[Xt,pt]=O.split("-"),ir=Oe.useMemo(()=>j.reduce((Er,Ur,ws)=>ws>=We?Er:Er+Ur.height,0),[j,We]),jr=XK(),rs=m.invert||f,zr=be==="loading";Vt.current=Oe.useMemo(()=>We*V+ir,[We,ir]),Oe.useEffect(()=>{ce.current=Bt},[Bt]),Oe.useEffect(()=>{he(!0)},[]),Oe.useEffect(()=>{let Er=ge.current;if(Er){let Ur=Er.getBoundingClientRect().height;return Ft(Ur),b(ws=>[{toastId:m.id,height:Ur,position:m.position},...ws]),()=>b(ws=>ws.filter(wn=>wn.toastId!==m.id))}},[b,m.id]),Oe.useLayoutEffect(()=>{if(!ee)return;let Er=ge.current,Ur=Er.style.height;Er.style.height="auto";let ws=Er.getBoundingClientRect().height;Er.style.height=Ur,Ft(ws),b(wn=>wn.find(hr=>hr.toastId===m.id)?wn.map(hr=>hr.toastId===m.id?{...hr,height:ws}:hr):[{toastId:m.id,height:ws,position:m.position},...wn])},[ee,m.title,m.description,b,m.id]);let xr=Oe.useCallback(()=>{Ce(!0),tt(Vt.current),b(Er=>Er.filter(Ur=>Ur.toastId!==m.id)),setTimeout(()=>{C(m)},hJ)},[m,C,b,Vt]);Oe.useEffect(()=>{if(m.promise&&be==="loading"||m.duration===1/0||m.type==="loading")return;let Er;return E||y||K&&jr?(()=>{if(cr.current<Lt.current){let Ur=new Date().getTime()-Lt.current;ce.current=ce.current-Ur}
571cr.current=new Date().getTime()})():ce.current!==1/0&&(Lt.current=new Date().getTime(),Er=setTimeout(()=>{var Ur;(Ur=m.onAutoClose)==null||Ur.call(m,m),xr()},ce.current)),()=>clearTimeout(Er)},[E,y,m,be,K,jr,xr]),Oe.useEffect(()=>{m.delete&&xr()},[xr,m.delete]);function Ds(){var Er,Ur,ws;return W!=null&&W.loading?Oe.createElement("div",{className:Nc($==null?void 0:$.loader,(Er=m==null?void 0:m.classNames)==null?void 0:Er.loader,"sonner-loader"),"data-visible":be==="loading"},W.loading):G?Oe.createElement("div",{className:Nc($==null?void 0:$.loader,(Ur=m==null?void 0:m.classNames)==null?void 0:Ur.loader,"sonner-loader"),"data-visible":be==="loading"},G):Oe.createElement(GK,{className:Nc($==null?void 0:$.loader,(ws=m==null?void 0:m.classNames)==null?void 0:ws.loader),visible:be==="loading"})}return Oe.createElement("li",{tabIndex:0,ref:ge,className:Nc(P,qe,$==null?void 0:$.toast,(e=m==null?void 0:m.classNames)==null?void 0:e.toast,$==null?void 0:$.default,$==null?void 0:$[be],(r=m==null?void 0:m.classNames)==null?void 0:r[be]),"data-sonner-toast":"","data-rich-colors":(n=m.richColors)!=null?n:T,"data-styled":!(m.jsx||m.unstyled||g),"data-mounted":ee,"data-promise":!!m.promise,"data-swiped":ae,"data-removed":ve,"data-visible":Je,"data-y-position":Xt,"data-x-position":pt,"data-index":N,"data-front":Ge,"data-swiping":re,"data-dismissible":Pe,"data-type":be,"data-invert":rs,"data-swipe-out":Ee,"data-swipe-direction":me,"data-expanded":!!(E||B&&ee),style:{"--index":N,"--toasts-before":N,"--z-index":S.length-N,"--offset":`${ve?mt:Vt.current}px`,"--initial-height":B?"auto":`${Xe}px`,...A,...m.style},onDragEnd:()=>{we(!1),X(null),wr.current=null},onPointerDown:Er=>{zr||!Pe||(fe.current=new Date,tt(Vt.current),Er.target.setPointerCapture(Er.pointerId),Er.target.tagName!=="BUTTON"&&(we(!0),wr.current={x:Er.clientX,y:Er.clientY}))},onPointerUp:()=>{var Er,Ur,ws,wn;if(Ee||!Pe)return;wr.current=null;let hr=Number(((Er=ge.current)==null?void 0:Er.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ga=Number(((Ur=ge.current)==null?void 0:Ur.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Jn=new Date().getTime()-((ws=fe.current)==null?void 0:ws.getTime()),dn=H==="x"?hr:ga,gn=Math.abs(dn)/Jn;if(Math.abs(dn)>=dJ||gn>.11){tt(Vt.current),(wn=m.onDismiss)==null||wn.call(m,m),ie(H==="x"?hr>0?"right":"left":ga>0?"down":"up"),xr(),Me(!0),ze(!1);return}we(!1),X(null)},onPointerMove:Er=>{var Ur,ws,wn,hr;if(!wr.current||!Pe||((Ur=window.getSelection())==null?void 0:Ur.toString().length)>0)return;let ga=Er.clientY-wr.current.y,Jn=Er.clientX-wr.current.x,dn=(ws=t.swipeDirections)!=null?ws:mJ(O);!H&&(Math.abs(Jn)>1||Math.abs(ga)>1)&&X(Math.abs(Jn)>Math.abs(ga)?"x":"y");let gn={x:0,y:0};H==="y"?(dn.includes("top")||dn.includes("bottom"))&&(dn.includes("top")&&ga<0||dn.includes("bottom")&&ga>0)&&(gn.y=ga):H==="x"&&(dn.includes("left")||dn.includes("right"))&&(dn.includes("left")&&Jn<0||dn.includes("right")&&Jn>0)&&(gn.x=Jn),(Math.abs(gn.x)>0||Math.abs(gn.y)>0)&&ze(!0),(wn=ge.current)==null||wn.style.setProperty("--swipe-amount-x",`${gn.x}px`),(hr=ge.current)==null||hr.style.setProperty("--swipe-amount-y",`${gn.y}px`)}},dt&&!m.jsx?Oe.createElement("button",{"aria-label":oe,"data-disabled":zr,"data-close-button":!0,onClick:zr||!Pe?()=>{}:()=>{var Er;xr(),(Er=m.onDismiss)==null||Er.call(m,m)},className:Nc($==null?void 0:$.closeButton,(a=m==null?void 0:m.classNames)==null?void 0:a.closeButton)},(i=W==null?void 0:W.close)!=null?i:ZK):null,m.jsx||x.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:Oe.createElement(Oe.Fragment,null,be||m.icon||m.promise?Oe.createElement("div",{"data-icon":"",className:Nc($==null?void 0:$.icon,(o=m==null?void 0:m.classNames)==null?void 0:o.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||Ds():null,m.type!=="loading"?m.
vendor: 6,573 bytes, line 571
571icon||(W==null?void 0:W[be])||WK(be):null):null,Oe.createElement("div",{"data-content":"",className:Nc($==null?void 0:$.content,(l=m==null?void 0:m.classNames)==null?void 0:l.content)},Oe.createElement("div",{"data-title":"",className:Nc($==null?void 0:$.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?Oe.createElement("div",{"data-description":"",className:Nc(U,Qe,$==null?void 0:$.description,(u=m==null?void 0:m.classNames)==null?void 0:u.description)},typeof m.description=="function"?m.description():m.description):null),x.isValidElement(m.cancel)?m.cancel:m.cancel&&rv(m.cancel)?Oe.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||R,onClick:Er=>{var Ur,ws;rv(m.cancel)&&Pe&&((ws=(Ur=m.cancel).onClick)==null||ws.call(Ur,Er),xr())},className:Nc($==null?void 0:$.cancelButton,(d=m==null?void 0:m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,x.isValidElement(m.action)?m.action:m.action&&rv(m.action)?Oe.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||M,onClick:Er=>{var Ur,ws;rv(m.action)&&((ws=(Ur=m.action).onClick)==null||ws.call(Ur,Er),!Er.defaultPrevented&&xr())},className:Nc($==null?void 0:$.actionButton,(h=m==null?void 0:m.classNames)==null?void 0:h.actionButton)},m.action.label):null))};function gE(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function pJ(t,e){let r={};return[t,e].forEach((n,a)=>{let i=a===1,o=i?"--mobile-offset":"--offset",l=i?lJ:oJ;function c(u){["top","right","bottom","left"].forEach(d=>{r[`${o}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof n=="number"||typeof n=="string"?c(n):typeof n=="object"?["top","right","bottom","left"].forEach(u=>{n[u]===void 0?r[`${o}-${u}`]=l:r[`${o}-${u}`]=typeof n[u]=="number"?`${n[u]}px`:n[u]}):c(l)}),r}var gJ=x.forwardRef(function(t,e){let{invert:r,position:n="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:o,className:l,offset:c,mobileOffset:u,theme:d="light",richColors:h,duration:f,style:m,visibleToasts:g=iJ,toastOptions:y,dir:b=gE(),gap:w=uJ,loadingIcon:j,icons:N,containerAriaLabel:S="Notifications",pauseWhenPageIsHidden:E}=t,[C,T]=Oe.useState([]),D=Oe.useMemo(()=>Array.from(new Set([n].concat(C.filter(K=>K.position).map(K=>K.position)))),[C,n]),[A,R]=Oe.useState([]),[M,P]=Oe.useState(!1),[U,I]=Oe.useState(!1),[O,V]=Oe.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),G=Oe.useRef(null),B=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),$=Oe.useRef(null),W=Oe.useRef(!1),oe=Oe.useCallback(K=>{T(H=>{var X;return(X=H.find(me=>me.id===K.id))!=null&&X.delete||To.dismiss(K.id),H.filter(({id:me})=>me!==K.id)})},[]);return Oe.useEffect(()=>To.subscribe(K=>{if(K.dismiss){T(H=>H.map(X=>X.id===K.id?{...X,delete:!0}:X));return}setTimeout(()=>{cw.flushSync(()=>{T(H=>{let X=H.findIndex(me=>me.id===K.id);return X!==-1?[...H.slice(0,X),{...H[X],...K},...H.slice(X+1)]:[K,...H]})})})}),[]),Oe.useEffect(()=>{if(d!=="system"){V(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?V("dark"):V("light")),typeof window>"u")return;let K=window.matchMedia("(prefers-color-scheme: dark)");try{K.addEventListener("change",({matches:H})=>{V(H?"dark":"light")})}catch{K.addListener(({matches:X})=>{try{V(X?"dark":"light")}catch(me){console.error(me)}})}},[d]),Oe.useEffect(()=>{C.length<=1&&P(!1)},[C]),Oe.useEffect(()=>{let K=H=>{var X,me;a.every(ie=>H[ie]||H.code===ie)&&(P(!0),(X=G.current)==null||X.focus()),H.code==="Escape"&&(document.activeElement===G.current||(me=G.current)!=null&&me.contains(document.activeElement))&&P(!1)};return document.addEventListener("keydown",K),()=>document.removeEventListener("keydown",K)},[a]),Oe.useEffect(()=>{if(G.current)return()=>{$.current&&($.current.focus({preventScroll:!0}),$.current=null,W.current=!1)}},[G.current]),Oe.createElement("section",{ref:e,"aria-label":`${S} ${B}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((K,H)=>{var X;let[me,ie]=K.split("-");return C.length?Oe.createElement("ol",{key:K,dir:b==="auto"?gE():b,tabIndex:-1,ref:G,className:l,"data-sonner-toaster":!0,"data-theme":O,"data-y-position":me,"data-lifted":M&&C.length>1&&!i,"data-x-position":ie,style:{"--front-toast-height":`${((X=A[0])==null?void 0:X.height)||0}px`,"--width":`${cJ}px`,"--gap":`${w}px`,...m,...pJ(c,u)},onBlur:ee=>{W.current&&!ee.currentTarget.contains(ee.relatedTarget)&&(W.current=!1,$.current&&($.current.focus({preventScroll:!0}),$.current=null))},onFocus:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||W.current||(W.current=!0,$.current=ee.relatedTarget)},onMouseEnter:()=>P(!0),onMouseMove:()=>P(!0),onMouseLeave:()=>{U||P(!1)},onDragEnd:()=>P(!1),onPointerDown:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||I(!0)},onPointerUp:()=>I(!1)},C.filter(ee=>!ee.position&&H===0||ee.position===K).map((ee,he)=>{var ve,Ce;return Oe.createElement(fJ,{key:ee.id,icons:N,index:he,toast:ee,defaultRichColors:h,duration:(ve=y==null?void 0:y.duration)!=null?ve:f,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:r,visibleToasts:g,closeButton:(Ce=y==null?void 0:y.closeButton)!=null?Ce:o,interacting:U,position:K,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,removeToast:oe,toasts:C.filter(re=>re.position==ee.position),heights:A.filter(re=>re.position==ee.position),setHeights:R,expandByDefault:i,gap:w,loadingIcon:j,expanded:M,pauseWhenPageIsHidden:E,swipeDirections:t.swipeDirections})})):null}))});const xJ=({...t})=>{const{theme:e="system"}=$K();return s.jsx(gJ,{theme:e,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"}},...t})};var yJ=uw[" useId ".trim().toString()]||(()=>{}),bJ=0;
vendor: 12,064 bytes, line 571
571function hl(t){const[e,r]=x.useState(yJ());return En(()=>{r(n=>n??String(bJ++))},[t]),e?`radix-${e}`:""}const vJ=["top","right","bottom","left"],rm=Math.min,ol=Math.max,c1=Math.round,sv=Math.floor,vu=t=>({x:t,y:t}),wJ={left:"right",right:"left",bottom:"top",top:"bottom"};function cF(t,e,r){return ol(t,rm(e,r))}function Nd(t,e){return typeof t=="function"?t(e):t}function Fd(t){return t.split("-")[0]}function Nx(t){return t.split("-")[1]}function jC(t){return t==="x"?"y":"x"}function NC(t){return t==="y"?"height":"width"}function pu(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function FC(t){return jC(pu(t))}function jJ(t,e,r){r===void 0&&(r=!1);const n=Nx(t),a=FC(t),i=NC(a);let o=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=u1(o)),[o,u1(o)]}function NJ(t){const e=u1(t);return[uF(t),e,uF(e)]}function uF(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const xE=["left","right"],yE=["right","left"],FJ=["top","bottom"],SJ=["bottom","top"];function CJ(t,e,r){switch(t){case"top":case"bottom":return r?e?yE:xE:e?xE:yE;case"left":case"right":return e?FJ:SJ;default:return[]}}function kJ(t,e,r,n){const a=Nx(t);let i=CJ(Fd(t),r==="start",n);return a&&(i=i.map(o=>o+"-"+a),e&&(i=i.concat(i.map(uF)))),i}function u1(t){const e=Fd(t);return wJ[e]+t.slice(e.length)}function _J(t){return{top:0,right:0,bottom:0,left:0,...t}}function y6(t){return typeof t!="number"?_J(t):{top:t,right:t,bottom:t,left:t}}function d1(t){const{x:e,y:r,width:n,height:a}=t;return{width:n,height:a,top:r,left:e,right:e+n,bottom:r+a,x:e,y:r}}function bE(t,e,r){let{reference:n,floating:a}=t;const i=pu(e),o=FC(e),l=NC(o),c=Fd(e),u=i==="y",d=n.x+n.width/2-a.width/2,h=n.y+n.height/2-a.height/2,f=n[l]/2-a[l]/2;let m;switch(c){case"top":m={x:d,y:n.y-a.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:h};break;case"left":m={x:n.x-a.width,y:h};break;default:m={x:n.x,y:n.y}}switch(Nx(e)){case"start":m[o]-=f*(r&&u?-1:1);break;case"end":m[o]+=f*(r&&u?-1:1);break}return m}async function EJ(t,e){var r;e===void 0&&(e={});const{x:n,y:a,platform:i,rects:o,elements:l,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:f=!1,padding:m=0}=Nd(e,t),g=y6(m),b=l[f?h==="floating"?"reference":"floating":h],w=d1(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(b)))==null||r?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),j=h==="floating"?{x:n,y:a,width:o.floating.width,height:o.floating.height}:o.reference,N=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),S=await(i.isElement==null?void 0:i.isElement(N))?await(i.getScale==null?void 0:i.getScale(N))||{x:1,y:1}:{x:1,y:1},E=d1(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:j,offsetParent:N,strategy:c}):j);return{top:(w.top-E.top+g.top)/S.y,bottom:(E.bottom-w.bottom+g.bottom)/S.y,left:(w.left-E.left+g.left)/S.x,right:(E.right-w.right+g.right)/S.x}}const AJ=50,DJ=async(t,e,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:i=[],platform:o}=r,l=o.detectOverflow?o:{...o,detectOverflow:EJ},c=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:a}),{x:d,y:h}=bE(u,n,c),f=n,m=0;const g={};for(let y=0;y<i.length;y++){const b=i[y];if(!b)continue;const{name:w,fn:j}=b,{x:N,y:S,data:E,reset:C}=await j({x:d,y:h,initialPlacement:n,placement:f,strategy:a,middlewareData:g,rects:u,platform:l,elements:{reference:t,floating:e}});d=N??d,h=S??h,g[w]={...g[w],...E},C&&m<AJ&&(m++,typeof C=="object"&&(C.placement&&(f=C.placement),C.rects&&(u=C.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:a}):C.rects),{x:d,y:h}=bE(u,f,c)),y=-1)}return{x:d,y:h,placement:f,strategy:a,middlewareData:g}},TJ=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:a,rects:i,platform:o,elements:l,middlewareData:c}=e,{element:u,padding:d=0}=Nd(t,e)||{};if(u==null)return{};const h=y6(d),f={x:r,y:n},m=FC(a),g=NC(m),y=await o.getDimensions(u),b=m==="y",w=b?"top":"left",j=b?"bottom":"right",N=b?"clientHeight":"clientWidth",S=i.reference[g]+i.reference[m]-f[m]-i.floating[g],E=f[m]-i.reference[m],C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let T=C?C[N]:0;(!T||!await(o.isElement==null?void 0:o.isElement(C)))&&(T=l.floating[N]||i.floating[g]);const D=S/2-E/2,A=T/2-y[g]/2-1,R=rm(h[w],A),M=rm(h[j],A),P=R,U=T-y[g]-M,I=T/2-y[g]/2+D,O=cF(P,I,U),V=!c.arrow&&Nx(a)!=null&&I!==O&&i.reference[g]/2-(I<P?R:M)-y[g]/2<0,G=V?I<P?I-P:I-U:0;return{[m]:f[m]+G,data:{[m]:O,centerOffset:I-O-G,...V&&{alignmentOffset:G}},reset:V}}}),MJ=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:a,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:u}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:y=!0,...b}=Nd(t,e);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const w=Fd(a),j=pu(l),N=Fd(l)===l,S=await(c.isRTL==null?void 0:c.isRTL(u.floating)),E=f||(N||!y?[u1(l)]:NJ(l)),C=g!=="none";!f&&C&&E.push(...kJ(l,y,g,S));const T=[l,...E],D=await c.detectOverflow(e,b),A=[];let R=((n=i.flip)==null?void 0:n.overflows)||[];if(d&&A.push(D[w]),h){const I=jJ(a,o,S);A.push(D[I[0]],D[I[1]])}if(R=[...R,{placement:a,overflows:A}],!A.every(I=>I<=0)){var M,P;const I=(((M=i.flip)==null?void 0:M.index)||0)+1,O=T[I];if(O&&(!(h==="alignment"?j!==pu(O):!1)||R.every(B=>pu(B.placement)===j?B.overflows[0]>0:!0)))return{data:{index:I,overflows:R},reset:{placement:O}};let V=(P=R.filter(G=>G.overflows[0]<=0).sort((G,B)=>G.overflows[1]-B.overflows[1])[0])==null?void 0:P.placement;if(!V)switch(m){case"bestFit":{var U;const G=(U=R.filter(B=>{if(C){const $=pu(B.placement);return $===j||$==="y"}return!0}).map(B=>[B.placement,B.overflows.filter($=>$>0).reduce(($,W)=>$+W,0)]).sort((B,$)=>B[1]-$[1])[0])==null?void 0:U[0];G&&(V=G);break}case"initialPlacement":V=l;break}if(a!==V)return{reset:{placement:V}}}return{}}}};function vE(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function wE(t){return vJ.some(e=>t[e]>=0)}const PJ=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r,platform:n}=e,{strategy:a="referenceHidden",...i}=Nd(t,e);switch(a){case"referenceHidden":{const o=await n.detectOverflow(e,{...i,elementContext:"reference"}),l=vE(o,r.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:wE(l)}}}case"escaped":{const o=await n.detectOverflow(e,{...i,altBoundary:!0}),l=vE(o,r.floating);return{data:{escapedOffsets:l,escaped:wE(l)}}}default:return{}}}}},b6=new Set(["left","top"]);async function RJ(t,e){const{placement:r,platform:n,elements:a}=t,i=await(n.isRTL==null?void 0:n.isRTL(a.floating)),o=Fd(r),l=Nx(r),c=pu(r)==="y",u=b6.has(o)?-1:1,d=i&&c?-1:1,h=Nd(e,t);let{mainAxis:f,crossAxis:m,alignmentAxis:g}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*d,y:f*u}:{x:f*u,y:m*d}}const BJ=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:a,y:i,placement:o,middlewareData:l}=e,c=await RJ(e,t);return o===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:o}}}}},LJ=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:a,platform:i}=e,{mainAxis:o=!0,crossAxis:l=!1,limiter:c={fn:w=>{let{x:j,y:N}=w;return{x:j,y:N}}},...u}=Nd(t,e),d={x:r,y:n},h=await i.detectOverflow(e,u),f=pu(Fd(a)),m=jC(f);let g=d[m],y=d[f];if(o){const w=m==="y"?"top":"left",j=m==="y"?"bottom":"right",N=g+h[w],S=g-h[j];g=cF(N,g,S)}if(l){const w=f==="y"?"top":"left",j=f==="y"?"bottom":"right",N=y+h[w],S=y-h[j];y=cF(N,y,S)}const b=c.fn({...e,[m]:g,[f]:y});return{...b,data:{x:b.x-r,y:b.y-n,enabled:{[m]:o,[f]:l}}}}}},IJ=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:a,rects:i,middlewareData:o}=e,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=Nd(t,e),d={x:r,y:n},h=pu(a),f=jC(h);let m=d[f],g=d[h];const y=Nd(l,e),b=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const N=f==="y"?"height":"width",S=i.reference[f]-i.floating[N]+b.mainAxis,E=i.reference[f]+i.reference[N]-b.mainAxis;m<S?m=S:m>E&&(m=E)}if(u){var w,j;const N=f==="y"?"width":"height",S=b6.has(Fd(a)),E=i.reference[h]-i.floating[N]+(S&&((w=o.offset)==null?void 0:w[h])||0)+(S?0:b.crossAxis),C=i.reference[h]+i.reference[N]+(S?0:((j=o.offset)==null?void 0:j[h])||0)-(S?b.crossAxis:0);g<E?g=E:g>C&&(g=C)}return{[f]:m,[h]:g}}}},OJ=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:a,rects:i,platform:o,elements:l}=e,{apply:c=()=>{},...u}=Nd(t,e),d=await o.detectOverflow(e,u),h=Fd(a),f=Nx(a),m=pu(a)==="y",{width:g,height:y}=i.floating;let b,w;h==="top"||h==="bottom"?(b=h,w=f===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(w=h,b=f==="end"?"top":"bottom");const j=y-d.top-d.bottom,N=g-d.left-d.right,S=rm(y-d[b],j),E=rm(g-d[w],N),C=!e.middlewareData.shift;let T=S,D=E;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(D=N),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(T=j),C&&!f){const R=ol(d.left,0),M=ol(d.right,0),P=ol(d.top,0),U=ol(d.bottom,0);m?D=g-2*(R!==0||M!==0?R+M:ol(d.left,d.right)):T=y-2*(P!==0||U!==0?P+U:ol(d.top,d.bottom))}await c({...e,availableWidth:D,availableHeight:T});const A=await o.getDimensions(l.floating);return g!==A.width||y!==A.height?{reset:{rects:!0}}:{}}}};function xw(){return typeof window<"u"}function Fx(t){return v6(t)?(t.nodeName||"").toLowerCase():"#document"}function ml(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Fu(t){var e;return(e=(v6(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function v6(t){return xw()?t instanceof Node||t instanceof ml(t).Node:!1}function Ic(t){return xw()?t instanceof Element||t instanceof ml(t).Element:!1}function Ad(t){return xw()?t instanceof HTMLElement||t instanceof ml(t).HTMLElement:!1}function jE(t){return!xw()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ml(t).ShadowRoot}function I0(t){const{overflow:e,overflowX:r,overflowY:n,display:a}=Oc(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&a!=="inline"&&a!=="contents"}function zJ(t){return/^(table|td|th)$/.test(Fx(t))}function yw(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const UJ=/transform|translate|scale|rotate|perspective|filter/,HJ=/paint|layout|strict|content/,of=t=>!!t&&t!=="none";let v2;function SC(t){const e=Ic(t)?Oc(t):t;return of(e.transform)||of(e.translate)||of(e.scale)||of(e.rotate)||of(e.perspective)||!CC()&&(of(e.backdropFilter)||of(e.filter))||UJ.test(e.willChange||"")||HJ.test(e.contain||"")}function $J(t){let e=sm(t);for(;Ad(e)&&!Zg(e);){if(SC(e))return e;if(yw(e))return null;e=sm(e)}return null}function CC(){return v2==null&&(v2=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),v2}function Zg(t){return/^(html|body|#document)$/.test(Fx(t))}function Oc(t){return ml(t).getComputedStyle(t)}function bw(t){return Ic(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function sm(t){if(Fx(t)==="html")return t;const e=t.assignedSlot||t.parentNode||jE(t)&&t.host||Fu(t);return jE(e)?e.host:e}function w6(t){const e=sm(t);return Zg(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ad(e)&&I0(e)?e:w6(e)}function Qy(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const a=w6(t),i=a===((n=t.ownerDocument)==null?void 0:n.body),o=ml(a);if(i){const l=dF(o);
vendor: 16,199 bytes, line 571
571return e.concat(o,o.visualViewport||[],I0(a)?a:[],l&&r?Qy(l):[])}else return e.concat(a,Qy(a,[],r))}function dF(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function j6(t){const e=Oc(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const a=Ad(t),i=a?t.offsetWidth:r,o=a?t.offsetHeight:n,l=c1(r)!==i||c1(n)!==o;return l&&(r=i,n=o),{width:r,height:n,$:l}}function kC(t){return Ic(t)?t:t.contextElement}function Fg(t){const e=kC(t);if(!Ad(e))return vu(1);const r=e.getBoundingClientRect(),{width:n,height:a,$:i}=j6(e);let o=(i?c1(r.width):r.width)/n,l=(i?c1(r.height):r.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const WJ=vu(0);function N6(t){const e=ml(t);return!CC()||!e.visualViewport?WJ:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function qJ(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==ml(t)?!1:e}function Hf(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const a=t.getBoundingClientRect(),i=kC(t);let o=vu(1);e&&(n?Ic(n)&&(o=Fg(n)):o=Fg(t));const l=qJ(i,r,n)?N6(i):vu(0);let c=(a.left+l.x)/o.x,u=(a.top+l.y)/o.y,d=a.width/o.x,h=a.height/o.y;if(i){const f=ml(i),m=n&&Ic(n)?ml(n):n;let g=f,y=dF(g);for(;y&&n&&m!==g;){const b=Fg(y),w=y.getBoundingClientRect(),j=Oc(y),N=w.left+(y.clientLeft+parseFloat(j.paddingLeft))*b.x,S=w.top+(y.clientTop+parseFloat(j.paddingTop))*b.y;c*=b.x,u*=b.y,d*=b.x,h*=b.y,c+=N,u+=S,g=ml(y),y=dF(g)}}return d1({width:d,height:h,x:c,y:u})}function vw(t,e){const r=bw(t).scrollLeft;return e?e.left+r:Hf(Fu(t)).left+r}function F6(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-vw(t,r),a=r.top+e.scrollTop;return{x:n,y:a}}function GJ(t){let{elements:e,rect:r,offsetParent:n,strategy:a}=t;const i=a==="fixed",o=Fu(n),l=e?yw(e.floating):!1;if(n===o||l&&i)return r;let c={scrollLeft:0,scrollTop:0},u=vu(1);const d=vu(0),h=Ad(n);if((h||!h&&!i)&&((Fx(n)!=="body"||I0(o))&&(c=bw(n)),h)){const m=Hf(n);u=Fg(n),d.x=m.x+n.clientLeft,d.y=m.y+n.clientTop}const f=o&&!h&&!i?F6(o,c):vu(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-c.scrollLeft*u.x+d.x+f.x,y:r.y*u.y-c.scrollTop*u.y+d.y+f.y}}function VJ(t){return Array.from(t.getClientRects())}function KJ(t){const e=Fu(t),r=bw(t),n=t.ownerDocument.body,a=ol(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=ol(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+vw(t);const l=-r.scrollTop;return Oc(n).direction==="rtl"&&(o+=ol(e.clientWidth,n.clientWidth)-a),{width:a,height:i,x:o,y:l}}const NE=25;function JJ(t,e){const r=ml(t),n=Fu(t),a=r.visualViewport;let i=n.clientWidth,o=n.clientHeight,l=0,c=0;if(a){i=a.width,o=a.height;const d=CC();(!d||d&&e==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}const u=vw(n);if(u<=0){const d=n.ownerDocument,h=d.body,f=getComputedStyle(h),m=d.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,g=Math.abs(n.clientWidth-h.clientWidth-m);g<=NE&&(i-=g)}else u<=NE&&(i+=u);return{width:i,height:o,x:l,y:c}}function YJ(t,e){const r=Hf(t,!0,e==="fixed"),n=r.top+t.clientTop,a=r.left+t.clientLeft,i=Ad(t)?Fg(t):vu(1),o=t.clientWidth*i.x,l=t.clientHeight*i.y,c=a*i.x,u=n*i.y;return{width:o,height:l,x:c,y:u}}function FE(t,e,r){let n;if(e==="viewport")n=JJ(t,r);else if(e==="document")n=KJ(Fu(t));else if(Ic(e))n=YJ(e,r);else{const a=N6(t);n={x:e.x-a.x,y:e.y-a.y,width:e.width,height:e.height}}return d1(n)}function S6(t,e){const r=sm(t);return r===e||!Ic(r)||Zg(r)?!1:Oc(r).position==="fixed"||S6(r,e)}function ZJ(t,e){const r=e.get(t);if(r)return r;let n=Qy(t,[],!1).filter(l=>Ic(l)&&Fx(l)!=="body"),a=null;const i=Oc(t).position==="fixed";let o=i?sm(t):t;for(;Ic(o)&&!Zg(o);){const l=Oc(o),c=SC(o);!c&&l.position==="fixed"&&(a=null),(i?!c&&!a:!c&&l.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||I0(o)&&!c&&S6(t,o))?n=n.filter(d=>d!==o):a=l,o=sm(o)}return e.set(t,n),n}function XJ(t){let{element:e,boundary:r,rootBoundary:n,strategy:a}=t;const o=[...r==="clippingAncestors"?yw(e)?[]:ZJ(e,this._c):[].concat(r),n],l=FE(e,o[0],a);let c=l.top,u=l.right,d=l.bottom,h=l.left;for(let f=1;f<o.length;f++){const m=FE(e,o[f],a);c=ol(m.top,c),u=rm(m.right,u),d=rm(m.bottom,d),h=ol(m.left,h)}return{width:u-h,height:d-c,x:h,y:c}}function QJ(t){const{width:e,height:r}=j6(t);return{width:e,height:r}}function eY(t,e,r){const n=Ad(e),a=Fu(e),i=r==="fixed",o=Hf(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const c=vu(0);function u(){c.x=vw(a)}if(n||!n&&!i)if((Fx(e)!=="body"||I0(a))&&(l=bw(e)),n){const m=Hf(e,!0,i,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}else a&&u();i&&!n&&a&&u();const d=a&&!n&&!i?F6(a,l):vu(0),h=o.left+l.scrollLeft-c.x-d.x,f=o.top+l.scrollTop-c.y-d.y;return{x:h,y:f,width:o.width,height:o.height}}function w2(t){return Oc(t).position==="static"}function SE(t,e){if(!Ad(t)||Oc(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return Fu(t)===r&&(r=r.ownerDocument.body),r}function C6(t,e){const r=ml(t);if(yw(t))return r;if(!Ad(t)){let a=sm(t);for(;a&&!Zg(a);){if(Ic(a)&&!w2(a))return a;a=sm(a)}return r}let n=SE(t,e);for(;n&&zJ(n)&&w2(n);)n=SE(n,e);return n&&Zg(n)&&w2(n)&&!SC(n)?r:n||$J(t)||r}const tY=async function(t){const e=this.getOffsetParent||C6,r=this.getDimensions,n=await r(t.floating);return{reference:eY(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function rY(t){return Oc(t).direction==="rtl"}const sY={convertOffsetParentRelativeRectToViewportRelativeRect:GJ,getDocumentElement:Fu,getClippingRect:XJ,getOffsetParent:C6,getElementRects:tY,getClientRects:VJ,getDimensions:QJ,getScale:Fg,isElement:Ic,isRTL:rY};function k6(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function nY(t,e){let r=null,n;const a=Fu(t);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const u=t.getBoundingClientRect(),{left:d,top:h,width:f,height:m}=u;if(l||e(),!f||!m)return;const g=sv(h),y=sv(a.clientWidth-(d+f)),b=sv(a.clientHeight-(h+m)),w=sv(d),N={rootMargin:-g+"px "+-y+"px "+-b+"px "+-w+"px",threshold:ol(0,rm(1,c))||1};let S=!0;function E(C){const T=C[0].intersectionRatio;if(T!==c){if(!S)return o();T?o(!1,T):n=setTimeout(()=>{o(!1,1e-7)},1e3)}T===1&&!k6(u,t.getBoundingClientRect())&&o(),S=!1}try{r=new IntersectionObserver(E,{...N,root:a.ownerDocument})}catch{r=new IntersectionObserver(E,N)}r.observe(t)}return o(!0),i}function aY(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=kC(t),d=a||i?[...u?Qy(u):[],...e?Qy(e):[]]:[];d.forEach(w=>{a&&w.addEventListener("scroll",r,{passive:!0}),i&&w.addEventListener("resize",r)});const h=u&&l?nY(u,r):null;let f=-1,m=null;o&&(m=new ResizeObserver(w=>{let[j]=w;j&&j.target===u&&m&&e&&(m.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var N;(N=m)==null||N.observe(e)})),r()}),u&&!c&&m.observe(u),e&&m.observe(e));let g,y=c?Hf(t):null;c&&b();function b(){const w=Hf(t);y&&!k6(y,w)&&r(),y=w,g=requestAnimationFrame(b)}return r(),()=>{var w;d.forEach(j=>{a&&j.removeEventListener("scroll",r),i&&j.removeEventListener("resize",r)}),h==null||h(),(w=m)==null||w.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const iY=BJ,oY=LJ,lY=MJ,cY=OJ,uY=PJ,CE=TJ,dY=IJ,hY=(t,e,r)=>{const n=new Map,a={platform:sY,...r},i={...a.platform,_c:n};return DJ(t,e,{...a,platform:i})};var mY=typeof document<"u",fY=function(){},Hv=mY?x.useLayoutEffect:fY;function h1(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,a;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!h1(t[n],e[n]))return!1;return!0}if(a=Object.keys(t),r=a.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,a[n]))return!1;for(n=r;n--!==0;){const i=a[n];if(!(i==="_owner"&&t.$$typeof)&&!h1(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function _6(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function kE(t,e){const r=_6(t);return Math.round(e*r)/r}function j2(t){const e=x.useRef(t);return Hv(()=>{e.current=t}),e}function pY(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=t,[d,h]=x.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[f,m]=x.useState(n);h1(f,n)||m(n);const[g,y]=x.useState(null),[b,w]=x.useState(null),j=x.useCallback(B=>{B!==C.current&&(C.current=B,y(B))},[]),N=x.useCallback(B=>{B!==T.current&&(T.current=B,w(B))},[]),S=i||g,E=o||b,C=x.useRef(null),T=x.useRef(null),D=x.useRef(d),A=c!=null,R=j2(c),M=j2(a),P=j2(u),U=x.useCallback(()=>{if(!C.current||!T.current)return;const B={placement:e,strategy:r,middleware:f};M.current&&(B.platform=M.current),hY(C.current,T.current,B).then($=>{const W={...$,isPositioned:P.current!==!1};I.current&&!h1(D.current,W)&&(D.current=W,bx.flushSync(()=>{h(W)}))})},[f,e,r,M,P]);Hv(()=>{u===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,h(B=>({...B,isPositioned:!1})))},[u]);const I=x.useRef(!1);Hv(()=>(I.current=!0,()=>{I.current=!1}),[]),Hv(()=>{if(S&&(C.current=S),E&&(T.current=E),S&&E){if(R.current)return R.current(S,E,U);U()}},[S,E,U,R,A]);const O=x.useMemo(()=>({reference:C,floating:T,setReference:j,setFloating:N}),[j,N]),V=x.useMemo(()=>({reference:S,floating:E}),[S,E]),G=x.useMemo(()=>{const B={position:r,left:0,top:0};if(!V.floating)return B;const $=kE(V.floating,d.x),W=kE(V.floating,d.y);return l?{...B,transform:"translate("+$+"px, "+W+"px)",..._6(V.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:$,top:W}},[r,l,V.floating,d.x,d.y]);return x.useMemo(()=>({...d,update:U,refs:O,elements:V,floatingStyles:G}),[d,U,O,V,G])}const gY=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:a}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?CE({element:n.current,padding:a}).fn(r):{}:n?CE({element:n,padding:a}).fn(r):{}}}},xY=(t,e)=>{const r=iY(t);return{name:r.name,fn:r.fn,options:[t,e]}},yY=(t,e)=>{const r=oY(t);return{name:r.name,fn:r.fn,options:[t,e]}},bY=(t,e)=>({fn:dY(t).fn,options:[t,e]}),vY=(t,e)=>{const r=lY(t);return{name:r.name,fn:r.fn,options:[t,e]}},wY=(t,e)=>{const r=cY(t);return{name:r.name,fn:r.fn,options:[t,e]}},jY=(t,e)=>{const r=uY(t);return{name:r.name,fn:r.fn,options:[t,e]}},NY=(t,e)=>{const r=gY(t);return{name:r.name,fn:r.fn,options:[t,e]}};var FY="Arrow",E6=x.forwardRef((t,e)=>{const{children:r,width:n=10,height:a=5,...i}=t;return s.jsx(Zt.svg,{...i,ref:e,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});E6.displayName=FY;var SY=E6;function O0(t){const[e,r]=x.useState(void 0);return En(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,l;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=t.offsetWidth,l=t.offsetHeight;r({width:o,height:l})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}var _C="Popper",[A6,Sx]=li(_C),[CY,D6]=A6(_C),T6=t=>{const{__scopePopper:e,children:r}=t,[n,a]=x.useState(null);return s.jsx(CY,{scope:e,anchor:n,onAnchorChange:a,children:r})};T6.displayName=_C;var M6="PopperAnchor",P6=x.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...a}=t,i=D6(M6,r),o=x.useRef(null),l=Cr(e,o),c=x.useRef(null);return x.useEffect(()=>{const u=c.current;c.current=(n==null?void 0:n.current)||o.current,u!==c.current&&i.onAnchorChange(c.current)}),n?null:s.jsx(Zt.div,{...a,ref:l})});P6.displayName=M6;var EC="PopperContent",[kY,_Y]=A6(EC),R6=x.forwardRef((t,e)=>{var ee,he,ve,Ce,re,we;const{__scopePopper:r,side:n="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:m="optimized",onPlaced:g,...y}=t,b=D6(EC,r),[w,j]=x.useState(null),N=Cr(e,Ee=>j(Ee)),[S,E]=x.useState(null),C=O0(S),T=(C==null?void 0:C.width)??0,D=(C==null?void 0:C.height)??0,A=n+(i!=="center"?"-"+i:""),R=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},M=Array.isArray(u)?u:[u],P=M.length>0,U={padding:R,boundary:M.filter(AY),altBoundary:P},{refs:I,floatingStyles:O,placement:V,isPositioned:G,middlewareData:B}=pY({strategy:"fixed",placement:A,whileElementsMounted:(...Ee)=>aY(...Ee,{animationFrame:m==="always"}),elements:{reference:b.anchor},middleware:[xY({mainAxis:a+D,alignmentAxis:o}),c&&yY({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?bY():void 0,...U}),c&&vY({...U}),wY({...U,apply:({elements:Ee,rects:Me,availableWidth:ae,availableHeight:ze})=>{const{width:mt,height:tt}=Me.reference,Xe=Ee.floating.style;Xe.setProperty("--radix-popper-available-width",`${ae}px`),Xe.setProperty("--radix-popper-available-height",`${ze}px`),Xe.setProperty("--radix-popper-anchor-width",`${mt}px`),Xe.setProperty("--radix-popper-anchor-height",`${tt}px`)}}),S&&NY({element:S,padding:l}),DY({arrowWidth:T,arrowHeight:D}),f&&jY({strategy:"referenceHidden",...U})]}),[$,W]=I6(V),oe=Zs(g);En(()=>{G&&(oe==null||oe())},[G,oe]);const K=(ee=B.arrow)==null?void 0:ee.x,H=(he=B.arrow)==null?void 0:he.y,X=((ve=B.arrow)==null?void 0:ve.centerOffset)!==0,[me,ie]=x.useState();return En(()=>{w&&ie(window.getComputedStyle(w).zIndex)},[w]),s.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...O,transform:G?O.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[(Ce=B.transformOrigin)==null?void 0:Ce.x,(re=B.transformOrigin)==null?void 0:re.y].join(" "),...((we=B.hide)==null?void 0:we.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:s.jsx(kY,{scope:r,placedSide:$,onArrowChange:E,arrowX:K,arrowY:H,shouldHideArrow:X,children:s.jsx(Zt.div,{"data-side":$,"data-align":W,...y,ref:N,style:{...y.style,animation:G?void 0:"none"}})})})});R6.displayName=EC;var B6="PopperArrow",EY={top:"bottom",right:"left",bottom:"top",left:"right"},L6=x.forwardRef(function(e,r){const{__scopePopper:n,...a}=e,i=_Y(B6,n),o=EY[i.placedSide];return s.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:s.jsx(SY,{...a,ref:r,style:{...a.style,display:"block"}})})});L6.displayName=B6;function AY(t){return t!==null}var DY=t=>({name:"transformOrigin",options:t,fn(e){var b,w,j;const{placement:r,rects:n,middlewareData:a}=e,o=((b=a.arrow)==null?void 0:b.centerOffset)!==0,l=o?0:t.arrowWidth,c=o?0:t.arrowHeight,[u,d]=I6(r),h={start:"0%",center:"50%",end:"100%"}[d],f=(((w=a.arrow)==null?void 0:w.x)??0)+l/2,m=(((j=a.arrow)==null?void 0:j.y)??0)+c/2;let g="",y="";return u==="bottom"?(g=o?h:`${f}px`,y=`${-c}px`):u==="top"?(g=o?h:`${f}px`,y=`${n.floating.height+c}px`):u==="right"?(g=`${-c}px`,y=o?h:`${m}px`):u==="left"&&(g=`${n.floating.width+c}px`,y=o?h:`${m}px`),{data:{x:g,y}}}});function I6(t){const[e,r="center"]=t.split("-");return[e,r]}var AC=T6,DC=P6,TC=R6,MC=L6,[ww]=li("Tooltip",[Sx]),jw=Sx(),O6="TooltipProvider",TY=700,hF="tooltip.open",[MY,PC]=ww(O6),z6=t=>{const{__scopeTooltip:e,delayDuration:r=TY,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:i}=t,o=x.useRef(!0),l=x.useRef(!1),c=x.useRef(0);return x.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),s.jsx(MY,{scope:e,isOpenDelayedRef:o,delayDuration:r,onOpen:x.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>
vendor: 5,465 bytes, line 571
571o.current=!0,n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:x.useCallback(u=>{l.current=u},[]),disableHoverableContent:a,children:i})};z6.displayName=O6;var e0="Tooltip",[PY,Nw]=ww(e0),U6=t=>{const{__scopeTooltip:e,children:r,open:n,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=t,c=PC(e0,t.__scopeTooltip),u=jw(e),[d,h]=x.useState(null),f=hl(),m=x.useRef(0),g=o??c.disableHoverableContent,y=l??c.delayDuration,b=x.useRef(!1),[w,j]=Lo({prop:n,defaultProp:a??!1,onChange:T=>{T?(c.onOpen(),document.dispatchEvent(new CustomEvent(hF))):c.onClose(),i==null||i(T)},caller:e0}),N=x.useMemo(()=>w?b.current?"delayed-open":"instant-open":"closed",[w]),S=x.useCallback(()=>{window.clearTimeout(m.current),m.current=0,b.current=!1,j(!0)},[j]),E=x.useCallback(()=>{window.clearTimeout(m.current),m.current=0,j(!1)},[j]),C=x.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{b.current=!0,j(!0),m.current=0},y)},[y,j]);return x.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),s.jsx(AC,{...u,children:s.jsx(PY,{scope:e,contentId:f,open:w,stateAttribute:N,trigger:d,onTriggerChange:h,onTriggerEnter:x.useCallback(()=>{c.isOpenDelayedRef.current?C():S()},[c.isOpenDelayedRef,C,S]),onTriggerLeave:x.useCallback(()=>{g?E():(window.clearTimeout(m.current),m.current=0)},[E,g]),onOpen:S,onClose:E,disableHoverableContent:g,children:r})})};U6.displayName=e0;var mF="TooltipTrigger",H6=x.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,a=Nw(mF,r),i=PC(mF,r),o=jw(r),l=x.useRef(null),c=Cr(e,l,a.onTriggerChange),u=x.useRef(!1),d=x.useRef(!1),h=x.useCallback(()=>u.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),s.jsx(DC,{asChild:!0,...o,children:s.jsx(Zt.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...n,ref:c,onPointerMove:gt(t.onPointerMove,f=>{f.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),d.current=!0)}),onPointerLeave:gt(t.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:gt(t.onPointerDown,()=>{a.open&&a.onClose(),u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:gt(t.onFocus,()=>{u.current||a.onOpen()}),onBlur:gt(t.onBlur,a.onClose),onClick:gt(t.onClick,a.onClose)})})});H6.displayName=mF;var RY="TooltipPortal",[HAe,BY]=ww(RY,{forceMount:void 0}),Xg="TooltipContent",$6=x.forwardRef((t,e)=>{const r=BY(Xg,t.__scopeTooltip),{forceMount:n=r.forceMount,side:a="top",...i}=t,o=Nw(Xg,t.__scopeTooltip);return s.jsx(fa,{present:n||o.open,children:o.disableHoverableContent?s.jsx(W6,{side:a,...i,ref:e}):s.jsx(LY,{side:a,...i,ref:e})})}),LY=x.forwardRef((t,e)=>{const r=Nw(Xg,t.__scopeTooltip),n=PC(Xg,t.__scopeTooltip),a=x.useRef(null),i=Cr(e,a),[o,l]=x.useState(null),{trigger:c,onClose:u}=r,d=a.current,{onPointerInTransitChange:h}=n,f=x.useCallback(()=>{l(null),h(!1)},[h]),m=x.useCallback((g,y)=>{const b=g.currentTarget,w={x:g.clientX,y:g.clientY},j=HY(w,b.getBoundingClientRect()),N=$Y(w,j),S=WY(y.getBoundingClientRect()),E=GY([...N,...S]);l(E),h(!0)},[h]);return x.useEffect(()=>()=>f(),[f]),x.useEffect(()=>{if(c&&d){const g=b=>m(b,d),y=b=>m(b,c);return c.addEventListener("pointerleave",g),d.addEventListener("pointerleave",y),()=>{c.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",y)}}},[c,d,m,f]),x.useEffect(()=>{if(o){const g=y=>{const b=y.target,w={x:y.clientX,y:y.clientY},j=(c==null?void 0:c.contains(b))||(d==null?void 0:d.contains(b)),N=!qY(w,o);j?f():N&&(f(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[c,d,o,u,f]),s.jsx(W6,{...t,ref:i})}),[IY,OY]=ww(e0,{isInside:!1}),zY=SM("TooltipContent"),W6=x.forwardRef((t,e)=>{const{__scopeTooltip:r,children:n,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...l}=t,c=Nw(Xg,r),u=jw(r),{onClose:d}=c;return x.useEffect(()=>(document.addEventListener(hF,d),()=>document.removeEventListener(hF,d)),[d]),x.useEffect(()=>{if(c.trigger){const h=f=>{const m=f.target;m!=null&&m.contains(c.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,d]),s.jsx(lp,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:s.jsxs(TC,{"data-state":c.stateAttribute,...u,...l,ref:e,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:[s.jsx(zY,{children:n}),s.jsx(IY,{scope:r,isInside:!0,children:s.jsx(AM,{id:c.contentId,role:"tooltip",children:a||n})})]})})});$6.displayName=Xg;var q6="TooltipArrow",UY=x.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,a=jw(r);return OY(q6,r).isInside?null:s.jsx(MC,{...a,...n,ref:e})});UY.displayName=q6;function HY(t,e){const r=Math.abs(e.top-t.y),n=Math.abs(e.bottom-t.y),a=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(r,n,a,i)){case i:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function $Y(t,e,r=5){const n=[];
571switch(e){case"top":n.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":n.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":n.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":n.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return n}function WY(t){const{top:e,right:r,bottom:n,left:a}=t;return[{x:a,y:e},{x:r,y:e},{x:r,y:n},{x:a,y:n}]}function qY(t,e){const{x:r,y:n}=t;let a=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const l=e[i],c=e[o],u=l.x,d=l.y,h=c.x,f=c.y;d>n!=f>n&&r<(h-u)*(n-d)/(f-d)+u&&(a=!a)}return a}function GY(t){const e=t.slice();return e.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),VY(e)}function VY(t){if(t.length<=1)return t.slice();const e=[];for(let n=0;n<t.length;n++){const a=t[n];for(;e.length>=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))e.pop();else break}e.push(a)}e.pop();const r=[];for(let n=t.length-1;n>=0;n--){const a=t[n];for(;r.length>=2;){const i=r[r.length-1],o=r[r.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))r.pop();else break}r.push(a)}return r.pop(),e.length===1&&r.length===1&&e[0].x===r[0].x&&e[0].y===r[0].y?e:e.concat(r)}var KY=z6,JY=U6,YY=H6,G6=$6;const ZY=KY,nv=JY,av=YY,wy=x.forwardRef(({className:t,sideOffset:e=4,...r},n)=>s.jsx(G6,{ref:n,sideOffset:e,className:xt("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]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r}));wy.displayName=G6.displayName;var Cx=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},XY={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Eh,aC,cM,QY=(cM=class{constructor(){kr(this,Eh,XY);kr(this,aC,!1)}setTimeoutProvider(t){er(this,Eh,t)}setTimeout(t,e){return Te(this,Eh).setTimeout(t,e)}clearTimeout(t){Te(this,Eh).clearTimeout(t)}setInterval(t,e){return Te(this,Eh).setInterval(t,e)}clearInterval(t){Te(this,Eh).clearInterval(t)}},Eh=new WeakMap,aC=new WeakMap,cM),yf=new QY;function eZ(t){setTimeout(t,0)}var $f=typeof window>"u"||"Deno"in globalThis;function ao(){}function tZ(t,e){return typeof t=="function"?t(e):t}function fF(t){return typeof t=="number"&&t>=0&&t!==1/0}function V6(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Gh(t,e){return typeof t=="function"?t(e):t}function Rl(t,e){return typeof t=="function"?t(e):t}function _E(t,e){const{type:r="all",exact:n,fetchStatus:a,predicate:i,queryKey:o,stale:l}=t;if(o){if(n){if(e.queryHash!==RC(o,e.options))return!1}else if(!t0(e.queryKey,o))return!1}if(r!=="all"){const c=e.isActive();if(r==="active"&&!c||r==="inactive"&&c)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||a&&a!==e.state.fetchStatus||i&&!i(e))}function EE(t,e){const{exact:r,status:n,predicate:a,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(r){if(Wf(e.options.mutationKey)!==Wf(i))return!1}else if(!t0(e.options.mutationKey,i))return!1}return!(n&&e.state.status!==n||a&&!a(e))}function RC(t,e){return((e==null?void 0:e.queryKeyHashFn)||Wf)(t)}function Wf(t){return JSON.stringify(t,(e,r)=>pF(r)?Object.keys(r).sort().reduce((n,a)=>(n[a]=r[a],n),{}):r)}function t0(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(r=>t0(t[r],e[r])):!1}var rZ=Object.prototype.hasOwnProperty;function K6(t,e,r=0){if(t===e)return t;if(r>500)return e;const n=AE(t)&&AE(e);if(!n&&!(pF(t)&&pF(e)))return e;const i=(n?t:Object.keys(t)).length,o=n?e:Object.keys(e),l=o.length,c=n?new Array(l):{};let u=0;for(let d=0;d<l;d++){const h=n?d:o[d],f=t[h],m=e[h];if(f===m){c[h]=f,(n?d<i:rZ.call(t,h))&&u++;continue}if(f===null||m===null||typeof f!="object"||typeof m!="object"){c[h]=m;continue}const g=K6(f,m,r+1);c[h]=g,g===f&&u++}return i===l&&u===i?t:c}function m1(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const r in t)if(t[r]!==e[r])return!1;return!0}function AE(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function pF(t){if(!DE(t))return!1;const e=t.constructor;if(e===void 0)return!0;const r=e.prototype;return!(!DE(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function DE(t){return Object.prototype.toString.call(t)==="[object Object]"}function sZ(t){return new Promise(e=>{yf.setTimeout(e,t)})}function gF(t,e,r){return typeof r.structuralSharing=="function"?r.structuralSharing(t,e):r.structuralSharing!==!1?K6(t,e):e}function nZ(t,e,r=0){const n=[...t,e];return r&&n.length>r?n.slice(1):n}function aZ(t,e,r=0){const n=[e,...t];return r&&n.length>r?n.slice(0,-1):n}var BC=Symbol();function J6(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===BC?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function LC(t,e){return typeof t=="function"?t(...e):!!t}function iZ(t,e,r){let n=!1,a;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(a??(a=e()),n||(n=!0,a.aborted?r():a.addEventListener("abort",r,{once:!0})),a)}),t}var Nf,Ah,Rg,uM,oZ=(uM=class extends Cx{constructor(){super();kr(this,Nf);kr(this,Ah);kr(this,Rg);er(this,Rg,e=>{if(!$f&&window.addEventListener){const r=()=>e();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){Te(this,Ah)||this.setEventListener(Te(this,Rg))}onUnsubscribe(){var e;this.hasListeners()||((e=Te(this,Ah))==null||e.call(this),er(this,Ah,void 0))}setEventListener(e){var r;er(this,Rg,e),(r=Te(this,Ah))==null||r.call(this),er(this,Ah,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){Te(this,Nf)!==e&&(er(this,Nf,e),this.onFocus())}onFocus(){const e=this.isFocused();
vendor: 5,024 bytes, line 571
571this.listeners.forEach(r=>{r(e)})}isFocused(){var e;return typeof Te(this,Nf)=="boolean"?Te(this,Nf):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Nf=new WeakMap,Ah=new WeakMap,Rg=new WeakMap,uM),IC=new oZ;function xF(){let t,e;const r=new Promise((a,i)=>{t=a,e=i});r.status="pending",r.catch(()=>{});function n(a){Object.assign(r,a),delete r.resolve,delete r.reject}return r.resolve=a=>{n({status:"fulfilled",value:a}),t(a)},r.reject=a=>{n({status:"rejected",reason:a}),e(a)},r}var lZ=eZ;function cZ(){let t=[],e=0,r=l=>{l()},n=l=>{l()},a=lZ;const i=l=>{e?t.push(l):a(()=>{r(l)})},o=()=>{const l=t;t=[],l.length&&a(()=>{n(()=>{l.forEach(c=>{r(c)})})})};return{batch:l=>{let c;e++;try{c=l()}finally{e--,e||o()}return c},batchCalls:l=>(...c)=>{i(()=>{l(...c)})},schedule:i,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{a=l}}}var La=cZ(),Bg,Dh,Lg,dM,uZ=(dM=class extends Cx{constructor(){super();kr(this,Bg,!0);kr(this,Dh);kr(this,Lg);er(this,Lg,e=>{if(!$f&&window.addEventListener){const r=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){Te(this,Dh)||this.setEventListener(Te(this,Lg))}onUnsubscribe(){var e;this.hasListeners()||((e=Te(this,Dh))==null||e.call(this),er(this,Dh,void 0))}setEventListener(e){var r;er(this,Lg,e),(r=Te(this,Dh))==null||r.call(this),er(this,Dh,e(this.setOnline.bind(this)))}setOnline(e){Te(this,Bg)!==e&&(er(this,Bg,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return Te(this,Bg)}},Bg=new WeakMap,Dh=new WeakMap,Lg=new WeakMap,dM),f1=new uZ;function dZ(t){return Math.min(1e3*2**t,3e4)}function Y6(t){return(t??"online")==="online"?f1.isOnline():!0}var yF=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function Z6(t){let e=!1,r=0,n;const a=xF(),i=()=>a.status!=="pending",o=y=>{var b;if(!i()){const w=new yF(y);f(w),(b=t.onCancel)==null||b.call(t,w)}},l=()=>{e=!0},c=()=>{e=!1},u=()=>IC.isFocused()&&(t.networkMode==="always"||f1.isOnline())&&t.canRun(),d=()=>Y6(t.networkMode)&&t.canRun(),h=y=>{i()||(n==null||n(),a.resolve(y))},f=y=>{i()||(n==null||n(),a.reject(y))},m=()=>new Promise(y=>{var b;n=w=>{(i()||u())&&y(w)},(b=t.onPause)==null||b.call(t)}).then(()=>{var y;n=void 0,i()||(y=t.onContinue)==null||y.call(t)}),g=()=>{if(i())return;let y;const b=r===0?t.initialPromise:void 0;try{y=b??t.fn()}catch(w){y=Promise.reject(w)}Promise.resolve(y).then(h).catch(w=>{var C;if(i())return;const j=t.retry??($f?0:3),N=t.retryDelay??dZ,S=typeof N=="function"?N(r,w):N,E=j===!0||typeof j=="number"&&r<j||typeof j=="function"&&j(r,w);if(e||!E){f(w);return}r++,(C=t.onFail)==null||C.call(t,r,w),sZ(S).then(()=>u()?void 0:m()).then(()=>{e?f(w):g()})})};return{promise:a,status:()=>a.status,cancel:o,continue:()=>(n==null||n(),a),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?g():m().then(g),a)}}var Ff,hM,X6=(hM=class{constructor(){kr(this,Ff)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),fF(this.gcTime)&&er(this,Ff,yf.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??($f?1/0:5*60*1e3))}clearGcTimeout(){Te(this,Ff)&&(yf.clearTimeout(Te(this,Ff)),er(this,Ff,void 0))}},Ff=new WeakMap,hM),Sf,Ig,Ml,Cf,Ja,D0,kf,Ac,id,mM,hZ=(mM=class extends X6{constructor(e){super();kr(this,Ac);kr(this,Sf);kr(this,Ig);kr(this,Ml);kr(this,Cf);kr(this,Ja);kr(this,D0);kr(this,kf);er(this,kf,!1),er(this,D0,e.defaultOptions),this.setOptions(e.options),this.observers=[],er(this,Cf,e.client),er(this,Ml,Te(this,Cf).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,er(this,Sf,ME(this.options)),this.state=e.state??Te(this,Sf),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=Te(this,Ja))==null?void 0:e.promise}setOptions(e){if(this.options={...Te(this,D0),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=ME(this.options);r.data!==void 0&&(this.setState(TE(r.data,r.dataUpdatedAt)),er(this,Sf,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Te(this,Ml).remove(this)}setData(e,r){const n=gF(this.state.data,e,this.options);return hs(this,Ac,id).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(e,r){hs(this,Ac,id).call(this,{type:"setState",state:e,setStateOptions:r})}cancel(e){var n,a;const r=(n=Te(this,Ja))==null?void 0:n.promise;return(a=Te(this,Ja))==null||a.cancel(e),r?r.then(ao).catch(ao):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Te(this,Sf))}isActive(){return this.observers.some(e=>Rl(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===BC||this.state.dataUpdateCount+this.state.errorUpdate
571Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Gh(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!V6(this.state.dataUpdatedAt,e)}onFocus(){var r;const e=this.observers.find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(r=Te(this,Ja))==null||r.continue()}onOnline(){var r;const e=this.observers.find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(r=Te(this,Ja))==null||r.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),Te(this,Ml).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(r=>r!==e),this.observers.length||(Te(this,Ja)&&(Te(this,kf)?Te(this,Ja).cancel({revert:!0}):Te(this,Ja).cancelRetry()),this.scheduleGc()),Te(this,Ml).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||hs(this,Ac,id).call(this,{type:"invalidate"})}async fetch(e,r){var c,u,d,h,f,m,g,y,b,w,j,N;if(this.state.fetchStatus!=="idle"&&((c=Te(this,Ja))==null?void 0:c.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(Te(this,Ja))return Te(this,Ja).continueRetry(),Te(this,Ja).promise}if(e&&this.setOptions(e),!this.options.queryFn){const S=this.observers.find(E=>E.options.queryFn);S&&this.setOptions(S.options)}const n=new AbortController,a=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(er(this,kf,!0),n.signal)})},i=()=>{const S=J6(this.options,r),C=(()=>{const T={client:Te(this,Cf),queryKey:this.queryKey,meta:this.meta};return a(T),T})();return er(this,kf,!1),this.options.persister?this.options.persister(S,C,this):S(C)},l=(()=>{const S={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:Te(this,Cf),state:this.state,fetchFn:i};return a(S),S})();(u=this.options.behavior)==null||u.onFetch(l,this),er(this,Ig,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&hs(this,Ac,id).call(this,{type:"fetch",meta:(h=l.fetchOptions)==null?void 0:h.meta}),er(this,Ja,Z6({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,onCancel:S=>{S instanceof yF&&S.revert&&this.setState({...Te(this,Ig),fetchStatus:"idle"}),n.abort()},onFail:(S,E)=>{hs(this,Ac,id).call(this,{type:"failed",failureCount:S,error:E})},onPause:()=>{hs(this,Ac,id).call(this,{type:"pause"})},onContinue:()=>{hs(this,Ac,id).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const S=await Te(this,Ja).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(m=(f=Te(this,Ml).config).onSuccess)==null||m.call(f,S,this),(y=(g=Te(this,Ml).config).onSettled)==null||y.call(g,S,this.state.error,this),S}catch(S){if(S instanceof yF){if(S.silent)return Te(this,Ja).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw hs(this,Ac,id).call(this,{type:"error",error:S}),(w=(b=Te(this,Ml).config).onError)==null||w.call(b,S,this),(N=(j=Te(this,Ml).config).onSettled)==null||N.call(j,this.state.data,S,this),S}finally{this.scheduleGc()}}},Sf=new WeakMap,Ig=new WeakMap,Ml=new WeakMap,Cf=new WeakMap,Ja=new WeakMap,D0=new WeakMap,kf=new WeakMap,Ac=new WeakSet,id=function(e){const r=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Q6(n.data,this.options),fetchMeta:e.meta??null};case"success":const a={...n,...TE(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return er(this,Ig,e.manual?a:void 0),a;case"error":const i=e.error;
vendor: 10,499 bytes, line 571
571return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=r(this.state),La.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),Te(this,Ml).notify({query:this,type:"updated",action:e})})},mM);function Q6(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Y6(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function TE(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function ME(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,r=e!==void 0,n=r?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Ao,Es,T0,so,_f,Og,ud,Th,M0,zg,Ug,Ef,Af,Mh,Hg,Gs,jy,bF,vF,wF,jF,NF,FF,SF,eP,fM,mZ=(fM=class extends Cx{constructor(e,r){super();kr(this,Gs);kr(this,Ao);kr(this,Es);kr(this,T0);kr(this,so);kr(this,_f);kr(this,Og);kr(this,ud);kr(this,Th);kr(this,M0);kr(this,zg);kr(this,Ug);kr(this,Ef);kr(this,Af);kr(this,Mh);kr(this,Hg,new Set);this.options=r,er(this,Ao,e),er(this,Th,null),er(this,ud,xF()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Te(this,Es).addObserver(this),PE(Te(this,Es),this.options)?hs(this,Gs,jy).call(this):this.updateResult(),hs(this,Gs,jF).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return CF(Te(this,Es),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return CF(Te(this,Es),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,hs(this,Gs,NF).call(this),hs(this,Gs,FF).call(this),Te(this,Es).removeObserver(this)}setOptions(e){const r=this.options,n=Te(this,Es);if(this.options=Te(this,Ao).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Rl(this.options.enabled,Te(this,Es))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");hs(this,Gs,SF).call(this),Te(this,Es).setOptions(this.options),r._defaulted&&!m1(this.options,r)&&Te(this,Ao).getQueryCache().notify({type:"observerOptionsUpdated",query:Te(this,Es),observer:this});const a=this.hasListeners();a&&RE(Te(this,Es),n,this.options,r)&&hs(this,Gs,jy).call(this),this.updateResult(),a&&(Te(this,Es)!==n||Rl(this.options.enabled,Te(this,Es))!==Rl(r.enabled,Te(this,Es))||Gh(this.options.staleTime,Te(this,Es))!==Gh(r.staleTime,Te(this,Es)))&&hs(this,Gs,bF).call(this);const i=hs(this,Gs,vF).call(this);a&&(Te(this,Es)!==n||Rl(this.options.enabled,Te(this,Es))!==Rl(r.enabled,Te(this,Es))||i!==Te(this,Mh))&&hs(this,Gs,wF).call(this,i)}getOptimisticResult(e){const r=Te(this,Ao).getQueryCache().build(Te(this,Ao),e),n=this.createResult(r,e);return pZ(this,n)&&(er(this,so,n),er(this,Og,this.options),er(this,_f,Te(this,Es).state)),n}getCurrentResult(){return Te(this,so)}trackResult(e,r){return new Proxy(e,{get:(n,a)=>(this.trackProp(a),r==null||r(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&Te(this,ud).status==="pending"&&Te(this,ud).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,a))})}trackProp(e){Te(this,Hg).add(e)}getCurrentQuery(){return Te(this,Es)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const r=Te(this,Ao).defaultQueryOptions(e),n=Te(this,Ao).getQueryCache().build(Te(this,Ao),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(e){return hs(this,Gs,jy).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),Te(this,so)))}createResult(e,r){var A;const n=Te(this,Es),a=this.options,i=Te(this,so),o=Te(this,_f),l=Te(this,Og),u=e!==n?e.state:Te(this,T0),{state:d}=e;let h={...d},f=!1,m;if(r._optimisticResults){const R=this.hasListeners(),M=!R&&PE(e,r),P=R&&RE(e,n,r,a);(M||P)&&(h={...h,...Q6(d.data,e.options)}),r._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:g,errorUpdatedAt:y,status:b}=h;m=h.data;let w=!1;if(r.placeholderData!==void 0&&m===void 0&&b==="pending"){let R;i!=null&&i.isPlaceholderData&&r.placeholderData===(l==null?void 0:l.placeholderData)?(R=i.data,w=!0):R=typeof r.placeholderData=="function"?r.placeholderData((A=Te(this,Ug))==null?void 0:A.state.data,Te(this,Ug)):r.placeholderData,R!==void 0&&(b="success",m=gF(i==null?void 0:i.data,R,r),f=!0)}if(r.select&&m!==void 0&&!w)if(i&&m===(o==null?void 0:o.data)&&r.select===Te(this,M0))m=Te(this,zg);else try{er(this,M0,r.select),m=r.select(m),m=gF(i==null?void 0:i.data,m,r),er(this,zg,m),er(this,Th,null)}catch(R){er(this,Th,R)}Te(this,Th)&&(g=Te(this,Th),m=Te(this,zg),y=Date.now(),b="error");const j=h.fetchStatus==="fetching",N=b==="pending",S=b==="error",E=N&&j,C=m!==void 0,D={status:b,fetchStatus:h.fetchStatus,isPending:N,isSuccess:b==="success",isError:S,isInitialLoading:E,isLoading:E,data:m,dataUpdatedAt:h.dataUpdatedAt,error:g,errorUpdatedAt:y,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>u.dataUpdateCount||h.errorUpdateCount>u.errorUpdateCount,isFetching:j,isRefetching:j&&!N,isLoadingError:S&&!C,isPaused:h.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&C,isStale:OC(e,r),refetch:this.refetch,promise:Te(this,ud),isEnabled:Rl(r.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const R=D.data!==void 0,M=D.status==="error"&&!R,P=O=>{M?O.reject(D.error):R&&O.resolve(D.data)},U=()=>{const O=er(this,ud,D.promise=xF());P(O)},I=Te(this,ud);switch(I.status){case"pending":e.queryHash===n.queryHash&&P(I);break;case"fulfilled":(M||D.data!==I.value)&&U();break;case"rejected":(!M||D.error!==I.reason)&&U();break}}return D}updateResult(){const e=Te(this,so),r=this.createResult(Te(this,Es),this.options);if(er(this,_f,Te(this,Es).state),er(this,Og,this.options),Te(this,_f).data!==void 0&&er(this,Ug,Te(this,Es)),m1(r,e))return;er(this,so,r);const n=()=>{if(!e)return!0;const{notifyOnChangeProps:a}=this.options,i=typeof a=="function"?a():a;if(i==="all"||!i&&!Te(this,Hg).size)return!0;const o=new Set(i??Te(this,Hg));return this.options.throwOnError&&o.add("error"),Object.keys(Te(this,so)).some(l=>{const c=l;return Te(this,so)[c]!==e[c]&&o.has(c)})};hs(this,Gs,eP).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&hs(this,Gs,jF).call(this)}},Ao=new WeakMap,Es=new WeakMap,T0=new WeakMap,so=new WeakMap,_f=new WeakMap,Og=new WeakMap,ud=new WeakMap,Th=new WeakMap,M0=new WeakMap,zg=new WeakMap,Ug=new WeakMap,Ef=new WeakMap,Af=new WeakMap,Mh=new WeakMap,Hg=new WeakMap,Gs=new WeakSet,jy=function(e){hs(this,Gs,SF).call(this);let r=Te(this,Es).fetch(this.options,e);return e!=null&&e.throwOnError||(r=r.catch(ao)),r},bF=function(){hs(this,Gs,NF).call(this);const e=Gh(this.options.staleTime,Te(this,Es));if($f||Te(this,so).isStale||!fF(e))return;const n=V6(Te(this,so).dataUpdatedAt,e)+1;er(this,Ef,yf.setTimeout(()=>{Te(this,so).isStale||this.updateResult()},n))},vF=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Te(this,Es)):this.options.refetchInterval)??!1},wF=function(e){hs(this,Gs,FF).call(this),er(this,Mh,e),!($f||Rl(this.options.enabled,Te(this,Es))===!1||!fF(Te(this,Mh))||Te(this,Mh)===0)&&er(this,Af,yf.setInterval(()=>{(this.options.refetchIntervalInBackground||IC.isFocused())&&hs(this,Gs,jy).call(this)},Te(this,Mh)))},jF=function(){hs(this,Gs,bF).call(this),hs(this,Gs,wF).call(this,hs(this,Gs,vF).call(this))},NF=function(){Te(this,Ef)&&(yf.clearTimeout(Te(this,Ef)),er(this,Ef,void 0))},FF=function(){Te(this,Af)&&(yf.clearInterval(Te(this,Af)),er(this,Af,void 0))},SF=function(){const e=Te(this,Ao).getQueryCache().build(Te(this,Ao),this.options);if(e===Te(this,Es))return;const r=Te(this,Es);er(this,Es,e),er(this,T0,e.state),this.hasListeners()&&(r==null||r.removeObserver(this),e.addObserver(this))},eP=function(e){La.batch(()=>{e.listeners&&this.listeners.forEach(r=>{r(Te(this,so))}),Te(this,Ao).getQueryCache().notify({query:Te(this,Es),type:"observerResultsUpdated"})})},fM);function fZ(t,e){return Rl(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function PE(t,e){return fZ(t,e)||t.state.data!==void 0&&CF(t,e,e.refetchOnMount)}function CF(t,e,r){if(Rl(e.enabled,t)!==!1&&Gh(e.staleTime,t)!=="static"){const n=typeof r=="function"?r(t):r;return n==="always"||n!==!1&&OC(t,e)}return!1}function RE(t,e,r,n){return(t!==e||Rl(n.enabled,t)===!1)&&(!r.suspense||t.state.status!=="error")&&OC(t,r)}function OC(t,e){return Rl(e.enabled,t)!==!1&&t.isStaleByTime(Gh(e.staleTime,t))}function pZ(t,e){return!m1(t.getCurrentResult(),e)}function BE(t){return{onFetch:(e,r)=>{var d,h,f,m,g;const n=e.options,a=(f=(h=(d=e.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:f.direction,i=((m=e.state.data)==null?void 0:m.pages)||[],o=((g=e.state.data)==null?void 0:g.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let y=!1;const b=N=>{iZ(N,()=>e.signal,()=>y=!0)},w=J6(e.options,e.fetchOptions),j=async(N,S,E)=>{if(y)return Promise.reject();if(S==null&&N.pages.length)return Promise.resolve(N);const T=(()=>{const M={client:e.client,queryKey:e.queryKey,pageParam:S,direction:E?"backward":"forward",meta:e.options.meta};return b(M),M})(),D=await w(T),{maxPages:A}=e.options,R=E?aZ:nZ;return{pages:R(N.pages,D,A),pageParams:R(N.pageParams,S,A)}};if(a&&i.length){const N=a==="backward",S=N?gZ:LE,E={pages:i,pageParams:o},C=S(n,E);l=await j(E,C,N)}else{const N=t??i.length;do{const S=c===0?o[0]??n.initialPageParam:LE(n,l);if(c>0&&S==null)break;l=await j(l,S),c++}while(c<N)}return l};e.options.persister?e.fetchFn=()=>{var y,b;return(b=(y=e.options).persister)==null?void 0:b.call(y,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},r)}:e.fetchFn=u}}}function LE(t,{pages:e,pageParams:r}){const n=e.length-1;return e.length>
vendor: 1,920 bytes, line 571
5710?t.getNextPageParam(e[n],e,r[n],r):void 0}function gZ(t,{pages:e,pageParams:r}){var n;return e.length>0?(n=t.getPreviousPageParam)==null?void 0:n.call(t,e[0],e,r[0],r):void 0}var P0,hu,Pi,Df,mu,gh,pM,xZ=(pM=class extends X6{constructor(e){super();kr(this,mu);kr(this,P0);kr(this,hu);kr(this,Pi);kr(this,Df);er(this,P0,e.client),this.mutationId=e.mutationId,er(this,Pi,e.mutationCache),er(this,hu,[]),this.state=e.state||tP(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){Te(this,hu).includes(e)||(Te(this,hu).push(e),this.clearGcTimeout(),Te(this,Pi).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){er(this,hu,Te(this,hu).filter(r=>r!==e)),this.scheduleGc(),Te(this,Pi).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){Te(this,hu).length||(this.state.status==="pending"?this.scheduleGc():Te(this,Pi).remove(this))}continue(){var e;return((e=Te(this,Df))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var o,l,c,u,d,h,f,m,g,y,b,w,j,N,S,E,C,T;const r=()=>{hs(this,mu,gh).call(this,{type:"continue"})},n={client:Te(this,P0),meta:this.options.meta,mutationKey:this.options.mutationKey};er(this,Df,Z6({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(D,A)=>{hs(this,mu,gh).call(this,{type:"failed",failureCount:D,error:A})},onPause:()=>{hs(this,mu,gh).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Te(this,Pi).canRun(this)}));const a=this.state.status==="pending",i=!Te(this,Df).canStart();try{if(a)r();else{hs(this,mu,gh).call(this,{type:"pending",variables:e,isPaused:i}),Te(this,Pi).config.onMutate&&await Te(this,Pi).config.onMutate(e,this,n);
571const A=await((l=(o=this.options).onMutate)==null?void 0:l.call(o,e,n));A!==this.state.context&&hs(this,mu,gh).call(this,{type:"pending",context:A,variables:e,isPaused:i})}const D=await Te(this,Df).start();return await((u=(c=Te(this,Pi).config).onSuccess)==null?void 0:u.call(c,D,e,this.state.context,this,n)),await((h=(d=this.options).onSuccess)==null?void 0:h.call(d,D,e,this.state.context,n)),await((m=(f=Te(this,Pi).config).onSettled)==null?void 0:m.call(f,D,null,this.state.variables,this.state.context,this,n)),await((y=(g=this.options).onSettled)==null?void 0:y.call(g,D,null,e,this.state.context,n)),hs(this,mu,gh).call(this,{type:"success",data:D}),D}catch(D){try{await((w=(b=Te(this,Pi).config).onError)==null?void 0:w.call(b,D,e,this.state.context,this,n))}catch(A){Promise.reject(A)}try{await((N=(j=this.options).onError)==null?void 0:N.call(j,D,e,this.state.context,n))}catch(A){Promise.reject(A)}try{await((E=(S=Te(this,Pi).config).onSettled)==null?void 0:E.call(S,void 0,D,this.state.variables,this.state.context,this,n))}catch(A){Promise.reject(A)}try{await((T=(C=this.options).onSettled)==null?void 0:T.call(C,void 0,D,e,this.state.context,n))}catch(A){Promise.reject(A)}throw hs(this,mu,gh).call(this,{type:"error",error:D}),D}finally{Te(this,Pi).runNext(this)}}},P0=new WeakMap,hu=new WeakMap,Pi=new WeakMap,Df=new WeakMap,mu=new WeakSet,gh=function(e){const r=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=r(this.state),La.batch(()=>{Te(this,hu).forEach(n=>{n.onMutationUpdate(e)}),Te(this,Pi).notify({mutation:this,type:"updated",action:e})})},pM);function tP(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var dd,Dc,R0,gM,yZ=(gM=class extends Cx{constructor(e={}){super();kr(this,dd);kr(this,Dc);kr(this,R0);this.config=e,er(this,dd,new Set),er(this,Dc,new Map),er(this,R0,0)}build(e,r,n){const a=new xZ({client:e,mutationCache:this,mutationId:++Xb(this,R0)._,options:e.defaultMutationOptions(r),state:n});return this.add(a),a}add(e){Te(this,dd).add(e);const r=iv(e);if(typeof r=="string"){const n=Te(this,Dc).get(r);n?n.push(e):Te(this,Dc).set(r,[e])}this.notify({type:"added",mutation:e})}remove(e){if(Te(this,dd).delete(e)){const r=iv(e);if(typeof r=="string"){const n=Te(this,Dc).get(r);if(n)if(n.length>1){const a=n.indexOf(e);a!==-1&&n.splice(a,1)}else n[0]===e&&Te(this,Dc).delete(r)}}this.notify({type:"removed",mutation:e})}canRun(e){const r=iv(e);if(typeof r=="string"){const n=Te(this,Dc).get(r),a=n==null?void 0:n.find(i=>i.state.status==="pending");return!a||a===e}else return!0}runNext(e){var n;const r=iv(e);if(typeof r=="string"){const a=(n=Te(this,Dc).get(r))==null?void 0:n.find(i=>i!==e&&i.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){La.batch(()=>{Te(this,dd).forEach(e=>{this.notify({type:"removed",mutation:e})}),Te(this,dd).clear(),Te(this,Dc).clear()})}getAll(){return Array.from(Te(this,dd))}find(e){const r={exact:!0,...e};return this.getAll().find(n=>EE(r,n))}findAll(e={}){return this.getAll().filter(r=>EE(e,r))}notify(e){La.batch(()=>{this.listeners.forEach(r=>{r(e)})})}resumePausedMutations(){const e=this.getAll().filter(r=>
vendor: 5,164 bytes, line 571
571r.state.isPaused);return La.batch(()=>Promise.all(e.map(r=>r.continue().catch(ao))))}},dd=new WeakMap,Dc=new WeakMap,R0=new WeakMap,gM);function iv(t){var e;return(e=t.options.scope)==null?void 0:e.id}var hd,Ph,Do,md,wd,$v,kF,xM,bZ=(xM=class extends Cx{constructor(r,n){super();kr(this,wd);kr(this,hd);kr(this,Ph);kr(this,Do);kr(this,md);er(this,hd,r),this.setOptions(n),this.bindMethods(),hs(this,wd,$v).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var a;const n=this.options;this.options=Te(this,hd).defaultMutationOptions(r),m1(this.options,n)||Te(this,hd).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Te(this,Do),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Wf(n.mutationKey)!==Wf(this.options.mutationKey)?this.reset():((a=Te(this,Do))==null?void 0:a.state.status)==="pending"&&Te(this,Do).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=Te(this,Do))==null||r.removeObserver(this)}onMutationUpdate(r){hs(this,wd,$v).call(this),hs(this,wd,kF).call(this,r)}getCurrentResult(){return Te(this,Ph)}reset(){var r;(r=Te(this,Do))==null||r.removeObserver(this),er(this,Do,void 0),hs(this,wd,$v).call(this),hs(this,wd,kF).call(this)}mutate(r,n){var a;return er(this,md,n),(a=Te(this,Do))==null||a.removeObserver(this),er(this,Do,Te(this,hd).getMutationCache().build(Te(this,hd),this.options)),Te(this,Do).addObserver(this),Te(this,Do).execute(r)}},hd=new WeakMap,Ph=new WeakMap,Do=new WeakMap,md=new WeakMap,wd=new WeakSet,$v=function(){var n;const r=((n=Te(this,Do))==null?void 0:n.state)??tP();er(this,Ph,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},kF=function(r){La.batch(()=>{var n,a,i,o,l,c,u,d;if(Te(this,md)&&this.hasListeners()){const h=Te(this,Ph).variables,f=Te(this,Ph).context,m={client:Te(this,hd),meta:this.options.meta,mutationKey:this.options.mutationKey};if((r==null?void 0:r.type)==="success"){try{(a=(n=Te(this,md)).onSuccess)==null||a.call(n,r.data,h,f,m)}catch(g){Promise.reject(g)}try{(o=(i=Te(this,md)).onSettled)==null||o.call(i,r.data,null,h,f,m)}catch(g){Promise.reject(g)}}else if((r==null?void 0:r.type)==="error"){try{(c=(l=Te(this,md)).onError)==null||c.call(l,r.error,h,f,m)}catch(g){Promise.reject(g)}try{(d=(u=Te(this,md)).onSettled)==null||d.call(u,void 0,r.error,h,f,m)}catch(g){Promise.reject(g)}}}this.listeners.forEach(h=>{h(Te(this,Ph))})})},xM),fu,yM,vZ=(yM=class extends Cx{constructor(e={}){super();kr(this,fu);this.config=e,er(this,fu,new Map)}build(e,r,n){const a=r.queryKey,i=r.queryHash??RC(a,r);let o=this.get(i);return o||(o=new hZ({client:e,queryKey:a,queryHash:i,options:e.defaultQueryOptions(r),state:n,defaultOptions:e.getQueryDefaults(a)}),this.add(o)),o}add(e){Te(this,fu).has(e.queryHash)||(Te(this,fu).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const r=Te(this,fu).get(e.queryHash);r&&(e.destroy(),r===e&&Te(this,fu).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){La.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return Te(this,fu).get(e)}getAll(){return[...Te(this,fu).values()]}find(e){const r={exact:!0,...e};return this.getAll().find(n=>_E(r,n))}findAll(e={}){const r=this.getAll();return Object.keys(e).length>0?r.filter(n=>_E(e,n)):r}notify(e){La.batch(()=>{this.listeners.forEach(r=>{r(e)})})}onFocus(){La.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){La.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},fu=new WeakMap,yM),$n,Rh,Bh,$g,Wg,Lh,qg,Gg,bM,wZ=(bM=class{constructor(t={}){kr(this,$n);kr(this,Rh);kr(this,Bh);kr(this,$g);kr(this,Wg);kr(this,Lh);kr(this,qg);kr(this,Gg);er(this,$n,t.queryCache||new vZ),er(this,Rh,t.mutationCache||new yZ),er(this,Bh,t.defaultOptions||{}),er(this,$g,new Map),er(this,Wg,new Map),er(this,Lh,0)}mount(){Xb(this,Lh)._++,Te(this,Lh)===1&&(er(this,qg,IC.subscribe(async t=>{t&&(await this.resumePausedMutations(),Te(this,$n).onFocus())})),er(this,Gg,f1.subscribe(async t=>{t&&(await this.resumePausedMutations(),Te(this,$n).onOnline())})))}unmount(){var t,e;Xb(this,Lh)._--,Te(this,Lh)===0&&((t=Te(this,qg))==null||t.call(this),er(this,qg,void 0),(e=Te(this,Gg))==null||e.call(this),er(this,Gg,void 0))}isFetching(t){return Te(this,$n).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return Te(this,Rh).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=Te(this,$n).get(e.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),r=Te(this,$n).build(this,e),n=r.state.data;return n===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(Gh(e.staleTime,r))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(t){return Te(this,$n).findAll(t).map(({queryKey:e,state:r})=>{const n=r.data;return[e,n]})}setQueryData(t,e,r){const n=this.defaultQueryOptions({queryKey:t}),a=Te(this,$n).get(n.queryHash),i=a==null?void 0:a.state.data,o=tZ(e,i);if(o!==void 0)return Te(this,$n).build(this,n).setData(o,{...r,manual:!0})}
571setQueriesData(t,e,r){return La.batch(()=>Te(this,$n).findAll(t).map(({queryKey:n})=>[n,this.setQueryData(n,e,r)]))}getQueryState(t){var r;const e=this.defaultQueryOptions({queryKey:t});return(r=Te(this,$n).get(e.queryHash))==null?void 0:r.state}removeQueries(t){const e=Te(this,$n);La.batch(()=>{e.findAll(t).forEach(r=>{e.remove(r)})})}resetQueries(t,e){const r=Te(this,$n);return La.batch(()=>(r.findAll(t).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const r={revert:!0,...e},n=La.batch(()=>Te(this,$n).findAll(t).map(a=>a.cancel(r)));return Promise.all(n).then(ao).catch(ao)}invalidateQueries(t,e={}){return La.batch(()=>(Te(this,$n).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const r={...e,cancelRefetch:e.cancelRefetch??!0},n=La.batch(()=>Te(this,$n).findAll(t).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,r);return r.throwOnError||(i=i.catch(ao)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(ao)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const r=Te(this,$n).build(this,e);return r.isStaleByTime(Gh(e.staleTime,r))?r.fetch(e):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(ao).catch(ao)}fetchInfiniteQuery(t){return t.behavior=BE(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(ao).catch(ao)}ensureInfiniteQueryData(t){return t.behavior=BE(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return f1.isOnline()?Te(this,Rh).resumePausedMutations():Promise.resolve()}getQueryCache(){return Te(this,$n)}getMutationCache(){return Te(this,Rh)}getDefaultOptions(){return Te(this,Bh)}setDefaultOptions(t){er(this,Bh,t)}setQueryDefaults(t,e){Te(this,$g).set(Wf(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...Te(this,$g).values()],r={};return e.forEach(n=>{t0(t,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(t,e){Te(this,Wg).set(Wf(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...Te(this,Wg).values()],r={};return e.forEach(n=>{t0(t,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const e={...Te(this,Bh).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=RC(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===BC&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...Te(this,Bh).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){Te(this,$n).clear(),Te(this,Rh).clear()}},$n=new WeakMap,Rh=new WeakMap,Bh=new WeakMap,$g=new WeakMap,Wg=new WeakMap,Lh=new WeakMap,qg=new WeakMap,Gg=new WeakMap,bM),rP=x.createContext(void 0),Su=t=>{const e=x.useContext(rP);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},jZ=({client:t,children:e})=>(x.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),s.jsx(rP.Provider,{value:t,children:e})),sP=x.createContext(!1),NZ=()=>x.useContext(sP);sP.Provider;function FZ(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var SZ=x.createContext(FZ()),CZ=()=>x.useContext(SZ),kZ=(t,e,r)=>{const n=r!=null&&r.state.error&&typeof t.throwOnError=="function"?LC(t.throwOnError,[r.state.error,r]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||n)&&(e.isReset()||(t.retryOnMount=!1))},_Z=t=>{x.useEffect(()=>{t.clearReset()},[t])},EZ=({result:t,errorResetBoundary:e,throwOnError:r,query:n,suspense:a})=>t.isError&&!e.isReset()&&!t.isFetching&&n&&(a&&t.data===void 0||LC(r,[t.error,n])),AZ=t=>{if(t.suspense){const r=a=>a==="static"?a:Math.max(a??1e3,1e3),n=t.staleTime;t.staleTime=typeof n=="function"?(...a)=>r(n(...a)):r(n),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},DZ=(t,e)=>t.isLoading&&t.isFetching&&!e,TZ=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,IE=(t,e,r)=>e.fetchOptimistic(t).catch(()=>{r.clearReset()});function MZ(t,e,r){var f,m,g,y;const n=NZ(),a=CZ(),i=Su(),o=i.defaultQueryOptions(t);(m=(f=i.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||m.call(f,o);const l=i.getQueryCache().get(o.queryHash);o._optimisticResults=n?"isRestoring":"optimistic",AZ(o),kZ(o,a,l),_Z(a);const c=!i.getQueryCache().get(o.queryHash),[u]=x.useState(()=>new e(i,o)),d=u.getOptimisticResult(o),h=!n&&t.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(b=>{const w=h?u.subscribe(La.batchCalls(b)):ao;return u.updateResult(),w},[u,h]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),x.useEffect(()=>{u.setOptions(o)},[o,u]),TZ(o,d))throw IE(o,u,a);if(EZ({result:d,errorResetBoundary:a,throwOnError:o.throwOnError,query:l,suspense:o.suspense}))throw d.error;if((y=(g=i.getDefaultOptions().queries)==null?void 0:g._experimental_afterQuery)==null||y.call(g,o,d),o.experimental_prefetchInRender&&!$f&&DZ(d,n)){const b=c?IE(o,u,a):l==null?void 0:l.promise;b==null||b.catch(ao).finally(()=>{u.updateResult()})}return o.notifyOnChangeProps?d:u.trackResult(d)}function kx(t,e){return MZ(t,mZ)}function $l(t,e){const r=Su(),[n]=x.useState(()=>new bZ(r,t));x.useEffect(()=>{n.setOptions(t)},[n,t]);
vendor: 9,896 bytes, lines 571-589
571const a=x.useSyncExternalStore(x.useCallback(o=>n.subscribe(La.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),i=x.useCallback((o,l)=>{n.mutate(o,l).catch(ao)},[n]);if(a.error&&LC(n.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:i,mutateAsync:a.mutate}}/** 572 * @remix-run/router v1.23.2 573 * 574 * Copyright (c) Remix Software Inc. 575 * 576 * This source code is licensed under the MIT license found in the 577 * LICENSE.md file in the root directory of this source tree. 578 * 579 * @license MIT 580 */function r0(){return r0=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},r0.apply(this,arguments)}var Oh;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(Oh||(Oh={}));const OE="popstate";function PZ(t){t===void 0&&(t={});function e(n,a){let{pathname:i,search:o,hash:l}=n.location;return _F("",{pathname:i,search:o,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:p1(a)}return BZ(e,r,null,t)}function ua(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function zC(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function RZ(){return Math.random().toString(36).substr(2,8)}function zE(t,e){return{usr:t.state,key:t.key,idx:e}}function _F(t,e,r,n){return r===void 0&&(r=null),r0({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?_x(e):e,{state:r,key:e&&e.key||n||RZ()})}function p1(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function _x(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function BZ(t,e,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,o=a.history,l=Oh.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(r0({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function h(){l=Oh.Pop;let b=d(),w=b==null?null:b-u;u=b,c&&c({action:l,location:y.location,delta:w})}function f(b,w){l=Oh.Push;let j=_F(y.location,b,w);u=d()+1;let N=zE(j,u),S=y.createHref(j);try{o.pushState(N,"",S)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;a.location.assign(S)}i&&c&&c({action:l,location:y.location,delta:1})}function m(b,w){l=Oh.Replace;let j=_F(y.location,b,w);u=d();let N=zE(j,u),S=y.createHref(j);o.replaceState(N,"",S),i&&c&&c({action:l,location:y.location,delta:0})}function g(b){let w=a.location.origin!=="null"?a.location.origin:a.location.href,j=typeof b=="string"?b:p1(b);return j=j.replace(/ $/,"%20"),ua(w,"No window.location.(origin|href) available to create URL for href: "+j),new URL(j,w)}let y={get action(){return l},get location(){return t(a,o)},listen(b){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(OE,h),c=b,()=>{a.removeEventListener(OE,h),c=null}},createHref(b){return e(a,b)},createURL:g,encodeLocation(b){let w=g(b);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:f,replace:m,go(b){return o.go(b)}};return y}var UE;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(UE||(UE={}));function LZ(t,e,r){return r===void 0&&(r="/"),IZ(t,e,r)}function IZ(t,e,r,n){let a=typeof e=="string"?_x(e):e,i=UC(a.pathname||"/",r);if(i==null)return null;let o=nP(t);OZ(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=ZZ(i);l=KZ(o[c],u)}return l}function nP(t,e,r,n){e===void 0&&(e=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(ua(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=Vh([n,c.relativePath]),d=r.concat(c);i.children&&i.children.length>0&&(ua(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),nP(i.children,e,d,u)),!(i.path==null&&!i.index)&&e.push({path:u,score:GZ(u,i.index),routesMeta:d})};return t.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))a(i,o);else for(let c of aP(i.path))a(i,o,c)}),e}function aP(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let o=aP(n.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),a&&l.push(...o),l.map(c=>t.startsWith("/")&&c===""?"/":c)}function OZ(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:VZ(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const zZ=/^:[\w-]+$/,UZ=3,HZ=2,$Z=1,WZ=10,qZ=-2,HE=t=>t==="*";function GZ(t,e){let r=t.split("/"),n=r.length;return r.some(HE)&&(n+=qZ),e&&(n+=HZ),r.filter(a=>!HE(a)).reduce((a,i)=>a+(zZ.test(i)?UZ:i===""?$Z:WZ),n)}function VZ(t,e){return t.length===e.length&&t.slice(0,-1).every((n,a)=>n===e[a])?t[t.length-1]-e[e.length-1]:0}function KZ(t,e,r){let{routesMeta:n}=t,a={},i="/",o=[];for(let l=0;l<n.length;++l){let c=n[l],u=l===n.length-1,d=i==="/"?e:e.slice(i.length)||"/",h=JZ({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),f=c.route;if(!h)return null;Object.assign(a,h.params),o.push({params:a,pathname:Vh([i,h.pathname]),pathnameBase:rX(Vh([i,h.pathnameBase])),route:f}),h.pathnameBase!=="/"&&(i=Vh([i,h.pathnameBase]))}return o}function JZ(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,n]=YZ(t.path,t.caseSensitive,t.end),a=e.match(r);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((u,d,h)=>{let{paramName:f,isOptional:m}=d;if(f==="*"){let y=l[h]||"";o=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const g=l[h];return m&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:t}}function YZ(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),zC(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],a="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),a+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":t!==""&&t!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,e?void 0:"i"),n]}function ZZ(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return zC(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function UC(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}const XZ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,QZ=t=>XZ.test(t);function eX(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:a=""}=typeof t=="string"?_x(t):t,i;if(r)if(QZ(r))i=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),zC(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?i=$E(r.substring(1),"/"):i=$E(r,e)}else i=e;return{pathname:i,search:sX(n),hash:nX(a)}}function $E(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function N2(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function tX(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function HC(t,e){let r=tX(t);return e?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function $C(t,e,r,n){n===void 0&&(n=!1);let a;typeof t=="string"?a=_x(t):(a=r0({},t),ua(!a.pathname||!a.pathname.includes("?"),N2("?","pathname","search",a)),ua(!a.pathname||!a.pathname.includes("#"),N2("#","pathname","hash",a)),ua(!a.search||!a.search.includes("#"),N2("#","search","hash",a)));let i=t===""||a.pathname==="",o=i?"/":a.pathname,l;if(o==null)l=r;else{let h=e.length-1;if(!n&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),h-=1;a.pathname=f.join("/")}l=h>=0?e[h]:"/"}let c=eX(a,l),u=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Vh=t=>t.join("/").replace(/\/\/+/g,"/"),rX=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),sX=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,nX=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function aX(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const iP=["post","put","patch","delete"];new Set(iP);const iX=["get",...iP];new Set(iX);/** 581 * React Router v6.30.3 582 * 583 * Copyright (c) Remix Software Inc. 584 * 585 * This source code is licensed under the MIT license found in the 586 * LICENSE.md file in the root directory of this source tree. 587 * 588 * @license MIT 589 */function s0(){return s0=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];
vendor: 5,331 bytes, line 589
589for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},s0.apply(this,arguments)}const WC=x.createContext(null),oX=x.createContext(null),um=x.createContext(null),Fw=x.createContext(null),Cu=x.createContext({outlet:null,matches:[],isDataRoute:!1}),oP=x.createContext(null);function lX(t,e){let{relative:r}=e===void 0?{}:e;Ex()||ua(!1);let{basename:n,navigator:a}=x.useContext(um),{hash:i,pathname:o,search:l}=cP(t,{relative:r}),c=o;return n!=="/"&&(c=o==="/"?n:Vh([n,o])),a.createHref({pathname:c,search:l,hash:i})}function Ex(){return x.useContext(Fw)!=null}function Wi(){return Ex()||ua(!1),x.useContext(Fw).location}function lP(t){x.useContext(um).static||x.useLayoutEffect(t)}function ks(){let{isDataRoute:t}=x.useContext(Cu);return t?NX():cX()}function cX(){Ex()||ua(!1);let t=x.useContext(WC),{basename:e,future:r,navigator:n}=x.useContext(um),{matches:a}=x.useContext(Cu),{pathname:i}=Wi(),o=JSON.stringify(HC(a,r.v7_relativeSplatPath)),l=x.useRef(!1);return lP(()=>{l.current=!0}),x.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){n.go(u);return}let h=$C(u,JSON.parse(o),i,d.relative==="path");t==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:Vh([e,h.pathname])),(d.replace?n.replace:n.push)(h,d.state,d)},[e,n,o,i,t])}const uX=x.createContext(null);function dX(t){let e=x.useContext(Cu).outlet;return e&&x.createElement(uX.Provider,{value:t},e)}function Dd(){let{matches:t}=x.useContext(Cu),e=t[t.length-1];return e?e.params:{}}function cP(t,e){let{relative:r}=e===void 0?{}:e,{future:n}=x.useContext(um),{matches:a}=x.useContext(Cu),{pathname:i}=Wi(),o=JSON.stringify(HC(a,n.v7_relativeSplatPath));return x.useMemo(()=>$C(t,JSON.parse(o),i,r==="path"),[t,o,i,r])}function hX(t,e){return mX(t,e)}function mX(t,e,r,n){Ex()||ua(!1);let{navigator:a}=x.useContext(um),{matches:i}=x.useContext(Cu),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=Wi(),d;if(e){var h;let b=typeof e=="string"?_x(e):e;c==="/"||(h=b.pathname)!=null&&h.startsWith(c)||ua(!1),d=b}else d=u;let f=d.pathname||"/",m=f;if(c!=="/"){let b=c.replace(/^\//,"").split("/");m="/"+f.replace(/^\//,"").split("/").slice(b.length).join("/")}let g=LZ(t,{pathname:m}),y=yX(g&&g.map(b=>Object.assign({},b,{params:Object.assign({},l,b.params),pathname:Vh([c,a.encodeLocation?a.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?c:Vh([c,a.encodeLocation?a.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),i,r,n);return e&&y?x.createElement(Fw.Provider,{value:{location:s0({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Oh.Pop}},y):y}function fX(){let t=jX(),e=aX(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},e),r?x.createElement("pre",{style:a},r):null,null)}const pX=x.createElement(fX,null);class gX extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error!==void 0?x.createElement(Cu.Provider,{value:this.props.routeContext},x.createElement(oP.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function xX(t){let{routeContext:e,match:r,children:n}=t,a=x.useContext(WC);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),x.createElement(Cu.Provider,{value:e},n)}function yX(t,e,r,n){var a;if(e===void 0&&(e=[]),r===void 0&&(r=null),n===void 0&&(n=null),t==null){var i;if(!r)return null;if(r.errors)t=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let o=t,l=(a=r)==null?void 0:a.errors;if(l!=null){let d=o.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);d>=0||ua(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d<o.length;d++){let h=o[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=d),h.route.id){let{loaderData:f,errors:m}=r,g=h.route.loader&&f[h.route.id]===void 0&&(!m||m[h.route.id]===void 0);if(h.route.lazy||g){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,h,f)=>{let m,g=!1,y=null,b=null;r&&(m=l&&h.route.id?l[h.route.id]:void 0,y=h.route.errorElement||pX,c&&(u<0&&f===0?(FX("route-fallback"),g=!0,b=null):u===f&&(g=!0,b=h.route.hydrateFallbackElement||null)));let w=e.concat(o.slice(0,f+1)),j=()=>{let N;return m?N=y:g?N=b:h.route.Component?N=x.createElement(h.route.Component,null):h.route.element?N=h.route.element:N=d,x.createElement(xX,{match:h,routeC
589ontext:{outlet:d,matches:w,isDataRoute:r!=null},children:N})};return r&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?x.createElement(gX,{location:r.location,revalidation:r.revalidation,component:y,error:m,children:j(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):j()},null)}var uP=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(uP||{}),dP=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(dP||{});function bX(t){let e=x.useContext(WC);return e||ua(!1),e}function vX(t){let e=x.useContext(oX);return e||ua(!1),e}function wX(t){let e=x.useContext(Cu);return e||ua(!1),e}function hP(t){let e=wX(),r=e.matches[e.matches.length-1];return r.route.id||ua(!1),r.route.id}function jX(){var t;let e=x.useContext(oP),r=vX(),n=hP();return e!==void 0?e:(t=r.errors)==null?void 0:t[n]}function NX(){let{router:t}=bX(uP.UseNavigateStable),e=hP(dP.UseNavigateStable),r=x.useRef(!1);return lP(()=>{r.current=!0}),x.useCallback(function(a,i){i===void 0&&(i={}),r.current&&(typeof a=="number"?t.navigate(a):t.navigate(a,s0({fromRouteId:e},i)))},[t,e])}const WE={};function FX(t,e,r){WE[t]||(WE[t]=!0)}function SX(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function Tf(t){let{to:e,replace:r,state:n,relative:a}=t;Ex()||ua(!1);let{future:i,static:o}=x.useContext(um),{matches:l}=x.useContext(Cu),{pathname:c}=Wi(),u=ks(),d=$C(e,HC(l,i.v7_relativeSplatPath),c,a==="path"),h=JSON.stringify(d);return x.useEffect(()=>u(JSON.parse(h),{replace:r,state:n,relative:a}),[u,h,a,r,n]),null}function mP(t){return dX(t.context)}function Pt(t){ua(!1)}function CX(t){let{basename:e="/",children:r=null,location:n,navigationType:a=Oh.Pop,navigator:i,static:o=!1,future:l}=t;Ex()&&ua(!1);let c=e.replace(/^\/*/,"/"),u=x.useMemo(()=>({basename:c,navigator:i,static:o,future:s0({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof n=="string"&&(n=_x(n));let{pathname:d="/",search:h="",hash:f="",state:m=null,key:g="default"}=n,y=x.useMemo(()=>{let b=UC(d,c);return b==null?null:{location:{pathname:b,search:h,hash:f,state:m,key:g},navigationType:a}},[c,d,h,f,m,g,a]);return y==null?null:x.createElement(um.Provider,{value:u},x.createElement(Fw.Provider,{children:r,value:y}))}function kX(t){let{children:e,location:r}=t;return hX(EF(e),r)}new Promise(()=>{});function EF(t,e){e===void 0&&(e=[]);let r=[];return x.Children.forEach(t,(n,a)=>{if(!x.isValidElement(n))return;let i=[...e,a];if(n.type===x.Fragment){r.push.apply(r,EF(n.props.children,i));return}n.type!==Pt&&ua(!1),!n.props.index||!n.props.children||ua(!1);let o={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=EF(n.props.children,i)),r.push(o)}),r}/** 590 * React Router DOM v6.30.3 591 * 592 * Copyright (c) Remix Software Inc. 593 * 594 * This source code is licensed under the MIT license found in the 595 * LICENSE.md file in the root directory of this source tree. 596 * 597 * @license MIT 598 */function AF(){return AF=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},AF.apply(this,arguments)}function _X(t,e){if(t==null)return{};var r={},n=Object.keys(t),a,i;for(i=0;i<n.length;i++)a=n[i],!(e.indexOf(a)>=0)&&(r[a]=t[a]);return r}function EX(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function AX(t,e){return t.button===0&&(!e||e==="_self")&&!EX(t)}function DF(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,r)=>{let n=t[r];return e.concat(Array.isArray(n)?n.map(a=>[r,a]):[[r,n]])},[]))}function DX(t,e){let r=DF(t);return e&&e.forEach((n,a)=>
598{r.has(a)||e.getAll(a).forEach(i=>{r.append(a,i)})}),r}const TX=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],MX="6";try{window.__reactRouterVersion=MX}catch{}const PX="startTransition",qE=uw[PX];function RX(t){let{basename:e,children:r,future:n,window:a}=t,i=x.useRef();i.current==null&&(i.current=PZ({window:a,v5Compat:!0}));let o=i.current,[l,c]=x.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},d=x.useCallback(h=>{u&&qE?qE(()=>c(h)):c(h)},[c,u]);return x.useLayoutEffect(()=>o.listen(d),[o,d]),x.useEffect(()=>SX(n),[n]),x.createElement(CX,{basename:e,children:r,location:l.location,navigationType:l.action,navigator:o,future:n})}const BX=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",LX=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,rt=x.forwardRef(function(e,r){let{onClick:n,relative:a,reloadDocument:i,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:h}=e,f=_X(e,TX),{basename:m}=x.useContext(um),g,y=!1;if(typeof u=="string"&&LX.test(u)&&(g=u,BX))try{let N=new URL(window.location.href),S=u.startsWith("//")?new URL(N.protocol+u):new URL(u),E=UC(S.pathname,m);S.origin===N.origin&&E!=null?u=E+S.search+S.hash:y=!0}catch{}let b=lX(u,{relative:a}),w=IX(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:a,viewTransition:h});function j(N){n&&n(N),N.defaultPrevented||w(N)}return x.createElement("a",AF({},f,{href:g||b,onClick:y||i?n:j,ref:r,target:c}))});var GE;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(GE||(GE={}));var VE;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(VE||(VE={}));function IX(t,e){let{target:r,replace:n,state:a,preventScrollReset:i,relative:o,viewTransition:l}=e===void 0?{}:e,c=ks(),u=Wi(),d=cP(t,{relative:o});return x.useCallback(h=>{if(AX(h,r)){h.preventDefault();let f=n!==void 0?n:p1(u)===p1(d);c(t,{replace:f,state:a,preventScrollReset:i,relative:o,viewTransition:l})}},[u,c,d,n,a,r,t,i,o,l])}function Td(t){let e=x.useRef(DF(t)),r=x.useRef(!1),n=Wi(),a=x.useMemo(()=>DX(n.search,r.current?null:e.current),[n.search]),i=ks(),o=x.useCallback((l,c)=>{const u=DF(typeof l=="function"?l(a):l);r.current=!0,i("?"+u,c)},[i,a]);return[a,o]}const fP="https://ntfepejabevzvrpomvpd.supabase.co",OX="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im50ZmVwZWphYmV2enZycG9tdnBkIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDQyOTk4MzIsImV4cCI6MjA1OTg3NTgzMn0.jn50xDz6nXKOQdRXPfa6NfkEG576z6eoq0rW42AsSsI",zX="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im50ZmVwZWphYmV2enZycG9tdnBkIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTc0NDI5OTgzMiwiZXhwIjoyMDU5ODc1ODMyfQ.KutGI6ij1VXfghiucTOPVwPoVDBNgCTEOAvidDuS7m4",Q=vM(fP,OX,{auth:{persistSession:!0,autoRefreshToken:!0,detectSessionInUrl:!0,storage:window.localStorage,flowType:"pkce"}}),UX=vM(fP,zX,{auth:{autoRefreshToken:!1,persistSession:!1}});var pP={},gP={},xP={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];if(typeof window<"u"){var l;typeof window.gtag>"u"&&(window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)}),(l=window).gtag.apply(l,i)}},r=e;t.default=r})(xP);var yP={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;var e=/^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;function r(l){return l.toString().trim().replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g,function(c,u,d){return u>0&&u+c.length!==d.length&&c.search(e)>-1&&d.charAt(u-2)!==":"&&(d.charAt(u+c.length)!=="-"||d.charAt(u-1)==="-")&&d.charAt(u-1).search(/[^\s-]/)<0?c.toLowerCase():c.substr(1).search(/[A-Z]|\../)>-1?c:c.charAt(0).toUpperCase()+c.substr(1)})}function n(l){return typeof l=="string"&&l.indexOf("@")!==-1}var a="REDACTED (Potential Email Address)";function i(l){return n(l)?(console.warn("This arg looks like an email address, redacting."),a):l}function o(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,d=l||"";return c&&(d=r(l)),u&&(d=i(d)),d}})(yP);
598(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.GA4=void 0;var e=o(xP),r=o(yP),n=["eventCategory","eventAction","eventLabel","eventValue","hitType"],a=["title","location"],i=["page","hitType"];function o(I){return I&&I.__esModule?I:{default:I}}function l(I,O){if(I==null)return{};var V=c(I,O),G,B;if(Object.getOwnPropertySymbols){var $=Object.getOwnPropertySymbols(I);for(B=0;B<$.length;B++)G=$[B],!(O.indexOf(G)>=0)&&Object.prototype.propertyIsEnumerable.call(I,G)&&(V[G]=I[G])}return V}function c(I,O){if(I==null)return{};var V={},G=Object.keys(I),B,$;for($=0;$<G.length;$++)B=G[$],!(O.indexOf(B)>=0)&&(V[B]=I[B]);return V}function u(I){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(O){return typeof O}:function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},u(I)}function d(I){return m(I)||f(I)||j(I)||h()}function h(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 599In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f(I){if(typeof Symbol<"u"&&I[Symbol.iterator]!=null||I["@@iterator"]!=null)return Array.from(I)}function m(I){if(Array.isArray(I))return N(I)}function g(I,O){var V=Object.keys(I);if(Object.getOwnPropertySymbols){var G=Object.getOwnPropertySymbols(I);O&&(G=G.filter(function(B){return Object.getOwnPropertyDescriptor(I,B).enumerable})),V.push.apply(V,G)}return V}function y(I){for(var O=1;O<arguments.length;O++){var V=arguments[O]!=null?arguments[O]:{};O%2?g(Object(V),!0).forEach(function(G){A(I,G,V[G])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(V)):g(Object(V)).forEach(function(G){Object.defineProperty(I,G,Object.getOwnPropertyDescriptor(V,G))})}return I}function b(I,O){return E(I)||S(I,O)||j(I,O)||w()}function w(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 600In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function j(I,O){if(I){if(typeof I=="string")return N(I,O);var V=Object.prototype.toString.call(I).slice(8,-1);if(V==="Object"&&I.constructor&&(V=I.constructor.name),V==="Map"||V==="Set")return Array.from(I);if(V==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(V))return N(I,O)}}function N(I,O){(O==null||O>I.length)&&(O=I.length);for(var V=0,G=new Array(O);V<O;V++)G[V]=I[V];return G}function S(I,O){var V=I==null?null:typeof Symbol<"u"&&I[Symbol.iterator]||I["@@iterator"];if(V!=null){var G,B,$,W,oe=[],K=!0,H=!1;try{if($=(V=V.call(I)).next,O!==0)for(;!(K=(G=$.call(V)).done)&&(oe.push(G.value),oe.length!==O);K=!0);}catch(X){H=!0,B=X}finally{try{if(!K&&V.return!=null&&(W=V.return(),Object(W)!==W))return}finally{if(H)throw B}}return oe}}function E(I){if(Array.isArray(I))return I}function C(I,O){if(!(I instanceof O))throw new TypeError("Cannot call a class as a function")}function T(I,O){for(var V=0;V<O.length;V++){var G=O[V];G.enumerable=G.enumerable||!1,G.configurable=!0,"value"in G&&(G.writable=!0),Object.defineProperty(I,R(G.key),G)}}function D(I,O,V){return O&&T(I.prototype,O),Object.defineProperty(I,"prototype",{writable:!1}),I}function A(I,O,V){return O=R(O),O in I?Object.defineProperty(I,O,{value:V,enumerable:!0,configurable:!0,writable:!0}):I[O]=V,I}function R(I){var O=M(I,"string");return u(O)==="symbol"?O:String(O)}function M(I,O){if(u(I)!=="object"||I===null)return I;var V=I[Symbol.toPrimitive];if(V!==void 0){var G=V.call(I,O);if(u(G)!=="object")return G;throw new TypeError("@@toPrimitive must return a primitive value.")}return(O==="string"?String:Number)(I)}var P=function(){function I(){var O=this;C(this,I),A(this,"reset",function(){O.isInitialized=!1,O._testMode=!1,O._currentMeasurementId,O._hasLoadedGA=!1,O._isQueuing=!1,O._queueGtag=[]}),A(this,"_gtag",function(){for(var V=arguments.length,G=new Array(V),B=0;B<V;B++)G[B]=arguments[B];O._testMode||O._isQueuing?O._queueGtag.push(G):e.default.apply(void 0,G)}),A(this,"_loadGA",function(V,G){var B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"https://www.googletagmanager.com/gtag/js";if(!(typeof window>"u"||typeof document>"u")&&!O._hasLoadedGA){var $=document.createElement("script");$.async=!0,$.src="".concat(B,"?id=").concat(V),G&&$.setAttribute("nonce",G),document.body.appendChild($),window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},O._hasLoadedGA=!0}}),A(this,"_toGtagOptions",function(V){if(V){var G={cookieUpdate:"cookie_update",cookieExpires:"cookie_expires",cookieDomain:"cookie_domain",cookieFlags:"cookie_flags",userId:"user_id",clientId:"client_id",anonymizeIp:"anonymize_ip",contentGroup1:"content_group1",contentGroup2:"content_group2",contentGroup3:"content_group3",contentGroup4:"content_group4",contentGroup5:"content_group5",allowAdFeatures:"allow_google_signals",allowAdPersonalizationSignals:"allow_ad_personalization_signals",nonInteraction:"non_interaction",page:"page_path",hitCallback:"event_callback"},B=Object.entries(V).reduce(function($,W){var oe=b(W,2),K=oe[0],H=oe[1];return G[K]?$[G[K]]=H:$[K]=H,$},{});return B}}),A(this,"initialize",function(V){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!V)throw new Error("Require GA_MEASUREMENT_ID");var B=typeof V=="string"?[{trackingId:V}]:V;O._currentMeasurementId=B[0].trackingId;var $=G.gaOptions,W=G.gtagOptions,oe=G.nonce,K=G.testMode,H=K===void 0?!1:K,X=G.gtagUrl;if(O._testMode=H,H||O._loadGA(O._currentMeasurementId,oe,X),O.isInitialized||(O._gtag("js",new Date),B.forEach(function(ee){var he=y(y(y({},O._toGtagOptions(y(y({},$),ee.gaOptions))),W),ee.gtagOptions);Object.keys(he).length?O._gtag("config",ee.trackingId,he):O._gtag("config",ee.trackingId)})),O.isInitialized=!0,!H){var me=d(O._queueGtag);for(O._queueGtag=[],O._isQueuing=!1;me.length;){var ie=me.shift();O._gtag.apply(O,d(ie)),ie[0]==="get"&&(O._isQueuing=!0)}}}),A(this,"set",function(V){if(!V){console.warn("`fieldsObject` is required in .set()");return}if(u(V)!=="object"){console.warn("Expected `fieldsObject` arg to be an Object");return}
600Object.keys(V).length===0&&console.warn("empty `fieldsObject` given to .set()"),O._gaCommand("set",V)}),A(this,"_gaCommandSendEvent",function(V,G,B,$,W){O._gtag("event",G,y(y({event_category:V,event_label:B,value:$},W&&{non_interaction:W.nonInteraction}),O._toGtagOptions(W)))}),A(this,"_gaCommandSendEventParameters",function(){for(var V=arguments.length,G=new Array(V),B=0;B<V;B++)G[B]=arguments[B];if(typeof G[0]=="string")O._gaCommandSendEvent.apply(O,d(G.slice(1)));else{var $=G[0],W=$.eventCategory,oe=$.eventAction,K=$.eventLabel,H=$.eventValue;$.hitType;var X=l($,n);O._gaCommandSendEvent(W,oe,K,H,X)}}),A(this,"_gaCommandSendTiming",function(V,G,B,$){O._gtag("event","timing_complete",{name:G,value:B,event_category:V,event_label:$})}),A(this,"_gaCommandSendPageview",function(V,G){if(G&&Object.keys(G).length){var B=O._toGtagOptions(G),$=B.title,W=B.location,oe=l(B,a);O._gtag("event","page_view",y(y(y(y({},V&&{page_path:V}),$&&{page_title:$}),W&&{page_location:W}),oe))}else V?O._gtag("event","page_view",{page_path:V}):O._gtag("event","page_view")}),A(this,"_gaCommandSendPageviewParameters",function(){for(var V=arguments.length,G=new Array(V),B=0;B<V;B++)G[B]=arguments[B];if(typeof G[0]=="string")O._gaCommandSendPageview.apply(O,d(G.slice(1)));else{var $=G[0],W=$.page;$.hitType;var oe=l($,i);O._gaCommandSendPageview(W,oe)}}),A(this,"_gaCommandSend",function(){for(var V=arguments.length,G=new Array(V),B=0;B<V;B++)G[B]=arguments[B];var $=typeof G[0]=="string"?G[0]:G[0].hitType;switch($){case"event":O._gaCommandSendEventParameters.apply(O,G);break;case"pageview":O._gaCommandSendPageviewParameters.apply(O,G);break;case"timing":O._gaCommandSendTiming.apply(O,d(G.slice(1)));break;case"screenview":case"transaction":case"item":case"social":case"exception":console.warn("Unsupported send command: ".concat($));break;default:console.warn("Send command doesn't exist: ".concat($))}}),A(this,"_gaCommandSet",function(){for(var V=arguments.length,G=new Array(V),B=0;B<V;B++)G[B]=arguments[B];typeof G[0]=="string"&&(G[0]=A({},G[0],G[1])),O._gtag("set",O._toGtagOptions(G[0]))}),A(this,"_gaCommand",function(V){for(var G=arguments.length,B=new Array(G>1?G-1:0),$=1;$<G;$++)B[$-1]=arguments[$];switch(V){case"send":O._gaCommandSend.apply(O,B);break;case"set":O._gaCommandSet.apply(O,B);break;default:console.warn("Command doesn't exist: ".concat(V))}}),A(this,"ga",function(){for(var V=arguments.length,G=new Array(V),B=0;B<V;B++)G[B]=arguments[B];if(typeof G[0]=="string")O._gaCommand.apply(O,G);else{var $=G[0];O._gtag("get",O._currentMeasurementId,"client_id",function(W){O._isQueuing=!1;var oe=O._queueGtag;for($({get:function(X){return X==="clientId"?W:X==="trackingId"?O._currentMeasurementId:X==="apiVersion"?"1":void 0}});oe.length;){var K=oe.shift();O._gtag.apply(O,d(K))}}),O._isQueuing=!0}return O.ga}),A(this,"event",function(V,G){if(typeof V=="string")O._gtag("event",V,O._toGtagOptions(G));else{var B=V.action,$=V.category,W=V.label,oe=V.value,K=V.nonInteraction,H=V.transport;if(!$||!B){console.warn("args.category AND args.action are required in event()");return}var X={hitType:"event",eventCategory:(0,r.default)($),eventAction:(0,r.default)(B)};W&&(X.eventLabel=(0,r.default)(W)),typeof oe<"u"&&(typeof oe!="number"?console.warn("Expected `args.value` arg to be a Number."):X.eventValue=oe),typeof K<"u"&&(typeof K!="boolean"?console.warn("`args.nonInteraction` must be a boolean."):X.nonInteraction=K),typeof H<"u"&&(typeof H!="string"?console.warn("`args.transport` must be a string."):(["beacon","xhr","image"].indexOf(H)===-1&&console.warn("`args.transport` must be either one of these values: `beacon`, `xhr` or `image`"),X.transport=H)),O._gaCommand("send",X)}}),A(this,"send",function(V){O._gaCommand("send",V)}),this.reset()}return D(I,[{key:"gtag",value:function(){this._gtag.apply(this,arguments)}}]),I}();t.GA4=P;var U=new P;t.default=U})(gP);(function(t){function e(l){"@babel/helpers - typeof";return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},e(l)}
600Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.ReactGAImplementation=void 0;var r=a(gP);function n(l){if(typeof WeakMap!="function")return null;var c=new WeakMap,u=new WeakMap;return(n=function(h){return h?u:c})(l)}function a(l,c){if(l&&l.__esModule)return l;if(l===null||e(l)!=="object"&&typeof l!="function")return{default:l};var u=n(c);if(u&&u.has(l))return u.get(l);var d={},h=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in l)if(f!=="default"&&Object.prototype.hasOwnProperty.call(l,f)){var m=h?Object.getOwnPropertyDescriptor(l,f):null;m&&(m.get||m.set)?Object.defineProperty(d,f,m):d[f]=l[f]}return d.default=l,u&&u.set(l,d),d}var i=r.GA4;t.ReactGAImplementation=i;var o=r.default;t.default=o})(pP);const Ax=iC(pP),HX=()=>{const t="G-6F58MGWST0";try{return Ax.initialize(t,{testMode:!1,gtagOptions:{debug_mode:!1,send_page_view:!0}}),console.log("Google Analytics initialized successfully with ID:",t),!0}catch(e){return console.error("Failed to initialize Google Analytics:",e),!1}},qC=(t,e)=>{try{Ax.send({hitType:"pageview",page:t,title:e||document.title})}catch(r){console.error("Failed to track page view:",r)}},Fn=(t,e,r,n)=>{try{Ax.event({action:t,category:e,label:r,value:n})}catch(a){console.error("Failed to track event:",a)}},Ia={viewBusiness:(t,e,r,n)=>{Fn("view_business","business_directory",`${e} (${t})`),Ax.event("view_item",{item_id:t,item_name:e,item_category:r||"business",content_type:"business_profile",custom_parameters:{business_location:n,page_type:"business_details"}}),typeof window<"u"&&window.gtag&&window.gtag("event","business_profile_view",{custom_map:{custom_dimension_1:e,custom_dimension_2:r,custom_dimension_3:n},business_id:t,business_name:e,business_category:r,business_location:n})},contactBusiness:(t,e,r)=>{Fn("contact_business","business_interaction",`${e} - ${r}`,1),typeof window<"u"&&window.gtag&&window.gtag("event","business_contact",{business_id:t,business_name:e,contact_method:r,event_category:"business_interaction",event_label:`${e} - ${r}`})},searchBusinesses:(t,e,r)=>{Fn("search_businesses","search",t,e),typeof window<"u"&&window.gtag&&window.gtag("event","business_search",{search_term:t,results_count:e,top_business_results:(r==null?void 0:r.slice(0,5).join(", "))||"",event_category:"search",event_label:t})},filterBusinesses:(t,e,r)=>{Fn("filter_businesses","filter",`${t}: ${e}`),typeof window<"u"&&window.gtag&&window.gtag("event","business_filter",{filter_type:t,filter_value:e,filtered_businesses:(r==null?void 0:r.slice(0,10).join(", "))||"",results_count:(r==null?void 0:r.length)||0,event_category:"filter",event_label:`${t}: ${e}`})},viewBusinessDirectory:(t,e,r=1)=>{Fn("view_business_directory","business_directory",`Page ${r}`,e),typeof window<"u"&&window.gtag&&window.gtag("event","business_directory_view",{visible_businesses:t.slice(0,15).join(", "),total_businesses:e,current_page:r,businesses_per_page:t.length,event_category:"business_directory",event_label:`Page ${r} - ${e} total businesses`})},startBusinessSignup:()=>{Fn("start_business_signup","business_onboarding")},completeBusinessSignup:t=>{Fn("complete_business_signup","business_onboarding",t)},editBusinessProfile:t=>{Fn("edit_business_profile","business_management",t)},viewSubscriptionModal:()=>{Fn("view_subscription_modal","subscription")},startSubscription:t=>{Fn("start_subscription","subscription",t)},completeSubscription:(t,e)=>{Fn("complete_subscription","subscription",t,e)},cancelSubscription:()=>{Fn("cancel_subscription","subscription")},viewEvent:(t,e,r,n)=>{Fn("view_event","events",`${e} (${t})`),typeof window<"u"&&window.gtag&&window.gtag("event","event_details_view",{event_id:t,event_name:e,event_date:r,event_location:n,event_category:"event_engagement"})},registerForEvent:(t,e,r,n)=>{Fn("register_for_event","events",`${e} (${t})`,1),typeof window<"u"&&window.gtag&&window.gtag("event","event_registration",{event_id:t,event_name:e,event_date:r,registration_type:n||"standard",event_category:"event_conversion"})},cancelEventRegistration:(t,e,r)=>{Fn("cancel_event_registration","events",`${e} (${t})`),typeof window<"u"&&window.gtag&&window.gtag("event","event_registration_cancel",{event_id:t,event_name:e,event_date:r,event_category:"event_conversion"})},shareEvent:(t,e,r)=>{Fn("share_event","events",`${e} via ${r}`),typeof window<"u"&&window.gtag&&window.gtag("event","event_share",{event_id:t,event_name:e,share_method:r,event_category:"event_viral"})},clickEventCTA:(t,e,r)=>{typeof window<"u"&&window.gtag&&window.gtag("event","event_cta_click",{event_id:t,event_name:e,cta_type:r,event_category:"event_engagement"})},userLogin:t=>{Fn("user_login","authentication",t)},userSignup:t=>{Fn("user_signup","authentication",t)},userLogout:()=>{Fn("user_logout","authentication")},clickNavigation:t=>{Fn("click_navigation","navigation",t)},downloadFile:(t,e)=>{Fn("download_file","engagement",`${t}.${e}`)},shareContent:(t,e,r)=>{Fn("share_content","social",`${t}:${e} via ${r}`)},startForm:(t,e)=>{typeof window<"u"&&window.gtag&&window.gtag("event","form_start",{form_type:t,form_section:e,event_category:"form_interaction"})},completeForm:(t,e,r)=>{Fn("complete_form","form_interaction",t),typeof window<"u"&&window.gtag&&window.gtag("event","form_complete",{form_type:t,form_section:e,time_spent_seconds:r,event_category:"form_conversion"})},abandonForm:(t,e,r,n)=>{typeof window<"u"&&window.gtag&&window.gtag("event","form_abandon",{form_type:t,form_section:e,time_spent_seconds:r,completion_percentage:n,event_category:"form_interaction"})},formFieldFocus:(t,e)=>{typeof window<"u"&&window.gtag&&window.gtag("event","form_field_focus",{form_type:t,field_name:e,event_category:"form_interaction"})},formError:(t,e,r)=>{typeof window<"u"&&window.gtag&&window.gtag("event","form_error",{form_type:t,field_name:e,error_message:r,event_category:"form_error"})},adminAction:(t,e)=>{Fn("admin_action","admin",`${t}${e?` - ${e}`:""}`)}},GC=t=>{try{Ax.set(t)}catch(e){console.error("Failed to set user properties:",e)}},$X=t=>{try{Ax.set({user_id:t})}catch(e){console.error("Failed to set user ID:",e)}},VC=x.createContext({user:null,session:null,isLoading:!0,userTypeLoading:!0,signIn:async()=>({error:null}),signOut:async()=>{},resetPassword:async()=>({error:null}),updatePassword:async()=>({error:null}),isAuthenticated:!1,userType:null,userName:null,avatarUrl:null,membershipStatus:null,residentialApprovalStatus:null,membershipStatusLoading:!0,businessSubscriptionStatus:null,businessSubscriptionStatusLoading:!0,shouldShowBusinessSubscriptionModal:!1,businessSubscriptionModalLoading:!0,reloadMembershipStatus:async()=>{},reloadBusinessSubscriptionStatus:async()=>{}}),WX=({children:t})=>
600{const[e,r]=x.useState(null),[n,a]=x.useState(null),[i,o]=x.useState(!0),[l,c]=x.useState(!0),[u,d]=x.useState(null),[h,f]=x.useState(null),[m,g]=x.useState(null),[y,b]=x.useState(null),[w,j]=x.useState(null),[N,S]=x.useState(!0),[E,C]=x.useState(null),[T,D]=x.useState(!0),[A,R]=x.useState(!1),[M,P]=x.useState(!0),U=x.useRef({}),I=3e4,O=x.useRef(null),V=x.useRef(null);x.useEffect(()=>{(async()=>{var we,Ee,Me,ae;try{const{data:ze}=await Q.auth.getSession();O.current=((Ee=(we=ze.session)==null?void 0:we.user)==null?void 0:Ee.id)??null,a(ze.session),r(((Me=ze.session)==null?void 0:Me.user)??null),(ae=ze.session)!=null&&ae.user?(G(ze.session.user.id),B(ze.session.user.id),$(ze.session.user.id)):(U.current={},d(null),V.current=null,f(null),g(null),b(null),j(null),S(!1),C(null),D(!1),c(!1))}catch(ze){console.error("Error getting initial session:",ze)}finally{o(!1)}})();const{data:{subscription:re}}=Q.auth.onAuthStateChange(async(we,Ee)=>{var Me,ae;we==="TOKEN_REFRESHED"&&((Me=Ee==null?void 0:Ee.user)!=null&&Me.id)&&Ee.user.id===O.current||(O.current=((ae=Ee==null?void 0:Ee.user)==null?void 0:ae.id)??null,a(Ee),r((Ee==null?void 0:Ee.user)??null),o(!1),Ee!=null&&Ee.user?($X(Ee.user.id),G(Ee.user.id),B(Ee.user.id),$(Ee.user.id),W(Ee.user.id),we==="SIGNED_IN"&&Ia.userLogin("email")):(U.current={},d(null),V.current=null,f(null),g(null),b(null),j(null),S(!1),C(null),D(!1),R(!1),P(!1),c(!1),we==="SIGNED_OUT"&&Ia.userLogout()))});return()=>{re.unsubscribe()}},[]);const G=async(Ce,re=!1)=>{const we=`userTypeAndName_${Ce}`,Ee=Date.now();if(!re&&U.current[we]&&Ee-U.current[we]<I){console.log("Using cached user type and name data");return}const Me=re||V.current===null;Me&&c(!0);const{data:ae,error:ze}=await Q.from("profiles").select("user_type, first_name, last_name, avatar_url").eq("id",Ce).single();if(!ze&&ae){d(ae.user_type),V.current=ae.user_type;const mt=[ae.first_name,ae.last_name].filter(Boolean).join(" ");f(mt||null),g(ae.avatar_url||null),GC({user_type:ae.user_type,has_name:!!mt,has_avatar:!!ae.avatar_url}),U.current[we]=Ee}else Me&&(d(null),V.current=null,f(null),g(null));Me&&c(!1)},B=async(Ce,re=!1)=>{const we=`membershipStatus_${Ce}`,Ee=Date.now();if(!re&&U.current[we]&&Ee-U.current[we]<I){console.log("Using cached membership status data");return}S(!0);const{data:Me,error:ae}
600=await Q.from("profiles").select("membership_status, user_type").eq("id",Ce).single();if(!ae&&Me){if(Me.user_type==="business")b("active"),j(null);else{const ze=Me.membership_status;if(b(ze==="trialing"||ze==="active"?"active":ze||null),Me.user_type==="residential"){const{data:mt,error:tt}=await Q.from("residential_profiles").select("status").eq("id",Ce).maybeSingle();j(tt?null:(mt==null?void 0:mt.status)??null)}else j(null)}U.current[we]=Ee}else b(null),j(null);S(!1)},$=async Ce=>{D(!0);const{data:re,error:we}=await Q.from("business_profiles").select("business_subscription_status").eq("owner_id",Ce);if(!we&&re){const Ee=re.some(Me=>Me.business_subscription_status==="active"||Me.business_subscription_status==="trialing");C(Ee?"active":"inactive")}else C("inactive");D(!1)},W=async Ce=>{P(!0);const{data:re,error:we}=await Q.from("business_profiles").select("business_subscription_status").eq("owner_id",Ce);if(!we&&re){const Ee=re.length===1&&re[0].business_subscription_status!=="active"&&re[0].business_subscription_status!=="trialing";R(Ee)}else R(!1);P(!1)},oe=async()=>{e&&await B(e.id,!0)},K=async()=>{e&&(await $(e.id),await W(e.id))},H=async(Ce,re)=>{try{const{error:we}=await Q.auth.signInWithPassword({email:Ce,password:re});return{error:we}}catch(we){return{error:we}}},X=async()=>{try{await Q.auth.signOut()}catch(Ce){console.error("Error signing out:",Ce)}},me=()=>"https://www.valleystreamchamber.org/auth/reset-password",ve={user:e,session:n,isLoading:i,userTypeLoading:l,signIn:H,signOut:X,resetPassword:async Ce=>{try{const re=me();console.log("Sending password reset email with redirect URL:",re);const{error:we}=await Q.auth.resetPasswordForEmail(Ce,{redirectTo:re});if(we){if(console.error("Reset password error:",we),(we.message||"").toLowerCase().includes("email not confirmed")){const{error:Me}=await Q.auth.resend({type:"signup",email:Ce});return Me?{error:new Error("You need to confirm your email first before resetting your password.")}:{error:new Error("You need to confirm your email first. We sent a new verification code to your email.")}}}else console.log("Password reset email sent successfully");return{error:we}}catch(re){return console.error("Reset password exception:",re),{error:re}}},updatePassword:async Ce=>{try{const{error:re}=await Q.auth.updateUser({password:Ce});return{error:re}}catch(re){return{error:re}}},isAuthenticated:!!e,userType:u,userName:h,avatarUrl:m,membershipStatus:y,residentialApprovalStatus:w,membershipStatusLoading:N,businessSubscriptionStatus:E,businessSubscriptionStatusLoading:T,shouldShowBusinessSubscriptionModal:A,businessSubscriptionModalLoading:M,reloadMembershipStatus:oe,reloadBusinessSubscriptionStatus:K};return s.jsx(VC.Provider,{value:ve,children:t})},ts=()=>{const t=x.useContext(VC);if(t===void 0)throw new Error("useAuth must be used within an AuthProvider");return t},bP=()=>{const{userType:t,isLoading:e}=ts();return{isAdmin:t==="admin",isLoading:e}},KC=()=>{const{userType:t,isLoading:e}=ts();return{isResidential:t==="residential",isLoading:e}},Ch={getSiteSettings:async()=>{const{data:t,error:e}=await Q.from("site_settings").select("*").single();if(e)throw console.error("Error fetching site settings:",e),e;return t},updateSiteSettings:async t=>{const{data:e,error:r}=await Q.from("site_settings").select("id").single();if(r)throw console.error("Error fetching current site settings:",r),r;const{data:n,error:a}=await Q.from("site_settings").update(t).eq("id",e.id).select().single();if(a)throw console.error("Error updating site settings:",a),a;return n},getSocialMediaSettings:async()=>{const{data:t,error:e}=await Q.from("social_media_settings").select("*").single();if(e)throw console.error("Error fetching social media settings:",e),e;return t},updateSocialMediaSettings:async t=>{const{data:e,error:r}=await Q.from("social_media_settings").select("id").single();if(r)throw console.error("Error fetching current social media settings:",r),r;const{data:n,error:a}=await Q.from("social_media_settings").update(t).eq("id",e.id).select().single();if(a)throw console.error("Error updating social media settings:",a),a;return n}},vP=x.createContext(void 0),qX=({children:t})=>
600{const[e,r]=x.useState(null),[n,a]=x.useState(null),[i,o]=x.useState(!0),l=async()=>{try{o(!0);const[d,h]=await Promise.all([Ch.getSiteSettings(),Ch.getSocialMediaSettings()]);r(d),a(h)}catch(d){console.error("Error loading site settings:",d),r({id:"",site_title:"Valley Stream Chamber of Commerce",city_name:"Valley Stream",site_logo:"/logo.png",contact_email:"info@Valley Stream.chamber",contact_phone:"(555) 123-4567",address_line1:"123 Main Street",address_line2:"",city:"Anytown",state:"USA",zip_code:"12345",business_hours:{monday:{open:"09:00",close:"17:00"},tuesday:{open:"09:00",close:"17:00"},wednesday:{open:"09:00",close:"17:00"},thursday:{open:"09:00",close:"17:00"},friday:{open:"09:00",close:"17:00"},saturday:{open:"closed",close:"closed"},sunday:{open:"closed",close:"closed"}},business_hours_json:{monday:{open:"09:00",close:"17:00"},tuesday:{open:"09:00",close:"17:00"},wednesday:{open:"09:00",close:"17:00"},thursday:{open:"09:00",close:"17:00"},friday:{open:"09:00",close:"17:00"},saturday:{open:"closed",close:"closed"},sunday:{open:"closed",close:"closed"}},maintenance_mode:!1,paypal_button_text:"Donate via PayPal",paypal_button_url:"https://www.paypal.com/donate",created_at:"",updated_at:""}),a({id:"",facebook_url:"https://facebook.com/chamberofcommerce",twitter_url:"https://twitter.com/chamberofcommerce",linkedin_url:"https://linkedin.com/company/chamberofcommerce",instagram_url:"https://instagram.com/chamberofcommerce",youtube_url:"",tiktok_url:"",created_at:"",updated_at:""})}finally{o(!1)}},c=async()=>{await l()};x.useEffect(()=>{l()},[]);const u={siteSettings:e,socialSettings:n,isLoading:i,refreshSettings:c};return s.jsx(vP.Provider,{value:u,children:t})},mp=()=>{const t=x.useContext(vP);if(t===void 0)throw new Error("useSiteSettings must be used within a SiteSettingsProvider");return t};var GX=Symbol.for("react.lazy"),g1=uw[" use ".trim().toString()];function VX(t){return typeof t=="object"&&t!==null&&"then"in t}function wP(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===GX&&"_payload"in t&&VX(t._payload)}function jP(t){const e=KX(t),r=x.forwardRef((n,a)=>{let{children:i,...o}=n;wP(i)&&typeof g1=="function"&&(i=g1(i._payload));const l=x.Children.toArray(i),c=l.find(YX);if(c){const u=c.props.children,d=l.map(h=>h===c?x.Children.count(u)>1?x.Children.only(null):x.isValidElement(u)?u.props.children:null:h);return s.jsx(e,{...o,ref:a,children:x.isValidElement(u)?x.cloneElement(u,void 0,d):null})}return s.jsx(e,{...o,ref:a,children:i})});return r.displayName=`${t}.Slot`,r}var NP=jP("Slot");function KX(t){const e=x.forwardRef((r,n)=>{let{children:a,...i}=r;if(wP(a)&&typeof g1=="function"&&(a=g1(a._payload)),x.isValidElement(a)){const o=XX(a),l=ZX(i,a.props);return a.type!==x.Fragment&&(l.ref=n?vx(n,o):o),x.cloneElement(a,l)}return x.Children.count(a)>1?x.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var JX=Symbol("radix.slottable");function YX(t){return x.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===JX}function ZX(t,e){const r={...e};for(const n in e){const a=t[n],i=e[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...l)=>{const c=i(...l);return a(...l),c}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...t,...r}}function XX(t){var n,a;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(a=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:a.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}const Sw=cp("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"}}),Y=x.forwardRef(({className:t,variant:e,size:r,asChild:n=!1,...a},i)=>{const o=n?NP:"button";return s.jsx(o,{className:xt(Sw({variant:e,size:r,className:t})),ref:i,...a})});Y.displayName="Button";const QX="modulepreload",eQ=function(t){return"/"+t},KE={}
600,Wv=function(e,r,n){let a=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));a=Promise.allSettled(r.map(c=>{if(c=eQ(c),c in KE)return;KE[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":QX,u||(h.as="script"),h.crossOrigin="",h.href=c,l&&h.setAttribute("nonce",l),document.head.appendChild(h),u)return new Promise((f,m)=>{h.addEventListener("load",f),h.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return a.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return e().catch(i)})},Dx={getActive:async()=>{const{data:t,error:e}=await Q.from("hero_sections").select("*").eq("is_active",!0).single();if(e&&e.code!=="PGRST116")throw e;return t},getAll:async()=>{const{data:t,error:e}=await Q.from("hero_sections").select("*").order("created_at",{ascending:!1});if(e)throw e;return t||[]},getById:async t=>{const{data:e,error:r}=await Q.from("hero_sections").select("*").eq("id",t).single();if(r&&r.code!=="PGRST116")throw r;return e},create:async t=>{const{data:{user:e}}=await Q.auth.getUser(),{data:r,error:n}=await Q.from("hero_sections").insert({...t,created_by:e==null?void 0:e.id,updated_by:e==null?void 0:e.id}).select().single();if(n)throw n;return r},update:async(t,e)=>{const{data:{user:r}}=await Q.auth.getUser(),{data:n,error:a}=await Q.from("hero_sections").update({...e,updated_by:r==null?void 0:r.id,updated_at:new Date().toISOString()}).eq("id",t).select().single();if(a)throw a;return n},delete:async t=>{const{data:e}=await Q.from("hero_sections").select("main_image_url, overlay_image_1_url, overlay_image_2_url").eq("id",t).single(),{error:r}=await Q.from("hero_sections").delete().eq("id",t);if(r)throw r;e&&Wv(async()=>{const{cleanupHeroSectionImages:n}=await import("./heroImageCleanup-wRZ9v20c.js");return{cleanupHeroSectionImages:n}},__vite__mapDeps([0,1,2,3])).then(({cleanupHeroSectionImages:n})=>{n(e).catch(console.error)})},setActive:async t=>{const{data:{user:e}}=await Q.auth.getUser();await Q.from("hero_sections").update({is_active:!1,updated_by:e==null?void 0:e.id,updated_at:new Date().toISOString()}).neq("id","00000000-0000-0000-0000-000000000000");const{error:r}=await Q.from("hero_sections").update({is_active:!0,updated_by:e==null?void 0:e.id,updated_at:new Date().toISOString()}).eq("id",t);if(r)throw r}},tQ=()=>kx({queryKey:["hero-section","active"],queryFn:Dx.getActive,staleTime:5*60*1e3}),rQ=()=>kx({queryKey:["hero-sections"],queryFn:Dx.getAll}),sQ=()=>{const t=Su();return $l({mutationFn:e=>Dx.create(e),onSuccess:()=>{t.invalidateQueries({queryKey:["hero-sections"]}),ct.success("Hero section created successfully")},onError:e=>{ct.error(e.message||"Failed to create hero section")}})},nQ=()=>{const t=Su();return $l({mutationFn:({id:e,data:r})=>Dx.update(e,r),onSuccess:e=>{t.invalidateQueries({queryKey:["hero-sections"]}),t.invalidateQueries({queryKey:["hero-section",e.id]}),t.invalidateQueries({queryKey:["hero-section","active"]}),ct.success("Hero section updated successfully")},onError:e=>{ct.error(e.message||"Failed to update hero section")}})},aQ=()=>{const t=Su();return $l({mutationFn:e=>Dx.delete(e),onSuccess:()=>{t.invalidateQueries({queryKey:["hero-sections"]}),t.invalidateQueries({queryKey:["hero-section","active"]}),ct.success("Hero section deleted successfully")},onError:e=>{ct.error(e.message||"Failed to delete hero section")}})},iQ=()=>{const t=Su();return $l({mutationFn:e=>Dx.setActive(e),onSuccess:()=>{t.invalidateQueries({queryKey:["hero-sections"]}),t.invalidateQueries({queryKey:["hero-section","active"]}),ct.success("Hero section activated successfully")},onError:e=>{ct.error(e.message||"Failed to activate hero section")}})},oQ=()=>{const{data:t,isLoading:e}=tQ(),n=t||{title:"Valley Stream Chamber of Commerce",subtitle:"Welcome to the",description:"Our mission is to connect businesses, and enrich our community by promoting opportunities and supporting local success. Join us as we build a stronger, more vibrant Valley Stream together.",primary_button_text:"Business Member",primary_button_url:"/auth/signup?type=business",secondary_button_text:"Residential Member",secondary_button_url:"/auth/signup?type=residential",directory_link_text:"Business Directory",directory_link_url:"/businesses",main_image_url:"/herosection.jpg",main_image_alt:"Local business owners working together",overlay_image_1_url:"/herosection2.jpg",overlay_image_1_alt:"Local business with OPEN sign",overlay_image_2_url:"/herosection3.jpg",overlay_image_2_alt:"Local business owner in greenhouse"};return e?s.jsx("section",{className:"bg-white py-12 sm:py-16 md:py-20",children:s.jsx("div",{className:"container-wrapper mx-auto px-6 md:px-12 lg:px-20",children:s.jsxs("div",{className:"grid md:grid-cols-2 gap-8 sm:gap-12 md:gap-14 items-center",children:[s.jsx("div",{className:"animate-pulse",children:s.jsx("div",{className:"bg-gray-200 h-[300px] sm:h-[400px] md:h-[480px] rounded-2xl"})}),s.jsxs("div",{className:"space-y-6 sm:space-y-8 animate-pulse",children:[s.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[s.jsx("div",{className:"bg-gray-200 h-3 sm:h-4 w-24 sm:w-32 rounded"}),s.jsx("div",{className:"bg-gray-200 h-8 sm:h-10 md:h-12 w-full rounded"}),s.jsx("div",{className:"bg-gray-200 h-16 sm:h-20 w-full rounded"})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[s.jsx("div",{className:"bg-gray-200 h-10 sm:h-12 w-full sm:w-32 rounded"}),s.jsx("div",{className:"bg-gray-200 h-10 sm:h-12 w-full sm:w-32 rounded"})]})]})]})})}):s.jsx("section",{className:"bg-white py-12 sm:py-16 md:py-20",children:s.jsx("div",{className:"container-wrapper mx-auto px-6 md:px-12 lg:px-20",children:s.jsxs("div",{className:"grid md:grid-cols-2 gap-8 sm:gap-12 md:gap-14 items-center",children:[s.jsxs("div",{className:"relative h-[500px] md:h-[480px] w-full flex items-center justify-center",children:[s.jsx("img",{src:n.main_image_url,alt:n.main_image_alt,className:"absolute inset-0 w-[85%] sm:w-fit h-full object-contain rounded-2xl z-10"}),s.jsx("img",{src:n.overlay_image_1_url,alt:n.overlay_image_1_alt,className:"absolute bottom-0 right-[10px] sm:right-0 sm:-bottom-10 right-14 w-40 h-50 object-cover rounded-2xl shadow-xl z-20 transform translate-x-2 md:translate-x-4"}),s.jsx("img",{src:n.overlay_image_2_url,alt:n.overlay_image_2_alt,className:"absolute right-[22%] sm:right-0 bottom-[-30px] sm:-bottom-24 right-48 w-fit h-32 md:w-fit md:h-fit object-cover rounded-2xl shadow-lg z-30 transform -translate-y-2 md:-translate-y-4"})]}),s.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[s.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[s.jsx("p",{className:"text-xs sm:text-sm md:text-base text-gray-500 uppercase tracking-[0.25em] font-medium",children:n.subtitle}),s.jsx("h1",{className:"text-2xl sm:text-3xl md:text-4xl lg:text-5xl xl:text-6xl font-extrabold text-chamber-blue leading-tight",children:s.jsx("span",{className:"block",children:n.title})}),s.jsx("p",{className:"text-sm sm:text-base md:text-lg lg:text-xl text-gray-600 leading-relaxed max-w-xl",children:n.description})]}),s.jsxs("div",{className:"flex flex-row gap-3 sm:gap-4 flex-wrap justify-center sm:justify-start",children:[s.jsx(rt,{to:n.primary_button_url,children:s.jsx(Y,{size:"lg",className:"w-auto bg-chamber-blue text-white hover:bg-blue-700 px-4 sm:px-6 lg:px-7 py-3 text-sm sm:text-base transition-colors",children:n.primary_button_text})}),s.jsx(rt,{to:n.secondary_button_url,children:s.jsx(Y,{size:"lg",className:"w-auto bg-chamber-blue text-white hover:bg-blue-700 px-4 sm:px-6 lg:px-7 py-3 text-sm sm:text-base transition-colors",children:n.secondary_button_text})})]}),s.jsx("div",{children:s.jsxs(rt,{to:n.directory_link_url,className:"flex items-center gap-2 text-chamber-blue hover:text-blue-700 transition-colors font-medium text-sm sm:text-base",children:[n.directory_link_text,s.jsx(ul,{className:"h-4 w-4"})]})})]})]})})})},lQ=cp("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-red-100 text-red-800 hover:bg-red-200/80",outline:"text-foreground",success:"border-transparent bg-green-100 text-green-800 hover:bg-green-200/80",warning:"border-transparent bg-amber-100 text-amber-800 hover:bg-amber-200/80"}},defaultVariants:{variant:"default"}});function ke({className:t,variant:e,...r}){return s.jsx("div",{className:xt(lQ({variant:e}),t),...r})}const De=x.forwardRef(({className:t,...e},r)=>s.jsx("div",{ref:r,className:xt("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));
600De.displayName="Card";const ot=x.forwardRef(({className:t,...e},r)=>s.jsx("div",{ref:r,className:xt("flex flex-col space-y-1.5 p-6",t),...e}));ot.displayName="CardHeader";const ut=x.forwardRef(({className:t,...e},r)=>s.jsx("h3",{ref:r,className:xt("text-2xl font-semibold leading-none tracking-tight",t),...e}));ut.displayName="CardTitle";const us=x.forwardRef(({className:t,...e},r)=>s.jsx("p",{ref:r,className:xt("text-sm text-muted-foreground",t),...e}));us.displayName="CardDescription";const Be=x.forwardRef(({className:t,...e},r)=>s.jsx("div",{ref:r,className:xt("p-6 pt-0",t),...e}));Be.displayName="CardContent";const co=x.forwardRef(({className:t,...e},r)=>s.jsx("div",{ref:r,className:xt("flex items-center p-6 pt-0",t),...e}));co.displayName="CardFooter";var cQ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],dm=cQ.reduce((t,e)=>{const r=jP(`Primitive.${e}`),n=x.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{}),uQ="AspectRatio",FP=x.forwardRef((t,e)=>{const{ratio:r=1/1,style:n,...a}=t;return s.jsx("div",{style:{position:"relative",width:"100%",paddingBottom:`${100/r}%`},"data-radix-aspect-ratio-wrapper":"",children:s.jsx(dm.div,{...a,ref:e,style:{...n,position:"absolute",top:0,right:0,bottom:0,left:0}})})});FP.displayName=uQ;var dQ=FP;const Qg=dQ,Ya={trackBusinessImpressions:(t,e)=>{typeof window<"u"&&window.gtag&&t.forEach((r,n)=>{var a;window.gtag("event","business_impression",{business_id:r.id,business_name:r.name,business_category:((a=r.categories[0])==null?void 0:a.name)||"Uncategorized",impression_context:e,impression_position:n+1,event_category:"business_visibility"})})},trackBusinessCardInteraction:(t,e,r)=>{typeof window<"u"&&window.gtag&&window.gtag("event","business_card_interaction",{business_id:t,business_name:e,interaction_type:r,event_category:"business_engagement"})},trackBusinessProfileTime:(t,e,r)=>{typeof window<"u"&&window.gtag&&window.gtag("event","business_profile_time",{business_id:t,business_name:e,time_spent_seconds:r,engagement_level:r>30?"high":r>10?"medium":"low",event_category:"business_engagement"})},trackBusinessGalleryView:(t,e,r)=>{typeof window<"u"&&window.gtag&&window.gtag("event","business_gallery_view",{business_id:t,business_name:e,image_index:r,event_category:"business_content_engagement"})},trackBusinessHoursView:(t,e)=>{typeof window<"u"&&window.gtag&&window.gtag("event","business_hours_view",{business_id:t,business_name:e,event_category:"business_information_access"})},trackBusinessLocationView:(t,e,r)=>{typeof window<"u"&&window.gtag&&window.gtag("event","business_location_interaction",{business_id:t,business_name:e,interaction_type:r,event_category:"business_location_engagement"})},trackBusinessSearchResult:(t,e,r,n,a)=>{typeof window<"u"&&window.gtag&&window.gtag("event","business_search_result",{search_query:t,business_id:e,business_name:r,result_position:n,total_results:a,event_category:"business_search_performance"})},trackBusinessCategoryBrowsing:(t,e,r=1)=>{typeof window<"u"&&window.gtag&&window.gtag("event","business_category_browse",{category_name:t,businesses_shown:e.slice(0,10).join(", "),business_count:e.length,page_number:r,event_category:"business_category_engagement"})},trackBusinessReferral:(t,e,r)=>{typeof window<"u"&&window.gtag&&window.gtag("event","business_referral",{business_id:t,business_name:e,referral_method:r,event_category:"business_viral_engagement"})},batchTrackBusinessEvents:t=>{typeof window<"u"&&window.gtag&&t.forEach(e=>{window.gtag("event",e.eventType,{business_id:e.businessId,business_name:e.businessName,event_category:"business_batch_tracking",...e.additionalData})})},trackBusinessJourney:(t,e,r,n)=>{typeof window<"u"&&window.gtag&&window.gtag("event","business_journey_step",{business_id:e,business_name:r,journey_step:t,session_id:n||"unknown",event_category:"business_funnel"})},trackScrollDepth:(t,e,r)=>{[25,50,75,100].includes(r)&&typeof window<"u"&&window.gtag&&window.gtag("event","business_scroll_depth",{business_id:t,business_name:e,scroll_percentage:r,event_category:"business_engagement"})},trackCategoryInterest:(t,e)=>{typeof window<"u"&&window.gtag&&window.gtag("event","category_interest",{category_name:t,interaction_type:e,event_category:"user_preference"})},trackBusinessFeatureUsage:(t,e,r)=>{typeof window<"u"&&window.gtag&&window.gtag("event","business_feature_usage",{business_id:t,business_name:e,feature_used:r,event_category:"business_engagement"})}};class hQ{constructor(){sr(this,"pricingCache",new Map);
600sr(this,"cacheExpiry",0);sr(this,"CACHE_DURATION",5*60*1e3)}async getSignupPricingAmountFromEdge(e){try{const r="https://ntfepejabevzvrpomvpd.supabase.co".replace(/\/$/,""),n="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im50ZmVwZWphYmV2enZycG9tdnBkIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDQyOTk4MzIsImV4cCI6MjA1OTg3NTgzMn0.jn50xDz6nXKOQdRXPfa6NfkEG576z6eoq0rW42AsSsI";if(!r)return null;const a=await fetch(`${r}/functions/v1/get-signup-pricing`,{method:"POST",headers:{"Content-Type":"application/json",apikey:n,Authorization:`Bearer ${n}`},body:JSON.stringify({price_type:e})}),i=await a.json().catch(()=>({}));if(!a.ok)return console.error("Edge signup pricing fetch failed:",(i==null?void 0:i.error)||a.statusText),null;const o=i==null?void 0:i.amount;return!Number.isFinite(o)||o<=0?null:Number(o)}catch(r){return console.error("Edge signup pricing fetch threw:",r),null}}async getAllPricing(){const{data:e,error:r}=await Q.from("pricing").select("*").eq("is_active",!0).order("price_type");if(r)throw console.error("Error fetching pricing data:",r),new Error("Failed to fetch pricing data");return e||[]}async getPricing(e){return this.pricingCache.has(e)&&Date.now()<this.cacheExpiry?this.pricingCache.get(e)||null:(await this.refreshCache(),this.pricingCache.get(e)||null)}async refreshCache(){try{const e=await this.getAllPricing();this.pricingCache.clear(),e.forEach(r=>{this.pricingCache.set(r.price_type,r)}),this.cacheExpiry=Date.now()+this.CACHE_DURATION}catch(e){console.error("Error refreshing pricing cache:",e)}}calculateProratedPricing(e){const r=new Date,n=r.getFullYear()+1,i=new Date(Date.UTC(n,0,1,0,0,0,0)).getTime()-r.getTime(),o=1e3*60*60*24,l=i/o;if(l>=360)return{fullYearPrice:e,proratedPrice:e,daysRemaining:Math.ceil(l),totalDaysInYear:365,isFullYear:!0};const u=365*o,d=i/u*e;let h=Math.round(e*.1);return e===65&&(h=7),e===125&&(h=13),e===200&&(h=20),{fullYearPrice:e,proratedPrice:Math.max(h,Math.round(d*100)/100),daysRemaining:Math.ceil(l),totalDaysInYear:365,isFullYear:!1}}async getBusinessPricing(){const e=await this.getPricing("business_basic");if(e)return this.calculateProratedPricing(Number(e.amount));
600const r=await this.getSignupPricingAmountFromEdge("business_basic");if(!r)throw new Error("Business pricing is not configured. Please update admin price management.");return this.calculateProratedPricing(r)}async getMembershipPricing(){const e=await this.getPricing("membership");if(e)return this.calculateProratedPricing(Number(e.amount));const r=await this.getSignupPricingAmountFromEdge("membership");if(!r)throw new Error("Membership pricing is not configured. Please update admin price management.");return this.calculateProratedPricing(r)}async getFeaturedBusinessPricing(){const e=await this.getPricing("business_featured"),r=e?Number(e.amount):200;return this.calculateProratedPricing(r)}async getAdditionalBusinessPricing(){const e=await this.getPricing("business_additional"),r=e?Number(e.amount):50;return this.calculateProratedPricing(r)}async getAdditionalBusinessStripePriceId(){const e=await this.getPricing("business_additional");return(e==null?void 0:e.stripe_price_id)??null}clearCache(){this.pricingCache.clear(),this.cacheExpiry=0}}const Ro=new hQ,mQ={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APP_URL:"https://www.valleystreamchamber.org",VITE_GA4_MEASUREMENT_ID:"G-6F58MGWST0",VITE_GOOGLE_MAPS_API_KEY:"AIzaSyAbLIh5nnw9na-VqFxRM1w4Ic-MmvJCJwQ",VITE_OUTSCRAPER_API_KEY:"MGU4ODdiNjlkMzNjNDBiMGI1NGNkNzJlMzE4M2I2Y2Z8Yzk5MTY0OTBiOQ",VITE_STRIPE_BUSINESS_CREATION_PRICE_ID:"price_1O1AYPGy3DeG9lNCUG2eXn0s",VITE_STRIPE_BUSINESS_SUBSCRIPTION_PRICE_ID:"price_1O1AYPGy3DeG9lNCUG2eXn0s",VITE_STRIPE_FEATURE_TAG_PRICE_ID:"price_1RgT6EGy3DeG9lNCTEp6iGSJ",VITE_STRIPE_MEMBERSHIP_PRICE_ID:"price_1RgT5nGy3DeG9lNCsulmFycX",VITE_STRIPE_PUBLISHABLE_KEY:"pk_live_51O18tbGy3DeG9lNCNWtPjgCPuNqYgHiQsLjwhQnhIWvqaIUJW942hJUuES9dCVNJPGkAMgfDztHDG3LebhI1v9M900TUbcRWbu",VITE_STRIPE_SECRET_KEY:"sk_test_51O18tbGy3DeG9lNCGbHA8kzMCorgbyZrmiUbv5uSTFm7151lGc9z6t3V9vus9OC4IF39ZAXt6i4MlfrwdzuJA3IZ009HQqtrzh",VITE_STRIPE_WEBHOOK_SECRET:"whsec_ryalrNds9ugbHNSZmABnyNYsRqm9wHLL",VITE_SUPABASE_ANON_KEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im50ZmVwZWphYmV2enZycG9tdnBkIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDQyOTk4MzIsImV4cCI6MjA1OTg3NTgzMn0.jn50xDz6nXKOQdRXPfa6NfkEG576z6eoq0rW42AsSsI",VITE_SUPABASE_SERVICE_ROLE_KEY:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Im50ZmVwZWphYmV2enZycG9tdnBkIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTc0NDI5OTgzMiwiZXhwIjoyMDU5ODc1ODMyfQ.KutGI6ij1VXfghiucTOPVwPoVDBNgCTEOAvidDuS7m4",VITE_SUPABASE_URL:"https://ntfepejabevzvrpomvpd.supabase.co",VITE_VERCEL_BRANCH_URL:"local-biz-hub-co-git-170f1b-thecandlecrusher-gmailcoms-projects.vercel.app",VITE_VERCEL_DEPLOYMENT_ID:"dpl_6shDFNKR4EyMYvnGro2XKcjqN7A5",VITE_VERCEL_ENV:"production",VITE_VERCEL_GIT_COMMIT_AUTHOR_LOGIN:"PFPLanceBishop",VITE_VERCEL_GIT_COMMIT_AUTHOR_NAME:"PFPLanceBishop",VITE_VERCEL_GIT_COMMIT_MESSAGE:"Update README.md",VITE_VERCEL_GIT_COMMIT_REF:"main",VITE_VERCEL_GIT_COMMIT_SHA:"0aad7aafe9f04a0b92197988178bb55178a8517c",VITE_VERCEL_GIT_PREVIOUS_SHA:"",VITE_VERCEL_GIT_PROVIDER:"github",VITE_VERCEL_GIT_PULL_REQUEST_ID:"",VITE_VERCEL_GIT_REPO_ID:"963298139",VITE_VERCEL_GIT_REPO_OWNER:"PFPLanceBishop",VITE_VERCEL_GIT_REPO_SLUG:"local-biz-hub-connect",VITE_VERCEL_OBSERVABILITY_CLIENT_CONFIG:'{"analytics":{"scriptSrc":"b9df9462bf15f197/script.js","viewEndpoint":"b9df9462bf15f197/view","eventEndpoint":"b9df9462bf15f197/event","sessionEndpoint":"b9df9462bf15f197/session"},"speedInsights":{"scriptSrc":"48aa618e67b3ef5b/script.js","endpoint":"48aa618e67b3ef5b/vitals"}}',VITE_VERCEL_PROJECT_ID:"prj_Tw9eG1Xj85JS5nh0c7jouEGvrsFI",VITE_VERCEL_PROJECT_PRODUCTION_URL:"www.valleystreamchamber.org",VITE_VERCEL_TARGET_ENV:"production",VITE_VERCEL_URL:"local-biz-hub-connect-cdthpkr4f.vercel.app"},fQ=_G("pk_live_51O18tbGy3DeG9lNCNWtPjgCPuNqYgHiQsLjwhQnhIWvqaIUJW942hJUuES9dCVNJPGkAMgfDztHDG3LebhI1v9M900TUbcRWbu");class Bi{static async createFeatureTagSubscription(e){try{const{data:{user:r}}=await Q.auth.getUser();if(!r)throw new Error("User not authenticated");const{data:n}=await Q.from("profiles").select("stripe_customer_id, email").eq("id",r.id).single(),{data:a,error:i}=await Q.functions.invoke("create-checkout-session",{body:{businessId:e.businessId,customerId:n==null?void 0:n.stripe_customer_id,customerEmail:(n==null?void 0:n.email)||r.email,successUrl:e.successUrl,cancelUrl:e.cancelUrl}});if(i)throw new Error(i.message||"Failed to create checkout session");return a}catch(r){throw console.error("Error creating checkout session:",r),r}}static async createMembershipSubscription(e){try{const{data:{user:r}}=await Q.auth.getUser();if(!r)throw new Error("User not authenticated");const{data:n}=await Q.from("profiles").select("stripe_customer_id, email").eq("id",r.id).single(),{data:a,error:i}=await Q.functions.invoke("create-residential-membership-session",{body:{priceId:e.priceId,customerId:n==null?void 0:n.stripe_customer_id,customerEmail:(n==null?void 0:n.email)||r.email,successUrl:e.successUrl,cancelUrl:e.cancelUrl,subscriptionType:"membership"}});if(i)throw new Error(i.message||"Failed to create checkout session");return a}catch(r){throw console.error("Error creating membership checkout session:",r),r}}static async createIndividualBusinessSubscription(e){try{const{data:{user:r}}=await Q.auth.getUser();if(!r)throw new Error("User not authenticated");const{data:n}=await Q.from("profiles").select("stripe_customer_id, email").eq("id",r.id).single(),{data:a,error:i}=await Q.functions.invoke("create-business-subscription-session",{body:{priceId:e.priceId,businessId:e.businessId,customerId:n==null?void 0:n.stripe_customer_id,customerEmail:(n==null?void 0:n.email)||r.email,successUrl:e.successUrl,cancelUrl:e.cancelUrl,subscriptionType:"individual_business"}});if(i)throw new Error(i.message||"Failed to create checkout session");return a}catch(r){throw console.error("Error creating business creation checkout session:",r),r}}static async redirectToCheckout(e){const r=await fQ;if(!r)throw new Error("Stripe failed to load");const{error:n}=await r.redirectToCheckout({sessionId:e});if(n)throw n}static requireEnv(e){const r=mQ[e];if(!r)throw new Error(`Missing required environment variable: ${e}`);return r}static async subscribeToFeatureTag(e){try{const r=await this.createFeatureTagSubscription({businessId:e,successUrl:`${window.location.origin}/dashboard/advertising?success=true&business_id=${e}`,cancelUrl:`${window.location.origin}/dashboard/advertising?canceled=true`});await this.redirectToCheckout(r.id)}catch(r){throw console.error("Error subscribing to feature tag:",r),r}}static async subscribeMembership(){try{const e=await this.createMembershipSubscription({priceId:this.requireEnv("VITE_STRIPE_MEMBERSHIP_PRICE_ID"),successUrl:`${window.location.origin}/dashboard/membership?success=true`,cancelUrl:`${window.location.origin}/dashboard/membership?canceled=true`});await this.redirectToCheckout(e.id)}catch(e){throw console.error("Error subscribing to membership:",e),e}}static async subscribeIndividualBusiness(e){try{const r=await this.createIndividualBusinessSubscription({priceId:this.requireEnv("VITE_STRIPE_BUSINESS_CREATION_PRICE_ID"),businessId:e,successUrl:`${window.location.origin}/dashboard/businesses?success=true`,cancelUrl:`${window.location.origin}/dashboard/businesses?canceled=true`});await this.redirectToCheckout(r.id)}catch(r){throw console.error("Error subscribing to individual business:",r),r}}static async getBusinessFeatureStatus(e){try{const{data:r,error:n}=await Q.from("business_profiles").select("featured, feature_subscription_id, feature_expires_at").eq("id",e).single();if(n)throw n;const a=new Date,i=r!=null&&r.feature_expires_at?new Date(r.feature_expires_at):null,o=i?i>a:!1;return{featured:(r==null?void 0:r.featured)||!1,subscriptionActive:o,expiresAt:r==null?void 0:r.feature_expires_at}}catch(r){return console.error("Error getting business feature status:",r),{featured:!1,subscriptionActive:!1}}}static async getUserBusinesses(){try{const{data:{user:e}}=await Q.auth.getUser();if(!e)throw new Error("User not authenticated");const{data:r,error:n}=await Q.from("business_profiles").select("id, business_name, featured, status, feature_subscription_id, feature_expires_at, feature_subscription_status, feature_cancel_at_period_end, feature_canceled_at").eq("owner_id",e.id).eq("status","approved");if(n)throw n;return(r||[]).map(i=>{const o=new Date,l=i.feature_expires_at?new Date(i.feature_expires_at):null,c=l?l>o:!1;return{...i,subscriptionActive:c,subscriptionExpired:i.featured&&!c}})}catch(e){return console.error("Error getting user businesses:",e),[]}}static async getUserSubscription(){try{const{data:{user:e}}=await Q.auth.getUser();if(!e)throw new Error("User not authenticated");const{data:r,error:n}=await Q.from("profiles").select("membership_subscription_id, membership_status, membership_expires_at, membership_canceled_at, membership_cancel_at_period_end").eq("id",e.id).single();if(n)throw n;return r.membership_subscription_id?{id:r.membership_subscription_id,status:r.membership_status||"inactive",current_period_end:r.membership_expires_at,canceled_at:r.membership_canceled_at,cancel_at_period_end:r.membership_cancel_at_period_end||!1}:null}catch(e){throw console.error("Error getting user subscription:",e),e}}static async getIndividualBusinessSubscription(e){try{const{data:r,error:n}=await Q.from("business_profiles").select("business_subscription_id, business_subscription_status, business_subscription_expires_at").eq("id",e).single();if(n)throw n;return r.business_subscription_id?{id:r.business_subscription_id,status:r.business_subscription_status||"inactive",current_period_end:r.business_subscription_expires_at,canceled_at:r.business_subscription_status==="canceled"?new Date().toISOString():null}:null}catch(r){throw console.error("Error getting individual business subscription:",r),r}}static async cancelFeatureSubscription(e){try{const{data:r,error:n}=await Q.functions.invoke("cancel-subscription",{body:{businessId:e}});if(n)throw new Error(n.message||"Failed to cancel subscription")}catch(r){throw console.error("Error canceling subscription:",r),r}}static async cancelSubscription(e){try{const{data:r,error:n}=await Q.functions.invoke("cancel-membership",{body:{subscriptionId:e}});if(n)throw new Error(n.message||"Failed to cancel membership subscription")}catch(r){throw console.error("Error canceling membership subscription:",r),r}}static async cancelBusinessSubscription(e){try{const{data:r,error:n}=await Q.functions.invoke("cancel-business-subscription",{body:{businessId:e}});if(n)throw new Error(n.message||"Failed to cancel business subscription")}catch(r){throw console.error("Error canceling business subscription:",r),r}}static async createCustomerPortalSession(e){try{const{data:r,error:n}=await Q.functions.invoke("create-customer-portal",{body:{return_url:e}});if(n)throw new Error(n.message||"Failed to create customer portal session");return r.url}catch(r){throw console.error("Error creating customer portal session:",r),r}}static async getBusinessSubscription(){try{const{data:{user:e}}=await Q.auth.getUser();if(!e)throw new Error("User not authenticated");const{data:r,error:n}=await Q.from("business_profiles").select("id, business_name, business_subscription_id, business_subscription_status, business_subscription_expires_at").eq("owner_id",e.id).eq("business_subscription_status","active").limit(1).single();
600if(n&&n.code!=="PGRST116")throw n;return!r||!r.business_subscription_id?null:{id:r.business_subscription_id,status:r.business_subscription_status,current_period_end:r.business_subscription_expires_at,business_id:r.id,business_name:r.business_name,canceled_at:r.business_subscription_status==="canceled"?new Date().toISOString():null}}catch(e){return console.error("Error getting business subscription:",e),null}}static async getUserBusinessesForSubscription(){try{const{data:{user:e}}=await Q.auth.getUser();if(!e)throw new Error("User not authenticated");const{data:r,error:n}=await Q.from("business_profiles").select("id, business_name, business_subscription_status").eq("owner_id",e.id).neq("business_subscription_status","active");if(n)throw n;return r||[]}catch(e){return console.error("Error getting user businesses for subscription:",e),[]}}static async getUserBusinessesWithActiveSubscription(){try{const{data:{user:e}}=await Q.auth.getUser();if(!e)throw new Error("User not authenticated");const{data:r,error:n}=await Q.from("business_profiles").select("id, business_name, business_subscription_status, business_subscription_expires_at, business_cancel_at_period_end, business_canceled_at, is_outside_payment").eq("owner_id",e.id).eq("business_subscription_status","active");if(n)throw n;return r||[]}catch(e){return console.error("Error getting user businesses with active subscription:",e),[]}}static async createBusinessSubscriptionSession(e){var r,n;try{if(!e||e.trim()===""||e==="undefined"||e==="null")throw new Error("Valid business ID is required for subscription");const{data:{user:a}}=await Q.auth.getUser();if(!a)throw new Error("User not authenticated");const{data:i}=await Q.from("profiles").select("stripe_customer_id, email").eq("id",a.id).single(),{data:o}=await Q.from("business_profiles").select("id").eq("owner_id",a.id).eq("business_subscription_status","active").neq("id",e),l=((o==null?void 0:o.length)??0)>0;let c;if(l){const h=await Ro.getAdditionalBusinessStripePriceId();h?(c=h,console.log("Using Additional Business price for this checkout:",c)):(console.warn("Additional Business stripe_price_id not configured, falling back to standard price"),c=this.requireEnv("VITE_STRIPE_BUSINESS_SUBSCRIPTION_PRICE_ID"))}else c=this.requireEnv("VITE_STRIPE_BUSINESS_SUBSCRIPTION_PRICE_ID"),console.log("Using standard Business Subscription price for this checkout:",c);console.log("Creating business subscription with params:",{businessId:e,priceId:c,customerId:i==null?void 0:i.stripe_customer_id,userEmail:a.email});const{data:u,error:d}=await Q.functions.invoke("create-business-subscription-session",{body:{priceId:c,businessId:e,customerId:i==null?void 0:i.stripe_customer_id,customerEmail:(i==null?void 0:i.email)||a.email,successUrl:`${window.location.origin}/dashboard/businesses?subscription=success`,cancelUrl:`${window.location.origin}/dashboard/businesses?subscription=canceled`,subscriptionType:"business"}});if(d)throw console.error("Edge function error:",d),(r=d.message)!=null&&r.includes("Business ID is required")?new Error("Business ID is missing. Please refresh the page and try again."):(n=d.message)!=null&&n.includes("Price ID is required")?new Error("Subscription pricing configuration error. Please contact support."):new Error(d.message||"Failed to create business subscription session");if(!u||!u.url)throw new Error("Invalid response from subscription service");return u}catch(a){throw console.error("Error creating business subscription session:",a),a}}static async createBusinessPortalSession(e){try{const{data:r,error:n}=await Q.functions.invoke("create-customer-portal",{body:{return_url:e||`${window.location.origin}/dashboard/businesses`}});if(n)throw new Error(n.message||"Failed to create business portal session");return{url:r.url}}catch(r){throw console.error("Error creating business portal session:",r),r}}}var F2="focusScope.autoFocusOnMount",S2="focusScope.autoFocusOnUnmount",JE={bubbles:!1,cancelable:!0},pQ="FocusScope",Cw=x.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=t,[l,c]=x.useState(null),u=Zs(a),d=Zs(i),h=x.useRef(null),f=Cr(e,y=>c(y)),m=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(n){let y=function(N){if(m.paused||!l)return;const S=N.target;l.contains(S)?h.current=S:xh(h.current,{select:!0})},b=function(N){if(m.paused||!l)return;const S=N.relatedTarget;S!==null&&(l.contains(S)||xh(h.current,{select:!0}))},w=function(N){if(document.activeElement===document.body)for(const E of N)E.removedNodes.length>0&&xh(l)};document.addEventListener("focusin",y),document.addEventListener("focusout",b);const j=new MutationObserver(w);return l&&j.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",b),j.disconnect()}}},[n,l,m.paused]),x.useEffect(()=>{if(l){ZE.add(m);const y=document.activeElement;if(!l.contains(y)){const w=new CustomEvent(F2,JE);l.addEventListener(F2,u),l.dispatchEvent(w),w.defaultPrevented||(gQ(wQ(SP(l)),{select:!0}),document.activeElement===y&&xh(l))}return()=>{l.removeEventListener(F2,u),setTimeout(()=>{const w=new CustomEvent(S2,JE);l.addEventListener(S2,d),l.dispatchEvent(w),w.defaultPrevented||xh(y??document.body,{select:!0}),l.removeEventListener(S2,d),ZE.remove(m)},0)}}},[l,u,d,m]);const g=x.useCallback(y=>{if(!r&&!n||m.paused)return;const b=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,w=document.activeElement;if(b&&w){const j=y.currentTarget,[N,S]=xQ(j);N&&S?!y.shiftKey&&w===S?(y.preventDefault(),r&&xh(N,{select:!0})):y.shiftKey&&w===N&&(y.preventDefault(),r&&xh(S,{select:!0})):w===j&&y.preventDefault()}},[r,n,m.paused]);return s.jsx(Zt.div,{tabIndex:-1,...o,ref:f,onKeyDown:g})});Cw.displayName=pQ;function gQ(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(xh(n,{select:e}),document.activeElement!==r)return}function xQ(t){const e=SP(t),r=YE(e,t),n=YE(e.reverse(),t);return[r,n]}function SP(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function YE(t,e){for(const r of t)if(!yQ(r,{upTo:e}))return r}function yQ(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function bQ(t){return t instanceof HTMLInputElement&&"select"in t}function xh(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&bQ(t)&&e&&t.select()}}var ZE=vQ();function vQ(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=XE(t,e),t.unshift(e)},remove(e){var r;t=XE(t,e),(r=t[0])==null||r.resume()}}}function XE(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function wQ(t){return t.filter(e=>e.tagName!=="A")}var C2=0;function JC(){x.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??QE()),document.body.insertAdjacentElement("beforeend",t[1]??QE()),C2++,()=>{C2===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e
vendor: 5,091 bytes, lines 600-615
600=>e.remove()),C2--}},[])}function QE(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var qv="right-scroll-bar-position",Gv="width-before-scroll-bar",jQ="with-scroll-bars-hidden",NQ="--removed-body-scroll-bar-size";function k2(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function FQ(t,e){var r=x.useState(function(){return{value:t,callback:e,facade:{get current(){return r.value},set current(n){var a=r.value;a!==n&&(r.value=n,r.callback(n,a))}}}})[0];return r.callback=e,r.facade}var SQ=typeof window<"u"?x.useLayoutEffect:x.useEffect,e5=new WeakMap;function CQ(t,e){var r=FQ(null,function(n){return t.forEach(function(a){return k2(a,n)})});return SQ(function(){var n=e5.get(r);if(n){var a=new Set(n),i=new Set(t),o=r.current;a.forEach(function(l){i.has(l)||k2(l,null)}),i.forEach(function(l){a.has(l)||k2(l,o)})}e5.set(r,t)},[t]),r}function kQ(t){return t}function _Q(t,e){e===void 0&&(e=kQ);var r=[],n=!1,a={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(i){var o=e(i,n);return r.push(o),function(){r=r.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(n=!0;r.length;){var o=r;r=[],o.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var o=[];if(r.length){var l=r;r=[],l.forEach(i),o=r}var c=function(){var d=o;o=[],d.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),r}}}};return a}function EQ(t){t===void 0&&(t={});var e=_Q(null);return e.options=Sh({async:!0,ssr:!1},t),e}var CP=function(t){var e=t.sideCar,r=wM(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=e.read();if(!n)throw new Error("Sidecar medium not found");return x.createElement(n,Sh({},r))};CP.isSideCarExport=!0;function AQ(t,e){return t.useMedium(e),CP}var kP=EQ(),_2=function(){},kw=x.forwardRef(function(t,e){var r=x.useRef(null),n=x.useState({onScrollCapture:_2,onWheelCapture:_2,onTouchMoveCapture:_2}),a=n[0],i=n[1],o=t.forwardProps,l=t.children,c=t.className,u=t.removeScrollBar,d=t.enabled,h=t.shards,f=t.sideCar,m=t.noRelative,g=t.noIsolation,y=t.inert,b=t.allowPinchZoom,w=t.as,j=w===void 0?"div":w,N=t.gapMode,S=wM(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=f,C=CQ([r,e]),T=Sh(Sh({},S),a);return x.createElement(x.Fragment,null,d&&x.createElement(E,{sideCar:kP,removeScrollBar:u,shards:h,noRelative:m,noIsolation:g,inert:y,setCallbacks:i,allowPinchZoom:!!b,lockRef:r,gapMode:N}),o?x.cloneElement(x.Children.only(l),Sh(Sh({},T),{ref:C})):x.createElement(j,Sh({},T,{className:c,ref:C}),l))});kw.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};kw.classNames={fullWidth:Gv,zeroRight:qv};var DQ=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function TQ(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=DQ();return e&&t.setAttribute("nonce",e),t}function MQ(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function PQ(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var RQ=function(){var t=0,e=null;return{add:function(r){t==0&&(e=TQ())&&(MQ(e,r),PQ(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},BQ=function(){var t=RQ();return function(e,r){x.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},_P=function(){var t=BQ(),e=function(r){var n=r.styles,a=r.dynamic;return t(n,a),null};return e},LQ={left:0,top:0,right:0,gap:0},E2=function(t){return parseInt(t||"",10)||0},IQ=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],n=e[t==="padding"?"paddingTop":"marginTop"],a=e[t==="padding"?"paddingRight":"marginRight"];return[E2(r),E2(n),E2(a)]},OQ=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return LQ;var e=IQ(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},zQ=_P(),Sg="data-scroll-locked",UQ=function(t,e,r,n){var a=t.left,i=t.top,o=t.right,l=t.gap;return r===void 0&&(r="margin"),` 601 .`.concat(jQ,` { 602 overflow: hidden `).concat(n,`; 603 padding-right: `).concat(l,"px ").concat(n,`; 604 } 605 body[`).concat(Sg,`] { 606 overflow: hidden `).concat(n,`; 607 overscroll-behavior: contain; 608 `).concat([e&&"position: relative ".concat(n,";"),r==="margin"&&` 609 padding-left: `.concat(a,`px; 610 padding-top: `).concat(i,`px; 611 padding-right: `).concat(o,`px; 612 margin-left:0; 613 margin-top:0; 614 margin-right: `).concat(l,"px ").concat(n,`; 615 `),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";
615")].filter(Boolean).join(""),` 616 } 617 618 .`).concat(qv,` { 619 right: `).concat(l,"px ").concat(n,`; 620 } 621 622 .`).concat(Gv,` { 623 margin-right: `).concat(l,"px ").concat(n,`; 624 } 625 626 .`).concat(qv," .").concat(qv,` { 627 right: 0 `).concat(n,`; 628 } 629 630 .`).concat(Gv," .").concat(Gv,` { 631 margin-right: 0 `).concat(n,`; 632 } 633 634 body[`).concat(Sg,`] { 635 `).concat(NQ,": ").concat(l,`px; 636 } 637`)},t5=function(){var t=parseInt(document.body.getAttribute(Sg)||"0",10);return isFinite(t)?t:0},HQ=function(){x.useEffect(function(){return document.body.setAttribute(Sg,(t5()+1).toString()),function(){var t=t5()-1;t<=0?document.body.removeAttribute(Sg):document.body.setAttribute(Sg,t.toString())}},[])},$Q=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,a=n===void 0?"margin":n;HQ();var i=x.useMemo(function(){return OQ(a)},[a]);return x.createElement(zQ,{styles:UQ(i,!e,a,r?"":"!important")})},TF=!1;if(typeof window<"u")try{var ov=Object.defineProperty({},"passive",{get:function(){return TF=!0,!0}});window.addEventListener("test",ov,ov),window.removeEventListener("test",ov,ov)}catch{TF=!1}var Jp=TF?{passive:!1}:!1,WQ=function(t){return t.tagName==="TEXTAREA"},EP=function(t,e){if(!(t instanceof Element))return!1;var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!WQ(t)&&r[e]==="visible")},qQ=function(t){return EP(t,"overflowY")},GQ=function(t){return EP(t,"overflowX")},r5=function(t,e){var r=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var a=AP(t,n);if(a){var i=DP(t,n),o=i[1],l=i[2];if(o>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},VQ=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},KQ=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},AP=function(t,e){return t==="v"?qQ(e):GQ(e)},DP=function(t,e){return t==="v"?VQ(e):KQ(e)},JQ=function(t,e){return t==="h"&&e==="rtl"?-1:1},YQ=function(t,e,r,n,a){var i=JQ(t,window.getComputedStyle(e).direction),o=i*n,l=r.target,c=e.contains(l),u=!1,d=o>0,h=0,f=0;do{if(!l)break;var m=DP(t,l),g=m[0],y=m[1],b=m[2],w=y-b-i*g;(g||w)&&AP(t,l)&&(h+=w,f+=g);var j=l.parentNode;l=j&&j.nodeType===Node.DOCUMENT_FRAGMENT_NODE?j.host:j}while(!c&&l!==document.body||c&&(e.contains(l)||e===l));return(d&&Math.abs(h)<1||!d&&Math.abs(f)<1)&&(u=!0),u},lv=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},s5=function(t){return[t.deltaX,t.deltaY]},n5=function(t){return t&&"current"in t?t.current:t},ZQ=function(t,e){return t[0]===e[0]&&t[1]===e[1]},XQ=function(t){return` 638 .block-interactivity-`.concat(t,` {pointer-events: none;} 639 .allow-interactivity-`).concat(t,` {pointer-events: all;} 640`)},QQ=0,Yp=[];function eee(t){var e=x.useRef([]),r=x.useRef([0,0]),n=x.useRef(),a=x.useState(QQ++)[0],i=x.useState(_P)[0],o=x.useRef(t);x.useEffect(function(){o.current=t},[t]),x.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(a));var y=kG([t.lockRef.current],(t.shards||[]).map(n5),!0).filter(Boolean);return y.forEach(function(b){return b.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),y.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(a))})}}},[t.inert,t.lockRef.current,t.shards]);var l=x.useCallback(function(y,b){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!o.current.allowPinchZoom;var w=lv(y),j=r.current,N="deltaX"in y?y.deltaX:j[0]-w[0],S="deltaY"in y?y.deltaY:j[1]-w[1],E,C=y.target,T=Math.abs(N)>Math.abs(S)?"h":"v";if("touches"in y&&T==="h"&&C.type==="range")return!1;var D=window.getSelection(),A=D&&D.anchorNode,R=A?A===C||A.contains(C):!1;if(R)return!1;var M=r5(T,C);if(!M)return!0;if(M?E=T:(E=T==="v"?"h":"v",M=r5(T,C)),!M)return!1;if(!n.current&&"changedTouches"in y&&(N||S)&&(n.current=E),!E)return!0;var P=n.current||E;return YQ(P,b,y,P==="h"?N:S)},[]),c=x.useCallback(function(y){var b=y;if(!(!Yp.length||Yp[Yp.length-1]!==i)){var w="deltaY"in b?s5(b):lv(b),j=e.current.filter(function(E){return E.name===b.type&&(E.target===b.target||b.target===E.shadowParent)&&ZQ(E.delta,w)})[0];if(j&&j.should){b.cancelable&&b.preventDefault();return}
vendor: 4,985 bytes, line 640
640if(!j){var N=(o.current.shards||[]).map(n5).filter(Boolean).filter(function(E){return E.contains(b.target)}),S=N.length>0?l(b,N[0]):!o.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),u=x.useCallback(function(y,b,w,j){var N={name:y,delta:b,target:w,should:j,shadowParent:tee(w)};e.current.push(N),setTimeout(function(){e.current=e.current.filter(function(S){return S!==N})},1)},[]),d=x.useCallback(function(y){r.current=lv(y),n.current=void 0},[]),h=x.useCallback(function(y){u(y.type,s5(y),y.target,l(y,t.lockRef.current))},[]),f=x.useCallback(function(y){u(y.type,lv(y),y.target,l(y,t.lockRef.current))},[]);x.useEffect(function(){return Yp.push(i),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:f}),document.addEventListener("wheel",c,Jp),document.addEventListener("touchmove",c,Jp),document.addEventListener("touchstart",d,Jp),function(){Yp=Yp.filter(function(y){return y!==i}),document.removeEventListener("wheel",c,Jp),document.removeEventListener("touchmove",c,Jp),document.removeEventListener("touchstart",d,Jp)}},[]);var m=t.removeScrollBar,g=t.inert;return x.createElement(x.Fragment,null,g?x.createElement(i,{styles:XQ(a)}):null,m?x.createElement($Q,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function tee(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const ree=AQ(kP,eee);var _w=x.forwardRef(function(t,e){return x.createElement(kw,Sh({},t,{ref:e,sideCar:ree}))});_w.classNames=kw.classNames;var see=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Zp=new WeakMap,cv=new WeakMap,uv={},A2=0,TP=function(t){return t&&(t.host||TP(t.parentNode))},nee=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=TP(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},aee=function(t,e,r,n){var a=nee(e,Array.isArray(t)?t:[t]);uv[r]||(uv[r]=new WeakMap);var i=uv[r],o=[],l=new Set,c=new Set(a),u=function(h){!h||l.has(h)||(l.add(h),u(h.parentNode))};a.forEach(u);var d=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(f){if(l.has(f))d(f);else try{var m=f.getAttribute(n),g=m!==null&&m!=="false",y=(Zp.get(f)||0)+1,b=(i.get(f)||0)+1;Zp.set(f,y),i.set(f,b),o.push(f),y===1&&g&&cv.set(f,!0),b===1&&f.setAttribute(r,"true"),g||f.setAttribute(n,"true")}catch(w){console.error("aria-hidden: cannot operate on ",f,w)}})};return d(e),l.clear(),A2++,function(){o.forEach(function(h){var f=Zp.get(h)-1,m=i.get(h)-1;Zp.set(h,f),i.set(h,m),f||(cv.has(h)||h.removeAttribute(n),cv.delete(h)),m||h.removeAttribute(r)}),A2--,A2||(Zp=new WeakMap,Zp=new WeakMap,cv=new WeakMap,uv={})}},YC=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),a=see(t);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),aee(n,a,r,"aria-hidden")):function(){return null}},Ew="Dialog",[MP,PP]=li(Ew),[iee,Hc]=MP(Ew),RP=t=>{const{__scopeDialog:e,children:r,open:n,defaultOpen:a,onOpenChange:i,modal:o=!0}=t,l=x.useRef(null),c=x.useRef(null),[u,d]=Lo({prop:n,defaultProp:a??!1,onChange:i,caller:Ew});return s.jsx(iee,{scope:e,triggerRef:l,contentRef:c,contentId:hl(),titleId:hl(),descriptionId:hl(),open:u,onOpenChange:d,onOpenToggle:x.useCallback(()=>d(h=>!h),[d]),modal:o,children:r})};RP.displayName=Ew;var BP="DialogTrigger",LP=x.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=Hc(BP,r),i=Cr(e,a.triggerRef);return s.jsx(Zt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":QC(a.open),...n,ref:i,onClick:gt(t.onClick,a.onOpenToggle)})});LP.displayName=BP;var ZC="DialogPortal",[oee,IP]=MP(ZC,{forceMount:void 0}),OP=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:a}=t,i=Hc(ZC,e);return s.jsx(oee,{scope:e,forceMount:r,children:x.Children.map(n,o=>s.jsx(fa,{present:r||i.open,children:s.jsx(B0,{asChild:!0,container:a,children:o})}))})};OP.displayName=ZC;var x1="DialogOverlay",zP=x.forwardRef((t,e)=>{const r=IP(x1,t.__scopeDialog),{forceMount:n=r.forceMount,...a}=t,i=Hc(x1,t.__scopeDialog);return i.modal?s.jsx(fa,{present:n||i.open,children:s.jsx(cee,{...a,ref:e})}):null});zP.displayName=x1;var lee=Vg("DialogOverlay.RemoveScroll"),cee=x.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=Hc(x1,r);return s.jsx(_w,{as:lee,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(Zt.div,{"data-state":QC(a.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),qf="DialogContent",UP=x.forwardRef((t,e)=>{const r=IP(qf,t.__scopeDialog),{forceMount:n=r.forceMount,...a}=t,i=Hc(qf,t.__scopeDialog);return s.jsx(fa,{present:n||i.open,children:i.modal?s.jsx(uee,{...a,ref:e}):s.jsx(dee,{...a,ref:e})})});UP.displayName=qf;var uee=x.forwardRef((t,e)=>{const r=Hc(qf,t.__scopeDialog),n=x.useRef(null),a=Cr(e,r.contentRef,n);return x.useEffect(()=>{const i=n.current;if(i)return YC(i)}
vendor: 4,495 bytes, lines 640-644
640,[]),s.jsx(HP,{...t,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:gt(t.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:gt(t.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:gt(t.onFocusOutside,i=>i.preventDefault())})}),dee=x.forwardRef((t,e)=>{const r=Hc(qf,t.__scopeDialog),n=x.useRef(!1),a=x.useRef(!1);return s.jsx(HP,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=t.onCloseAutoFocus)==null||o.call(t,i),i.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),i.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:i=>{var c,u;(c=t.onInteractOutside)==null||c.call(t,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((u=r.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),HP=x.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=t,l=Hc(qf,r),c=x.useRef(null),u=Cr(e,c);return JC(),s.jsxs(s.Fragment,{children:[s.jsx(Cw,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(lp,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":QC(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(mee,{titleId:l.titleId}),s.jsx(pee,{contentRef:c,descriptionId:l.descriptionId})]})]})}),XC="DialogTitle",$P=x.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=Hc(XC,r);return s.jsx(Zt.h2,{id:a.titleId,...n,ref:e})});$P.displayName=XC;var WP="DialogDescription",qP=x.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=Hc(WP,r);return s.jsx(Zt.p,{id:a.descriptionId,...n,ref:e})});qP.displayName=WP;var GP="DialogClose",VP=x.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=Hc(GP,r);return s.jsx(Zt.button,{type:"button",...n,ref:e,onClick:gt(t.onClick,()=>a.onOpenChange(!1))})});VP.displayName=GP;function QC(t){return t?"open":"closed"}var KP="DialogTitleWarning",[hee,JP]=zG(KP,{contentName:qf,titleName:XC,docsSlug:"dialog"}),mee=({titleId:t})=>{const e=JP(KP),r=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. 641 642If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. 643 644For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return x.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},fee="DialogDescriptionWarning",pee=({contentRef:t,descriptionId:e})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${JP(fee).contentName}}.`;return x.useEffect(()=>{var i;const a=(i=t.current)==null?void 0:i.getAttribute("aria-describedby");e&&a&&(document.getElementById(e)||console.warn(n))},[n,t,e]),null},ek=RP,YP=LP,tk=OP,z0=zP,U0=UP,H0=$P,$0=qP,W0=VP,ZP="AlertDialog",[gee]=li(ZP,[PP]),Md=PP(),XP=t=>{const{__scopeAlertDialog:e,...r}=t,n=Md(e);return s.jsx(ek,{...n,...r,modal:!0})};XP.displayName=ZP;var xee="AlertDialogTrigger",QP=x.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,a=Md(r);return s.jsx(YP,{...a,...n,ref:e})});QP.displayName=xee;var yee="AlertDialogPortal",eR=t=>{const{__scopeAlertDialog:e,...r}=t,n=Md(e);return s.jsx(tk,{...n,...r})};eR.displayName=yee;var bee="AlertDialogOverlay",tR=x.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,a=Md(r);return s.jsx(z0,{...a,...n,ref:e})});tR.displayName=bee;var Cg="AlertDialogContent",[vee,wee]=gee(Cg),jee=SM("AlertDialogContent"),rR=x.forwardRef((t,e)=>{const{__scopeAlertDialog:r,children:n,...a}=t,i=Md(r),o=x.useRef(null),l=Cr(e,o),c=x.useRef(null);return s.jsx(hee,{contentName:Cg,titleName:sR,docsSlug:"alert-dialog",children:s.jsx(vee,{scope:r,cancelRef:c,children:s.jsxs(U0,{role:"alertdialog",...i,...a,ref:l,onOpenAutoFocus:gt(a.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[s.jsx(jee,{children:n}),s.jsx(Fee,{contentRef:o})]})})})});rR.displayName=Cg;var sR="AlertDialogTitle",nR=x.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,a=Md(r);return s.jsx(H0,{...a,...n,ref:e})});nR.displayName=sR;
644var aR="AlertDialogDescription",iR=x.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,a=Md(r);return s.jsx($0,{...a,...n,ref:e})});iR.displayName=aR;var Nee="AlertDialogAction",oR=x.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,a=Md(r);return s.jsx(W0,{...a,...n,ref:e})});oR.displayName=Nee;var lR="AlertDialogCancel",cR=x.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,{cancelRef:a}=wee(lR,r),i=Md(r),o=Cr(e,a);return s.jsx(W0,{...i,...n,ref:o})});cR.displayName=lR;var Fee=({contentRef:t})=>{const e=`\`${Cg}\` requires a description for the component to be accessible for screen reader users. 645 646You can add a description to the \`${Cg}\` by passing a \`${aR}\` component as a child, which also benefits sighted users by adding visible context to the dialog. 647 648Alternatively, 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 \`${Cg}\`. 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. 649 650For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return x.useEffect(()=>{var n;document.getElementById((n=t.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},See=XP,Cee=QP,kee=eR,uR=tR,dR=rR,hR=oR,mR=cR,fR=nR,pR=iR;const ai=See,rk=Cee,_ee=kee,gR=x.forwardRef(({className:t,...e},r)=>s.jsx(uR,{className:xt("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",t),...e,ref:r}));gR.displayName=uR.displayName;const Oa=x.forwardRef(({className:t,...e},r)=>s.jsxs(_ee,{children:[s.jsx(gR,{}),s.jsx(dR,{ref:r,className:xt("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",t),...e})]}));Oa.displayName=dR.displayName;const za=({className:t,...e})=>s.jsx("div",{className:xt("flex flex-col space-y-2 text-center sm:text-left",t),...e});za.displayName="AlertDialogHeader";const Ua=({className:t,...e})=>s.jsx("div",{className:xt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Ua.displayName="AlertDialogFooter";const Ha=x.forwardRef(({className:t,...e},r)=>s.jsx(fR,{ref:r,className:xt("text-lg font-semibold",t),...e}));Ha.displayName=fR.displayName;const $a=x.forwardRef(({className:t,...e},r)=>s.jsx(pR,{ref:r,className:xt("text-sm text-muted-foreground",t),...e}));$a.displayName=pR.displayName;const Wa=x.forwardRef(({className:t,...e},r)=>s.jsx(hR,{ref:r,className:xt(Sw(),t),...e}));Wa.displayName=hR.displayName;const qa=x.forwardRef(({className:t,...e},r)=>s.jsx(mR,{ref:r,className:xt(Sw({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));qa.displayName=mR.displayName;const xR=({isOpen:t,onClose:e,onConfirm:r,businessName:n,isLoading:a,expirationDate:i})=>{const o=()=>{const l=new Date;return new Date(l.getFullYear(),11,31).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})};return s.jsx(ai,{open:t,onOpenChange:e,children:s.jsxs(Oa,{children:[s.jsxs(za,{children:[s.jsx(Ha,{children:"Cancel Business Subscription?"}),s.jsxs($a,{className:"space-y-3",children:[s.jsxs("p",{children:["Are you sure you want to cancel the business subscription for"," ",s.jsx("strong",{children:n}),"?"]}),s.jsxs("div",{className:"text-sm space-y-2",children:[s.jsxs("p",{className:"text-gray-600",children:["Your subscription will remain active through the end of this year (",s.jsx("strong",{children:o()}),"), and you won't be charged for future billing periods."]}),s.jsx("p",{className:"text-amber-600 font-medium",children:"â ï¸ After cancellation, your business listing will become inactive and won't appear in the public directory."}),s.jsx("p",{className:"text-sm text-gray-500",children:"This action cannot be undone. You'll need to create a new subscription to reactivate your business listing."})]})]})]}),s.jsxs(Ua,{children:[s.jsx(qa,{disabled:a,children:"Keep Subscription"}),s.jsx(Wa,{onClick:r,disabled:a,className:"bg-red-600 text-white hover:bg-red-700",children:a?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"h-4 w-4 animate-spin mr-2"}),"Canceling..."]}):"Yes, Cancel Subscription"})]})]})})},yR=({business:t,showEditButton:e=!1,onEdit:r,onActivate:n,showStatusBadges:a=!1,onBusinessUpdated:i})=>{const[o,l]=x.useState(!1),[c,u]=x.useState(!1),{toast:d}=St(),h=()=>{u(!0)},f=async()=>{try{l(!0),u(!1),await Bi.cancelBusinessSubscription(t.id),d({title:"Subscription Canceled",description:"Your business subscription will be canceled at the end of the current billing period.",variant:"default"}),i&&i()}catch(T){console.error("Error canceling business subscription:",T),d({title:"Cancellation Failed",description:T.message||"Failed to cancel business subscription. Please try again.",variant:"destructive"})}finally{l(!1)}},m=(T,D=100)=>!T||T.length<=D?T:T.substring(0,D)+"...",g=()=>t.short_description||t.business_description||t.description||"",y=()=>{var M;if(t.business_type==="service_area")return((M=t.service_area)==null?void 0:M.description)||null;if(!t.location)return null;const{address:T,city:D,state:A}=t.location,R=[T,D,A].filter(P=>P&&P.trim()!=="");return R.length>0?R.join(", "):null},b=()=>t.business_subscription_status!=="active",w=()=>t.business_subscription_status==="active"&&!t.business_cancel_at_period_end,j=()=>
650{if(!a)return null;if(t.business_subscription_status==="active"&&t.business_cancel_at_period_end){const T=t.business_subscription_expires_at?new Date(t.business_subscription_expires_at).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):null;return s.jsxs(ke,{variant:"outline",className:"border-orange-500 text-orange-600",children:[s.jsx(Br,{className:"w-3 h-3 mr-1"}),T?`Ends ${T}`:"Canceling at Period End"]})}switch(t.business_subscription_status){case"active":return s.jsxs(ke,{variant:"default",className:"bg-green-500",children:[s.jsx(Or,{className:"w-3 h-3 mr-1"}),"Active"]});case"inactive":return s.jsxs(ke,{variant:"outline",className:"bg-orange-50 text-orange-700 border-orange-200",children:[s.jsx(Ts,{className:"w-3 h-3 mr-1"}),"Inactive"]});case"canceled":return s.jsxs(ke,{variant:"destructive",children:[s.jsx(Ts,{className:"w-3 h-3 mr-1"}),"Canceled"]});case"past_due":return s.jsxs(ke,{variant:"destructive",children:[s.jsx(Ts,{className:"w-3 h-3 mr-1"}),"Past Due"]});default:return s.jsxs(ke,{variant:"outline",children:[s.jsx(Ts,{className:"w-3 h-3 mr-1"}),t.business_subscription_status||"Inactive"]})}},N=()=>{if(!a)return null;switch(t.status){case"pending":return s.jsxs(ke,{variant:"outline",className:"bg-yellow-50 text-yellow-700 border-yellow-200",children:[s.jsx(Ts,{className:"w-3 h-3 mr-1"}),"Pending Review"]});case"approved":return null;case"rejected":return s.jsxs(ke,{variant:"destructive",children:[s.jsx(Ts,{className:"w-3 h-3 mr-1"}),"Rejected"]});default:return null}},S=T=>{if(T){if(T.includes("unsplash.com/photo-")&&!T.includes("?")&&(T.includes("w=")||T.includes("&"))){const D=T.indexOf("w=");if(D>
6500)return T.slice(0,D)+"?"+T.slice(D);const A=T.indexOf("auto=");if(A>0)return T.slice(0,A)+"?"+T.slice(A)}return T}},E=y(),C=g();return s.jsxs(De,{className:"h-full flex flex-col overflow-hidden hover:shadow-lg transition-shadow duration-300",onMouseEnter:()=>Ya.trackBusinessCardInteraction(t.id,t.name,"hover"),onFocus:()=>Ya.trackBusinessCardInteraction(t.id,t.name,"focus"),children:[s.jsxs("div",{className:"relative",children:[s.jsxs("div",{className:"absolute top-2 left-2 z-10 flex flex-col gap-1",children:[j(),N()]}),t.featured&&s.jsx("div",{className:"absolute top-2 right-2 bg-chamber-gold text-white px-2 py-1 text-xs font-semibold rounded z-10",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx(ri,{size:14,className:"mr-1"})," Featured"]})}),s.jsx(Qg,{ratio:16/10,className:"bg-gray-100",children:t.cover_image_url?s.jsx("img",{src:S(t.cover_image_url),alt:`${t.name} cover`,className:"w-full h-full object-cover",loading:"lazy",onError:T=>{console.error("Failed to load cover image:",t.cover_image_url),T.currentTarget.style.display="none";const D=T.currentTarget.parentElement;if(D&&!D.querySelector(".fallback-icon")){D.classList.add("flex","items-center","justify-center","bg-gray-100");const A=document.createElement("div");A.className="fallback-icon",A.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-gray-400"><rect x="4" y="2" width="16" height="20" rx="2" ry="2"></rect><path d="M9 22v-4h6v4"></path><path d="M8 6h.01"></path><path d="M16 6h.01"></path><path d="M12 6h.01"></path><path d="M12 10h.01"></path><path d="M12 14h.01"></path><path d="M16 10h.01"></path><path d="M16 14h.01"></path><path d="M8 10h.01"></path><path d="M8 14h.01"></path></svg>',D.appendChild(A)}}}):s.jsx("div",{className:"flex items-center justify-center w-full h-full",children:s.jsx(ka,{size:64,className:"text-gray-400"})})}),s.jsx("div",{className:"absolute -bottom-8 left-4 transform",children:s.jsx("div",{className:"w-24 h-24 rounded-lg overflow-hidden border-2 border-white shadow-md bg-white",children:t.logo_url?s.jsx("img",{src:S(t.logo_url),alt:`${t.name} logo`,className:"w-full h-full object-contain",loading:"lazy",onError:T=>{console.error("Failed to load logo image:",t.logo_url),T.currentTarget.style.display="none";const D=T.currentTarget.parentElement;if(D&&!D.querySelector(".fallback-icon")){D.classList.add("flex","items-center","justify-center","bg-gray-100");const A=document.createElement("div");A.className="fallback-icon",A.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-gray-400"><rect x="4" y="2" width="16" height="20" rx="2" ry="2"></rect><path d="M9 22v-4h6v4"></path><path d="M8 6h.01"></path><path d="M16 6h.01"></path><path d="M12 6h.01"></path><path d="M12 10h.01"></path><path d="M12 14h.01"></path><path d="M16 10h.01"></path><path d="M16 14h.01"></path><path d="M8 10h.01"></path><path d="M8 14h.01"></path></svg>',D.appendChild(A)}}}):s.jsx("div",{className:"flex items-center justify-center w-full h-full bg-gray-100",children:s.jsx(ka,{size:48,className:"text-gray-400"})})})})]}),s.jsxs(Be,{className:"pt-12 flex-grow",children:[s.jsx("h3",{className:"text-xl font-semibold mb-2 text-gray-900 truncate",children:t.name}),C&&s.jsx("p",{className:"text-gray-600 text-sm mb-3 line-clamp-3",children:m(C)}),s.jsxs("div",{className:"space-y-2 text-sm",children:[E&&s.jsxs("div",{className:"flex items-start",children:[s.jsx(_n,{size:16,className:"text-gray-500 mr-2 mt-1 flex-shrink-0"}),s.jsx("span",{className:"text-gray-700 truncate",children:E})]}),t.phone&&t.phone.trim()!==""&&s.jsxs("div",{className:"flex items-center",children:[s.jsx(wi,{size:16,className:"text-gray-500 mr-2 flex-shrink-0"}),s.jsx("a",{href:`tel:${t.phone}`,className:"text-chamber-blue hover:underline",onClick:()=>{Ia.contactBusiness(t.id,t.name,"phone"),Ya.trackBusinessCardInteraction(t.id,t.name,"click_phone")},children:t.phone})]}),t.website&&t.website.trim()!==""&&s.jsxs("div",{className:"flex items-center",children:[s.jsx(Bc,{size:16,className:"text-gray-500 mr-2 flex-shrink-0"}),s.jsx("a",{href:t.website,target:"_blank",rel:"noopener noreferrer",className:"text-chamber-blue hover:underline truncate max-w-[200px]",onClick:()=>{Ia.contactBusiness(t.id,t.name,"website"),Ya.trackBusinessCardInteraction(t.id,t.name,"click_website")},children:t.website.replace(/^https?:\/\//,"")})]})]}),t.categories&&t.categories.length>0&&s.jsx("div",{className:"mt-4 flex flex-wrap gap-2",children:t.categories.map((T,D)=>s.jsx(ke,{variant:"outline",className:"bg-chamber-blue-light text-chamber-blue-dark",children:T.name},D))}),t.tags&&t.tags.length>0&&t.tags.some(T=>T&&T.trim()!=="")&&s.jsxs("div",{className:"mt-3 flex flex-wrap gap-1",children:[t.tags.filter(T=>T&&T.trim()!=="").slice(0,5).map((T,D)=>s.jsx(ke,{variant:"secondary",className:"text-xs bg-gray-100 text-gray-700 hover:bg-gray-200",children:T},D)),t.tags.filter(T=>T&&T.trim()!=="").length>5&&s.jsxs(ke,{variant:"secondary",className:"text-xs bg-gray-100 text-gray-500",children:["+",t.tags.filter(T=>T&&T.trim()!=="").length-5," more"]})]})]}),s.jsx(co,{className:"pt-2 pb-4 mt-auto",children:s.jsxs("div",{className:"w-full flex flex-col gap-2",children:[s.jsx(rt,{to:`/businesses/${t.id}`,className:"w-full text-center text-white bg-chamber-blue py-2 rounded-md hover:bg-chamber-blue-dark transition-colors",onClick:()=>{const T=t.categories&&t.categories.length>0?t.categories[0].name:"Uncategorized",D=t.business_type==="service_area"?"Service Area":t.location&&t.location.city&&t.location.state?`${t.location.city}, ${t.location.state}`:"Location not specified";Ia.viewBusiness(t.id,t.name,T,D)},children:"View Business"}),w()&&a&&!t.is_outside_payment&&s.jsx(Y,{variant:"outline",className:"w-full flex items-center justify-center gap-2 border-red-200 text-red-600 hover:bg-red-50 hover:border-red-300",onClick:h,disabled:o,children:"Cancel Subscription"}),b()&&n&&s.jsxs(Y,{variant:"default",className:"w-full flex items-center justify-center gap-2 bg-orange-600 hover:bg-orange-700 text-white",onClick:n,children:[s.jsx(Ii,{size:16})," Activate Business"]}),e&&r&&s.jsxs(Y,{variant:"outline",className:"w-full flex items-center justify-center gap-2",onClick:r,children:[s.jsx(zs,{size:16})," Edit Business"]})]})}),s.jsx(xR,{isOpen:c,onClose:()=>u(!1),onConfirm:f,businessName:t.name,isLoading:o,expirationDate:t.business_subscription_expires_at})]})},Sd=t=>{let e=[];
650if(t.categories&&Array.isArray(t.categories)&&t.categories.length>0){const a=t.categories[0];a&&typeof a=="object"&&"id"in a&&"name"in a?e=t.categories.map(i=>({id:i.id,name:i.name,isPrimary:i.isPrimary||!1})):t.categories.forEach(i=>{typeof i=="string"?e.push({id:i,name:i,isPrimary:!1}):i&&typeof i=="object"&&e.push({id:i.id||i.category_id,name:i.name||i.category_name,isPrimary:i.isPrimary||i.is_primary||!1})})}else t.business_categories&&t.business_categories.length>0&&(console.warn("Business using old category system:",t.id,t.business_name),console.warn("Categories should be migrated to business_category_junction table"),e=[]);const r={id:t.id||"default-location",address:t.address_line1||void 0,city:t.city||void 0,state:t.state||void 0,zipCode:t.zip_code||void 0,latitude:t.latitude,longitude:t.longitude},n=t.business_type==="service_area"&&t.service_area_description?{description:t.service_area_description,radiusMiles:t.service_radius_miles||void 0}:void 0;return{id:t.id,ownerId:t.owner_id,name:t.business_name,short_description:t.short_description||void 0,business_description:t.business_description||void 0,description:t.business_description||t.short_description||"",logo_url:t.logo_url||void 0,cover_image_url:t.cover_image_url||void 0,website:t.website||void 0,phone:t.phone||"",email:t.email||"",facebook_url:t.facebook_url||void 0,instagram_url:t.instagram_url||void 0,twitter_url:t.twitter_url||void 0,business_type:t.business_type||"physical_location",categories:e,location:r,service_area:n,status:t.status||"pending",featured:t.featured||!1,is_first_business:t.is_first_business||!1,business_subscription_status:t.business_subscription_status||"inactive",business_subscription_expires_at:t.business_subscription_expires_at,business_cancel_at_period_end:t.business_cancel_at_period_end||!1,business_canceled_at:t.business_canceled_at||void 0,createdAt:t.created_at,updatedAt:t.updated_at,gallery_urls:t.gallery_urls||[],business_hours_json:t.business_hours_json||{},tags:t.tags||[],is_outside_payment:t.is_outside_payment||!1,outside_payment_note:t.outside_payment_note||void 0,outside_payment_expiration_year:t.outside_payment_expiration_year||void 0,outside_payment_created_at:t.outside_payment_created_at||void 0,outside_payment_updated_at:t.outside_payment_updated_at||void 0}},Eee=()=>{const[t,e]=x.useState([]),[r,n]=x.useState(!0),a=x.useCallback(async()=>{n(!0);try{console.log("Fetching random featured businesses for main page");const{data:i,error:o}=await Q.rpc("get_random_businesses",{p_limit:3,p_offset:0,p_category_id:null,p_search_term:null,p_status:"approved",p_owner_id:null,p_featured:!0,p_exclude_featured:!1});if(o){console.error("Error fetching random featured businesses:",o),e([]);return}if(!i||i.length<3){if(console.log(`Only ${(i==null?void 0:i.length)||0} featured businesses found. Need at least 3 for home page grid. Skipping fallback to maintain featured business integrity.`),i&&i.length>0){const c=i.map(Sd);console.log("Using actual featured businesses only:",c.length),e(c)}else e([]);return}const l=i.map(Sd);console.log("Featured businesses fetched:",l.length),e(l)}catch(i){console.error("Error fetching featured businesses:",i),e([])}finally{n(!1)}},[]);return x.useEffect(()=>{a();const i=setInterval(()=>{console.log("Refreshing random businesses on main page..."),a()},2*60*1e3);return()=>clearInterval(i)},[a]),s.jsx("section",{className:"py-16 bg-white",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs("div",{className:"flex justify-between items-center mb-8",children:[s.jsx("h2",{className:"text-3xl font-bold text-gray-900",children:"Featured Businesses"}),s.jsxs(rt,{to:"/businesses",className:"text-chamber-blue hover:text-chamber-blue-dark flex items-center gap-2 whitespace-nowrap",children:["View All ",s.jsx(ul,{size:16})]})]}),r?s.jsx("div",{className:"flex justify-center items-center py-12",children:s.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-chamber-blue"})}):t.length>0?s.jsx("div",{className:`grid gap-8 ${t.length===1?"grid-cols-1 max-w-md mx-auto":t.length===2?"grid-cols-1 md:grid-cols-2 max-w-2xl mx-auto":"grid-cols-1 md:grid-cols-3"}`,children:t.map(i=>s.jsx(yR,{business:i},i.id))}):s.jsxs("div",{className:"text-center py-12",children:[s.jsx("p",{className:"text-gray-600",children:"No featured businesses available at this time."}),s.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"Check back soon for premium business partners."})]}),s.jsxs("div",{className:"mt-12 text-center",children:[s.jsx("h3",{className:"text-2xl font-semibold text-gray-900 mb-4",children:"Ready to showcase your business?"}),s.jsx("p",{className:"text-gray-600 max-w-2xl mx-auto mb-6",children:"Join our chamber to get featured in our business directory and connect with local customers and other business owners."}),s.jsx(rt,{to:"/auth/signup",children:s.jsx(Y,{size:"lg",className:"bg-chamber-blue hover:bg-chamber-blue-dark",children:"Become a Member"})})]})]})})},Tt=ek,Aw=YP,Aee=tk,Dee=W0,bR=x.forwardRef(({className:t,...e},r)=>s.jsx(z0,{ref:r,className:xt("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",t),...e}));bR.displayName=z0.displayName;const Dt=x.forwardRef(({className:t,children:e,hideCloseButton:r,...n},a)=>s.jsxs(Aee,{children:[s.jsx(bR,{}),s.jsxs(U0,{ref:a,className:xt("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:rou
650nded-lg",t),...n,children:[e,!r&&s.jsxs(W0,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[s.jsx(Ir,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Dt.displayName=U0.displayName;const It=({className:t,...e})=>s.jsx("div",{className:xt("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});It.displayName="DialogHeader";const Sr=({className:t,...e})=>s.jsx("div",{className:xt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Sr.displayName="DialogFooter";const Ot=x.forwardRef(({className:t,...e},r)=>s.jsx(H0,{ref:r,className:xt("text-lg font-semibold leading-none tracking-tight",t),...e}));Ot.displayName=H0.displayName;const rr=x.forwardRef(({className:t,...e},r)=>s.jsx($0,{ref:r,className:xt("text-sm text-muted-foreground",t),...e}));rr.displayName=$0.displayName;const Tee=({imageUrl:t,title:e})=>{const[r,n]=x.useState(!1);return s.jsx(s.Fragment,{children:s.jsx(Qg,{ratio:16/9,className:"bg-gray-200",children:t?s.jsxs(Tt,{open:r,onOpenChange:n,children:[s.jsx(Aw,{asChild:!0,children:s.jsx("img",{src:t,alt:e,className:"w-full h-full object-contain bg-gray-100 cursor-pointer hover:opacity-90 transition-opacity"})}),s.jsx(Dt,{className:"max-w-4xl max-h-[90vh] p-0 bg-transparent border-none shadow-none [&>button]:text-white [&>button]:hover:text-gray-200",children:s.jsx("div",{className:"relative flex items-center justify-center min-h-[50vh] max-h-[90vh]",children:s.jsx("img",{src:t,alt:e,className:"max-w-full max-h-full object-contain",onClick:()=>n(!1)})})})]}):s.jsx("div",{className:"w-full h-full flex items-center justify-center bg-chamber-blue-light",children:s.jsx(Br,{size:48,className:"text-chamber-blue"})})})})},Mee=({date:t,time:e,location:r,ticket_price:n,event_type:a})=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Br,{size:14,className:"text-chamber-blue"}),t]}),s.jsxs("div",{className:"mt-3 space-y-1 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(rn,{size:14,className:"text-chamber-blue"}),s.jsx("span",{children:e})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(_n,{size:14,className:"text-chamber-blue"}),s.jsx("span",{children:r})]}),a&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ji,{size:14,className:"text-chamber-blue"}),s.jsx("span",{className:"capitalize",children:a})]}),n!=null&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(yu,{size:14,className:"text-chamber-blue"}),s.jsx("span",{children:n===0?"Free":`$${n.toFixed(2)}`})]})]})]}),Pee=({description:t})=>s.jsx("p",{className:"text-sm text-gray-600 line-clamp-3",children:t}),Ree=({eventId:t})=>s.jsx(co,{className:"pt-2 border-t",children:s.jsx(rt,{to:`/events/${t}`,className:"w-full",children:s.jsx(Y,{variant:"outline",className:"w-full hover:bg-chamber-blue hover:text-white transition-colors",children:"View Details"})})}),vR=({event:t})=>s.jsxs(De,{className:"overflow-hidden h-full flex flex-col",children:[s.jsx(Tee,{imageUrl:t.imageUrl,title:t.title}),s.jsxs(ot,{className:"pb-2",children:[s.jsx(ut,{className:"line-clamp-1",children:t.title}),s.jsx(Mee,{date:t.date,time:t.time,location:t.location,ticket_price:t.ticket_price,event_type:t.event_type})]}),s.jsx(Be,{className:"flex-grow",children:s.jsx(Pee,{description:t.description})}),s.jsx(Ree,{eventId:t.id})]});function tn(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function Cd(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function wR(t,e){const r=tn(t);return isNaN(e)?Cd(t,NaN):(e&&r.setDate(r.getDate()+e),r)}const jR=6048e5,Bee=864e5,dv=43200,a5=1440;let Lee={};function q0(){return Lee}function n0(t,e){var l,c,u,d;const r=q0(),n=(e==null?void 0:e.weekStartsOn)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,a=tn(t),i=a.getDay(),o=(i<n?7:0)+i-n;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function y1(t){return n0(t,{weekStartsOn:1}
650)}function NR(t){const e=tn(t),r=e.getFullYear(),n=Cd(t,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const a=y1(n),i=Cd(t,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const o=y1(i);return e.getTime()>=a.getTime()?r+1:e.getTime()>=o.getTime()?r:r-1}function i5(t){const e=tn(t);return e.setHours(0,0,0,0),e}function b1(t){const e=tn(t),r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),+t-+r}function Iee(t,e){const r=i5(t),n=i5(e),a=+r-b1(r),i=+n-b1(n);return Math.round((a-i)/Bee)}function Oee(t){const e=NR(t),r=Cd(t,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),y1(r)}function Vv(t,e){const r=tn(t),n=tn(e),a=r.getTime()-n.getTime();return a<0?-1:a>0?1:a}function zee(t){return Cd(t,Date.now())}function Uee(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Hee(t){if(!Uee(t)&&typeof t!="number")return!1;const e=tn(t);return!isNaN(Number(e))}function $ee(t,e){const r=tn(t),n=tn(e),a=r.getFullYear()-n.getFullYear(),i=r.getMonth()-n.getMonth();return a*12+i}function Wee(t){return e=>{const n=(t?Math[t]:Math.trunc)(e);return n===0?0:n}}function qee(t,e){return+tn(t)-+tn(e)}function Gee(t){const e=tn(t);return e.setHours(23,59,59,999),e}function Vee(t){const e=tn(t),r=e.getMonth();return e.setFullYear(e.getFullYear(),r+1,0),e.setHours(23,59,59,999),e}function Kee(t){const e=tn(t);return+Gee(e)==+Vee(e)}function Jee(t,e){const r=tn(t),n=tn(e),a=Vv(r,n),i=Math.abs($ee(r,n));let o;if(i<1)o=0;else{r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*i);let l=Vv(r,n)===-a;Kee(tn(t))&&i===1&&Vv(t,n)===1&&(l=!1),o=a*(i-Number(l))}return o===0?0:o}function Yee(t,e,r){const n=qee(t,e)/1e3;return Wee(r==null?void 0:r.roundingMethod)(n)}function Zee(t){const e=tn(t),r=Cd(t,0);return r.setFullYear(e.getFullYear(),0,1),r.setHours(0,0,0,0),r}const Xee={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"}},Qee=(t,e,r)=>{let n;const a=Xee[t];return typeof a=="string"?n=a:e===1?n=a.one:n=a.other.replace("{{count}}",e.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function D2(t){return(e={})=>{const r=e.width?String(e.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}const ete={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},tte={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},rte={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},ste={date:D2({formats:ete,defaultWidth:"full"}),time:D2({formats:tte,defaultWidth:"full"}),dateTime:D2({formats:rte,defaultWidth:"full"})},nte={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ate=(t,e,r,n)=>nte[t];function dy(t){return(e,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let a;if(n==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,l=r!=null&&r.width?String(r.width):o;a=t.formattingValues[l]||t.formattingValues[o]}else{const o=t.defaultWidth,l=r!=null&&r.width?String(r.width):t.defaultWidth;a=t.values[l]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const ite={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ote={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},lte={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"]},cte={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
650ay","Saturday"]},ute={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"}},dte={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"}},hte=(t,e)=>{const r=Number(t),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},mte={ordinalNumber:hte,era:dy({values:ite,defaultWidth:"wide"}),quarter:dy({values:ote,defaultWidth:"wide",argumentCallback:t=>t-1}),month:dy({values:lte,defaultWidth:"wide"}),day:dy({values:cte,defaultWidth:"wide"}),dayPeriod:dy({values:ute,defaultWidth:"wide",formattingValues:dte,defaultFormattingWidth:"wide"})};function hy(t){return(e,r={})=>{const n=r.width,a=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],l=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?pte(l,h=>h.test(o)):fte(l,h=>h.test(o));let u;u=t.valueCallback?t.valueCallback(c):c,u=r.valueCallback?r.valueCallback(u):u;const d=e.slice(o.length);return{value:u,rest:d}}}function fte(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return r}function pte(t,e){for(let r=0;r<t.length;r++)if(e(t[r]))return r}function gte(t){return(e,r={})=>{const n=e.match(t.matchPattern);if(!n)return null;const a=n[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=r.valueCallback?r.valueCallback(o):o;const l=e.slice(a.length);return{value:o,rest:l}}}const xte=/^(\d+)(th|st|nd|rd)?/i,yte=/\d+/i,bte={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},vte={any:[/^b/i,/^(a|c)/i]},wte={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},jte={any:[/1/i,/2/i,/3/i,/4/i]},Nte={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},Fte={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]},Ste={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},Cte={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]},kte={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},_te={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}},Ete={ordinalNumber:gte({matchPattern:xte,parsePattern:yte,valueCallback:t=>parseInt(t,10)}),era:hy({matchPatterns:bte,defaultMatchWidth:"wide",parsePatterns:vte,defaultParseWidth:"any"}),quarter:hy({matchPatterns:wte,defaultMatchWidth:"wide",parsePatterns:jte,defaultParseWidth:"any",valueCallback:t=>t+1}),month:hy({matchPatterns:Nte,defaultMatchWidth:"wide",parsePatterns:Fte,defaultParseWidth:"any"}),day:hy({matchPatterns:Ste,defaultMatchWidth:"wide",parsePatterns:Cte,defaultParseWidth:"any"}),dayPeriod:hy({matchPatterns:kte,defaultMatchWidth:"any",parsePatterns:_te,defaultParseWidth:"any"})},FR={code:"en-US",formatDistance:Qee,formatLong:ste,formatRelative:ate,localize:mte,match:Ete,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Ate(t){const e=tn(t);return Iee(e,Zee(e))+1}function Dte(t){const e=tn(t),r=+y1(e)-+Oee(e);return Math.round(r/jR)+1}function SR(t,e){var d,h,f,m;
vendor: 10,881 bytes, line 650
650const r=tn(t),n=r.getFullYear(),a=q0(),i=(e==null?void 0:e.firstWeekContainsDate)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??a.firstWeekContainsDate??((m=(f=a.locale)==null?void 0:f.options)==null?void 0:m.firstWeekContainsDate)??1,o=Cd(t,0);o.setFullYear(n+1,0,i),o.setHours(0,0,0,0);const l=n0(o,e),c=Cd(t,0);c.setFullYear(n,0,i),c.setHours(0,0,0,0);const u=n0(c,e);return r.getTime()>=l.getTime()?n+1:r.getTime()>=u.getTime()?n:n-1}function Tte(t,e){var l,c,u,d;const r=q0(),n=(e==null?void 0:e.firstWeekContainsDate)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,a=SR(t,e),i=Cd(t,0);return i.setFullYear(a,0,n),i.setHours(0,0,0,0),n0(i,e)}function Mte(t,e){const r=tn(t),n=+n0(r,e)-+Tte(r,e);return Math.round(n/jR)+1}function Js(t,e){const r=t<0?"-":"",n=Math.abs(t).toString().padStart(e,"0");return r+n}const hh={y(t,e){const r=t.getFullYear(),n=r>0?r:1-r;return Js(e==="yy"?n%100:n,e.length)},M(t,e){const r=t.getMonth();return e==="M"?String(r+1):Js(r+1,2)},d(t,e){return Js(t.getDate(),e.length)},a(t,e){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(t,e){return Js(t.getHours()%12||12,e.length)},H(t,e){return Js(t.getHours(),e.length)},m(t,e){return Js(t.getMinutes(),e.length)},s(t,e){return Js(t.getSeconds(),e.length)},S(t,e){const r=e.length,n=t.getMilliseconds(),a=Math.trunc(n*Math.pow(10,r-3));return Js(a,e.length)}},Xp={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},o5={G:function(t,e,r){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(t,e,r){if(e==="yo"){const n=t.getFullYear(),a=n>0?n:1-n;return r.ordinalNumber(a,{unit:"year"})}return hh.y(t,e)},Y:function(t,e,r,n){const a=SR(t,n),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return Js(o,2)}return e==="Yo"?r.ordinalNumber(i,{unit:"year"}):Js(i,e.length)},R:function(t,e){const r=NR(t);return Js(r,e.length)},u:function(t,e){const r=t.getFullYear();return Js(r,e.length)},Q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return Js(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return Js(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,r){const n=t.getMonth();switch(e){case"M":case"MM":return hh.M(t,e);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,r){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return Js(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,r,n){const a=Mte(t,n);return e==="wo"?r.ordinalNumber(a,{unit:"week"}):Js(a,e.length)},I:function(t,e,r){const n=Dte(t);return e==="Io"?r.ordinalNumber(n,{unit:"week"}):Js(n,e.length)},d:function(t,e,r){return e==="do"?r.ordinalNumber(t.getDate(),{unit:"date"}):hh.d(t,e)},D:function(t,e,r){const n=Ate(t);return e==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):Js(n,e.length)},E:function(t,e,r){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,r,n){const a=t.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return Js(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});case"eeee":default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,r,n){const a=t.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return Js(i,e.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});case"cccc":default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,r){const n=t.getDay(),a=n===0?7:n;switch(e){case"i":return String(a);case"ii":return Js(a,e.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,r){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,r){const n=t.getHours();let a;switch(n===12?a=Xp.noon:n===0?a=Xp.midnight:a=n/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,r){const n=t.getHours();let a;switch(n>=17?a=Xp.evening:n>=12?a=Xp.afternoon:n>=4?a=Xp.morning:a=Xp.night,e){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,r){if(e==="ho"){let n=t.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return hh.h(t,e)},H:function(t,e,r){return e==="Ho"?r.ordinalNumber(t.getHours(),{unit:"hour"}):hh.H(t,e)},K:function(t,e,r){const n=t.getHours()%12;return e==="Ko"?r.ordinalNumber(n,{unit:"hour"}):Js(n,e.length)},k:function(t,e,r){let n=t.getHours();return n===0&&(n=24),e==="ko"?r.ordinalNumber(n,{unit:"hour"}):Js(n,e.length)},m:function(t,e,r){return e==="mo"?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):hh.m(t,e)},s:function(t,e,r){return e==="so"?r.ordinalNumber(t.getSeconds(),{unit:"second"}):hh.s(t,e)},S:function(t,e){return hh.S(t,e)},X:function(t,e,r){const n=t.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return c5(n);case"XXXX":case"XX":return hf(n);case"XXXXX":case"XXX":default:return hf(n,":")}},x:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"x":return c5(n);case"xxxx":case"xx":return hf(n);case"xxxxx":case"xxx":default:return hf(n,":")}},O:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+l5(n,":");case"OOOO":default:return"GMT"+hf(n,":")}},z:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+l5(n,":");case"zzzz":default:return"GMT"+hf(n,":")}},t:function(t,e,r){const n=Math.trunc(t.getTime()/1e3);return Js(n,e.length)},T:function(t,e,r){const n=t.getTime();return Js(n,e.length)}};function l5(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),a=Math.trunc(n/60),i=n%60;return i===0?r+String(a):r+String(a)+e+Js(i,2)}function c5(t,e){return t%60===0?(t>0?"-":"+")+Js(Math.abs(t)/60,2):hf(t,e)}function hf(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),a=Js(Math.trunc(n/60),2),i=Js(n%60,2);return r+a+e+i}const u5=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},CR=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},Pte=(t,e)=>{const r=t.match(/(P+)(p+)?/)||[],n=r[1],a=r[2];if(!a)return u5(t,e);let i;switch(n){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",u5(n,e)).replace("{{time}}",CR(a,e))},Rte={p:CR,P:Pte},Bte=/^D+$/,Lte=/^Y+$/,Ite=["D","DD","YY","YYYY"];function Ote(t){return Bte.test(t)}function zte(t){return Lte.test(t)}function Ute(t,e,r){const n=Hte(t,e,r);if(console.warn(n),Ite.includes(t))throw new RangeError(n)}function Hte(t,e,r){const n=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const $te=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Wte=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,qte=/^'([^]*?)'?$/,Gte=/''/g,Vte=/[a-zA-Z]/;function Cs(t,e,r){var d,h,f,m;const n=q0(),a=n.locale??FR,i=n.firstWeekContainsDate??((h=(d=n.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??1,o=n.weekStartsOn??((m=(f=n.locale)==null?void 0:f.options)==null?void 0:m.weekStartsOn)??0,l=tn(t);if(!Hee(l))throw new RangeError("Invalid time value");let c=e.match(Wte).map(g=>{const y=g[0];if(y==="p"||y==="P"){const b=Rte[y];return b(g,a.formatLong)}return g}).join("").match($te).map(g=>{if(g==="''")return{isToken:!1,value:"'"};const y=g[0];if(y==="'")return{isToken:!1,value:Kte(g)};if(o5[y])return{isToken:!0,value:g};
650if(y.match(Vte))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return{isToken:!1,value:g}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const u={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return c.map(g=>{if(!g.isToken)return g.value;const y=g.value;(zte(y)||Ote(y))&&Ute(y,e,String(t));const b=o5[y[0]];return b(l,y,a.localize,u)}).join("")}function Kte(t){const e=t.match(qte);return e?e[1].replace(Gte,"'"):t}function Jte(t,e,r){const n=q0(),a=(r==null?void 0:r.locale)??n.locale??FR,i=2520,o=Vv(t,e);if(isNaN(o))throw new RangeError("Invalid time value");const l=Object.assign({},r,{addSuffix:r==null?void 0:r.addSuffix,comparison:o});let c,u;o>0?(c=tn(e),u=tn(t)):(c=tn(t),u=tn(e));const d=Yee(u,c),h=(b1(u)-b1(c))/1e3,f=Math.round((d-h)/60);let m;if(f<2)return r!=null&&r.includeSeconds?d<5?a.formatDistance("lessThanXSeconds",5,l):d<10?a.formatDistance("lessThanXSeconds",10,l):d<20?a.formatDistance("lessThanXSeconds",20,l):d<40?a.formatDistance("halfAMinute",0,l):d<60?a.formatDistance("lessThanXMinutes",1,l):a.formatDistance("xMinutes",1,l):f===0?a.formatDistance("lessThanXMinutes",1,l):a.formatDistance("xMinutes",f,l);if(f<45)return a.formatDistance("xMinutes",f,l);if(f<90)return a.formatDistance("aboutXHours",1,l);if(f<a5){const g=Math.round(f/60);return a.formatDistance("aboutXHours",g,l)}else{if(f<i)return a.formatDistance("xDays",1,l);if(f<dv){const g=Math.round(f/a5);return a.formatDistance("xDays",g,l)}else if(f<dv*2)return m=Math.round(f/dv),a.formatDistance("aboutXMonths",m,l)}if(m=Jee(u,c),m<12){const g=Math.round(f/dv);return a.formatDistance("xMonths",g,l)}else{const g=m%12,y=Math.trunc(m/12);return g<3?a.formatDistance("aboutXYears",y,l):g<9?a.formatDistance("overXYears",y,l):a.formatDistance("almostXYears",y+1,l)}}function Dw(t,e){return Jte(t,zee(t),e)}function Yte(t,e){return wR(t,-e)}const mi=[];for(let t=0;t<256;++t)mi.push((t+256).toString(16).slice(1));function Zte(t,e=0){return(mi[t[e+0]]+mi[t[e+1]]+mi[t[e+2]]+mi[t[e+3]]+"-"+mi[t[e+4]]+mi[t[e+5]]+"-"+mi[t[e+6]]+mi[t[e+7]]+"-"+mi[t[e+8]]+mi[t[e+9]]+"-"+mi[t[e+10]]+mi[t[e+11]]+mi[t[e+12]]+mi[t[e+13]]+mi[t[e+14]]+mi[t[e+15]]).toLowerCase()}let T2;const Xte=new Uint8Array(16);function Qte(){if(!T2){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");T2=crypto.getRandomValues.bind(crypto)}return T2(Xte)}const ere=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),d5={randomUUID:ere};function Wn(t,e,r){var a;if(d5.randomUUID&&!t)return d5.randomUUID();t=t||{};const n=t.random??((a=t.rng)==null?void 0:a.call(t))??Qte();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Zte(n)}const qs=(t,e=12,r=0)=>{const n=t>=0?wR(new Date,t):Yte(new Date,Math.abs(t));return n.setHours(e,r,0,0),n.toISOString()},tre=[{id:Wn(),title:"Networking Breakfast",description:"Join us for a networking breakfast with local business owners. Connect, share ideas, and build valuable relationships.",location:"Grand Hotel Downtown",start_date:qs(5,8,0),end_date:qs(5,10,0),is_featured:!0,image_url:"https://images.unsplash.com/photo-1517457373958-b7bdd4587205?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"},{id:Wn(),title:"Small Business Workshop",description:"Learn essential strategies for small business growth. Topics include digital marketing, funding opportunities, and local resources.",location:"Community Center",start_date:qs(11,13,0),end_date:qs(11,16,0),is_featured:!1,image_url:"https://images.unsplash.com/photo-1552664730-d307ca884978?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"},{id:Wn(),title:"Chamber Mixer",description:"End your workweek with a relaxed networking event. Enjoy refreshments while connecting with fellow chamber members.",location:"Riverside Brewing Co.",start_date:qs(18,17,30),end_date:qs(18,19,30),is_featured:!0,image_url:"https://images.unsplash.com/photo-1511795409834-ef04bbd61622?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"},{id:Wn(),title:"Annual Golf Tournament",description:"Join us for our annual charity golf tournament. Proceeds benefit local business scholarship programs.",location:"Pinehurst Country Club",start_date:qs(25,9,0),end_date:qs(25,15,0),is_featured:!0,image_url:"https://images.unsplash.com/photo-1587174486073-ae5e5cff23aa?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"},{id:Wn(),title:"Tech Trends Seminar",description:"Stay ahead of the curve with the latest te
650chnology trends affecting local businesses.",location:"Innovation Center",start_date:qs(34,10,0),end_date:qs(34,12,0),is_featured:!1,image_url:"https://images.unsplash.com/photo-1505373877841-8d25f7d46678?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"},{id:Wn(),title:"Business After Hours",description:"Network with fellow chamber members in a relaxed setting after business hours.",location:"Metro Art Gallery",start_date:qs(42,17,0),end_date:qs(42,19,0),is_featured:!1,image_url:"https://images.unsplash.com/photo-1511578314322-379afb476865?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"},{id:Wn(),title:"Marketing Masterclass",description:"Full-day workshop on marketing strategies for small businesses in today's digital landscape.",location:"Business Development Center",start_date:qs(54,9,0),end_date:qs(54,16,0),is_featured:!1,image_url:"https://images.unsplash.com/photo-1557804506-669a67965ba0?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"},{id:Wn(),title:"Business Leadership Summit",description:"A full day of insights from top industry leaders discussing strategies for business growth and adaptation in today's market.",location:"Civic Conference Center",start_date:qs(-20,9,0),end_date:qs(-20,16,0),is_featured:!0,image_url:"https://images.unsplash.com/photo-1505373877841-8d25f7d46678?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"},{id:Wn(),title:"Small Business Tax Workshop",description:"Expert accountants provided guidance on tax preparation and strategies for small business owners.",location:"Community Center",start_date:qs(-32,13,0),end_date:qs(-32,15,0),is_featured:!1,image_url:"https://images.unsplash.com/photo-1554224155-8d04cb21cd6c?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"},{id:Wn(),title:"Women in Business Luncheon",description:"Celebrating female entrepreneurs and business leaders in our community with inspirational speakers and networking.",location:"Hilton Hotel",start_date:qs(-37,12,0),end_date:qs(-37,14,0),is_featured:!0,image_url:"https://images.unsplash.com/photo-1573164574572-cb89e39749b4?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"},{id:Wn(),title:"Chamber After Hours Mixer",description:"Casual networking event with fellow chamber members in a relaxed atmosphere with complimentary appetizers.",location:"Downtown Brewery",start_date:qs(-45,17,30),end_date:qs(-45,19,30),is_featured:!1,image_url:"https://images.unsplash.com/photo-1511795409834-ef04bbd61622?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"},{id:Wn(),title:"Digital Marketing Workshop",description:"Hands-on workshop covering social media strategies, SEO basics, and content marketing for small businesses.",location:"Tech Hub",start_date:qs(-53,9,0),end_date:qs(-53,12,0),is_featured:!1,image_url:"https://images.unsplash.com/photo-1557804506-669a67965ba0?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"},{id:Wn(),title:"Annual Business Awards Gala",description:"Celebrating excellence in our business community with dinner, awards ceremony, and entertainment.",location:"Grand Ballroom",start_date:qs(-64,18,0),end_date:qs(-64,22,0),is_featured:!0,image_url:"https://images.unsplash.com/photo-1519167758481-83f550bb49b3?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"},{id:Wn(),title:"Small Business Financing Seminar",description:"Learn about financing options, SBA loans, and strategies to secure capital for your business growth.",location:"First National Bank",start_date:qs(-72,10,0),end_date:qs(-72,12,0),is_featured:!1,image_url:"https://images.unsplash.com/photo-1460925895917-afdab827c52f?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"},{id:Wn(),title:"Health Insurance Options Workshop",description:"Information session on healthcare options available to small business owners and their employees.",location:"Chamber Office",start_date:qs(-79,14,0),end_date:qs(-79,16,0),is_featured:!1,image_url:"https://images.unsplash.com/photo-1505751172876-fa1923c5c528?ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80"}],rre=async()=>{console.info("Starting import of mock event data...");try{console.info("Starting event import..."),console.info("Removing existing event registrations...");const{error:t}=await Q.from("event_registrations").delete().neq("id","00000000-0000-0000-0000-000000000000");if(t)return console.error("Error deleting event registrations:",t),{success:!1,message:`Error removing existing event registrations: ${t.message}`};console.info("Removing existing events...");const{error:e}=await Q.from("events").delete().neq("id","00000000-0000-0000-0000-000000000000");if(e)return console.error("Error deleting events:",e),{success:!1,message:`Error removing existing events: ${e.message}`};console.info("Inserting mock events...");const{data:r,error:n}=await Q.from("events").insert(tre).select();return n?(console.error("Error inserting mock events:",n),{success:!1,message:`Error inserting mock events: ${n.message}`}):(console.info(`Successfully inserted ${(r==null?void 0:r.length)||0} mock events`),{success:!0,message:`${(r==null?void 0:r.length)||0} Events imported successfully`,count:(r==null?void 0:r.length)||0})}catch(t){return console.error("Error in insertMockEvents:",t),{success:!1,message:`An unexpected error occurred: ${t}`}}},Mf=async(t={})=>{const{upcoming:e=!0,featured:r=!1,businessId:n,limit:a=10,page:i=1,approval_status:o,includeUnapproved:l=!1}=t,c=(i-1)*a;let u=Q.from("events").select("*",{count:"exact"});const d=new Date;e?u=u.gte("start_date",d.toISOString()):u=u.lt("start_date",d.toISOString()),r&&(u=u.eq("is_featured",!0)),n&&(u=u.eq("business_id",n)),o?u=u.eq("approval_status",o):l||(u=u.eq("approval_status","approved")),u=u.order("start_date",{ascending:e}),u=u.range(c,c+a-1);const{data:h,error:f,count:m}=await u;if(f)throw console.error("Error fetching events:",f),f;return{events:h.map(y=>{const b=new Date(y.start_date),w=new Date(y.end_date);
650return{id:y.id,title:y.title,description:y.description||"",date:Cs(b,"EEEE, MMMM d, yyyy"),time:`${Cs(b,"h:mm a")} - ${Cs(w,"h:mm a")}`,location:y.location,imageUrl:y.image_url,businessId:y.business_id,rawStartDate:y.start_date,rawEndDate:y.end_date,approval_status:y.approval_status,reviewed_by:y.reviewed_by,reviewed_at:y.reviewed_at,admin_notes:y.admin_notes,created_by:y.created_by,created_at:y.created_at,updated_at:y.updated_at,contact_name:y.contact_name,contact_email:y.contact_email,contact_phone:y.contact_phone,organization_name:y.organization_name,event_website:y.event_website,additional_info:y.additional_info,ticket_price:y.ticket_price,event_type:y.event_type,is_featured:y.is_featured}}),count:m||0}},sre=async t=>{try{const{data:e,error:r}=await Q.from("events").select("*, event_registrations(*)").eq("id",t).single();return r||!e?(console.error("Error fetching event:",r),null):{id:e.id,title:e.title,description:e.description,date:Cs(new Date(e.start_date),"MMMM d, yyyy"),time:`${Cs(new Date(e.start_date),"h:mm a")} - ${Cs(new Date(e.end_date),"h:mm a")}`,location:e.location,imageUrl:e.image_url,registrations:e.event_registrations?e.event_registrations.length:0,businessId:e.business_id,rawStartDate:e.start_date,rawEndDate:e.end_date,approval_status:e.approval_status,reviewed_by:e.reviewed_by,reviewed_at:e.reviewed_at,admin_notes:e.admin_notes,created_by:e.created_by,created_at:e.created_at,updated_at:e.updated_at,contact_name:e.contact_name,contact_email:e.contact_email,contact_phone:e.contact_phone,organization_name:e.organization_name,event_website:e.event_website,additional_info:e.additional_info,ticket_price:e.ticket_price,event_type:e.event_type}}catch(e){return console.error("Error in getEventById:",e),null}},nre=async(t,e)=>{try{const{data:r,error:n}=await Q.from("event_registrations").select("*").eq("event_id",t).eq("user_id",e).single();if(n&&n.code!=="PGRST116")return console.error("Error checking registration:",n),{success:!1,message:`Error checking existing registration: ${n.message}`};if(r)return{success:!0,message:"You are already registered for this event",data:r};const{data:a,error:i}=await Q.from("event_registrations").insert([{event_id:t,user_id:e,status:"confirmed"}]).select().single();return i?(console.error("Error registering for event:",i),{success:!1,message:`Error registering for event: ${i.message}`}):{success:!0,message:"Successfully registered for event",data:a}}catch(r){return console.error("Exception registering for event:",r),{success:!1,message:`An unexpected error occurred: ${r instanceof Error?r.message:"Unknown error"}`}}},are=async(t,e)=>{try{const{error:r}=await Q.from("event_registrations").update({status:"canceled"}).eq("event_id",t).eq("user_id",e);return r?(console.error("Error canceling registration:",r),{success:!1,message:`Error canceling registration: ${r.message}`}):{success:!0,message:"Successfully canceled event registration"}}catch(r){return console.error("Exception canceling registration:",r),{success:!1,message:`An unexpected error occurred: ${r instanceof Error?r.message:"Unknown error"}`}}},ire=async(t,e)=>{try{const{data:r,error:n}=await Q.from("event_registrations").select("status").eq("event_id",t).eq("user_id",e).single();return n?n.code==="PGRST116"?{isRegistered:!1}:(console.error("Error checking registration status:",n),{isRegistered:!1,error:n.message}):{isRegistered:!0,status:r.status}}catch(r){return console.error("Exception checking registration:",r),{isRegistered:!1,error:r instanceof Error?r.message:"Unknown error"}}},ore=async t=>{try{let e=Q.from("event_registrations").select(` 651 id, 652 event_id, 653 user_id, 654 status, 655 created_at, 656 profiles!inner( 657 id, 658 first_name, 659 last_name, 660 email, 661 user_type 662 ), 663 events!inner( 664 id, 665 title, 666 start_date 667 ) 668 `).order("created_at",{ascending:!1});const{data:r,error:n}=await e;return n?(console.error("Error fetching event registrations:",n),{success:!1,message:`Error fetching registrations: ${n.message}`}):{success:!0,data:r.map(i=>({id:i.id,event_id:i.event_id,user_id:i.user_id,status:i.status,created_at:i.created_at,user:{first_name:i.profiles.first_name,last_name:i.profiles.last_name,email:i.profiles.email},event:{title:i.events.title,start_date:i.events.start_date}}))}}catch(e){return console.error("Exception fetching event registrations:",e),{success:!1,message:`An unexpected error occurred: ${e instanceof Error?e.message:"Unknown error"}`}}},lre=async t=>{var i,o,l,c,u,d;const{data:{user:e}}=await Q.auth.getUser(),r={title:t.title.trim(),description:t.description.trim(),location:t.location.trim(),start_date:t.start_date,end_date:t.end_date,image_url:((i=t.image_url)==null?void 0:i.trim())||null,is_featured:!1,approval_status:"pending",created_by:(e==null?void 0:e.id)||null,contact_name:t.contact_name.trim(),contact_email:t.contact_email.trim(),contact_phone:((o=t.contact_phone)==null?void 0:o.trim())||null,organization_name:((l=t.organization_name)==null?void 0:l.trim())||null,event_website:((c=t.event_website)==null?void 0:c.trim())||null,additional_info:((u=t.additional_info)==null?void 0:u.trim())||null,ticket_price:t.ticket_price||null,event_type:((d=t.event_type)==null?void 0:d.trim())||null},{data:n,error:a}=await Q.from("events").insert([r]).select();if(a)throw console.error("Error submitting event:",a),a;return n[0]},h5=async t=>{const{data:{user:e}}=await Q.auth.getUser();if(!e)throw new Error("User not authenticated");const r={approval_status:t.approval_status,reviewed_by:e.id,reviewed_at:new Date().toISOString(),admin_notes:t.admin_notes||null},{data:n,error:a}=await Q.from("events").update(r).eq("id",t.id).select();if(a)throw console.error("Error updating event approval:",a),a;return n[0]},cre=async()=>{const{data:t,error:e}
668=await Q.from("events").select("*").eq("approval_status","pending").order("created_at",{ascending:!1});if(e)throw console.error("Error fetching pending events:",e),e;return t},ure=async(t={})=>{const{data:{user:e}}=await Q.auth.getUser();if(!e)throw new Error("User not authenticated");const{status:r,limit:n=50,page:a=1}=t,i=(a-1)*n;let o=Q.from("events").select("*").eq("created_by",e.id).order("created_at",{ascending:!1}).range(i,i+n-1);r&&(o=o.eq("approval_status",r));const{data:l,error:c}=await o;if(c)throw console.error("Error fetching user events:",c),c;return l.map(d=>{const h=new Date(d.start_date),f=new Date(d.end_date);return{id:d.id,title:d.title,description:d.description||"",date:Cs(h,"EEEE, MMMM d, yyyy"),time:`${Cs(h,"h:mm a")} - ${Cs(f,"h:mm a")}`,location:d.location,imageUrl:d.image_url,businessId:d.business_id,rawStartDate:d.start_date,rawEndDate:d.end_date,approval_status:d.approval_status,reviewed_by:d.reviewed_by,reviewed_at:d.reviewed_at,admin_notes:d.admin_notes,created_by:d.created_by,created_at:d.created_at,updated_at:d.updated_at,contact_name:d.contact_name,contact_email:d.contact_email,contact_phone:d.contact_phone,organization_name:d.organization_name,event_website:d.event_website,additional_info:d.additional_info,ticket_price:d.ticket_price,event_type:d.event_type}})},dre=async t=>{var l,c,u,d,h,f;const{data:{user:e}}=await Q.auth.getUser();if(!e)throw new Error("User not authenticated");const{data:r,error:n}=await Q.from("events").select("approval_status, created_by").eq("id",t.id).single();if(n)throw new Error("Event not found");if(r.created_by!==e.id)throw new Error("Unauthorized: You can only edit your own events");if(r.approval_status==="approved")throw new Error("Cannot edit approved events. Please contact support if changes are needed.");const a={updated_at:new Date().toISOString()};t.title!==void 0&&(a.title=t.title.trim()),t.description!==void 0&&(a.description=t.description.trim()),t.location!==void 0&&(a.location=t.location.trim()),t.start_date!==void 0&&(a.start_date=t.start_date),t.end_date!==void 0&&(a.end_date=t.end_date),t.image_url!==void 0&&(a.image_url=((l=t.image_url)==null?void 0:l.trim())||null),t.contact_name!==void 0&&(a.contact_name=t.contact_name.trim()),t.contact_email!==void 0&&(a.contact_email=t.contact_email.trim()),t.contact_phone!==void 0&&(a.contact_phone=((c=t.contact_phone)==null?void 0:c.trim())||null),t.organization_name!==void 0&&(a.organization_name=((u=t.organization_name)==null?void 0:u.trim())||null),t.event_website!==void 0&&(a.event_website=((d=t.event_website)==null?void 0:d.trim())||null),t.additional_info!==void 0&&(a.additional_info=((h=t.additional_info)==null?void 0:h.trim())||null),t.ticket_price!==void 0&&(a.ticket_price=t.ticket_price||null),t.event_type!==void 0&&(a.event_type=((f=t.event_type)==null?void 0:f.trim())||null),r.approval_status==="rejected"&&(a.approval_status="pending",a.reviewed_by=null,a.reviewed_at=null,a.admin_notes=null);const{data:i,error:o}=await Q.from("events").update(a).eq("id",t.id).select();if(o)throw console.error("Error updating event:",o),o;return i[0]},hre=async t=>{const{data:{user:e}}=await Q.auth.getUser();if(!e)throw new Error("User not authenticated");const{data:r,error:n}=await Q.from("events").select("approval_status, created_by").eq("id",t).single();if(n)throw new Error("Event not found");if(r.created_by!==e.id)throw new Error("Unauthorized: You can only delete your own events");if(r.approval_status==="approved")throw new Error("Cannot delete approved events. Please contact support if you need to remove the event.");const{error:a}=await Q.from("events").delete().eq("id",t);if(a)throw console.error("Error deleting event:",a),a;return!0};function cs({className:t,...e}){return s.jsx("div",{className:xt("animate-pulse rounded-md bg-muted",t),...e})}const Pd=({className:t,...e})=>s.jsx("nav",{role:"navigation","aria-label":"pagination",className:xt("mx-auto flex w-full justify-center",t),...e});Pd.displayName="Pagination";const Rd=x.forwardRef(({className:t,...e},r)=>s.jsx("ul",{ref:r,className:xt("flex flex-row items-center gap-1",t),...e}));Rd.displayName="PaginationContent";const Qr=x.forwardRef(({className:t,...e},r)=>s.jsx("li",{ref:r,className:xt("",t),...e}));Qr.displayName="PaginationItem";const ca=({className:t,isActive:e,size:r="icon",...n})=>s.jsx("a",{"aria-current":e?"page":void 0,className:xt(Sw({variant:e?"outline":"ghost",size:r}),t),...n});ca.displayName="PaginationLink";const Bd=({className:t,...e})=>s.jsxs(ca,{"aria-label":"Go to previous page",size:"default",className:xt("gap-1 pl-2.5",t),...e,children:[s.jsx(hC,{className:"h-4 w-4"}),s.jsx("span",{children:"Previous"})]});Bd.displayName="PaginationPrevious";const Ld=({className:t,...e})=>s.jsxs(ca,{"aria-label":"Go to next page",size:"default",className:xt("gap-1 pr-2.5",t),...e,children:[s.jsx("span",{children:"Next"}),s.jsx(Ih,{className:"h-4 w-4"})]});Ld.displayName="PaginationNext";const nm=({className:t,...e})=>
668s.jsxs("span",{"aria-hidden":!0,className:xt("flex h-9 w-9 items-center justify-center",t),...e,children:[s.jsx(mC,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"More pages"})]});nm.displayName="PaginationEllipsis";const kR=({currentPage:t,totalPages:e,onPageChange:r,maxVisible:n=5})=>{if(e<=1)return null;const i=(()=>{if(e<=n)return Array.from({length:e},(l,c)=>c+1);const o=Math.floor(n/2);return t<=o+1?Array.from({length:n},(l,c)=>c+1):t>=e-o?Array.from({length:n},(l,c)=>e-n+c+1):Array.from({length:n},(l,c)=>t-o+c)})();return s.jsx(Pd,{children:s.jsxs(Rd,{children:[s.jsx(Qr,{children:s.jsx(Bd,{onClick:()=>r(t-1),className:t===1?"pointer-events-none opacity-50":""})}),t>Math.floor(n/2)+1&&e>n&&s.jsxs(s.Fragment,{children:[s.jsx(Qr,{children:s.jsx(ca,{onClick:()=>r(1),children:"1"})}),t>Math.floor(n/2)+2&&s.jsx(Qr,{children:s.jsx(nm,{})})]}),i.map(o=>s.jsx(Qr,{children:s.jsx(ca,{isActive:t===o,onClick:()=>r(o),children:o})},o)),t<e-Math.floor(n/2)&&e>n&&s.jsxs(s.Fragment,{children:[t<e-Math.floor(n/2)-1&&s.jsx(Qr,{children:s.jsx(nm,{})}),s.jsx(Qr,{children:s.jsx(ca,{onClick:()=>r(e),children:e})})]}),s.jsx(Qr,{children:s.jsx(Ld,{onClick:()=>r(t+1),className:t===e?"pointer-events-none opacity-50":""})})]})})},mre=()=>{const[t,e]=x.useState([]),[r,n]=x.useState(1),[a,i]=x.useState(0),[o,l]=x.useState(!0),c=3;x.useEffect(()=>{(async()=>{l(!0);try{const m=await Mf({upcoming:!0,featured:!0,limit:c,page:r});e(m.events),i(m.count)}catch(m){console.error("Failed to fetch upcoming events:",m)}finally{l(!1)}})()},[r]);const u=Math.ceil(a/c),d=f=>n(f),h=()=>s.jsx("div",{className:"grid md:grid-cols-3 gap-6",children:Array.from({length:3}).map((f,m)=>s.jsxs("div",{className:"flex flex-col rounded-lg overflow-hidden border h-full",children:[s.jsx(cs,{className:"h-[200px] w-full"}),s.jsxs("div",{className:"p-4 space-y-3",children:[s.jsx(cs,{className:"h-6 w-2/3"}),s.jsx(cs,{className:"h-4 w-1/2"}),s.jsx(cs,{className:"h-4 w-4/5"}),s.jsx(cs,{className:"h-20 w-full"})]}),s.jsx("div",{className:"p-4 mt-auto",children:s.jsx(cs,{className:"h-10 w-full"})})]},m))});return s.jsx("section",{className:"py-16 bg-white",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs("div",{className:"flex justify-between items-center mb-8",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"inline-flex items-center justify-center p-2 bg-chamber-blue-light text-chamber-blue rounded-full",children:s.jsx(Br,{size:24})}),s.jsx("h2",{className:"text-3xl font-bold text-gray-900",children:"Upcoming Events"})]}),s.jsx(rt,{to:"/events",children:s.jsxs(Y,{variant:"ghost",className:"text-chamber-blue hover:text-chamber-blue-dark flex items-center gap-2 whitespace-nowrap",children:["View All Events ",s.jsx(ul,{size:16})]})})]}),o?h():t.length===0?s.jsxs("div",{className:"text-center py-10 bg-gray-50 rounded-lg",children:[s.jsx("h3",{className:"text-xl font-semibold text-gray-700",children:"No upcoming events"}),s.jsx("p",{className:"text-gray-600 mt-2",children:"Check back later for upcoming chamber events."}),s.jsx(rt,{to:"/events",className:"mt-4 inline-block",children:s.jsx(Y,{children:"View All Events"})})]}):s.jsx("div",{className:"grid md:grid-cols-3 gap-6 mb-6",children:t.map(f=>s.jsx(vR,{event:f},f.id))}),u>1&&s.jsx(Pd,{className:"mt-8",children:s.jsxs(Rd,{children:[r>1&&s.jsx(Qr,{children:s.jsx(Bd,{onClick:()=>d(r-1)})}),Array.from({length:u},(f,m)=>m+1).map(f=>s.jsx(Qr,{children:s.jsx(ca,{onClick:()=>d(f),isActive:r===f,children:f})},f)),r<u&&s.jsx(Qr,{children:s.jsx(Ld,{onClick:()=>d(r+1)})})]})})]})})},fre=async(t=4)=>{try{console.log("Fetching latest news articles...");const{data:e,error:r}=await Q.from("blog_posts").select(` 669 id, 670 title, 671 slug, 672 content, 673 excerpt, 674 featured_image, 675 publish_date, 676 status, 677 author_id, 678 created_at, 679 updated_at, 680 post_category_mapping!inner( 681 category_id, 682 post_categories(name, slug) 683 ) 684 `).eq("status","published").order("publish_date",{ascending:!1}).limit(t);if(r)throw console.error("Error fetching news articles:",r),r;if(!e||e.length===0)return console.log("No published news articles found"),[];const n=e.filter(c=>
684!c.post_category_mapping||!Array.isArray(c.post_category_mapping)?!1:c.post_category_mapping.some(u=>u.post_categories&&u.post_categories.slug==="latest-news")),a=[...new Set(n.map(c=>c.author_id))],{data:i}=await Q.from("profiles").select("id, first_name, last_name, avatar_url").in("id",a),o=new Map;(i||[]).forEach(c=>{o.set(c.id,{name:`${c.first_name} ${c.last_name}`,avatar_url:c.avatar_url})});const l=n.map(c=>{var h;const u=((h=c.post_category_mapping)==null?void 0:h.map(f=>{var m;return(m=f.post_categories)==null?void 0:m.name}).filter(Boolean))||[],d=o.get(c.author_id);return{id:c.id,title:c.title,slug:c.slug,content:c.content||"",excerpt:c.excerpt||"",featured_image:c.featured_image||"",author_id:c.author_id,status:c.status,publish_date:c.publish_date,created_at:c.created_at,updated_at:c.updated_at,categories:u,author_name:(d==null?void 0:d.name)||"Chamber member",author_avatar:(d==null?void 0:d.avatar_url)||null,featured:!1}});return console.log(`Successfully loaded ${l.length} news articles`),l}catch(e){throw console.error("Error in fetchLatestNews:",e),e}},pre=()=>{const[t,e]=x.useState([]),[r,n]=x.useState(!0),[a,i]=x.useState(null),[o,l]=x.useState(new Set),{toast:c}=St();x.useEffect(()=>{u()},[]);const u=async()=>{n(!0),i(null);try{const b=await fre(4);if(!b||b.length===0)i("No news articles available");else{const w=b.map((j,N)=>({...j,featured:N===0?!0:j.featured}));e(w)}}catch(b){console.error("Error loading news articles:",b),i("Failed to load news articles"),c({title:"Error",description:"Failed to load news articles",variant:"destructive"})}finally{n(!1)}},d=b=>Dw(new Date(b),{addSuffix:!0}),h=b=>{l(w=>new Set(w).add(b))},f=(b,w)=>!w||o.has(b);if(r)return s.jsx("section",{className:"py-12 bg-gray-50",children:s.jsx("div",{className:"container-wrapper",children:s.jsxs("div",{className:"flex justify-center items-center py-12",children:[s.jsx(Mt,{className:"h-8 w-8 animate-spin text-chamber-blue mr-3"}),s.jsx("span",{className:"text-lg",children:"Loading latest news..."})]})})});if(!r&&(t.length===0||a))return s.jsx("section",{className:"py-12 bg-gray-50",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs("div",{className:"flex justify-between items-center mb-6",children:[s.jsx("h2",{className:"text-3xl font-bold text-gray-900",children:"Latest News"}),s.jsxs(rt,{to:"/news/latest",className:"text-chamber-blue hover:text-chamber-blue-dark flex items-center gap-2 whitespace-nowrap",children:["View All News ",s.jsx(ul,{size:16})]})]}),s.jsx("div",{className:"text-center py-12",children:s.jsx("p",{className:"text-lg text-gray-600",children:a||"No news articles available"})})]})});const m=[...t].sort((b,w)=>new Date(w.publish_date||w.created_at).getTime()-new Date(b.publish_date||b.created_at).getTime()),g=m.find(b=>b.featured)||m[0],y=m.filter(b=>b.id!==g.id).slice(0,3);return s.jsx("section",{className:"py-12 bg-gray-50",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs("div",{className:"flex justify-between items-center mb-6",children:[s.jsx("h2",{className:"text-3xl font-bold text-gray-900",children:"Latest News"}),s.jsxs(rt,{to:"/news/latest",className:"text-chamber-blue hover:text-chamber-blue-dark flex items-center gap-2 whitespace-nowrap",children:["View All News ",s.jsx(ul,{size:16})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[s.jsx("div",{className:"lg:col-span-2 flex",children:s.jsxs(De,{className:"w-full overflow-hidden hover:shadow-md transition-shadow flex flex-col",children:[s.jsxs("div",{className:"relative",children:[f(g.id,g.featured_image)?s.jsx("div",{className:"w-full h-80 bg-gray-100 flex items-center justify-center",children:s.jsx("img",{src:"/placeholder.svg",alt:"No image available",className:"w-20 h-20 opacity-50"})}):s.jsx("img",{src:g.featured_image||"https://images.unsplash.com/photo-1557804506-669a67965ba0?auto=format&fit=crop&w=800&h=500&q=80",alt:g.title,className:"w-full h-80 object-cover",onError:()=>h(g.id)}),s.jsx("div",{className:"absolute top-4 left-4",children:s.jsx("span",{className:"bg-chamber-blue text-white px-3 py-1 rounded-full text-sm font-medium",children:"Featured"})})]}),s.jsxs(Be,{className:"p-6 flex-grow flex flex-col justify-between",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center text-sm text-gray-500 mb-2",children:[s.jsx(Br,{size:16,className:"mr-2"}),s.jsx("span",{children:d(g.publish_date||g.created_at)})]}),s.jsx("h3",{className:"text-2xl font-bold mb-2",children:g.title}),s.jsx("p",{className:"text-gray-600 mb-3",children:g.excerpt})]}),s.jsx(rt,{to:`/news/${g.id}`,children:s.jsxs(Y,{variant:"link",className:"px-0 text-chamber-blue hover:text-chamber-blue-dark",children:["Read More ",s.jsx(ul,{size:16,className:"ml-1"})]})})]})]})}),s.jsx("div",{className:"flex flex-col space-y-4 h-full",children:y.map((b,w)=>s.jsx(De,{className:`hover:shadow-md transition-shadow ${w===y.length-1?"flex-grow":"h-[calc(33.33%-8px)]"}`,children:s.jsxs("div",{className:"flex h-full",children:[s.jsx("div",{className:"w-1/3",children:f(b.id,b.featured_image)?s.jsx("div",{className:"h-full w-full bg-gray-100 flex items-center justify-center",children:s.jsx("img",{src:"/placeholder.svg",alt:"No image available",className:"w-8 h-8 opacity-50"})}):s.jsx("img",{src:b.featured_image||"https://images.unsplash.com/photo-1557804506-669a67965ba0?auto=format&fit=crop&w=800&h=500&q=80",alt:b.title,className:"h-full w-full object-cover",onError:()=>h(b.id)})}),s.jsxs(Be,{className:"w-2/3 p-4 flex flex-col justify-between",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-xs text-gray-500 mb-1",children:d(b.publish_date||b.created_at)}),s.jsx("h3",{className:"font-semibold line-clamp-2",children:b.title}),s.jsx("p",{className:"text-gray-600 text-sm line-clamp-1",children:b.excerpt})]}),s.jsx(rt,{to:`/news/${b.id}`,className:"text-chamber-blue text-sm hover:underline",children:"Read More"})]})]})},b.id))})]}),s.jsx("div",{className:"mt-8 text-center",children:s.jsx(rt,{to:"/news/latest",children:s.jsxs(Y,{className:"bg-chamber-blue hover:bg-chamber-blue-dark",children:["Browse All News ",s.jsx(ul,{size:16,className:"ml-2"})]})})})]})})},gre=()=>{const t=ks();return x.useEffect(()=>{(()=>
684{if(window.location.hash){const r=new URLSearchParams(window.location.hash.substring(1)),n=r.get("access_token"),a=r.get("refresh_token"),i=r.get("type");if(n&&a&&i==="recovery"){console.log("Recovery tokens detected, redirecting to reset password page");const o=`/auth/reset-password?${r.toString()}`;t(o,{replace:!0})}}})()},[t]),null},xre=()=>s.jsxs("div",{className:"flex flex-col min-h-screen",children:[s.jsx(gre,{}),s.jsx(oQ,{}),s.jsx(Eee,{}),s.jsx(pre,{}),s.jsx(mre,{}),s.jsx("section",{className:"py-16 bg-gray-50",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs("div",{className:"text-center mb-12",children:[s.jsx("h2",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Why Join Our Chamber?"}),s.jsx("p",{className:"text-xl text-gray-600 max-w-3xl mx-auto",children:"Membership in our Chamber of Commerce provides valuable benefits to help your business thrive."})]}),s.jsxs("div",{className:"grid md:grid-cols-3 gap-8",children:[s.jsxs("div",{className:"bg-white p-8 rounded-lg shadow-sm text-center",children:[s.jsx("div",{className:"mx-auto w-16 h-16 bg-chamber-blue-light rounded-full flex items-center justify-center mb-4",children:s.jsx(Os,{size:32,className:"text-chamber-blue"})}),s.jsx("h3",{className:"text-xl font-semibold mb-3",children:"Networking Opportunities"}),s.jsx("p",{className:"text-gray-600 mb-4",children:"Connect with other business owners and potential customers through regular networking events."})]}),s.jsxs("div",{className:"bg-white p-8 rounded-lg shadow-sm text-center",children:[s.jsx("div",{className:"mx-auto w-16 h-16 bg-chamber-blue-light rounded-full flex items-center justify-center mb-4",children:s.jsx(pw,{size:32,className:"text-chamber-blue"})}),s.jsx("h3",{className:"text-xl font-semibold mb-3",children:"Business Promotion"}),s.jsx("p",{className:"text-gray-600 mb-4",children:"Increase your visibility through our business directory, social media features, and community events."})]}),s.jsxs("div",{className:"bg-white p-8 rounded-lg shadow-sm text-center",children:[s.jsx("div",{className:"mx-auto w-16 h-16 bg-chamber-blue-light rounded-full flex items-center justify-center mb-4",children:s.jsx(Br,{size:32,className:"text-chamber-blue"})}),s.jsx("h3",{className:"text-xl font-semibold mb-3",children:"Educational Resources"}),s.jsx("p",{className:"text-gray-600 mb-4",children:"Access workshops, seminars, and resources designed to help your business grow and succeed."})]})]}),s.jsx("div",{className:"text-center mt-12",children:s.jsx(rt,{to:"/auth/signup",children:s.jsxs(Y,{size:"lg",className:"bg-chamber-blue hover:bg-chamber-blue-dark",children:["Become a Member ",s.jsx(ul,{size:16,className:"ml-2"})]})})})]})}),s.jsx("section",{className:"py-16 bg-white",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs("div",{className:"text-center mb-10",children:[s.jsx("h2",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Benefits of membership"}),s.jsx("p",{className:"text-xl text-gray-700 italic max-w-3xl mx-auto",children:"âJoining the Chamber isnât just about growing your business; itâs about becoming part of a community that supports and empowers success.â"})]}),s.jsx("div",{className:"max-w-3xl mx-auto mb-12",children:s.jsxs("div",{className:"flex items-center justify-center",children:[s.jsx("img",{src:"/person.webp",alt:"Sasan Shavanson - Valley Stream Chamber Of Commerce President",className:"w-16 h-16 rounded-full object-cover mr-4"}),s.jsxs("div",{className:"text-center sm:text-left",children:[s.jsx("h3",{className:"text-lg font-extrabold text-gray-900",children:"Sasan Shavanson"}),s.jsxs("p",{className:"text-sm text-gray-600 font-medium",children:["Valley Stream Chamber Of Commerce President",s.jsx("br",{}),s.jsx("br",{}),"One in a Million, Inc."]})]})]})}),s.jsxs("div",{className:"grid md:grid-cols-2 gap-8",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-bold text-gray-900 mb-1",children:"Expand Your Network"}),s.jsx("p",{className:"text-gray-700",children:"Build meaningful connections with local businesses and community leaders through exclusive events and opportunities."})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-bold text-gray-900 mb-1",children:"Grow Your Business"}),s.jsx("p",{className:"text-gray-700",children:"Access resources, tools, and workshops tailored to help your business thrive in a competitive market."})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-bold text-gray-900 mb-1",children:"Advocacy and Representation"}),s.jsx("p",{className:"text-gray-700",children:"Have your voice heard and influence decisions on issues that affect your business locally and at the state level."})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-bold text-gray-900 mb-1",children:"Promotion and Visibility"}),s.jsx("p",{className:"text-gray-700",children:"Showcase your business through Chamber directories, newsletters, and event sponsorships."})]})]})]})}),s.jsx("section",{className:"py-16 bg-chamber-blue text-white",children:s.jsxs("div",{className:"container-wrapper text-center",children:[s.jsx("h2",{className:"text-3xl font-bold mb-6",children:"Ready to Grow Your Business?"}),s.jsx("p",{className:"text-xl max-w-2xl mx-auto mb-8",children:"Join our Chamber of Commerce today and connect with local businesses, access valuable resources, and increase your community presence."}),s.jsxs("div",{className:"flex flex-col sm:flex-row justify-center gap-4",children:[s.jsx(rt,{to:"/auth/signup",children:s.jsx(Y,{size:"lg",variant:"default",className:"bg-white text-chamber-blue hover:bg-gray-100",children:"Join Now"})}),s.jsx(rt,{to:"/contact",children:s.jsx(Y,{size:"lg",variant:"default",className:"bg-white text-chamber-blue hover:bg-gray-100",children:"Contact Us"})})]})]})})]}),Ne=x.forwardRef(({className:t,type:e,...r},n)=>s.jsx("input",{type:e,className:xt("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",t),ref:n,...r}));Ne.displayName="Input";var yre="Label",_R=x.forwardRef((t,e)=>s.jsx(dm.label,{...t,ref:e,onMouseDown:r=>{var a;r.target.closest("button, input, select, textarea")||((a=t.onMouseDown)==null||a.call(t,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));_R.displayName=yre;var ER=_R;const bre=cp("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Z=x.forwardRef(({className:t,...e},r)=>s.jsx(ER,{ref:r,className:xt(bre(),t),...e}));Z.displayName=ER.displayName;const vre=cp("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),da=x.forwardRef(({className:t,variant:e,...r},n)=>s.jsx("div",{ref:n,role:"alert",className:xt(vre({variant:e}),t),...r}));da.displayName="Alert";const AR=x.forwardRef(({className:t,...e},r)=>s.jsx("h5",{ref:r,className:xt("mb-1 font-medium leading-none tracking-tight",t),...e}));AR.displayName="AlertTitle";const ha=x.forwardRef(({className:t,...e},r)=>s.jsx("div",{ref:r,className:xt("text-sm [&_p]:leading-relaxed",t),...e}));ha.displayName="AlertDescription";const Gf=({id:t,name:e,value:r,onChange:n,label:a,showHint:i=!1,disabled:o=!1,required:l=!1})=>{const[c,u]=x.useState(!1);return s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:t,children:a}),s.jsxs("div",{className:"relative",children:[s.jsx(Ne,{id:t,name:e,type:c?"text":"password",value:r,onChange:n,placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",required:l,disabled:o}),s.jsx("button",{type:"button",className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-500",onClick:()=>u(!c),children:c?s.jsx(Xs,{size:18}):s.jsx(Py,{size:18})})]}),i&&s.jsx("p",{className:"text-xs text-gray-500",children:"Password must be at least 8 characters long"})]})},wre=()=>{const[t,e]=x.useState(""),[r,n]=x.useState(""),[a,i]=x.useState(!1),[o,l]=x.useState(""),c=ks(),u=Wi(),{toast:d}=St(),{signIn:h}=ts();x.useEffect(()=>{var m;(m=u.state)!=null&&m.message&&l(u.state.message)},[u.state]);const f=async m=>{var g,y;if(m.preventDefault(),!t||!r){d({title:"Error",description:"Please fill in all fields",variant:"destructive"});return}i(!0);try{const{error:b}=await h(t,r);if(b){if(((b==null?void 0:b.message)||"").toLowerCase().includes("email not confirmed")){const{error:j}=await Q.auth.resend({type:"signup",email:t});d(j?{title:"Email not confirmed",description:"Please verify your email first. We couldn't resend a new code right now, please try again in a moment.",variant:"destructive"}:{title:"Email not confirmed",description:"We've sent a new verification code to your email."}),c(`/auth/verify-otp?email=${encodeURIComponent(t)}`);return}d({title:"Login failed",description:b.message,variant:"destructive"})}else{d({title:"Login successful",description:"Welcome back!"});const w=((y=(g=u.state)==null?void 0:g.from)==null?void 0:y.pathname)||"/dashboard";c(w,{replace:!0})}}catch(b){d({title:"Error",description:b instanceof Error?b.message:"Unknown error",variant:"destructive"})}finally{i(!1)}};
684return s.jsxs(De,{className:"w-full max-w-md shadow-lg",children:[s.jsxs(ot,{className:"space-y-1",children:[s.jsx(ut,{className:"text-2xl font-bold",children:"Login"}),s.jsx(us,{children:"Enter your email and password to access your account"})]}),s.jsxs(Be,{children:[o&&s.jsx(da,{className:"mb-4 bg-blue-50",children:s.jsx(ha,{children:o})}),s.jsxs("form",{onSubmit:f,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"email",children:"Email"}),s.jsx(Ne,{id:"email",type:"email",placeholder:"[email protected]",value:t,onChange:m=>e(m.target.value),disabled:a,required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"password",children:"Password"}),s.jsx(Gf,{id:"password",name:"password",value:r,onChange:m=>n(m.target.value),disabled:a,label:""}),s.jsx("div",{className:"flex justify-end",children:s.jsx(rt,{to:"/auth/forgot-password",className:"text-xs text-chamber-blue hover:underline",children:"Forgot password?"})})]}),s.jsx(Y,{type:"submit",className:"w-full bg-chamber-blue hover:bg-chamber-blue-dark",disabled:a,children:a?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"})," Signing in"]}):"Sign in"})]})]}),s.jsx(co,{className:"flex justify-center border-t pt-4",children:s.jsxs("p",{className:"text-sm text-gray-500",children:["Don't have an account?"," ",s.jsx(rt,{to:"/auth/signup",className:"text-chamber-blue hover:underline",children:"Create an account"})]})})]})},jre=()=>s.jsx("div",{className:"min-h-screen flex flex-col",children:s.jsx("div",{className:"flex-1 flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"w-full max-w-md
684space-y-8",children:[s.jsxs("div",{className:"text-center",children:[s.jsx(rt,{to:"/",className:"inline-block",children:s.jsx("span",{className:"font-bold text-2xl text-chamber-blue",children:"Valley Stream Chamber"})}),s.jsx("h2",{className:"mt-6 text-3xl font-bold tracking-tight text-gray-900",children:"Sign in to your account"})]}),s.jsx(wre,{})]})})}),Nre=()=>{const t=ks(),[e,r]=x.useState(null),[n,a]=x.useState(null),[i,o]=x.useState(!0);x.useEffect(()=>{l()},[]);const l=async()=>{try{const[u,d]=await Promise.all([Ro.getBusinessPricing(),Ro.getMembershipPricing()]);r(u),a(d)}catch(u){console.error("Error loading pricing info:",u),r(null),a(null)}finally{o(!1)}},c=u=>{t(`/auth/signup/${u}`)};return s.jsx("div",{className:"min-h-screen flex flex-col",children:s.jsx("div",{className:"flex-1 flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"w-full max-w-3xl space-y-8",children:[s.jsxs("div",{className:"text-center",children:[s.jsx(rt,{to:"/",className:"inline-block",children:s.jsx("span",{className:"font-bold text-2xl text-chamber-blue",children:"Valley Stream Chamber"})}),s.jsx("h2",{className:"mt-6 text-3xl font-bold tracking-tight text-gray-900",children:"Select account type"}),s.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Choose the type of account that best fits your needs"})]}),s.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[s.jsxs(De,{className:"w-full shadow-md hover:shadow-lg transition-shadow",children:[s.jsxs(ot,{className:"text-center",children:[s.jsx(ka,{className:"w-12 h-12 mx-auto text-chamber-blue"}),s.jsx(ut,{className:"text-xl font-bold mt-4",children:"Business Account"}),s.jsx(us,{children:"For local business owners"}),s.jsxs("div",{className:"mt-2",children:[s.jsx("div",{className:"text-2xl font-bold text-emerald-600",children:i?s.jsxs("span",{className:"inline-flex items-center gap-1","aria-label":"Loading business pricing",children:[s.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-600 animate-bounce"}),s.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-600 animate-bounce",style:{animationDelay:"0.15s"}}),s.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-600 animate-bounce",style:{animationDelay:"0.3s"}})]}):e?`$${e.isFullYear?e.fullYearPrice.toFixed(2):e.proratedPrice.toFixed(2)}`:"Pricing unavailable"}),e&&!e.isFullYear&&s.jsxs("div",{className:"text-sm text-gray-600 mt-1",children:["Prorated for ",e.daysRemaining," days remaining"]}),e&&!e.isFullYear&&s.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:["Full year: $",e.fullYearPrice.toFixed(2)," ⢠Save: $",Math.round((e.fullYearPrice-e.proratedPrice)*100)/100," ⢠Then $",e.fullYearPrice.toFixed(2),"/yr starting Jan 1, ",new Date().getFullYear()+1]})]})]}),s.jsx(Be,{className:"text-sm",children:s.jsxs("ul",{className:"space-y-2",children:[s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"text-green-500 mr-2",children:"â"})," Business listing in directory"]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"text-green-500 mr-2",children:"â"})," Promote events and special offers"]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"text-green-500 mr-2",children:"â"})," Networking opportunities"]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"text-green-500 mr-2",children:"â"})," Business development resources"]})]})}),s.jsx(co,{children:s.jsx(Y,{onClick:()=>c("business"),className:"w-full bg-chamber-blue hover:bg-chamber-blue-dark",children:"Create Business Account"})})]}),s.jsxs(De,{className:"w-full shadow-md hover:shadow-lg transition-shadow",children:[s.jsxs(ot,{className:"text-center",children:[s.jsx(ma,{className:"w-12 h-12 mx-auto text-chamber-blue"}),s.jsx(ut,{className:"text-xl font-bold mt-4",children:"Residential Account"}),s.jsx(us,{children:"For local residents"}),s.jsxs("div",{className:"mt-2",children:[s.jsx("div",{className:"text-2xl font-bold text-emerald-600",children:i?s.jsxs("span",{className:"inline-flex items-center gap-1","aria-label":"Loading residential pricing",children:[s.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-600 animate-bounce"}),s.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-600 animate-bounce",style:{animationDelay:"0.15s"}}),s.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-600 animate-bounce",style:{animationDelay:"0.3s"}})]}):n?`$${n.isFullYear?n.fullYearPrice.toFixed(2):n.proratedPrice.toFixed(2)}`:"Pricing unavailable"}),n&&!n.isFullYear&&s.jsxs("div",{className:"text-sm text-gray-600 mt-1",children:["Prorated for ",n.daysRemaining," days remaining"]}),n&&!n.isFullYear&&s.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:["Full year: $",n.fullYearPrice.toFixed(2)," ⢠Save: $",Math.round((n.fullYearPrice-n.proratedPrice)*100)/100," ⢠Then $",n.fullYearPrice.toFixed(2),"/yr starting Jan 1, ",new Date().getFullYear()+1]})]})]}),s.jsx(Be,{className:"text-sm",children:s.jsxs("ul",{className:"space-y-2",children:[s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"text-green-500 mr-2",children:"â"})," Connect with local businesses"]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"text-green-500 mr-2",children:"â"})," Access to member discounts"]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"text-green-500 mr-2",children:"â"})," Community event invitations"]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx("span",{className:"text-green-500 mr-2",children:"â"})," Support local economic growth"]})]})}),s.jsx(co,{children:s.jsx(Y,{onClick:()=>c("residential"),variant:"outline",className:"w-full border-chamber-blue text-chamber-blue hover:bg-chamber-blue hover:text-white",children:"Create Residential Account"})})]})]}),(e&&!e.isFullYear||n&&!n.isFullYear)&&s.jsxs("div",{className:"p-4 bg-blue-50 rounded-lg mt-6",children:[s.jsx("h4",{className:"font-medium text-blue-800 text-center mb-2",children:"Prorated Pricing"}),s.jsx("p",{className:"text-sm text-blue-700 text-center",children:"Our pricing is prorated based on the calendar year. If you join mid-year, you'll only pay for the remaining days of the current year. On January 1st, all subscriptions renew at the full annual rate based on your account type."})]}),s.jsx("div",{className:"text-center mt-6",children:s.jsxs("p",{className:"text-sm text-gray-600",children:["Already have an account?"," ",s.jsx(rt,{to:"/auth/login",className:"text-chamber-blue hover:underline",children:"Sign in"})]})})]})})})};var Fre=x.createContext(void 0);function hm(t){const e=x.useContext(Fre);return t||e||"ltr"}var M2="rovingFocusGroup.onEntryFocus",Sre={bubbles:!1,cancelable:!0},G0="RovingFocusGroup",[MF,DR,Cre]=op(G0),[kre,Tx]=li(G0,[Cre]),[_re,Ere]=kre(G0),TR=x.forwardRef((t,e)=>s.jsx(MF.Provider,{scope:t.__scopeRovingFocusGroup,children:s.jsx(MF.Slot,{scope:t.__scopeRovingFocusGroup,children:s.jsx(Are,{...t,ref:e})})}));TR.displayName=G0;var Are=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...h}=t,f=x.useRef(null),m=Cr(e,f),g=hm(i),[y,b]=Lo({prop:o,defaultProp:l??null,onChange:c,caller:G0}),[w,j]=x.useState(!1),N=Zs(u),S=DR(r),E=x.useRef(!1),[C,T]=x.useState(0);return x.useEffect(()=>{const D=f.current;if(D)return D.addEventListener(M2,N),()=>D.removeEventListener(M2,N)},[N]),s.jsx(_re,{scope:r,orientation:n,dir:g,loop:a,currentTabStopId:y,onItemFocus:x.useCallback(D=>b(D),[b]),onItemShiftTab:x.useCallback(()=>j(!0),[]),onFocusableItemAdd:x.useCallback(()=>T(D=>D+1),[]),onFocusableItemRemove:x.useCallback(()=>T(D=>D-1),[]),children:s.jsx(Zt.div,{tabIndex:w||C===0?-1:0,"data-orientation":n,...h,ref:m,style:{outline:"none",...t.style},onMouseDown:gt(t.onMouseDown,()=>{E.current=!0}),onFocus:gt(t.onFocus,D=>{const A=!E.current;if(D.target===D.currentTarget&&A&&!w){const R=new CustomEvent(M2,Sre);
684if(D.currentTarget.dispatchEvent(R),!R.defaultPrevented){const M=S().filter(V=>V.focusable),P=M.find(V=>V.active),U=M.find(V=>V.id===y),O=[P,U,...M].filter(Boolean).map(V=>V.ref.current);RR(O,d)}}E.current=!1}),onBlur:gt(t.onBlur,()=>j(!1))})})}),MR="RovingFocusGroupItem",PR=x.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:a=!1,tabStopId:i,children:o,...l}=t,c=hl(),u=i||c,d=Ere(MR,r),h=d.currentTabStopId===u,f=DR(r),{onFocusableItemAdd:m,onFocusableItemRemove:g,currentTabStopId:y}=d;return x.useEffect(()=>{if(n)return m(),()=>g()},[n,m,g]),s.jsx(MF.ItemSlot,{scope:r,id:u,focusable:n,active:a,children:s.jsx(Zt.span,{tabIndex:h?0:-1,"data-orientation":d.orientation,...l,ref:e,onMouseDown:gt(t.onMouseDown,b=>{n?d.onItemFocus(u):b.preventDefault()}),onFocus:gt(t.onFocus,()=>d.onItemFocus(u)),onKeyDown:gt(t.onKeyDown,b=>{if(b.key==="Tab"&&b.shiftKey){d.onItemShiftTab();return}if(b.target!==b.currentTarget)return;const w=Mre(b,d.orientation,d.dir);if(w!==void 0){if(b.metaKey||b.ctrlKey||b.altKey||b.shiftKey)return;b.preventDefault();let N=f().filter(S=>S.focusable).map(S=>S.ref.current);if(w==="last")N.reverse();else if(w==="prev"||w==="next"){w==="prev"&&N.reverse();const S=N.indexOf(b.currentTarget);N=d.loop?Pre(N,S+1):N.slice(S+1)}setTimeout(()=>RR(N))}}),children:typeof o=="function"?o({isCurrentTabStop:h,hasTabStop:y!=null}):o})})});PR.displayName=MR;var Dre={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Tre(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function Mre(t,e,r){const n=Tre(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Dre[n]}function RR(t,e=!1){const r=document.activeElement;for(const n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}function Pre(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var sk=TR,nk=PR,Tw="Tabs",[Rre]=li(Tw,[Tx]),BR=Tx(),[Bre,ak]=Rre(Tw),LR=x.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:l,activationMode:c="automatic",...u}=t,d=hm(l),[h,f]=Lo({prop:n,onChange:a,defaultProp:i??"",caller:Tw});return s.jsx(Bre,{scope:r,baseId:hl(),value:h,onValueChange:f,orientation:o,dir:d,activationMode:c,children:s.jsx(Zt.div,{dir:d,"data-orientation":o,...u,ref:e})})});LR.displayName=Tw;var IR="TabsList",OR=x.forwardRef((t,e)=>{const{__scopeTabs:r,loop:n=!0,...a}=t,i=ak(IR,r),o=BR(r);return s.jsx(sk,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:n,children:s.jsx(Zt.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:e})})});OR.displayName=IR;var zR="TabsTrigger",UR=x.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,disabled:a=!1,...i}=t,o=ak(zR,r),l=BR(r),c=WR(o.baseId,n),u=qR(o.baseId,n),d=n===o.value;return s.jsx(nk,{asChild:!0,...l,focusable:!a,active:d,children:s.jsx(Zt.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:e,onMouseDown:gt(t.onMouseDown,h=>{!a&&h.button===0&&h.ctrlKey===!1?o.onValueChange(n):h.preventDefault()}),onKeyDown:gt(t.onKeyDown,h=>{[" ","Enter"].includes(h.key)&&o.onValueChange(n)}),onFocus:gt(t.onFocus,()=>{const h=o.activationMode!=="manual";!d&&!a&&h&&o.onValueChange(n)})})})});UR.displayName=zR;var HR="TabsContent",$R=x.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,forceMount:a,children:i,...o}=t,l=ak(HR,r),c=WR(l.baseId,n),u=qR(l.baseId,n),d=n===l.value,h=x.useRef(d);return x.useEffect(()=>{const f=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(f)},[]),s.jsx(fa,{present:a||d,children:({present:f})=>s.jsx(Zt.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!f,id:u,tabIndex:0,...o,ref:e,style:{...t.style,animationDuration:h.current?"0s":void 0},children:f&&i})})});$R.displayName=HR;function WR(t,e){return`${t}-trigger-${e}`}function qR(t,e){return`${t}-content-${e}`}var Lre=LR,GR=OR,VR=UR,KR=$R;const sn=Lre,Qs=x.forwardRef(({className:t,...e},r)=>s.jsx(GR,{ref:r,className:xt("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...e}));Qs.displayName=GR.displayName;const Gt=x.forwardRef(({className:t,...e},r)=>s.jsx(VR,{ref:r,className:xt("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",t),...e}));Gt.displayName=VR.displayName;const Rt=x.forwardRef(({className:t,...e},r)=>s.jsx(KR,{ref:r,className:xt("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...e}));Rt.displayName=KR.displayName;const PF=t=>{const e=t.replace(/[^\d]/g,"");return e.length<=3?e.length?`(${e}`:"":e.length<=6?`(${e.slice(0,3)}) ${e.slice(3)}`:`(${e.slice(0,3)}) ${e.slice(3,6)}-${e.slice(6,10)}`},Ire=t=>t?!t.startsWith("http://")&&!t.startsWith("https://")?`https://${t}`:t:"",Ore=t=>{const e=t.target.value;if(e.includes("-")&&!e.includes(")")){const n=e.replace(/-/g,"");return PF(n)}return PF(e)},zre=t=>t.replace(/[^\d]/g,"").substring(0,5),Kh={async getActiveTerms(){const{data:t,error:e}=await Q.from("terms_and_conditions").select("*").eq("is_active",!0).single();return e?(console.error("Error fetching active terms:",e),null):t},async getAllTerms(){const{data:t,error:e}=await Q.from("terms_and_conditions").select("*").order("created_at",{ascending:!1});if(e)throw console.error("Error fetching all terms:",e),e;return t||[]},async createTerms(t){const{data:{user:e}}=await Q.auth.getUser();if(!e)throw new Error("User not authenticated");await Q.from("terms_and_conditions").update({is_active:!1}).eq("is_active",!0);const{data:r,error:n}=await Q.from("terms_and_conditions").insert({...t,is_active:!0,created_by:e.id}).select().single();if(n)throw console.error("Error creating terms:",n),n;return r},async updateTerms(t,e){await Q.from("terms_and_conditions").update({is_active:!1}).eq("is_active",!0);const{data:r,error:n}=await Q.from("terms_and_conditions").update({...e,is_active:!0,updated_at:new Date().toISOString()}).eq("id",t).select().single();if(n)throw console.error("Error updating terms:",n),n;return r},async acceptTerms(t,e){const{data:{user:r}}=await Q.auth.getUser();if(!r)throw new Error("User not authenticated");const n=navigator.userAgent,{data:a,error:i}=await Q.from("user_terms_acceptance").upsert({user_id:r.id,terms_id:t,terms_version:e,user_agent:n,accepted_at:new Date().toISOString()}).select().single();if(i)throw console.error("Error accepting terms:",i),i;return a},async hasUserAcceptedCurrentTerms(t){const{data:{user:e}}=await Q.auth.getUser(),r=t||(e==null?void 0:e.id);if(!r)return!1;const n=await this.getActiveTerms();if(!n)return!0;const{data:a,error:i}=await Q.from("user_terms_acceptance").select("id").eq("user_id",r).eq("terms_id",n.id).single();
684return i&&i.code!=="PGRST116"?(console.error("Error checking terms acceptance:",i),!1):!!a},async getUserTermsHistory(t){const{data:e,error:r}=await Q.from("user_terms_acceptance").select(` 685 *, 686 terms_and_conditions ( 687 title, 688 version 689 ) 690 `).eq("user_id",t).order("accepted_at",{ascending:!1});if(r)throw console.error("Error fetching user terms history:",r),r;return e||[]}},Ure=()=>{const t={monday:{open:"09:00",close:"17:00"},tuesday:{open:"09:00",close:"17:00"},wednesday:{open:"09:00",close:"17:00"},thursday:{open:"09:00",close:"17:00"},friday:{open:"09:00",close:"17:00"},saturday:{open:"10:00",close:"15:00"},sunday:{open:"closed",close:"closed"}},[e,r]=x.useState("personal"),[n,a]=x.useState(!1),i=ks(),{toast:o}=St(),[l]=Td(),[c,u]=x.useState({authStarted:!1,authCompleted:!1,businessCreationStarted:!1,businessCreationCompleted:!1}),[d,h]=x.useState({firstName:"",lastName:"",email:"",password:"",confirmPassword:"",referralName:"",referralEmail:"",businessName:"",businessDescription:"",shortDescription:"",business_type:"physical_location",addressLine1:"",addressLine2:"",city:"",state:"",zipCode:"",latitude:void 0,longitude:void 0,service_area_description:"",service_radius_miles:void 0,phone:"",businessEmail:"",website:"",facebookUrl:"",instagramUrl:"",twitterUrl:"",categories:[],business_hours_json:{...t},gallery_urls:[],logo_url:"",cover_image_url:"",tags:[]}),[f,m]=x.useState(null),[g,y]=x.useState(""),[b,w]=x.useState(!1),[j,N]=x.useState(null),[S,E]=x.useState(""),[C,T]=x.useState(!1),[D,A]=x.useState([]),[R,M]=x.useState([]),[P,U]=x.useState(!1),[I,O]=x.useState(!1);x.useEffect(()=>{const re=l.get("ref");re&&h(we=>({...we,referralEmail:re}))},[l]);const V=re=>{const we=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],Ee={};return we.forEach(Me=>{Ee[Me]={open:"closed",close:"closed"}}),re.forEach(Me=>{const ae=we[Me.open.day];if(ae)try{let ze="",mt="23:59";if(typeof Me.open.hour=="number"&&typeof Me.open.minute=="number")ze=`${Me.open.hour.toString().padStart(2,"0")}:${Me.open.minute.toString().padStart(2,"0")}`;else if(Me.open.time){const tt=Me.open.time.padStart(4,"0");ze=tt.slice(0,2)+":"+tt.slice(2)}if(Me.close&&typeof Me.close.hour=="number"&&typeof Me.close.minute=="number")mt=`${Me.close.hour.toString().padStart(2,"0")}:${Me.close.minute.toString().padStart(2,"0")}`;else if(Me.close&&Me.close.time){const tt=Me.close.time.padStart(4,"0");mt=tt.slice(0,2)+":"+tt.slice(2)}ze&&ze.match(/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/)&&mt.match(/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/)&&(Ee[ae]={open:ze,close:mt})}catch(ze){console.warn("Error converting time for day",ae,":",ze)}}),Ee},G=re=>{const{name:we,value:Ee}=re.target;let Me=Ee;we==="phone"?Me=PF(Ee):we==="service_radius_miles"&&(Me=Ee?parseInt(Ee):void 0),h(ae=>({...ae,[we]:Me}))},B=re=>{h(we=>({...we,business_type:re}))},$=re=>{var Ee,Me,ae;h(ze=>{var Xe,Ft,ce;const mt=(Ft=(Xe=re.openingHours)==null?void 0:Xe.periods)!=null&&Ft.length?V(re.openingHours.periods):{...t},tt={...ze,addressLine1:re.address||"",city:re.city||"",state:re.state||"",zipCode:re.zipCode||"",latitude:re.latitude,longitude:re.longitude,businessName:re.businessName||"",phone:re.phoneNumber||"",businessEmail:re.businessEmail||"",website:re.website||"",facebookUrl:re.facebookUrl||"",instagramUrl:re.instagramUrl||"",twitterUrl:re.twitterUrl||"",logo_url:re.logo||"",cover_image_url:((ce=re.photos)==null?void 0:ce[0])||"",gallery_urls:re.photos&&re.photos.length>0?re.photos:[],business_hours_json:mt,businessDescription:re.editorialSummary||"",shortDescription:re.editorialSummary?re.editorialSummary.slice(0,150):""};return console.log("BusinessSignupForm: Replaced form data from selected place:",{businessName:tt.businessName,businessEmail:tt.businessEmail,website:tt.website,social:{facebookUrl:tt.facebookUrl,instagramUrl:tt.instagramUrl,twitterUrl:tt.twitterUrl},description:tt.businessDescription,shortDescription:tt.shortDescription,businessHours:tt.business_hours_json}),tt}),y(re.logo||""),E(((Ee=re.photos)==null?void 0:Ee[0])||""),re.photos&&re.photos.length>
6900&&(R.forEach(ze=>{ze.startsWith("blob:")&&URL.revokeObjectURL(ze)}),A([]),M([]));const we=[];re.businessName&&we.push("Business Name"),re.address&&we.push("Address"),re.phoneNumber&&we.push("Phone"),re.website&&we.push("Website"),re.businessEmail&&we.push("Business Email"),(re.facebookUrl||re.instagramUrl||re.twitterUrl)&&we.push("Social Media"),re.logo&&we.push("Logo"),re.photos&&re.photos.length>0&&we.push(`Photos (${re.photos.length})`),re.editorialSummary&&we.push("Description"),(ae=(Me=re.openingHours)==null?void 0:Me.periods)!=null&&ae.length&&we.push("Business Hours"),we.length>0&&o({title:"Business details auto-populated",description:`Found and filled: ${we.join(", ")}. Review and adjust as needed.`})},W=(re,we,Ee)=>{h(Me=>{const ae={...Me.business_hours_json};return ae[re]||(ae[re]={open:"09:00",close:"17:00"}),Ee==="24/7"?ae[re]={open:"24/7",close:"24/7"}:Ee==="closed"||ae[re][we==="open"?"close":"open"]==="closed"?ae[re]={open:"closed",close:"closed"}:ae[re][we]=Ee,{...Me,business_hours_json:ae}})},oe=re=>{if(re)try{new URL(re),h(we=>we.gallery_urls.includes(re)?we:{...we,gallery_urls:[...we.gallery_urls,re]})}catch{o({title:"Invalid URL",description:"Please enter a valid image URL",variant:"destructive"})}},K=re=>{h(we=>({...we,gallery_urls:we.gallery_urls.filter(Ee=>Ee!==re)}))},H=(re,we)=>{h(Ee=>{const Me=Ee.categories;if(Me.some(ze=>ze.id===re)||Me.length>=2)return Ee;const ae={id:re,name:we,isPrimary:Me.length===0};return{...Ee,categories:[...Me,ae]}})},X=re=>{h(we=>{const Ee=we.categories.filter(Me=>Me.id!==re);return Ee.length>0&&!Ee.some(Me=>Me.isPrimary)&&(Ee[0].isPrimary=!0),{...we,categories:Ee}})},me=re=>{h(we=>({...we,logo_url:re}))},ie=re=>{h(we=>({...we,cover_image_url:re}))},ee=re=>{h(we=>({...we,tags:re}))},he=()=>!d.firstName||!d.lastName||!d.email||!d.password||!d.confirmPassword?(o({title:"Missing fields",description:"Please fill in all required fields",variant:"destructive"}),!1):d.password!==d.confirmPassword?(o({title:"Passwords don't match",description:"Please make sure your passwords match",variant:"destructive"}),!1):d.password.length<8?(o({title:"Password too short",description:"Password must be at least 8 characters long",variant:"destructive"}),!1):!0,ve=()=>{const re=[{key:"businessName",label:"Business Name"},{key:"phone",label:"Phone"},{key:"businessEmail",label:"Business Email"}];let we=[];d.business_type==="physical_location"?we=[{key:"addressLine1",label:"Address Line 1"},{key:"city",label:"City"},{key:"state",label:"State"},{key:"zipCode",label:"Zip Code"}]:d.business_type==="service_area"&&(we=[{key:"service_area_description",label:"Service Area Description"}]);const Me=[...re,...we].filter(ae=>!d[ae.key]);return Me.length>0?(o({title:"Missing fields",description:`Please fill in: ${Me.map(ae=>ae.label).join(", ")}`,variant:"destructive"}),!1):d.business_type==="service_area"&&d.service_area_description.length<10?(o({title:"Service area description too short",description:"Please provide a detailed description of your service area (at least 10 characters)",variant:"destructive"}),!1):d.business_type==="service_area"&&d.service_area_description.length>100?(o({title:"Service area description too long",description:"Service area description must be 100 characters or less for proper display",variant:"destructive"}),!1):d.categories.length===0?(o({title:"Categories required",description:"Please select at least one business category",variant:"destructive"}),!1):I?!0:(o({title:"Terms acceptance required",description:"Please accept the terms and conditions to continue",variant:"destructive"}),!1)},Ce=async re=>{if(re.preventDefault(),!(!he()||!ve())){a(!0),u(we=>({...we,authStarted:!0}));try{const{data:we,error:Ee}=await Q.auth.signUp({email:d.email,password:d.password,options:{data:{first_name:d.firstName,last_name:d.lastName}}});if(Ee)throw Ee;if(we.user){u(ce=>({...ce,authCompleted:!0,businessCreationStarted:!0}));let Me=d.logo_url;if(f){w(!0);try{const ce=`${we.user.id}/${Date.now()}_${f.name.replace(/[^a-zA-Z0-9.]/g,"_")}`,{error:fe}=await Q.storage.from("business-logos").upload(ce,f);if(fe)throw fe;const{data:{publicUrl:ge}}=Q.storage.from("business-logos").getPublicUrl(ce);Me=ge}catch(ce){console.error("Logo upload error:",ce),o({title:"Logo Upload Failed",description:ce.message||"Failed to upload logo",variant:"destructive"})}finally{w(!1)}}let ae=d.cover_image_url;if(j){T(!0);try{const ce=`business_covers/${we.user.id}/${Date.now()}_${j.name.replace(/[^a-zA-Z0-9.]/g,"_")}`,{error:fe}=await Q.storage.from("business_assets").upload(ce,j);if(fe)throw fe;const{data:{publicUrl:ge}}=Q.storage.from("business_assets").getPublicUrl(ce);ae=ge}catch(ce){console.error("Cover image upload error:",ce),o({title:"Cover Image Upload Failed",description:ce.message||"Failed to upload cover image",variant:"destructive"})}finally{T(!1)}}let ze=[...d.gallery_urls];if(D.length>0){U(!0);try{const ce=D.map(async ge=>{const Ge=`business_gallery/${we.user.id}/${Date.now()}_${ge.name.replace(/[^a-zA-Z0-9.]/g,"_")}`,{error:Je}=await Q.storage.from("business_assets").upload(Ge,ge);if(Je)throw Je;const{data:{publicUrl:be}}=Q.storage.from("business_assets").getPublicUrl(Ge);return be}),fe=await Promise.all(ce);ze=[...ze,...fe]}catch(ce){console.error("Gallery upload error:",ce),o({title:"Gallery Upload Failed",description:ce.message||"Some gallery images failed to upload",variant:"destructive"})}finally{U(!1)}}const{error:mt}=await Q.from("profiles").upsert({id:we.user.id,first_name:d.firstName,last_name:d.lastName,email:d.email,user_type:"business",referral_name:d.referralName||null,referral_email:d.referralEmail||null});if(mt)throw mt;if(d.referralEmail)try{const{data:ce,error:fe}=await Q.from("profiles").select("id, first_name, last_name, email").eq("email",d.referralEmail.toLowerCase()).single();if(ce&&!fe){const{error:ge}=await Q.from("referrals").insert({referrer_id:ce.id,referred_id:we.user.id,referrer_name:`${ce.first_name} ${ce.last_name}`,referrer_email:ce.email,referred_name:`${d.firstName} ${d.lastName}`,referred_email:d.email,points_awarded:1,discount_percentage:10,subscription_required:!0,subscription_awarded:!1,total_points_awarded:0});ge&&console.error("Error creating referral:",ge)}}catch(ce){console.error("Error processing referral:",ce)}const tt={id:we.user.id,owner_id:we.user.id,business_name:d.businessName,business_description:d.businessDescription,short_description:d.shortDescription,business_hours_json:d.business_hours_json,business_type:d.business_type,phone:d.phone,email:d.businessEmail||null,website:d.website||null,facebook_url:d.facebookUrl||null,instagram_url:d.instagramUrl||null,twitter_url:d.twitterUrl||null,gallery_urls:ze,logo_url:Me||null,cover_image_url:ae||null,tags:d.tags||[]};d.business_type==="physical_location"?(tt.address_line1=d.addressLine1,tt.address_line2=d.addressLine2,tt.city=d.city,tt.state=d.state,tt.zip_code=d.zipCode,tt.latitude=d.latitude||null,tt.longitude=d.longitude||null):d.business_type==="service_area"&&(tt.service_area_description=d.service_area_description,tt.service_radius_miles=d.service_radius_miles||null);const{error:Xe}=await Q.from("business_profiles").insert(tt);if(Xe)throw Xe;const{error:Ft}=await Q.from("business_categories").insert(d.categories.map(ce=>({business_id:we.user.id,category_name:ce.name,is_primary:ce.isPrimary})));if(Ft)throw Ft;
690try{const ce=await Kh.getActiveTerms();ce&&await Kh.acceptTerms(ce.id,ce.version)}catch(ce){console.error("Error accepting terms:",ce)}u(ce=>({...ce,businessCreationCompleted:!0})),o({title:"Account created",description:"Your business account has been created successfully. Please check your email for the 6-digit verification code."}),i(`/auth/verify-otp?email=${encodeURIComponent(d.email)}`)}}catch(we){console.error("Signup error:",we),o({title:"Error",description:we.message||"An error occurred during sign up",variant:"destructive"})}finally{a(!1)}}};return x.useEffect(()=>()=>{g&&g.startsWith("blob:")&&URL.revokeObjectURL(g),S&&S.startsWith("blob:")&&URL.revokeObjectURL(S),R.forEach(re=>{re.startsWith("blob:")&&URL.revokeObjectURL(re)})},[g,S,R]),{activeTab:e,setActiveTab:r,formData:d,isLoading:n,signupSteps:c,logoFile:f,setLogoFile:m,logoPreview:g,setLogoPreview:y,uploadingLogo:b,setUploadingLogo:w,handleLogoUrlChange:me,coverImageFile:j,setCoverImageFile:N,coverImagePreview:S,setCoverImagePreview:E,uploadingCoverImage:C,setUploadingCoverImage:T,handleCoverImageUrlChange:ie,galleryFiles:D,setGalleryFiles:A,galleryPreviews:R,setGalleryPreviews:M,uploadingGallery:P,setUploadingGallery:U,handleChange:G,handleBusinessTypeChange:B,handlePlaceSelect:$,handleBusinessHoursChange:W,handleAddGalleryUrl:oe,removeGalleryUrl:K,handleCategorySelect:H,removeCategory:X,handleTagsChange:ee,validatePersonalInfo:he,handleSubmit:Ce,termsAccepted:I,setTermsAccepted:O}},Hre=({formData:t,isLoading:e,handleChange:r,onNext:n})=>s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Z,{htmlFor:"firstName",children:["First Name ",s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx(Ne,{id:"firstName",name:"firstName",value:t.firstName,onChange:r,placeholder:"John",required:!0,disabled:e})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Z,{htmlFor:"lastName",children:["Last Name ",s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx(Ne,{id:"lastName",name:"lastName",value:t.lastName,onChange:r,placeholder:"Doe",required:!0,disabled:e})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Z,{htmlFor:"email",children:["Email ",s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx(Ne,{id:"email",name:"email",type:"email",value:t.email,onChange:r,placeholder:"[email protected]",required:!0,disabled:e})]}),s.jsx(Gf,{id:"password",name:"password",value:t.password,onChange:r,label:"Password",showHint:!0,disabled:e}),s.jsx(Gf,{id:"confirmPassword",name:"confirmPassword",value:t.confirmPassword,onChange:r,label:"Confirm Password",disabled:e}),s.jsxs("div",{className:"space-y-4 border-t pt-4",children:[s.jsx("h3",{className:"text-sm font-medium text-gray-700",children:"Referral Information (Optional)"}),s.jsx("p",{className:"text-xs text-gray-500",children:"If someone referred you to join, please provide their information below. They'll receive referral points and a 10% discount!"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"referralName",children:"Referrer's Name"}),s.jsx(Ne,{id:"referralName",name:"referralName",value:t.referralName,onChange:r,placeholder:"John Doe",disabled:e})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"referralEmail",children:"Referrer's Email"}),s.jsx(Ne,{id:"referralEmail",name:"referralEmail",type:"email",value:t.referralEmail,onChange:r,placeholder:"[email protected]",disabled:e})]})]})]}),s.jsx("div",{className:"pt-4",children:s.jsx(Y,{type:"button",onClick:n,className:"w-full bg-chamber-blue hover:bg-chamber-blue-dark",disabled:e,children:"Continue to Business Information"})})]});function $re(t,e){let r;return(...n)=>{clearTimeout(r),r=setTimeout(()=>t(...n),e)}}const Mw=({onPlaceSelect:t,onChange:e,placeholder:r="Start typing an address...",label:n,required:a=!1,disabled:i=!1,value:o="",className:l="",id:c,name:u,searchType:d="address"})=>
690{const h=x.useRef(null),f=x.useRef(null),[m,g]=x.useState(!1),[y,b]=x.useState(o),[w,j]=x.useState([]),[N,S]=x.useState(!1),[E,C]=x.useState(-1),[T,D]=x.useState(!0),A="AIzaSyAbLIh5nnw9na-VqFxRM1w4Ic-MmvJCJwQ",R=x.useMemo(()=>d==="business"?"(regions)":"address",[d]);x.useEffect(()=>{D(!!A)},[A]);const M=x.useMemo(()=>$re(async $=>{var W;if(!$.trim()||!A){j([]),S(!1);return}try{(W=f.current)==null||W.abort();const oe=new AbortController;f.current=oe;const K=await fetch("https://places.googleapis.com/v1/places:autocomplete",{method:"POST",headers:{"Content-Type":"application/json","X-Goog-Api-Key":A,"X-Goog-FieldMask":"suggestions.placePrediction.placeId,suggestions.placePrediction.text,suggestions.placePrediction.structuredFormat"},body:JSON.stringify({input:$,includedRegionCodes:["us"],includePureServiceAreaBusinesses:!0,...d==="address"?{inputType:R}:{}}),signal:oe.signal});if(!K.ok){console.error("[Places API][Autocomplete] Non-OK response",{status:K.status,statusText:K.statusText,query:$,searchType:d}),j([]),S(!1);return}const H=await K.json();console.log("[Places API][Autocomplete] Response",{query:$,searchType:d,request:{input:$,includedRegionCodes:["us"],includePureServiceAreaBusinesses:!0,...d==="address"?{inputType:R}:{}},response:H});const X=(H.suggestions||[]).map(me=>{var ee,he,ve,Ce,re,we;const ie=me.placePrediction;return ie!=null&&ie.placeId?{placeId:ie.placeId,description:((ee=ie.text)==null?void 0:ee.text)||"",mainText:((ve=(he=ie.structuredFormat)==null?void 0:he.mainText)==null?void 0:ve.text)||((Ce=ie.text)==null?void 0:Ce.text)||"",secondaryText:((we=(re=ie.structuredFormat)==null?void 0:re.secondaryText)==null?void 0:we.text)||""}:null}).filter(Boolean).slice(0,5);j(X),S(X.length>0)}catch(oe){(oe==null?void 0:oe.name)!=="AbortError"&&(j([]),S(!1))}},300),[A,R,d]);x.useEffect(()=>{b(o)},[o]);const P=$=>{const W=$.target.value;b(W),C(-1),M(W),e&&e(W)},U=($,W=!1)=>W?($==null?void 0:$.shortText)||($==null?void 0:$.short_name)||($==null?void 0:$.shortName)||"":($==null?void 0:$.longText)||($==null?void 0:$.long_name)||($==null?void 0:$.longName)||"",I=$=>{const W=[],oe=X=>{typeof X=="string"&&X.startsWith("http")&&W.push(X)},K=X=>{if(X){if(Array.isArray(X)){X.forEach(K);return}if(typeof X=="object"){Object.values(X).forEach(K);return}oe(X)}};K($.socialMediaUris),oe($.facebookUri),oe($.instagramUri),oe($.twitterUri),oe($.websiteUri);const H=X=>W.find(me=>me.includes(X))||"";return{facebookUrl:H("facebook.com"),instagramUrl:H("instagram.com"),twitterUrl:H("twitter.com")||H("x.com")}},O=async $=>{var W,oe,K,H,X,me,ie;g(!0),S(!1),b($.description);try{const ee=await fetch(`https://places.googleapis.com/v1/places/${$.placeId}`,{headers:{"X-Goog-Api-Key":A,"X-Goog-FieldMask":"addressComponents,pureServiceAreaBusiness,displayName,nationalPhoneNumber,websiteUri,formattedAddress,location,types,photos,editorialSummary,regularOpeningHours"}});if(!ee.ok){console.error("[Places API][Details] Non-OK response",{status:ee.status,statusText:ee.statusText,placeId:$.placeId});return}const he=await ee.json();console.log("[Places API][Details] Response",{placeId:$.placeId,fieldMask:"addressComponents,pureServiceAreaBusiness,displayName,nationalPhoneNumber,websiteUri,formattedAddress,location,types,photos,editorialSummary,regularOpeningHours",response:he});const ve=he.addressComponents||[];let Ce="",re="",we="",Ee="",Me="",ae="";ve.forEach(qe=>{const Qe=qe.types||[];Qe.includes("street_number")?Ce=U(qe):Qe.includes("route")?re=U(qe):Qe.includes("locality")?we=U(qe):Qe.includes("administrative_area_level_1")?Ee=U(qe,!0):Qe.includes("postal_code")?Me=U(qe):Qe.includes("country")&&(ae=U(qe))});const ze=!!he.pureServiceAreaBusiness,mt=`${Ce} ${re}`.trim(),tt=ze?"Service Area":mt,Xe=(W=he.location)==null?void 0:W.latitude,Ft=(oe=he.location)==null?void 0:oe.longitude,ce=(he.photos||[]).slice(0,5).map(qe=>{const Qe=qe==null?void 0:qe.name;return Qe?`https://places.googleapis.com/v1/${Qe}/media?maxWidthPx=1200&key=${A}`:""}).filter(Boolean),fe=ce[0]||"",ge=((K=he.editorialSummary)==null?void 0:K.text)||((H=he.editorialSummary)==null?void 0:H.overview)||"",Ge=(((X=he.regularOpeningHours)==null?void 0:X.periods)||[]).map(qe=>{var Qe,We,dt,Bt,Lt,Vt,cr;return{open:{day:((Qe=qe==null?void 0:qe.open)==null?void 0:Qe.day)??0,hour:(We=qe==null?void 0:qe.open)==null?void 0:We.hour,minute:(dt=qe==null?void 0:qe.open)==null?void 0:dt.minute,time:typeof((Bt=qe==null?void 0:qe.open)==null?void 0:Bt.hour)=="number"&&typeof((Lt=qe==null?void 0:qe.open)==null?void 0:Lt.minute)=="number"?`${qe.open.hour.toString().padStart(2,"0")}${qe.open.minute.toString().padStart(2,"0")}`:void 0},close:qe!=null&&qe.close?{day:qe.close.day,hour:qe.close.hour,minute:qe.close.minute,time:typeof((Vt=qe==null?void 0:qe.close)==null?void 0:Vt.hour)=="number"&&typeof((cr=qe==null?void 0:qe.close)==null?void 0:cr.minute)=="number"?`${qe.close.hour.toString().padStart(2,"0")}${qe.close.minute.toString().padStart(2,"0")}`:void 0}:void 0}}),Je=I(he),be=he.emailAddress||he.businessEmail||he.email||"",Pe={address:tt,city:we,state:Ee,zipCode:Me,country:ae,latitude:Xe,longitude:Ft,formattedAddress:he.formattedAddress||$.description,pureServiceAreaBusiness:ze,businessName:((me=he.displayName)==null?void 0:me.text)||$.mainText||"",phoneNumber:he.nationalPhoneNumber||"",businessEmail
690:be,website:he.websiteUri||"",facebookUrl:Je.facebookUrl,instagramUrl:Je.instagramUrl,twitterUrl:Je.twitterUrl,logo:fe,photos:ce,categories:(he.types||[]).join(", "),editorialSummary:ge,openingHours:{weekday_text:((ie=he.regularOpeningHours)==null?void 0:ie.weekdayDescriptions)||[],periods:Ge}};console.log("[Places API][Autofill] Parsed result",Pe),console.log("[Places API][Business Description]",Pe.editorialSummary||"(not provided)"),console.log("[Places API][Business Hours]",Pe.openingHours||"(not provided)"),console.log("[Places API][Business Email]",Pe.businessEmail||"(not provided)"),console.log("[Places API][Social Links]",{facebookUrl:Pe.facebookUrl||"(not provided)",instagramUrl:Pe.instagramUrl||"(not provided)",twitterUrl:Pe.twitterUrl||"(not provided)"}),t(Pe)}finally{g(!1)}},V=$=>{if(!(!N||w.length===0))switch($.key){case"ArrowDown":$.preventDefault(),C(W=>W<w.length-1?W+1:W);break;case"ArrowUp":$.preventDefault(),C(W=>W>0?W-1:-1);break;case"Enter":$.preventDefault(),E>=0&&E<w.length&&O(w[E]);break;case"Escape":S(!1),C(-1);break}},G=()=>{w.length>0&&S(!0)},B=()=>{setTimeout(()=>{S(!1),C(-1)},200)};return s.jsxs("div",{className:"space-y-2",children:[n&&s.jsxs(Z,{htmlFor:c,children:[n," ",a&&s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsxs("div",{className:"relative",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx(_n,{className:"mr-2 h-4 w-4 text-muted-foreground"}),s.jsx(Ne,{ref:h,id:c,name:u,value:y,onChange:P,onKeyDown:V,onFocus:G,onBlur:B,placeholder:T?r:"Google Places API key missing",disabled:i||!T,required:a,className:l,autoComplete:"off"}),m&&s.jsx(Mt,{className:"ml-2 h-4 w-4 animate-spin text-muted-foreground"})]}),N&&w.length>0&&s.jsx("div",{className:"absolute z-50 w-full mt-1 bg-white border border-gray-200 rounded-md shadow-lg max-h-80 overflow-y-auto",children:w.map(($,W)=>s.jsx("div",{className:`flex items-center p-3 cursor-pointer hover:bg-gray-50 border-b border-gray-100 last:border-b-0 ${W===E?"bg-blue-50":""}`,onClick:()=>O($),onMouseDown:oe=>oe.preventDefault(),children:s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"font-medium text-gray-900 truncate",children:$.mainText}),s.jsx("div",{className:"text-sm text-gray-500 truncate",children:$.secondaryText})]})},$.placeId))}),!T&&s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Add `VITE_GOOGLE_MAPS_API_KEY` to enable autocomplete."})]})]})};var Wre=Object.defineProperty,qre=(t,e,r)=>e in t?Wre(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Cn=(t,e,r)=>qre(t,typeof e!="symbol"?e+"":e,r);const v1={x:0,y:0,width:0,height:0,unit:"px"},Qp=(t,e,r)=>Math.min(Math.max(t,e),r),Gre=(...t)=>t.filter(e=>e&&typeof e=="string").join(" "),m5=(t,e)=>t===e||t.width===e.width&&t.height===e.height&&t.x===e.x&&t.y===e.y&&t.unit===e.unit;function f5(t,e,r,n){const a=cu(t,r,n);return t.width&&(a.height=a.width/e),t.height&&(a.width=a.height*e),a.y+a.height>n&&(a.height=n-a.y,a.width=a.height*e),a.x+a.width>r&&(a.width=r-a.x,a.height=a.width/e),t.unit==="%"?wh(a,r,n):a}function p5(t,e,r){const n=cu(t,e,r);return n.x=(e-n.width)/2,n.y=(r-n.height)/2,t.unit==="%"?wh(n,e,r):n}function wh(t,e,r){return t.unit==="%"?{...v1,...t,unit:"%"}:{unit:"%",x:t.x?t.x/e*100:0,y:t.y?t.y/r*100:0,width:t.width?t.width/e*100:0,height:t.height?t.height/r*100:0}}function cu(t,e,r){return t.unit?t.unit==="px"?{...v1,...t,unit:"px"}:{unit:"px",x:t.x?t.x*e/100:0,y:t.y?t.y*r/100:0,width:t.width?t.width*e/100:0,height:t.height?t.height*r/100:0}:{...v1,...t,unit:"px"}}function g5(t,e,r,n,a,i=0,o=0,l=n,c=a){const u={...t};let d=Math.min(i,n),h=Math.min(o,a),f=Math.min(l,n),m=Math.min(c,a);e&&(e>1?(d=o?o*e:d,h=d/e,f=l*e):(h=i?i/e:h,d=h*e,m=c/e)),u.y<0&&(u.height=Math.max(u.height+u.y,h),u.y=0),u.x<0&&(u.width=Math.max(u.width+u.x,d),u.x=0);const g=n-(u.x+u.width);g<0&&(u.x=Math.min(u.x,n-d),u.width+=g);const y=a-(u.y+u.height);if(y<0&&(u.y=Math.min(u.y,a-h),u.height+=y),u.width<d&&((r==="sw"||r=="nw")&&(u.x-=d-u.width),u.width=d),u.height<h&&((r==="nw"||r=="ne")&&(u.y-=h-u.height),u.height=h),u.width>f&&((r==="sw"||r=="nw")&&(u.x-=f-u.width),u.width=f),u.height>m&&((r==="nw"||r=="ne")&&(u.y-=m-u.height),u.height=m),e){const b=u.width/u.height;if(b<e){const w=Math.max(u.width/e,h);
690(r==="nw"||r=="ne")&&(u.y-=w-u.height),u.height=w}else if(b>e){const w=Math.max(u.height*e,d);(r==="sw"||r=="nw")&&(u.x-=w-u.width),u.width=w}}return u}function Vre(t,e,r,n){const a={...t};return e==="ArrowLeft"?n==="nw"?(a.x-=r,a.y-=r,a.width+=r,a.height+=r):n==="w"?(a.x-=r,a.width+=r):n==="sw"?(a.x-=r,a.width+=r,a.height+=r):n==="ne"?(a.y+=r,a.width-=r,a.height-=r):n==="e"?a.width-=r:n==="se"&&(a.width-=r,a.height-=r):e==="ArrowRight"&&(n==="nw"?(a.x+=r,a.y+=r,a.width-=r,a.height-=r):n==="w"?(a.x+=r,a.width-=r):n==="sw"?(a.x+=r,a.width-=r,a.height-=r):n==="ne"?(a.y-=r,a.width+=r,a.height+=r):n==="e"?a.width+=r:n==="se"&&(a.width+=r,a.height+=r)),e==="ArrowUp"?n==="nw"?(a.x-=r,a.y-=r,a.width+=r,a.height+=r):n==="n"?(a.y-=r,a.height+=r):n==="ne"?(a.y-=r,a.width+=r,a.height+=r):n==="sw"?(a.x+=r,a.width-=r,a.height-=r):n==="s"?a.height-=r:n==="se"&&(a.width-=r,a.height-=r):e==="ArrowDown"&&(n==="nw"?(a.x+=r,a.y+=r,a.width-=r,a.height-=r):n==="n"?(a.y+=r,a.height-=r):n==="ne"?(a.y+=r,a.width-=r,a.height-=r):n==="sw"?(a.x-=r,a.width+=r,a.height+=r):n==="s"?a.height+=r:n==="se"&&(a.width+=r,a.height+=r)),a}const eg={capture:!0,passive:!1};let Kre=0;const yh=class _c extends x.PureComponent{constructor(){super(...arguments),Cn(this,"docMoveBound",!1),Cn(this,"mouseDownOnCrop",!1),Cn(this,"dragStarted",!1),Cn(this,"evData",{startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0}),Cn(this,"componentRef",x.createRef()),Cn(this,"mediaRef",x.createRef()),Cn(this,"resizeObserver"),Cn(this,"initChangeCalled",!1),Cn(this,"instanceId",`rc-${Kre++}`),Cn(this,"state",{cropIsActive:!1,newCropIsBeingDrawn:!1}),Cn(this,"onCropPointerDown",e=>{const{crop:r,disabled:n}=this.props,a=this.getBox();if(!r)return;const i=cu(r,a.width,a.height);if(n)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const o=e.target.dataset.ord,l=!!o;let c=e.clientX,u=e.clientY,d=i.x,h=i.y;if(o){const f=e.clientX-a.x,m=e.clientY-a.y;let g=0,y=0;o==="ne"||o=="e"?(g=f-(i.x+i.width),y=m-i.y,d=i.x,h=i.y+i.height):o==="se"||o==="s"?(g=f-(i.x+i.width),y=m-(i.y+i.height),d=i.x,h=i.y):o==="sw"||o=="w"?(g=f-i.x,y=m-(i.y+i.height),d=i.x+i.width,h=i.y):(o==="nw"||o=="n")&&(g=f-i.x,y=m-i.y,d=i.x+i.width,h=i.y+i.height),c=d+a.x+g,u=h+a.y+y}this.evData={startClientX:c,startClientY:u,startCropX:d,startCropY:h,clientX:e.clientX,clientY:e.clientY,isResize:l,ord:o},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})}),Cn(this,"onComponentPointerDown",e=>{const{crop:r,disabled:n,locked:a,keepSelection:i,onChange:o}=this.props,l=this.getBox();if(n||a||i&&r)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const c=e.clientX-l.x,u=e.clientY-l.y,d={unit:"px",x:c,y:u,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:c,startCropY:u,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,o(cu(d,l.width,l.height),wh(d,l.width,l.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})}),Cn(this,"onDocPointerMove",e=>{const{crop:r,disabled:n,onChange:a,onDragStart:i}=this.props,o=this.getBox();if(n||!r||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,i&&i(e));const{evData:l}=this;l.clientX=e.clientX,l.clientY=e.clientY;let c;l.isResize?c=this.resizeCrop():c=this.dragCrop(),m5(r,c)||a(cu(c,o.width,o.height),wh(c,o.width,o.height))}),Cn(this,"onComponentKeyDown",e=>{const{crop:r,disabled:n,onChange:a,onComplete:i}=this.props;if(n)return;const o=e.key;let l=!1;if(!r)return;const c=this.getBox(),u=this.makePixelCrop(c),d=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?_c.nudgeStepLarge:e.shiftKey?_c.nudgeStepMedium:_c.nudgeStep;if(o==="ArrowLeft"?(u.x-=d,l=!0):o==="ArrowRight"?(u.x+=d,l=!0):o==="ArrowUp"?(u.y-=d,l=!0):o==="ArrowDown"&&(u.y+=d,l=!0),l){e.cancelable&&e.preventDefault(),u.x=Qp(u.x,0,c.width-u.width),u.y=Qp(u.y,0,c.height-u.height);const h=cu(u,c.width,c.height),f=wh(u,c.width,c.height);a(h,f),i&&i(h,f)}}),Cn(this,"onHandlerKeyDown",(e,r)=>{const{aspect:n=0,crop:a,disabled:i,minWidth:o=0,minHeight:l=0,maxWidth:c,maxHeight:u,onChange:d,onComplete:h}=this.props,f=this.getBox();if(i||!a)return;if(e.key==="ArrowUp"||e.key==="ArrowDown"||e.key==="ArrowLeft"||e.key==="ArrowRight")e.stopPropagation(),e.preventDefault();else return;const m=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?_c.nudgeStepLarge:e.shiftKey?_c.nudgeStepMedium:_c.nudgeStep,g=cu(a,f.width,f.height),y=Vre(g,e.key,m,r),b=g5(y,n,r,f.width,f.height,o,l,c,u);if(!m5(a,b)){const w=wh(b,f.width,f.height);d(b,w),h&&h(b,w)}}),Cn(this,"onDocPointerDone",e=>{const{crop:r,disabled:n,onComplete:a,onDragEnd:i}=this.props,o=this.getBox();this.unbindDocMove(),!(n||!r)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,i&&i(e),a&&a(cu(r,o.width,o.height),wh(r,o.width,o.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))}),Cn(this,"onDragFocus",()=>{var e;(e=this.componentRef.current)==null||e.scrollTo(0,0)})}get document(){return document}getBox(){const e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};const{x:r,y:n,width:a,height:i}=e.getBoundingClientRect();return{x:r,y:n,width:a,height:i}}componentDidUpdate(e){const{crop:r,onComplete:n}=this.props;if(n&&!e.crop&&r){const{width:a,height:i}=this.getBox();a&&i&&n(cu(r,a,i),wh(r,a,i))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,eg),this.document.addEventListener("pointerup",this.onDocPointerDone,eg),this.document.addEventListener("pointercancel",this.onDocPointerDone,eg),this.docMoveBound=!0)}
690unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,eg),this.document.removeEventListener("pointerup",this.onDocPointerDone,eg),this.document.removeEventListener("pointercancel",this.onDocPointerDone,eg),this.docMoveBound=!1)}getCropStyle(){const{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){const{evData:e}=this,r=this.getBox(),n=this.makePixelCrop(r),a=e.clientX-e.startClientX,i=e.clientY-e.startClientY;return n.x=Qp(e.startCropX+a,0,r.width-n.width),n.y=Qp(e.startCropY+i,0,r.height-n.height),n}getPointRegion(e,r,n,a){const{evData:i}=this,o=i.clientX-e.x,l=i.clientY-e.y;let c;a&&r?c=r==="nw"||r==="n"||r==="ne":c=l<i.startCropY;let u;return n&&r?u=r==="nw"||r==="w"||r==="sw":u=o<i.startCropX,u?c?"nw":"sw":c?"ne":"se"}resolveMinDimensions(e,r,n=0,a=0){const i=Math.min(n,e.width),o=Math.min(a,e.height);return!r||!i&&!o?[i,o]:r>1?i?[i,i/r]:[o*r,o]:o?[o*r,o]:[i,i/r]}resizeCrop(){const{evData:e}=this,{aspect:r=0,maxWidth:n,maxHeight:a}=this.props,i=this.getBox(),[o,l]=this.resolveMinDimensions(i,r,this.props.minWidth,this.props.minHeight);let c=this.makePixelCrop(i);const u=this.getPointRegion(i,e.ord,o,l),d=e.ord||u;let h=e.clientX-e.startClientX,f=e.clientY-e.startClientY;(o&&d==="nw"||d==="w"||d==="sw")&&(h=Math.min(h,-o)),(l&&d==="nw"||d==="n"||d==="ne")&&(f=Math.min(f,-l));const m={unit:"px",x:0,y:0,width:0,height:0};u==="ne"?(m.x=e.startCropX,m.width=h,r?(m.height=m.width/r,m.y=e.startCropY-m.height):(m.height=Math.abs(f),m.y=e.startCropY-m.height)):u==="se"?(m.x=e.startCropX,m.y=e.startCropY,m.width=h,r?m.height=m.width/r:m.height=f):u==="sw"?(m.x=e.startCropX+h,m.y=e.startCropY,m.width=Math.abs(h),r?m.height=m.width/r:m.height=f):u==="nw"&&(m.x=e.startCropX+h,m.width=Math.abs(h),r?(m.height=m.width/r,m.y=e.startCropY-m.height):(m.height=Math.abs(f),m.y=e.startCropY+f));const g=g5(m,r,u,i.width,i.height,o,l,n,a);return r||_c.xyOrds.indexOf(d)>-1?c=g:_c.xOrds.indexOf(d)>-1?(c.x=g.x,c.width=g.width):_c.yOrds.indexOf(d)>-1&&(c.y=g.y,c.height=g.height),c.x=Qp(c.x,0,i.width-c.width),c.y=Qp(c.y,0,i.height-c.height),c}renderCropSelection(){const{ariaLabels:e=_c.defaultProps.ariaLabels,disabled:r,locked:n,renderSelectionAddon:a,ruleOfThirds:i,crop:o}=this.props,l=this.getCropStyle();if(o)return Oe.createElement("div",{style:l,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":e.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!r&&!n&&Oe.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},Oe.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),Oe.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),Oe.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),Oe.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),Oe.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":e.nwDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"nw"),role:"button"}),Oe.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":e.nDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"n"),role:"button"}),Oe.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":e.neDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"ne"),role:"button"}),Oe.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":e.eDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"e"),role:"button"}),Oe.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":e.seDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"se"),role:"button"}),Oe.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":e.sDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"s"),role:"button"}),Oe.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":e.swDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"sw"),role:"button"}),Oe.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":e.wDragHandle,onKeyDown:c=>this.onHandlerKeyDown(c,"w"),role:"button"})),a&&Oe.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:c=>c.stopPropagation()},a(this.state)),i&&Oe.createElement(Oe.Fragment,null,Oe.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),Oe.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){const r={...v1,...this.props.crop||{}};return cu(r,e.width,e.height)}render(){const{aspect:e,children:r,circularCrop:n,className:a,crop:i,disabled:o,locked:l,style:c,ruleOfThirds:u}=this.props,{cropIsActive:d,newCropIsBeingDrawn:h}=this.state,f=i?this.renderCropSelection():null,m=Gre("ReactCrop",a,d&&"ReactCrop--active",o&&"ReactCrop--disabled",l&&"ReactCrop--locked",h&&"ReactCrop--new-crop",i&&e&&"ReactCrop--fixed-aspect",i&&n&&"ReactCrop--circular-crop",i&&u&&"ReactCrop--rule-of-thirds",!this.dragStarted&&i&&!i.width&&!i.height&&"ReactCrop--invisible-crop",n&&"ReactCrop--no-animate");return Oe.createElement("div",{ref:this.componentRef,className:m,style:c},Oe.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},r),i?Oe.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},Oe.createElement("defs",null,Oe.createElement("mask",{id:`hole-${this.instanceId}`},Oe.createElement("rect",{width:"100%",height:"100%",fill:"white"}),n?Oe.createElement("ellipse",{cx:`${i.x+i.width/2}${i.unit}`,cy:`${i.y+i.height/2}${i.unit}`,rx:`${i.width/2}${i.unit}`,ry:`${i.height/2}${i.unit}`,fill:"black"}):Oe.createElement("rect",{x:`${i.x}${i.unit}`,y:`${i.y}${i.unit}`,width:`${i.width}${i.unit}`,height:`${i.height}${i.unit}`,fill:"black"}))),Oe.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,f)}};Cn(yh,"xOrds",["e","w"]),Cn(yh,"yOrds",["n","s"]),Cn(yh,"xyOrds",["nw","ne","se","sw"]),Cn(yh,"nudgeStep",1),Cn(yh,"nudgeStepMedium",10),Cn(yh,"nudgeStepLarge",100),Cn(yh,"defaultProps",{ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}});let Jre=yh;function a0(t,[e,r]){return Math.min(r,Math.max(e,t))}function Mx(t){const e=x.useRef({value:t,previous:t});return x.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var JR=["PageUp","PageDown"],YR=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],ZR={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Px="Slider",[RF,Yre,Zre]=op(Px),[XR]=li(Px,[Zre]),[Xre,Pw]=XR(Px),QR=x.forwardRef((t,e)=>{const{name:r,min:n=0,max:a=100,step:i=1,orientation:o="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[n],value:d,onValueChange:h=()=>{},onValueCommit:f=()=>{},inverted:m=!1,form:g,...y}
690=t,b=x.useRef(new Set),w=x.useRef(0),N=o==="horizontal"?Qre:ese,[S=[],E]=Lo({prop:d,defaultProp:u,onChange:M=>{var U;(U=[...b.current][w.current])==null||U.focus(),h(M)}}),C=x.useRef(S);function T(M){const P=ase(S,M);R(M,P)}function D(M){R(M,w.current)}function A(){const M=C.current[w.current];S[w.current]!==M&&f(S)}function R(M,P,{commit:U}={commit:!1}){const I=cse(i),O=use(Math.round((M-n)/i)*i+n,I),V=a0(O,[n,a]);E((G=[])=>{const B=sse(G,V,P);if(lse(B,c*i)){w.current=B.indexOf(V);const $=String(B)!==String(G);return $&&U&&f(B),$?B:G}else return G})}return s.jsx(Xre,{scope:t.__scopeSlider,name:r,disabled:l,min:n,max:a,valueIndexToChangeRef:w,thumbs:b.current,values:S,orientation:o,form:g,children:s.jsx(RF.Provider,{scope:t.__scopeSlider,children:s.jsx(RF.Slot,{scope:t.__scopeSlider,children:s.jsx(N,{"aria-disabled":l,"data-disabled":l?"":void 0,...y,ref:e,onPointerDown:gt(y.onPointerDown,()=>{l||(C.current=S)}),min:n,max:a,inverted:m,onSlideStart:l?void 0:T,onSlideMove:l?void 0:D,onSlideEnd:l?void 0:A,onHomeKeyDown:()=>!l&&R(n,0,{commit:!0}),onEndKeyDown:()=>!l&&R(a,S.length-1,{commit:!0}),onStepKeyDown:({event:M,direction:P})=>{if(!l){const O=JR.includes(M.key)||M.shiftKey&&YR.includes(M.key)?10:1,V=w.current,G=S[V],B=i*O*P;R(G+B,V,{commit:!0})}}})})})})});QR.displayName=Px;var[eB,tB]=XR(Px,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Qre=x.forwardRef((t,e)=>{const{min:r,max:n,dir:a,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:c,onStepKeyDown:u,...d}=t,[h,f]=x.useState(null),m=Cr(e,N=>f(N)),g=x.useRef(void 0),y=hm(a),b=y==="ltr",w=b&&!i||!b&&i;function j(N){const S=g.current||h.getBoundingClientRect(),E=[0,S.width],T=ik(E,w?[r,n]:[n,r]);return g.current=S,T(N-S.left)}return s.jsx(eB,{scope:t.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:s.jsx(rB,{dir:y,"data-orientation":"horizontal",...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:N=>{const S=j(N.clientX);o==null||o(S)},onSlideMove:N=>{const S=j(N.clientX);l==null||l(S)},onSlideEnd:()=>{g.current=void 0,c==null||c()},onStepKeyDown:N=>{const E=ZR[w?"from-left":"from-right"].includes(N.key);u==null||u({event:N,direction:E?-1:1})}})})}),ese=x.forwardRef((t,e)=>{const{min:r,max:n,inverted:a,onSlideStart:i,onSlideMove:o,onSlideEnd:l,onStepKeyDown:c,...u}=t,d=x.useRef(null),h=Cr(e,d),f=x.useRef(void 0),m=!a;function g(y){const b=f.current||d.current.getBoundingClientRect(),w=[0,b.height],N=ik(w,m?[n,r]:[r,n]);return f.current=b,N(y-b.top)}return s.jsx(eB,{scope:t.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:s.jsx(rB,{"data-orientation":"vertical",...u,ref:h,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:y=>{const b=g(y.clientY);i==null||i(b)},onSlideMove:y=>{const b=g(y.clientY);o==null||o(b)},onSlideEnd:()=>{f.current=void 0,l==null||l()},onStepKeyDown:y=>{const w=ZR[m?"from-bottom":"from-top"].includes(y.key);c==null||c({event:y,direction:w?-1:1})}})})}),rB=x.forwardRef((t,e)=>{const{__scopeSlider:r,onSlideStart:n,onSlideMove:a,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:l,onStepKeyDown:c,...u}=t,d=Pw(Px,r);return s.jsx(Zt.span,{...u,ref:e,onKeyDown:gt(t.onKeyDown,h=>{h.key==="Home"?(o(h),h.preventDefault()):h.key==="End"?(l(h),h.preventDefault()):JR.concat(YR).includes(h.key)&&(c(h),h.preventDefault())}),onPointerDown:gt(t.onPointerDown,h=>{const f=h.target;f.setPointerCapture(h.pointerId),h.preventDefault(),d.thumbs.has(f)?f.focus():n(h)}),onPointerMove:gt(t.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&a(h)}),onPointerUp:gt(t.onPointerUp,h=>{const f=h.target;f.hasPointerCapture(h.pointerId)&&(f.releasePointerCapture(h.pointerId),i(h))})})}),sB="SliderTrack",nB=x.forwardRef((t,e)=>{const{__scopeSlider:r,...n}=t,a=Pw(sB,r);return s.jsx(Zt.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...n,ref:e})});nB.displayName=sB;var BF="SliderRange",aB=x.forwardRef((t,e)=>{const{__scopeSlider:r,...n}=t,a=Pw(BF,r),i=tB(BF,r),o=x.useRef(null),l=Cr(e,o),c=a.values.length,u=a.values.map(f=>
690lB(f,a.min,a.max)),d=c>1?Math.min(...u):0,h=100-Math.max(...u);return s.jsx(Zt.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...n,ref:l,style:{...t.style,[i.startEdge]:d+"%",[i.endEdge]:h+"%"}})});aB.displayName=BF;var LF="SliderThumb",iB=x.forwardRef((t,e)=>{const r=Yre(t.__scopeSlider),[n,a]=x.useState(null),i=Cr(e,l=>a(l)),o=x.useMemo(()=>n?r().findIndex(l=>l.ref.current===n):-1,[r,n]);return s.jsx(tse,{...t,ref:i,index:o})}),tse=x.forwardRef((t,e)=>{const{__scopeSlider:r,index:n,name:a,...i}=t,o=Pw(LF,r),l=tB(LF,r),[c,u]=x.useState(null),d=Cr(e,j=>u(j)),h=c?o.form||!!c.closest("form"):!0,f=O0(c),m=o.values[n],g=m===void 0?0:lB(m,o.min,o.max),y=nse(n,o.values.length),b=f==null?void 0:f[l.size],w=b?ise(b,g,l.direction):0;return x.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),s.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${g}% + ${w}px)`},children:[s.jsx(RF.ItemSlot,{scope:t.__scopeSlider,children:s.jsx(Zt.span,{role:"slider","aria-label":t["aria-label"]||y,"aria-valuemin":o.min,"aria-valuenow":m,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...i,ref:d,style:m===void 0?{display:"none"}:t.style,onFocus:gt(t.onFocus,()=>{o.valueIndexToChangeRef.current=n})})}),h&&s.jsx(oB,{name:a??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:m},n)]})});iB.displayName=LF;var rse="RadioBubbleInput",oB=x.forwardRef(({__scopeSlider:t,value:e,...r},n)=>{const a=x.useRef(null),i=Cr(a,n),o=Mx(e);return x.useEffect(()=>{const l=a.current;if(!l)return;const c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==e&&d){const h=new Event("input",{bubbles:!0});d.call(l,e),l.dispatchEvent(h)}},[o,e]),s.jsx(Zt.input,{style:{display:"none"},...r,ref:i,defaultValue:e})});oB.displayName=rse;function sse(t=[],e,r){const n=[...t];return n[r]=e,n.sort((a,i)=>a-i)}function lB(t,e,r){const i=100/(r-e)*(t-e);return a0(i,[0,100])}function nse(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function ase(t,e){if(t.length===1)return 0;const r=t.map(a=>Math.abs(a-e)),n=Math.min(...r);return r.indexOf(n)}function ise(t,e,r){const n=t/2,i=ik([0,50],[0,n]);return(n-i(e)*r)*r}function ose(t){return t.slice(0,-1).map((e,r)=>t[r+1]-e)}function lse(t,e){if(e>0){const r=ose(t);return Math.min(...r)>=e}return!0}function ik(t,e){return r=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const n=(e[1]-e[0])/(t[1]-t[0]);return e[0]+n*(r-t[0])}}function cse(t){return(String(t).split(".")[1]||"").length}function use(t,e){const r=Math.pow(10,e);return Math.round(t*r)/r}var cB=QR,dse=nB,hse=aB,mse=iB;const IF=x.forwardRef(({className:t,...e},r)=>s.jsxs(cB,{ref:r,className:xt("relative flex w-full touch-none select-none items-center",t),...e,children:[s.jsx(dse,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:s.jsx(hse,{className:"absolute h-full bg-primary"})}),s.jsx(mse,{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"})]}));IF.displayName=cB.displayName;const i0=({isOpen:t,onClose:e,imageSrc:r,onCropComplete:n,aspectRatio:a=3,cropShape:i="rect",title:o="Crop Image"})=>{const l=x.useRef(null),c=x.useRef(null),[u,d]=x.useState(),[h,f]=x.useState(),[m,g]=x.useState(1),[y,b]=x.useState(0),w=x.useCallback(E=>{const{width:C,height:T}=E.currentTarget,D=p5(f5({unit:"%",width:90},a,C,T),C,T);d(D)},[a]),j=x.useCallback(async()=>{if(!h||!l.current||!c.current)return;const E=l.current,C=c.current,T=C.getContext("2d");if(!T)return;const D=E.naturalWidth/E.width,A=E.naturalHeight/E.height,R=window.devicePixelRatio;C.width=Math.floor(h.width*D*R),C.height=Math.floor(h.height*A*R),T.scale(R,R),T.imageSmoothingQuality="high";
690const M=h.x*D,P=h.y*A,U=E.naturalWidth/2,I=E.naturalHeight/2;return T.save(),T.translate(-M,-P),T.translate(U,I),T.rotate(y*Math.PI/180),T.scale(m,m),T.translate(-U,-I),T.drawImage(E,0,0,E.naturalWidth,E.naturalHeight,0,0,E.naturalWidth,E.naturalHeight),T.restore(),new Promise(O=>{C.toBlob(V=>{if(V){const G=URL.createObjectURL(V);O({blob:V,url:G})}},"image/jpeg",.9)})},[h,m,y]),N=async()=>{const E=await j();E&&(n(E.blob,E.url),e())},S=()=>{if(g(1),b(0),l.current){const{width:E,height:C}=l.current,T=p5(f5({unit:"%",width:90},a,E,C),E,C);d(T)}};return s.jsx(Tt,{open:t,onOpenChange:e,children:s.jsxs(Dt,{className:"max-w-4xl max-h-[90vh] overflow-hidden",children:[s.jsx(It,{children:s.jsx(Ot,{children:o})}),s.jsxs("div",{className:"flex flex-col space-y-4 overflow-hidden",children:[s.jsx("div",{className:"flex-1 overflow-auto max-h-[60vh] border rounded-lg",children:s.jsx(Jre,{crop:u,onChange:(E,C)=>d(C),onComplete:E=>f(E),aspect:a,circularCrop:i==="round",className:"max-w-full",children:s.jsx("img",{ref:l,alt:"Crop preview",src:r,style:{transform:`scale(${m}) rotate(${y}deg)`,maxWidth:"100%",height:"auto"},onLoad:w})})}),s.jsxs("div",{className:"space-y-4 p-4 bg-gray-50 rounded-lg",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Z,{className:"flex items-center gap-2",children:[s.jsx(sK,{className:"h-4 w-4"}),"Zoom: ",m.toFixed(1),"x"]}),s.jsx(IF,{value:[m],onValueChange:E=>g(E[0]),min:.5,max:3,step:.1,className:"w-full"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Z,{className:"flex items-center gap-2",children:[s.jsx(dE,{className:"h-4 w-4"}),"Rotation: ",y,"°"]}),s.jsx(IF,{value:[y],onValueChange:E=>b(E[0]),min:-180,max:180,step:1,className:"w-full"})]})]}),s.jsx("div",{className:"flex justify-center",children:s.jsxs(Y,{type:"button",variant:"outline",onClick:S,className:"flex items-center gap-2",children:[s.jsx(dE,{className:"h-4 w-4"}),"Reset"]})})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{type:"button",variant:"outline",onClick:e,children:"Cancel"}),s.jsx(Y,{type:"button",onClick:N,children:"Apply Crop"})]}),s.jsx("canvas",{ref:c,style:{display:"none"}})]})})},fse=["image/jpeg","image/jpg","image/png"],pse=2*1024*1024,ex=({open:t,onOpenChange:e,title:r,currentUrl:n="",currentFile:a=null,currentPreview:i="",onUrlSubmit:o,onFileSubmit:l,uploading:c=!1,aspectRatio:u="square",onCropComplete:d})=>{const{toast:h}=St(),[f,m]=x.useState("url"),[g,y]=x.useState(n),[b,w]=x.useState(!1),[j,N]=x.useState(n),[S,E]=x.useState(null),[C,T]=x.useState(""),[D,A]=x.useState(!1),[R,M]=x.useState(""),P=W=>{const oe=W.target.value;if(y(oe),oe)try{new URL(oe),N(oe)}catch{N("")}else N("")},U=W=>{if(!W.target.files||W.target.files.length===0)return;const oe=W.target.files[0];if(!fse.includes(oe.type)){h({title:"Invalid file type",description:"Please upload only JPG or PNG image files.",variant:"destructive"});return}if(oe.size>pse){h({title:"File too large",description:"Image must be less than 2MB.",variant:"destructive"});return}E(oe);const K=URL.createObjectURL(oe);T(K)},I=()=>{if(!S){h({title:"No file selected",description:"Please select a file to upload.",variant:"destructive"});return}l(S),e(!1)},O=(W,oe)=>{const K=new File([W],"cropped-image.jpg",{type:"image/jpeg"});E(K),T(oe),f==="url"&&(y(oe),N(oe)),d&&d(W,oe),A(!1),R&&(URL.revokeObjectURL(R),M(""))},V=()=>{if(!g){h({title:"No URL provided",description:"Please enter an image URL.",variant:"destructive"});return}try{new URL(g),o(g),e(!1)}catch{h({title:"Invalid URL",description:"Please enter a valid image URL.",variant:"destructive"})}},G=W=>{W.preventDefault(),W.stopPropagation(),w(!0)},B=W=>{W.preventDefault(),W.stopPropagation(),w(!1)},$=W=>{W.preventDefault(),W.stopPropagation(),w(!1),W.dataTransfer.files&&W.dataTransfer.files.length>0&&U({target:{files:W.dataTransfer.files}})};return x.useEffect(()=>{t&&(y(n),N(n),E(null),T(""))},[t,n]),s.jsxs(Tt,{open:t,onOpenChange:e,children:[s.jsxs(Dt,{className:"sm:max-w-[500px]",children:[s.jsx(It,{children:s.jsx(Ot,{children:r})}),s.jsxs(sn,{value:f,onValueChange:W=>m(W),className:"w-full",children:[s.jsxs(Qs,{className:"grid w-full grid-cols-2",children:[s.jsx(Gt,{value:"url",children:"Image URL"}),s.jsx(Gt,{value:"upload",children:"Upload Image"})]}),s.jsxs(Rt,{value:"url",className:"space-y-4 min-h-[30px] flex flex-col",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Ne,{placeholder:"https://example.com/image.jpg",value:g,onChange:P,disabled:c}),s.jsx("p",{className:"text-xs text-gray-500",children:"Enter a direct URL to your image"})]}),s.jsx("div",{className:"flex-1 flex items-center justify-center",children:j?s.jsxs("div",{className:`border rounded overflow-hidden relative ${u==="square"?"w-32 h-32":"w-full h-32 max-w-sm"}`,children:[s.jsx("img",{src:j,alt:"Preview",className:"w-full h-full object-cover",referrerPolicy:"no-referrer",onError:W=>{W.target.src="https://placehold.co/400x400?text=Image+Error"}}),d&&s.jsx("div",{className:"absolute top-2 right-2",children:s.jsx(Y,{type:"button",size:"sm",variant:"secondary",onClick:()=>{M(j),A(!0)},className:"flex items-center gap-1 bg-white/90 hover:bg-white",children:s.jsx(Jg,{className:"h-3 w-3"})})}),j.includes("placehold.co")&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/30 rounded",children:s.jsx(yd,{className:"h-4 w-4 text-yellow-400"})})]}):s.jsxs("div",{className:"text-center text-gray-400",children:[s.jsx(vi,{className:"h-16 w-16 mx-auto mb-2 opacity-50"}),s.jsx("p",{className:"text-sm",children:"Enter a URL to see preview"})]})}),s.jsx(Y,{onClick:V,disabled:!g||c,className:"w-full",children:c?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"}),"Processing..."]}):"Save URL"})]}),s.jsx(Rt,{value:"upload",className:"space-y-4 min-h-[30px] flex flex-col",children:S&&C?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsxs("div",{className:`border rounded overflow-hidden relative ${u==="square"?"w-32 h-32":"w-full h-32 max-w-sm"}`,children:[s.jsx("img",{src:C,alt:"File preview",className:"w-full h-full object-cover"}),d&&s.jsx("div",{className:"absolute top-2 right-2",children:s.jsx(Y,{type:"button",size:"sm",variant:"secondary",onClick:()=>{M(C),A(!0)},className:"flex items-center gap-1 bg-white/90 hover:bg-white",children:s.jsx(Jg,{className:"h-3 w-3"})})})]})}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("p",{className:"text-sm text-center text-gray-600",children:["Selected: ",S.name]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Y,{variant:"outline",onClick:()=>{E(null),T("")}
690,className:"flex-1",disabled:c,children:"Choose Different File"}),s.jsx(Y,{onClick:I,disabled:c,className:"flex-1",children:c?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save File"})]})]})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx("div",{className:`flex flex-col items-center justify-center border-2 border-dashed rounded-md p-8 w-full transition-colors ${b?"border-primary bg-primary/5":"border-gray-300 hover:border-gray-400"}`,onDragOver:G,onDragLeave:B,onDrop:$,children:c?s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx(Mt,{className:"h-12 w-12 text-primary animate-spin mb-4"}),s.jsx("p",{className:"text-sm text-gray-500",children:"Processing..."})]}):s.jsxs(s.Fragment,{children:[s.jsx(vn,{className:"h-12 w-12 text-gray-400 mb-4"}),s.jsx("p",{className:"text-sm text-gray-500 mb-4 text-center",children:"Drag & drop your image here or click to browse"}),s.jsxs("label",{className:"cursor-pointer bg-primary text-primary-foreground text-sm py-2 px-4 rounded hover:bg-primary/90 transition-colors",children:["Choose File",s.jsx("input",{type:"file",accept:"image/jpeg,image/jpg,image/png",onChange:U,className:"hidden",disabled:c})]}),s.jsx("p",{className:"text-xs text-gray-400 mt-2",children:"JPG or PNG, max 2MB"})]})})}),s.jsx("div",{className:"h-3"})]})})]})]}),d&&s.jsx(i0,{isOpen:D,onClose:()=>{A(!1),R&&(URL.revokeObjectURL(R),M(""))},imageSrc:R,onCropComplete:O,aspectRatio:u==="square"?1:3,title:`Crop ${r}`})]})},gse=({formData:t,handleChange:e,isLoading:r,logoFile:n=null,setLogoFile:a=()=>{},logoPreview:i="",setLogoPreview:o=()=>{},uploadingLogo:l=!1,coverImageFile:c=null,setCoverImageFile:u=()=>{},coverImagePreview:d="",setCoverImagePreview:h=()=>{},uploadingCoverImage:f=!1,galleryPreviews:m=[],handlePlaceSelect:g})=>{const[y,b]=Oe.useState(!1),[w,j]=Oe.useState(!1),[N,S]=Oe.useState(""),[E,C]=Oe.useState(""),[T,D]=Oe.useState(!1),[A,R]=Oe.useState(!1);Oe.useEffect(()=>{const G=t.logo_url;if(G&&!n)try{new URL(G),o(G)}catch{}},[t.logo_url,n,o]),Oe.useEffect(()=>{const G=t.cover_image_url;if(G&&!c)try{new URL(G),h(G)}catch{}},[t.cover_image_url,c,h]);const M=(G,B)=>{const $=new File([G],"cover-image.jpg",{type:"image/jpeg"});u($),h(B),b(!1),N&&(URL.revokeObjectURL(N),S(""))},P=(G,B)=>{const $=new File([G],"logo.jpg",{type:"image/jpeg"});a($),o(B),j(!1),E&&(URL.revokeObjectURL(E),C(""))},U=G=>{e({target:{name:"logo_url",value:G}}),o(G),n&&a(null)},I=G=>{a(G);const B=URL.createObjectURL(G);o(B),e({target:{name:"logo_url",value:""}})},O=G=>{e({target:{name:"cover_image_url",value:G}}),h(G),c&&u(null)},V=G=>{u(G);const B=URL.createObjectURL(G);h(B),e({target:{name:"cover_image_url",value:""}})};return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Z,{htmlFor:"businessName",children:["Business Name ",s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx("div",{className:"text-xs text-gray-500 mb-1",children:"Search for your business to auto-populate details, or type manually"}),s.jsx(Mw,{placeholder:"Start typing your business name or type manually...",value:t.businessName,onChange:G=>{e({target:{name:"businessName",value:G}})},onPlaceSelect:G=>{g&&g(G)},id:"businessName",name:"businessName",searchType:"business",required:!0,disabled:r})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Z,{htmlFor:"cover_image_url",children:"Cover Image"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"(recommended: 1200x400px)"})]}),s.jsx("p",{className:"text-xs text-gray-500",children:"Upload a full-width cover image for your business profile. You'll be able to crop and adjust it after upload."}),d||t.cover_image_url?s.jsxs("div",{className:"relative w-full h-32 border rounded-lg overflow-hidden",children:[s.jsx("img",{src:d||t.cover_image_url,alt:"Cover image preview",className:"w-full h-full object-cover",referrerPolicy:"no-referrer",onError:G=>{G.target.src="https://placehold.co/600x400?text=Image+Error"}}),s.jsxs("div",{className:"absolute top-2 right-2 flex gap-1",children:[s.jsx(Y,{type:"button",size:"sm",variant:"secondary",onClick:()=>{S(d||t.cover_image_url),b(!0)},className:"flex items-center gap-1 bg-white/90 hover:bg-white",children:s.jsx(Jg,{className:"h-3 w-3"})}),s.jsx(Y,{type:"button",size:"sm",variant:"secondary",onClick:()=>R(!0),className:"flex items-center gap-1 bg-white/90 hover:bg-white",children:s.jsx(bu,{className:"h-3 w-3"})}),s.jsx(Y,{type:"button",size:"sm",variant:"destructive",onClick:()=>{c?(u(null),h("")):(e({target:{name:"cover_image_url",value:""}}),h(""))},className:"flex items-center gap-1 bg-red-500/90 hover:bg-red-500",children:s.jsx(vr,{className:"h-3 w-3"})})]}),(d||t.cover_image_url).includes("placehold.co")&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/30",children:s.jsx("div",{className:"bg-yellow-500 text-white p-2 rounded",children:s.jsx("p",{className:"text-sm",children:"Image could not be loaded"})})})]}):s.jsxs("div",{className:"flex flex-col items-center justify-center border-2 border-dashed border-gray-300 rounded-lg p-8",children:[s.jsx(vi,{className:"h-12 w-12 text-gray-400 mb-4"}),s.jsx("p",{className:"text-sm text-gray-500 mb-4",children:"No cover image selected"}),s.jsxs(Y,{type:"button",variant:"outline",onClick:()=>R(!0),className:"flex items-center gap-2",children:[s.jsx(vn,{className:"h-4 w-4"}),"Add Cover Image"]})]}),(()=>{const B=[...t.gallery_urls||[],...m];return B.length>0&&s.jsxs("div",{className:"mt-4 space-y-2",children:[s.jsx("p",{className:"text-sm font-medium text-gray-700",children:"Qu
690ick select from gallery:"}),s.jsx("div",{className:"grid grid-cols-4 gap-2",children:B.slice(0,8).map(($,W)=>s.jsxs("button",{type:"button",className:`relative rounded-md overflow-hidden border-2 transition-all hover:border-chamber-blue/50 ${t.cover_image_url===$?"border-chamber-blue ring-2 ring-chamber-blue/20":"border-gray-300"}`,onClick:()=>{e({target:{name:"cover_image_url",value:$}}),h($)},children:[s.jsx("div",{className:"w-full h-16",children:s.jsx("img",{src:$,alt:`Gallery suggestion ${W+1}`,className:"w-full h-full object-cover",referrerPolicy:"no-referrer",onError:oe=>{oe.target.src="https://placehold.co/300x200?text=Image+Error"}})}),t.cover_image_url===$&&s.jsx("div",{className:"absolute inset-0 bg-chamber-blue/20 flex items-center justify-center",children:s.jsx("div",{className:"bg-chamber-blue text-white rounded-full p-1",children:s.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:s.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})})]},`gallery-suggestion-${W}`))}),B.length>8&&s.jsx("p",{className:"text-xs text-gray-500",children:"Showing first 8 gallery images. Add more to gallery to see more suggestions."})]})})()]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Z,{htmlFor:"logo_url",children:"Business Logo"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"(only .jpg or .png)"})]}),i||t.logo_url?s.jsx("div",{className:"flex justify-center",children:s.jsxs("div",{className:"relative w-56 h-56 border rounded-lg overflow-hidden",children:[s.jsx("img",{src:i||t.logo_url,alt:"Logo preview",className:"w-full h-full object-cover",referrerPolicy:"no-referrer",onError:G=>{G.target.src="https://placehold.co/400x400?text=Image+Error"}}),s.jsxs("div",{className:"absolute top-2 right-2 flex gap-1",children:[s.jsx(Y,{type:"button",size:"sm",variant:"secondary",onClick:()=>{C(i||t.logo_url),j(!0)},className:"flex items-center gap-1 bg-white/90 hover:bg-white",children:s.jsx(Jg,{className:"h-3 w-3"})}),s.jsx(Y,{type:"button",size:"sm",variant:"secondary",onClick:()=>D(!0),className:"flex items-center gap-1 bg-white/90 hover:bg-white",children:s.jsx(bu,{className:"h-3 w-3"})}),s.jsx(Y,{type:"button",size:"sm",variant:"destructive",onClick:()=>{n?(a(null),o("")):(e({target:{name:"logo_url",value:""}}),o(""))},className:"flex items-center gap-1 bg-red-500/90 hover:bg-red-500",children:s.jsx(vr,{className:"h-3 w-3"})})]}),(i||t.logo_url).includes("placehold.co")&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/30",children:s.jsx("div",{className:"bg-yellow-500 text-white p-2 rounded",children:s.jsx("p",{className:"text-sm",children:"Image could not be loaded"})})})]})}):s.jsx("div",{className:"flex justify-center",children:s.jsxs("div",{className:"flex flex-col items-center justify-center border-2 border-dashed border-gray-300 rounded-lg p-8 w-56 h-56",children:[s.jsx(ka,{className:"h-12 w-12 text-gray-400 mb-4"}),s.jsx("p",{className:"text-sm text-gray-500 mb-4 text-center",children:"No logo selected"}),s.jsxs(Y,{type:"button",variant:"outline",onClick:()=>D(!0),className:"flex items-center gap-2",children:[s.jsx(vn,{className:"h-4 w-4"}),"Add Logo"]})]})})]}),s.jsx(i0,{isOpen:y,onClose:()=>{b(!1),N&&(URL.revokeObjectURL(N),S(""))},imageSrc:N,onCropComplete:M,aspectRatio:3,title:"Crop Cover Image"}),s.jsx(i0,{isOpen:w,onClose:()=>{j(!1),E&&(URL.revokeObjectURL(E),C(""))},imageSrc:E,onCropComplete:P,aspectRatio:1,title:"Crop Logo"}),s.jsx(ex,{open:T,onOpenChange:D,title:"Edit Business Logo",currentUrl:t.logo_url,currentFile:n,currentPreview:i,onUrlSubmit:U,onFileSubmit:I,uploading:l,aspectRatio:"square",onCropComplete:P}),s.jsx(ex,{open:A,onOpenChange:R,title:"Edit Cover Image",currentUrl:t.cover_image_url,currentFile:c,currentPreview:d,onUrlSubmit:O,onFileSubmit:V,uploading:f,aspectRatio:"wide",onCropComplete:M})]})},zt=x.forwardRef(({className:t,...e},r)=>s.jsx("textarea",{className:xt("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
690ing-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",t),ref:r,...e}));zt.displayName="Textarea";var ok="Radio",[xse,uB]=li(ok),[yse,bse]=xse(ok),dB=x.forwardRef((t,e)=>{const{__scopeRadio:r,name:n,checked:a=!1,required:i,disabled:o,value:l="on",onCheck:c,form:u,...d}=t,[h,f]=x.useState(null),m=Cr(e,b=>f(b)),g=x.useRef(!1),y=h?u||!!h.closest("form"):!0;return s.jsxs(yse,{scope:r,checked:a,disabled:o,children:[s.jsx(Zt.button,{type:"button",role:"radio","aria-checked":a,"data-state":pB(a),"data-disabled":o?"":void 0,disabled:o,value:l,...d,ref:m,onClick:gt(t.onClick,b=>{a||c==null||c(),y&&(g.current=b.isPropagationStopped(),g.current||b.stopPropagation())})}),y&&s.jsx(fB,{control:h,bubbles:!g.current,name:n,value:l,checked:a,required:i,disabled:o,form:u,style:{transform:"translateX(-100%)"}})]})});dB.displayName=ok;var hB="RadioIndicator",mB=x.forwardRef((t,e)=>{const{__scopeRadio:r,forceMount:n,...a}=t,i=bse(hB,r);return s.jsx(fa,{present:n||i.checked,children:s.jsx(Zt.span,{"data-state":pB(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:e})})});mB.displayName=hB;var vse="RadioBubbleInput",fB=x.forwardRef(({__scopeRadio:t,control:e,checked:r,bubbles:n=!0,...a},i)=>{const o=x.useRef(null),l=Cr(o,i),c=Mx(r),u=O0(e);return x.useEffect(()=>{const d=o.current;if(!d)return;const h=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==r&&m){const g=new Event("click",{bubbles:n});m.call(d,r),d.dispatchEvent(g)}},[c,r,n]),s.jsx(Zt.input,{type:"radio","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:l,style:{...a.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});fB.displayName=vse;function pB(t){return t?"checked":"unchecked"}var wse=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Rw="RadioGroup",[jse]=li(Rw,[Tx,uB]),gB=Tx(),xB=uB(),[Nse,Fse]=jse(Rw),yB=x.forwardRef((t,e)=>{const{__scopeRadioGroup:r,name:n,defaultValue:a,value:i,required:o=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:h,...f}=t,m=gB(r),g=hm(u),[y,b]=Lo({prop:i,defaultProp:a??null,onChange:h,caller:Rw});return s.jsx(Nse,{scope:r,name:n,required:o,disabled:l,value:y,onValueChange:b,children:s.jsx(sk,{asChild:!0,...m,orientation:c,dir:g,loop:d,children:s.jsx(Zt.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":l?"":void 0,dir:g,...f,ref:e})})})});yB.displayName=Rw;var bB="RadioGroupItem",vB=x.forwardRef((t,e)=>{const{__scopeRadioGroup:r,disabled:n,...a}=t,i=Fse(bB,r),o=i.disabled||n,l=gB(r),c=xB(r),u=x.useRef(null),d=Cr(e,u),h=i.value===a.value,f=x.useRef(!1);return x.useEffect(()=>{const m=y=>{wse.includes(y.key)&&(f.current=!0)},g=()=>f.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",g),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",g)}},[]),s.jsx(nk,{asChild:!0,...l,focusable:!o,active:h,children:s.jsx(dB,{disabled:o,required:i.required,
690checked:h,...c,...a,name:i.name,ref:d,onCheck:()=>i.onValueChange(a.value),onKeyDown:gt(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:gt(a.onFocus,()=>{var m;f.current&&((m=u.current)==null||m.click())})})})});vB.displayName=bB;var Sse="RadioGroupIndicator",wB=x.forwardRef((t,e)=>{const{__scopeRadioGroup:r,...n}=t,a=xB(r);return s.jsx(mB,{...a,...n,ref:e})});wB.displayName=Sse;var jB=yB,NB=vB,Cse=wB;const lk=x.forwardRef(({className:t,...e},r)=>s.jsx(jB,{className:xt("grid gap-2",t),...e,ref:r}));lk.displayName=jB.displayName;const o0=x.forwardRef(({className:t,...e},r)=>s.jsx(NB,{ref:r,className:xt("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...e,children:s.jsx(Cse,{className:"flex items-center justify-center",children:s.jsx(QM,{className:"h-2.5 w-2.5 fill-current text-current"})})}));o0.displayName=NB.displayName;const kse=({formData:t,handleChange:e,handleBusinessTypeChange:r,handlePlaceSelect:n,isLoading:a})=>{var i;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx(Z,{className:"text-base font-medium",children:"Business Location Type"}),s.jsxs(lk,{value:t.business_type,onValueChange:o=>r==null?void 0:r(o),className:"space-y-3",disabled:a,children:[s.jsxs("div",{className:"flex items-center space-x-3 p-4 border rounded-lg",children:[s.jsx(o0,{value:"physical_location",id:"physical_location"}),s.jsxs(Z,{htmlFor:"physical_location",className:"flex items-center cursor-pointer flex-1",children:[s.jsx(ka,{className:"mr-3 h-5 w-5 text-blue-600"}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium",children:"Physical Business Location"}),s.jsx("div",{className:"text-sm text-gray-500",children:"Customers visit your business at a specific address"})]})]})]}),s.jsxs("div",{className:"flex items-center space-x-3 p-4 border rounded-lg",children:[s.jsx(o0,{value:"service_area",id:"service_area"}),s.jsxs(Z,{htmlFor:"service_area",className:"flex items-center cursor-pointer flex-1",children:[s.jsx(r6,{className:"mr-3 h-5 w-5 text-green-600"}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium",children:"Service Area Business"}),s.jsx("div",{className:"text-sm text-gray-500",children:"You provide services to customers in their locations"})]})]})]})]})]}),t.business_type==="physical_location"&&s.jsxs(s.Fragment,{children:[s.jsx(Mw,{label:"Business Address",placeholder:"Start typing your business address...",required:!0,disabled:a,value:t.addressLine1,onPlaceSelect:o=>{n&&n(o)},onChange:o=>{e({target:{name:"addressLine1",value:o}})},id:"addressLine1",name:"addressLine1",searchType:"address"}),s.jsx("div",{className:"text-xs text-gray-500 mt-2",children:"Can't find your address? You can also fill in the fields manually below."}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"addressLine1",children:"Street Address *"}),s.jsx(Ne,{id:"addressLine1",name:"addressLine1",value:t.addressLine1,onChange:e,placeholder:"123 Main Street",disabled:a,required:!0})]}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"city",children:"City *"}),s.jsx(Ne,{id:"city",name:"city",value:t.city,onChange:e,placeholder:"Valley Stream",disabled:a,required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"state",children:"State *"}),s.jsx(Ne,{id:"state",name:"state",value:t.state,onChange:e,placeholder:"NY",disabled:a,required:!0})]}),s.jsxs("div",{className:"space-y-2 md:col-span-2",children:[s.jsx(Z,{htmlFor:"zipCode",children:"Zip Code *"}),s.jsx(Ne,{id:"zipCode",name:"zipCode",value:t.zipCode,onChange:e,placeholder:"11580",disabled:a,maxLength:5,required:!0})]})]})]}),t.business_type==="service_area"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"service_area_description",children:"Service Area Description *"}),s.jsx(zt,{id:"service_area_description",name:"service_area_description",value:t.service_area_description,onChange:e,placeholder:"Describe the areas you serve (e.g., 'Serving all of Nassau County and western Suffolk County' or 'Within 25 miles of Valley Stream, NY')",disabled:a,className:"min-h-[100px]",maxLength:100,required:!0}),s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("p",{className:"text-gray-500",children:"Be specific about the cities, counties, or regions you serve to help customers find you."}),s.jsxs("span",{className:"text-gray-400",children:[((i=t.service_area_description)==null?void 0:i.length)||0,"/100 characters"]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"service_radius_miles",children:"Service Radius (Optional)"}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Ne,{id:"service_radius_miles",name:"service_radius_miles",type:"number",value:t.service_radius_miles||"",onChange:e,placeholder:"25",disabled:a,min:"1",max:"500",className:"w-24"}),s.jsx("span",{className:"text-sm text-gray-500",children:"miles from your base location"})]})]})]})]})},_se=({formData:t,handleChange:e,isLoading:r})=>s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Z,{htmlFor:"phone",children:["Business Phone ",s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx(Ne,{id:"phone",name:"phone",value:t.phone,onChange:e,placeholder:"(555) 123-4567",required:!0,disabled:r})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Z,{htmlFor:"businessEmail",children:["Business Email ",s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx(Ne,{id:"businessEmail",name:"businessEmail",type:"email",value:t.businessEmail,onChange:e,placeholder:"[email protected]",required:!0,disabled:r})]})]}),Ese=({value:t,onChange:e,isLoading:r})=>s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"website",children:"Website"}),s.jsx(Ne,{id:"website",name:"website",value:t,onChange:e,placeholder:"https://www.acmeinc.com",disabled:r})]}),Ase=({facebook:t,instagram:e,twitter:r,onChange:n,isLoading:a})=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"facebookUrl",children:"Facebook"}),s.jsx(Ne,{id:"facebookUrl",name:"facebookUrl",value:t,onChange:n,placeholder:"facebook.com/acmeinc",disabled:a})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"instagramUrl",children:"Instagram"}
690),s.jsx(Ne,{id:"instagramUrl",name:"instagramUrl",value:e,onChange:n,placeholder:"@acmeinc",disabled:a})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"twitterUrl",children:"Twitter"}),s.jsx(Ne,{id:"twitterUrl",name:"twitterUrl",value:r,onChange:n,placeholder:"@acmeinc",disabled:a})]})]}),Dse=({formData:t,handleChange:e,isLoading:r})=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[s.jsx(Ese,{value:t.website,onChange:e,isLoading:r}),s.jsx(Ase,{facebook:t.facebookUrl,instagram:t.instagramUrl,twitter:t.twitterUrl,onChange:e,isLoading:r})]})}),Tse=({formData:t,handleChange:e,isLoading:r})=>{var n;return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"shortDescription",children:"Short Description"}),s.jsx(zt,{id:"shortDescription",name:"shortDescription",value:t.shortDescription,onChange:e,placeholder:"Brief description of your business (max 150 characters)",rows:3,maxLength:150,disabled:r}),s.jsxs("div",{className:"text-sm text-muted-foreground",children:[((n=t.shortDescription)==null?void 0:n.length)||0,"/150 characters"]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"businessDescription",children:"Business Description"}),s.jsx(zt,{id:"businessDescription",name:"businessDescription",value:t.businessDescription,onChange:e,placeholder:"Detailed description of your business, products, services, and mission",rows:5,disabled:r})]})]})},FB=({value:t=[],onChange:e,placeholder:r="Add a tag...",maxTags:n=10,disabled:a=!1,className:i})=>{const[o,l]=x.useState(""),c=x.useRef(null),u=m=>{const g=m.trim();g&&!t.includes(g)&&t.length<n&&(e([...t,g]),l(""))},d=m=>{e(t.filter(g=>g!==m))},h=m=>{m.key==="Enter"||m.key===","?(m.preventDefault(),u(o)):m.key==="Backspace"&&!o&&t.length>0&&d(t[t.length-1])},f=()=>{o.trim()&&u(o)};return s.jsxs("div",{className:xt("space-y-2",i),children:[s.jsx("div",{className:"flex flex-wrap gap-2",children:t.map((m,g)=>s.jsxs(ke,{variant:"secondary",className:"flex items-center gap-1 px-2 py-1",children:[s.jsx(ji,{size:12}),s.jsx("span",{children:m}),!a&&s.jsx(Y,{type:"button",variant:"ghost",size:"sm",className:"h-auto p-0 hover:bg-transparent",onClick:()=>d(m),children:s.jsx(Ir,{size:12})})]},g))}),!a&&t.length<n&&s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ne,{ref:c,type:"text",value:o,onChange:m=>l(m.target.value),onKeyDown:h,onBlur:f,placeholder:r,className:"flex-1"}),s.jsx(Y,{type:"button",variant:"outline",size:"sm",onClick:()=>u(o),disabled:!o.trim(),children:"Add"})]}),t.length>=n&&s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Maximum ",n," tags allowed"]})]})},Mse=({formData:t,handleTagsChange:e,isLoading:r=!1})=>s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Business Tags"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Add tags to help customers find your business more easily. Use keywords that describe your products, services, or specialties."})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"tags",className:"block text-sm font-medium text-gray-700 mb-2",children:"Tags"}),s.jsx(FB,{value:t.tags||[],onChange:e,placeholder:"e.g., organic, delivery, 24/7, family-owned...",maxTags:10,disabled:r}),s.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:'Add up to 10 tags. Press Enter or comma to add a tag. Examples: "organic", "delivery", "24/7", "family-owned", "eco-friendly"'})]})]}),ck=()=>{const[t,e]=x.useState([]),[r,n]=x.useState(!0),[a,i]=x.useState(null);return x.useEffect(()=>{(async()=>{try{n(!0);const{data:l,error:c}=await Q.from("business_category").select("id, name, slug").order("name");if(c)throw c;e(l.map(u=>({id:u.id,name:u.name})))}catch(l){console.error("Error fetching categories:",l),i(l instanceof Error?l:new Error("Failed to fetch categories"))}finally{n(!1)}})()},[]),{categories:t,loading:r,error:a}};var V0=t=>t.type==="checkbox",bf=t=>t instanceof Date,Mo=t=>t==null;const SB=t=>typeof t=="object";var Ca=t=>!Mo(t)&&!Array.isArray(t)&&SB(t)&&!bf(t),CB=t=>Ca(t)&&t.target?V0(t.target)?t.target.checked:t.target.value:t,Pse=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,kB=(t,e)=>t.has(Pse(e)),Rse=t=>{const e=t.constructor&&t.constructor.prototype;return Ca(e)&&e.hasOwnProperty("isPrototypeOf")},uk=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function wa(t){if(t instanceof Date)return new Date(t);const e=typeof FileList<"u"&&t instanceof FileList;if(uk&&(t instanceof Blob||e))return t;const r=Array.isArray(t);if(!r&&!(Ca(t)&&Rse(t)))return t;const n=r?[]:Object.create(Object.getPrototypeOf(t));for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&(n[a]=wa(t[a]));return n}var Bw=t=>/^\w*$/.test(t),kn=t=>t===void 0,dk=t=>Array.isArray(t)?t.filter(Boolean):[],hk=t=>dk(t.replace(/["|']|\]/g,"").split(/\.|\[/)),Kt=(t,e,r)=>{if(!e||!Ca(t))return r;const n=(Bw(e)?[e]:hk(e)).reduce((a,i)=>
vendor: 4,707 bytes, line 690
690Mo(a)?a:a[i],t);return kn(n)||n===t?kn(t[e])?r:t[e]:n},il=t=>typeof t=="boolean",oo=t=>typeof t=="function",Ks=(t,e,r)=>{let n=-1;const a=Bw(e)?[e]:hk(e),i=a.length,o=i-1;for(;++n<i;){const l=a[n];let c=r;if(n!==o){const u=t[l];c=Ca(u)||Array.isArray(u)?u:isNaN(+a[n+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;t[l]=c,t=t[l]}};const w1={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Tc={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},td={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},mk=Oe.createContext(null);mk.displayName="HookFormControlContext";const fk=()=>Oe.useContext(mk);var _B=(t,e,r,n=!0)=>{const a={defaultValues:e._defaultValues};for(const i in t)Object.defineProperty(a,i,{get:()=>{const o=i;return e._proxyFormState[o]!==Tc.all&&(e._proxyFormState[o]=!n||Tc.all),r&&(r[o]=!0),t[o]}});return a};const pk=typeof window<"u"?Oe.useLayoutEffect:Oe.useEffect;function Bse(t){const e=fk(),{control:r=e,disabled:n,name:a,exact:i}=t||{},[o,l]=Oe.useState(r._formState),c=Oe.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return pk(()=>r._subscribe({name:a,formState:c.current,exact:i,callback:u=>{!n&&l({...r._formState,...u})}}),[a,n,i]),Oe.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),Oe.useMemo(()=>_B(o,r,c.current,!1),[o,r])}var ll=t=>typeof t=="string",OF=(t,e,r,n,a)=>ll(t)?(n&&e.watch.add(t),Kt(r,t,a)):Array.isArray(t)?t.map(i=>(n&&e.watch.add(i),Kt(r,i))):(n&&(e.watchAll=!0),r),zF=t=>Mo(t)||!SB(t);function Mc(t,e,r=new WeakSet){if(zF(t)||zF(e))return Object.is(t,e);if(bf(t)&&bf(e))return Object.is(t.getTime(),e.getTime());const n=Object.keys(t),a=Object.keys(e);if(n.length!==a.length)return!1;if(r.has(t)||r.has(e))return!0;r.add(t),r.add(e);for(const i of n){const o=t[i];if(!a.includes(i))return!1;if(i!=="ref"){const l=e[i];if(bf(o)&&bf(l)||Ca(o)&&Ca(l)||Array.isArray(o)&&Array.isArray(l)?!Mc(o,l,r):!Object.is(o,l))return!1}}return!0}function Lse(t){const e=fk(),{control:r=e,name:n,defaultValue:a,disabled:i,exact:o,compute:l}=t||{},c=Oe.useRef(a),u=Oe.useRef(l),d=Oe.useRef(void 0),h=Oe.useRef(r),f=Oe.useRef(n);u.current=l;const[m,g]=Oe.useState(()=>{const S=r._getWatch(n,c.current);return u.current?u.current(S):S}),y=Oe.useCallback(S=>{const E=OF(n,r._names,S||r._formValues,!1,c.current);return u.current?u.current(E):E},[r._formValues,r._names,n]),b=Oe.useCallback(S=>{if(!i){const E=OF(n,r._names,S||r._formValues,!1,c.current);if(u.current){const C=u.current(E);Mc(C,d.current)||(g(C),d.current=C)}else g(E)}},[r._formValues,r._names,i,n]);pk(()=>((h.current!==r||!Mc(f.current,n))&&(h.current=r,f.current=n,b()),r._subscribe({name:n,formState:{values:!0},exact:o,callback:S=>{b(S.values)}})),[r,o,n,b]),Oe.useEffect(()=>r._removeUnmounted());const w=h.current!==r,j=f.current,N=Oe.useMemo(()=>{if(i)return null;const S=!w&&!Mc(j,n);return w||S?y():null},[i,w,n,j,y]);return N!==null?N:m}function Ise(t){const e=fk(),{name:r,disabled:n,control:a=e,shouldUnregister:i,defaultValue:o,exact:l=!0}=t,c=kB(a._names.array,r),u=Oe.useMemo(()=>Kt(a._formValues,r,Kt(a._defaultValues,r,o)),[a,r,o]),d=Lse({control:a,name:r,defaultValue:u,exact:l}),h=Bse({control:a,name:r,exact:l}),f=Oe.useRef(t),m=Oe.useRef(void 0),g=Oe.useRef(a.register(r,{...t.rules,value:d,...il(t.disabled)?{disabled:t.disabled}:{}}));f.current=t;const y=Oe.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Kt(h.errors,r)},isDirty:{enumerable:!0,get:()=>!!Kt(h.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!Kt(h.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!Kt(h.validatingFields,r)},error:{enumerable:!0,get:()=>Kt(h.errors,r)}}),[h,r]),b=Oe.useCallback(S=>g.current.onChange({target:{value:CB(S),name:r},type:w1.CHANGE}),[r]),w=Oe.useCallback(()=>g.current.onBlur({target:{value:Kt(a._formValues,r),name:r},type:w1.BLUR}),[r,a._formValues]),j=Oe.useCallback(S=>{const E=Kt(a._fields,r);E&&E._f&&S&&(E._f.ref={focus:()=>oo(S.focus)&&S.focus(),select:()=>oo(S.select)&&S.select(),setCustomValidity:C=>oo(S.setCustomValidity)&&S.setCustomValidity(C),reportValidity:()=>oo(S.reportValidity)&&S.reportValidity()})},[a._fields,r]),N=Oe.useMemo(()=>({name:r,value:d,...il(n)||h.disabled?{disabled:h.disabled||n}:{},onChange:b,onBlur:w,ref:j}),[r,n,h.disabled,b,w,j,d]);return Oe.useEffect(()=>{const S=a._options.shouldUnregister||i,E=m.current;E&&E!==r&&!c&&a.unregister(E),a.register(r,{...f.current.rules,...il(f.current.disabled)?{disabled:f.current.disabled}:{}});const C=(T,D)=>{const A=Kt(a._fields,T);A&&A._f&&(A._f.mount=D)};
vendor: 4,349 bytes, line 690
690if(C(r,!0),S){const T=wa(Kt(a._options.defaultValues,r,f.current.defaultValue));Ks(a._defaultValues,r,T),kn(Kt(a._formValues,r))&&Ks(a._formValues,r,T)}return!c&&a.register(r),m.current=r,()=>{(c?S&&!a._state.action:S)?a.unregister(r):C(r,!1)}},[r,a,c,i]),Oe.useEffect(()=>{a._setDisabledField({disabled:n,name:r})},[n,r,a]),Oe.useMemo(()=>({field:N,formState:h,fieldState:y}),[N,h,y])}const Ose=t=>t.render(Ise(t)),gk=Oe.createContext(null);gk.displayName="HookFormContext";const zse=()=>Oe.useContext(gk),EB=t=>{const{children:e,watch:r,getValues:n,getFieldState:a,setError:i,clearErrors:o,setValue:l,trigger:c,formState:u,resetField:d,reset:h,handleSubmit:f,unregister:m,control:g,register:y,setFocus:b,subscribe:w}=t;return Oe.createElement(gk.Provider,{value:Oe.useMemo(()=>({watch:r,getValues:n,getFieldState:a,setError:i,clearErrors:o,setValue:l,trigger:c,formState:u,resetField:d,reset:h,handleSubmit:f,unregister:m,control:g,register:y,setFocus:b,subscribe:w}),[o,g,u,a,n,f,y,h,d,i,b,l,w,c,m,r])},Oe.createElement(mk.Provider,{value:g},e))};var xk=(t,e,r,n,a)=>e?{...r[t],types:{...r[t]&&r[t].types?r[t].types:{},[n]:a||!0}}:{},Ry=t=>Array.isArray(t)?t:[t],x5=()=>{let t=[];return{get observers(){return t},next:a=>{for(const i of t)i.next&&i.next(a)},subscribe:a=>(t.push(a),{unsubscribe:()=>{t=t.filter(i=>i!==a)}}),unsubscribe:()=>{t=[]}}};function AB(t,e){const r={};for(const n in t)if(t.hasOwnProperty(n)){const a=t[n],i=e[n];if(a&&Ca(a)&&i){const o=AB(a,i);Ca(o)&&(r[n]=o)}else t[n]&&(r[n]=i)}return r}var no=t=>Ca(t)&&!Object.keys(t).length,yk=t=>t.type==="file",j1=t=>{if(!uk)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},DB=t=>t.type==="select-multiple",bk=t=>t.type==="radio",Use=t=>bk(t)||V0(t),P2=t=>j1(t)&&t.isConnected;function Hse(t,e){const r=e.slice(0,-1).length;let n=0;for(;n<r;)t=kn(t)?n++:t[e[n++]];return t}function $se(t){for(const e in t)if(t.hasOwnProperty(e)&&!kn(t[e]))return!1;return!0}function ja(t,e){const r=Array.isArray(e)?e:Bw(e)?[e]:hk(e),n=r.length===1?t:Hse(t,r),a=r.length-1,i=r[a];return n&&delete n[i],a!==0&&(Ca(n)&&no(n)||Array.isArray(n)&&$se(n))&&ja(t,r.slice(0,-1)),t}var Wse=t=>{for(const e in t)if(oo(t[e]))return!0;return!1};function TB(t){return Array.isArray(t)||Ca(t)&&!Wse(t)}function UF(t,e={}){for(const r in t){const n=t[r];TB(n)?(e[r]=Array.isArray(n)?[]:{},UF(n,e[r])):kn(n)||(e[r]=!0)}return e}function lg(t,e,r){r||(r=UF(e));for(const n in t){const a=t[n];if(TB(a))kn(e)||zF(r[n])?r[n]=UF(a,Array.isArray(a)?[]:{}):lg(a,Mo(e)?{}:e[n],r[n]);else{const i=e[n];r[n]=!Mc(a,i)}}return r}const y5={value:!1,isValid:!1},b5={value:!0,isValid:!0};var MB=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!kn(t[0].attributes.value)?kn(t[0].value)||t[0].value===""?b5:{value:t[0].value,isValid:!0}:b5:y5}return y5},PB=(t,{valueAsNumber:e,valueAsDate:r,setValueAs:n})=>kn(t)?t:e?t===""?NaN:t&&+t:r&&ll(t)?new Date(t):n?n(t):t;const v5={isValid:!1,value:null};var RB=t=>Array.isArray(t)?t.reduce((e,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:e,v5):v5;function w5(t){const e=t.ref;return yk(e)?e.files:bk(e)?RB(t.refs).value:DB(e)?[...e.selectedOptions].map(({value:r})=>r):V0(e)?MB(t.refs).value:PB(kn(e.value)?t.ref.value:e.value,t)}var qse=(t,e,r,n)=>{const a={};for(const i of t){const o=Kt(e,i);o&&Ks(a,i,o._f)}return{criteriaMode:r,names:[...t],fields:a,shouldUseNativeValidation:n}},N1=t=>t instanceof RegExp,my=t=>kn(t)?t:N1(t)?t.source:Ca(t)?N1(t.value)?t.value.source:t.value:t,j5=t=>({isOnSubmit:!t||t===Tc.onSubmit,isOnBlur:t===Tc.onBlur,isOnChange:t===Tc.onChange,isOnAll:t===Tc.all,isOnTouch:t===Tc.onTouched});const N5="AsyncFunction";var Gse=t=>!!t&&!!t.validate&&!!(oo(t.validate)&&t.validate.constructor.name===N5||Ca(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===N5)),Vse=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),F5=(t,e,r)=>!r&&(e.watchAll||e.watch.has(t)||[...e.watch].some(n=>t.startsWith(n)&&/^\.\w+/.test(t.slice(n.length))));const By=(t,e,r,n)=>{for(const a of r||Object.keys(t)){const i=Kt(t,a);if(i){const{_f:o,...l}=i;if(o){if(o.refs&&o.refs[0]&&e(o.refs[0],a)&&!n)return!0;
vendor: 4,162 bytes, line 690
690if(o.ref&&e(o.ref,o.name)&&!n)return!0;if(By(l,e))break}else if(Ca(l)&&By(l,e))break}}};function S5(t,e,r){const n=Kt(t,r);if(n||Bw(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const i=a.join("."),o=Kt(e,i),l=Kt(t,i);if(o&&!Array.isArray(o)&&r!==i)return{name:r};if(l&&l.type)return{name:i,error:l};if(l&&l.root&&l.root.type)return{name:`${i}.root`,error:l.root};a.pop()}return{name:r}}var Kse=(t,e,r,n)=>{r(t);const{name:a,...i}=t;return no(i)||Object.keys(i).length>=Object.keys(e).length||Object.keys(i).find(o=>e[o]===(!n||Tc.all))},Jse=(t,e,r)=>!t||!e||t===e||Ry(t).some(n=>n&&(r?n===e:n.startsWith(e)||e.startsWith(n))),Yse=(t,e,r,n,a)=>a.isOnAll?!1:!r&&a.isOnTouch?!(e||t):(r?n.isOnBlur:a.isOnBlur)?!t:(r?n.isOnChange:a.isOnChange)?t:!0,Zse=(t,e)=>!dk(Kt(t,e)).length&&ja(t,e),Xse=(t,e,r)=>{const n=Ry(Kt(t,r));return Ks(n,"root",e[r]),Ks(t,r,n),t};function C5(t,e,r="validate"){if(ll(t)||Array.isArray(t)&&t.every(ll)||il(t)&&!t)return{type:r,message:ll(t)?t:"",ref:e}}var tg=t=>Ca(t)&&!N1(t)?t:{value:t,message:""},k5=async(t,e,r,n,a,i)=>{const{ref:o,refs:l,required:c,maxLength:u,minLength:d,min:h,max:f,pattern:m,validate:g,name:y,valueAsNumber:b,mount:w}=t._f,j=Kt(r,y);if(!w||e.has(y))return{};const N=l?l[0]:o,S=P=>{a&&N.reportValidity&&(N.setCustomValidity(il(P)?"":P||""),N.reportValidity())},E={},C=bk(o),T=V0(o),D=C||T,A=(b||yk(o))&&kn(o.value)&&kn(j)||j1(o)&&o.value===""||j===""||Array.isArray(j)&&!j.length,R=xk.bind(null,y,n,E),M=(P,U,I,O=td.maxLength,V=td.minLength)=>{const G=P?U:I;E[y]={type:P?O:V,message:G,ref:o,...R(P?O:V,G)}};if(i?!Array.isArray(j)||!j.length:c&&(!D&&(A||Mo(j))||il(j)&&!j||T&&!MB(l).isValid||C&&!RB(l).isValid)){const{value:P,message:U}=ll(c)?{value:!!c,message:c}:tg(c);if(P&&(E[y]={type:td.required,message:U,ref:N,...R(td.required,U)},!n))return S(U),E}if(!A&&(!Mo(h)||!Mo(f))){let P,U;const I=tg(f),O=tg(h);if(!Mo(j)&&!isNaN(j)){const V=o.valueAsNumber||j&&+j;Mo(I.value)||(P=V>I.value),Mo(O.value)||(U=V<O.value)}else{const V=o.valueAsDate||new Date(j),G=W=>new Date(new Date().toDateString()+" "+W),B=o.type=="time",$=o.type=="week";ll(I.value)&&j&&(P=B?G(j)>G(I.value):$?j>I.value:V>new Date(I.value)),ll(O.value)&&j&&(U=B?G(j)<G(O.value):$?j<O.value:V<new Date(O.value))}if((P||U)&&(M(!!P,I.message,O.message,td.max,td.min),!n))return S(E[y].message),E}if((u||d)&&!A&&(ll(j)||i&&Array.isArray(j))){const P=tg(u),U=tg(d),I=!Mo(P.value)&&j.length>+P.value,O=!Mo(U.value)&&j.length<+U.value;if((I||O)&&(M(I,P.message,U.message),!n))return S(E[y].message),E}if(m&&!A&&ll(j)){const{value:P,message:U}=tg(m);if(N1(P)&&!j.match(P)&&(E[y]={type:td.pattern,message:U,ref:o,...R(td.pattern,U)},!n))return S(U),E}if(g){if(oo(g)){const P=await g(j,r),U=C5(P,N);if(U&&(E[y]={...U,...R(td.validate,U.message)},!n))return S(U.message),E}else if(Ca(g)){let P={};for(const U in g){if(!no(P)&&!n)break;const I=C5(await g[U](j,r),N,U);I&&(P={...I,...R(U,I.message)},S(I.message),n&&(E[y]=P))}if(!no(P)&&(E[y]={ref:N,...P},!n))return E}}return S(!0),E};const Qse={mode:Tc.onSubmit,reValidateMode:Tc.onChange,shouldFocusError:!0};function ene(t={}){let e={...Qse,...t},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:oo(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},n={},a=Ca(e.defaultValues)||Ca(e.values)?wa(e.defaultValues||e.values)||{}:{},i=e.shouldUnregister?{}:wa(a),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},h={...d};let f={...h};const m={array:x5(),state:x5()},g=e.criteriaMode===Tc.all,y=ce=>fe=>{clearTimeout(u),u=setTimeout(ce,fe)},b=async ce=>{if(!o.keepIsValid&&!e.disabled&&(h.isValid||f.isValid||ce)){let fe;e.resolver?(fe=no((await D()).errors),w()):fe=await R(n,!0),fe!==r.isValid&&m.state.next({isValid:fe})}},w=(ce,fe)=>{!e.disabled&&(h.isValidating||h.validatingFields||f.isValidating||f.validatingFields)&&((ce||Array.from(l.mount)).forEac
vendor: 8,623 bytes, line 690
690h(ge=>{ge&&(fe?Ks(r.validatingFields,ge,fe):ja(r.validatingFields,ge))}),m.state.next({validatingFields:r.validatingFields,isValidating:!no(r.validatingFields)}))},j=(ce,fe=[],ge,Ge,Je=!0,be=!0)=>{if(Ge&&ge&&!e.disabled){if(o.action=!0,be&&Array.isArray(Kt(n,ce))){const Pe=ge(Kt(n,ce),Ge.argA,Ge.argB);Je&&Ks(n,ce,Pe)}if(be&&Array.isArray(Kt(r.errors,ce))){const Pe=ge(Kt(r.errors,ce),Ge.argA,Ge.argB);Je&&Ks(r.errors,ce,Pe),Zse(r.errors,ce)}if((h.touchedFields||f.touchedFields)&&be&&Array.isArray(Kt(r.touchedFields,ce))){const Pe=ge(Kt(r.touchedFields,ce),Ge.argA,Ge.argB);Je&&Ks(r.touchedFields,ce,Pe)}(h.dirtyFields||f.dirtyFields)&&(r.dirtyFields=lg(a,i)),m.state.next({name:ce,isDirty:P(ce,fe),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Ks(i,ce,fe)},N=(ce,fe)=>{Ks(r.errors,ce,fe),m.state.next({errors:r.errors})},S=ce=>{r.errors=ce,m.state.next({errors:r.errors,isValid:!1})},E=(ce,fe,ge,Ge)=>{const Je=Kt(n,ce);if(Je){const be=Kt(i,ce,kn(ge)?Kt(a,ce):ge);kn(be)||Ge&&Ge.defaultChecked||fe?Ks(i,ce,fe?be:w5(Je._f)):O(ce,be),o.mount&&!o.action&&b()}},C=(ce,fe,ge,Ge,Je)=>{let be=!1,Pe=!1;const qe={name:ce};if(!e.disabled){if(!ge||Ge){(h.isDirty||f.isDirty)&&(Pe=r.isDirty,r.isDirty=qe.isDirty=P(),be=Pe!==qe.isDirty);const Qe=Mc(Kt(a,ce),fe);Pe=!!Kt(r.dirtyFields,ce),Qe?ja(r.dirtyFields,ce):Ks(r.dirtyFields,ce,!0),qe.dirtyFields=r.dirtyFields,be=be||(h.dirtyFields||f.dirtyFields)&&Pe!==!Qe}if(ge){const Qe=Kt(r.touchedFields,ce);Qe||(Ks(r.touchedFields,ce,ge),qe.touchedFields=r.touchedFields,be=be||(h.touchedFields||f.touchedFields)&&Qe!==ge)}be&&Je&&m.state.next(qe)}return be?qe:{}},T=(ce,fe,ge,Ge)=>{const Je=Kt(r.errors,ce),be=(h.isValid||f.isValid)&&il(fe)&&r.isValid!==fe;if(e.delayError&&ge?(c=y(()=>N(ce,ge)),c(e.delayError)):(clearTimeout(u),c=null,ge?Ks(r.errors,ce,ge):ja(r.errors,ce)),(ge?!Mc(Je,ge):Je)||!no(Ge)||be){const Pe={...Ge,...be&&il(fe)?{isValid:fe}:{},errors:r.errors,name:ce};r={...r,...Pe},m.state.next(Pe)}},D=async ce=>(w(ce,!0),await e.resolver(i,e.context,qse(ce||l.mount,n,e.criteriaMode,e.shouldUseNativeValidation))),A=async ce=>{const{errors:fe}=await D(ce);if(w(ce),ce)for(const ge of ce){const Ge=Kt(fe,ge);Ge?Ks(r.errors,ge,Ge):ja(r.errors,ge)}else r.errors=fe;return fe},R=async(ce,fe,ge={valid:!0})=>{for(const Ge in ce){const Je=ce[Ge];if(Je){const{_f:be,...Pe}=Je;if(be){const qe=l.array.has(be.name),Qe=Je._f&&Gse(Je._f);Qe&&h.validatingFields&&w([be.name],!0);const We=await k5(Je,l.disabled,i,g,e.shouldUseNativeValidation&&!fe,qe);if(Qe&&h.validatingFields&&w([be.name]),We[be.name]&&(ge.valid=!1,fe||t.shouldUseNativeValidation))break;!fe&&(Kt(We,be.name)?qe?Xse(r.errors,We,be.name):Ks(r.errors,be.name,We[be.name]):ja(r.errors,be.name))}!no(Pe)&&await R(Pe,fe,ge)}}return ge.valid},M=()=>{for(const ce of l.unMount){const fe=Kt(n,ce);fe&&(fe._f.refs?fe._f.refs.every(ge=>!P2(ge)):!P2(fe._f.ref))&&he(ce)}l.unMount=new Set},P=(ce,fe)=>!e.disabled&&(ce&&fe&&Ks(i,ce,fe),!Mc(oe(),a)),U=(ce,fe,ge)=>OF(ce,l,{...o.mount?i:kn(fe)?a:ll(ce)?{[ce]:fe}:fe},ge,fe),I=ce=>dk(Kt(o.mount?i:a,ce,e.shouldUnregister?Kt(a,ce,[]):[])),O=(ce,fe,ge={})=>{const Ge=Kt(n,ce);let Je=fe;if(Ge){const be=Ge._f;be&&(!be.disabled&&Ks(i,ce,PB(fe,be)),Je=j1(be.ref)&&Mo(fe)?"":fe,DB(be.ref)?[...be.ref.options].forEach(Pe=>Pe.selected=Je.includes(Pe.value)):be.refs?V0(be.ref)?be.refs.forEach(Pe=>{(!Pe.defaultChecked||!Pe.disabled)&&(Array.isArray(Je)?Pe.checked=!!Je.find(qe=>qe===Pe.value):Pe.checked=Je===Pe.value||!!Je)}):be.refs.forEach(Pe=>Pe.checked=Pe.value===Je):yk(be.ref)?be.ref.value="":(be.ref.value=Je,be.ref.type||m.state.next({name:ce,values:wa(i)})))}(ge.shouldDirty||ge.shouldTouch)&&C(ce,Je,ge.shouldTouch,ge.shouldDirty,!0),ge.shouldValidate&&W(ce)},V=(ce,fe,ge)=>{for(const Ge in fe){if(!fe.hasOwnProperty(Ge))return;const Je=fe[Ge],be=ce+"."+Ge,Pe=Kt(n,be);(l.array.has(ce)||Ca(Je)||Pe&&!Pe._f)&&!bf(Je)?V(be,Je,ge):O(be,Je,ge)}},G=(ce,fe,ge={})=>{const Ge=Kt(n,ce),Je=l.array.has(ce),be=wa(fe);Ks(i,ce,be),Je?(m.array.next({name:ce,values:wa(i)}),(h.isDirty||h.dirtyFields||f.isDirty||f.dirtyFields)&&ge.shouldDirty&&m.state.next({name:ce,dirtyFields:lg(a,i),isDirty:P(ce,be)})):Ge&&!Ge._f&&!Mo(be)?V(ce,be,ge):O(ce,be,ge),F5(ce,l)?m.state.next({...r,name:ce,values:wa(i)}):m.state.next({name:o.mount?ce:void 0,values:wa(i)})},B=async ce=>{o.mount=!0;const fe=ce.target;let ge=fe.name,Ge=!0;const Je=Kt(n,ge),be=Qe=>{Ge=Number.isNaN(Qe)||bf(Qe)&&isNaN(Qe.getTime())||Mc(Qe,Kt(i,ge,Qe))},Pe=j5(e.mode),qe=j5(e.reValidateMode);if(Je){let Qe,We;const dt=fe.type?w5(Je._f):CB(ce),Bt=ce.type===w1.BLUR||ce.type===w1.FOCUS_OUT,Lt=!Vse(Je._f)&&!e.resolver&&!Kt(r.errors,ge)&&!Je._f.deps||Yse(Bt,Kt(r.touchedFields,ge),r.isSubmitted,qe,Pe),Vt=F5(ge,l,Bt);Ks(i,ge,dt),Bt?(!fe||!fe.readOnly)&&(Je._f.onBlur&&Je._f.onBlur(ce),c&&c(0)):Je._f.onChange&&Je._f.onChange(ce);const cr=C(ge,dt,Bt),wr=!no(cr)||Vt;if(!Bt&&m.state.next({name:ge,type:ce.type,values:wa(i)}),Lt)return(h.isValid||f.isValid)&&(e.mode==="onBlur"?Bt&&b():Bt||b()),wr&&m.state.next({name:ge,...Vt?{}:cr});if(!Bt&&Vt&&m.state.next({...r}),e.resolver){const{errors:Xt}=await D([ge]);if(w([ge]),be(dt),Ge){const pt=S5(r.errors,n,ge),ir=S5(Xt,n,pt.name||ge);Qe=ir.error,ge=ir.name,We=no(Xt)}}else w([ge],!0),Qe=(await k5(Je,l.disabled,i,g,e.shouldUseNativeValidation))[ge],w([ge]),be(dt),Ge&&(Qe?We=!1:(h.isValid||f.isValid)&&(We=await R(n,!0)));Ge&&(Je._f.deps&&(!Array.isArray(Je._f.deps)||Je._f.deps.length>0)&&W(Je._f.deps),T(ge,We,Qe,cr))}},$=(ce,fe)=>{if(Kt(r.errors,fe)&&ce.focus)return ce.focus(),1},W=async(ce,fe={})=>{let ge,Ge;const Je=Ry(ce);if(e.resolver){const be=await A(kn(ce)?ce:Je);ge=no(be),Ge=ce?!Je.some(Pe=>Kt(be,Pe)):ge}else ce?(Ge=(await Promise.all(Je.map(async be=>{const Pe=Kt(n,be);return await R(Pe&&Pe._f?{[be]:Pe}:Pe)}))).every(Boolean),!(!Ge&&!r.isValid)&&b()):Ge=ge=await R(n);return m.state.next({...!ll(ce)||(h.isValid||f.isValid)&&ge!==r.isValid?{}:{name:ce},...e.resolver||!ce?{isValid:ge}:{},errors:r.errors}),fe.shouldFocus&&!Ge&&By(n,$,ce?Je:l.mount),Ge},oe=(ce,fe)=>{let ge={...o.mount?i:a};return fe&&(ge=AB(fe.dirtyFields?r.dirtyFields:r.touchedFields,ge)),kn(ce)?ge:ll(ce)?Kt(ge,ce):ce.map(Ge=>Kt(ge,Ge))},K=(ce,fe)=>({invalid:!!Kt((fe||r).errors,ce),isDirty:!!Kt((fe||r).dirtyFields,ce),error:Kt((fe||r).errors,ce),isValidating:!!Kt(r.validatingFields,ce),isTouched:!!Kt((fe||r).touchedFields,ce)}),H=ce=>{const fe=ce?Ry(ce):void 0;fe==null||fe.forEach(ge=>ja(r.errors,ge)),fe?fe.forEach(ge=>{m.state.next({name:ge,errors:r.errors})}):m.state.next({errors:{}})},X=(ce,fe,ge)=>{const Ge=(Kt(n,ce,{_f:{}})._f||{}).ref,Je=Kt(r.errors,ce)||{},{ref:be,message:Pe,type:qe,...Qe}=Je;Ks(r.errors,ce,{...Qe,...fe,ref:Ge}),m.state.next({name:ce,errors:r.errors,isValid:!1}),ge&&ge.shouldFocus&&Ge&&Ge.focus&&Ge.focus()},me=(ce,fe)=>oo(ce)?m.state.subscribe({next:ge=>"values"in ge&&ce(U(void 0,fe),ge)}):U(ce,fe,!0),ie=ce=>m.state.subscribe({next:fe=>{Jse(ce.name,fe.name,ce.exact)&&Kse(fe,ce.formState||h,tt,ce.reRenderRoot)&&ce.callback({values:{...i},...r,...fe,defaultValues:a})}}).unsubscribe,ee=ce=>(o.mount=!0,f={...f,...ce.formState},ie({...ce,formState:{...d,...ce.formState}})),he=(ce,fe={})=>{for(const ge of ce?Ry(ce):l.mount)l.mount.delete(ge),l.array.delete(ge),fe.keepValue||(ja(n,ge),ja(i,ge)),!fe.keepError&&ja(r.errors,ge),!fe.keepDirty&&ja(r.dirtyFields,ge),!fe.keepTouched&&ja(r.touchedFields,ge),!fe.keepIsValidating&&ja(r.validatingFields,ge),!e.shouldUnregister&&!fe.keepDefaultValue&&ja(a,ge);m.state.next({values:wa(i)}),m.state.next({...r,...fe.keepDirty?{isDirty:P()}:{}}),!fe.keepIsValid&&b()},ve=({disabled:ce,name:fe})=>{if(il(ce)&&o.mount||ce||l.disabled.has(fe)){const Je=l.disabled.has(fe)!==!!ce;ce?l.disabled.add(fe):l.disabled.delete(fe),Je&&o.mount&&!o.action&&b()}},Ce=(ce,fe={})=>{let ge=Kt(n,ce);const Ge=il(fe.disabled)||il(e.disabled);return Ks(n,ce,{...ge||{},_f:{...ge&&ge._f?ge._f:{ref:{name:ce}},name:ce,mount:!0,...fe}}),l.mount.add(ce),ge?ve({disabled:il(fe.disabled)?fe.disabled:e.disabled,name:ce}):E(ce,!0,fe.value),{...Ge?{disabled:fe.disabled||e.disabled}:{},...e.progressive?{required:!!fe.required,min:my(fe.min),max:my(fe.max),minLength:my(fe.minLength),maxLength:my(fe.maxLength),pattern:my(fe.pattern)}:{},name:ce,onChange:B,onBlur:B,ref:Je=>{if(Je){Ce(ce,fe),ge=Kt(n,ce);const be=kn(Je.value)&&Je.querySelectorAll&&Je.querySelectorAll("input,select,textarea")[0]||Je,Pe=Use(be),qe=ge._f.refs||[];if(Pe?qe.find(Qe=>Qe===be):be===ge._f.ref)return;Ks(n,ce,{_f:{...ge._f,...Pe?{refs:[...qe.filter(P2),be,...Array.isArray(Kt(a,ce))?[{}]:[]],ref:{type:be.type,name:ce}}:{ref:be}}}),E(ce,!1,void 0,be)}
vendor: 4,767 bytes, line 690
690else ge=Kt(n,ce,{}),ge._f&&(ge._f.mount=!1),(e.shouldUnregister||fe.shouldUnregister)&&!(kB(l.array,ce)&&o.action)&&l.unMount.add(ce)}}},re=()=>e.shouldFocusError&&By(n,$,l.mount),we=ce=>{il(ce)&&(m.state.next({disabled:ce}),By(n,(fe,ge)=>{const Ge=Kt(n,ge);Ge&&(fe.disabled=Ge._f.disabled||ce,Array.isArray(Ge._f.refs)&&Ge._f.refs.forEach(Je=>{Je.disabled=Ge._f.disabled||ce}))},0,!1))},Ee=(ce,fe)=>async ge=>{let Ge;ge&&(ge.preventDefault&&ge.preventDefault(),ge.persist&&ge.persist());let Je=wa(i);if(m.state.next({isSubmitting:!0}),e.resolver){const{errors:be,values:Pe}=await D();w(),r.errors=be,Je=wa(Pe)}else await R(n);if(l.disabled.size)for(const be of l.disabled)ja(Je,be);if(ja(r.errors,"root"),no(r.errors)){m.state.next({errors:{}});try{await ce(Je,ge)}catch(be){Ge=be}}else fe&&await fe({...r.errors},ge),re(),setTimeout(re);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:no(r.errors)&&!Ge,submitCount:r.submitCount+1,errors:r.errors}),Ge)throw Ge},Me=(ce,fe={})=>{Kt(n,ce)&&(kn(fe.defaultValue)?G(ce,wa(Kt(a,ce))):(G(ce,fe.defaultValue),Ks(a,ce,wa(fe.defaultValue))),fe.keepTouched||ja(r.touchedFields,ce),fe.keepDirty||(ja(r.dirtyFields,ce),r.isDirty=fe.defaultValue?P(ce,wa(Kt(a,ce))):P()),fe.keepError||(ja(r.errors,ce),h.isValid&&b()),m.state.next({...r}))},ae=(ce,fe={})=>{const ge=ce?wa(ce):a,Ge=wa(ge),Je=no(ce),be=Je?a:Ge;if(fe.keepDefaultValues||(a=ge),!fe.keepValues){if(fe.keepDirtyValues){const Pe=new Set([...l.mount,...Object.keys(lg(a,i))]);for(const qe of Array.from(Pe)){const Qe=Kt(r.dirtyFields,qe),We=Kt(i,qe),dt=Kt(be,qe);Qe&&!kn(We)?Ks(be,qe,We):!Qe&&!kn(dt)&&G(qe,dt)}}else{if(uk&&kn(ce))for(const Pe of l.mount){const qe=Kt(n,Pe);if(qe&&qe._f){const Qe=Array.isArray(qe._f.refs)?qe._f.refs[0]:qe._f.ref;if(j1(Qe)){const We=Qe.closest("form");if(We){We.reset();break}}}}if(fe.keepFieldsRef)for(const Pe of l.mount)G(Pe,Kt(be,Pe));else n={}}i=e.shouldUnregister?fe.keepDefaultValues?wa(a):{}:wa(be),m.array.next({values:{...be}}),m.state.next({values:{...be}})}l={mount:fe.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!h.isValid||!!fe.keepIsValid||!!fe.keepDirtyValues||!e.shouldUnregister&&!no(be),o.watch=!!e.shouldUnregister,o.keepIsValid=!!fe.keepIsValid,o.action=!1,fe.keepErrors||(r.errors={}),m.state.next({submitCount:fe.keepSubmitCount?r.submitCount:0,isDirty:Je?!1:fe.keepDirty?r.isDirty:!!(fe.keepDefaultValues&&!Mc(ce,a)),isSubmitted:fe.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:Je?{}:fe.keepDirtyValues?fe.keepDefaultValues&&i?lg(a,i):r.dirtyFields:fe.keepDefaultValues&&ce?lg(a,ce):fe.keepDirty?r.dirtyFields:{},touchedFields:fe.keepTouched?r.touchedFields:{},errors:fe.keepErrors?r.errors:{},isSubmitSuccessful:fe.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:a})},ze=(ce,fe)=>ae(oo(ce)?ce(i):ce,{...e.resetOptions,...fe}),mt=(ce,fe={})=>{const ge=Kt(n,ce),Ge=ge&&ge._f;if(Ge){const Je=Ge.refs?Ge.refs[0]:Ge.ref;Je.focus&&setTimeout(()=>{Je.focus(),fe.shouldSelect&&oo(Je.select)&&Je.select()})}},tt=ce=>{r={...r,...ce}},Ft={control:{register:Ce,unregister:he,getFieldState:K,handleSubmit:Ee,setError:X,_subscribe:ie,_runSchema:D,_updateIsValidating:w,_focusError:re,_getWatch:U,_getDirty:P,_setValid:b,_setFieldArray:j,_setDisabledField:ve,_setErrors:S,_getFieldArray:I,_reset:ae,_resetDefaultValues:()=>oo(e.defaultValues)&&e.defaultValues().then(ce=>{ze(ce,e.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:M,_disableForm:we,_subjects:m,_proxyFormState:h,get _fields(){return n},get _formValues(){return i},get _state(){return o},set _state(ce){o=ce},get _defaultValues(){return a},get _names(){return l},set _names(ce){l=ce},get _formState(){return r},get _options(){return e},set _options(ce){e={...e,...ce}}},subscribe:ee,trigger:W,register:Ce,handleSubmit:Ee,watch:me,setValue:G,getValues:oe,reset:ze,resetField:Me,clearErrors:H,unregister:he,setError:X,setFocus:mt,getFieldState:K};return{...Ft,formControl:Ft}}function K0(t={}){const e=Oe.useRef(void 0),r=Oe.useRef(void 0),[n,a]=Oe.useState({isDirty:!1,isValidating:!1,isLoading:oo(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,isReady:!1,defaultValues:oo(t.defaultValues)?void 0:t.defaultValues});if(!e.current)if(t.formControl)e.current={...t.formControl,formState:n},t.defaultValues&&!oo(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{const{formControl:o,...l}=ene(t);e.current={...l,formState:n}}const i=e.current.control;return i._options=t,pk(()=>{const o=i._subscribe({formState:i._proxyFormState,callback:()=>a({...i._formState}
690),reRenderRoot:!0});return a(l=>({...l,isReady:!0})),i._formState.isReady=!0,o},[i]),Oe.useEffect(()=>i._disableForm(t.disabled),[i,t.disabled]),Oe.useEffect(()=>{t.mode&&(i._options.mode=t.mode),t.reValidateMode&&(i._options.reValidateMode=t.reValidateMode)},[i,t.mode,t.reValidateMode]),Oe.useEffect(()=>{t.errors&&(i._setErrors(t.errors),i._focusError())},[i,t.errors]),Oe.useEffect(()=>{t.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,t.shouldUnregister]),Oe.useEffect(()=>{if(i._proxyFormState.isDirty){const o=i._getDirty();o!==n.isDirty&&i._subjects.state.next({isDirty:o})}},[i,n.isDirty]),Oe.useEffect(()=>{var o;t.values&&!Mc(t.values,r.current)?(i._reset(t.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((o=i._options.resetOptions)===null||o===void 0)&&o.keepIsValid||i._setValid(),r.current=t.values,a(l=>({...l}))):i._resetDefaultValues()},[i,t.values]),Oe.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),e.current.formState=Oe.useMemo(()=>_B(n,i),[i,n]),e.current}const BB=EB,LB=x.createContext({}),aa=({...t})=>s.jsx(LB.Provider,{value:{name:t.name},children:s.jsx(Ose,{...t})}),Lw=()=>{const t=x.useContext(LB),e=x.useContext(IB),{getFieldState:r,formState:n}=zse(),a=r(t.name,n);if(!t)throw new Error("useFormField should be used within <FormField>");const{id:i}=e;return{id:i,name:t.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...a}},IB=x.createContext({}),Vn=x.forwardRef(({className:t,...e},r)=>{const n=x.useId();return s.jsx(IB.Provider,{value:{id:n},children:s.jsx("div",{ref:r,className:xt("space-y-2",t),...e})})});Vn.displayName="FormItem";const Bn=x.forwardRef(({className:t,...e},r)=>{const{error:n,formItemId:a}=Lw();return s.jsx(Z,{ref:r,className:xt(n&&"text-destructive",t),htmlFor:a,...e})});Bn.displayName="FormLabel";const Qa=x.forwardRef(({...t},e)=>{const{error:r,formItemId:n,formDescriptionId:a,formMessageId:i}=Lw();return s.jsx(NP,{ref:e,id:n,"aria-describedby":r?`${a} ${i}`:`${a}`,"aria-invalid":!!r,...t})});Qa.displayName="FormControl";const zh=x.forwardRef(({className:t,...e},r)=>{const{formDescriptionId:n}=Lw();return s.jsx("p",{ref:r,id:n,className:xt("text-sm text-muted-foreground",t),...e})});zh.displayName="FormDescription";const Ln=x.forwardRef(({className:t,children:e,...r},n)=>{const{error:a,formMessageId:i}=Lw(),o=a?String(a==null?void 0:a.message):e;return o?s.jsx("p",{ref:n,id:i,className:xt("text-sm font-medium text-destructive",t),...r,children:o}):null});Ln.displayName="FormMessage";var tne=[" ","Enter","ArrowUp","ArrowDown"],rne=[" ","Enter"],Vf="Select",[Iw,Ow,sne]=op(Vf),[Rx]=li(Vf,[sne,Sx]),zw=Sx(),[nne,mm]=Rx(Vf),[ane,ine]=Rx(Vf),OB=t=>{const{__scopeSelect:e,children:r,open:n,defaultOpen:a,onOpenChange:i,value:o,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:h,disabled:f,required:m,form:g}=t,y=zw(e),[b,w]=x.useState(null),[j,N]=x.useState(null),[S,E]=x.useState(!1),C=hm(u),[T,D]=Lo({prop:n,defaultProp:a??!1,onChange:i,caller:Vf}),[A,R]=Lo({prop:o,defaultProp:l,onChange:c,caller:Vf}),M=x.useRef(null),P=b?g||!!b.closest("form"):!0,[U,I]=x.useState(new Set),O=Array.from(U).map(V=>V.props.value).join(";");return s.jsx(AC,{...y,children:s.jsxs(nne,{required:m,scope:e,trigger:b,onTriggerChange:w,valueNode:j,onValueNodeChange:N,valueNodeHasChildren:S,onValueNodeHasChildrenChange:E,contentId:hl(),value:A,onValueChange:R,open:T,onOpenChange:D,dir:C,triggerPointerDownPosRef:M,disabled:f,children:[s.jsx(Iw.Provider,{scope:e,children:s.jsx(ane,{scope:t.__scopeSelect,onNativeOptionAdd:x.useCallback(V=>{I(G=>new Set(G).add(V))},[]),onNativeOptionRemove:x.useCallback(V=>{I(G=>{const B=new Set(G);return B.delete(V),B})},[]),children:r})}),P?s.jsxs(cL,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:h,value:A,onChange:V=>R(V.target.value),disabled:f,form:g,children:[A===void 0?s.jsx("option",{value:""}):null,Array.from(U)]},O):null]})})};OB.displayName=Vf;var zB="SelectTrigger",UB=x.forwardRef((t,e)=>{const{__scopeSelect:r,disabled:n=!1,...a}=t,i=zw(r),o=mm(zB,r),l=o.disabled||n,c=Cr(e,o.onTriggerChange),u=Ow(r),d=x.useRef("touch"),[h,f,m]=dL(y=>{const b=u().filter(N=>!N.disabled),w=b.find(N=>N.value===o.value),j=hL(b,y,w);j!==void 0&&o.onValueChange(j.value)}),g=y=>{l||(o.onOpenChange(!0),m()),y&&(o.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return s.jsx(DC,{asChild:!0,...i,children:s.jsx(Zt.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":uL(o.value)?"":void 0,...a,ref:c,onClick:gt(a.onClick,y=>
vendor: 16,018 bytes, line 690
690{y.currentTarget.focus(),d.current!=="mouse"&&g(y)}),onPointerDown:gt(a.onPointerDown,y=>{d.current=y.pointerType;const b=y.target;b.hasPointerCapture(y.pointerId)&&b.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(g(y),y.preventDefault())}),onKeyDown:gt(a.onKeyDown,y=>{const b=h.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&f(y.key),!(b&&y.key===" ")&&tne.includes(y.key)&&(g(),y.preventDefault())})})})});UB.displayName=zB;var HB="SelectValue",$B=x.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:a,children:i,placeholder:o="",...l}=t,c=mm(HB,r),{onValueNodeHasChildrenChange:u}=c,d=i!==void 0,h=Cr(e,c.onValueNodeChange);return En(()=>{u(d)},[u,d]),s.jsx(Zt.span,{...l,ref:h,style:{pointerEvents:"none"},children:uL(c.value)?s.jsx(s.Fragment,{children:o}):i})});$B.displayName=HB;var one="SelectIcon",WB=x.forwardRef((t,e)=>{const{__scopeSelect:r,children:n,...a}=t;return s.jsx(Zt.span,{"aria-hidden":!0,...a,ref:e,children:n||"â¼"})});WB.displayName=one;var lne="SelectPortal",qB=t=>s.jsx(B0,{asChild:!0,...t});qB.displayName=lne;var Kf="SelectContent",GB=x.forwardRef((t,e)=>{const r=mm(Kf,t.__scopeSelect),[n,a]=x.useState();if(En(()=>{a(new DocumentFragment)},[]),!r.open){const i=n;return i?bx.createPortal(s.jsx(VB,{scope:t.__scopeSelect,children:s.jsx(Iw.Slot,{scope:t.__scopeSelect,children:s.jsx("div",{children:t.children})})}),i):null}return s.jsx(KB,{...t,ref:e})});GB.displayName=Kf;var Ec=10,[VB,fm]=Rx(Kf),cne="SelectContentImpl",une=Vg("SelectContent.RemoveScroll"),KB=x.forwardRef((t,e)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:o,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:g,hideWhenDetached:y,avoidCollisions:b,...w}=t,j=mm(Kf,r),[N,S]=x.useState(null),[E,C]=x.useState(null),T=Cr(e,ee=>S(ee)),[D,A]=x.useState(null),[R,M]=x.useState(null),P=Ow(r),[U,I]=x.useState(!1),O=x.useRef(!1);x.useEffect(()=>{if(N)return YC(N)},[N]),JC();const V=x.useCallback(ee=>{const[he,...ve]=P().map(we=>we.ref.current),[Ce]=ve.slice(-1),re=document.activeElement;for(const we of ee)if(we===re||(we==null||we.scrollIntoView({block:"nearest"}),we===he&&E&&(E.scrollTop=0),we===Ce&&E&&(E.scrollTop=E.scrollHeight),we==null||we.focus(),document.activeElement!==re))return},[P,E]),G=x.useCallback(()=>V([D,N]),[V,D,N]);x.useEffect(()=>{U&&G()},[U,G]);const{onOpenChange:B,triggerPointerDownPosRef:$}=j;x.useEffect(()=>{if(N){let ee={x:0,y:0};const he=Ce=>{var re,we;ee={x:Math.abs(Math.round(Ce.pageX)-(((re=$.current)==null?void 0:re.x)??0)),y:Math.abs(Math.round(Ce.pageY)-(((we=$.current)==null?void 0:we.y)??0))}},ve=Ce=>{ee.x<=10&&ee.y<=10?Ce.preventDefault():N.contains(Ce.target)||B(!1),document.removeEventListener("pointermove",he),$.current=null};return $.current!==null&&(document.addEventListener("pointermove",he),document.addEventListener("pointerup",ve,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",he),document.removeEventListener("pointerup",ve,{capture:!0})}}},[N,B,$]),x.useEffect(()=>{const ee=()=>B(!1);return window.addEventListener("blur",ee),window.addEventListener("resize",ee),()=>{window.removeEventListener("blur",ee),window.removeEventListener("resize",ee)}},[B]);const[W,oe]=dL(ee=>{const he=P().filter(re=>!re.disabled),ve=he.find(re=>re.ref.current===document.activeElement),Ce=hL(he,ee,ve);Ce&&setTimeout(()=>Ce.ref.current.focus())}),K=x.useCallback((ee,he,ve)=>{const Ce=!O.current&&!ve;(j.value!==void 0&&j.value===he||Ce)&&(A(ee),Ce&&(O.current=!0))},[j.value]),H=x.useCallback(()=>N==null?void 0:N.focus(),[N]),X=x.useCallback((ee,he,ve)=>{const Ce=!O.current&&!ve;(j.value!==void 0&&j.value===he||Ce)&&M(ee)},[j.value]),me=n==="popper"?HF:JB,ie=me===HF?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:g,hideWhenDetached:y,avoidCollisions:b}:{};return s.jsx(VB,{scope:r,content:N,viewport:E,onViewportChange:C,itemRefCallback:K,selectedItem:D,onItemLeave:H,itemTextRefCallback:X,focusSelectedItem:G,selectedItemText:R,position:n,isPositioned:U,searchRef:W,children:s.jsx(_w,{as:une,allowPinchZoom:!0,children:s.jsx(Cw,{asChild:!0,trapped:j.open,onMountAutoFocus:ee=>{ee.preventDefault()},onUnmountAutoFocus:gt(a,ee=>{var he;(he=j.trigger)==null||he.focus({preventScroll:!0}),ee.preventDefault()}),children:s.jsx(lp,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:ee=>ee.preventDefault(),onDismiss:()=>j.onOpenChange(!1),children:s.jsx(me,{role:"listbox",id:j.contentId,"data-state":j.open?"open":"closed",dir:j.dir,onContextMenu:ee=>ee.preventDefault(),...w,...ie,onPlaced:()=>I(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...w.style},onKeyDown:gt(w.onKeyDown,ee=>{const he=ee.ctrlKey||ee.altKey||ee.metaKey;if(ee.key==="Tab"&&ee.preventDefault(),!he&&ee.key.length===1&&oe(ee.key),["ArrowUp","ArrowDown","Home","End"].includes(ee.key)){let Ce=P().filter(re=>!re.disabled).map(re=>re.ref.current);if(["ArrowUp","End"].includes(ee.key)&&(Ce=Ce.slice().reverse()),["ArrowUp","ArrowDown"].includes(ee.key)){const re=ee.target,we=Ce.indexOf(re);Ce=Ce.slice(we+1)}setTimeout(()=>V(Ce)),ee.preventDefault()}})})})})})})});KB.displayName=cne;var dne="SelectItemAlignedPosition",JB=x.forwardRef((t,e)=>{const{__scopeSelect:r,onPlaced:n,...a}=t,i=mm(Kf,r),o=fm(Kf,r),[l,c]=x.useState(null),[u,d]=x.useState(null),h=Cr(e,T=>d(T)),f=Ow(r),m=x.useRef(!1),g=x.useRef(!0),{viewport:y,selectedItem:b,selectedItemText:w,focusSelectedItem:j}=o,N=x.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&y&&b&&w){const T=i.trigger.getBoundingClientRect(),D=u.getBoundingClientRect(),A=i.valueNode.getBoundingClientRect(),R=w.getBoundingClientRect();if(i.dir!=="rtl"){const re=R.left-D.left,we=A.left-re,Ee=T.left-we,Me=T.width+Ee,ae=Math.max(Me,D.width),ze=window.innerWidth-Ec,mt=a0(we,[Ec,Math.max(Ec,ze-ae)]);l.style.minWidth=Me+"px",l.style.left=mt+"px"}else{const re=D.right-R.right,we=window.innerWidth-A.right-re,Ee=window.innerWidth-T.right-we,Me=T.width+Ee,ae=Math.max(Me,D.width),ze=window.innerWidth-Ec,mt=a0(we,[Ec,Math.max(Ec,ze-ae)]);l.style.minWidth=Me+"px",l.style.right=mt+"px"}const M=f(),P=window.innerHeight-Ec*2,U=y.scrollHeight,I=window.getComputedStyle(u),O=parseInt(I.borderTopWidth,10),V=parseInt(I.paddingTop,10),G=parseInt(I.borderBottomWidth,10),B=parseInt(I.paddingBottom,10),$=O+V+U+B+G,W=Math.min(b.offsetHeight*5,$),oe=window.getComputedStyle(y),K=parseInt(oe.paddingTop,10),H=parseInt(oe.paddingBottom,10),X=T.top+T.height/2-Ec,me=P-X,ie=b.offsetHeight/2,ee=b.offsetTop+ie,he=O+V+ee,ve=$-he;if(he<=X){const re=M.length>0&&b===M[M.length-1].ref.current;l.style.bottom="0px";const we=u.clientHeight-y.offsetTop-y.offsetHeight,Ee=Math.max(me,ie+(re?H:0)+we+G),Me=he+Ee;l.style.height=Me+"px"}else{const re=M.length>0&&b===M[0].ref.current;l.style.top="0px";const Ee=Math.max(X,O+y.offsetTop+(re?K:0)+ie)+ve;l.style.height=Ee+"px",y.scrollTop=he-X+y.offsetTop}l.style.margin=`${Ec}px 0`,l.style.minHeight=W+"px",l.style.maxHeight=P+"px",n==null||n(),requestAnimationFrame(()=>m.current=!0)}},[f,i.trigger,i.valueNode,l,u,y,b,w,i.dir,n]);En(()=>N(),[N]);const[S,E]=x.useState();En(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const C=x.useCallback(T=>{T&&g.current===!0&&(N(),j==null||j(),g.current=!1)},[N,j]);return s.jsx(mne,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:m,onScrollButtonChange:C,children:s.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:s.jsx(Zt.div,{...a,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});JB.displayName=dne;var hne="SelectPopperPosition",HF=x.forwardRef((t,e)=>{const{__scopeSelect:r,align:n="start",collisionPadding:a=Ec,...i}=t,o=zw(r);return s.jsx(TC,{...o,...i,ref:e,align:n,collisionPadding:a,style:{boxSizing:"border-box",...i.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)"}})});HF.displayName=hne;var[mne,vk]=Rx(Kf,{}),$F="SelectViewport",YB=x.forwardRef((t,e)=>{const{__scopeSelect:r,nonce:n,...a}=t,i=fm($F,r),o=vk($F,r),l=Cr(e,i.onViewportChange),c=x.useRef(0);return s.jsxs(s.Fragment,{children:[s.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:n}),s.jsx(Iw.Slot,{scope:r,children:s.jsx(Zt.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:gt(a.onScroll,u=>{const d=u.currentTarget,{contentWrapper:h,shouldExpandOnScrollRef:f}=o;if(f!=null&&f.current&&h){const m=Math.abs(c.current-d.scrollTop);if(m>0){const g=window.innerHeight-Ec*2,y=parseFloat(h.style.minHeight),b=parseFloat(h.style.height),w=Math.max(y,b);if(w<g){const j=w+m,N=Math.min(g,j),S=j-N;h.style.height=N+"px",h.style.bottom==="0px"&&(d.scrollTop=S>0?S:0,h.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});YB.displayName=$F;var ZB="SelectGroup",[fne,pne]=Rx(ZB),gne=x.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,a=hl();return s.jsx(fne,{scope:r,id:a,children:s.jsx(Zt.div,{role:"group","aria-labelledby":a,...n,ref:e})})});gne.displayName=ZB;var XB="SelectLabel",QB=x.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,a=pne(XB,r);return s.jsx(Zt.div,{id:a.id,...n,ref:e})});QB.displayName=XB;var F1="SelectItem",[xne,eL]=Rx(F1),tL=x.forwardRef((t,e)=>{const{__scopeSelect:r,value:n,disabled:a=!1,textValue:i,...o}=t,l=mm(F1,r),c=fm(F1,r),u=l.value===n,[d,h]=x.useState(i??""),[f,m]=x.useState(!1),g=Cr(e,j=>{var N;return(N=c.itemRefCallback)==null?void 0:N.call(c,j,n,a)}),y=hl(),b=x.useRef("touch"),w=()=>{a||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")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 s.jsx(xne,{scope:r,value:n,disabled:a,textId:y,isSelected:u,onItemTextChange:x.useCallback(j=>{h(N=>N||((j==null?void 0:j.textContent)??"").trim())},[]),children:s.jsx(Iw.ItemSlot,{scope:r,value:n,disabled:a,textValue:d,children:s.jsx(Zt.div,{role:"option","aria-labelledby":y,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:g,onFocus:gt(o.onFocus,()=>m(!0)),onBlur:gt(o.onBlur,()=>m(!1)),onClick:gt(o.onClick,()=>{b.current!=="mouse"&&w()}),onPointerUp:gt(o.onPointerUp,()=>{b.current==="mouse"&&w()}),onPointerDown:gt(o.onPointerDown,j=>{b.current=j.pointerType}),onPointerMove:gt(o.onPointerMove,j=>{var N;b.current=j.pointerType,a?(N=c.onItemLeave)==null||N.call(c):b.current==="mouse"&&j.currentTarget.focus({preventScroll:!0})}),onPointerLeave:gt(o.onPointerLeave,j=>{var N;j.currentTarget===document.activeElement&&((N=c.onItemLeave)==null||N.call(c))}),onKeyDown:gt(o.onKeyDown,j=>{var S;((S=c.searchRef)==null?void 0:S.current)!==""&&j.key===" "||(rne.includes(j.key)&&w(),j.key===" "&&j.preventDefault())})})})})});tL.displayName=F1;var Ny="SelectItemText",rL=x.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:a,...i}=t,o=mm(Ny,r),l=fm(Ny,r),c=eL(Ny,r),u=ine(Ny,r),[d,h]=x.useState(null),f=Cr(e,w=>h(w),c.onItemTextChange,w=>{var j;return(j=l.itemTextRefCallback)==null?void 0:j.call(l,w,c.value,c.disabled)}),m=d==null?void 0:d.textContent,g=x.useMemo(()=>s.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:y,onNativeOptionRemove:b}=u;return En(()=>(y(g),()=>b(g)),[y,b,g]),s.jsxs(s.Fragment,{children:[s.jsx(Zt.span,{id:c.textId,...i,ref:f}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?bx.createPortal(i.children,o.valueNode):null]})});rL.displayName=Ny;var sL="SelectItemIndicator",nL=x.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t;return eL(sL,r).isSelected?s.jsx(Zt.span,{"aria-hidden":!0,...n,ref:e}):null});nL.displayName=sL;var WF="SelectScrollUpButton",aL=x.forwardRef((t,e)=>{const r=fm(WF,t.__scopeSelect),n=vk(WF,t.__scopeSelect),[a,i]=x.useState(!1),o=Cr(e,n.onScrollButtonChange);return En(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollTop>0;i(u)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),a?s.jsx(oL,{...t,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});aL.displayName=WF;var qF="SelectScrollDownButton",iL=x.forwardRef((t,e)=>{const r=fm(qF,t.__scopeSelect),n=vk(qF,t.__scopeSelect),[a,i]=x.useState(!1),o=Cr(e,n.onScrollButtonChange);return En(()=>{if(r.viewport&&r.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;i(d)};const c=r.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),a?s.jsx(oL,{...t,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=r;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});iL.displayName=qF;var oL=x.forwardRef((t,e)=>{const{__scopeSelect:r,onAutoScroll:n,...a}=t,i=fm("SelectScrollButton",r),o=x.useRef(null),l=Ow(r),c=x.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return x.useEffect(()=>()=>c(),[c]),En(()=>{var d;const u=l().find(h=>h.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),s.jsx(Zt.div,{"aria-hidden":!0,...a,ref:e,style:{flexShrink:0,...a.style},onPointerDown:gt(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:gt(a.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:gt(a.onPointerLeave,()=>{c()})})}),yne="SelectSeparator",lL=x.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t;return s.jsx(Zt.div,{"aria-hidden":!0,...n,ref:e})});lL.displayName=yne;var GF="SelectArrow",bne=x.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,a=zw(r),i=mm(GF,r),o=fm(GF,r);return i.open&&o.position==="popper"?s.jsx(MC,{...a,...n,ref:e}):null});bne.displayName=GF;var vne="SelectBubbleInput",cL=x.forwardRef(({__scopeSelect:t,value:e,...r},n)=>{const a=x.useRef(null),i=Cr(n,a),o=Mx(e);return x.useEffect(()=>{const l=a.current;if(!l)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==e&&d){const h=new Event("change",{bubbles:!0});d.call(l,e),l.dispatchEvent(h)}},[o,e]),s.jsx(Zt.select,{...r,style:{...EM,...r.style},ref:i,defaultValue:e})});cL.displayName=vne;function uL(t){return t===""||t===void 0}function dL(t){const e=Zs(t),r=x.useRef(""),n=x.useRef(0),a=x.useCallback(o=>{const l=r.current+o;e(l),function c(u){r.current=u,window.clearTimeout(n.current),u!==""&&(n.current=window.setTimeout(()=>c(""),1e3))}(l)},[e]),i=x.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,a,i]}function hL(t,e,r){const a=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=r?t.indexOf(r):-1;let o=wne(t,Math.max(i,0));a.length===1&&(o=o.filter(u=>u!==r));const c=o.find(u=>u.textValue.toLowerCase().startsWith(a.toLowerCase()));return c!==r?c:void 0}function wne(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var jne=OB,mL=UB,Nne=$B,Fne=WB,Sne=qB,fL=GB,Cne=YB,pL=QB,gL=tL,kne=rL,_ne=nL,xL=aL,yL=iL,bL=lL;const Wt=jne,qt=Nne,Ht=x.forwardRef(({className:t,children:e,...r},n)=>
vendor: 5,039 bytes, line 690
690s.jsxs(mL,{ref:n,className:xt("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-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",t),...r,children:[e,s.jsx(Fne,{asChild:!0,children:s.jsx(fd,{className:"h-4 w-4 opacity-50"})})]}));Ht.displayName=mL.displayName;const vL=x.forwardRef(({className:t,...e},r)=>s.jsx(xL,{ref:r,className:xt("flex cursor-default items-center justify-center py-1",t),...e,children:s.jsx(LV,{className:"h-4 w-4"})}));vL.displayName=xL.displayName;const wL=x.forwardRef(({className:t,...e},r)=>s.jsx(yL,{ref:r,className:xt("flex cursor-default items-center justify-center py-1",t),...e,children:s.jsx(fd,{className:"h-4 w-4"})}));wL.displayName=yL.displayName;const $t=x.forwardRef(({className:t,children:e,position:r="popper",...n},a)=>s.jsx(Sne,{children:s.jsxs(fL,{ref:a,className:xt("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",r==="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",t),position:r,...n,children:[s.jsx(vL,{}),s.jsx(Cne,{className:xt("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),s.jsx(wL,{})]})}));$t.displayName=fL.displayName;const Ene=x.forwardRef(({className:t,...e},r)=>s.jsx(pL,{ref:r,className:xt("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...e}));Ene.displayName=pL.displayName;const Ae=x.forwardRef(({className:t,children:e,...r},n)=>s.jsxs(gL,{ref:n,className:xt("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(_ne,{children:s.jsx(un,{className:"h-4 w-4"})})}),s.jsx(kne,{children:e})]}));Ae.displayName=gL.displayName;const Ane=x.forwardRef(({className:t,...e},r)=>s.jsx(bL,{ref:r,className:xt("-mx-1 my-1 h-px bg-muted",t),...e}));Ane.displayName=bL.displayName;var Uw="Switch",[Dne]=li(Uw),[Tne,Mne]=Dne(Uw),jL=x.forwardRef((t,e)=>{const{__scopeSwitch:r,name:n,checked:a,defaultChecked:i,required:o,disabled:l,value:c="on",onCheckedChange:u,form:d,...h}=t,[f,m]=x.useState(null),g=Cr(e,N=>m(N)),y=x.useRef(!1),b=f?d||!!f.closest("form"):!0,[w,j]=Lo({prop:a,defaultProp:i??!1,onChange:u,caller:Uw});return s.jsxs(Tne,{scope:r,checked:w,disabled:l,children:[s.jsx(Zt.button,{type:"button",role:"switch","aria-checked":w,"aria-required":o,"data-state":CL(w),"data-disabled":l?"":void 0,disabled:l,value:c,...h,ref:g,onClick:gt(t.onClick,N=>{j(S=>!S),b&&(y.current=N.isPropagationStopped(),y.current||N.stopPropagation())})}),b&&s.jsx(SL,{control:f,bubbles:!y.current,name:n,value:c,checked:w,required:o,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});jL.displayName=Uw;var NL="SwitchThumb",FL=x.forwardRef((t,e)=>{const{__scopeSwitch:r,...n}=t,a=Mne(NL,r);return s.jsx(Zt.span,{"data-state":CL(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:e})});FL.displayName=NL;var Pne="SwitchBubbleInput",SL=x.forwardRef(({__scopeSwitch:t,control:e,checked:r,bubbles:n=!0,...a},i)=>{const o=x.useRef(null),l=Cr(o,i),c=Mx(r),u=O0(e);return x.useEffect(()=>{const d=o.current;if(!d)return;const h=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(h,"checked").set;if(c!==r&&m){const g=new Event("click",{bubbles:n});m.call(d,r),d.dispatchEvent(g)}},[c,r,n]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:l,style:{...a.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});SL.displayName=Pne;function CL(t){return t?"checked":"unchecked"}var kL=jL,Rne=FL;const ii=x.forwardRef(({className:t,...e},r)=>s.jsx(kL,{className:xt("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors 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 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...e,ref:r,children:s.jsx(Rne,{className:xt("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")})}
690));ii.displayName=kL.displayName;const Fc=[{id:"monday",label:"Monday"},{id:"tuesday",label:"Tuesday"},{id:"wednesday",label:"Wednesday"},{id:"thursday",label:"Thursday"},{id:"friday",label:"Friday"},{id:"saturday",label:"Saturday"},{id:"sunday",label:"Sunday"}],hv=[{value:"closed",label:"Closed"},{value:"24/7",label:"24 Hours (Always Open)"},{value:"00:00",label:"12:00 AM"},{value:"00:30",label:"12:30 AM"},{value:"01:00",label:"1:00 AM"},{value:"01:30",label:"1:30 AM"},{value:"02:00",label:"2:00 AM"},{value:"02:30",label:"2:30 AM"},{value:"03:00",label:"3:00 AM"},{value:"03:30",label:"3:30 AM"},{value:"04:00",label:"4:00 AM"},{value:"04:30",label:"4:30 AM"},{value:"05:00",label:"5:00 AM"},{value:"05:30",label:"5:30 AM"},{value:"06:00",label:"6:00 AM"},{value:"06:30",label:"6:30 AM"},{value:"07:00",label:"7:00 AM"},{value:"07:30",label:"7:30 AM"},{value:"08:00",label:"8:00 AM"},{value:"08:30",label:"8:30 AM"},{value:"09:00",label:"9:00 AM"},{value:"09:30",label:"9:30 AM"},{value:"10:00",label:"10:00 AM"},{value:"10:30",label:"10:30 AM"},{value:"11:00",label:"11:00 AM"},{value:"11:30",label:"11:30 AM"},{value:"12:00",label:"12:00 PM"},{value:"12:30",label:"12:30 PM"},{value:"13:00",label:"1:00 PM"},{value:"13:30",label:"1:30 PM"},{value:"14:00",label:"2:00 PM"},{value:"14:30",label:"2:30 PM"},{value:"15:00",label:"3:00 PM"},{value:"15:30",label:"3:30 PM"},{value:"16:00",label:"4:00 PM"},{value:"16:30",label:"4:30 PM"},{value:"17:00",label:"5:00 PM"},{value:"17:30",label:"5:30 PM"},{value:"18:00",label:"6:00 PM"},{value:"18:30",label:"6:30 PM"},{value:"19:00",label:"7:00 PM"},{value:"19:30",label:"7:30 PM"},{value:"20:00",label:"8:00 PM"},{value:"20:30",label:"8:30 PM"},{value:"21:00",label:"9:00 PM"},{value:"21:30",label:"9:30 PM"},{value:"22:00",label:"10:00 PM"},{value:"22:30",label:"10:30 PM"},{value:"23:00",label:"11:00 PM"},{value:"23:30",label:"11:30 PM"}],_L=({form:t})=>{const[e,r]=x.useState(!1),[n,a]=x.useState(!1);Oe.useEffect(()=>{const d=t.getValues("business_hours_json")||{},h=Fc.every(f=>{var m;return((m=d[f.id])==null?void 0:m.open)==="24/7"});a(h)},[t]);const i=(d,h,f)=>{const m=t.getValues("business_hours_json")||{};if(e){const g={...m};Fc.forEach(y=>{g[y.id]||(g[y.id]={open:"09:00",close:"17:00"}),f==="24/7"?g[y.id]={open:"24/7",close:"24/7"}:f==="closed"||g[y.id][h==="open"?"close":"open"]==="closed"?g[y.id]={open:"closed",close:"closed"}:g[y.id][h]=f}),t.setValue("business_hours_json",g)}else{const g={...m};g[d]||(g[d]={open:"09:00",close:"17:00"}),f==="24/7"?g[d]={open:"24/7",close:"24/7"}:f==="closed"||g[d][h==="open"?"close":"open"]==="closed"?g[d]={open:"closed",close:"closed"}:g[d][h]=f,t.setValue("business_hours_json",g)}},o=(d,h)=>{var m;return((m=(t.getValues("business_hours_json")||{})[d])==null?void 0:m[h])||(h==="open"?"09:00":"17:00")},l=d=>{var f;const h=t.getValues("business_hours_json")||{};return((f=h[d])==null?void 0:f.open)==="closed"||!h[d]},c=d=>{var f;return((f=(t.getValues("business_hours_json")||{})[d])==null?void 0:f.open)==="24/7"},u=d=>{if(a(d),d){const h={};Fc.forEach(f=>{h[f.id]={open:"24/7",close:"24/7"}}),t.setValue("business_hours_json",h),r(!1)}else{const h={};Fc.forEach(f=>{h[f.id]={open:"09:00",close:"17:00"}}),t.setValue("business_hours_json",h)}};return s.jsx(aa,{control:t.control,name:"business_hours_json",render:({field:d})=>s.jsxs(Vn,{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(rn,{className:"h-4 w-4 text-muted-foreground"}),s.jsx(Bn,{className:"text-base",children:"Business Hours"})]}),s.jsx(De,{children:s.jsxs(Be,{className:"pt-6",children:[s.jsxs("div",{className:"space-y-3 mb-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ii,{id:"always-open",checked:n,onCheckedChange:u}),s.jsx(Z,{htmlFor:"always-open",children:"24/7 (Always Open)"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ii,{id:"same-hours",checked:e,onCheckedChange:r,disabled:n}),s.jsx(Z,{htmlFor:"same-hours",className:n?"text-gray-400":"",children:"Same hours for all days"})]})]}),n?s.jsxs("div",{className:"text-center py-8",children:[s.jsx("div",{className:"text-lg font-medium text-green-600",children:"ð Open 24 Hours Every Day"}),s.jsx("div",{className:"text-sm text-gray-500 mt-2",children:"Your business is set to be open 24/7"})]}):e?s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"all-open",children:"Opening Time"}),s.jsxs(Wt,{value:o(Fc[0].id,"open"),onValueChange:h=>i(Fc[0].id,"open",h),children:[s.jsx(Ht,{id:"all-open",children:s.jsx(qt,{placeholder:"Opening Time"})}),s.jsx($t,{children:hv.map(h=>s.jsx(Ae,{value:h.value,children:h.label},h.value))})]})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"all-close",children:"Closing Time"}),s.jsxs(Wt,{value:o(Fc[0].id,"close"),onValueChange:h=>i(Fc[0].id,"close",h),disabled:o(Fc[0].id,"open")==="closed"||c(Fc[0].id),children:[s.jsx(Ht,{id:"all-close",children:s.jsx(qt,{placeholder:"Closing Time"})}),s.jsx($t,{children:hv.filter(h=>h.value!=="closed"&&h.value!=="24/7").map(h=>s.jsx(Ae,{value:h.value,children:h.label},h.value))})]})]})]}):s.jsx("div",{className:"space-y-4",children:Fc.map(h=>s.jsxs("div",{className:"grid grid-cols-3 gap-4 items-center",children:[s.jsx("div",{className:"font-medium",children:h.label}),s.jsx("div",{children:s.jsxs(Wt,{value:o(h.id,"open"),onValueChange:f=>i(h.id,"open",f),children:[s.jsx(Ht,{id:`${h.id}-open`,children:s.jsx(qt,{placeholder:"Opening Time"})}),s.jsx($t,{children:hv.map(f=>s.jsx(Ae,{value:f.value,children:f.label},f.value))})]})}),s.jsx("div",{children:s.jsxs(Wt,{value:o(h.id,"close"),onValueChange:f=>i(h.id,"close",f),disabled:l(h.id)||c(h.id),children:[s.jsx(Ht,{id:`${h.id}-close`,children:s.jsx(qt,{placeholder:"Closing Time"})}),s.jsx($t,{children:hv.filter(f=>f.value!=="closed"&&f.value!=="24/7").map(f=>s.jsx(Ae,{value:f.value,children:f.label},f.value))})]})})]}
vendor: 4,903 bytes, line 690
690,h.id))})]})}),s.jsx(Ln,{})]})})},Bne=2*1024*1024,Lne=["image/jpeg","image/jpg","image/png"];function Ine(t,e){return x.useReducer((r,n)=>e[r][n]??r,t)}var wk="ScrollArea",[EL]=li(wk),[One,Jl]=EL(wk),AL=x.forwardRef((t,e)=>{const{__scopeScrollArea:r,type:n="hover",dir:a,scrollHideDelay:i=600,...o}=t,[l,c]=x.useState(null),[u,d]=x.useState(null),[h,f]=x.useState(null),[m,g]=x.useState(null),[y,b]=x.useState(null),[w,j]=x.useState(0),[N,S]=x.useState(0),[E,C]=x.useState(!1),[T,D]=x.useState(!1),A=Cr(e,M=>c(M)),R=hm(a);return s.jsx(One,{scope:r,type:n,dir:R,scrollHideDelay:i,scrollArea:l,viewport:u,onViewportChange:d,content:h,onContentChange:f,scrollbarX:m,onScrollbarXChange:g,scrollbarXEnabled:E,onScrollbarXEnabledChange:C,scrollbarY:y,onScrollbarYChange:b,scrollbarYEnabled:T,onScrollbarYEnabledChange:D,onCornerWidthChange:j,onCornerHeightChange:S,children:s.jsx(Zt.div,{dir:R,...o,ref:A,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":N+"px",...t.style}})})});AL.displayName=wk;var DL="ScrollAreaViewport",TL=x.forwardRef((t,e)=>{const{__scopeScrollArea:r,children:n,nonce:a,...i}=t,o=Jl(DL,r),l=x.useRef(null),c=Cr(e,l,o.onViewportChange);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),s.jsx(Zt.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t.style},children:s.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});TL.displayName=DL;var ku="ScrollAreaScrollbar",jk=x.forwardRef((t,e)=>{const{forceMount:r,...n}=t,a=Jl(ku,t.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=a,l=t.orientation==="horizontal";return x.useEffect(()=>(l?i(!0):o(!0),()=>{l?i(!1):o(!1)}),[l,i,o]),a.type==="hover"?s.jsx(zne,{...n,ref:e,forceMount:r}):a.type==="scroll"?s.jsx(Une,{...n,ref:e,forceMount:r}):a.type==="auto"?s.jsx(ML,{...n,ref:e,forceMount:r}):a.type==="always"?s.jsx(Nk,{...n,ref:e}):null});jk.displayName=ku;var zne=x.forwardRef((t,e)=>{const{forceMount:r,...n}=t,a=Jl(ku,t.__scopeScrollArea),[i,o]=x.useState(!1);return x.useEffect(()=>{const l=a.scrollArea;let c=0;if(l){const u=()=>{window.clearTimeout(c),o(!0)},d=()=>{c=window.setTimeout(()=>o(!1),a.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",d)}}},[a.scrollArea,a.scrollHideDelay]),s.jsx(fa,{present:r||i,children:s.jsx(ML,{"data-state":i?"visible":"hidden",...n,ref:e})})}),Une=x.forwardRef((t,e)=>{const{forceMount:r,...n}=t,a=Jl(ku,t.__scopeScrollArea),i=t.orientation==="horizontal",o=$w(()=>c("SCROLL_END"),100),[l,c]=Ine("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return x.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>c("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,a.scrollHideDelay,c]),x.useEffect(()=>{const u=a.viewport,d=i?"scrollLeft":"scrollTop";if(u){let h=u[d];const f=()=>{const m=u[d];h!==m&&(c("SCROLL"),o()),h=m};return u.addEventListener("scroll",f),()=>u.removeEventListener("scroll",f)}},[a.viewport,i,c,o]),s.jsx(fa,{present:r||l!=="hidden",children:s.jsx(Nk,{"data-state":l==="hidden"?"hidden":"visible",...n,ref:e,onPointerEnter:gt(t.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:gt(t.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),ML=x.forwardRef((t,e)=>{const r=Jl(ku,t.__scopeScrollArea),{forceMount:n,...a}=t,[i,o]=x.useState(!1),l=t.orientation==="horizontal",c=$w(()=>{if(r.viewport){const u=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;o(l?u:d)}},10);return tx(r.viewport,c),tx(r.content,c),s.jsx(fa,{present:n||i,children:s.jsx(Nk,{"data-state":i?"visible":"hidden",...a,ref:e})})}),Nk=x.forwardRef((t,e)=>{const{orientation:r="vertical",...n}=t,a=Jl(ku,t.__scopeScrollArea),i=x.useRef(null),o=x.useRef(0),[l,c]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=IL(l.viewport,l.content),d={...n,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:f=>i.current=f,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:f=>o.current=f};function h(f,m){return Vne(f,o.current,l,m)}return r==="horizontal"?s.jsx(Hne,{...d,ref:e,onThumbPositionChange:()=>{if(a.viewport&&i.current){const f=a.viewport.scrollLeft,m=_5(f,l,a.dir);i.current.style.transform=`translate3d(${m}px, 0, 0)`}}
vendor: 8,225 bytes, line 690
690,onWheelScroll:f=>{a.viewport&&(a.viewport.scrollLeft=f)},onDragScroll:f=>{a.viewport&&(a.viewport.scrollLeft=h(f,a.dir))}}):r==="vertical"?s.jsx($ne,{...d,ref:e,onThumbPositionChange:()=>{if(a.viewport&&i.current){const f=a.viewport.scrollTop,m=_5(f,l);i.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:f=>{a.viewport&&(a.viewport.scrollTop=f)},onDragScroll:f=>{a.viewport&&(a.viewport.scrollTop=h(f))}}):null}),Hne=x.forwardRef((t,e)=>{const{sizes:r,onSizesChange:n,...a}=t,i=Jl(ku,t.__scopeScrollArea),[o,l]=x.useState(),c=x.useRef(null),u=Cr(e,c,i.onScrollbarXChange);return x.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),s.jsx(RL,{"data-orientation":"horizontal",...a,ref:u,sizes:r,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Hw(r)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.x),onDragScroll:d=>t.onDragScroll(d.x),onWheelScroll:(d,h)=>{if(i.viewport){const f=i.viewport.scrollLeft+d.deltaX;t.onWheelScroll(f),zL(f,h)&&d.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&n({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:C1(o.paddingLeft),paddingEnd:C1(o.paddingRight)}})}})}),$ne=x.forwardRef((t,e)=>{const{sizes:r,onSizesChange:n,...a}=t,i=Jl(ku,t.__scopeScrollArea),[o,l]=x.useState(),c=x.useRef(null),u=Cr(e,c,i.onScrollbarYChange);return x.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),s.jsx(RL,{"data-orientation":"vertical",...a,ref:u,sizes:r,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Hw(r)+"px",...t.style},onThumbPointerDown:d=>t.onThumbPointerDown(d.y),onDragScroll:d=>t.onDragScroll(d.y),onWheelScroll:(d,h)=>{if(i.viewport){const f=i.viewport.scrollTop+d.deltaY;t.onWheelScroll(f),zL(f,h)&&d.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&n({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:C1(o.paddingTop),paddingEnd:C1(o.paddingBottom)}})}})}),[Wne,PL]=EL(ku),RL=x.forwardRef((t,e)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:a,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:h,...f}=t,m=Jl(ku,r),[g,y]=x.useState(null),b=Cr(e,A=>y(A)),w=x.useRef(null),j=x.useRef(""),N=m.viewport,S=n.content-n.viewport,E=Zs(d),C=Zs(c),T=$w(h,10);function D(A){if(w.current){const R=A.clientX-w.current.left,M=A.clientY-w.current.top;u({x:R,y:M})}}return x.useEffect(()=>{const A=R=>{const M=R.target;(g==null?void 0:g.contains(M))&&E(R,S)};return document.addEventListener("wheel",A,{passive:!1}),()=>document.removeEventListener("wheel",A,{passive:!1})},[N,g,S,E]),x.useEffect(C,[n,C]),tx(g,T),tx(m.content,T),s.jsx(Wne,{scope:r,scrollbar:g,hasThumb:a,onThumbChange:Zs(i),onThumbPointerUp:Zs(o),onThumbPositionChange:C,onThumbPointerDown:Zs(l),children:s.jsx(Zt.div,{...f,ref:b,style:{position:"absolute",...f.style},onPointerDown:gt(t.onPointerDown,A=>{A.button===0&&(A.target.setPointerCapture(A.pointerId),w.current=g.getBoundingClientRect(),j.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),D(A))}),onPointerMove:gt(t.onPointerMove,D),onPointerUp:gt(t.onPointerUp,A=>{const R=A.target;R.hasPointerCapture(A.pointerId)&&R.releasePointerCapture(A.pointerId),document.body.style.webkitUserSelect=j.current,m.viewport&&(m.viewport.style.scrollBehavior=""),w.current=null})})})}),S1="ScrollAreaThumb",BL=x.forwardRef((t,e)=>{const{forceMount:r,...n}=t,a=PL(S1,t.__scopeScrollArea);return s.jsx(fa,{present:r||a.hasThumb,children:s.jsx(qne,{ref:e,...n})})}),qne=x.forwardRef((t,e)=>{const{__scopeScrollArea:r,style:n,...a}=t,i=Jl(S1,r),o=PL(S1,r),{onThumbPositionChange:l}=o,c=Cr(e,h=>o.onThumbChange(h)),u=x.useRef(void 0),d=$w(()=>{u.current&&(u.current(),u.current=void 0)},100);return x.useEffect(()=>{const h=i.viewport;if(h){const f=()=>{if(d(),!u.current){const m=Kne(h,l);u.current=m,l()}};return l(),h.addEventListener("scroll",f),()=>h.removeEventListener("scroll",f)}},[i.viewport,d,l]),s.jsx(Zt.div,{"data-state":o.hasThumb?"visible":"hidden",...a,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:gt(t.onPointerDownCapture,h=>{const m=h.target.getBoundingClientRect(),g=h.clientX-m.left,y=h.clientY-m.top;o.onThumbPointerDown({x:g,y})}),onPointerUp:gt(t.onPointerUp,o.onThumbPointerUp)})});BL.displayName=S1;var Fk="ScrollAreaCorner",LL=x.forwardRef((t,e)=>{const r=Jl(Fk,t.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?s.jsx(Gne,{...t,ref:e}):null});LL.displayName=Fk;var Gne=x.forwardRef((t,e)=>{const{__scopeScrollArea:r,...n}=t,a=Jl(Fk,r),[i,o]=x.useState(0),[l,c]=x.useState(0),u=!!(i&&l);return tx(a.scrollbarX,()=>{var h;const d=((h=a.scrollbarX)==null?void 0:h.offsetHeight)||0;a.onCornerHeightChange(d),c(d)}),tx(a.scrollbarY,()=>{var h;const d=((h=a.scrollbarY)==null?void 0:h.offsetWidth)||0;a.onCornerWidthChange(d),o(d)}),u?s.jsx(Zt.div,{...n,ref:e,style:{width:i,height:l,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function C1(t){return t?parseInt(t,10):0}function IL(t,e){const r=t/e;return isNaN(r)?0:r}function Hw(t){const e=IL(t.viewport,t.content),r=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,n=(t.scrollbar.size-r)*e;return Math.max(n,18)}function Vne(t,e,r,n="ltr"){const a=Hw(r),i=a/2,o=e||i,l=a-o,c=r.scrollbar.paddingStart+o,u=r.scrollbar.size-r.scrollbar.paddingEnd-l,d=r.content-r.viewport,h=n==="ltr"?[0,d]:[d*-1,0];return OL([c,u],h)(t)}function _5(t,e,r="ltr"){const n=Hw(e),a=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,i=e.scrollbar.size-a,o=e.content-e.viewport,l=i-n,c=r==="ltr"?[0,o]:[o*-1,0],u=a0(t,c);return OL([0,o],[0,l])(u)}function OL(t,e){return r=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const n=(e[1]-e[0])/(t[1]-t[0]);return e[0]+n*(r-t[0])}}function zL(t,e){return t>0&&t<e}var Kne=(t,e=()=>{})=>{let r={left:t.scrollLeft,top:t.scrollTop},n=0;return function a(){const i={left:t.scrollLeft,top:t.scrollTop},o=r.left!==i.left,l=r.top!==i.top;(o||l)&&e(),r=i,n=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(n)};function $w(t,e){const r=Zs(t),n=x.useRef(0);return x.useEffect(()=>()=>window.clearTimeout(n.current),[]),x.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,e)},[r,e])}function tx(t,e){const r=Zs(e);En(()=>{let n=0;if(t){const a=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return a.observe(t),()=>{window.cancelAnimationFrame(n),a.unobserve(t)}}},[t,r])}var UL=AL,Jne=TL,Yne=LL;const rx=x.forwardRef(({className:t,children:e,...r},n)=>s.jsxs(UL,{ref:n,className:xt("relative overflow-hidden",t),...r,children:[s.jsx(Jne,{className:"h-full w-full rounded-[inherit]",children:e}),s.jsx(HL,{}),s.jsx(Yne,{})]}));rx.displayName=UL.displayName;const HL=x.forwardRef(({className:t,orientation:e="vertical",...r},n)=>s.jsx(jk,{ref:n,orientation:e,className:xt("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...r,children:s.jsx(BL,{className:"relative flex-1 rounded-full bg-border"})}));HL.displayName=jk.displayName;const $L=({form:t,galleryFiles:e,setGalleryFiles:r,galleryPreviews:n,setGalleryPreviews:a,uploadingGallery:i})=>{const{toast:o}=St(),[l,c]=x.useState("url"),[u,d]=x.useState(""),[h,f]=x.useState(!1),m=()=>{if(u)try{const S=new URL(u),E=t.getValues("gallery_urls")||[];E.includes(u)?o({title:"Duplicate image",description:"This image URL is already in your gallery.",variant:"destructive"}):(t.setValue("gallery_urls",[...E,u]),d(""))}catch{o({title:"Invalid URL",description:"Please enter a valid image URL.",variant:"destructive"})}},g=S=>{const E=t.getValues("gallery_urls")||[];
690t.setValue("gallery_urls",E.filter(C=>C!==S))},y=S=>{if(!S.target.files||S.target.files.length===0)return;const E=Array.from(S.target.files),C=[],T=[];E.forEach(D=>{if(!Lne.includes(D.type)){o({title:"Invalid file type",description:`${D.name} is not a supported image type. Please upload only JPG or PNG image files.`,variant:"destructive"});return}if(D.size>Bne){o({title:"File too large",description:`${D.name} exceeds 2MB. Please upload smaller images.`,variant:"destructive"});return}C.push(D),T.push(URL.createObjectURL(D))}),C.length>0&&(r([...e,...C]),a([...n,...T]))},b=S=>{const E=[...e],C=[...n];URL.revokeObjectURL(C[S]),E.splice(S,1),C.splice(S,1),r(E),a(C)},w=S=>{S.preventDefault(),S.stopPropagation(),f(!0)},j=S=>{S.preventDefault(),S.stopPropagation(),f(!1)},N=S=>{S.preventDefault(),S.stopPropagation(),f(!1),S.dataTransfer.files&&S.dataTransfer.files.length>0&&y({target:{files:S.dataTransfer.files}})};return s.jsx(aa,{control:t.control,name:"gallery_urls",render:({field:S})=>s.jsxs(Vn,{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(vi,{className:"h-4 w-4 text-muted-foreground"}),s.jsx(Bn,{className:"text-base",children:"Photo Gallery"})]}),s.jsx(De,{children:s.jsxs(Be,{className:"pt-6",children:[s.jsxs(sn,{defaultValue:"url",value:l,onValueChange:E=>c(E),className:"w-full",children:[s.jsxs(Qs,{className:"grid w-full grid-cols-2",children:[s.jsx(Gt,{value:"url",children:"Add by URL"}),s.jsx(Gt,{value:"upload",children:"Upload Photos"})]}),s.jsxs(Rt,{value:"url",className:"pt-4 space-y-4",children:[s.jsxs("div",{className:"flex items-end gap-2",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx(Bn,{htmlFor:"image-url",children:"Image URL"}),s.jsx(Ne,{id:"image-url",placeholder:"https://example.com/image.jpg",value:u,onChange:E=>d(E.target.value)})]}),s.jsxs(Y,{type:"button",onClick:m,disabled:!u,children:[s.jsx(UV,{className:"h-4 w-4 mr-2"}),"Add"]})]}),S.value&&S.value.length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("h4",{className:"text-sm font-medium",children:["Gallery URLs (",S.value.length,")"]}),s.jsx(rx,{className:"h-56 w-full rounded-md border",children:s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-2 p-2",children:S.value.map((E,C)=>s.jsxs("div",{className:"relative group",children:[s.jsxs(Qg,{ratio:16/9,children:[s.jsx("img",{src:E,alt:`Gallery image ${C+1}`,className:"rounded-md object-cover w-full h-full",onError:T=>{T.target.src="https://placehold.co/600x400?text=Image+Error",T.target.classList.add("error")}}),E.includes("placehold.co")&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/30 rounded-md",children:s.jsx(yd,{className:"h-6 w-6 text-yellow-400"})})]}),s.jsx("button",{type:"button",onClick:()=>g(E),className:"absolute top-1 right-1 bg-black/70 rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity","aria-label":"Remove image",children:s.jsx(Ir,{className:"h-4 w-4 text-white"})})]},C))})})]})]}),s.jsxs(Rt,{value:"upload",className:"pt-4 space-y-4",children:[s.jsx("div",{className:`flex flex-col items-center justify-center border-2 border-dashed rounded-md p-6 transition-colors ${h?"border-primary bg-primary/5":"border-gray-300 hover:border-gray-400"}`,onDragOver:w,onDragLeave:j,onDrop:N,children:i?s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx(Mt,{className:"h-10 w-10 text-chamber-blue animate-spin mb-2"}),s.jsx("p",{className:"text-sm text-gray-500",children:"Uploading photos..."})]}):s.jsxs(s.Fragment,{children:[s.jsx(vn,{className:"h-12 w-12 text-gray-400 mb-2"}),s.jsx("p",{className:"text-sm text-gray-500 mb-2",children:"Drag & drop your photos here or click to browse"}),s.jsxs("label",{htmlFor:"gallery-upload",className:"cursor-pointer flex items-center gap-2 text-sm py-1 px-3 border rounded bg-chamber-blue text-white hover:bg-chamber-blue/90 transition-colors",children:[s.jsx("span",{children:"Choose Files"}),s.jsx("input",{id:"gallery-upload",type:"file",accept:".jpg,.jpeg,.png",onChange:y,className:"sr-only",multiple:!0,disabled:i})]}),s.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"Maximum 10 photos, 2MB each, JPG or PNG"})]})}),n.length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("h4",{className:"text-sm font-medium",children:["Uploaded Photos (",n.length,")"]}),s.jsx(rx,{className:"h-56 w-full rounded-md border",children:s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-2 p-2",children:n.map((E,C)=>s.jsxs("div",{className:"relative group",children:[s.jsx(Qg,{ratio:16/9,children:s.jsx("img",{src:E,alt:`Gallery image ${C+1}`,className:"rounded-md object-cover w-full h-full"})}),s.jsx("button",{type:"button",onClick:()=>b(C),className:"absolute top-1 right-1 bg-black/70 rounded-full p-1 opacity-0 group-hover:opacity-100 transition-opacity","aria-label":"Remove image",children:s.jsx(Ir,{className:"h-4 w-4 text-white"})})]},C))})})]})]})]}),s.jsx(zh,{className:"text-xs mt-4",children:"Add photos of your business to showcase your products, services, or location. A good gallery helps attract customers."})]})}),s.jsx(Ln,{})]})})};var Ww="Checkbox",[Zne]=li(Ww),[Xne,Sk]=Zne(Ww);function Qne(t){const{__scopeCheckbox:e,checked:r,children:n,defaultChecked:a,disabled:i,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:h}=t,[f,m]=Lo({prop:r,defaultProp:a??!1,onChange:c,caller:Ww}),[g,y]=x.useState(null),[b,w]=x.useState(null),j=x.useRef(!1),N=g?!!o||!!g.closest("form"):!0,S={checked:f,disabled:i,setChecked:m,control:g,setControl:y,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:j,required:u,defaultChecked:Jh(a)?!1:a,isFormControl:N,bubbleInput:b,setBubbleInput:w};return s.jsx(Xne,{scope:e,...S,children:eae(h)?h(S):n})}var WL="CheckboxTrigger",qL=x.forwardRef(({__scopeCheckbox:t,onKeyDown:e,onClick:r,...n},a)=>{const{control:i,value:o,disabled:l,checked:c,required:u,setControl:d,setChecked:h,hasConsumerStoppedPropagationRef:f,isFormControl:m,bubbleInput:g}=Sk(WL,t),y=Cr(a,d),b=x.useRef(c);return x.useEffect(()=>{const w=i==null?void 0:i.form;if(w){const j=()=>h(b.current);return w.addEventListener("reset",j),()=>w.removeEventListener("reset",j)}},[i,h]),s.jsx(Zt.button,{type:"button",role:"checkbox","aria-checked":Jh(c)?"mixed":c,"aria-required":u,"data-state":YL(c),"data-disabled":l?"":void 0,disabled:l,value:o,...n,ref:y,onKeyDown:gt(e,w=>{w.key==="Enter"&&w.preventDefault()}),onClick:gt(r,w=>{h(j=>Jh(j)?!0:!j),g&&m&&(f.current=w.isPropagationStopped(),f.current||w.stopPropagation())})})});qL.displayName=WL;var Ck=x.forwardRef((t,e)=>{const{__scopeCheckbox:r,name:n,checked:a,defaultChecked:i,required:o,disabled:l,value:c,onCheckedChange:u,form:d,...h}=t;return s.jsx(Qne,{__scopeCheckbox:r,checked:a,defaultChecked:i,disabled:l,required:o,onCheckedChange:u,name:n,form:d,value:c,internal_do_not_use_render:({isFormControl:f})=>s.jsxs(s.Fragment,{children:[s.jsx(qL,{...h,ref:e,__scopeCheckbox:r}),f&&s.jsx(JL,{__scopeCheckbox:r})]})})});Ck.displayName=Ww;var GL="CheckboxIndicator",VL=x.forwardRef((t,e)=>{const{__scopeCheckbox:r,forceMount:n,...a}=t,i=Sk(GL,r);
690return s.jsx(fa,{present:n||Jh(i.checked)||i.checked===!0,children:s.jsx(Zt.span,{"data-state":YL(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:e,style:{pointerEvents:"none",...t.style}})})});VL.displayName=GL;var KL="CheckboxBubbleInput",JL=x.forwardRef(({__scopeCheckbox:t,...e},r)=>{const{control:n,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:o,required:l,disabled:c,name:u,value:d,form:h,bubbleInput:f,setBubbleInput:m}=Sk(KL,t),g=Cr(r,m),y=Mx(i),b=O0(n);x.useEffect(()=>{const j=f;if(!j)return;const N=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(N,"checked").set,C=!a.current;if(y!==i&&E){const T=new Event("click",{bubbles:C});j.indeterminate=Jh(i),E.call(j,Jh(i)?!1:i),j.dispatchEvent(T)}},[f,y,i,a]);const w=x.useRef(Jh(i)?!1:i);return s.jsx(Zt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??w.current,required:l,disabled:c,name:u,value:d,form:h,...e,tabIndex:-1,ref:g,style:{...e.style,...b,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});JL.displayName=KL;function eae(t){return typeof t=="function"}function Jh(t){return t==="indeterminate"}function YL(t){return Jh(t)?"indeterminate":t?"checked":"unchecked"}const Wl=x.forwardRef(({className:t,...e},r)=>s.jsx(Ck,{ref:r,className:xt("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...e,children:s.jsx(VL,{className:xt("flex items-center justify-center text-current"),children:s.jsx(un,{className:"h-4 w-4"})})}));Wl.displayName=Ck.displayName;const ZL=({isAccepted:t,onAcceptanceChange:e,disabled:r=!1,required:n=!0})=>{const[a,i]=x.useState(null),[o,l]=x.useState(!1),[c,u]=x.useState(!0);x.useEffect(()=>{d()},[]);const d=async()=>{try{u(!0);const m=await Kh.getActiveTerms();i(m)}catch(m){console.error("Error fetching active terms:",m)}finally{u(!1)}},h=()=>{l(!0)},f=m=>m.replace(/\*\*(.*?)\*\*/g,"<strong>$1</strong>").replace(/\*(.*?)\*/g,"<em>$1</em>").split(` 691`).map(g=>g.trim()).filter(g=>g.length>0).map(g=>g.match(/^\d+\./)?`<div class="mb-4"><h3 class="font-semibold text-base mb-2">${g}</h3></div>`:g.startsWith(" -")?`<div class="ml-6 mb-2 text-sm">${g.substring(4)}</div>`:`<div class="mb-2 text-sm leading-relaxed">${g}</div>`).join("");return c?s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("div",{className:"animate-pulse bg-gray-200 h-4 w-4 rounded"}),s.jsx("div",{className:"animate-pulse bg-gray-200 h-4 w-32 rounded"})]}):a?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-start space-x-2",children:[s.jsx(Wl,{id:"terms-acceptance",checked:t,onCheckedChange:e,disabled:r,className:"mt-1"}),s.jsx("div",{className:"flex-1",children:s.jsxs("label",{htmlFor:"terms-acceptance",className:"text-sm leading-relaxed cursor-pointer",children:["I agree to the"," ",s.jsxs("button",{type:"button",onClick:h,className:"text-chamber-blue hover:text-chamber-blue-dark underline inline-flex items-center gap-1 transition-colors",children:["Terms and Conditions",s.jsx(wx,{className:"w-3 h-3"})]}),n&&s.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})})]}),s.jsx(Tt,{open:o,onOpenChange:l,children:s.jsxs(Dt,{className:"max-w-4xl max-h-[90vh] h-full flex flex-col",children:[s.jsxs(It,{className:"flex-shrink-0",children:[s.jsxs(Ot,{className:"flex items-center gap-3",children:[s.jsx(ti,{className:"w-5 h-5 text-chamber-blue"}),a.title,s.jsxs(ke,{variant:"secondary",className:"text-xs",children:["v",a.version]})]}),s.jsx(rr,{className:"text-muted-foreground",children:"Please read our terms and conditions carefully before proceeding"})]}),s.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:s.jsx(rx,{className:"h-full pr-4",children:s.jsx("div",{className:"prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:f(a.content)}})})}),s.jsxs(Sr,{className:"flex-shrink-0 flex flex-col sm:flex-row justify-between items-center pt-4 border-t gap-3",children:[s.jsx("div",{className:"flex items-center gap-2 order-2 sm:order-1",children:s.jsxs(ke,{variant:"outline",className:"text-xs",children:["Last updated: ",new Date(a.updated_at).toLocaleDateString()]})}
691),s.jsxs("div",{className:"flex gap-3 order-1 sm:order-2",children:[s.jsx(Y,{variant:"outline",onClick:()=>l(!1),className:"min-w-[80px]",children:"Close"}),s.jsx(Y,{onClick:()=>{e(!0),l(!1)},className:"bg-chamber-blue hover:bg-chamber-blue-dark min-w-[120px]",children:"Accept Terms"})]})]})]})})]}):null},tae=({formData:t,isLoading:e,handleChange:r,handleBusinessTypeChange:n,handlePlaceSelect:a,handleCategorySelect:i,removeCategory:o,handleTagsChange:l,onBack:c,onSubmit:u,galleryFiles:d=[],setGalleryFiles:h=()=>{},galleryPreviews:f=[],setGalleryPreviews:m=()=>{},uploadingGallery:g=!1,logoFile:y=null,setLogoFile:b=()=>{},logoPreview:w="",setLogoPreview:j=()=>{},uploadingLogo:N=!1,coverImageFile:S=null,setCoverImageFile:E=()=>{},coverImagePreview:C="",setCoverImagePreview:T=()=>{},uploadingCoverImage:D=!1,termsAccepted:A=!1,setTermsAccepted:R=()=>{}})=>{const{categories:M,loading:P}=ck(),U=K0({defaultValues:{name:t.businessName,short_description:t.shortDescription,business_description:t.businessDescription,business_type:t.business_type,phone:t.phone,email:t.businessEmail||t.email,website:t.website,address:t.addressLine1,city:t.city,state:t.state,zipCode:t.zipCode,service_area_description:t.service_area_description,service_radius_miles:t.service_radius_miles,business_hours_json:t.business_hours_json,gallery_urls:t.gallery_urls,logo_url:t.logo_url,cover_image_url:t.cover_image_url,categories:t.categories.map(I=>({id:I.id,name:I.name,isPrimary:I.isPrimary}))}});return Oe.useEffect(()=>{console.log("Syncing formData to form:",{business_hours_json:t.business_hours_json,gallery_urls:t.gallery_urls}),U.setValue("business_hours_json",t.business_hours_json),U.setValue("gallery_urls",t.gallery_urls),U.setValue("logo_url",t.logo_url),U.setValue("cover_image_url",t.cover_image_url)},[t.business_hours_json,t.gallery_urls,t.logo_url,t.cover_image_url,U]),Oe.useEffect(()=>{const I=U.watch((O,{name:V})=>{V==="business_hours_json"&&O.business_hours_json&&Object.assign(t,{business_hours_json:O.business_hours_json}),V==="gallery_urls"&&O.gallery_urls&&Object.assign(t,{gallery_urls:O.gallery_urls}),V==="logo_url"&&O.logo_url&&Object.assign(t,{logo_url:O.logo_url}),V==="cover_image_url"&&O.cover_image_url&&Object.assign(t,{cover_image_url:O.cover_image_url})});return()=>I.unsubscribe()},[U,t]),s.jsxs("div",{className:"space-y-4",children:[s.jsx(gse,{formData:t,handleChange:r,isLoading:e,logoFile:y,setLogoFile:b,logoPreview:w,setLogoPreview:j,uploadingLogo:N,coverImageFile:S,setCoverImageFile:E,coverImagePreview:C,setCoverImagePreview:T,uploadingCoverImage:D,galleryPreviews:f,handlePlaceSelect:a}),s.jsx(kse,{formData:t,handleChange:r,handleBusinessTypeChange:n,handlePlaceSelect:a,isLoading:e}),s.jsx(_se,{formData:t,handleChange:r,isLoading:e}),s.jsx(Dse,{formData:t,handleChange:r,isLoading:e}),s.jsx(EB,{...U,children:s.jsxs(BB,{...U,children:[s.jsx(_L,{form:U}),s.jsx($L,{form:U,galleryFiles:d,setGalleryFiles:h,galleryPreviews:f,setGalleryPreviews:m,uploadingGallery:g})]})}),s.jsx(Tse,{formData:t,handleChange:r,isLoading:e}),s.jsx("div",{className:"space-y-4",children:P?s.jsxs("div",{className:"text-center py-4",children:[s.jsx(Mt,{className:"h-5 w-5 animate-spin mx-auto"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Loading categories..."})]}):s.jsx(uae,{categories:M,selectedCategories:t.categories,handleCategorySelect:i,removeCategory:o})}),s.jsx(Mse,{formData:t,handleTagsChange:l,isLoading:e}),s.jsx("div",{className:"border-t pt-4",children:s.jsx(ZL,{isAccepted:A,onAcceptanceChange:R,disabled:e,required:!0})}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 pt-4",children:[s.jsx(Y,{type:"button",onClick:c,variant:"outline",className:"flex-1",disabled:e,children:"Back to Personal Info"}),s.jsx(Y,{type:"submit",className:"flex-1 bg-chamber-blue hover:bg-chamber-blue-dark",disabled:e,onClick:u,children:e?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"})," Creating Account"]}):"Create Business Account"})]})]})};function XL(t,e=[]){let r=[];function n(i,o){const l=x.createContext(o);l.displayName=i+"Context";const c=r.length;r=[...r,o];const u=h=>{var w;const{scope:f,children:m,...g}=h,y=((w=f==null?void 0:f[t])==null?void 0:w[c])||l,b=x.useMemo(()=>g,Object.values(g));return s.jsx(y.Provider,{value:b,children:m})};u.displayName=i+"Provider";function d(h,f){var y;const m=((y=f==null?void 0:f[t])==null?void 0:y[c])||l,g=x.useContext(m);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${i}\``)}return[u,d]}const a=()=>{const i=r.map(o=>x.createContext(o));return function(l){const c=(l==null?void 0:l[t])||i;return x.useMemo(()=>({[`__scope${t}`]:{...l,[t]:c}}),[l,c])}};return a.scopeName=t,[n,rae(a,...e)]}function rae(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(a=>({useScope:a(),scopeName:a.scopeName}));
691return function(i){const o=n.reduce((l,{useScope:c,scopeName:u})=>{const h=c(i)[`__scope${u}`];return{...l,...h}},{});return x.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}var kk="Progress",_k=100,[sae]=XL(kk),[nae,aae]=sae(kk),QL=x.forwardRef((t,e)=>{const{__scopeProgress:r,value:n=null,max:a,getValueLabel:i=iae,...o}=t;(a||a===0)&&!E5(a)&&console.error(oae(`${a}`,"Progress"));const l=E5(a)?a:_k;n!==null&&!A5(n,l)&&console.error(lae(`${n}`,"Progress"));const c=A5(n,l)?n:null,u=k1(c)?i(c,l):void 0;return s.jsx(nae,{scope:r,value:c,max:l,children:s.jsx(dm.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":k1(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":rI(c,l),"data-value":c??void 0,"data-max":l,...o,ref:e})})});QL.displayName=kk;var eI="ProgressIndicator",tI=x.forwardRef((t,e)=>{const{__scopeProgress:r,...n}=t,a=aae(eI,r);return s.jsx(dm.div,{"data-state":rI(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...n,ref:e})});tI.displayName=eI;function iae(t,e){return`${Math.round(t/e*100)}%`}function rI(t,e){return t==null?"indeterminate":t===e?"complete":"loading"}function k1(t){return typeof t=="number"}function E5(t){return k1(t)&&!isNaN(t)&&t>0}function A5(t,e){return k1(t)&&!isNaN(t)&&t<=e&&t>=0}function oae(t,e){return`Invalid prop \`max\` of value \`${t}\` supplied to \`${e}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${_k}\`.`}function lae(t,e){return`Invalid prop \`value\` of value \`${t}\` supplied to \`${e}\`. The \`value\` prop must be: 692 - a positive number 693 - less than the value passed to \`max\` (or ${_k} if no \`max\` prop is set) 694 - \`null\` or \`undefined\` if the progress is indeterminate. 695 696Defaulting to \`null\`.`}var sI=QL,cae=tI;const nI=x.forwardRef(({className:t,value:e,...r},n)=>s.jsx(sI,{ref:n,className:xt("relative h-4 w-full overflow-hidden rounded-full bg-secondary",t),...r,children:s.jsx(cae,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(e||0)}%)`}})}));nI.displayName=sI.displayName;const uae=({categories:t,selectedCategories:e,handleCategorySelect:r,removeCategory:n})=>s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-lg font-medium",children:"Categories"}),e.length>0&&s.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:e.map(a=>s.jsxs(ke,{className:"pl-2 pr-1 py-1.5 flex items-center gap-1 text-sm",variant:a.isPrimary?"default":"secondary",children:[a.name,s.jsxs("span",{className:"text-xs ml-1 opacity-75",children:["(",a.isPrimary?"Primary":"Secondary",")"]}),s.jsx("button",{type:"button",onClick:()=>n(a.id),className:"ml-1 rounded-full hover:bg-destructive/20 p-1",children:s.jsx(Ir,{className:"h-3 w-3"})})]},a.id))}),s.jsx("div",{className:"flex flex-wrap gap-2",children:t.map(a=>{const i=e.some(o=>o.id===a.id);return s.jsxs("label",{className:`px-3 py-1.5 rounded-full text-sm border cursor-pointer transition-colors 697 ${i?"bg-chamber-blue text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}`,children:[s.jsx("input",{type:"checkbox",value:a.id,checked:i,onChange:()=>r(a.id,a.name),className:"sr-only"}),a.name]},a.id)})}),s.jsx("div",{className:"text-sm text-muted-foreground",children:e.length===0?s.jsx(s.Fragment,{children:"Select at least one category. The first selected will be Primary."}):e.length===1?s.jsx(s.Fragment,{children:"You can add 1 more category."}):null})]}),dae=({steps:t,isLoading:e})=>{const r=Object.values(t).filter(Boolean).length,n=Object.keys(t).length,a=r/n*100;return!e&&r===0?null:s.jsxs("div",{className:"space-y-2 mt-4",children:[s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{children:"Signup Progress"}),s.jsxs("span",{children:[r," of ",n," steps"]})]}),s.jsx(nI,{value:a,className:"h-2"}),s.jsxs("ul",{className:"text-xs space-y-1 text-gray-500",children:[t.authStarted&&s.jsx("li",{className:t.authCompleted?"text-green-600":"",children:t.authCompleted?"â User account created":"â³ Creating user account..."}),t.businessCreationStarted&&s.jsx("li",{className:t.businessCreationCompleted?"text-green-600":"",children:t.businessCreationCompleted?"â Business profile created":"â³ Creating business profile..."})]})]})},hae=()=>{const{activeTab:t,setActiveTab:e,formData:r,isLoading:n,signupSteps:a,handleChange:i,handleBusinessTypeChange:o,handlePlaceSelect:l,handleCategorySelect:c,removeCategory:u,handleTagsChange:d,validatePersonalInfo:h,handleSubmit:f,logoFile:m,setLogoFile:g,logoPreview:y,setLogoPreview:b,uploadingLogo:w,coverImageFile:j,setCoverImageFile:N,coverImagePreview:S,setCoverImagePreview:E,uploadingCoverImage:C,galleryFiles:T,setGalleryFiles:D,galleryPreviews:A,setGalleryPreviews:R,uploadingGallery:M,termsAccepted:P,setTermsAccepted:U}=Ure(),I=()=>{t==="personal"&&h()&&e("business")},O=()=>{e("personal")};return s.jsxs(De,{className:"w-full shadow-lg",children:[s.jsxs(ot,{children:[s.jsx(ut,{children:"Create Your Business Account"}),s.jsx(us,{children:"Fill in the required information to join our chamber of commerce"})]}),s.jsx(Be,{children:s.jsxs("form",{onSubmit:f,children:[s.jsxs(sn,{value:t,onValueChange:e,className:"w-full",children:[s.jsxs(Qs,{className:"grid grid-cols-2 mb-8",children:[s.jsx(Gt,{value:"personal",children:"Personal Information"}),s.jsx(Gt,{value:"business",children:"Business Information"})]}),s.jsx(Rt,{value:"personal",children:s.jsx(Hre,{formData:r,isLoading:n,handleChange:i,onNext:I})}),s.jsx(Rt,{value:"business",children:s.jsx(tae,{formData:r,isLoading:n,handleChange:i,handleBusinessTypeChange:o,handlePlaceSelect:l,handleCategorySelect:c,removeCategory:u,handleTagsChange:d,onBack:O,onSubmit:f,logoFile:m,setLogoFile:g,logoPreview:y,setLogoPreview:b,uploadingLogo:w,coverImageFile:j,setCoverImageFile:N,coverImagePreview:S,setCoverImagePreview:E,uploadingCoverImage:C,galleryFiles:T,setGalleryFiles:D,galleryPreviews:A,setGalleryPreviews:R,uploadingGallery:M,termsAccepted:P,setTermsAccepted:U})})]}),s.jsx(dae,{steps:a,isLoading:n})]})}),s.jsx(co,{className:"flex justify-center border-t pt-4",children:s.jsxs("p",{className:"text-sm text-gray-500",children:["Already have an account?"," ",s.jsx(rt,{to:"/auth/login",className:"text-chamber-blue hover:underline",children:"Sign in"})]})})]})},mae=()=>s.jsx("div",{className:"min-h-screen flex flex-col",children:s.jsx("div",{className:"flex-1 flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"w-full max-w-4xl space-y-8",children:[s.jsxs("div",{className:"text-center",children:[s.jsx(rt,{to:"/",className:"inline-block",children:s.jsx("span",{className:"font-bold text-2xl text-chamber-blue",children:"Valley Stream Chamber"})}),s.jsx("h2",{className:"mt-6 text-3xl font-bold tracking-tight text-gray-900",children:"Create a Business Account"}),s.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Join our community and promote your local business"})]}),s.jsx(hae,{})]})})}),fae=({formData:t,handleChange:e,isLoading:r})=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"firstName",children:"First Name"}),s.jsx(Ne,{id:"firstName",name:"firstName",value:t.firstName,onChange:e,placeholder:"John",required:!0,disabled:r})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"lastName",children:"Last Name"}),s.jsx(Ne,{id:"lastName",name:"lastName",value:t.lastName,onChange:e,placeholder:"Doe",required:!0,disabled:r})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"email",children:"Email"}),s.jsx(Ne,{id:"email",name:"email",type:"email",value:t.email,onChange:e,placeholder:"[email protected]",required:!0,disabled:r})]})]}),pae=()=>{const[t,e]=x.useState({firstName:"",lastName:"",email:"",password:"",confirmPassword:"",referralName:"",referralEmail:""}),[r,n]=x.useState(!1),[a,i]=x.useState(!1),[o,l]=x.useState(!1),c=ks(),{toast:u}=St(),[d]=Td();x.useEffect(()=>{const m=d.get("ref");m&&e(g=>({...g,referralEmail:m}))},[d]);const h=m=>{const{name:g,value:y}=m.target;e(b=>({...b,[g]:y}))},f=async m=>{if(m.preventDefault(),!t.firstName||!t.lastName||!t.email||!t.password||!t.confirmPassword){u({title:"Missing fields",description:"Please fill in all required fields",variant:"destructive"});return}if(t.password!==t.confirmPassword){u({title:"Passwords don't match",description:"Please make sure your passwords match",variant:"destructive"});return}if(t.password.length<8){u({title:"Password too short",description:"Password must be at least 8 characters long",variant:"destructive"});return}if(!a){u({title:"Terms acceptance required",description:"Please accept the terms and conditions to continue",variant:"destructive"});return}if(!o){u({title:"Confirmation required",description:"Please confirm that you do not own or c
697onduct any business to sign up as a resident.",variant:"destructive"});return}n(!0);try{const{data:g,error:y}=await Q.auth.signUp({email:t.email,password:t.password,options:{data:{first_name:t.firstName,last_name:t.lastName}}});if(y)throw y;if(g.user){const{error:b}=await Q.from("profiles").insert({id:g.user.id,first_name:t.firstName,last_name:t.lastName,email:t.email,user_type:"residential",referral_name:t.referralName||null,referral_email:t.referralEmail||null});if(b)throw b;const{error:w}=await Q.from("residential_profiles").insert({id:g.user.id,status:"pending"});if(w)throw w;if(t.referralEmail)try{const{data:j,error:N}=await Q.from("profiles").select("id, first_name, last_name, email").eq("email",t.referralEmail.toLowerCase()).single();if(j&&!N){const{error:S}=await Q.from("referrals").insert({referrer_id:j.id,referred_id:g.user.id,referrer_name:`${j.first_name} ${j.last_name}`,referrer_email:j.email,referred_name:`${t.firstName} ${t.lastName}`,referred_email:t.email,points_awarded:1,discount_percentage:10,subscription_required:!0,subscription_awarded:!1,total_points_awarded:0});S&&console.error("Error creating referral:",S)}}catch(j){console.error("Error processing referral:",j)}try{const j=await Kh.getActiveTerms();j&&await Kh.acceptTerms(j.id,j.version)}catch(j){console.error("Error accepting terms:",j)}u({title:"Account created",description:"Your residential account has been created successfully. Please check your email for the 6-digit verification code."}),c(`/auth/verify-otp?email=${encodeURIComponent(t.email)}`)}}catch(g){console.error("Signup error:",g),u({title:"Error",description:g.message||"An error occurred during sign up",variant:"destructive"})}finally{n(!1)}};return s.jsxs(De,{className:"w-full shadow-lg",children:[s.jsxs(ot,{children:[s.jsx(ut,{children:"Create a Residential Account"}),s.jsx(us,{children:"Join our chamber of commerce as a resident and support local businesses"})]}),s.jsx(Be,{children:s.jsxs("form",{onSubmit:f,className:"space-y-4",children:[s.jsx(fae,{formData:t,handleChange:h,isLoading:r}),s.jsx(Gf,{id:"password",name:"password",value:t.password,onChange:h,label:"Password",showHint:!0,disabled:r}),s.jsx(Gf,{id:"confirmPassword",name:"confirmPassword",value:t.confirmPassword,onChange:h,label:"Confirm Password",disabled:r}),s.jsxs("div",{className:"space-y-4 border-t pt-4",children:[s.jsx("h3",{className:"text-sm font-medium text-gray-700",children:"Referral Information (Optional)"}),s.jsx("p",{className:"text-xs text-gray-500",children:"If someone referred you to join, please provide their information below. They'll receive referral points and a 10% discount!"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"referralName",className:"block text-sm font-medium text-gray-700 mb-1",children:"Referrer's Name"}),s.jsx("input",{id:"referralName",name:"referralName",type:"text",value:t.referralName,onChange:h,disabled:r,className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-chamber-blue focus:border-chamber-blue",placeholder:"John Doe"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"referralEmail",className:"block text-sm font-medium text-gray-700 mb-1",children:"Referrer's Email"}),s.jsx("input",{id:"referralEmail",name:"referralEmail",type:"email",value:t.referralEmail,onChange:h,disabled:r,className:"w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-chamber-blue focus:border-chamber-blue",placeholder:"[email protected]"})]})]})]}),s.jsxs("div",{className:"border-t pt-4 space-y-3",children:[s.jsx(ZL,{isAccepted:a,onAcceptanceChange:i,disabled:r,required:!0}),s.jsxs("div",{className:"flex items-start space-x-2",children:[s.jsx(Wl,{id:"no-business-ownership",checked:o,onCheckedChange:m=>l(m===!0),disabled:r,className:"mt-1"}),s.jsxs("label",{htmlFor:"no-business-ownership",className:"text-sm leading-relaxed cursor-pointer",children:["I do not own or conduct any business.",s.jsx("span",{className:"text-red-500 ml-1",children:"*"})]})]})]}),s.jsx(Y,{type:"submit",className:"w-full bg-chamber-blue hover:bg-chamber-blue-dark",disabled:r,children:r?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"})," Creating Account"]}):"Create Residential Account"})]})}),s.jsx(co,{className:"flex justify-center border-t pt-4",children:s.jsxs("p",{className:"text-sm text-gray-500",children:["Already have an account?"," ",s.jsx(rt,{to:"/auth/login",className:"text-chamber-blue hover:underline",children:"Sign in"})]})})]})},gae=()=>s.jsx("div",{className:"min-h-screen flex flex-col",children:s.jsx("div",{className:"flex-1 flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"w-full max-w-md
697space-y-8",children:[s.jsxs("div",{className:"text-center",children:[s.jsx(rt,{to:"/",className:"inline-block",children:s.jsx("span",{className:"font-bold text-2xl text-chamber-blue",children:"Valley Stream Chamber"})}),s.jsx("h2",{className:"mt-6 text-3xl font-bold tracking-tight text-gray-900",children:"Create a Residential Account"}),s.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Join our community and support local businesses"})]}),s.jsx(pae,{})]})})}),xae=()=>{const[t,e]=x.useState(""),[r,n]=x.useState(!1),[a,i]=x.useState(!1),{toast:o}=St(),{resetPassword:l}=ts(),c=ks(),u=async d=>{if(d.preventDefault(),!t){o({title:"Error",description:"Please enter your email address",variant:"destructive"});return}n(!0);try{const{error:h}=await l(t);if(h){if(((h==null?void 0:h.message)||"").toLowerCase().includes("confirm your email first")){o({title:"Email not confirmed",description:h.message,variant:"destructive"}),c(`/auth/verify-otp?email=${encodeURIComponent(t)}`);return}o({title:"Error",description:h.message,variant:"destructive"})}else i(!0),o({title:"Reset email sent",description:"Check your email for password reset instructions"})}catch(h){o({title:"Error",description:h instanceof Error?h.message:"Unknown error",variant:"destructive"})}finally{n(!1)}};
697return a?s.jsxs(De,{className:"w-full max-w-md shadow-lg",children:[s.jsxs(ot,{className:"space-y-1 text-center",children:[s.jsx("div",{className:"mx-auto w-12 h-12 bg-green-100 rounded-full flex items-center justify-center mb-4",children:s.jsx(fs,{className:"w-6 h-6 text-green-600"})}),s.jsx(ut,{className:"text-2xl font-bold",children:"Check your email"}),s.jsxs(us,{children:["We've sent password reset instructions to ",s.jsx("strong",{children:t})]})]}),s.jsx(Be,{className:"space-y-4",children:s.jsxs(da,{children:[s.jsx(fs,{className:"h-4 w-4"}),s.jsx(ha,{children:"If you don't see the email, check your spam or junk folder. The reset link will expire in 1 hour."})]})}),s.jsxs(co,{className:"flex flex-col space-y-2",children:[s.jsx(Y,{variant:"outline",className:"w-full",onClick:()=>{i(!1),e("")},children:"Send another email"}),s.jsxs(rt,{to:"/auth/login",className:"text-sm text-chamber-blue hover:underline flex items-center justify-center gap-1",children:[s.jsx(pn,{className:"w-4 h-4"}),"Back to login"]})]})]}
697):s.jsxs(De,{className:"w-full max-w-md shadow-lg",children:[s.jsxs(ot,{className:"space-y-1",children:[s.jsx(ut,{className:"text-2xl font-bold",children:"Reset your password"}),s.jsx(us,{children:"Enter your email address and we'll send you a link to reset your password"})]}),s.jsx(Be,{children:s.jsxs("form",{onSubmit:u,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"email",children:"Email address"}),s.jsx(Ne,{id:"email",type:"email",placeholder:"[email protected]",value:t,onChange:d=>e(d.target.value),disabled:r,required:!0})]}),s.jsx(Y,{type:"submit",className:"w-full bg-chamber-blue hover:bg-chamber-blue-dark",disabled:r,children:r?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"})," Sending reset email"]}):"Send reset email"})]})}),s.jsx(co,{className:"flex justify-center border-t pt-4",children:s.jsxs(rt,{to:"/auth/login",className:"text-sm text-chamber-blue hover:underline flex items-center gap-1",children:[s.jsx(pn,{className:"w-4 h-4"}),"Back to login"]})})]})},yae=()=>s.jsx("div",{className:"min-h-screen flex flex-col",children:s.jsx("div",{className:"flex-1 flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"w-full max-w-md
697space-y-8",children:[s.jsxs("div",{className:"text-center",children:[s.jsx(rt,{to:"/",className:"inline-block",children:s.jsx("span",{className:"font-bold text-2xl text-chamber-blue",children:"Valley Stream Chamber"})}),s.jsx("h2",{className:"mt-6 text-3xl font-bold tracking-tight text-gray-900",children:"Forgot your password?"}),s.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"No worries, we'll send you reset instructions"})]}),s.jsx(xae,{})]})})}),bae=()=>{const[t,e]=x.useState(""),[r,n]=x.useState(""),[a,i]=x.useState(!1),[o,l]=x.useState(!1),[c,u]=x.useState(null),[d]=Td(),h=Wi(),f=ks(),{toast:m}=St(),{updatePassword:g}=ts();x.useEffect(()=>{(async()=>{console.log("Current URL:",window.location.href),console.log("Hash:",window.location.hash),console.log("Search params:",window.location.search);let j=d.get("access_token"),N=d.get("refresh_token"),S=d.get("type");if(console.log("From search params:",{accessToken:j,refreshToken:N,type:S}),!j&&window.location.hash){const C=new URLSearchParams(window.location.hash.substring(1));j=C.get("access_token"),N=C.get("refresh_token"),S=C.get("type"),console.log("From hash params:",{accessToken:j,refreshToken:N,type:S})}const{data:E}=await Q.auth.getSession();if(console.log("Current session:",E),E!=null&&E.session){console.log("User already has active session, proceeding to password reset form"),window.history.replaceState({},document.title,window.location.pathname);return}if(j&&N&&S==="recovery"){console.log("Token-based reset link detected");try{console.log("Setting session with tokens...");const{data:C,error:T}=await Q.auth.setSession({access_token:j,refresh_token:N});T?(console.error("Session error:",T),u("Invalid or expired reset link. Please request a new password reset.")):(console.log("Session set successfully:",C),window.history.replaceState({},document.title,window.location.pathname))}catch(C){console.error("Exception setting session:",C),u("Invalid or expired reset link. Please request a new password reset.")}}else console.log("No valid reset tokens found - checking for existing session or showing error"),E!=null&&E.session||u("Invalid or expired reset link. Please request a new password reset.")})()},[d,h]);const y=w=>w.length<8?"Password must be at least 8 characters long":/(?=.*[a-z])/.test(w)?/(?=.*[A-Z])/.test(w)?/(?=.*\d)/.test(w)?null:"Password must contain at least one number":"Password must contain at least one uppercase letter":"Password must contain at least one lowercase letter",b=async w=>{if(w.preventDefault(),!t||!r){m({title:"Error",description:"Please fill in all fields",variant:"destructive"});return}if(t!==r){m({title:"Error",description:"Passwords do not match",variant:"destructive"});return}const j=y(t);if(j){m({title:"Error",description:j,variant:"destructive"});return}i(!0);try{const{error:N}=await g(t);N?m({title:"Error",description:N.message,variant:"destructive"}):(l(!0),m({title:"Password updated",description:"Your password has been successfully updated"}),setTimeout(()=>{f("/auth/login",{state:{message:"Password updated successfully. Please log in with your new password."}})},2e3))}catch(N){m({title:"Error",description:N instanceof Error?N.message:"Unknown error",variant:"destructive"})}finally{i(!1)}};
697return c?s.jsxs(De,{className:"w-full max-w-md shadow-lg",children:[s.jsxs(ot,{className:"space-y-1 text-center",children:[s.jsx("div",{className:"mx-auto w-12 h-12 bg-red-100 rounded-full flex items-center justify-center mb-4",children:s.jsx(Ts,{className:"w-6 h-6 text-red-600"})}),s.jsx(ut,{className:"text-2xl font-bold",children:"Invalid Reset Link"}),s.jsx(us,{children:c})]}),s.jsx(Be,{className:"text-center",children:s.jsx(Y,{onClick:()=>f("/auth/forgot-password"),className:"w-full bg-chamber-blue hover:bg-chamber-blue-dark",children:"Request new reset link"})})]}):o?s.jsxs(De,{className:"w-full max-w-md shadow-lg",children:[s.jsxs(ot,{className:"space-y-1 text-center",children:[s.jsx("div",{className:"mx-auto w-12 h-12 bg-green-100 rounded-full flex items-center justify-center mb-4",children:s.jsx(Or,{className:"w-6 h-6 text-green-600"})}),s.jsx(ut,{className:"text-2xl font-bold",children:"Password Updated"}),s.jsx(us,{children:"Your password has been successfully updated. You will be redirected to the login page."})]}),s.jsx(Be,{className:"text-center",children:s.jsxs(da,{children:[s.jsx(Or,{className:"h-4 w-4"}),s.jsx(ha,{children:"Redirecting to login page..."})]})})]}
697):s.jsxs(De,{className:"w-full max-w-md shadow-lg",children:[s.jsxs(ot,{className:"space-y-1",children:[s.jsx(ut,{className:"text-2xl font-bold",children:"Set new password"}),s.jsx(us,{children:"Enter your new password below"})]}),s.jsx(Be,{children:s.jsxs("form",{onSubmit:b,className:"space-y-4",children:[s.jsx(Gf,{id:"password",name:"password",value:t,onChange:w=>e(w.target.value),label:"New Password",showHint:!0,disabled:a}),s.jsx(Gf,{id:"confirmPassword",name:"confirmPassword",value:r,onChange:w=>n(w.target.value),label:"Confirm New Password",disabled:a}),s.jsx(Y,{type:"submit",className:"w-full bg-chamber-blue hover:bg-chamber-blue-dark",disabled:a,children:a?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"})," Updating password"]}):"Update password"})]})})]})},vae=()=>s.jsx("div",{className:"min-h-screen flex flex-col",children:s.jsx("div",{className:"flex-1 flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"w-full max-w-md space-y-8",children:[s.jsxs("div",{className:"text-center",children:[s.jsx(rt,{to:"/",className:"inline-block",children:s.jsx("span",{className:"font-bold text-2xl text-chamber-blue",children:"Valley Stream Chamber"})}),s.jsx("h2",{className:"mt-6 text-3xl font-bold tracking-tight text-gray-900",children:"Reset your password"}),s.jsx("p",{className:"mt-2 text-sm text-gray-600",children:"Enter your new password below"})]}),s.jsx(bae,{})]})})}),wae=()=>{const t=ks();return x.useEffect(()=>{(async()=>{try{const r=new URLSearchParams(window.location.search),n=new URLSearchParams(window.location.hash.substring(1)),a=r.get("type")||n.get("type");if(console.log("AuthCallback - URL:",window.location.href),console.log("AuthCallback - Type detected:",a),a==="recovery"){console.log("Recovery flow detected, redirecting to reset password page");const l=window.location.search,c=window.location.hash;let u="/auth/reset-password";l?u+=l:c&&(u+="?"+c.substring(1)),console.log("Redirecting to:",u),window.location.replace(u);return}const{data:i,error:o}=await Q.auth.getSession();if(o){console.error("Auth callback error:",o),t("/auth/login",{state:{message:"Authentication failed. Please try again."}});return}i.session?(console.log("Regular login detected, redirecting to dashboard"),t("/dashboard")):(console.log("No session found, redirecting to login"),t("/auth/login"))}catch(r){console.error("Auth callback exception:",r),t("/auth/login",{state:{message:"Authentication failed. Please try again."}})}})()},[t]),s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-chamber-blue mx-auto"}),s.jsx("p",{className:"mt-4 text-gray-600",children:"Processing authentication..."})]})})},jae=({searchTerm:t,setSearchTerm:e,className:r="w-full md:w-1/2"})=>{const n=x.useRef(),a=x.useRef(),i=c=>{const u=c.target.value;u.length===1&&t.length===0&&(a.current=Date.now(),typeof window<"u"&&window.gtag&&window.gtag("event","search_start",{event_category:"business_search_behavior",search_context:"business_directory"})),e(u),n.current&&clearTimeout(n.current),u.length>0&&(n.current=setTimeout(()=>{const d=a.current?Date.now()-a.current:0;typeof window<"u"&&window.gtag&&window.gtag("event","search_completion",{search_term:u,search_length:u.length,search_duration_ms:d,event_category:"business_search_behavior"})},1e3)),u.length===0&&t.length>0&&typeof window<"u"&&window.gtag&&window.gtag("event","search_clear",{previous_search_term:t,event_category:"business_search_behavior"})},o=()=>{typeof window<"u"&&window.gtag&&window.gtag("event","search_focus",{event_category:"business_search_behavior",current_search_term:t})},l=()=>{typeof window<"u"&&window.gtag&&window.gtag("event","search_blur",{event_category:"business_search_behavior",final_search_term:t})};return x.useEffect(()=>()=>{n.current&&clearTimeout(n.current)},[]),s.jsxs("div",{className:`relative ${r}`,children:[s.jsx(Uc,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400",size:18}),s.jsx(Ne,{type:"text",placeholder:"Search businesses...",className:"pl-10",value:t,onChange:i,onFocus:o,onBlur:l})]})},D5=({categories:t,selectedCategory:e,setSelectedCategory:r,sortBy:n,setSortBy:a,isMobile:i=!1,showSortOptions:o=!0})=>s.jsxs("div",{className:`${i?"space-y-4":"flex items-center space-x-4 flex-grow"}`,children:[s.jsxs(Wt,{value:e,onValueChange:r,children:[s.jsx(Ht,{className:i?"w-full":"w-[180px]",children:s.jsx(qt,{placeholder:"All Categories"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"all",children:"All Categories"}),t.map(l=>s.jsx(Ae,{value:l.id,children:l.name},l.id))]})]}),o&&s.jsxs(Wt,{value:n,onValueChange:a,children:[s.jsx(Ht,{className:i?"w-full":"w-[180px]",children:s.jsx(qt,{placeholder:"Sort By"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"name",children:"Name (A-Z)"}),s.jsx(Ae,{value:"featured",children:"Featured First"})]})]})]}),Nae=({businesses:t,showEditButton:e=!1,onEditBusiness:r,onActivateBusiness:n,showStatusBadges:a=!1,onBusinessUpdated:i})=>t.length===0?s.jsxs("div",{className:"bg-gray-50 rounded-lg p-8 text-center",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-800 mb
697-2",children:"No businesses found"}),s.jsx("p",{className:"text-gray-600",children:"Try adjusting your search or filter criteria to find businesses."})]}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:t.map(o=>s.jsx(yR,{business:o,showEditButton:e,onEdit:r?()=>r(o):void 0,onActivate:n?()=>n(o):void 0,showStatusBadges:a,onBusinessUpdated:i},o.id))}),Fae=({currentPage:t,totalPages:e,itemsPerPage:r,setItemsPerPage:n,onPageChange:a,totalItems:i,indexOfFirstItem:o,indexOfLastItem:l})=>{const c=()=>{t>1&&a(t-1)},u=()=>{t<e&&a(t+1)},d=()=>{if(e<=1)return null;const h=[];if(e<=5)for(let f=1;f<=e;f++)h.push(s.jsx(Qr,{children:s.jsx(ca,{isActive:t===f,onClick:()=>a(f),children:f})},f));else{let m=Math.max(1,t-Math.floor(2.5)),g=Math.min(e,m+5-1);g-m+1<5&&(m=Math.max(1,g-5+1)),m>1&&(h.push(s.jsx(Qr,{children:s.jsx(ca,{onClick:()=>a(1),children:"1"})},"first")),m>2&&h.push(s.jsx(Qr,{children:s.jsx(nm,{})},"ellipsis-start")));for(let y=m;y<=g;y++)h.push(s.jsx(Qr,{children:s.jsx(ca,{isActive:t===y,onClick:()=>a(y),children:y})},y));g<e&&(g<e-1&&h.push(s.jsx(Qr,{children:s.jsx(nm,{})},"ellipsis-end")),h.push(s.jsx(Qr,{children:s.jsx(ca,{onClick:()=>a(e),children:e})},"last")))}return h};return s.jsxs("div",{className:"mt-8",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-center gap-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("span",{className:"text-sm text-gray-500",children:"Items per page:"}),s.jsxs(Wt,{value:String(r),onValueChange:h=>{n(Number(h)),a(1)},children:[s.jsx(Ht,{className:"w-[80px]",children:s.jsx(qt,{placeholder:"9"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"9",children:"9"}),s.jsx(Ae,{value:"12",children:"12"}),s.jsx(Ae,{value:"24",children:"24"}),s.jsx(Ae,{value:"48",children:"48"})]})]})]}),s.jsxs("div",{className:"text-sm text-gray-500",children:["Showing ",o+1,"-",Math.min(l,i)," of ",i," businesses"]})]}),s.jsx(Pd,{className:"mt-4",children:s.jsxs(Rd,{children:[s.jsx(Qr,{children:s.jsx(Bd,{onClick:c,className:t===1?"pointer-events-none opacity-50":"cursor-pointer"})}),d(),s.jsx(Qr,{children:s.jsx(Ld,{onClick:u,className:t===e?"pointer-events-none opacity-50":"cursor-pointer"})})]})})]})},l0=[{id:"1",ownerId:"101",name:"Riverside Cafe",description:"A cozy cafe offering specialty coffee, fresh pastries, and light meals in a relaxing riverside setting with outdoor seating.",logo_url:"https://images.unsplash.com/photo-1485827404703-89b55fcc595e?auto=format&fit=crop&w=150&h=150&q=80",website:"https://riversidecafe.example.com",phone:"(555) 123-4567",email:"[email protected]",categories:[{id:"1",name:"Food & Dining"},{id:"8",name:"Cafe"}],location:{id:"1",address:"123 River Road",city:"Anytown",state:"CA",zipCode:"90210",latitude:34.0522,longitude:-118.2437},status:"approved",featured:!0,createdAt:"2023-10-15T00:00:00.000Z",updatedAt:"2023-11-01T00:00:00.000Z"},{id:"2",ownerId:"102",name:"Tech Solutions Inc.",description:"Professional IT services including hardware repair, software installation, network setup, and cybersecurity solutions for small businesses.",logo_url:"https://images.unsplash.com/photo-1487058792275-0ad4aaf24ca7?auto=format&fit=crop&w=150&h=150&q=80",website:"https://techsolutions.example.com",phone:"(555) 987-6543",email:"[email protected]",categories:[{id:"2",name:"Technology"},{id:"7",name:"IT Services"}],location:{id:"2",address:"456 Tech Avenue",city:"Digital Valley",state:"CA",zipCode:"94103",latitude:37.7749,longitude:-122.4194},status:"approved",featured:!0,createdAt:"2023-09-05T00:00:00.000Z",updatedAt:"2023-09-05T00:00:00.000Z"},{id:"3",ownerId:"103",name:"Green Thumb Landscaping",description:"Comprehensive landscaping services including lawn care, garden design, irrigation systems, and hardscape installation for residential and commercial properties.",logo_url:"https://images.unsplash.com/photo-1581091226825-a6a2a5aee158?auto=format&fit=crop&w=150&h=150&q=80",website:"https://greenthumb.example.com",phone:"(555) 456-7890",email:"[email protected]",categories:[{id:"3",name:"Home & Garden"},{id:"9",name:"Landscaping"}],location:{id:"3",address:"789 Garden Way",city:"Greenville",state:"CA",zipCode:"93001",latitude:34.2805,longitude:-119.2945},status:"approved",featured:!0,createdAt:"2023-08-12T00:00:00.000Z",updatedAt:"2023-08-12T00:00:00.000Z"},{id:"4",ownerId:"104",name:"Downtown Fitness Center",description:"Full-service fitness center featuring state-of-the-art equipment, group classes, personal training, and wellness programs for all fitness levels.",logo_url:"https://images.unsplash.com/photo-1605810230434-7631ac76ec81?auto=format&fit=crop&w=150&h=150&q=80",website:"https://downtownfitness.example.com",phone:"(555) 234-5678",email:"[email protected]",categories:[{id:"4",name:"Health & Wellness"},{id:"10",name:"Fitness"}],location:{id:"4",address:"101 Fitness Blvd",city:"Healthyville",state:"CA",zipCode:"92037",latitude:32.8328,longitude:-117.2713},status:"approved",featured:!1,createdAt:"2023-11-20T00:00:00.000Z",updatedAt:"2023-11-20T00:00:00.000Z"},{id:"5",ownerId:"105",name:"Bluebird Bookstore",description:"Independent bookstore offering a curated selection of books across all genres, with regular author events, reading groups, and a cozy in-store cafe.",logo_url:"https://images.unsplash.com/photo-1519389950473-47ba0277781c?auto=format&fit=crop&w=150&h=150&q=80",website:"https://bluebirdbookstore.example.com",phone:"(555) 345-6789",email:"[email protected]",categories:[{id:"5",name:"Retail"},{id:"11",name:"Bookstore"}],location:{id:"5",address:"202 Book Lane",city:"Literarytown",state:"CA",zipCode:"92067",latitude:33.0242,longitude:-117.2701},status:"approved",featured:!1,createdAt:"2023-10-05T00:00:00.000Z",updatedAt:"2023-10-05T00:00:00.000Z"}
697,{id:"6",ownerId:"106",name:"Sunlight Solar Systems",description:"Residential and commercial solar panel installation, energy audits, battery backup systems, and renewable energy consulting services.",logo_url:"https://images.unsplash.com/photo-1461749280684-dccba630e2f6?auto=format&fit=crop&w=150&h=150&q=80",website:"https://sunlightsolar.example.com",phone:"(555) 456-7890",email:"[email protected]",categories:[{id:"6",name:"Energy"},{id:"12",name:"Home Services"}],location:{id:"6",address:"303 Solar Drive",city:"Sunnyside",state:"CA",zipCode:"91302",latitude:34.1478,longitude:-118.6257},status:"approved",featured:!1,createdAt:"2023-07-15T00:00:00.000Z",updatedAt:"2023-07-15T00:00:00.000Z"},{id:"7",ownerId:"107",name:"Harbor View Restaurant",description:"Upscale dining with panoramic waterfront views, specializing in fresh seafood and locally sourced ingredients with an extensive wine list.",logo_url:"https://images.unsplash.com/photo-1498050108023-c5249f4df085?auto=format&fit=crop&w=150&h=150&q=80",website:"https://harborview.example.com",phone:"(555) 567-8901",email:"[email protected]",categories:[{id:"1",name:"Food & Dining"}],location:{id:"7",address:"789 Harbor Drive",city:"Bayside",state:"CA",zipCode:"94133",latitude:37.8099,longitude:-122.4103},status:"approved",featured:!0,createdAt:"2023-12-01T00:00:00.000Z",updatedAt:"2023-12-01T00:00:00.000Z"},{id:"8",ownerId:"108",name:"Community Credit Union",description:"Member-owned financial cooperative offering personal and business banking services, loans, mortgages, and financial education resources.",logo_url:"https://images.unsplash.com/photo-1460925895917-afdab827c52f?auto=format&fit=crop&w=150&h=150&q=80",website:"https://communitycredit.example.com",phone:"(555) 678-9012",email:"[email protected]",categories:[{id:"13",name:"Financial Services"}],location:{id:"8",address:"456 Financial Way",city:"Commerce",state:"CA",zipCode:"91789",latitude:34.0522,longitude:-117.7505},status:"approved",featured:!1,createdAt:"2024-01-10T00:00:00.000Z",updatedAt:"2024-01-10T00:00:00.000Z"},{id:"9",ownerId:"109",name:"Evergreen Dental Care",description:"Full-service dental practice offering preventive care, cosmetic dentistry, orthodontics, and emergency services in a comfortable, family-friendly environment.",logo_url:"https://images.unsplash.com/photo-1473091534298-04dcbce3278c?auto=format&fit=crop&w=150&h=150&q=80",website:"https://evergreendentalcare.example.com",phone:"(555) 789-0123",email:"[email protected]",categories:[{id:"4",name:"Health & Wellness"}],location:{id:"9",address:"123 Health Street",city:"Wellville",state:"CA",zipCode:"93003",latitude:34.2577,longitude:-119.2429},status:"approved",featured:!1,createdAt:"2023-09-22T00:00:00.000Z",updatedAt:"2023-09-22T00:00:00.000Z"},{id:"10",ownerId:"110",name:"Hometown Brewery",description:"Craft brewery and taproom featuring handcrafted beers, brewery tours, tasting events, and a rotating menu of food from local vendors.",logo_url:"https://images.unsplash.com/photo-1481833761820-0509d3217039?auto=format&fit=crop&w=150&h=150&q=80",website:"https://hometownbrewery.example.com",phone:"(555) 890-1234",email:"[email protected]",categories:[{id:"1",name:"Food & Dining"}],location:{id:"10",address:"567 Brew Lane",city:"Craftville",state:"CA",zipCode:"93101",latitude:34.4208,longitude:-119.6982},status:"approved",featured:!0,createdAt:"2023-11-05T00:00:00.000Z",updatedAt:"2023-11-05T00:00:00.000Z"},{id:"11",ownerId:"111",name:"Artistic Impressions Gallery",description:"Contemporary art gallery showcasing local and international artists with monthly exhibitions, artist talks, and educational workshops.",logo_url:"https://images.unsplash.com/photo-1581092795360-fd1ca04f0952?auto=format&fit=crop&w=150&h=150&q=80",website:"https://artisticimpressions.example.com",phone:"(555) 901-2345",email:"[email protected]",categories:[{id:"14",name:"Arts & Culture"}],location:{id:"11",address:"789 Creative Avenue",city:"Artstown",state:"CA",zipCode:"94102",latitude:37.7749,longitude:-122.4194},status:"approved",featured:!1,createdAt:"2023-10-15T00:00:00.000Z",updatedAt:"2023-10-15T00:00:00.000Z"},{id:"12",ownerId:"112",name:"Urban Pet Supply",description:"Premium pet store offering natural foods, toys, accessories, grooming services, and pet adoption events in partnership with local shelters.",logo_url:"https://images.unsplash.com/photo-1535268647677-300dbf3d78d1?auto=format&fit=crop&w=150&h=150&q=80",website:"https://urbanpetsupply.example.com",phone:"(555) 012-3456",email:"[email protected]",categories:[{id:"5",name:"Retail"},{id:"15",name:"Pet Services"}],location:{id:"12",address:"234 Pet Lane",city:"Animalville",state:"CA",zipCode:"92008",latitude:33.1581,longitude:-117.3506},status:"approved",featured:!1,createdAt:"2023-08-25T00:00:00.000Z",updatedAt:"2023-08-25T00:00:00.000Z"},{id:"13",ownerId:"113",name:"Serenity Day Spa",description:"Luxury day spa offering massage therapy, facials, body treatments, nail care, and specialized wellness packages in a tranquil environment.",logo_url:"https://images.unsplash.com/photo-1537480246937-1d8c76a88ecf?auto=format&fit=crop&w=150&h=150&q=80",website:"https://serenitydayspa.example.com",phone:"(555) 123-4567",email:"[email protected]",categories:[{id:"4",name:"Health & Wellness"}],location:{id:"13",address:"345 Relaxation Road",city:"Calmsborough",state:"CA",zipCode:"92037",latitude:32.8328,longitude:-117.2713},status:"approved",featured:!0,createdAt:"2023-12-15T00:00:00.000Z",updatedAt:"2023-12-15T00:00:00.000Z"},{id:"14",ownerId:"114",name:"Summit Legal Partners",description:"Full-service law firm specializing in business law, estate planning, family law, and real estate with personalized client service.",logo_url:"https://images.unsplash.com/photo-1521171707779-dbdc0bf28333?auto=format&fit=crop&w=150&h=150&q=80",website:"https://summitlegalpartners.example.com",phone:"(555) 234-5678",email:"[email protected]",categories:[{id:"16",name:"Professional Services"},{id:"17",name:"Legal"}],location:{id:"14",address:"567 Justice Avenue",city:"Lawton",state:"CA",zipCode:"94108",latitude:37.7929,longitude:-122.4078},status:"approved",featured:!1,createdAt:"2023-09-05T00:00:00.000Z",updatedAt:"2023-09-05T00:00:00.000Z"},{id:"15",ownerId:"115",name:"Heritage Home Furnishings",description:"Family-owned furniture store offering high-quality home furnishings, interior design services, and custom furniture options.",logo_url:"https://images.unsplash.com/photo-1524758631624-e2822e304c36?auto=format&fit=crop&w=150&h=150&q=80",website:"https://heritagehome.example.com",phone:"(555) 345-6789",email:"[email protected]",categories:[{id:"5",name:"Retail"},{id:"3",name:"Home & Garden"}],location:{id:"15",address:"678 Furniture Boulevard",city:"Homeville",state:"CA",zipCode:"91304",latitude:34.2013,longitude:-118.5739},status:"approved",featured:!1,createdAt:"2023-07-20T00:00:00.000Z",updatedAt:"2023-07-20T00:00:00.000Z"},{id:"16",ownerId:"116",name:"Peak Performance Auto Service",description:"Full-service auto repair shop offering maintenance, diagnostics, major repairs, and state inspections with certified mechanics.",logo_url:"https://images.unsplash.com/photo-1434494878577-86c23bcb06b9?auto=format&fit=crop&w=150&h=150&q=80",website:"https://peakperformanceauto.example.com",phone:"(555) 456-7890",email:"[email protected]",categories:[{id:"18",name:"Automotive"},{id:"19",name:"Auto Repair"}],location:{id:"16",address:"789 Motor Way",city:"Mechanicsburg",state:"CA",zipCode:"92071",latitude:32.8382,longitude:-116.9861},status:"approved",featured:!1,createdAt:"2023-11-10T00:00:00.000Z",updatedAt:"2023-11-10T00:00:00.000Z"},{id:"17",ownerId:"117",name:"Blossom Floral Design",description:"Boutique florist creating custom floral arrangements for weddings, events, corporate clients, and everyday occasions with delivery service.",logo_url:"https://images.unsplash.com/photo-1525310072745-f49212b5ac6d?auto=format&fit=crop&w=150&h=150&q=80",website:"https://blossomfloral.example.com",phone:"(555) 567-8901",email:"[email protected]",categories:[{id:"5",name:"Retail"},{id:"20",name:"Florist"}],location:{id:"17",address:"890 Flower Street",city:"Petalhaven",state:"CA",zipCode:"90403",latitude:34.0195,longitude:-118.4912},status:"approved",featured:!0,createdAt:"2023-10-10T00:00:00.000Z",updatedAt:"2023-10-10T00:00:00.000Z"},{id:"18",ownerId:"118",name:"Cornerstone Construction",description:"Licensed general contractor specializing in residential and commercial construction, remodeling, and renovation projects with design services.",logo_url:"https://images.unsplash.com/photo-1487958449943-2429e8be8625?auto=format&fit=crop&w=150&h=150&q=80",website:"https://cornerstoneconstruction.example.com",phone:"(555) 678
697-9012",email:"[email protected]",categories:[{id:"21",name:"Construction"},{id:"12",name:"Home Services"}],location:{id:"18",address:"901 Builder Avenue",city:"Constructville",state:"CA",zipCode:"95820",latitude:38.5499,longitude:-121.4382},status:"approved",featured:!1,createdAt:"2023-08-05T00:00:00.000Z",updatedAt:"2023-08-05T00:00:00.000Z"},{id:"19",ownerId:"119",name:"Vintage Vinyl Records",description:"Specialty music store selling new and used vinyl records, turntables, and accessories with knowledgeable staff and in-store performances.",logo_url:"https://images.unsplash.com/photo-1483058712412-4245e9b90334?auto=format&fit=crop&w=150&h=150&q=80",website:"https://vintagevinyl.example.com",phone:"(555) 789-0123",email:"[email protected]",categories:[{id:"5",name:"Retail"},{id:"22",name:"Music"}],location:{id:"19",address:"012 Music Lane",city:"Melodytown",state:"CA",zipCode:"92104",latitude:32.7503,longitude:-117.1298},status:"approved",featured:!1,createdAt:"2023-12-20T00:00:00.000Z",updatedAt:"2023-12-20T00:00:00.000Z"},{id:"20",ownerId:"120",name:"Evergreen Investment Advisors",description:"Independent financial advisory firm offering investment management, retirement planning, tax strategies, and wealth preservation services.",logo_url:"https://images.unsplash.com/photo-1454165804606-c3d57bc86b40?auto=format&fit=crop&w=150&h=150&q=80",website:"https://evergreeninvestments.example.com",phone:"(555) 890-1234",email:"[email protected]",categories:[{id:"13",name:"Financial Services"},{id:"23",name:"Investment"}],location:{id:"20",address:"123 Wealth Street",city:"Prosperityville",state:"CA",zipCode:"94111",latitude:37.8002,longitude:-122.4003},status:"approved",featured:!0,createdAt:"2023-09-15T00:00:00.000Z",updatedAt:"2023-09-15T00:00:00.000Z"},{id:"21",ownerId:"121",name:"Fresh Harvest Market",description:"Local grocery store specializing in organic produce, artisanal foods, and specialty items sourced from local farmers and producers.",logo_url:"https://images.unsplash.com/photo-1488972685288-c3fd157d7c7a?auto=format&fit=crop&w=150&h=150&q=80",website:"https://freshharvestmarket.example.com",phone:"(555) 901-2345",email:"[email protected]",categories:[{id:"1",name:"Food & Dining"},{id:"24",name:"Grocery"}],location:{id:"21",address:"234 Market Street",city:"Freshville",state:"CA",zipCode:"92880",latitude:33.9514,longitude:-117.4587},status:"approved",featured:!1,createdAt:"2023-11-15T00:00:00.000Z",updatedAt:"2023-11-15T00:00:00.000Z"},{id:"22",ownerId:"122",name:"Precision Watch Repair",description:"Specialized watch repair service offering maintenance, restoration, and repairs for luxury watches and antique timepieces by certified watchmakers.",logo_url:"https://images.unsplash.com/photo-1581092795360-fd1ca04f0952?auto=format&fit=crop&w=150&h=150&q=80",website:"https://precisionwatchrepair.example.com",phone:"(555) 012-3456",email:"[email protected]",categories:[{id:"16",name:"Professional Services"},{id:"25",name:"Repair"}],location:{id:"22",address:"345 Time Avenue",city:"Clocktown",state:"CA",zipCode:"92660",latitude:33.6189,longitude:-117.8738},status:"approved",featured:!1,createdAt:"2023-10-01T00:00:00.000Z",updatedAt:"2023-10-01T00:00:00.000Z"}],aI=t=>["random_business_order",t.category||"all",t.status||"approved",t.featured?"featured":"",t.excludeFeatured?"exclude_featured":"",t.search||"",t.ownerId||""].filter(Boolean).join("_"),Sae=async t=>{const{ownerId:e,category:r,status:n="approved",featured:a,excludeFeatured:i,search:o}=t;try{let l=Q.from("business_profiles").select("id");if(n!=="all"&&(l=l.eq("status",n)),e&&(l=l.eq("owner_id",e)),a!==void 0&&(l=l.eq("featured",a)),i&&(l=l.eq("featured",!1)),o){const{data:f,error:m}=await Q.rpc("search_businesses_by_name_tags_categories",{search_term:o,status_filter:n,category_filter:r&&r!=="all"?r:null,featured_filter:a,exclude_featured_filter:i,owner_filter:e,limit_count:1e3,offset_count:0});if(m){console.error("Error in search function:",m);const g=`%${o}%`;l=l.ilike("business_name",g)}else if(f&&f.length>0){const g=f.map(y=>y.id);l=l.in("id",g)}else return[]}if(!o&&r&&r!=="all"){const{data:f,error:m}=await Q.from("business_category_junction").select("business_id").eq("category_id",r);
697if(m)return console.error("Error fetching category businesses:",m),[];if(!f||f.length===0)return[];const g=f.map(y=>y.business_id);l=l.in("id",g)}const{data:c,error:u}=await l;if(u)return console.error("Error fetching business IDs:",u),[];if(!c||c.length===0)return[];const h=[...c.map(f=>f.id)];for(let f=h.length-1;f>0;f--){const m=Math.floor(Math.random()*(f+1));[h[f],h[m]]=[h[m],h[f]]}return h}catch(l){return console.error("Unexpected error fetching random business IDs:",l),[]}},Cae=async(t={})=>{const{ownerId:e,category:r,status:n="approved",featured:a,excludeFeatured:i,search:o,limit:l=10,offset:c=0}=t;console.log("Fetching random businesses with filters:",{ownerId:e,category:r,status:n,featured:a,excludeFeatured:i,search:o,limit:l,offset:c});try{const u=aI(t);let d=[],h=!1;if(typeof window<"u"){const E=sessionStorage.getItem(u);if(E)try{d=JSON.parse(E),d.length>0&&(console.log("Using cached random order with",d.length,"businesses"),h=!0)}catch(C){console.warn("Failed to parse cached random order:",C),sessionStorage.removeItem(u)}}if((!h||d.length===0)&&(console.log("Generating new random business order for filters:",t),d=await Sae(t),typeof window<"u"&&d.length>0&&sessionStorage.setItem(u,JSON.stringify(d))),d.length===0)return console.log("No businesses found matching criteria"),{businesses:[],count:0};const f=d.length,m=d.slice(c,c+l);if(m.length===0)return console.log("No businesses for current page"),{businesses:[],count:f};console.log("Fetching businesses for page with IDs:",m);const{data:g,error:y}=await Q.from("business_profiles").select("*").in("id",m);if(y)return console.error("Error fetching business data:",y),{businesses:[],count:0};if(!g||g.length===0)return console.log("No business data found for IDs"),{businesses:[],count:f};const b=m.map(E=>g.find(C=>C.id===E)).filter(Boolean),w=b.map(E=>E.id),{data:j,error:N}=await Q.from("business_category_junction").select(` 698 business_id, 699 is_primary, 700 business_category (id, name) 701 `).in("business_id",w);if(!N&&j&&j.length>0){const E=j.reduce((C,T)=>{const D=T.business_id;return C[D]||(C[D]=[]),C[D].push({id:T.business_category.id,name:T.business_category.name,isPrimary:T.is_primary}),C},{});b.forEach(C=>{C.categories=E[C.id]||[]})}else{const{data:E,error:C}=await Q.from("business_categories").select("*").in("business_id",w);if(!C&&E&&E.length>0){const T=E.reduce((D,A)=>{const R=A.business_id;return D[R]||(D[R]=[]),D[R].push(A),D},{});b.forEach(D=>{D.business_categories=T[D.id]||[]})}}return console.log(`Fetched ${b.length} random businesses (page ${Math.floor(c/l)+1}) with total count: ${f}`),{businesses:b.map(Sd),count:f}}catch(u){return console.error("Unexpected error fetching random businesses:",u),{businesses:[],count:0}}},Ly=async(t={})=>{const{ownerId:e,category:r,status:n="approved",featured:a,excludeFeatured:i,search:o,limit:l=10,offset:c=0}=t;console.log("Fetching businesses with filters:",{ownerId:e,category:r,status:n,featured:a,excludeFeatured:i,search:o,limit:l,offset:c});try{let u=Q.from("business_profiles").select("*",{count:"exact"});if(n!=="all"&&(u=u.eq("status",n)),e&&(u=u.eq("owner_id",e)),a!==void 0&&(u=u.eq("featured",a)),i&&(u=u.eq("featured",!1)),o){const{data:w,error:j,count:N}=await Q.rpc("search_businesses_by_name_tags_categories",{search_term:o,status_filter:n,category_filter:r&&r!=="all"?r:null,featured_filter:a,exclude_featured_filter:i,owner_filter:e,limit_count:l,offset_count:c},{count:"exact"});return j?(console.error("Error in search function:",j),{businesses:[],count:0}):(console.log(`Found ${(w==null?void 0:w.length)||0} businesses matching search "${o}"`),{businesses:(w==null?void 0:w.map(Sd))||[],count:N||0})}if(r&&r!=="all"){const{data:w,error:j}=await Q.from("business_category_junction").select("business_id").eq("category_id",r);if(j)return console.error("Error fetching category businesses:",j),{businesses:[],count:0};if(!w||w.length===0)return console.log("No businesses found for category:",r),{businesses:[],count:0};const N=w.map(S=>S.business_id);u=u.in("id",N)}u=u.order("created_at",{ascending:!1}).range(c,c+l-1),console.log("Executing query with filters applied");const{data:d,error:h,count:f}=await u;if(h)return console.error("Error fetching businesses:",h),n!=="approved"?R2(t):{businesses:[],count:0};if(console.log("Fetched raw business data:",d),console.log("Total count from Supabase:",f),!d||d.length===0)return n!=="approved"?(console.log("No data in database, returning mock data"),R2(t)):{businesses:[],count:f||0};const m=d.map(w=>w.id),{data:g,error:y}=await Q.from("business_category_junction").select(` 702 business_id, 703 is_primary, 704 business_category (id, name) 705 `).in("business_id",m);if(!y&&g&&g.length>0){const w=g.reduce((j,N)=>{const S=N.business_id;return j[S]||(j[S]=[]),j[S].push({id:N.business_category.id,name:N.business_category.name,isPrimary:N.is_primary}),j},{});d.forEach(j=>
705{j.categories=w[j.id]||[]})}else{const{data:w,error:j}=await Q.from("business_categories").select("*").in("business_id",m);if(!j&&w&&w.length>0){const N=w.reduce((S,E)=>{const C=E.business_id;return S[C]||(S[C]=[]),S[C].push(E),S},{});d.forEach(S=>{S.business_categories=N[S.id]||[]})}}console.log(`Fetched ${d.length} businesses from Supabase with total count: ${f}`);const b=d.map(Sd);return{businesses:b,count:f||b.length}}catch(u){return console.error("Unexpected error fetching businesses:",u),R2(t)}},kae=t=>{if(!(typeof window>"u")){if(t){const e=aI(t);sessionStorage.removeItem(e)}else{const e=[];for(let r=0;r<sessionStorage.length;r++){const n=sessionStorage.key(r);n&&n.startsWith("random_business_order")&&e.push(n)}e.forEach(r=>sessionStorage.removeItem(r))}console.log("Cleared random order cache")}},R2=(t={})=>{console.log("Using mock data as fallback");let e=[...l0];if(t.ownerId&&(e=e.filter(i=>i.ownerId===t.ownerId)),t.category&&t.category!=="all"&&(e=e.filter(i=>i.categories.some(o=>o.id===t.category))),t.status&&t.status!=="all"&&(e=e.filter(i=>i.status===t.status)),t.featured!==void 0&&(e=e.filter(i=>i.featured===t.featured)),t.excludeFeatured&&(e=e.filter(i=>!i.featured)),t.search){const i=t.search.toLowerCase();e=e.filter(o=>o.name.toLowerCase().includes(i)||o.tags&&o.tags.some(l=>l.toLowerCase().includes(i)))}const r=t.offset||0,n=t.limit||10;return{businesses:e.slice(r,r+n),count:e.length}},Fy=({showFilters:t=!0,showSearch:e=!0,limit:r,featuredOnly:n=!1,ownerOnly:a=!1,showEditButton:i=!1,onEditBusiness:o,onActivateBusiness:l,status:c="approved",showStatusBadges:u=!1,excludeFeatured:d=!1,useRandomOrder:h=!1})=>{const{toast:f}=St(),{user:m}=ts(),{categories:g,loading:y}=ck(),[b,w]=x.useState(""),[j,N]=x.useState("all"),[S,E]=x.useState("name"),[C,T]=x.useState(!1),[D,A]=x.useState(1),[R,M]=x.useState(9),[P,U]=x.useState([]),[I,O]=x.useState(0),[V,G]=x.useState(!1),[B,$]=x.useState(!0),[W,oe]=x.useState(null),K=x.useRef(),H=x.useRef(0),X=Math.ceil(I/R),me=(D-1)*R,ie=Math.min(me+R,I),ee=x.useRef(""),he=x.useRef(!0);x.useEffect(()=>{A(1)},[b,j,d,n,a,c,h,m==null?void 0:m.id]),x.useEffect(()=>{if(he.current){he.current=!1;return}if(h){const re={category:j!=="all"?j:void 0,search:b||void 0,featured:n||void 0,excludeFeatured:d,ownerId:a&&m?m.id:void 0,status:c},we=JSON.stringify(re);ee.current!==""&&ee.current!==we&&(console.log("Filters changed, clearing cache:",re),kae(re),$(!0)),ee.current=we}},[b,j,d,n,a,c,h,m==null?void 0:m.id]);const ve=x.useCallback(()=>{K.current&&clearTimeout(K.current),K.current=setTimeout(async()=>{const re=++H.current;G(!0),oe(null);try{console.log("Fetching businesses with params:",{category:j!=="all"?j:void 0,search:b,featured:n||void 0,limit:r||R,offset:r?0:(D-1)*R,ownerId:a&&m?m.id:void 0,status:c});const we=h?Cae:Ly,{businesses:Ee,count:Me}=await we({category:j!=="all"?j:void 0,search:b,featured:n||void 0,excludeFeatured:d,limit:r||R,offset:r?0:(D-1)*R,ownerId:a&&m?m.id:void 0,status:c});if(re!==H.current){console.log("Ignoring outdated fetch result");return}console.log("Fetched businesses:",Ee),console.log("Total count:",Me);let ae=Ee;if(h||(ae=[...Ee].sort((ze,mt)=>S==="name"?ze.name.localeCompare(mt.name):S==="featured"?(mt.featured?1:0)-(ze.featured?1:0):0)),ae&&ae.length>=0){U(ae),O(Me);const ze=ae.map(tt=>tt.name);b&&Ia.searchBusinesses(b,ae.length,ze),j!=="all"&&Ia.filterBusinesses("category",j,ze),!b&&j==="all"&&Ia.viewBusinessDirectory(ze,Me,D);const mt=b?`search_results:${b}`:j!=="all"?`category_filter:${j}`:`directory_page:${D}`;Ya.trackBusinessImpressions(ae,mt)}}catch(we){console.error("Error fetching businesses:",we),oe("Failed to load businesses. Please try again later."),f({title:"Error loading businesses",description:"There was a problem loading the business directory. Please try again.",variant:"destructive"})}finally{G(!1),$(!1)}},300)},[m,n,r,R,D,a,b,j,S,c,d,h,f]);x.useEffect(()=>(ve(),()=>{K.current&&clearTimeout(K.current)}),[ve]);const Ce=re=>{A(re),window.scrollTo({top:0,behavior:"smooth"})};return s.jsxs("div",{className:"space-y-8",children:[(e||t)&&s.jsxs("div",{className:"bg-white shadow-sm rounded-lg p-4",children:[s.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center gap-4",children:[e&&s.jsx(jae,{searchTerm:b,setSearchTerm:w}),t&&s.jsx("div",{className:"hidden md:flex items-center gap-4 flex-1",children:y?s.jsxs("div",{className:"flex items-center justify-center w-full",children:[s.jsx("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-chamber-blue"}),s.jsx("span",{className:"text-sm text-gray-500",children:"Loading c
705ategories..."})]}):s.jsx(D5,{categories:g,selectedCategory:j,setSelectedCategory:N,sortBy:S,setSortBy:E,showSortOptions:!h})}),t&&s.jsx("div",{className:"md:hidden w-full",children:s.jsxs(Y,{variant:"outline",className:"w-full flex items-center justify-center",onClick:()=>T(!C),children:[s.jsx(Yg,{className:"mr-2 h-4 w-4"}),C?"Hide Filters":"Show Filters"]})})]}),t&&C&&s.jsx("div",{className:"md:hidden mt-4",children:y?s.jsxs("div",{className:"flex items-center justify-center py-4",children:[s.jsx("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-chamber-blue mr-2"}),s.jsx("span",{className:"text-sm text-gray-500",children:"Loading categories..."})]}):s.jsx(D5,{categories:g,selectedCategory:j,setSelectedCategory:N,sortBy:S,setSortBy:E,isMobile:!0,showSortOptions:!h})})]}),W&&s.jsxs(da,{variant:"destructive",children:[s.jsx(Ts,{className:"h-4 w-4"}),s.jsx(AR,{children:"Error"}),s.jsx(ha,{children:W})]}),V&&s.jsx("div",{className:"flex justify-center items-center py-12",children:s.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-chamber-blue"})}),!V&&!B&&P.length>0&&s.jsx(Nae,{businesses:P,showEditButton:i,onEditBusiness:o,onActivateBusiness:l,showStatusBadges:u,onBusinessUpdated:ve}),!V&&!B&&P.length===0&&s.jsx("div",{className:"text-center py-12",children:s.jsx("p",{className:"text-gray-500 text-lg",children:"No businesses found matching your criteria."})}),!r&&!V&&I>0&&s.jsx(Fae,{currentPage:D,totalPages:X,itemsPerPage:R,setItemsPerPage:M,onPageChange:Ce,totalItems:I,indexOfFirstItem:me,indexOfLastItem:ie})]})},_ae=({business:t})=>{var a,i,o,l,c,u,d,h,f;const e=()=>t.short_description||t.business_description||t.description||"",r=(m,g=100)=>m.length<=g?m:m.substring(0,g)+"...",n=m=>{if(m){if(m.includes("unsplash.com/photo-")&&!m.includes("?")&&(m.includes("w=")||m.includes("&"))){const g=m.indexOf("w=");if(g>0)return m.slice(0,g)+"?"+m.slice(g);const y=m.indexOf("auto=");if(y>0)return m.slice(0,y)+"?"+m.slice(y)}return m}};return s.jsxs("div",{className:"flex bg-white rounded-xl shadow-sm border border-gray-200 overflow-hidden h-[200px] w-full max-w-2xl hover:shadow-lg transition-shadow duration-300",children:[s.jsxs("div",{className:"flex-shrink-0 w-48 bg-gray-100 relative",children:[t.cover_image_url?s.jsx("img",{src:n(t.cover_image_url),alt:t.name+" cover",className:"w-full h-full object-cover",loading:"lazy",onError:m=>{var y;m.currentTarget.style.display="none";const g=m.currentTarget.parentElement;if(g&&!g.querySelector(".fallback-icon")){g.classList.add("flex","items-center","justify-center");const b=document.createElement("div");b.className="fallback-icon text-gray-400 text-6xl font-bold",b.textContent=((y=t.name)==null?void 0:y[0])||"?",g.appendChild(b)}}}):s.jsx("div",{className:"w-full h-full flex items-center justify-center text-gray-400 text-6xl font-bold bg-gray-100",children:((a=t.name)==null?void 0:a[0])||"?"}),t.featured&&s.jsx("div",{className:"absolute top-2 right-2 bg-chamber-gold text-white px-2 py-1 text-xs font-semibold rounded",children:"Featured"})]}),s.jsxs("div",{className:"flex flex-col justify-between px-5 py-4 flex-1 min-w-0 h-full",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"font-semibold text-lg text-gray-900 truncate mb-2",children:t.name}),e()&&s.jsx("p",{className:"text-gray-600 text-sm mb-2 line-clamp-2",children:r(e(),100)}),(t.business_type==="service_area"?(i=t.service_area)==null?void 0:i.description:((o=t.location)==null?void 0:o.city)&&((l=t.location)==null?void 0:l.state))&&s.jsxs("div",{className:"text-gray-500 text-sm mb-2 flex items-center",children:[s.jsx("span",{className:"mr-1",children:"ð"}),s.jsx("span",{className:"truncate",children:t.business_type==="service_area"?((u=(c=t.service_area)==null?void 0:c.description)==null?void 0:u.substring(0,40))+((d=t.service_area)!=null&&d.description&&t.service_area.description.length>40?"...":""):`${(h=t.location)==null?void 0:h.city}, ${(f=t.location)==null?void 0:f.state}`})]})]}),s.jsxs("div",{className:"mt-auto",children:[t.categories&&t.categories.length>0&&s.jsxs("div",{className:"flex flex-wrap gap-1 mb-3",children:[t.categories.slice(0,2).map(m=>s.jsx(ke,{variant:"outline",className:"bg-chamber-blue-light text-chamber-blue-dark text-xs px-2 py-1",children:m.name},m.id)),t.categories.length>2&&s.jsxs(ke,{variant:"outline",className:"bg-gray-100 text-gray-600 text-xs px-2 py-1",children:["+",t.categories.length-2," more"]})]}),s.jsx(rt,{to:`/businesses/${t.id}`,className:"inline-block text-white bg-chamber-blue px-4 py-2 rounded-md hover:bg-chamber-blue-dark transition-colors text-sm font-medium w-full text-center",children:"View Business"})]})]})]})},Eae=500,Aae=4e3,Dae=({className:t})=>{const e=ks(),[r,n]=x.useState([]),[a,i]=x.useState(!0),[o,l]=x.useState(0),[c,u]=x.useState(!1),d=()=>{e("/dashboard/membership")},h=x.useCallback(async()=>{i(!0);try{console.log("Fetching random featured businesses using Supabase RPC");const{data:m,error:g}=await Q.rpc("get_random_businesses",{p_limit:20,p_offset:0,p_category_id:null,p_search_term:null,p_status:"approved",p_owner_id:null,p_featured:!0,p_exclude_featured:!1});if(g){console.error("Error fetching random featured businesses:",g),n([]);return}if(!m||m.length<4){if(console.log(`Only ${(m==null?void 0:m.length)||0} featured businesses found. Need at least 4 for carousel. Skipping fallback to maintain featured business integrity.`),m&&m.length>0){const b=m.map(Sd);console.log("Using actual featured businesses only:",b.length),n(b)}else n([]);return}const y=m.map(Sd);console.log("Featured businesses fetched:",y.length),n(y)}catch(m){console.error("Error fetching featured businesses:",m),n([])}finally{i(!1)}},[]);if(x.useEffect(()=>{h();const m=setInterval(()=>{console.log("Refreshing random businesses..."),h()},2*60*1e3);return()=>clearInterval(m)},[h]),x.useEffect(()=>{if(r.length<=2)return;const m=setTimeout(()=>{u(!0),setTimeout(()=>{l(g=>(g+2)%r.length),u(!1)},Eae)},Aae);return()=>clearTimeout(m)},[o,r.length]),a)return s.jsx("div",{className:`py-8 ${t}`,children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"p-2 bg-chamber-gold/10 rounded-full mr-3",children:s.jsx(ri,{className:"text-chamber-gold",size:24})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Featured Businesses"}),s.jsx("p",{className:"text-gray-600 text-sm",children:"Discover our premium business partners"})]})]}),s.jsx("div",{className:"text-sm text-gray-500",children:s.jsxs("span",{className:"inline-flex items-center",children:[s.jsx("span",{className:"text-yellow-500 text-2xl mr-1",children:"â¢"}),"Continuously Updating"]})})]}),s.jsx("div",{className:"flex justify-center items-center py-12",children:s.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-chamber-blue"})})]})});if(r.length===0)return s.jsx("div",{className:`py-8 ${t}`,children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"p-2 bg-chamber-gold/10 rounded-full mr-3",children:s.jsx(ri,{className:"text-chamber-gold",size:24})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Featured Businesses"}),s.jsx("p",{className:"text-gray-600 text-sm",children:"Coming soon - more featured businesses"})]})]}),s.jsxs(Y,{onClick:d,className:"bg-amber-500 hover:bg-amber-600 text-white font-semibold px-4 py-2 rounded-lg shadow-lg transition-colors duration-200",children:[s.jsx(ri,{className:"mr-2 h-4 w-4"}),"Feature My Business"]})]}),s.jsxs("div",{className:"text-center py-12",children:[s.jsx("p",{className:"text-gray-600",children:"No featured businesses available at this time."}),s.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"Check back soon for premium business partners."})]})]})});let f=[];return r.length===1?f=[r[0]]:r.length===2?f=r:f=[r[o],r[(o+1)%r.length]],s.jsxs("div",{className:`py-8 ${t}`,children:[s.jsx("div",{className:"container-wrapper",children:s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"p-2 bg-chamber-gold/10 rounded-full mr-3",children:s.jsx(ri,{className:"text-chamber-gold",size:24})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Featured Businesses"}),s.jsx("p",{className:"text-gray-600 text-sm",children:"Discover our premium business partners"})]})]}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs(Y,{onClick:d,className:"bg-amber-500 hover:bg-amber-600 text-white font-semibold px-4 py-2 rounded-lg shadow-lg transition-colors duration-200",children:[s.jsx(ri,{className:"mr-2 h-4 w-4"}),"Feature My Business"]}),r.length>2&&s.jsx("div",{className:"text-sm text-gray-500",children:s.jsxs("span",{className:"inline-flex items-center",children:[s.jsx("span",{className:"text-yellow-500 text-2xl mr-1",children:"â¢"}),"Continuously Updating"]})})]})]})}),s.jsx("div",{className:"container-wrapper",children:s.jsx("div",{className:`grid gap-6 transition-opacity duration-500 ${r.length>2&&c?"opacity-0":"opacity-100"} ${f.length===1?"grid-cols-1 max-w-2xl mx-auto":"grid-cols-1 lg:grid-cols-2"}`,children:f.map(m=>m?s.jsx("div",{children:s.jsx(_ae,{business:m})},m.id):null)})})]})},Tae=()=>s.jsxs("div",{children:[s.jsx("div",{className:"py-12",children:s.jsx("div",{className:"container-wrapper",children:s.jsxs("div",{className:"mb-12 text-center",children:[s.jsx("div",{className:"inline-flex items-center justify-center p-3 bg-chamber-blue-light text-chamber-blue-dark rounded-full mb-4",children:s.jsx(ka,{size:24})}),s.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Business Directory"}),s.jsx("p",{className:"max-w-2xl mx-auto text-gray-600 text-lg mb-6",children:"Discover and connect with local businesses in our community. Use the filters to find exactly what you're looking for."})]})})}),s.jsx(Dae,{}),s.jsx("div",{className:"py-8",children:s.jsx("div",{className:"container-wrapper",children:s.jsx(Fy,{showFilters:!0,showSearch:!0,useRandomOrder:!0})})})]}),Jf=async t=>{const e=t.startsWith("biz")?t.replace("biz",""):t;console.log("Looking for business with ID:",e);try{const{data:r,error:n}=await Q.from("business_profiles").select(` 706 * 707 `).eq("id",e).single();if(n)return console.error("Error fetching business from Supabase:",n),console.log("Falling back to mock data"),B2(e);if(r){console.log("Found business in Supabase:",r.business_name);const{data:a,error:i}=await Q.from("business_category_junction").select(` 708 *, 709 business_category (id, name) 710 `).eq("business_id",e);if(!i&&a&&a.length>0)r.categories=a.map(o=>({id:o.business_category.id,name:o.business_category.name,isPrimary:o.is_primary}));else{const{data:o,error:l}=await Q.from("business_categories").select("*").eq("business_id",e);!l&&o&&o.length>0?r.business_categories=o:r.categories=[]}return Sd(r)}return console.log("No business found in Supabase, checking mock data"),B2(e)}catch(r){return console.error("Unexpected error fetching business:",r),B2(e)}},B2=t=>{console.log("Checking mock data for business ID:",t),console.log("Available mock business IDs:",l0.map(r=>r.id));const e=l0.find(r=>r.id===t);
710return e?(console.log("Found business in mock data:",e.name),e):(console.log("No business found in mock data with ID:",t),null)},yi={async getPublicDeals(){const{data:t,error:e}=await Q.from("insider_deals").select(` 711 *, 712 business:business_profiles( 713 id, 714 business_name, 715 logo_url, 716 phone, 717 website, 718 address_line1, 719 city, 720 state 721 ) 722 `).eq("approval_status","approved").eq("is_active",!0).gte("valid_until",new Date().toISOString()).order("created_at",{ascending:!1});if(e)throw console.error("Error fetching public deals:",e),e;return t||[]},async getPublicDealsByBusiness(t){console.log("[insiderDealsService.getPublicDealsByBusiness] API call start",{businessId:t,approval_status:"approved",is_active:!0,valid_until_gte_now:!0});const{data:e,error:r}=await Q.from("insider_deals").select(` 723 *, 724 business:business_profiles( 725 id, 726 business_name, 727 logo_url, 728 phone, 729 website, 730 address_line1, 731 city, 732 state 733 ) 734 `).eq("business_id",t).eq("approval_status","approved").eq("is_active",!0).gte("valid_until",new Date().toISOString()).order("created_at",{ascending:!1});if(r)throw console.error("[insiderDealsService.getPublicDealsByBusiness] API call failed",{businessId:t,error:r}),r;return console.log("[insiderDealsService.getPublicDealsByBusiness] API call success",{businessId:t,dealsCount:(e||[]).length}),e||[]},async getBusinessDeals(t){const{data:e,error:r}=await Q.from("insider_deals").select(` 735 *, 736 business:business_profiles( 737 id, 738 business_name, 739 logo_url, 740 phone, 741 website, 742 address_line1, 743 city, 744 state 745 ) 746 `).eq("business_id",t).order("created_at",{ascending:!1});if(r)throw console.error("Error fetching business deals:",r),r;return e||[]},async getAllDealsForAdmin(){const{data:t,error:e}=await Q.from("insider_deals").select(` 747 *, 748 business:business_profiles( 749 id, 750 business_name, 751 logo_url, 752 phone, 753 website, 754 address_line1, 755 city, 756 state 757 ) 758 `).order("created_at",{ascending:!1});if(e)throw console.error("Error fetching all deals for admin:",e),e;return t||[]},async getPendingDeals(){const{data:t,error:e}=await Q.from("insider_deals").select(` 759 *, 760 business:business_profiles( 761 id, 762 business_name, 763 logo_url, 764 phone, 765 website, 766 address_line1, 767 city, 768 state 769 ) 770 `).eq("approval_status","pending").order("created_at",{ascending:!0});if(e)throw console.error("Error fetching pending deals:",e),e;return t||[]},async createDeal(t,e){const{data:{user:r}}=await Q.auth.getUser();if(!r)throw new Error("User not authenticated");const{data:n,error:a}=await Q.from("insider_deals").insert({business_id:t,title:e.title,description:e.description,deal_type:e.deal_type,deal_value:e.deal_value,redemption_code:e.redemption_code,terms_and_conditions:e.terms_and_conditions,image_url:e.image_url,valid_from:e.valid_from,valid_until:e.valid_until,created_by:r.id}).select(` 771 *, 772 business:business_profiles( 773 id, 774 business_name, 775 logo_url, 776 phone, 777 website, 778 address_line1, 779 city, 780 state 781 ) 782 `).single();if(a)throw console.error("Error creating deal:",a),a;return n},async adminUpdateDeal(t,e){const{data:{user:r}}=await Q.auth.getUser();if(!r)throw new Error("User not authenticated");const{data:n,error:a}=await Q.from("insider_deals").update(e).eq("id",t).select(` 783 *, 784 business:business_profiles( 785 id, 786 business_name, 787 logo_url, 788 phone, 789 website, 790 address_line1, 791 city, 792 state 793 ) 794 `).single();if(a)throw console.error("Error admin-updating deal:",a),a;return n},async updateDeal(t,e){const r={...e,approval_status:"pending",reviewed_at:null,reviewed_by:null,admin_notes:null},{data:n,error:a}=await Q.from("insider_deals").update(r).eq("id",t).select(` 795 *, 796 business:business_profiles( 797 id, 798 business_name, 799 logo_url, 800 phone, 801 website, 802 address_line1, 803 city, 804 state 805 ) 806 `).single();if(a)throw console.error("Error updating deal:",a),a;return n},async reviewDeal(t,e,r){const{data:{user:n}}=await Q.auth.getUser();if(!n)throw new Error("User not authenticated");const{data:a,error:i}=await Q.from("insider_deals").update({approval_status:e,admin_notes:r,reviewed_by:n.id,reviewed_at:new Date().toISOString()}).eq("id",t).select(` 807 *, 808 business:business_profiles( 809 id, 810 business_name, 811 logo_url, 812 phone, 813 website, 814 address_line1, 815 city, 816 state 817 ) 818 `).single();if(i)throw console.error("Error reviewing deal:",i),i;return a},async toggleDealStatus(t,e){const{data:r,error:n}=await Q.from("insider_deals").update({is_active:e}).eq("id",t).select(` 819 *, 820 business:business_profiles( 821 id, 822 business_name, 823 logo_url, 824 phone, 825 website, 826 address_line1, 827 city, 828 state 829 ) 830 `).single();if(n)throw console.error("Error toggling deal status:",n),n;return r},async deleteDeal(t){const{error:e}=await Q.from("insider_deals").delete().eq("id",t);if(e)throw console.error("Error deleting deal:",e),e},async getDealById(t){const{data:e,error:r}=await Q.from("insider_deals").select(` 831 *, 832 business:business_profiles( 833 id, 834 business_name, 835 logo_url, 836 phone, 837 website, 838 address_line1, 839 city, 840 state 841 ) 842 `).eq("id",t).single();if(r){if(r.code==="PGRST116")return null;throw console.error("Error fetching deal by ID:",r),r}return e}},Mae=500,Pae=5e3,Rae=2*60*1e3,Bae=({excludeBusinessId:t,className:e=""})=>{var y,b,w,j,N,S;const[r,n]=x.useState([]),[a,i]=x.useState(0),[o,l]=x.useState(!0),[c,u]=x.useState(!1),d=x.useRef(null),h=x.useRef(null),f=x.useRef(null),m=x.useCallback(async()=>{try{console.log("Fetching random featured businesses pool, excluding:",t);const{data:E,error:C}=await Q.rpc("get_random_businesses",{p_limit:15,p_offset:0,p_category_id:null,p_search_term:null,p_status:"approved",p_owner_id:null,p_featured:!0,p_exclude_featured:!1});if(C){console.error("Error fetching random featured businesses:",C),n([]);return}if(!E||E.length===0){console.log("No featured businesses found for random business component"),n([]);return}const T=E.map(Sd),D=t?T.filter(A=>A.id!==t):T;console.log("Featured businesses pool fetched:",D.length),n(D)}catch(E){console.error("Error fetching featured businesses pool:",E),n([])}},[t]);if(x.useEffect(()=>((async()=>
842{l(!0),await m(),i(0),l(!1)})(),f.current=setInterval(()=>{console.log("Refreshing random featured businesses pool..."),m(),i(0)},Rae),()=>{f.current&&clearInterval(f.current)}),[m]),x.useEffect(()=>{if(!(o||r.length===0))return d.current&&clearTimeout(d.current),h.current&&clearTimeout(h.current),d.current=setTimeout(()=>{u(!0),h.current=setTimeout(()=>{i(E=>(E+1)%r.length),u(!1)},Mae)},Pae),()=>{d.current&&clearTimeout(d.current),h.current&&clearTimeout(h.current)}},[a,r.length,o]),o)return s.jsx(De,{className:e,children:s.jsxs(Be,{className:"p-6",children:[s.jsxs("div",{className:"flex items-center mb-4",children:[s.jsx("div",{className:"p-2 bg-chamber-gold/10 rounded-full mr-3",children:s.jsx(ri,{className:"text-chamber-gold",size:20})}),s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Featured Business"})]}),s.jsxs("div",{className:"animate-pulse",children:[s.jsx("div",{className:"bg-gray-200 rounded-lg h-32 mb-4"}),s.jsx("div",{className:"h-4 bg-gray-200 rounded mb-2"}),s.jsx("div",{className:"h-4 bg-gray-200 rounded w-3/4 mb-2"}),s.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/2"})]})]})});if(r.length===0)return null;const g=r[a];return g?s.jsx(De,{className:e,children:s.jsxs(Be,{className:"p-6",children:[s.jsxs("div",{className:"flex items-center mb-4",children:[s.jsx("div",{className:"p-2 bg-chamber-gold/10 rounded-full mr-3",children:s.jsx(ri,{className:"text-chamber-gold",size:20})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Featured Business"}),s.jsxs("p",{className:"text-xs text-gray-500 flex items-center",children:[s.jsx(Pl,{size:10,className:`mr-1 ${c?"animate-spin":""}`}),"Updates every 5 seconds"]})]})]}),s.jsxs("div",{className:`space-y-4 transition-opacity duration-500 ${c?"opacity-0":"opacity-100"}`,children:[s.jsxs("div",{className:"relative overflow-hidden rounded-lg h-32",children:[g.logo_url||g.cover_image_url?s.jsx("img",{src:g.cover_image_url||g.logo_url,alt:g.name,className:"w-full h-full object-cover",onError:E=>{E.currentTarget.src="https://images.unsplash.com/photo-1497935586351-b67a49e012bf?auto=format&fit=crop&w=400&h=200&q=85"}}):s.jsx("div",{className:"w-full h-full bg-gradient-to-br from-chamber-blue-light to-chamber-blue flex items-center justify-center",children:s.jsx(ri,{className:"text-white",size:32})}),s.jsx("div",{className:"absolute top-2 right-2",children:s.jsxs(ke,{className:"bg-chamber-gold text-white",children:[s.jsx(ri,{size:12,className:"mr-1"}),"Featured"]})})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold text-gray-900 mb-1",children:g.name}),g.categories&&g.categories.length>0&&s.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[g.categories.slice(0,2).map((E,C)=>s.jsx(ke,{variant:"outline",className:"text-xs",children:E.name},C)),g.categories.length>2&&s.jsxs(ke,{variant:"outline",className:"text-xs",children:["+",g.categories.length-2," more"]})]}),(g.short_description||g.description)&&s.jsx("p",{className:"text-sm text-gray-600 mb-3 line-clamp-2",children:g.short_description||g.description}),s.jsxs("div",{className:"space-y-1 text-xs text-gray-500 mb-4",children:[(g.business_type==="service_area"?(y=g.service_area)==null?void 0:y.description:((b=g.location)==null?void 0:b.city)&&((w=g.location)==null?void 0:w.state))&&s.jsxs("div",{className:"flex items-center",children:[s.jsx(_n,{size:12,className:"mr-1 flex-shrink-0"}),s.jsx("span",{className:"truncate",children:g.business_type==="service_area"?((N=(j=g.service_area)==null?void 0:j.description)==null?void 0:N.substring(0,50))+((S=g.service_area)!=null&&S.description&&g.service_area.description.length>50?"...":""):`${g.location.city}, ${g.location.state}`})]}),g.phone&&g.phone.trim()!==""&&s.jsxs("div",{className:"flex items-center",children:[s.jsx(wi,{size:12,className:"mr-1 flex-shrink-0"}),s.jsx("span",{children:g.phone})]}),g.website&&g.website.trim()!==""&&s.jsxs("div",{className:"flex items-center mb-2",children:[s.jsx(Bc,{size:12,className:"mr-1 flex-shrink-0"}),s.jsx("span",{className:"truncate",children:g.website.replace(/^https?:\/\//,"")})]})]})]}),s.jsx(rt,{to:`/businesses/${g.id}`,children:s.jsxs(Y,{variant:"outline",size:"sm",className:"w-full",children:["View Details",s.jsx(ul,{size:14,className:"ml-1"})]})})]})]})}):null},T5=({address:t,lat:e,lng:r})=>{const[n,a]=x.useState(!1),[i,o]=x.useState(!1),l=x.useRef(null),c=x.useRef(null);if(x.useEffect(()=>{const u=async()=>{var h;try{if((h=window.google)!=null&&h.maps)d();else{const f="AIzaSyAbLIh5nnw9na-VqFxRM1w4Ic-MmvJCJwQ",m=document.createElement("script");
842m.src=`https://maps.googleapis.com/maps/api/js?key=${f}&libraries=places&loading=async`,m.async=!0,m.defer=!0,m.onload=()=>d(),m.onerror=()=>{console.error("Failed to load Google Maps API"),o(!0)},document.head.appendChild(m)}}catch(f){console.error("Error initializing map:",f),o(!0)}},d=async()=>{if(l.current)try{let h;if(e&&r)h={lat:e,lng:r};else{const m=new google.maps.Geocoder,y=(await new Promise((b,w)=>{m.geocode({address:t},(j,N)=>{N==="OK"&&j&&j.length>0?b(j):w(new Error(`Geocoding failed: ${N}`))})}))[0].geometry.location;h={lat:y.lat(),lng:y.lng()}}const f=new google.maps.Map(l.current,{center:h,zoom:15,mapTypeId:google.maps.MapTypeId.ROADMAP,disableDefaultUI:!1,zoomControl:!0,streetViewControl:!0,fullscreenControl:!0});new google.maps.Marker({position:h,map:f,title:t}),c.current=f,a(!0)}catch(h){console.error("Error creating map:",h),o(!0)}};return u(),()=>{c.current&&(c.current=null)}},[t,e,r]),i){const d=`https://maps.google.com/maps?q=${encodeURIComponent(t)}&t=&z=13&ie=UTF8&iwloc=&output=embed`;return s.jsx("div",{className:"w-full h-full min-h-[150px] rounded-md overflow-hidden relative",children:s.jsx("iframe",{title:`Map of ${t}`,src:d,className:"w-full h-full min-h-[150px] border-0",style:{border:0,margin:0,overflow:"hidden"},onLoad:()=>a(!0),onError:()=>o(!0)})})}return s.jsxs("div",{className:"w-full h-full min-h-[150px] rounded-md overflow-hidden relative",children:[!n&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-100 z-10",children:s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx(_n,{size:24,className:"text-gray-400 mb-2"}),s.jsx("span",{className:"text-sm text-gray-500",children:"Loading interactive map..."})]})}),s.jsx("div",{ref:l,className:"w-full h-full min-h-[150px]",style:{minHeight:"150px"}})]})},M5=t=>{if(!t||t==="closed"||t==="24/7"||t.toLowerCase().includes("am")||t.toLowerCase().includes("pm"))return t;const e=t.split(":");if(e.length!==2)return t;const r=parseInt(e[0],10),n=e[1];return isNaN(r)||r<0||r>23?t:r===0?`12:${n} AM`:r===12?`12:${n} PM`:r<12?`${r}:${n} AM`:`${r-12}:${n} PM`},iI=(t,e)=>{if(t==="closed"||e==="closed"||!t||!e)return"Closed";if(t==="24/7"||e==="24/7")return"24 Hours";const r=M5(t),n=M5(e);return`${r} - ${n}`},Lae=t=>{if(!t||Object.keys(t).length===0)return[];const e=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],r={monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday",sunday:"Sunday"},n=[];let a=null;return e.forEach(i=>{const o=t[i];if(!o)return;let l;o.open==="closed"||!o.open?l="Closed":o.open==="24/7"?l="24 Hours":l=iI(o.open,o.close),a?a.hours===l?a.days.push(i):(n.push(a),a={days:[i],hours:l}):a={days:[i],hours:l}}),a&&n.push(a),n.map(i=>({days:i.days.length>1?`${r[i.days[0]]} - ${r[i.days[i.days.length-1]]}`:r[i.days[0]],hours:i.hours}))},Iae=()=>{var b,w,j,N,S,E,C,T,D,A,R,M,P,U,I,O,V,G;const{id:t}=Dd(),[e,r]=x.useState(null),[n,a]=x.useState([]),[i,o]=x.useState(!0),[l,c]=x.useState(!0),[u]=x.useState(Date.now()),{toast:d}=St(),{isAuthenticated:h}=ts();if(x.useEffect(()=>{(async()=>{var $,W;if(t){c(!0),console.log("Fetching business with ID:",t);try{const oe=await Jf(t);if(console.log("Fetched business:",oe),r(oe),!oe)d({title:"Business not found",description:"We couldn't find the business you're looking for.",variant:"destructive"});else{const K=oe.categories&&oe.categories.length>0?oe.categories[0].name:"Uncategorized",H=oe.business_type==="service_area"?"Service Area":($=oe.location)!=null&&$.city&&((W=oe.location)!=null&&W.state)?`${oe.location.city}, ${oe.location.state}`:"Location not specified";Ia.viewBusiness(oe.id,oe.name,K,H),qC(`/businesses/${oe.id}`,`${oe.name} - Business Details | Local Business Hub`),GC({business_name:oe.name,business_category:K,business_location:H,business_type:oe.business_type,business_featured:oe.featured?"Yes":"No"})}}catch(oe){console.error("Error fetching business details:",oe),d({title:"Error loading business",description:"There was a problem loading the business details. Please try again.",variant:"destructive"})}finally{c(!1)}}})()},[t,d]),x.useEffect(()=>{(async()=>
842{if(!(e!=null&&e.id)&&!t)return;const $=t!=null&&t.startsWith("biz")?t.replace("biz",""):t,W=(e==null?void 0:e.id)||$;if(W)try{o(!0),console.log("[BusinessDetails] fetching insider deals for business_id:",W);const oe=await yi.getPublicDealsByBusiness(W);console.log("[BusinessDetails] insider deals fetched:",oe.length),a(oe)}catch(oe){console.error("Error fetching business deals:",oe),a([])}finally{o(!1)}})()},[t]),x.useEffect(()=>()=>{if(e){const B=Math.round((Date.now()-u)/1e3);Ya.trackBusinessProfileTime(e.id,e.name,B)}},[e,u]),x.useEffect(()=>{if(!e)return;let B={25:!1,50:!1,75:!1,100:!1};const $=()=>{const W=window.pageYOffset,oe=document.documentElement.scrollHeight-window.innerHeight,K=Math.round(W/oe*100);K>=25&&!B[25]&&(B[25]=!0,Ya.trackScrollDepth(e.id,e.name,25)),K>=50&&!B[50]&&(B[50]=!0,Ya.trackScrollDepth(e.id,e.name,50)),K>=75&&!B[75]&&(B[75]=!0,Ya.trackScrollDepth(e.id,e.name,75)),K>=100&&!B[100]&&(B[100]=!0,Ya.trackScrollDepth(e.id,e.name,100))};return window.addEventListener("scroll",$),()=>window.removeEventListener("scroll",$)},[e]),l)return s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container-wrapper flex flex-col items-center justify-center",children:[s.jsx(Mt,{className:"h-12 w-12 text-chamber-blue animate-spin mb-4"}),s.jsx("h1",{className:"text-2xl font-bold",children:"Loading business details..."})]})});if(!e)return s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container-wrapper text-center",children:[s.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Business not found"}),s.jsx("p",{className:"mb-6",children:"The business you're looking for doesn't exist or has been removed."}),s.jsx(rt,{to:"/businesses",children:s.jsxs(Y,{children:[s.jsx(pn,{className:"mr-2 h-4 w-4"})," Back to Business Directory123"]})})]})});const f={facebook:e.facebook_url&&e.facebook_url.trim()!==""?e.facebook_url:null,instagram:e.instagram_url&&e.instagram_url.trim()!==""?e.instagram_url:null,twitter:e.twitter_url&&e.twitter_url.trim()!==""?e.twitter_url:null,linkedin:null},m=(e.gallery_urls||[]).filter(B=>B&&B.trim()!==""),g=e.short_description||e.business_description||e.description||"",y=e.business_description||e.description||"";return s.jsx("div",{className:"py-8",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs(rt,{to:"/businesses",className:"inline-flex items-center text-chamber-blue hover:underline mb-6",children:[s.jsx(pn,{className:"mr-1 h-4 w-4"})," Back to Business Directory"]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6 mb-8",children:[s.jsxs("div",{className:"lg:col-span-2 space-y-6",children:[s.jsx("div",{className:"bg-white rounded-lg p-6 shadow-sm",children:s.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[s.jsx("div",{className:"w-full md:w-1/3",children:s.jsx("div",{className:"rounded-lg overflow-hidden h-64 p-2",children:e.logo_url?s.jsx("img",{src:e.logo_url,alt:`${e.name} logo`,className:"w-full h-full object-contain",loading:"lazy",onError:B=>{B.currentTarget.style.display="none";const $=B.currentTarget.parentElement;if($&&!$.querySelector(".fallback-icon")){$.classList.add("flex","items-center","justify-center","bg-gray-50");const W=document.createElement("div");W.className="fallback-icon flex items-center justify-center w-full h-full",W.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-gray-400"><rect x="4" y="2" width="16" height="20" rx="2" ry="2"></rect><path d="M9 22v-4h6v4"></path><path d="M8 6h.01"></path><path d="M16 6h.01"></path><path d="M12 6h.01"></path><path d="M12 10h.01"></path><path d="M12 14h.01"></path><path d="M16 10h.01"></path><path d="M16 14h.01"></path><path d="M8 10h.01"></path><path d="M8 14h.01"></path></svg>',$.appendChild(W)}}}):s.jsx("div",{className:"flex items-center justify-center w-full h-full bg-gray-50 rounded",children:s.jsx(ka,{size:64,className:"text-gray-400"})})})}),s.jsxs("div",{className:"w-full md:w-2/3",children:[s.jsx("h1",{className:"text-3xl font-bold mb-2",children:e.name}),e.categories&&e.categories.length>0&&s.jsx("div",{className:"mb-4 flex flex-wrap gap-2",children:e.categories.map((B,$)=>s.jsx(ke,{variant:"outline",className:"bg-chamber-blue-light text-chamber-blue-dark",children:B.name},$))}),e.tags&&e.tags.length>0&&e.tags.some(B=>B&&B.trim()!=="")&&s.jsx("div",{className:"mb-4 flex flex-wrap gap-2",children:e.tags.filter(
842B=>B&&B.trim()!=="").map((B,$)=>s.jsx(ke,{variant:"secondary",className:"text-sm bg-gray-100 text-gray-700 hover:bg-gray-200",children:B},$))}),g&&s.jsx("p",{className:"text-gray-700",children:g})]})]})}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsx(De,{children:s.jsxs(Be,{className:"p-4",children:[s.jsx("h3",{className:"text-sm font-semibold text-gray-500 mb-3",children:"Contact Information"}),s.jsxs("div",{className:"space-y-3",children:[(e.business_type==="service_area"?(b=e.service_area)==null?void 0:b.description:((w=e.location)==null?void 0:w.address)||((j=e.location)==null?void 0:j.city)||((N=e.location)==null?void 0:N.state))&&s.jsxs("div",{className:"flex items-start",children:[s.jsx(_n,{size:18,className:"text-gray-500 mt-1 mr-2 flex-shrink-0"}),s.jsx("span",{className:"text-gray-900",children:e.business_type==="service_area"?(S=e.service_area)==null?void 0:S.description:[e.location.address,e.location.city,e.location.state,e.location.zipCode].filter($=>$&&$.trim()!=="").join(", ")})]}),e.phone&&e.phone.trim()!==""&&s.jsxs("div",{className:"flex items-center",children:[s.jsx(wi,{size:18,className:"text-gray-500 mr-2 flex-shrink-0"}),s.jsx("a",{href:`tel:${e.phone}`,className:"text-chamber-blue hover:underline",onClick:()=>{Ia.contactBusiness(e.id,e.name,"phone"),Ya.trackBusinessCardInteraction(e.id,e.name,"click_phone")},children:e.phone})]}),e.email&&e.email.trim()!==""&&s.jsxs("div",{className:"flex items-center",children:[s.jsx(fs,{size:18,className:"text-gray-500 mr-2 flex-shrink-0"}),s.jsx("a",{href:`mailto:${e.email}`,className:"text-chamber-blue hover:underline",onClick:()=>{Ia.contactBusiness(e.id,e.name,"email"),Ya.trackBusinessCardInteraction(e.id,e.name,"click_email")},children:e.email})]}),e.website&&e.website.trim()!==""&&s.jsxs("div",{className:"flex items-center",children:[s.jsx(Bc,{size:18,className:"text-gray-500 mr-2 flex-shrink-0"}),s.jsx("a",{href:e.website,target:"_blank",rel:"noopener noreferrer",className:"text-chamber-blue hover:underline",onClick:()=>{Ia.contactBusiness(e.id,e.name,"website"),Ya.trackBusinessCardInteraction(e.id,e.name,"click_website")},children:e.website.replace(/^https?:\/\//,"")})]}),!((E=e.phone)!=null&&E.trim())&&!((C=e.email)!=null&&C.trim())&&!((T=e.website)!=null&&T.trim())&&!((A=(D=e.location)==null?void 0:D.address)!=null&&A.trim())&&!((M=(R=e.location)==null?void 0:R.city)!=null&&M.trim())&&!((U=(P=e.service_area)==null?void 0:P.description)!=null&&U.trim())&&s.jsx("div",{className:"text-gray-500 italic text-sm",children:"Contact information not available"})]})]})}),s.jsx(De,{children:s.jsxs(Be,{className:"p-4",children:[s.jsx("h3",{className:"text-sm font-semibold text-gray-500 mb-3 cursor-pointer",onClick:()=>Ya.trackBusinessHoursView(e.id,e.name),children:"Business Hours"}),e.business_hours_json&&Object.keys(e.business_hours_json).length>0?s.jsx("div",{className:"space-y-2",onClick:()=>Ya.trackBusinessHoursView(e.id,e.name),children:Lae(e.business_hours_json).map((B,$)=>s.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s.jsx("span",{className:"font-medium",children:B.days}),s.jsx("span",{className:"text-gray-700",children:B.hours})]},$))}):s.jsxs("div",{className:"flex items-start",children:[s.jsx(rn,{size:18,className:"text-gray-500 mt-1 mr-2 flex-shrink-0"}),s.jsx("span",{className:"text-gray-500 italic",children:"Business hours not specified"})]}),s.jsx("h3",{className:"text-sm font-semibold text-gray-500 mt-6 mb-3",children:"Social Media"}),Object.values(f).some(B=>B)?s.jsxs("div",{className:"flex space-x-3",children:[f.facebook&&s.jsx("a",{href:f.facebook,target:"_blank",rel:"noopener noreferrer",className:"text-gray-600 hover:text-chamber-blue",children:s.jsx(fw,{size:20})}),f.instagram&&s.jsx("a",{href:f.instagram,target:"_blank",rel:"noopener noreferrer",className:"text-gray-600 hover:text-chamber-blue",children:s.jsx(fC,{size:20})}),f.twitter&&s.jsx("a",{href:f.twitter,target:"_blank",rel:"noopener noreferrer",className:"text-gray-600 hover:text-chamber-blue",children:s.jsx(gw,{size:20})}),f.linkedin]}):s.jsx("div",{className:"text-gray-500 italic text-sm",children:"No social media links available"})]})})]}),s.jsx(De,{children:s.jsxs(Be,{className:"p-4",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsx("h3",{className:"text-sm font-semibold text-gray-500",children:"Current Insider Deals"}),n.length>0&&s.jsx(rt,{to:"/businesses/insider-deals",className:"text-sm text-chamber-blue hover:underline",children:"View all deals"})]}),i?s.jsx("div",{className:"text-gray-500 italic text-sm",children:"Loading current deals..."}):n.length>0?s.jsx("div",{className:"space-y-3",children:n.map(B=>s.jsxs("div",{className:"border rounded-lg p-3 bg-white",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-2",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold text-gray-900",children:B.title}),s.jsx("p",{className:"text-sm text-gray-600 mt-1 line-clamp-2",children:B.description})]}),s.jsx(ke,{variant:"outline",className:"w-fit bg-chamber-blue-light text-chamber-blue-dark",children:B.deal_value})]}),s.jsxs("div",{className:"mt-2 text-xs text-gray-500",children:["Valid until ",new Date(B.valid_until).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})]}),h&&s.jsx("div",{className:"mt-3",children:s.jsx(rt,{to:`/businesses/insider-deals/${B.id}`,className:"text-sm text-chamber-blue hover:underline",children:"View deal details"})})]},B.id))}):s.jsx("div",{className:"text-gray-500 italic text-sm",children:"This business does not have any active insider deals right now."})]})}),s.jsxs(sn,{defaultValue:"details",className:"mt-8",children:[s.jsxs(Qs,{className:"grid w-full max-w-md grid-cols-2",children:[s.jsx(Gt,{value:"details",children:"About the Business"}),s.jsx(Gt,{value:"gallery",children:"Photo Gallery"})]}),s.jsx(Rt,{value:"details",className:"mt-6",children:s.jsx(De,{children:s.jsx(Be,{className:"p-6",children:s.jsx("div",{className:"prose prose-gray max-w-none",children:y&&y.trim()!==""?s.jsx("div",{className:"space-y-4",children:y.split(`
843`).filter(B=>B.trim().length>0).map((B,$)=>s.jsx("p",{className:"text-gray-700 leading-relaxed text-base",children:B.trim()},$))}):s.jsx("div",{className:"text-center py-12",children:s.jsxs("div",{className:"bg-gray-50 rounded-lg p-8",children:[s.jsx(ka,{className:"mx-auto h-12 w-12 text-gray-400 mb-4"}),s.jsxs("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:["About ",e.name]}),s.jsx("p",{className:"text-gray-500 max-w-md mx-auto",children:"No detailed description is currently available for this business. Contact them directly for more information about their services."})]})})})})})}),s.jsx(Rt,{value:"gallery",className:"mt-6",children:s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:m.length>0?m.map((B,$)=>s.jsx("div",{className:"overflow-hidden rounded-lg h-64",children:s.jsx("img",{src:B,alt:`${e.name} gallery image ${$+1}`,className:"w-full h-full object-cover hover:scale-105 transition-transform duration-300 cursor-pointer",loading:"lazy",onClick:()=>Ya.trackBusinessGalleryView(e.id,e.name,$),onError:W=>{W.currentTarget.src="https://placehold.co/600x400?text=Image+not+available"}})},$)):s.jsx("div",{className:"col-span-full text-center py-8",children:s.jsx("p",{className:"text-gray-500",children:"No gallery images available"})})})})]})]}),s.jsxs("div",{className:"lg:col-span-1 space-y-6",children:[s.jsx(De,{children:s.jsxs(Be,{className:"p-4",children:[s.jsx("h3",{className:"text-sm font-semibold text-gray-500 mb-3",children:e.business_type==="service_area"?"Service Area":"Business Location"}),e.business_type==="service_area"?s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3",children:s.jsxs("div",{className:"flex items-start",children:[s.jsx(_n,{size:16,className:"text-blue-600 mt-0.5 mr-2 flex-shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-blue-800 text-sm font-medium",children:((I=e.service_area)==null?void 0:I.description)||"Service area not specified"}),((O=e.service_area)==null?void 0:O.radiusMiles)&&s.jsxs("p",{className:"text-blue-600 text-xs mt-1",children:["Service radius: ",e.service_area.radiusMiles," miles"]})]})]})}),s.jsx("div",{className:"h-48 rounded-lg overflow-hidden",onClick:()=>Ya.trackBusinessLocationView(e.id,e.name,"map_view"),children:s.jsx(T5,{address:"Valley Stream, NY",lat:40.664268,lng:-73.708466})}),s.jsx("p",{className:"text-gray-400 text-xs text-center",children:"Map shows Valley Stream, NY area"})]}):(V=e.location)!=null&&V.latitude&&((G=e.location)!=null&&G.longitude)?s.jsx("div",{className:"h-64",onClick:()=>Ya.trackBusinessLocationView(e.id,e.name,"map_view"),children:s.jsx(T5,{address:[e.location.address,e.location.city,e.location.state,e.location.zipCode].filter($=>$&&$.trim()!=="").join(", "),lat:e.location.latitude,lng:e.location.longitude})}):s.jsx("div",{className:"bg-gray-200 rounded-lg h-64 flex items-center justify-center",children:s.jsxs("div",{className:"text-center p-8",children:[s.jsx(_n,{size:32,className:"mx-auto text-gray-500 mb-2"}),s.jsx("p",{className:"text-gray-500 text-sm",children:"Location information not available"})]})})]})}),s.jsx(Bae,{excludeBusinessId:e.id})]})]})]})})},oI={getBusinessCategories:async t=>{const{data:e,error:r}=await Q.from("business_category_junction").select(` 844 category_id, 845 is_primary, 846 business_category (id, name, slug) 847 `).eq("business_id",t);if(r)throw console.error("Error fetching business categories:",r),r;return e.map(n=>{const a=Array.isArray(n.business_category)?n.business_category[0]:n.business_category;return{id:a==null?void 0:a.id,name:a==null?void 0:a.name,isPrimary:n.is_primary}})},updateBusinessCategories:async(t,e)=>{const{error:r}=await Q.from("business_category_junction").delete().eq("business_id",t);if(r)throw console.error("Error removing business categories:",r),r;if(e.length===0)return;const n=e.map(i=>({business_id:t,category_id:i.id,is_primary:i.isPrimary})),{error:a}=await Q.from("business_category_junction").insert(n);if(a)throw console.error("Error adding business categories:",a),a},getBusinessesByCategory:async t=>{const{data:e,error:r}=await Q.from("business_category_junction").select("business_id").eq("category_id",t);if(r)throw console.error("Error fetching businesses by category:",r),r;return e.map(n=>n.business_id)}},lI=async(t,e)=>{try{console.log("Updating business with ID:",t);const r=t.startsWith("biz")?t.replace("biz",""):t;console.log("Normalized ID for update:",r);const n=await Jf(r);if(!n)throw console.error(`Business with ID ${t} (normalized: ${r}) not found`),new Error(`Business with ID ${t} not found`);console.log("Found business for update:",n.name);const a={};e.name!==void 0&&(a.business_name=e.name),e.short_description!==void 0&&(a.short_description=e.short_description),e.business_description!==void 0&&(a.business_description=e.business_description),e.description&&!e.business_description&&(a.business_description=e.description,e.short_description||(a.short_description=e.description.substring(0,150))),e.business_type!==void 0&&(a.business_type=e.business_type),e.logo_url!==void 0&&(a.logo_url=e.logo_url),e.cover_image_url!==void 0&&(a.cover_image_url=e.cover_image_url),e.phone!==void 0&&(a.phone=e.phone),e.email!==void 0&&(a.email=e.email),e.website!==void 0&&(a.website=e.website),e.facebook_url!==void 0&&(a.facebook_url=e.facebook_url),e.instagram_url!==void 0&&(a.instagram_url=e.instagram_url),e.t
847witter_url!==void 0&&(a.twitter_url=e.twitter_url),e.gallery_urls!==void 0&&(a.gallery_urls=e.gallery_urls),e.business_hours_json!==void 0&&(a.business_hours_json=e.business_hours_json),e.tags!==void 0&&(a.tags=e.tags),e.business_type==="physical_location"&&e.location?(e.location.address!==void 0&&(a.address_line1=e.location.address),e.location.city!==void 0&&(a.city=e.location.city),e.location.state!==void 0&&(a.state=e.location.state),e.location.zipCode!==void 0&&(a.zip_code=e.location.zipCode),a.service_area_description=null,a.service_radius_miles=null):e.business_type==="service_area"&&e.service_area?(e.service_area.description!==void 0&&(a.service_area_description=e.service_area.description),e.service_area.radiusMiles!==void 0&&(a.service_radius_miles=e.service_area.radiusMiles),a.address_line1=null,a.city=null,a.state=null,a.zip_code=null):e.location&&(e.location.address!==void 0&&(a.address_line1=e.location.address),e.location.city!==void 0&&(a.city=e.location.city),e.location.state!==void 0&&(a.state=e.location.state),e.location.zipCode!==void 0&&(a.zip_code=e.location.zipCode)),a.updated_at=new Date().toISOString(),n.status==="rejected"&&(a.status="pending");const{data:i,error:o}=await Q.from("business_profiles").update(a).eq("id",r).select().single();if(o)throw console.error("Error updating business profile:",o),new Error(`Failed to update business profile: ${o.message}`);if(e.categories&&e.categories.length>0)try{console.log("Updating categories for business:",e.categories),await oI.updateBusinessCategories(r,e.categories.map(c=>({id:c.id,isPrimary:c.isPrimary||!1}))),console.log("Business categories updated successfully")}catch(c){console.error("Error updating business categories:",c)}const l=await Jf(r);if(!l)throw new Error(`Updated business with ID ${r} not found`);return l}catch(r){throw console.error("Error in updateBusiness:",r),r}},Oae=({businessData:t,id:e,onSaveSuccess:r})=>{const{toast:n}=St(),[a,i]=x.useState(""),[o,l]=x.useState(""),[c,u]=x.useState(""),[d,h]=x.useState(""),[f,m]=x.useState(""),[g,y]=x.useState(""),[b,w]=x.useState(""),[j,N]=x.useState(""),[S,E]=x.useState(""),[C,T]=x.useState(""),[D,A]=x.useState([]),[R,M]=x.useState(""),[P,U]=x.useState({facebook:"",instagram:"",twitter:"",linkedin:""}),[I,O]=x.useState([]),[V,G]=x.useState(""),[B,$]=x.useState([]);return x.useEffect(()=>{var ee,he,ve,Ce;t&&(i(t.name||""),l(t.short_description||((ee=t.description)==null?void 0:ee.substring(0,150))||""),u(t.business_description||t.description||""),h(t.logo_url||""),m(t.cover_image_url||""),y(((he=t.location)==null?void 0:he.address)||""),w(t.phone||""),N(t.email||""),E(t.website||""),T(t.hours||""),A(((ve=t.categories)==null?void 0:ve.map(re=>re.name))||[]),U({facebook:t.facebook_url||"",instagram:t.instagram_url||"",twitter:t.twitter_url||"",linkedin:((Ce=t.social)==null?void 0:Ce.linkedin)||""}),O(t.gallery_urls||t.gallery||[]),$(t.tags||[]))},[t]),{name:a,setName:i,shortDescription:o,setShortDescription:l,businessDescription:c,setBusinessDescription:u,logoUrl:d,setLogoUrl:h,coverImageUrl:f,setCoverImageUrl:m,address:g,setAddress:y,phone:b,setPhone:w,email:j,setEmail:N,website:S,setWebsite:E,hours:C,setHours:T,categories:D,setCategories:A,newCategory:R,setNewCategory:M,social:P,setSocial:U,gallery:I,setGallery:O,newImageUrl:V,setNewImageUrl:G,tags:B,setTags:$,handleAddCategory:()=>{R&&!D.includes(R)&&(A([...D,R]),M(""))},handleRemoveCategory:ee=>{A(D.filter(he=>he!==ee))},handleSocialChange:(ee,he)=>{U({...P,[ee]:he})},handleAddImage:()=>{V&&(O([...I,V]),G(""))},handleRemoveImage:ee=>{O(I.filter(he=>he!==ee))},handleTagsChange:ee=>{$(ee)},handleSubmit:async ee=>{var he,ve,Ce,re;if(ee.preventDefault(),!!e)try{await lI(e,{name:a,short_description:o,business_description:c,logo_url:d,cover_image_url:f,gallery_urls:I,phone:b,email:j,website:S,facebook_url:P.facebook,instagram_url:P.instagram,twitter_url:P.twitter,location:{id:((he=t==null?void 0:t.location)==null?void 0:he.id)||"",address:g,city:((ve=t==null?void 0:t.location)==null?void 0:ve.city)||"",state:((Ce=t==null?void 0:t.location)==null?void 0:Ce.state)||"",zipCode:((re=t==null?void 0:t.location)==null?void 0:re.zipCode)||""},business_hours_json:(t==null?void 0:t.business_hours_json)||{},tags:B}),n({title:"Business Updated",description:"Your business information has been successfully updated."}),r&&r()}catch(we){n({title:"Error",description:`Failed to update business: ${we instanceof Error?we.message:"Unknown error"}`,variant:"destructive"})}}}},zae=({logoUrl:t,setLogoUrl:e})=>{const[r,n]=x.useState(!1),[a,i]=x.useState(null),[o,l]=x.useState(t),c=h=>{e(h),l(h),a&&i(null)},u=h=>
847{i(h);const f=URL.createObjectURL(h);l(f),e(f)},d=(h,f)=>{const m=new File([h],"logo.jpg",{type:"image/jpeg"});i(m),l(f),e(f)};return s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"logoUrl",children:"Business Logo/Image"}),s.jsx("div",{className:"mt-2 bg-gray-100 rounded-lg overflow-hidden",children:o?s.jsxs("div",{className:"relative",children:[s.jsx("img",{src:o,alt:"Business logo",className:"w-full h-56 object-cover"}),s.jsxs("div",{className:"p-2 flex gap-2",children:[s.jsxs(Y,{type:"button",variant:"secondary",onClick:()=>n(!0),className:"flex-1",children:[s.jsx(bu,{className:"mr-2 h-4 w-4"})," Edit"]}),s.jsxs(Y,{type:"button",variant:"destructive",onClick:()=>{e(""),l(""),i(null)},className:"flex-1",children:[s.jsx(vr,{className:"mr-2 h-4 w-4"})," Remove"]})]})]}):s.jsxs("div",{className:"flex flex-col items-center justify-center p-4 h-56",children:[s.jsx(ka,{size:48,className:"text-gray-400 mb-2"}),s.jsx(Y,{type:"button",variant:"outline",onClick:()=>n(!0),className:"mt-2",children:"Add Logo"}),s.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"Upload or enter a URL for your business logo"})]})}),s.jsx(ex,{open:r,onOpenChange:n,title:"Edit Business Logo",currentUrl:t,currentFile:a,currentPreview:o,onUrlSubmit:c,onFileSubmit:u,uploading:!1,aspectRatio:"square",onCropComplete:d})]})},Uae=({coverImageUrl:t,setCoverImageUrl:e})=>{const[r,n]=x.useState(!1),[a,i]=x.useState(null),[o,l]=x.useState(t),c=h=>{e(h),l(h),a&&i(null)},u=h=>{i(h);const f=URL.createObjectURL(h);l(f),e(f)},d=(h,f)=>{const m=new File([h],"cover-image.jpg",{type:"image/jpeg"});i(m),l(f),e(f)};return s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"coverImageUrl",children:"Cover Image"}),s.jsx("div",{className:"mt-2 bg-gray-100 rounded-lg overflow-hidden",children:o?s.jsxs("div",{className:"relative",children:[s.jsx("img",{src:o,alt:"Business cover",className:"w-full h-48 object-cover"}),s.jsxs("div",{className:"p-2 flex gap-2",children:[s.jsxs(Y,{type:"button",variant:"secondary",onClick:()=>n(!0),className:"flex-1",children:[s.jsx(bu,{className:"mr-2 h-4 w-4"})," Edit"]}),s.jsxs(Y,{type:"button",variant:"destructive",onClick:()=>{e(""),l(""),i(null)},className:"flex-1",children:[s.jsx(vr,{className:"mr-2 h-4 w-4"})," Remove"]})]})]}):s.jsxs("div",{className:"flex flex-col items-center justify-center p-4 h-48",children:[s.jsx(vi,{size:48,className:"text-gray-400 mb-2"}),s.jsx(Y,{type:"button",variant:"outline",onClick:()=>n(!0),className:"mt-2",children:"Add Cover Image"}),s.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"Upload or enter a URL for your business cover image"})]})}),s.jsx(ex,{open:r,onOpenChange:n,title:"Edit Cover Image",currentUrl:t,currentFile:a,currentPreview:o,onUrlSubmit:c,onFileSubmit:u,uploading:!1,aspectRatio:"wide",onCropComplete:d})]})},Hae=({categories:t,newCategory:e,setNewCategory:r,handleAddCategory:n,handleRemoveCategory:a})=>s.jsxs("div",{children:[s.jsx($ae,{children:"Business Categories"}),s.jsx("div",{className:"flex flex-wrap gap-2 mt-2 mb-3",children:t.map((i,o)=>s.jsxs(ke,{variant:"outline",className:"bg-chamber-blue-light text-chamber-blue-dark group",children:[i,s.jsx("button",{type:"button",onClick:()=>a(i),className:"ml-1 text-gray-500 hover:text-red-500 transition-colors",children:"Ã"})]},o))}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ne,{value:e,onChange:i=>r(i.target.value),placeholder:"Add a category"}),s.jsx(Y,{type:"button",onClick:n,className:"shrink-0",children:"Add"})]})]}),$ae=({children:t,htmlFor:e,className:r})=>s.jsx("label",{className:`block text-sm font-medium text-gray-700 ${r}`,htmlFor:e,children:t}),Wae=({shortDescription:t,setShortDescription:e,businessDescription:r,setBusinessDescription:n})=>s.jsxs("div",{className:"space-y-4",children:[s.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Business Descriptions"}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"shortDescription",children:"Short Description"}),s.jsx(zt,{id:"shortDescription",value:t,onChange:a=>e(a.target.value),className:"mt-1",rows:3,maxLength:150,placeholder:"Brief description of your business (max 150 characters)"}),s.jsxs("div",{className:"text-sm text-muted-foreground mt-1",children:[(t==null?void 0:t.length)||0,"/150 characters"]})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"businessDescription",children:"Business Description"}),s.jsx(zt,{id:"businessDescription",value:r,onChange:a=>n(a.target.value),className:"mt-1",rows:5,placeholder:"Detailed description of your business, products, services, and mission"})]})]}),qae=({address:t,setAddress:e,phone:r,setPhone:n,email:a,setEmail:i,website:o,setWebsite:l,hours:c,setHours:u})=>s.jsxs("div",{className:"space-y-4",children:[s.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Contact Information"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsxs(Z,{htmlFor:"address",className:"flex items-center gap-2",children:[s.jsx(_n,{size:16,className:"text-gray-500"})," Address"]}),s.jsx(Ne,{id:"address",value:t,onChange:d=>e(d.target.value),className:"mt-1",placeholder:"123 Main Street, City, State, ZIP"})]}),s.jsxs("div",{children:[s.jsxs(Z,{htmlFor:"phone",className:"flex items-center gap-2",children:[s.jsx(wi,{size:16,className:"text-gray-500"})," Phone"]}),s.jsx(Ne,{id:"phone",value:r,onChange:d=>n(d.target.value),className:"mt-1",placeholder:"(555) 123-4567"})]}),s.jsxs("div",{children:[s.jsxs(Z,{htmlFor:"email",className:"flex items-center gap-2",children:[s.jsx(fs,{size:16,className:"text-gray-500"})," Email"]}),s.jsx(Ne,{id:"email",value:a,onChange:d=>i(d.target.value),className:"mt-1",placeholder:"[email protected]"})]}),s.jsxs("div",{children:[s.jsxs(Z,{htmlFor:"website",className:"flex items-center gap-2",children:[s.jsx(Bc,{size:16,className:"text-gray-500"})," Website"]}),s.jsx(Ne,{id:"website",value:o,onChange:d=>l(d.target.value),className:"mt-1",placeholder:"https://www.yourbusiness.com"})]}),s.jsxs("div",{className:"md:col-span-2",children:[s.jsxs(Z,{htmlFor:"hours",className:"flex items-center gap-2",children:[s.jsx(rn,{size:16,className:"text-gray-500"})," Business Hours"]}),s.jsx(Ne,{id:"hours",value:c,onChange:d=>u(d.target.value),className:"mt-1",placeholder:"e.g., Mon-Fri: 9am-5pm, Sat: 10am-4pm, Sun: Closed"})]})]})]}),Gae=({social:t,handleSocialChange:e})=>s.jsxs("div",{className:"space-y-4",children:[s.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Social Media"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsxs(Z,{htmlFor:"facebook",className:"flex items-center gap-2",children:[s.jsx(fw,{size:16,className:"text-gray-500"})," Facebook"]}),s.jsx(Ne,{id:"facebook",value:t.facebook||"",onChange:r=>e("facebook",r.target.value),className:"mt-1",placeholder:"https://facebook.com/yourbusiness"})]}),s.jsxs("div",{children:[s.jsxs(Z,{htmlFor:"instagram",className:"flex items-center gap-2",children:[s.jsx(fC,{size:16,className:"text-gray-500"})," Instagram"]}),s.jsx(Ne,{id:"instagram",value:t.instagram||"",onChange:r=>e("instagram",r.target.value),className:"mt-1",placeholder:"https://instagram.com/yourbusiness"})]}),s.jsxs("div",{children:[s.jsxs(Z,{htmlFor:"twitter",className:"flex items-center gap-2",children:[s.jsx(gw,{size:16,className:"text-gray-500"})," Twitter"]}),s.jsx(Ne,{id:"twitter",value:t.twitter||"",onChange:r=>e("twitter",r.target.value),className:"mt-1",placeholder:"https://twitter.com/yourbusiness"})]}),s.jsxs("div",{children:[s.jsxs(Z,{htmlFor:"linkedin",className:"flex items-center gap-2",children:[s.jsx(pC,{size:16,className:"text-gray-500"})," LinkedIn"]}),s.jsx(Ne,{id:"linkedin",value:t.linkedin||"",onChange:r=>e("linkedin",r.target.value),className:"mt-1",placeholder:"https://linkedin.com/company/yourbusiness"})]})]})]}),Vae=({gallery:t,newImageUrl:e,setNewImageUrl:r,handleAddImage:n,handleRemoveImage:a})=>s.jsxs("div",{className:"space-y-4",children:[s.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Photo Gallery"}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-6",children:t.map((i,o)=>s.jsxs("div",{className:"relative rounded-lg overflow-hidden group",children:[s.jsx("img",{src:i,alt:`Gallery image ${o+1}`,className:"w-full h-48 object-cover"}),s.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-0 group-hover:bg-opacity-40 transition-all flex items-center justify-center",children:s.jsx(Y,{type:"button",variant:"destructive",onClick:()=>a(i),className:"opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(vr,{className:"h-4 w-4"})})})]},o))}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ne,{value:e,onCh
847ange:i=>r(i.target.value),placeholder:"Add image URL",className:"flex-grow"}),s.jsxs(Y,{type:"button",onClick:n,className:"shrink-0",children:[s.jsx(vs,{className:"mr-2 h-4 w-4"})," Add Image"]})]})]}),Kae=()=>{const{id:t}=Dd(),e=ks(),r=t&&t.startsWith("biz")?t.replace("biz",""):t;console.log("BusinessEdit - Original ID:",t,"Normalized ID:",r);const[n,a]=x.useState(null),[i,o]=x.useState(!0),[l,c]=x.useState(null);x.useEffect(()=>{(async()=>{if(t)try{o(!0);const ee=await Jf(t);ee?(a(ee),c(null)):(c(`Business with ID ${t} not found`),console.error(`Business with ID ${t} not found`))}catch(ee){c(`Error fetching business data: ${ee instanceof Error?ee.message:"Unknown error"}`),console.error("Error fetching business data:",ee)}finally{o(!1)}})()},[t]);const{name:u,setName:d,shortDescription:h,setShortDescription:f,businessDescription:m,setBusinessDescription:g,logoUrl:y,setLogoUrl:b,coverImageUrl:w,setCoverImageUrl:j,address:N,setAddress:S,phone:E,setPhone:C,email:T,setEmail:D,website:A,setWebsite:R,hours:M,setHours:P,categories:U,newCategory:I,setNewCategory:O,social:V,gallery:G,newImageUrl:B,setNewImageUrl:$,handleAddCategory:W,handleRemoveCategory:oe,handleSocialChange:K,handleAddImage:H,handleRemoveImage:X,handleSubmit:me}=Oae({businessData:n,id:t||"",onSaveSuccess:()=>e(`/businesses/${t}`)});return i?s.jsx("div",{className:"py-12",children:s.jsx("div",{className:"container-wrapper",children:s.jsx("div",{className:"text-center",children:s.jsx("p",{className:"text-lg",children:"Loading business information..."})})})}):l||!n?s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container-wrapper text-center",children:[s.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Business not found"}),s.jsx("p",{className:"mb-6",children:l||"The business you're looking for doesn't exist or has been removed."}),s.jsxs("div",{className:"mb-6",children:[s.jsx("p",{className:"text-sm text-gray-500",children:"Debug Info:"}),s.jsxs("p",{className:"text-sm text-gray-500",children:["Original ID: ",t]}),s.jsxs("p",{className:"text-sm text-gray-500",children:["Normalized ID: ",r]})]}),s.jsx(rt,{to:"/dashboard",children:s.jsxs(Y,{children:[s.jsx(pn,{className:"mr-2 h-4 w-4"})," Back to Dashboard"]})})]})}):s.jsx("div",{className:"py-8",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs(rt,{to:"/dashboard",className:"inline-flex items-center text-chamber-blue hover:underline mb-6",children:[s.jsx(pn,{className:"mr-1 h-4 w-4"})," Back to Dashboard"]}),s.jsx("h1",{className:"text-3xl font-bold mb-4",children:"Edit Business"}),s.jsxs("form",{onSubmit:me,className:"space-y-6",children:[s.jsx(De,{children:s.jsx(Be,{className:"p-6",children:s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[s.jsx("div",{children:s.jsx(zae,{logoUrl:y,setLogoUrl:b})}),s.jsxs("div",{className:"lg:col-span-2 space-y-4",children:[s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"businessName",children:"Business Name"}),s.jsx(Ne,{id:"businessName",value:u,onChange:ie=>d(ie.target.value),className:"mt-1"})]}),s.jsx(Hae,{categories:U,newCategory:I,setNewCategory:O,handleAddCategory:W,handleRemoveCategory:oe}),s.jsx(Wae,{shortDescription:h,setShortDescription:f,businessDescription:m,setBusinessDescription:g})]})]})})}),s.jsx(De,{children:s.jsx(Be,{className:"p-6",children:s.jsx(Uae,{coverImageUrl:w,setCoverImageUrl:j})})}),s.jsx(De,{children:s.jsx(Be,{className:"p-6",children:s.jsx(qae,{address:N,setAddress:S,phone:E,setPhone:C,email:T,setEmail:D,website:A,setWebsite:R,hours:M,setHours:P})})}),s.jsx(De,{children:s.jsx(Be,{className:"p-6",children:s.jsx(Gae,{social:V,handleSocialChange:K})})}),s.jsx(De,{children:s.jsx(Be,{className:"p-6",children:s.jsx(Vae,{gallery:G,newImageUrl:B,setNewImageUrl:$,handleAddImage:H,handleRemoveImage:X})})}),s.jsxs("div",{className:"flex justify-end gap-4",children:[s.jsx(rt,{to:`/businesses/${t}`,children:s.jsx(Y,{variant:"outline",type:"button",children:"Cancel"})}),s.jsxs(Y,{type:"submit",className:"bg-chamber-blue",children:[s.jsx(hp,{className:"mr-2 h-4 w-4"})," Save Changes"]})]})]})]})})},Jae=async t=>{var e,r,n,a,i,o,l;try{console.log("Creating business with data:",t);const{data:c,error:u}=await Q.auth.getSession();if(u)throw console.error("Session error:",u),new Error(`Authentication error: ${u.message}`);if(!c.session)throw console.error("No active session found"),new Error("You must be logged in to create a business");console.log("User is authenticated with ID:",c.session.user.id),console.log("Creating business - subscription will be required for activation");const d=t.ownerId||c.session.user.id,{data:h}=await Q.from("business_profiles").select("id").eq("owner_id",d),f=!h||h.length===0,g={id:Wn(),owner_id:d,business_name:t.name,business_description:t.business_description||t.description||"No description provided",short_description:t.short_description||((e=t.description)==null?void 0:e.substring(0,150))||"No description provided",business_type:t.business_type||"physical_location",address_line1:t.business_type==="physical_location"?((r=t.location)==null?void 0:r.address)||"No address provided":null,city:t.business_type==="physical_location"?((n=t.location)==null?void 0:n.city)||"":null,state:t.business_type==="physical_location"?((a=t.location)==null?void 0:a.state)||"":null,zip_code:t.business_type==="physical_location"?((i=t.location)==null?void 0:i.zipCode)||"":null,service_area_description:t.business_type==="service_area"&&((o=t.service_area)==null?void 0:o.description)||null,service_radius_miles:t.business_type==="service_area"&&((l=t.service_area)==null?void 0:l.radiusMiles)||null,phone:t.phone||"",email:t.email||"",website:t.website||"",facebook_url:t.facebook_url||"",instagram_url:t.instagram_url||"",twitter_url:t.twitter_url||"",status:"pending",logo_url:t.logo_url||null,cover_image_url:t.cover_image_url||null,gallery_urls:t.gallery_urls||[],business_hours_json:t.business_hours_json||{},is_first_business:f,business_subscription_status:"inactive",tags:t.tags||[]};console.log("Formatted business profile data for insert:",g);const{data:y,error:b}=await Q.from("business_profiles").insert(g).select().single();if(b)throw console.error("Error creating business profile:",b),new Error(`Failed to create business profile: ${b.message}`);if(!y)throw new Error("No business profile data returned after creation");if(console.log("Business profile created successfully:",y),t.categories&&t.categories.length>0)try{console.log("Adding categories for business:",t.categories),await oI.updateBusinessCategories(y.id,t.categories.map(w=>({id:w.id,isPrimary:w.isPrimary||!1}))),console.log("Business categories added successfully")}catch(w){console.error("Error creating business categories:",w)}return{id:y.id,ownerId:d,name:y.business_name,short_description:y.short_description,business_description:y.business_description,description:y.business_description,logo_url:t.logo_url||null,cover_image_url:t.cover_image_url||null,phone:y.phone,email:y.email||t.email||"",website:y.website,facebook_url:y.facebook_url||"",instagram_url:y.instagram_url||"",twitter_url:y.twitter_url||"",business_type:y.business_type,categories:t.categories||[],location:y.business_type==="physical_location"?{id:`loc-${y.id}`,address:y.address_line1,city:y.city,state:y.state,zipCode:y.zip_code}:{id:`loc-${y.id}`,address:void 0,city:void 0,state:void 0,zipCode:void 0},service_area:y.business_type==="service_area"?{description:y.service_area_description||"",radiu
847sMiles:y.service_radius_miles||void 0}:void 0,gallery_urls:y.gallery_urls||[],business_hours_json:y.business_hours_json||{},status:y.status,featured:!1,is_first_business:y.is_first_business||!1,business_subscription_status:y.business_subscription_status,business_subscription_expires_at:y.business_subscription_expires_at,tags:y.tags||[],createdAt:y.created_at,updatedAt:y.updated_at}}catch(c){throw console.error("Error in createBusiness:",c),c}},cI=async()=>{try{console.log("Starting to populate mock data..."),console.log("Clearing existing businesses and locations...");const{error:t}=await Q.from("business_locations").delete().is("business_id",null).not("business_id","eq","00000000-0000-0000-0000-000000000000");t&&console.error("Error clearing business locations:",t);const{data:e}=await Q.from("business_locations").select("id");if(e&&e.length>0)for(const a of e)await Q.from("business_locations").delete().eq("id",a.id);const{data:r}=await Q.from("businesses").select("id");if(r&&r.length>0)for(const a of r)await Q.from("businesses").delete().eq("id",a.id);let n=0;for(const a of l0){console.log(`Adding business: ${a.name}`);const i={name:a.name,description:a.description,logo_url:a.logo_url,website:a.website||"",phone:a.phone||"555-123-4567",categories:a.categories.map(h=>h.name),status:"approved",featured:a.featured,address:a.location.address,owner_id:"00000000-0000-0000-0000-000000000000"},{data:o,error:l}=await Q.from("businesses").insert(i).select("id").single();if(l){console.error("Error inserting business:",l),console.error("Business data:",i);continue}if(!o){console.error("No business ID returned after insert");continue}const c=o.id;console.log(`Added business: ${a.name} with ID: ${c}`);const u={business_id:c,address:a.location.address,city:a.location.city,state:a.location.state,zip_code:a.location.zipCode,latitude:a.location.latitude,longitude:a.location.longitude},{error:d}=await Q.from("business_locations").insert(u);d?(console.error("Error inserting business location:",d),console.error("Location data:",u)):(console.log(`Added location for business: ${a.name}`),n++)}return console.log(`Mock data population completed successfully for ${n} businesses`),{success:!0,message:`Successfully added ${n} mock businesses`,count:n}}catch(t){throw console.error("Error populating mock data:",t),t}},Yae=t=>{const e=t.toLowerCase().replace(/[^\w\s]/g,"").replace(/\s+/g,"-"),r=Wn().substring(0,8);return`${e}-${r}`},Zae=t=>{if(!t)throw console.error("Author ID is required for createWhatsNewPosts"),new Error("Author ID is required");return[{title:"Chamber Welcomes 10 New Businesses in February",content:"<p>Our Chamber of Commerce family continues to grow! This month, we're excited to welcome 10 new business members representing industries from retail to professional services.</p><p>These new members will bring fresh perspectives and expand our community network. Be sure to supp
847ort our newest members and attend our next networking mixer to meet them in person.</p>",excerpt:"Ten new businesses have joined our Chamber this month, expanding our local business community in exciting new ways."},{title:"Business Awards Announced",content:"<p>Our Chamber of Commerce is proud to announce the winners of our annual business awards!</p><p>These awards recognize the hard work and dedication of our local business community. Congratulations to all the winners!</p>",excerpt:"Our Chamber of Commerce is proud to announce the winners of our annual business awards!"},{title:"Downtown Grant Awarded",content:"<p>Our Chamber of Commerce has received a downtown grant to support local businesses!</p><p>This grant will help us continue to promote our local business community and support our members.</p>",excerpt:"Our Chamber of Commerce has received a downtown grant to support local businesses!"},{title:"Member Spotlight",content:"<p>Our Chamber of Commerce is proud to spotlight our member of the month!</p><p>Meet [Member Name], a local business owner who has been a member of our Chamber for many years. [Member Name] has been a great asset to our community and we are excited to celebrate their success.</p>",excerpt:"Our Chamber of Commerce is proud to spotlight our member of the month!"},{title:"Mobile App Launch",content:"<p>Our Chamber of Commerce has launched a new mobile app to make it easier for our members to stay connected!</p><p>With our mobile app, you can access news, events, and resources from the comfort of your phone. Download the app today and start using it to stay informed and connected!</p>",excerpt:"Our Chamber of Commerce has launched a new mobile app to make it easier for our members to stay connected!"},{title:"College Partnership",content:"<p>Our Chamber of Commerce has partnered with a local college to supp
847ort local businesses!</p><p>This partnership will help us continue to promote our local business community and support our members.</p>",excerpt:"Our Chamber of Commerce has partnered with a local college to support local businesses!"},{title:"Strategic Plan Update",content:"<p>Our Chamber of Commerce has updated our strategic plan to reflect the changing needs of our local business community.</p><p>This strategic plan will help us continue to promote our local business community and support our members.</p>",excerpt:"Our Chamber of Commerce has updated our strategic plan to reflect the changing needs of our local business community."}].map((r,n)=>{const a=n*3,i=new Date;return i.setDate(i.getDate()-a),{id:Wn(),title:r.title,slug:Yae(r.title),content:r.content,excerpt:r.excerpt,featured_image:`https://images.unsplash.com/photo-${156e7+n*1e4}?auto=format&fit=crop&w=800&h=500&q=80`,author_id:t,status:"published",publish_date:i.toISOString()}})};var Xae=[{name:"Aegean Airlines",iataCode:"A3"},{name:"Aeroflot",iataCode:"SU"},{name:"Aerolineas Argentinas",iataCode:"AR"},{name:"Aeromexico",iataCode:"AM"},{name:"Air Algerie",iataCode:"AH"},{name:"Air Arabia",iataCode:"G9"},{name:"Air Canada",iataCode:"AC"},{name:"Air China",iataCode:"CA"},{name:"Air Europa",iataCode:"UX"},{name:"Air France",iataCode:"AF"},{name:"Air India",iataCode:"AI"},{name:"Air Mauritius",iataCode:"MK"},{name:"Air New Zealand",iataCode:"NZ"},{name:"Air Niugini",iataCode:"PX"},{name:"Air Tahiti",iataCode:"VT"},{name:"Air Tahiti Nui",iataCode:"TN"},{name:"Air Transat",iataCode:"TS"},{name:"AirAsia X",iataCode:"D7"},{name:"AirAsia",iataCode:"AK"},{name:"Aircalin",iataCode:"SB"},{name:"Alaska Airlines",iataCode:"AS"},{name:"Alitalia",iataCode:"AZ"},{name:"All Nippon Airways",iataCode:"NH"},{name:"Allegiant Air",iataCode:"G4"},{name:"American Airlines",iataCode:"AA"},{name:"Asiana Airlines",iataCode:"OZ"},{name:"Avianca",iataCode:"AV"},{name:"Azul Linhas Aereas Brasileiras",iataCode:"AD"},{name:"Azur Air",iataCode:"ZF"},{name:"Beijing Capital Airlines",iataCode:"JD"},{name:"Boliviana de Aviacion",iataCode:"OB"},{name:"British Airways",iataCode:"BA"},{name:"Cathay Pacific",iataCode:"CX"},{name:"Cebu Pacific Air",iataCode:"5J"},{name:"China Airlines",iataCode:"CI"},{name:"China Eastern Airlines",iataCode:"MU"},{name:"China Southern Airlines",iataCode:"CZ"},{name:"Condor",iataCode:"DE"},{name:"Copa Airlines",iataCode:"CM"},{name:"Delta Air Lines",iataCode:"DL"},{name:"Easyfly",iataCode:"VE"},{name:"EasyJet",iataCode:"U2"},{name:"EcoJet",iataCode:"8J"},{name:"Egyptair",iataCode:"MS"},{name:"El Al",iataCode:"LY"},{name:"Emirates Airlines",iataCode:"EK"},{name:"Ethiopian Airlines",iataCode:"ET"},{name:"Etihad Airways",iataCode:"EY"},{name:"EVA Air",iataCode:"BR"},{name:"Fiji Airways",iataCode:"FJ"},{name:"Finnair",iataCode:"AY"},{name:"Flybondi",iataCode:"FO"},{name:"Flydubai",iataCode:"FZ"},{name:"FlySafair",iataCode:"FA"},{name:"Frontier Airlines",iataCode:"F9"},{name:"Garuda Indonesia",iataCode:"GA"},{name:"Go First",iataCode:"G8"},{name:"Gol Linhas Aereas Inteligentes",iataCode:"G3"},{name:"Hainan Airlines",iataCode:"HU"},{name:"Hawaiian Airlines",iataCode:"HA"},{name:"IndiGo Airlines",iataCode:"6E"},{name:"Japan Airlines",iataCode:"JL"},{name:"Jeju Air",iataCode:"7C"},{name:"Jet2",iataCode:"LS"},{name:"JetBlue Airways",iataCode:"B6"},{name:"JetSMART",iataCode:"JA"},{name:"Juneyao Airlines",iataCode:"HO"},{name:"Kenya Airways",iataCode:"KQ"},{name:"KLM Royal Dutch Airlines",iataCode:"KL"},{name:"Korean Air",iataCode:"KE"},{name:"Kulula.com",iataCode:"MN"},{name:"LATAM Airlines",iataCode:"LA"},{name:"Lion Air",iataCode:"JT"},{name:"LOT Polish Airlines",iataCode:"LO"},{name:"Lufthansa",iataCode:"LH"},{name:"Libyan Airlines",iataCode:"LN"},{name:"Linea Aerea Amaszonas",iataCode:"Z8"},{name:"Malaysia Airlines",iataCode:"MH"},{name:"Nordwind Airlines",iataCode:"N4"},{name:"Norwegian Air Shuttle",iataCode:"DY"},{name:"Oman Air",iataCode:"WY"},{name:"Pakistan International Airlines",iataCode:"PK"},{name:"Pegasus Airlines",iataCode:"PC"},{name:"Philippine Airlines",iataCode:"PR"},{name:"Qantas Group",iataCode:"QF"},{name:"Qatar Airways",iataCode:"QR"},{name:"Republic Airways",iataCode:"YX"},{name:"Royal Air Maroc",iataCode:"AT"},{name:"Ryanair",iataCode:"FR"},{name:"S7 Airlines",iataCode:"S7"}
847,{name:"SAS",iataCode:"SK"},{name:"Satena",iataCode:"9R"},{name:"Saudia",iataCode:"SV"},{name:"Shandong Airlines",iataCode:"SC"},{name:"Sichuan Airlines",iataCode:"3U"},{name:"Singapore Airlines",iataCode:"SQ"},{name:"Sky Airline",iataCode:"H2"},{name:"SkyWest Airlines",iataCode:"OO"},{name:"South African Airways",iataCode:"SA"},{name:"Southwest Airlines",iataCode:"WN"},{name:"SpiceJet",iataCode:"SG"},{name:"Spirit Airlines",iataCode:"NK"},{name:"Spring Airlines",iataCode:"9S"},{name:"SriLankan Airlines",iataCode:"UL"},{name:"Star Peru",iataCode:"2I"},{name:"Sun Country Airlines",iataCode:"SY"},{name:"SunExpress",iataCode:"XQ"},{name:"TAP Air Portugal",iataCode:"TP"},{name:"Thai AirAsia",iataCode:"FD"},{name:"Thai Airways",iataCode:"TG"},{name:"TUI Airways",iataCode:"BY"},{name:"Tunisair",iataCode:"TU"},{name:"Turkish Airlines",iataCode:"TK"},{name:"Ukraine International",iataCode:"PS"},{name:"United Airlines",iataCode:"UA"},{name:"Ural Airlines",iataCode:"U6"},{name:"VietJet Air",iataCode:"VJ"},{name:"Vietnam Airlines",iataCode:"VN"},{name:"Virgin Atlantic Airways",iataCode:"VS"},{name:"Virgin Australia",iataCode:"VA"},{name:"VivaAerobus",iataCode:"VB"},{name:"VOEPASS Linhas Aereas",iataCode:"2Z"},{name:"Volaris",iataCode:"Y4"},{name:"WestJet",iataCode:"WS"},{name:"Wingo",iataCode:"P5"},{name:"Wizz Air",iataCode:"W6"}],Qae=[{name:"Aerospatiale/BAC Concorde",iataTypeCode:"SSC"},{name:"Airbus A300",iataTypeCode:"AB3"},{name:"Airbus A310",iataTypeCode:"310"},{name:"Airbus A310-200",iataTypeCode:"312"},{name:"Airbus A310-300",iataTypeCode:"313"},{name:"Airbus A318",iataTypeCode:"318"},{name:"Airbus A319",iataTypeCode:"319"},{name:"Airbus A319neo",iataTypeCode:"31N"},{name:"Airbus A320",iataTypeCode:"320"},{name:"Airbus A320neo",iataTypeCode:"32N"},{name:"Airbus A321",iataTypeCode:"321"},{name:"Airbus A321neo",iataTypeCode:"32Q"},{name:"Airbus A330",iataTypeCode:"330"},{name:"Airbus A330-200",iataTypeCode:"332"},{name:"Airbus A330-300",iataTypeCode:"333"},{name:"Airbus A330-800neo",iataTypeCode:"338"},{name:"Airbus A330-900neo",iataTypeCode:"339"},{name:"Airbus A340",iataTypeCode:"340"},{name:"Airbus A340-200",iataTypeCode:"342"},{name:"Airbus A340-300",iataTypeCode:"343"},{name:"Airbus A340-500",iataTypeCode:"345"},{name:"Airbus A340-600",iataTypeCode:"346"},{name:"Airbus A350",iataTypeCode:"350"},{name:"Airbus A350-900",iataTypeCode:"359"},{name:"Airbus A350-1000",iataTypeCode:"351"},{name:"Airbus A380",iataTypeCode:"380"},{name:"Airbus A380-800",iataTypeCode:"388"},{name:"Antonov An-12",iataTypeCode:"ANF"},{name:"Antonov An-24",iataTypeCode:"AN4"},{name:"Antonov An-26",iataTypeCode:"A26"},{name:"Antonov An-28",iataTypeCode:"A28"},{name:"Antonov An-30",iataTypeCode:"A30"},{name:"Antonov An-32",iataTypeCode:"A32"},{name:"Antonov An-72",iataTypeCode:"AN7"},{name:"Antonov An-124 Ruslan",iataTypeCode:"A4F"},{name:"Antonov An-140",iataTypeCode:"A40"},{name:"Antonov An-148",iataTypeCode:"A81"},{name:"Antonov An-158",iataTypeCode:"A58"},{name:"Antonov An-225 Mriya",iataTypeCode:"A5F"},{name:"Boeing 707",iataTypeCode:"703"},{name:"Boeing 717",iataTypeCode:"717"},{name:"Boeing 720B",iataTypeCode:"B72"},{name:"Boeing 727",iataTypeCode:"727"},{name:"Boeing 727-100",iataTypeCode:"721"},{name:"Boeing 727-200",iataTypeCode:"722"},{name:"Boeing 737 MAX 7",iataTypeCode:"7M7"},{name:"Boeing 737 MAX 8",iataTypeCode:"7M8"},{name:"Boeing 737 MAX 9",iataTypeCode:"7M9"},{name:"Boeing 737 MAX 10",iataTypeCode:"7MJ"},{name:"Boeing 737",iataTypeCode:"737"},{name:"Boeing 737-100",iataTypeCode:"731"},{name:"Boeing 737-200",iataTypeCode:"732"},{name:"Boeing 737-300",iataTypeCode:"733"},{name:"Boeing 737-400",iataTypeCode:"734"},{name:"Boeing 737-500",iataTypeCode:"735"},{name:"Boeing 737-600",iataTypeCode:"736"},{name:"Boeing 737-700",iataTypeCode:"73G"},{name:"Boeing 737-800",iataTypeCode:"738"},{name:"Boeing 737-900",iataTypeCode:"739"},{name:"Boeing 747",iataTypeCode:"747"},{name:"Boeing 747-100",iataTypeCode:"741"},{name:"Boeing 747-200",iataTypeCode:"742"},{name:"Boeing 747-300",iataTypeCode:"743"},{name:"Boeing 747-400",iataTypeCode:"744"},{name:"Boeing 747-400D",iataTypeCode:"74J"},{name:"Boeing 747-8",iataTypeCode:"748"},{name:"Boeing 747SP",iataTypeCode:"74L"},{name:"Boeing 747SR",iataTypeCode:"74R"},{name:"Boeing 757",iataTypeCode:"757"},{name:"Boeing 757-200",iataTypeCode:"752"},{name:"Boeing 757-300",iataTypeCode:"753"},{name:"Boeing 767",iataTypeCode:"767"},{name:"Boeing 767-200",iataTypeCode:"762"},{name:"Boeing 767-300",iataTypeCode:"763"},{name:"Boeing 767-400",iataTypeCode:"764"},{name:"Boeing 777",iataTypeCode:"777"},{name:"Boeing 777-200",iataTypeCode:"772"},{name:"Boeing 777-200LR",iataTypeCode:"77L"},{name:"Boeing 777-300",iataTypeCode:"773"},{name:"Boeing 777-300ER",iataTypeCode:"77W"},{name:"Boeing 787",iataTypeCode:"787"},{name:"Boeing 787-8",iataTypeCode:"788"},{name:"Boeing 787-9",iataTypeCode:"789"},{name:"Boeing 787-10",iataTypeCode:"781"},{name:"Canadair Challenger",iataTypeCode:"CCJ"},{name:"Canadair CL-44",iataTypeCode:"CL4"},{name:"Canadair Regional Jet 100",iataTypeCode:"CR1"},{name:"Canadair Regional Jet 200",iataTypeCode:"CR2"},{name:"Canadair Regional Jet 700",iataTypeCode:"CR7"}
847,{name:"Canadair Regional Jet 705",iataTypeCode:"CRA"},{name:"Canadair Regional Jet 900",iataTypeCode:"CR9"},{name:"Canadair Regional Jet 1000",iataTypeCode:"CRK"},{name:"De Havilland Canada DHC-2 Beaver",iataTypeCode:"DHP"},{name:"De Havilland Canada DHC-2 Turbo-Beaver",iataTypeCode:"DHR"},{name:"De Havilland Canada DHC-3 Otter",iataTypeCode:"DHL"},{name:"De Havilland Canada DHC-4 Caribou",iataTypeCode:"DHC"},{name:"De Havilland Canada DHC-6 Twin Otter",iataTypeCode:"DHT"},{name:"De Havilland Canada DHC-7 Dash 7",iataTypeCode:"DH7"},{name:"De Havilland Canada DHC-8-100 Dash 8 / 8Q",iataTypeCode:"DH1"},{name:"De Havilland Canada DHC-8-200 Dash 8 / 8Q",iataTypeCode:"DH2"},{name:"De Havilland Canada DHC-8-300 Dash 8 / 8Q",iataTypeCode:"DH3"},{name:"De Havilland Canada DHC-8-400 Dash 8Q",iataTypeCode:"DH4"},{name:"De Havilland DH.104 Dove",iataTypeCode:"DHD"},{name:"De Havilland DH.114 Heron",iataTypeCode:"DHH"},{name:"Douglas DC-3",iataTypeCode:"D3F"},{name:"Douglas DC-6",iataTypeCode:"D6F"},{name:"Douglas DC-8-50",iataTypeCode:"D8T"},{name:"Douglas DC-8-62",iataTypeCode:"D8L"},{name:"Douglas DC-8-72",iataTypeCode:"D8Q"},{name:"Douglas DC-9-10",iataTypeCode:"D91"},{name:"Douglas DC-9-20",iataTypeCode:"D92"},{name:"Douglas DC-9-30",iataTypeCode:"D93"},{name:"Douglas DC-9-40",iataTypeCode:"D94"},{name:"Douglas DC-9-50",iataTypeCode:"D95"},{name:"Douglas DC-10",iataTypeCode:"D10"},{name:"Douglas DC-10-10",iataTypeCode:"D1X"},{name:"Douglas DC-10-30",iataTypeCode:"D1Y"},{name:"Embraer 170",iataTypeCode:"E70"},{name:"Embraer 175",iataTypeCode:"E75"},{name:"Embraer 190",iataTypeCode:"E90"},{name:"Embraer 195",iataTypeCode:"E95"},{name:"Embraer E190-E2",iataTypeCode:"290"},{name:"Embraer E195-E2",iataTypeCode:"295"},{name:"Embraer EMB.110 Bandeirante",iataTypeCode:"EMB"},{name:"Embraer EMB.120 Brasilia",iataTypeCode:"EM2"},{name:"Embraer Legacy 600",iataTypeCode:"ER3"},{name:"Embraer Phenom 100",iataTypeCode:"EP1"},{name:"Embraer Phenom 300",iataTypeCode:"EP3"},{name:"Embraer RJ135",iataTypeCode:"ER3"},{name:"Embraer RJ140",iataTypeCode:"ERD"},{name:"Embraer RJ145 Amazon",iataTypeCode:"ER4"},{name:"Ilyushin IL18",iataTypeCode:"IL8"},{name:"Ilyushin IL62",iataTypeCode:"IL6"},{name:"Ilyushin IL76",iataTypeCode:"IL7"},{name:"Ilyushin IL86",iataTypeCode:"ILW"},{name:"Ilyushin IL96-300",iataTypeCode:"I93"},{name:"Ilyushin IL114",iataTypeCode:"I14"},{name:"Lockheed L-182 / 282 / 382 (L-100) Hercules",iataTypeCode:"LOH"},{name:"Lockheed L-188 Electra",iataTypeCode:"LOE"},{name:"Lockheed L-1011 Tristar",iataTypeCode:"L10"},{name:"Lockheed L-1049 Super Constellation",iataTypeCode:"L49"},{name:"McDonnell Douglas MD11",iataTypeCode:"M11"},{name:"McDonnell Douglas MD80",iataTypeCode:"M80"},{name:"McDonnell Douglas MD81",iataTypeCode:"M81"},{name:"McDonnell Douglas MD82",iataTypeCode:"M82"},{name:"McDonnell Douglas MD83",iataTypeCode:"M83"},{name:"McDonnell Douglas MD87",iataTypeCode:"M87"},{name:"McDonnell Douglas MD88",iataTypeCode:"M88"},{name:"McDonnell Douglas MD90",iataTypeCode:"M90"},{name:"Sukhoi Superjet 100-95",iataTypeCode:"SU9"},{name:"Tupolev Tu-134",iataTypeCode:"TU3"},{name:"Tupolev Tu-154",iataTypeCode:"TU5"},{name:"Tupolev Tu-204",iataTypeCode:"T20"},{name:"Yakovlev Yak-40",iataTypeCode:"YK4"},{name:"Yakovlev Yak-42",iataTypeCode:"YK2"}],eie=[{name:"Adelaide International Airport",iataCode:"ADL"},{name:"Adolfo Suarez Madrid-Barajas Airport",iataCode:"MAD"},{name:"Aeroparque Jorge Newbery Airport",iataCode:"AEP"},{name:"Afonso Pena International Airport",iataCode:"CWB"},{name:"Alfonso Bonilla Aragon International Airport",iataCode:"CLO"},{name:"Amsterdam Airport Schiphol",iataCode:"AMS"},{name:"Arturo Merino Benitez International Airport",iataCode:"SCL"},{name:"Auckland International Airport",iataCode:"AKL"},{name:"Beijing Capital International Airport",iataCode:"PEK"},{name:"Belem Val de Cans International Airport",iataCode:"BEL"},{name:"Belo Horizonte Tancredo Neves International Airport",iataCode:"CNF"},{name:"Berlin-Tegel Airport",iataCode:"TXL"},{name:"Bole International Airport",iataCode:"ADD"},{name:"Brasilia-Presidente Juscelino Kubitschek International Airport",iataCode:"BSB"},{name:"Brisbane International Airport",iataCode:"BNE"},{name:"Brussels Airport",iataCode:"BRU"},{name:"Cairns Airport",iataCode:"CNS"},{name:"Cairo International Airport",iataCode:"CAI"},{name:"Canberra Airport",iataCode:"CBR"},{name:"Capetown International Airport",iataCode:"CPT"},{name:"Charles de Gaulle International Airport",iataCode:"CDG"},{name:"Charlotte Douglas International Airport",iataCode:"CLT"},{name:"Chengdu Shuangliu International Airport",iataCode:"CTU"},{name:"Chhatrapati Shivaji International Airport",iataCode:"BOM"},{name:"Chicago O'Hare International Airport",iataCode:"ORD"},{name:"Chongqing Jiangbei International Airport",iataCode:"CKG"},{name:"Christchurch International Airport",iataCode:"CHC"},{name:"Copenhagen Kastrup Airport",iataCode:"CPH"},{name:"Dallas Fort Worth International Airport",iataCode:"DFW"},{name:"Daniel K. Inouye International Airport",iataCode:"HNL"},{name:"Denver International Airport",iataCode:"DEN"},{name:"Don Mueang International Airport",iataCode:"DMK"},{name:"Dubai International Airport",iataCode:"DXB"},{name:"Dublin Airport",iataCode:"DUB"},{name:"Dusseldorf Airport",iataCode:"DUS"},{name:"El Dorado International Airport",iataCode:"BOG"},{name:"Eleftherios Venizelos International Airport",iataCode:"ATH"},{name:"Faa'a International Airport",iataCode:"PPT"},{name:"Fort Lauderdale Hollywood International Airport",iataCode:"FLL"},{name:"Fortaleza Pinto Martins International Airport",iataCode:"FOR"},{name:"Frankfurt am Main Airport",iataCode:"FRA"},{name:"George Bush Intercontinental Houston Airport",iataCode:"IAH"},{name:"Gold Coast Airport",iataCode:"OOL"},{name:"Guarulhos - Governador Andre Franco Montoro International Airport",iataCode:"GRU"},{name:"Hartsfield-Jackson Atlanta International Airport",iataCode:"ATL"},{name:"Helsinki Vantaa Airport",iataCode:"HEL"},{name:"Hobart International Airport",iataCode:"HBA"},{name:"Hong Kong International Airport",iataCode:"HKG"},{name:"Houari Boumediene Airport",iataCode:"ALG"},{name:"Hurgada International Airport",iataCode:"HRG"},{name:"Incheon International Airport",iataCode:"ICN"},{name:"Indira Gandhi International Airport",iataCode:"DEL"},{name:"Istanbul Airport",iataCode:"IST"},{name:"Jacksons International Airport",iataCode:"POM"},{name:"Jeju International Airport",iataCode:"CJU"},{name:"John F Kennedy International Airport",iataCode:"JFK"},{name:"Jorge Chavez International Airport",iataCode:"LIM"},{name:"Jose Maria Cordova International Airport",iataCode:"MDE"},{name:"Josep Tarradellas Barcelona-El Prat Airport",iataCode:"BCN"},{name:"Kahului Airport",iataCode:"OGG"},{name:"King Abdulaziz International Airport",iataCode:"JED"},{name:"Kuala Lumpur International Airport",iataCode:"KUL"},{name:"Kunming Changshui International Airport",iataCode:"KMG"},{name:"La Tontouta International Airport",iataCode:"NOU"},{name:"Leonardo da Vinci-Fiumicino Airport",iataCode:"FCO"},{name:"London Heathrow Airport",iataCode:"LHR"},{name:"Los Angeles International Airport",iataCode:"LAX"},{name:"McCarran International Airport",iataCode:"LAS"},{name:"Melbourne International Airport",iataCode:"MEL"},{name:"Mexico City International Airport",iataCode:"MEX"},{name:"Miami International Airport",iataCode:"MIA"},{name:"Ministro Pistarini International Airport",iataCode:"EZE"},{name:"Minneapolis-St Paul International/Wold-Chamberlain Airport",iataCode:"MSP"},{name:"Mohammed V International Airport",iataCode:"CMN"},{name:"Moscow Domodedovo Airport",iataCode:"DME"},{name:"Munich Airport",iataCode:"MUC"},{name:"Murtala Muhammed International Airport",iataCode:"LOS"},{name:"Nadi International Airport",iataCode:"NAN"},{name:"Nairobi Jomo Kenyatta International Airport",iataCode:"NBO"},{name:"Narita International Airport",iataCode:"NRT"},{name:"Newark Liberty International Airport",iataCode:"EWR"},{name:"Ninoy Aquino International Airport",iataCode:"MNL"},{name:"Noumea Magenta Airport",iataCode:"GEA"},{name:"O. R. Tambo International Airport",iataCode:"JNB"},{name:"Orlando International Airport",iataCode:"MCO"},{name:"Oslo Lufthavn",iataCode:"OSL"},{name:"Perth Airport",iataCode:"PER"},{name:"Phoenix Sky Harbor International Airport",iataCode:"PHX"},{name:"Recife Guararapes-Gilberto Freyre International Airport",iataCode:"REC"},{name:"Rio de Janeiro Galeao International Airport",iataCode:"GIG"},{name:"Salgado Filho International Airport",iataCode:"POA"},{name:"Salvador Deputado Luis Eduardo Magalhaes International Airport",iataCode:"SSA"},{name:"San Francisco International Airport",iataCode:"SFO"},{name:"Santos Dumont Airport",iataCode:"SDU"},{name:"Sao Paulo-Congonhas Airport",iataCode:"CGH"},{name:"Seattle Tacoma International Airport",iataCode:"SEA"},{name:"Shanghai Hongqiao International Airport",iataCode:"SHA"},{name:"Shanghai Pudong International Airport",iataCode:"PVG"},{name:"Shenzhen Bao'an International Airport",iataCode:"SZX"},{name:"Sheremetyevo International Airport",iataCode:"SVO"}
847,{name:"Singapore Changi Airport",iataCode:"SIN"},{name:"Soekarno-Hatta International Airport",iataCode:"CGK"},{name:'Stockholm-Arlanda Airport"',iataCode:"ARN"},{name:"Suvarnabhumi Airport",iataCode:"BKK"},{name:"Sydney Kingsford Smith International Airport",iataCode:"SYD"},{name:"Taiwan Taoyuan International Airport",iataCode:"TPE"},{name:"Tan Son Nhat International Airport",iataCode:"SGN"},{name:"Tokyo Haneda International Airport",iataCode:"HND"},{name:"Toronto Pearson International Airport",iataCode:"YYZ"},{name:"Tunis Carthage International Airport",iataCode:"TUN"},{name:"Vancouver International Airport",iataCode:"YVR"},{name:"Vienna International Airport",iataCode:"VIE"},{name:"Viracopos International Airport",iataCode:"VCP"},{name:"Vnukovo International Airport",iataCode:"VKO"},{name:"Wellington International Airport",iataCode:"WLG"},{name:"Xi'an Xianyang International Airport",iataCode:"XIY"},{name:"Zhukovsky International Airport",iataCode:"ZIA"},{name:"Zurich Airport",iataCode:"ZRH"}],tie={airline:Xae,airplane:Qae,airport:eie},rie=tie,sie=["American black bear","Asian black bear","Brown bear","Giant panda","Polar bear","Sloth bear","Spectacled bear","Sun bear"],nie=["Abert's Towhee","Acadian Flycatcher","Acorn Woodpecker","Alder Flycatcher","Aleutian Tern","Allen's Hummingbird","Altamira Oriole","American Avocet","American Bittern","American Black Duck","American Coot","American Crow","American Dipper","American Golden-Plover","American Goldfinch","American Kestrel","American Oystercatcher","American Pipit","American Redstart","American Robin","American Tree Sparrow","American White Pelican","American Wigeon","American Woodcock","Ancient Murrelet","Anhinga","Anna's Hummingbird","Antillean Nighthawk","Antillean Palm Swift","Aplomado Falcon","Arctic Loon","Arctic Tern","Arctic Warbler","Ash-throated Flycatcher","Ashy Storm-Petrel","Asian Brown Flycatcher","Atlantic Puffin","Audubon's Oriole","Audubon's Shearwater","Aztec Thrush","Azure Gallinule","Bachman's Sparrow","Bachman's Warbler","Bahama Mockingbird","Bahama Swallow","Bahama Woodstar","Baikal Teal","Baird's Sandpiper","Baird's Sparrow","Bald Eagle","Baltimore Oriole","Bananaquit","Band-rumped Storm-Petrel","Band-tailed Gull","Band-tailed Pigeon","Bank Swallow","Bar-tailed Godwit","Barn Owl","Barn Swallow","Barnacle Goose","Barred Owl","Barrow's Goldeneye","Bay-breasted Warbler","Bean Goose","Bell's Vireo","Belted Kingfisher","Bendire's Thrasher","Berylline Hummingbird","Bewick's Wren","Bicknell's Thrush","Black Catbird","Black Guillemot","Black Noddy","Black Oystercatcher","Black Phoebe","Black Rail","Black Rosy-Finch","Black Scoter","Black Skimmer","Black Storm-Petrel","Black Swift","Black Tern","Black Turnstone","Black Vulture","Black-and-white Warbler","Black-backed Wagtail","Black-backed Woodpecker","Black-bellied Plover","Black-bellied Whistling-Duck","Black-billed Cuckoo","Black-billed Magpie","Black-browed Albatross","Black-capped Chickadee","Black-capped Gnatcatcher","Black-capped Petrel","Black-capped Vireo","Black-chinned Hummingbird","Black-chinned Sparrow","Black-crowned Night-Heron","Black-faced Grassquit","Black-footed Albatross","Black-headed Grosbeak","Black-headed Gull","Black-legged Kittiwake","Black-necked Stilt","Black-tailed Gnatcatcher","Black-tailed Godwit","Black-tailed Gull","Black-throated Blue Warbler","Black-throated Gray Warbler","Black-throated Green Warbler","Black-throated Sparrow","Black-vented Oriole","Black-vented Shearwater","Black-whiskered Vireo","Black-winged Stilt","Blackburnian Warbler","Blackpoll Warbler","Blue Bunting","Blue Grosbeak","Blue Grouse","Blue Jay","Blue Mockingbird","Blue-footed Booby","Blue-gray Gnatcatcher","Blue-headed Vireo","Blue-throated Hummingbird","Blue-winged Teal","Blue-winged Warbler","Bluethroat","Boat-tailed Grackle","Bobolink","Bohemian Waxwing","Bonaparte's Gull","Boreal Chickadee","Boreal Owl","Botteri's Sparrow","Brambling","Brandt's Cormorant","Brant","Brewer's Blackbird","Brewer's Sparrow","Bridled Tern","Bridled Titmouse","Bristle-thighed Curlew","Broad-billed Hummingbird","Broad-billed Sandpiper","Broad-tailed Hummingbird","Broad-winged Hawk","Bronzed Cowbird","Brown Booby","Brown Creeper","Brown Jay","Brown Noddy","Brown Pelican","Brown Shrike","Brown Thrasher","Brown-capped Rosy-Finch","Brown-chested Martin","Brown-crested Flycatcher","Brown-headed Cowbird","Brown-headed Nuthatch","Budgerigar","Buff-bellied Hummingbird","Buff-breasted Flycatcher","Buff-breasted Sandpiper","Buff-collared Nightjar","Bufflehead","Buller's Shearwater","Bullock's Oriole","Bumblebee Hummingbird","Burrowing Owl","Bushtit","Cactus Wren","California Condor","California Gnatcatcher","California Gull","California Quail","California Thrasher","California Towhee","Calliope Hummingbird","Canada Goose","Canada Warbler","Canvasback","Canyon Towhee","Canyon Wren","Cape May Warbler","Caribbean Elaenia","Carolina Chickadee","Carolina Parakeet","Carolina Wren","Caspian Tern","Cassin's Auklet","Cassin's Finch","Cassin's Kingbird","Cassin's Sparrow","Cassin's Vireo","Cattle Egret","Cave Swallow","Cedar Waxwing","Cerulean Warbler","Chestnut-backed Chickadee","Chestnut-collared Longspur","Chestnut-sided Warbler","Chihuahuan Raven","Chimney Swift","Chinese Egret","Chipping Sparrow","Chuck-will's-widow","Chukar","Cinnamon Hummingbird","Cinnamon Teal","Citrine Wagtail","Clapper Rail","Clark's Grebe","Clark's Nutcracker","Clay-colored Robin","Clay-colored Sparrow","Cliff Swallow","Colima Warbler","Collared Forest-Falcon","Collared Plover","Common Black-Hawk","Common Chaffinch","Common Crane","Common Cuckoo","Common Eider","Common Goldeneye","Common Grackle","Common Greenshank","Common Ground-Dove","Common House-Martin","Common Loon","Common Merganser","Common Moorhen","Common Murre","Common Nighthawk","Common Pauraque","Common Pochard","Common Poorwill","Common Raven","Common Redpoll","Common Ringed Plover","Common Rosefinch","Common S
847andpiper","Common Snipe","Common Swift","Common Tern","Common Yellowthroat","Connecticut Warbler","Cook's Petrel","Cooper's Hawk","Cordilleran Flycatcher","Corn Crake","Cory's Shearwater","Costa's Hummingbird","Couch's Kingbird","Crane Hawk","Craveri's Murrelet","Crescent-chested Warbler","Crested Auklet","Crested Caracara","Crested Myna","Crimson-collared Grosbeak","Crissal Thrasher","Cuban Martin","Curlew Sandpiper","Curve-billed Thrasher","Dark-eyed Junco","Dickcissel","Double-crested Cormorant","Double-striped Thick-knee","Dovekie","Downy Woodpecker","Dunlin","Dusky Flycatcher","Dusky Thrush","Dusky Warbler","Dusky-capped Flycatcher","Eared Grebe","Eared Trogon","Eastern Bluebird","Eastern Kingbird","Eastern Meadowlark","Eastern Phoebe","Eastern Screech-Owl","Eastern Towhee","Eastern Wood-Pewee","Elegant Tern","Elegant Trogon","Elf Owl","Emperor Goose","Eskimo Curlew","Eurasian Blackbird","Eurasian Bullfinch","Eurasian Collared-Dove","Eurasian Coot","Eurasian Curlew","Eurasian Dotterel","Eurasian Hobby","Eurasian Jackdaw","Eurasian Kestrel","Eurasian Oystercatcher","Eurasian Siskin","Eurasian Tree Sparrow","Eurasian Wigeon","Eurasian Woodcock","Eurasian Wryneck","European Golden-Plover","European Starling","European Storm-Petrel","European Turtle-Dove","Evening Grosbeak","Eyebrowed Thrush","Falcated Duck","Fan-tailed Warbler","Far Eastern Curlew","Ferruginous Hawk","Ferruginous Pygmy-Owl","Field Sparrow","Fieldfare","Fish Crow","Five-striped Sparrow","Flame-colored Tanager","Flammulated Owl","Flesh-footed Shearwater","Florida Scrub-Jay","Fork-tailed Flycatcher","Fork-tailed Storm-Petrel","Fork-tailed Swift","Forster's Tern","Fox Sparrow","Franklin's Gull","Fulvous Whistling-Duck","Gadwall","Gambel's Quail","Garganey","Gila Woodpecker","Gilded Flicker","Glaucous Gull","Glaucous-winged Gull","Glossy Ibis","Golden Eagle","Golden-cheeked Warbler","Golden-crowned Kinglet","Golden-crowned Sparrow","Golden-crowned Warbler","Golden-fronted Woodpecker","Golden-winged Warbler","Grace's Warbler","Grasshopper Sparrow","Gray Bunting","Gray Catbird","Gray Flycatcher","Gray Hawk","Gray Jay","Gray Kingbird","Gray Partridge","Gray Silky-flycatcher","Gray Vireo","Gray Wagtail","Gray-breasted Martin","Gray-cheeked Thrush","Gray-crowned Rosy-Finch","Gray-crowned Yellowthroat","Gray-headed Chickadee","Gray-spotted Flycatcher","Gray-tailed Tattler","Great Auk","Great Black-backed Gull","Great Blue Heron","Great Cormorant","Great Crested Flycatcher","Great Egret","Great Frigatebird","Great Gray Owl","Great Horned Owl","Great Kiskadee","Great Knot","Great Skua","Great Spotted Woodpecker","Great-tailed Grackle","Greater Flamingo","Greater Pewee","Greater Prairie-chicken","Greater Roadrunner","Greater Scaup","Greater Shearwater","Greater White-fronted Goose","Greater Yellowlegs","Green Heron","Green Jay","Green Kingfisher","Green Sandpiper","Green Violet-ear","Green-breasted Mango","Green-tailed Towhee","Green-winged Teal","Greenish Elaenia","Groove-billed Ani","Gull-billed Tern","Gyrfalcon","Hairy Woodpecker","Hammond's Flycatcher","Harlequin Duck","Harris's Hawk","Harris's Sparrow","Hawfinch","Heermann's Gull","Henslow's Sparrow","Hepatic Tanager","Herald Petrel","Hermit Thrush","Hermit Warbler","Herring Gull","Himalayan Snowcock","Hoary Redpoll","Hooded Merganser","Hooded Oriole","Hooded Warbler","Hook-billed Kite","Hoopoe","Horned Grebe","Horned Lark","Horned Puffin","House Finch","House Sparrow","House Wren","Hudsonian Godwit","Hutton's Vireo","Iceland Gull","Inca Dove","Indigo Bunting","Island Scrub-Jay","Ivory Gull","Ivory-billed Woodpecker","Jabiru","Jack Snipe","Jungle Nightjar","Juniper Titmouse","Kentucky Warbler","Key West Quail-Dove","Killdeer","King Eider","King Rail","Kirtland's Warbler","Kittlitz's Murrelet","La Sagra's Flycatcher","Labrador Duck","Ladder-backed Woodpecker","Lanceolated Warbler","Lapland Longspur","Large-billed Tern","Lark Bunting","Lark Sparrow","Laughing Gull","Lawrence's Goldfinch","Laysan Albatross","Lazuli Bunting","Le Conte's Sparrow","Le Conte's Thrasher","Leach's Storm-Petrel","Least Auklet","Least Bittern","Least Flycatcher","Least Grebe","Least Sandpiper","Least Storm-Petrel","Least Tern","Lesser Black-backed Gull","Lesser Frigatebird","Lesser Goldfinch","Lesser Nighthawk","Lesser Prairie-chicken","Lesser Scaup","Lesser White-fronted Goose","Lesser Yellowlegs","Lewis's Woodpecker","Limpkin","Lincoln's Sparrow","Little Blue Heron","Little Bunting","Little Curlew","Little Egret","Little Gull","Little Ringed Plover","Little Shearwater","Little Stint","Loggerhead Kingbird","Loggerhead Shrike","Long-billed Curlew","Long-billed Dowitcher","Long-billed Murrelet","Long-billed Thrasher","Long-eared Owl","Long-tailed Jaeger","Long-toed Stint","Louisiana Waterthrush","Lucifer Hummingbird","Lucy's Warbler","MacGillivray's Warbler","Magnificent Frigatebird","Magnificent Hummingbird","Magnolia Warbler","Mallard","Mangrove Cuckoo","Manx Shearwater","Marbled Godwit","Marbled Murrelet","Marsh Sandpiper","Marsh Wren","Masked Booby","Masked Duck","Masked Tityra","McCown's Longspur","McKay's Bunting","Merlin","Mew Gull","Mexican Chickadee","Mexican Jay","Middendorff's Grasshopper-Warbler","Mississippi Kite","Mongolian Plover","Monk Parakeet","Montezuma Quail","Mottled Duck","Mottled Owl","Mottled Petrel","Mountain Bluebird","Mountain Chickadee","Mountain Plover","Mountain Quail","Mourning Dove","Mourning Warbler","Mugimaki Flycatcher","Murphy's Petrel","Muscovy Duck","Mute Swan","Narcissus Flycatcher","Nashville Warbler","Nelson's Sharp-tailed Sparrow","Neotropic Cormorant","Northern Beardless-Tyrannulet","Northern Bobwhite","Northern Cardinal","Northern Flicker","Northern Fulmar","Northern Gannet","Northern Goshawk","Northern Harrier","Northern Hawk Owl","Northern Jacana","Northern Lapwing","Northern Mockingbird","Northern Parula","Northern Pintail","Northern Pygmy-Owl","Northern Rough-winged Swallow","Northern Saw-whet Owl","Northern Shoveler","Northern Shrike","Northern Waterthrush","Northern Wheatear","Northwestern Crow","Nuttall's Woodpecker","Nutting's Flycatcher","Oak Titmouse","Oldsquaw","Olive Sparrow","Olive Warbler","Olive-backed Pipit","Olive-sided Flycatcher","Orange-crowned Warbler","Orchard Oriole","Oriental Cuckoo","Oriental Greenfinch","Oriental Pratincole","Oriental Scops-Owl","Oriental Turtle-Dove","Osprey","Ovenbird","Pacific Golden-Plover","Pacific Loon","Pacific-slope Flycatcher","Paint-billed Crake","Painted Bunting","Painted Redstart","Pallas's Bunting","Palm Warbler","Parakeet Auklet","Parasitic Jaeger","Passenger Pigeon","Pechora Pipit","Pectoral Sandpiper","Pelagic Cormorant","Peregrine Falcon","Phainopepla","Philadelphia Vireo","Pied-billed Grebe","Pigeon Guillemot","Pileated Woodpecker","Pin-tailed Snipe","Pine Bunting","Pine Grosbeak","Pine Siskin","Pine Warbler","Pink-footed Goose","Pink-footed Shearwater","Pinyon Jay","Piping Plover","Plain Chachalaca","Plain-capped Starthroat","Plumbeous Vireo","Pomarine Jaeger","Prairie Falcon","Prairie Warbler","Prothonotary Warbler","Purple Finch","Purple Gallinule","Purple Martin","Purple Sandpiper","Pygmy Nuthatch","Pyrrhuloxia","Razorbill","Red Crossbill","Red Knot","Red Phalarope","Red-bellied Woodpecker","Red-billed Pigeon","Red-billed Tropicbird","Red-breasted Flycatcher","Red-breasted Merganser","Red-breasted Nuthatch","Red-breasted Sapsucker","Red-cockaded Woodpecker","Red-crowned Parrot","Red-eyed Vireo","Red-faced Cormorant","Red-faced Warbler","Red-flanked Bluetail","Red-footed Booby","Red-headed Woodpecker","Red-legged Kittiwake","Red-naped Sapsucker","Red-necked Grebe","Red-necked Phalarope","Red-necked Stint","Red-shouldered Hawk","Red-tailed Hawk","Red-tailed Tropicbird","Red-throated Loon","Red-throated Pipit","Red-whiskered Bulbul","Red-winged Blackbird","Reddish Egret","Redhead","Redwing","Reed Bunting","Rhinoceros Auklet","Ring-billed Gull","Ring-necked Duck","Ring-necked Pheasant","Ringed Kingfisher","Roadside Hawk","Rock Dove","Rock Ptarmigan","Rock Sandpiper","Rock Wren","Rose-breasted Grosbeak","Rose-throated Becard","Roseate Spoonbill","Roseate Tern","Ross's Goose","Ross's Gull","Rough-legged Hawk","Royal Tern","Ruby-crowned Kinglet","Ruby-throated Hummingbird","Ruddy Duck","Ruddy Ground-Dove","Ruddy Quail-Dove","Ruddy Turnstone","Ruff","Ruffed Grouse","Rufous Hummingbird","Rufous-backed Robin","Rufous-capped Warbler","Rufous-crowned Sparrow","Rufous-winged Sparrow","Rustic Bunting","Rusty Blackbird","Sabine's Gull","Sage Grouse","Sage Sparrow","Sage Thrasher","Saltmarsh Sharp-tailed Sparrow","Sanderling","Sandhill Crane","Sandwich Tern","S
847avannah Sparrow","Say's Phoebe","Scaled Quail","Scaly-naped Pigeon","Scarlet Ibis","Scarlet Tanager","Scissor-tailed Flycatcher","Scott's Oriole","Seaside Sparrow","Sedge Wren","Semipalmated Plover","Semipalmated Sandpiper","Sharp-shinned Hawk","Sharp-tailed Grouse","Sharp-tailed Sandpiper","Shiny Cowbird","Short-billed Dowitcher","Short-eared Owl","Short-tailed Albatross","Short-tailed Hawk","Short-tailed Shearwater","Shy Albatross","Siberian Accentor","Siberian Blue Robin","Siberian Flycatcher","Siberian Rubythroat","Sky Lark","Slate-throated Redstart","Slaty-backed Gull","Slender-billed Curlew","Smew","Smith's Longspur","Smooth-billed Ani","Snail Kite","Snow Bunting","Snow Goose","Snowy Egret","Snowy Owl","Snowy Plover","Solitary Sandpiper","Song Sparrow","Sooty Shearwater","Sooty Tern","Sora","South Polar Skua","Southern Martin","Spectacled Eider","Spoonbill Sandpiper","Spot-billed Duck","Spot-breasted Oriole","Spotted Dove","Spotted Owl","Spotted Rail","Spotted Redshank","Spotted Sandpiper","Spotted Towhee","Sprague's Pipit","Spruce Grouse","Stejneger's Petrel","Steller's Eider","Steller's Jay","Steller's Sea-Eagle","Stilt Sandpiper","Stonechat","Streak-backed Oriole","Streaked Shearwater","Strickland's Woodpecker","Stripe-headed Tanager","Sulphur-bellied Flycatcher","Summer Tanager","Surf Scoter","Surfbird","Swainson's Hawk","Swainson's Thrush","Swainson's Warbler","Swallow-tailed Kite","Swamp Sparrow","Tamaulipas Crow","Tawny-shouldered Blackbird","Temminck's Stint","Tennessee Warbler","Terek Sandpiper","Thayer's Gull","Thick-billed Kingbird","Thick-billed Murre","Thick-billed Parrot","Thick-billed Vireo","Three-toed Woodpecker","Townsend's Solitaire","Townsend's Warbler","Tree Pipit","Tree Swallow","Tricolored Blackbird","Tricolored Heron","Tropical Kingbird","Tropical Parula","Trumpeter Swan","Tufted Duck","Tufted Flycatcher","Tufted Puffin","Tufted Titmouse","Tundra Swan","Turkey Vulture","Upland Sandpiper","Varied Bunting","Varied Thrush","Variegated Flycatcher","Vaux's Swift","Veery","Verdin","Vermilion Flycatcher","Vesper Sparrow","Violet-crowned Hummingbird","Violet-green Swallow","Virginia Rail","Virginia's Warbler","Wandering Albatross","Wandering Tattler","Warbling Vireo","Wedge-rumped Storm-Petrel","Wedge-tailed Shearwater","Western Bluebird","Western Grebe","Western Gull","Western Kingbird","Western Meadowlark","Western Reef-Heron","Western Sandpiper","Western Screech-Owl","Western Scrub-Jay","Western Tanager","Western Wood-Pewee","Whimbrel","Whip-poor-will","Whiskered Auklet","Whiskered Screech-Owl","Whiskered Tern","White Ibis","White Wagtail","White-breasted Nuthatch","White-cheeked Pintail","White-chinned Petrel","White-collared Seedeater","White-collared Swift","White-crowned Pigeon","White-crowned Sparrow","White-eared Hummingbird","White-eyed Vireo","White-faced Ibis","White-faced Storm-Petrel","White-headed Woodpecker","White-rumped Sandpiper","White-tailed Eagle","White-tailed Hawk","White-tailed Kite","White-tailed Ptarmigan","White-tailed Tropicbird","White-throated Needletail","White-throated Robin","White-throated Sparrow","White-throated Swift","White-tipped Dove","White-winged Crossbill","White-winged Dove","White-winged Parakeet","White-winged Scoter","White-winged Tern","Whooper Swan","Whooping Crane","Wild Turkey","Willet","Williamson's Sapsucker","Willow Flycatcher","Willow Ptarmigan","Wilson's Phalarope","Wilson's Plover","Wilson's Storm-Petrel","Wilson's Warbler","Winter Wren","Wood Duck","Wood Sandpiper","Wood Stork","Wood Thrush","Wood Warbler","Worm-eating Warbler","Worthen's Sparrow","Wrentit","Xantus's Hummingbird","Xantus's Murrelet","Yellow Bittern","Yellow Grosbeak","Yellow Rail","Yellow Wagtail","Yellow Warbler","Yellow-bellied Flycatcher","Yellow-bellied Sapsucker","Yellow-billed Cuckoo","Yellow-billed Loon","Yellow-billed Magpie","Yellow-breasted Bunting","Yellow-breasted Chat","Yellow-crowned Night-Heron","Yellow-eyed Junco","Yellow-faced Grassquit","Yellow-footed Gull","Yellow-green Vireo","Yellow-headed Blackbird","Yellow-legged Gull","Yellow-nosed Albatross","Yellow-rumped Warbler","Yellow-throated Vireo","Yellow-throated Warbler","Yucatan Vireo","Zenaida Dove","Zone-tailed Hawk"],aie=["Abyssinian","American Bobtail","American Curl","American Shorthair","American Wirehair","Balinese","Bengal","Birman","Bombay","British Shorthair","Burmese","Chartreux","Chausie","Cornish Rex","Devon Rex","Donskoy","Egyptian Mau","
847Exotic Shorthair","Havana","Highlander","Himalayan","Japanese Bobtail","Korat","Kurilian Bobtail","LaPerm","Maine Coon","Manx","Minskin","Munchkin","Nebelung","Norwegian Forest Cat","Ocicat","Ojos Azules","Oriental","Persian","Peterbald","Pixiebob","Ragdoll","Russian Blue","Savannah","Scottish Fold","Selkirk Rex","Serengeti","Siamese","Siberian","Singapura","Snowshoe","Sokoke","Somali","Sphynx","Thai","Tonkinese","Toyger","Turkish Angora","Turkish Van"],iie=["Amazon River Dolphin","Arnoux's Beaked Whale","Atlantic Humpbacked Dolphin","Atlantic Spotted Dolphin","Atlantic White-Sided Dolphin","Australian Snubfin Dolphin","Australian humpback Dolphin","Blue Whale","Bottlenose Dolphin","Brydeâs whale","Burrunan Dolphin","Chilean Dolphin","Chinese River Dolphin","Chinese White Dolphin","Clymene Dolphin","Commersonâs Dolphin","Costero","Dusky Dolphin","False Killer Whale","Fin Whale","Fraserâs Dolphin","Ganges River Dolphin","Guiana Dolphin","Heavisideâs Dolphin","Hectorâs Dolphin","Hourglass Dolphin","Humpback whale","Indo-Pacific Bottlenose Dolphin","Indo-Pacific Hump-backed Dolphin","Irrawaddy Dolphin","Killer Whale (Orca)","La Plata Dolphin","Long-Beaked Common Dolphin","Long-finned Pilot Whale","Longman's Beaked Whale","Melon-headed Whale","Northern Rightwhale Dolphin","Omuraâs whale","Pacific White-Sided Dolphin","Pantropical Spotted Dolphin","Pealeâs Dolphin","Pygmy Killer Whale","Rissoâs Dolphin","Rough-Toothed Dolphin","Sei Whale","Short-Beaked Common Dolphin","Short-finned Pilot Whale","Southern Bottlenose Whale","Southern Rightwhale Dolphin","Sperm Whale","Spinner Dolphin","Striped Dolphin","Tucuxi","White-Beaked Dolphin"],oie=["Aberdeen Angus","Abergele","Abigar","Abondance","Abyssinian Shorthorned Zebu","Aceh","Achham","Adamawa","Adaptaur","Afar","Africangus","Afrikaner","Agerolese","Alambadi","Alatau","Albanian","Albera","Alderney","Alentejana","Aleutian wild cattle","Aliad Dinka","Alistana-Sanabresa","Allmogekor","Alur","American","American Angus","American Beef Friesian","American Brown Swiss","American Milking Devon","American White Park","Amerifax","Amrit Mahal","Amsterdam Island cattle","Anatolian Black","Andalusian Black","Andalusian Blond","Andalusian Grey","Angeln","Angoni","Ankina","Ankole","Ankole-Watusi","Aracena","Arado","Argentine Criollo","Argentine Friesian","Armorican","Arouquesa","Arsi","Asturian Mountain","Asturian Valley","Aubrac","Aulie-Ata","Aure et Saint-Girons","Australian Braford","Australian Brangus","Australian Charbray","Australian Friesian Sahiwal","Australian Lowline","Australian Milking Zebu","Australian Shorthorn","Austrian Simmental","Austrian Yellow","Avileña-Negra Ibérica","Avétonou","Aweil Dinka","Ayrshire","Azaouak","Azebuado","Azerbaijan Zebu","Azores","Bachaur cattle","Baherie cattle","Bakosi cattle","Balancer","Baoule","Bargur cattle","Barrosã","Barzona","Bazadaise","Beef Freisian","Beefalo","Beefmaker","Beefmaster","Begayt","Belgian Blue","Belgian Red","Belgian Red Pied","Belgian White-and-Red","Belmont Red","Belted Galloway","Bernese","Berrenda cattle","Betizu","Bianca Modenese","Blaarkop","Black Angus","Black Baldy","Black Hereford","Blanca Cacereña","Blanco Orejinegro BON","Blonde d'Aquitaine","Blue Albion","Blue Grey","Bohuskulla","Bonsmara","Boran","BoÅ¡karin","Braford","Brahman","Brahmousin","Brangus","Braunvieh","Brava","Breed","British Friesian","British White","Brown Carpathian","Brown Caucasian","Brown Swiss","Bue Lingo","Burlina","Bushuyev","Butana cattle","BuÅ¡a cattle","Cachena","Caldelana","Camargue","Campbell Island cattle","Canadian Speckle Park","Canadienne","Canaria","Canchim","Caracu","Carinthian Blondvieh","Carora","Charbray","Charolais","Chateaubriand","Chiangus","Chianina","Chillingham cattle","Chinese Black Pied","Cholistani","Coloursided White Back","Commercial","Corriente","Corsican cattle","Costeño con Cuernos","Crioulo Lageano","Cárdena Andaluza","Dajal","Dangi cattle","Danish Black-Pied","Danish Jersey","Danish Red","Deep Red cattle","Deoni","Devon","Dexter cattle","Dhanni","Doayo cattle","Doela","Drakensberger","Droughtmaster","Dulong'","Dutch Belted","Dutch Friesian","Dwarf Lulu","Dølafe","East Anatolian Red","Eastern Finncattle","Eastern Red Polled","Enderby Island cattle","English Longhorn","Ennstaler Bergscheck","Estonian Holstein","Estonian Native","Estonian Red cattle","Finncattle","Finnish Ayrshire","Finnish Holstein-Friesian","Fjäll","Fleckvieh","Florida Cracker cattle","Fogera","French Simmental","Fribourgeoise","Friesian Red and White","Fulani Sudanese","FÄng Cattle","Galician Blond","Galloway cattle","Gangatiri","Gaolao","Garvonesa","Gascon cattle","Gelbvieh","Georgian Mountain cattle","German Angus","German Black Pied Dairy","German Black Pied cattle","German Red Pied","Gir","Glan cattle","Gloucester","Gobra","Greek Shorthorn","Greek Steppe","Greyman cattle","Gudali","Guernsey cattle","Guzerá","Hallikar4","Hanwoo","Hariana cattle","Hartón del Valle","Harzer Rotvieh","Hays Converter","Heck cattle","Hereford","Herens","Highland cattle","Hinterwald","Holando-Argentino","Holstein Friesian cattle","Horro","Hungarian Grey","Huáng Cattle","Hybridmaster","Iberian cattle","Icelandic","Illawarra cattle","Improved Red and White","Indo-Brazilian","Irish Moiled","Israeli Holstein","Israeli Red","Istoben cattle","Istrian cattle","Jamaica Black","Jamaica Hope","Jamaica Red","Japanese Brown","Jarmelista","Javari cattle","Jersey cattle","Jutland cattle","Kabin Buri cattle","Kalmyk cattle","Kamphaeng Saen cattle","Kangayam","Kankrej","Karan Swiss","Kasaragod Dwarf cattle","Kathiawadi","Kazakh Whiteheaded","Kenana cattle","Kenkatha cattle","Kerry cattle","Kherigarh","Khillari cattle","Kholomogory","Korat Wagyu","Kostroma cattle","Krishna Valley cattle","Kurgan cattle","Kuri","La Reina cattle","Lakenvelder cattle","Lampurger","Latvian Blue","Latvian Brown","Latvian Danish Red","Lebedyn","Levantina","Limia cattle","Limousin","Limpurger","Lincoln Red","Lineback","Lithuanian Black-and-White","Lithuanian Light Grey","Lithuanian Red","Lithuanian White-Backed","Lohani cattle","Lourdais","Lucerna cattle","Luing","Madagascar Zebu","Madura","Maine-Anjou","Malnad Gidda","Malvi","Mandalong Special","Mantequera Leonesa","MaramureÅ Brown","Marchigiana","Maremmana","Marinhoa","Maronesa","Masai","Mashona","Menorquina","Mertolenga","Meuse-Rhine-Issel","Mewati","Milking Shorthorn","Minhota","Mirandesa","Mirkadim","MocÄniÅ£Ä","Mollie","Monchina","Mongolian","Montbéliarde","Morucha","Murboden","Murnau-Werdenfels","Murray Grey","Muturu","N'Dama","Nagori","Negra Andaluza","Nelore","Nguni","Nimari","Normande","North Bengal Grey","Northern Finncattle","Northern Shorthorn","Norweg
847ian Red","Ongole","Original Simmental","Pajuna","Palmera","Pantaneiro","Parda Alpina","Parthenaise","Pasiega","Pembroke","Philippine Native","Pie Rouge des Plaines","Piedmontese cattle","Pineywoods","Pinzgauer","Pirenaica","Podolac","Podolica","Polish Black-and-White","Polish Red","Poll Shorthorn","Polled Hereford","Polled Shorthorn","Ponwar","Preta","Pulikulam","Punganur","Pustertaler Sprinzen","Qinchaun","Queensland Miniature Boran","RX3","Ramo Grande","Randall","Raramuri Criollo","Rathi","Raya","Red Angus","Red Brangus","Red Chittagong","Red Fulani","Red Gorbatov","Red Holstein","Red Kandhari","Red Mingrelian","Red Poll","Red Polled Ãstland","Red Sindhi","Retinta","Riggit Galloway","RingamÃ¥la","Rohjan","Romagnola","Romanian BÄlÅ£ata","Romanian Steppe Gray","Romosinuano","Russian Black Pied","Rätisches Grauvieh","Sahiwal","Salers","Salorn","Sanga","Sanhe","Santa Cruz","Santa Gertrudis","Sayaguesa","Schwyz","Selembu","Senepol","Serbian Pied","Serbian Steppe","Sheko","Shetland","Shorthorn","Siboney de Cuba","Simbrah","Simford","Simmental","Siri","South Devon","Spanish Fighting Bull","Speckle Park","Square Meater","Sussex","Swedish Friesian","Swedish Polled","Swedish Red Pied","Swedish Red Polled","Swedish Red-and-White","Tabapuã","Tarentaise","Tasmanian Grey","Tauros","Telemark","Texas Longhorn","Texon","Thai Black","Thai Fighting Bull","Thai Friesian","Thai Milking Zebu","Tharparkar","Tswana","Tudanca","Tuli","Tulim","Turkish Grey Steppe","Tux-Zillertal","Tyrol Grey","Ukrainian Grey","Umblachery","Valdostana Castana","Valdostana Pezzata Nera","Valdostana Pezzata Rossa","Vaynol","Vechur8","Vestland Fjord","Vestland Red Polled","Vianesa","Volinian Beef","Vorderwald","Vosgienne","Väneko","Waguli","Wagyu","Wangus","Welsh Black","Western Finncattle","White Cáceres","White Fulani","White Lamphun","White Park","Whitebred Shorthorn","Xingjiang Brown","Yakutian","Yanbian","Yanhuang","Yurino","Zebu","Ãvolène cattle","Å»ubroÅ"],lie=["African Slender-snouted Crocodile","Alligator mississippiensis","American Crocodile","Australian Freshwater Crocodile","Black Caiman","Broad-snouted Caiman","Chinese Alligator","Cuban Crocodile","Cuvierâs Dwarf Caiman","Dwarf Crocodile","Gharial","Moreletâs Crocodile","Mugger Crocodile","New Guinea Freshwater Crocodile","Nile Crocodile","Orinoco Crocodile","Philippine Crocodile","Saltwater Crocodile","Schneiderâs Smooth-fronted Caiman","Siamese Crocodile","Spectacled Caiman","Tomistoma","West African Crocodile","Yacare Caiman"],cie=["Affenpinscher","Afghan Hound","Aidi","Airedale Terrier","Akbash","Akita","Alano Español","Alapaha Blue Blood Bulldog","Alaskan Husky","Alaskan Klee Kai","Alaskan Malamute","Alopekis","Alpine Dachsbracke","American Bulldog","American Bully","American Cocker Spaniel","American English Coonhound","American Foxhound","American Hairless Terrier","American Pit Bull Terrier","American Staffordshire Terrier","American Water Spaniel","Andalusian Hound","Anglo-Français de Petite Vénerie","Appenzeller Sennenhund","Ariegeois","Armant","Armenian Gampr dog","Artois Hound","Australian Cattle Dog","Australian Kelpie","Australian Shepherd","Australian Stumpy Tail Cattle Dog","Australian Terrier","Austrian Black and Tan Hound","Austrian Pinscher","Azawakh","Bakharwal dog","Banjara Hound","Barbado da Terceira","Barbet","Basenji","Basque Shepherd Dog","Basset Artésien Normand","Basset Bleu de Gascogne","Basset Fauve de Bretagne","Basset Hound","Bavarian Mountain Hound","Beagle","Beagle-Harrier","Bearded Collie","Beauceron","Bedlington Terrier","Belgian Shepherd","Bergamasco Shepherd","Berger Picard","Bernese Mountain Dog","Bhotia","Bichon Frisé","Billy","Black Mouth Cur","Black Norwegian Elkhound","Black Russian Terrier","Black and Tan Coonhound","Bloodhound","Blue Lacy","Blue Picardy Spaniel","Bluetick Coonhound","Boerboel","Bohemian Shepherd","Bolognese","Border Collie","Border Terrier","Borzoi","Bosnian Coarse-haired Hound","Boston Terrier","Bouvier des Ardennes","Bouvier des Flandres","Boxer","Boykin Spaniel","Bracco Italiano","Braque Francais","Braque Saint-Germain","Braque d'Auvergne","Braque de l'Ariège","Braque du Bourbonnais","Briard","Briquet Griffon Vendéen","Brittany","Broholmer","Bruno Jura Hound","Brussels Griffon","Bucovina Shepherd Dog","Bull Arab","Bull Terrier","Bulldog","Bullmastiff","Bully Kutta","Burgos Pointer","Cairn Terrier","Campeiro Bulldog","Can de Chira","Canaan Dog","Canadian Eskimo Dog","Cane Corso","Cane Paratore","Cane di Oropa","Cantabrian Water Dog","Cardigan Welsh Corgi","Carea Castellano Manchego","Carolina Dog","Carpathian Shepherd Dog","Catahoula Leopard Dog","Catalan Sheepdog","Caucasian Shepherd Dog","Cavalier King Charles Spaniel","Central Asian Shepherd Dog","Cesky Fousek","Cesky Terrier","Chesapeake Bay Retriever","Chien Français Blanc et Noir","Chien Français Blanc et Orange","Chien Français Tricolore","Chihuahua","Chilean Terrier","Chinese Chongqing Dog","Chinese Crested Dog","Chinook","Chippiparai","Chongqing dog","Chortai","Chow Chow","Cimarrón Uruguayo","Cirneco dell'Etna","Clumber Spaniel","Colombian fino hound","Coton de Tulear","Cretan Hound","Croatian Sheepdog","Curly-Coated Retriever","Cursinu","Czechoslovakian Wolfdog","Cão Fila de São Miguel","Cão da Serra de Aires","Cão de Castro Laboreiro","Cão de Gado Transmontano","Dachshund","Dalmatian","Dandie Dinmont Terrier","Danish-Swedish Farmdog","Denmark Feist","Dingo","Doberman Pinscher","Dogo Argentino","Dogo Guatemalteco","Dogo Sardesco","Dogue Brasileiro","Dogue de Bordeaux","Drentse Patrijshond","Drever","Dunker","Dutch Shepherd","Dutch Smoushond","East European Shepherd","East Siberian Laika","English Cocker Spaniel","English Foxhound","English Mastiff","English Setter","English Shepherd","English Springer Spaniel","English Toy Terrier","Entlebucher Mountain Dog","Estonian Hound","Estrela Mountain Dog","Eurasier","Field Spaniel","Fila Brasileiro","Finnish Hound","Finnish Lapphund","Finnish Spitz","Flat-Coated Retriever","French Bulldog","French Spaniel","Galgo Español","Galician Shepherd Dog","Garafian Shepherd","Gascon Saintongeois","Georgian Shepherd","German Hound","German Longhaired Pointer","German Pinscher","German Roughhaired Pointer","German Shepherd Dog","German Shorthaired Pointer","German Spaniel","German Spitz","German Wirehaired Pointer","Giant Schnauzer","Glen of Imaal Terrier","Golden Retriever","Gordon Setter","GoÅczy Polski","Grand Anglo-Français Blanc et Noir","Grand Anglo-Français Blanc et Orange","Grand Anglo-Français Tricolore","Grand Basset Griffon Vendéen","Grand Bleu de Gascogne","Grand Griffon Vendéen","Great Dane","Greater Swiss Mountain Dog","Greek Harehound","Greek Shepherd","Greenland Dog","Greyhound","Griffon Bleu de Gascogne","Griffon Fauve de Bretagne","Griffon Nivernais","Gull Dong","Gull Terrier","Hamiltonstövare","Hanover Hound","Harrier","Havanese","Hierran Wolfdog","Hokkaido","Hovawart","Huntaway","Hygen Hound","Hällefors Elkhound","Ibizan Hound","Icelandic Sheepdog","Indian Spitz","Indian pariah dog","Irish Red and White Setter","Irish Setter","Irish Terrier","Irish Water Spaniel","Irish Wolfhound","Istrian Coarse-haired Hound","Istrian Shorthaired Hound","Italian Greyhound","Jack Russell Terrier","Jagdterrier","Japanese Chin","Japanese Spitz","Japanese Terrier","Jindo","Jonangi","Kai Ken","Kaikadi","Kangal Shepherd Dog","Kanni","Karakachan dog","Karelian Bear Dog","Kars","Karst Shepherd","Keeshond","Kerry Beagle","Kerry Blue Terrier","King Charles Spaniel","King Shepherd","Kintamani","Kishu","Kokoni","Kombai","Komondor","Kooikerhondje","Koolie","Koyun dog","Kromfohrländer","Kuchi","Kuvasz","Labrador Retriever","Lagotto Romagnolo","Lakeland Terrier","Lancashire Heeler","Landseer","Lapponian Herder","Large Münsterländer","Leonberger","Levriero Sardo","Lhasa Apso","Lithuanian Hound","Lupo Italiano","Löwchen","Mackenzie River Husky","Magyar agár","Mahratta Greyhound","Maltese","Manchester Terrier","Maremmano-Abruzzese Sheepdog","McNab dog","Miniature American Shepherd","Miniature Bull Terrier","Miniature Fox Terrier","Miniature Pinscher","Miniature Schnauzer","Molossus of Epirus","Montenegrin Mountain Hound","Mountain Cur","Mountain Feist","Mucuchies","Mudhol Hound","Mudi","Neapolitan Mastiff","New Guinea Singing Dog","New Zealand Heading Dog","Newfoundland","Norfolk Terrier","Norrbottenspets","Northern Inuit Dog","Norweg
847ian Buhund","Norwegian Elkhound","Norwegian Lundehund","Norwich Terrier","Nova Scotia Duck Tolling Retriever","Old Croatian Sighthound","Old Danish Pointer","Old English Sheepdog","Old English Terrier","Olde English Bulldogge","Otterhound","Pachon Navarro","Paisley Terrier","Pampas Deerhound","Papillon","Parson Russell Terrier","Pastore della Lessinia e del Lagorai","Patagonian Sheepdog","Patterdale Terrier","Pekingese","Pembroke Welsh Corgi","Perro Majorero","Perro de Pastor Mallorquin","Perro de Presa Canario","Perro de Presa Mallorquin","Peruvian Inca Orchid","Petit Basset Griffon Vendéen","Petit Bleu de Gascogne","Phalène","Pharaoh Hound","Phu Quoc Ridgeback","Picardy Spaniel","Plott Hound","Plummer Terrier","Podenco Canario","Podenco Valenciano","Pointer","Poitevin","Polish Greyhound","Polish Hound","Polish Lowland Sheepdog","Polish Tatra Sheepdog","Pomeranian","Pont-Audemer Spaniel","Poodle","Porcelaine","Portuguese Podengo","Portuguese Pointer","Portuguese Water Dog","Posavac Hound","Pražský KrysaÅÃk","Pshdar Dog","Pudelpointer","Pug","Puli","Pumi","Pungsan Dog","Pyrenean Mastiff","Pyrenean Mountain Dog","Pyrenean Sheepdog","Rafeiro do Alentejo","Rajapalayam","Rampur Greyhound","Rat Terrier","Ratonero Bodeguero Andaluz","Ratonero Mallorquin","Ratonero Murciano de Huerta","Ratonero Valenciano","Redbone Coonhound","Rhodesian Ridgeback","Romanian Mioritic Shepherd Dog","Romanian Raven Shepherd Dog","Rottweiler","Rough Collie","Russian Spaniel","Russian Toy","Russo-European Laika","Saarloos Wolfdog","Sabueso Español","Saint Bernard","Saint Hubert Jura Hound","Saint-Usuge Spaniel","Saluki","Samoyed","Sapsali","Sarabi dog","Sardinian Shepherd Dog","Schapendoes","Schillerstövare","Schipperke","Schweizer Laufhund","Schweizerischer Niederlaufhund","Scottish Deerhound","Scottish Terrier","Sealyham Terrier","Segugio Italiano","Segugio Maremmano","Segugio dell'Appennino","Seppala Siberian Sleddog","Serbian Hound","Serbian Tricolour Hound","Serrano Bulldog","Shar Pei","Shetland Sheepdog","Shiba Inu","Shih Tzu","Shikoku","Shiloh Shepherd","Siberian Husky","Silken Windhound","Silky Terrier","Sinhala Hound","Skye Terrier","Sloughi","Slovakian Wirehaired Pointer","Slovenský Cuvac","Slovenský Kopov","Smalandstövare","Small Greek domestic dog","Small Münsterländer","Smooth Collie","Smooth Fox Terrier","Soft-Coated Wheaten Terrier","South Russian Ovcharka","Spanish Mastiff","Spanish Water Dog","Spinone Italiano","Sporting Lucas Terrier","Stabyhoun","Staffordshire Bull Terrier","Standard Schnauzer","Stephens Stock","Styrian Coarse-haired Hound","Sussex Spaniel","Swedish Elkhound","Swedish Lapphund","Swedish Vallhund","Swedish White Elkhound","Taigan","Taiwan Dog","Tamaskan Dog","Teddy Roosevelt Terrier","Telomian","Tenterfield Terrier","Terrier Brasileiro","Thai Bangkaew Dog","Thai Ridgeback","Tibetan Mastiff","Tibetan Spaniel","Tibetan Terrier","Tornjak","Tosa","Toy Fox Terrier","Toy Manchester Terrier","Transylvanian Hound","Treeing Cur","Treeing Feist","Treeing Tennessee Brindle","Treeing Walker Coonhound","Trigg Hound","Tyrolean Hound","Vikhan","Villano de Las Encartaciones","Villanuco de Las Encartaciones","Vizsla","Volpino Italiano","Weimaraner","Welsh Sheepdog","Welsh Springer Spaniel","Welsh Terrier","West Highland White Terrier","West Siberian Laika","Westphalian Dachsbracke","Wetterhoun","Whippet","White Shepherd","White Swiss Shepherd Dog","Wire Fox Terrier","Wirehaired Pointing Griffon","Wirehaired Vizsla","Xiasi Dog","Xoloitzcuintli","Yakutian Laika","Yorkshire Terrier","Å arplaninac"],uie=["Alaska pollock","Albacore","Amur catfish","Araucanian herring","Argentine hake","Asari","Asian swamp eel","Atlantic cod","Atlantic herring","Atlantic horse mackerel","Atlantic mackerel","Atlantic menhaden","Atlantic salmon","Bigeye scad","Bigeye tuna","Bighead carp","Black carp","Blood cockle","Blue swimming crab","Blue whiting","Bombay-duck","Bonga shad","California pilchard","Cape horse mackerel","Capelin","Catla","Channel catfish","Chilean jack mackerel","Chinese perch","Chinese softshell turtle","Chub mackerel","Chum salmon","Common carp","Crucian carp","Daggertooth pike conger","European anchovy","European pilchard","European sprat","Filipino Venus","Gazami crab","Goldstripe sardinella","Grass carp","Gulf menhaden","Haddock","Hilsa shad","Indian mackerel","Indian oil sardine","Iridescent shark","Japanese anchovy","Japanese cockle","Japanese common catfish","Japanese flying squid","Japanese jack mackerel","Japanese littleneck","Japanese pilchard","Jumbo flying squid","Kawakawa","Korean bullhead","Largehead hairtail","Longtail tuna","Madeiran sardinella","Mandarin fish","Milkfish","Mrigal carp","Narrow-barred Spanish mackerel","Nile perch","Nile tilapia","North Pacific hake","Northern snakehead","Pacific anchoveta","Pacific cod","Pacific herring","Pacific sand lance","Pacific sandlance","Pacific saury","Pacific thread herring","Peruvian anchoveta","Pink salmon","Pollock","Pond loach","Rainbow trout","Rohu","Round sardinella","Short mackerel","Silver carp","Silver cyprinid","Skipjack tuna","Southern African anchovy","Southern rough shrimp","Whiteleg shrimp","Wuchang bream","Yellow croaker","Yellowfin tuna","Yellowhead catfish","Yellowstripe scad"],die=["Abaco Barb","Abtenauer","Abyssinian","Aegidienberger","Akhal-Teke","Albanian Horse","Altai Horse","Altèr Real","American Albino","American Cream Draft","American Indian Horse","American Paint Horse","American Quarter Horse","American Saddlebred","American Warmblood","Andalusian Horse","Andravida Horse","Anglo-Arabian","Anglo-Arabo-Sardo","Anglo-Kabarda","Appaloosa","AraApp
847aloosa","Arabian Horse","Ardennes Horse","Arenberg-Nordkirchen","Argentine Criollo","Asian wild Horse","Assateague Horse","Asturcón","Augeron","Australian Brumby","Australian Draught Horse","Australian Stock Horse","Austrian Warmblood","Auvergne Horse","Auxois","Azerbaijan Horse","Azteca Horse","Baise Horse","Bale","Balearic Horse","Balikun Horse","Baluchi Horse","Banker Horse","Barb Horse","Bardigiano","Bashkir Curly","Basque Mountain Horse","Bavarian Warmblood","Belgian Half-blood","Belgian Horse","Belgian Warmblood","Bhutia Horse","Black Forest Horse","Blazer Horse","Boerperd","Borana","Boulonnais Horse","Brabant","Brandenburger","Brazilian Sport Horse","Breton Horse","Brumby","Budyonny Horse","Burguete Horse","Burmese Horse","Byelorussian Harness Horse","Calabrese Horse","Camargue Horse","Camarillo White Horse","Campeiro","Campolina","Canadian Horse","Canadian Pacer","Carolina Marsh Tacky","Carthusian Horse","Caspian Horse","Castilian Horse","Castillonnais","Catria Horse","Cavallo Romano della Maremma Laziale","Cerbat Mustang","Chickasaw Horse","Chilean Corralero","Choctaw Horse","Cleveland Bay","Clydesdale Horse","Cob","Coldblood Trotter","Colonial Spanish Horse","Colorado Ranger","Comtois Horse","Corsican Horse","Costa Rican Saddle Horse","Cretan Horse","Criollo Horse","Croatian Coldblood","Cuban Criollo","Cumberland Island Horse","Curly Horse","Czech Warmblood","Daliboz","Danish Warmblood","Danube Delta Horse","Dole Gudbrandsdal","Don","Dongola Horse","Draft Trotter","Dutch Harness Horse","Dutch Heavy Draft","Dutch Warmblood","Dzungarian Horse","East Bulgarian","East Friesian Horse","Estonian Draft","Estonian Horse","Falabella","Faroese","Finnhorse","Fjord Horse","Fleuve","Florida Cracker Horse","Foutanké","Frederiksborg Horse","Freiberger","French Trotter","Friesian Cross","Friesian Horse","Friesian Sporthorse","Furioso-North Star","Galiceño","Galician Pony","Gelderland Horse","Georgian Grande Horse","German Warmblood","Giara Horse","Gidran","Groningen Horse","Gypsy Horse","Hackney Horse","Haflinger","Hanoverian Horse","Heck Horse","Heihe Horse","Henson Horse","Hequ Horse","Hirzai","Hispano-Bretón","Holsteiner Horse","Horro","Hungarian Warmblood","Icelandic Horse","Iomud","Irish Draught","Irish Sport Horse sometimes called Irish Hunter","Italian Heavy Draft","Italian Trotter","Jaca Navarra","Jeju Horse","Jutland Horse","Kabarda Horse","Kafa","Kaimanawa Horses","Kalmyk Horse","Karabair","Karabakh Horse","Karachai Horse","Karossier","Kathiawari","Kazakh Horse","Kentucky Mountain Saddle Horse","Kiger Mustang","Kinsky Horse","Kisber Felver","Kiso Horse","Kladruber","Knabstrupper","Konik","Kundudo","Kustanair","Kyrgyz Horse","Latvian Horse","Lipizzan","Lithuanian Heavy Draught","Lokai","Losino Horse","Lusitano","Lyngshest","M'Bayar","M'Par","MallorquÃn","Malopolski","Mangalarga","Mangalarga Marchador","Maremmano","Marismeño Horse","Marsh Tacky","Marwari Horse","Mecklenburger","MenorquÃn","Messara Horse","Metis Trotter","MezÅhegyesi Sport Horse","MeÄimurje Horse","Miniature Horse","Misaki Horse","Missouri Fox Trotter","Monchina","Mongolian Horse","Mongolian Wild Horse","Monterufolino","Morab","Morgan Horse","Mountain Pleasure Horse","Moyle Horse","Murakoz Horse","Murgese","Mustang Horse","Mérens Horse","Namib Desert Horse","Nangchen Horse","National Show Horse","Nez Perce Horse","Nivernais Horse","Nokota Horse","Noma","Nonius Horse","Nooitgedachter","Nordlandshest","Noriker Horse","Norman Cob","North American Single-Footer Horse","North Swedish Horse","Norweg
847ian Coldblood Trotter","Norwegian Fjord","Novokirghiz","Oberlander Horse","Ogaden","Oldenburg Horse","Orlov trotter","Ostfriesen","Paint","Pampa Horse","Paso Fino","Pentro Horse","Percheron","Persano Horse","Peruvian Paso","Pintabian","Pleven Horse","Poitevin Horse","Posavac Horse","Pottok","Pryor Mountain Mustang","Przewalski's Horse","Pura Raza Española","Purosangue Orientale","Qatgani","Quarab","Quarter Horse","Racking Horse","Retuerta Horse","Rhenish German Coldblood","Rhinelander Horse","Riwoche Horse","Rocky Mountain Horse","Romanian Sporthorse","Rottaler","Russian Don","Russian Heavy Draft","Russian Trotter","Saddlebred","Salerno Horse","Samolaco Horse","San Fratello Horse","Sarcidano Horse","Sardinian Anglo-Arab","Schleswig Coldblood","Schwarzwälder Kaltblut","Selale","Sella Italiano","Selle Français","Shagya Arabian","Shan Horse","Shire Horse","Siciliano Indigeno","Silesian Horse","Sokolsky Horse","Sorraia","South German Coldblood","Soviet Heavy Draft","Spanish Anglo-Arab","Spanish Barb","Spanish Jennet Horse","Spanish Mustang","Spanish Tarpan","Spanish-Norman Horse","Spiti Horse","Spotted Saddle Horse","Standardbred Horse","Suffolk Punch","Swedish Ardennes","Swedish Warmblood","Swedish coldblood trotter","Swiss Warmblood","TaishÅ« Horse","Takhi","Tawleed","Tchernomor","Tennessee Walking Horse","Tersk Horse","Thoroughbred","Tiger Horse","Tinker Horse","Tolfetano","Tori Horse","Trait Du Nord","Trakehner","Tsushima","Tuigpaard","Ukrainian Riding Horse","Unmol Horse","Uzunyayla","Ventasso Horse","Virginia Highlander","Vlaamperd","Vladimir Heavy Draft","Vyatka","Waler","Waler Horse","Walkaloosa","Warlander","Warmblood","Welsh Cob","Westphalian Horse","Wielkopolski","Württemberger","Xilingol Horse","Yakutian Horse","Yili Horse","Yonaguni Horse","Zaniskari","Zhemaichu","Zweibrücker","Žemaitukas"],hie=["Acacia-ants","Acorn-plum gall","Aerial yellowjacket","Africanized honey bee","Allegheny mound ant","Almond stone wasp","Ant","Arboreal ant","Argentine ant","Asian paper wasp","Baldfaced hornet","Bee","Bigheaded ant","Black and yellow mud dauber","Black carpenter ant","Black imported fire ant","Blue horntail woodwasp","Blue orchard bee","Braconid wasp","Bumble bee","Carpenter ant","Carpenter wasp","Chalcid wasp","Cicada killer","Citrus blackfly parasitoid","Common paper wasp","Crazy ant","Cuckoo wasp","Cynipid gall wasp","Eastern Carpenter bee","Eastern yellowjacket","Elm sawfly","Encyrtid wasp","Erythrina gall wasp","Eulophid wasp","European hornet","European imported fire ant","False honey ant","Fire ant","Forest bachac","Forest yellowjacket","German yellowjacket","Ghost ant","Giant ichneumon wasp","Giant resin bee","Giant wood wasp","Golden northern bumble bee","Golden paper wasp","Gouty oak gall","Grass Carrying Wasp","Great black wasp","Great golden digger wasp","Hackberry nipple gall parasitoid","Honey bee","Horned oak gall","Horse guard wasp","Hunting wasp","Ichneumonid wasp","Keyhole wasp","Knopper gall","Large garden bumble bee","Large oak-apple gall","Leafcutting bee","Little fire ant","Little yellow ant","Long-horned bees","Long-legged ant","Macao paper wasp","Mallow bee","Marble gall","Mossyrose gall wasp","Mud-daubers","Multiflora rose seed chalcid","Oak apple gall wasp","Oak rough bulletgall wasp","Oak saucer gall","Oak shoot sawfly","Odorous house ant","Orange-tailed bumble bee","Orangetailed potter wasp","Oriental chestnut gall wasp","Paper wasp","Pavement ant","Pigeon tremex","Pip gall wasp","Prairie yellowjacket","Pteromalid wasp","Pyramid ant","Raspberry Horntail","Red ant","Red carpenter ant","Red harvester ant","Red imported fire ant","Red wasp","Red wood ant","Red-tailed wasp","Reddish carpenter ant","Rough harvester ant","Sawfly parasitic wasp","Scale parasitoid","Silky ant","Sirex woodwasp","Siricid woodwasp","Smaller yellow ant","Southeastern blueberry bee","Southern fire ant","Southern yellowjacket","Sphecid wasp","Stony gall","Sweat bee","Texas leafcutting ant","Tiphiid wasp","Torymid wasp","Tramp ant","Valentine ant","Velvet ant","Vespid wasp","Weevil parasitoid","Western harvester ant","Western paper wasp","Western thatching ant","Western yellowjacket","White-horned horntail","Willow shoot sawfly","Woodwasp","Wool sower gall maker","Yellow Crazy Ant","Yellow and black potter wasp","Yellow-horned horntail"],mie=["Asiatic Lion","Barbary Lion","Cape lion","Masai Lion","Northeast Congo Lion","Transvaal lion","West African Lion"],fie=["Ace","Archie","Bailey","Bandit","Bella","Bentley","Bruno","Buddy","Charlie","Coco","Cookie","Cooper","Daisy","Dixie","Finn","Ginger","Gracie","Gus","Hank","Jack","Jax","Joey","Kobe","Leo","Lola","Louie","Lucy","Maggie","Max","Mia","Milo","Molly","Murphey","Nala","Nova","Ollie","Oreo","Rosie","Scout","Stella","Teddy","Tuffy"],pie=["American","American Chinchilla","American Fuzzy Lop","American Sable","Argente Brun","Belgian Hare","Beveren","Blanc de Hotot","Britannia Petite","Californian","Champagne DâArgent","Checkered Giant","Cinnamon","Crème DâArgent","Dutch","Dwarf Hotot","English Angora","English Lop","English Spot","Flemish Giant","Florida White","French Angora","French Lop","Giant Angora","Giant Chinchilla","Harlequin","Havana","Himalayan","Holland Lop","Jersey Wooly","Lilac","Lionhead","Mini Lop","Mini Rex","Mini Satin","Netherland Dwarf","New Zealand","Palomino","Polish","Rex","Rhinelander","Satin","Satin Angora","Silver","Silver Fox","Silver Marten","Standard Chinchilla","Tan","Thrianta"],gie=["Abrocoma","Abrocoma schistacea","Aconaemys","Aconaemys porteri","African brush-tailed porcupine","Andean mountain cavy","Argentine tuco-tuco","Ashy chinchilla rat","Asiatic brush-tailed porcupine","Atherurus","Azara's agouti","Azara's tu
847co-tuco","Bahia porcupine","Bathyergus","Bathyergus janetta","Bathyergus suillus","Bennett's chinchilla rat","Bicolored-spined porcupine","Black agouti","Black dwarf porcupine","Black-rumped agouti","Black-tailed hairy dwarf porcupine","Bolivian chinchilla rat","Bolivian tuco-tuco","Bonetto's tuco-tuco","Brandt's yellow-toothed cavy","Brazilian guinea pig","Brazilian porcupine","Brazilian tuco-tuco","Bridge's degu","Brown hairy dwarf porcupine","Budin's chinchilla rat, A. budini","Cape porcupine","Catamarca tuco-tuco","Cavia","Central American agouti","Chacoan tuco-tuco","Chilean rock rat","Chinchilla","Coendou","Coiban agouti","Colburn's tuco-tuco","Collared tuco-tuco","Common degu","Common yellow-toothed cavy","Conover's tuco-tuco","Coruro","Crested agouti","Crested porcupine","Cryptomys","Cryptomys bocagei","Cryptomys damarensis","Cryptomys foxi","Cryptomys hottentotus","Cryptomys mechowi","Cryptomys ochraceocinereus","Cryptomys zechi","Ctenomys","Cuniculus","Cuscomys","Cuscomys ashanika","Dactylomys","Dactylomys boliviensis","Dactylomys dactylinus","Dactylomys peruanus","Dasyprocta","Domestic guinea pig","Emily's tuco-tuco","Erethizon","Famatina chinchilla rat","Frosted hairy dwarf porcupine","Fukomys","Fukomys amatus","Fukomys anselli","Fukomys bocagei","Fukomys damarensis","Fukomys darlingi","Fukomys foxi","Fukomys ilariae","Fukomys kafuensis","Fukomys mechowii","Fukomys micklemi","Fukomys occlusus","Fukomys ochraceocinereus","Fukomys whytei","Fukomys zechi","Furtive tuco-tuco","Galea","Georychus","Georychus capensis","Golden viscacha-rat","Goya tuco-tuco","Greater guinea pig","Green acouchi","Haig's tuco-tuco","Heliophobius","Heliophobius argenteocinereus","Heterocephalus","Heterocephalus glaber","Highland tuco-tuco","Hystrix","Indian porcupine","Isla Mocha degu","Kalinowski agouti","Kannabateomys","Kannabateomys amblyonyx","Lagidium","Lagostomus","Lewis' tuco-tuco","Long-tailed chinchilla","Long-tailed porcupine","Los Chalchaleros' viscacha-rat","Lowland paca","Magellanic tuco-tuco","Malayan porcupine","Maule tuco-tuco","Mendoza tuco-tuco","Mexican agouti","Mexican hairy dwarf porcupine","Microcavia","Montane guinea pig","Moon-toothed degu","Mottled tuco-tuco","Mountain degu","Mountain paca","Mountain viscacha-rat","Myoprocta","Natterer's tuco-tuco","North American porcupine","Northern viscacha","Octodon","Octodontomys","Octomys","Olallamys","Olallamys albicauda","Olallamys edax","Orinoco agouti","Paraguaian hairy dwarf porcupine","Pearson's tuco-tuco","Peruvian tuco-tuco","Philippine porcupine","Pipanacoctomys","Plains viscacha","Plains viscacha-rat","Porteous' tuco-tuco","Punta de Vacas chinchilla rat","Red acouchi","Red-rumped agouti","Reddish tuco-tuco","Rio Negro tuco-tuco","Robust tuco-tuco","Roosmalen's dwarf porcupine","Rothschild's porcupine","Ruatan Island agouti","Sage's rock rat","Salinoctomys","Salta tuco-tuco","San Luis tuco-tuco","Santa Catarina's guinea pig","Shiny guinea pig","Shipton's mountain cavy","Short-tailed chinchilla","Silky tuco-tuco","Social tuco-tuco","Southern mountain cavy","Southern tuco-tuco","Southern viscacha","Spalacopus","Spix's yellow-toothed cavy","Steinbach's tuco-tuco","Streaked dwarf porcupine","Strong tuco-tuco","Stump-tailed porcupine","Sumatran porcupine","Sunda porcupine","Talas tuco-tuco","Tawny tuco-tuco","Thick-spined porcupine","Tiny tuco-tuco","Trichys","Tucuman tuco-tuco","Tympanoctomys","Uspallata chinchilla rat","White-toothed tuco-tuco","Wolffsohn's viscacha"],xie=["Abaco Island boa","Aesculapian snake","African beaked snake","African puff adder","African rock python","African twig snake","African wolf snake","Amazon tree boa","Amazonian palm viper","American Vine Snake","American copperhead","Amethystine python","Anaconda","Andaman cat snake","Andaman cobra","Angolan python","Annulated sea snake","Arabian cobra","Arafura file snake","Arizona black rattlesnake","Arizona coral snake","Aruba rattlesnake","Asian Vine Snake, Whip Snake","Asian cobra","Asian keelback","Asian pipe snake","Asp","Asp viper","Assam keelback","Australian copperhead","Australian scrub python","Baird's rat snake","Baja California lyresnake","Ball Python","Ball python","Bamboo pitviper","Bamboo viper","Banded Flying Snake","Banded cat-eyed snake","Banded krait","Banded pitviper","Banded water cobra","Barbour's pit viper","Barred wolf snake","Beaked sea snake","Beauty rat snake","Beddome's cat snake","Beddome's coral snake","Bimini racer","Bird snake","Bismarck ringed python","Black headed python","Black krait","Black mamba","Black rat snake","Black snake","Black tree cobra","Black-banded trinket snake","Black-headed snake","Black-necked cobra","Black-necked spitting cobra","Black-speckled palm-pitviper","Black-striped keelback","Black-tailed horned pit viper","Blanding's tree snake","Blind snake","Blonde hognose snake","Blood python","Blue
847krait","Blunt-headed tree snake","Bluntnose viper","Boa","Boa constrictor","Bocourt's water snake","Boelen python","Boiga","Bolivian anaconda","Boomslang","Bornean pitviper","Borneo short-tailed python","Brahminy blind snake","Brazilian coral snake","Brazilian mud Viper","Brazilian smooth snake","Bredl's python","Brongersma's pitviper","Brown snake","Brown spotted pitviper[4]","Brown tree snake","Brown water python","Brown white-lipped python","Buff striped keelback","Bull snake","Burmese keelback","Burmese krait","Burmese python","Burrowing cobra","Burrowing viper","Bush viper","Bushmaster","Buttermilk racer","Calabar python","California kingsnake","Canebrake","Cantil","Cantor's pitviper","Cape cobra","Cape coral snake","Cape gopher snake","Carpet viper","Cascabel","Caspian cobra","Cat snake","Cat-eyed night snake","Cat-eyed snake","Central American lyre snake","Central ranges taipan","Centralian carpet python","Ceylon krait","Chappell Island tiger snake","Checkered garter snake","Checkered keelback","Chicken snake","Chihuahuan ridge-nosed rattlesnake","Children's python","Chinese tree viper","Coachwhip snake","Coastal carpet python","Coastal taipan","Cobra","Collett's snake","Colorado desert sidewinder","Common adder","Common cobra","Common garter snake","Common ground snake","Common keelback","Common lancehead","Common tiger snake","Common worm snake","Congo snake","Congo water cobra","Copperhead","Coral snake","Corn snake","Coronado Island rattlesnake","Cottonmouth","Crossed viper","Crowned snake","Cuban boa","Cuban wood snake","Cyclades blunt-nosed viper","Dauan Island water python","De Schauensee's anaconda","Death Adder","Desert death adder","Desert kingsnake","Desert woma python","Diamond python","Dog-toothed cat snake","Down's tiger snake","Dubois's sea snake","Dumeril's boa","Durango rock rattlesnake","Dusky pigmy rattlesnake","Dusty hognose snake","Dwarf beaked snake","Dwarf boa","Dwarf pipe snake","Dwarf sand adder","Eastern brown snake","Eastern coral snake","Eastern diamondback rattlesnake","Eastern green mamba","Eastern hognose snake","Eastern lyre snake","Eastern mud snake","Eastern racer","Eastern tiger snake","Eastern water cobra","Eastern yellowbelly sad racer","Egg-eater","Egyptian asp","Egyptian cobra","Elegant pitviper","Emerald tree boa","Equatorial spitting cobra","European asp","European smooth snake","Eyelash palm-pitviper","Eyelash pit viper","Eyelash viper","False cobra","False horned viper","False water cobra","Fan-Si-Pan horned pitviper","Fea's viper","Fer-de-lance","Fierce snake","Fifty pacer","Fishing snake","Flat-nosed pitviper","Flinders python","Flying snake","Forest cobra","Forest flame snake","Forsten's cat snake","Fox snake, three species of Pantherophis","Gaboon viper","Garter snake","Giant Malagasy hognose snake","Godman's pit viper","Gold tree cobra","Gold-ringed cat snake","Golden tree snake","Grand Canyon rattlesnake","Grass snake","Gray cat snake","Great Basin rattlesnake","Great Lakes bush viper","Great Plains rat snake","Green anaconda","Green cat-eyed snake","Green mamba","Green palm viper","Green rat snake","Green snake","Green tree pit viper","Green tree python","Grey Lora","Grey-banded kingsnake","Ground snake","Guatemalan palm viper","Guatemalan tree viper","Habu","Habu pit viper","Hagen's pitviper","Hairy bush viper","Halmahera python","Hardwicke's sea snake","Harlequin coral snake","High Woods coral snake","Hill keelback","Himalayan keelback","Hogg Island boa","Hognose snake","Hognosed viper","Honduran palm viper","Hook Nosed Sea Snake","Hopi rattlesnake","Horned adder","Horned desert viper","Horned viper","Horseshoe pitviper","Hundred pacer","Hutton's tree viper","Ikaheka snake","Indian cobra","Indian flying snake","Indian krait","Indian python","Indian tree viper","Indigo snake","Indochinese spitting cobra","Indonesian water python","Inland carpet python","Inland taipan","Jamaican Tree Snake","Jamaican boa","Jan's hognose snake","Japanese forest rat snake","Japanese rat snake","Japanese striped snake","Javan spitting cobra","Jerdon's pitviper","Jumping viper","Jungle carpet python","Kanburian pit viper","Kaulback's lance-headed pitviper","Kayaudi dwarf reticulated python","Kaznakov's viper","Keelback","Kham Plateau pitviper","Khasi Hills keelback","King Island tiger snake","King brown","King cobra","King rat snake","King snake","Krait","Krefft's tiger snake","Lance-headed rattlesnake","Lancehead","Large shield snake","Large-eyed pitviper","Large-scaled tree viper","Leaf viper","Leaf-nosed viper","Lesser black krait","Levant viper","Long-nosed adder","Long-nosed tree snake","Long-nosed viper","Long-nosed whip snake","Long-tailed rattlesnake","Longnosed worm snake","Lora","Lyre snake","Machete savane","Macklot's python","Madagascar ground boa","Madagascar tree boa","Malabar rock pitviper","Malayan krait","Malayan long-glanded coral snake","Malayan pit viper","Malcolm's tree viper","Mamba","Mamushi","Manchurian Black Water Snake","Mandalay cobra","Mandarin rat snake","Mangrove pit viper","Mangrove snake","Mangshan pitviper","Many-banded krait","Many-banded tree snake","Many-horned adder","Many-spotted cat snake","Massasauga rattlesnake","McMahon's viper","Mexican black kingsnake","Mexican green rattlesnake","Mexican hognose snake","Mexican palm-pitviper","Mexican parrot snake","Mexican racer","Mexican vine snake","Mexican west coast rattlesnake","Midget faded rattlesnake","Milk snake","Moccasin snake","Modest keelback","Mojave desert sidewinder","Mojave rattlesnake","Mole viper","Mollucan python","Moluccan flying snake","Montpellier snake","Motuo bamboo pitviper","Mountain adder","Mozambique spitting cobra","Mud adder","Mud snake","Mussurana","Namaqua dwarf adder","Namib dwarf sand adder","Narrowhead Garter Snake","New Guinea carpet python","Nichell snake","Nicobar Island keelback","Nicobar bamboo pitviper","Night snake","Nightingale adder","Nilgiri keelback","Nitsche's bush viper","Nitsche's tree viper","North Philippine cobra","North eastern king snake","Northeastern hill krait","Northern black-tailed rattlesnake","Northern tree snake","Northern water snake","Northern white-lipped python","Northwestern carpet python","Nose-horned viper","Nubian spitting cobra","Oaxacan small-headed rattlesnake","Oenpelli python","Olive python","Olive sea snake","Orange-collared keelback","Ornate flying snake","Palestine viper","Pallas' viper","Palm viper","Papuan python","Paradise flying snake","Parrot snake","Patchnose snake","Paupan taipan","Pelagic sea snake","Peninsula tiger snake","Peringuey's adder","Perrotet's shieldtail snake","Persian rat snake","Philippine cobra","Philippine pitviper","Pine snake","Pipe snake","Pit viper","Pointed-scaled pit viper[5]","Pope's tree viper","Portuguese viper","Prairie kingsnake","Puerto Rican boa","Puff adder","Pygmy python","Python","Queen snake","Racer","Raddysnake","Rainbow boa","Rat snake","Rattler","Rattlesnake","Red blood python","Red diamond rattlesnake","Red spitting cobra","Red-backed rat snake","Red-bellied black snake","Red-headed krait","Red-necked keelback","Red-tailed bamboo pitviper","Red-tailed boa","Red-tailed pipe snake","Reticulated python","Rhinoceros viper","Rhombic night adder","Ribbon snake","Rinkhals","Rinkhals cobra","River jack","Rosy boa","Rough green snake","Rough-scaled bush viper","Rough-scaled python","Rough-scaled tree viper","Royal python","Rubber boa","Rufous beaked snake","Rungwe tree viper","San Francisco garter snake","Sand adder","Sand boa","Savu python","Saw-scaled viper","Scarlet kingsnake","Schlegel's viper","Schultze's pitviper","Sea snake","Sedge viper","Selayer reticulated python","Sharp-nosed viper","Shield-nosed cobra","Shield-tailed snake","Siamese palm viper","Side-striped palm-pitviper","Sidewinder","Sikkim keelback","Sinai desert cobra","Sind krait","Small-eyed snake","Smooth green snake","Smooth snake","Snorkel viper","Snouted cobra","Sonoran sidewinder","South American hognose snake","South eastern corn snake","Southern Indonesian spitting cobra","Southern Pacific rattlesnake","Southern Philippine cobra","Southern black racer","Southern white-lipped python","Southwestern black spitting cobra","Southwestern blackhead snake","Southwestern carpet python","Southwestern speckled rattlesnake","Speckle-bellied keelback","Speckled kingsnake","Spectacled cobra","Spiny bush viper","Spitting cobra","Spotted python","Sri Lankan pit viper","Stejneger's bamboo pitviper","Stiletto snake","Stimson's python","Stoke's sea snake","Storm water cobra","Striped snake","Sumatran short-tailed python","Sumatran tree viper","Sunbeam snake","Taipan","Taiwan cobra","Tan racer","Tancitaran dusky rattlesnake","Tanimbar python","Tasmanian tiger snake","Tawny cat snake","Temple pit viper","Temple viper","Tentacled snake","Texas Coral Snake","Texas blind snake","Texas garter snake","Texas lyre snake","Texas night snake","Thai cobra","Three-lined ground snake","Tibetan bamboo pitviper","Tic polonga","Tiger pit viper","Tiger rattlesnake","Tiger snake","Tigre snake","Timber rattlesnake","Timor python","Titanboa","Tree boa","Tree snake","Tree viper","Trinket snake","Tropical rattlesnake","Twig snake","Twin Headed King Snake","Twin-Barred tree snake","Twin-spotted rat snake","Twin-spotted rattlesnake","Undulated pit viper","Uracoan rattlesnake","Ursini's viper","Urutu","Vine snake","Viper","Viper Adder","Vipera ammodytes","Wagler's pit viper","Wart snake","Water adder","Water moccasin","Water snake","West Indian racer","Western blind snake","Western carpet python","Western coral snake","Western diamondback rattlesnake","Western green mamba","Western ground snake","Western hog-nosed viper","Western mud snake","Western tiger snake","Western woma python","Wetar Island python","Whip snake","White-lipped keelback","White-lipped python","White-lipped tree viper","Wirot's pit viper","Wolf snake","Woma python","Worm snake","Wutu","Wynaad keelback","Yarara","Yellow anaconda","Yellow-banded sea snake","Yellow-bellied sea snake","Yellow-lined palm viper","Yellow-lipped sea snake","Yellow-striped rat snake","Yunnan keelback","Zebra snake","Zebra spitting cobra"],yie=["bat","bear","bee","bird","butterfly","cat","cow","crocodile","deer","dog","dolphin","eagle","elephant","fish","flamingo","fox","frog","gecko","giraffe","gorilla","hamster","hippopotamus","horse","kangaroo","koala","lion","monkey","ostrich","panda","parrot","peacock","penguin","polar bear","rabbit","rhinoceros","sea lion","shark","snake","squirrel","tiger","turtle","
847whale","wolf","zebra"],bie={bear:sie,bird:nie,cat:aie,cetacean:iie,cow:oie,crocodilia:lie,dog:cie,fish:uie,horse:die,insect:hie,lion:mie,pet_name:fie,rabbit:pie,rodent:gie,snake:xie,type:yie},vie=bie,wie=["{{person.name}}","{{company.name}}"],jie=["Redhold","Treeflex","Trippledex","Kanlam","Bigtax","Daltfresh","Toughjoyfax","Mat Lam Tam","Otcom","Tres-Zap","Y-Solowarm","Tresom","Voltsillam","Biodex","Greenlam","Viva","Matsoft","Temp","Zoolab","Subin","Rank","Job","Stringtough","Tin","It","Home Ing","Zamit","Sonsing","Konklab","Alpha","Latlux","Voyatouch","Alphazap","Holdlamis","Zaam-Dox","Sub-Ex","Quo Lux","Bamity","Ventosanzap","Lotstring","Hatity","Tempsoft","Overhold","Fixflex","Konklux","Zontrax","Tampflex","Span","Namfix","Transcof","Stim","Fix San","Sonair","Stronghold","Fintone","Y-find","Opela","Lotlux","Ronstring","Zathin","Duobam","Keylex"],Nie=["0.#.#","0.##","#.##","#.#","#.#.#"],Fie={author:wie,name:jie,version:Nie},Sie=Fie,Cie=["A.A. Milne","Agatha Christie","Alan Moore and Dave Gibbons","Albert Camus","Aldous Huxley","Alexander Pope","Alexandre Dumas","Alice Walker","Andrew Lang","Anne Frank","Anthony Burgess","Anthony Trollope","Antoine de Saint-Exupéry","Anton Chekhov","Anton Pavlovich Chekhov","Arthur Conan Doyle","Arthur Schopenhauer","Aylmer Maude","Ayn Rand","Beatrix Potter","Benjamin Disraeli","Benjamin Jowett","Bernard Shaw","Bertrand Russell","Bhagavanlal Indrajit","Boris Pasternak","Bram Stoker","Brian Evenson","C.E. Brock","C.S. Lewis","Carson McCallers","Charles Dickens","Charles E. Derbyshire","Charlotte Brontë","Charlotte Perkins Gilman","Chinua Achebe","Clifford R. Adams","Constance Garnett","Cormac McCarthy","D.H. Lawrence","Dan Brown","Daniel Defoe","Dante Alighieri","Dashiell Hammett","David Widger","David Wyllie","Dean Koontz","Don DeLillo","E.M. Forster","Edgar Allan Poe","Edgar Rice Burroughs","Elizabeth Cleghorn Gaskell","Elizabeth Von Arnim","Emily Brontë","Erich Remarque","Ernest Hemingway","Evelyn Waugh","F. Scott Fitzgerald","Ford Madox Ford","Frances Hodgson Burnett","Frank Herbert","Frank T. Merrill","Franz Kafka","Friedrich Wilhelm Nietzsche","Fyodor Dostoyevsky","G.K. Chesterton","Gabriel Garcia Marquez","Geoffrey Chaucer","George Eliot","George Grossmith","George Orwell","George R. R. Martin","George Saunders","Grady Ward","Graham Greene","Gustave Doré","Gustave Flaubert","Guy de Maupassant","Günter Grass","H.G. Wells","H.P. Lovecraft","Harper Lee","Harriet Beecher Stowe","Haruki Murakami","Henrik Ibsen","Henry David Thoreau","Henry Fielding","Henry James","Henry Miller","Henry Morley","Herman Melville","Hermann Broch","Homer","Honoré de Balzac","Ian McEwan","Isabel Florence Hapgood","Italo Calvino","J.D. Salinger","J.K. Rowling","J.M. Barrie","J.R.R. Tolkien","Jack Kerouac","Jack London","Jacob Grimm","Jacqueline Crooks","James Baldwin","James Dickey","James Ellroy","James Joyce","James Patterson","Jane Austen","Johann Wolfgang von Goethe","John Bunyan","John Camden Hotten","John Dos Passos","John Green","John Grisham","John Kennedy Toole","John Milton","John Ormsby","John Steinbeck","John Updike","Jonathan Franzen","Jonathan Swift","Joseph Conrad","Joseph Heller","José Rizal","Judy Blume","Jules Verne","Junot Diaz","Karl Marx","Kazuo Ishiguro","Ken Follett","Ken Kesey","Kenneth Grahame","Khaled Hosseini","Kingsley Amis","Kurt Vonnegut","L. Frank Baum","L.M. Montgomery","Laurence Sterne","Leo Tolstoy","Lewis Carroll","Louisa May Alcott","Louise Maude","Malcolm Lowry","Marcel Proust","Margaret Atwood","Margaret Mitchell","Marilynne Robinson","Mark Twain","Martin Amis","Mary Shelley","Michael Chabon","Miguel de Cervantes","Mikhail Bulgakov","Muriel Spark","Nancy Mitford","Nathanael West","Nathaniel Hawthorne","Neil Gaiman","Niccolo Machiavelli","Norman Mailer","Oscar Levy","Oscar Wilde","P.G. Wodehouse","Paulo Coelho","Peter Carey","Philip Pullman","Philip Roth","Plato","R.L. Stine","Rachel Kushner","Ralph Ellison","Ray Bradbury","Raymond Chandler","Richard Wagner","Richard Wright","Richard Yates","Roald Dahl","Robert Graves","Robert Louis Stevenson","Robert Penn Warren","Rudyard Kipling","Salman Rushdie","Samuel Beckett","Samuel Butler","Samuel Richardson","Saul Bellow","Shivaram Parashuram Bhide","Sir Arthur Conan Doyle","Sir Richard Francis Burton","Stendhal","Stephen Hawking","Stephen King","Sun Tzu","Suzanne Collins","T. Smollett","T.S. Eliot","Theodore Alois Buckley","Theodore Dreiser","Thomas Hardy","Thomas Love Peacock","Thomas Mann","Toni Morrison","Truman Capote","V.S. Naipaul","Vance Packard","Vatsyayana","Victor Hugo","Virgil","Virginia Woolf","Vladimir Nabokov","Voltaire","W.G. Sebald","W.K. Marriott","Walker Percy","Walt Whitman","Walter Scott","Wilhelm Grimm","Wilkie Collins","William Faulkner","William Gibson","William Golding","William Makepeace Thackeray","William Shakespeare","Zadie Smith"],kie=["Audiobook","Ebook","Hardcover","Paperback"],_ie=["Adventure","Biography","Business","Children's Literature","Classic","Comedy","Comic","Detective","Drama","Fantasy","Graphic Novel","Historical Fiction","Horror","Memoir","Mystery","Mythology","Philosophy","Poetry","Psychology","Religion","Romance","Science Fiction","Thriller","Western","Young Adult"],Eie=["Academic Press","Ace Books","Addison-Wesley","Adis International","Airiti Press","Allen Ltd","Andrews McMeel Publishing","Anova Books","Anvil Press Poetry","Applewood Books","Apress","Athabasca University Press","Atheneum Books","Atheneum Publishers","Atlantic Books","Atlas Press","BBC Books","Ballantine Books","Banner of Truth Trust","Bantam Books","Bantam Spectra","Barrie & Jenkins","Basic Books","Belknap Press","Bella Books","Bellevue Literary Press","Berg Publishers","Berkley Books","Bison Books","Black Dog Publishing","Black Library","Black Sparrow Books","Blackie and Son Limited","Blackstaff Press","Blackwell Publishing","Bloodaxe Books","Bloomsbury Publishing Plc","Blue Ribbon Books","Book League of America","Book Works","Booktrope","Borgo Press","Bowes & Bowes","Boydell & Brewer","Breslov Research Institute","Brill","Brimstone Press","Broadview Press","Burns & Oates","Butterworth-Heinemann","Caister Academic Press","Cambridge University Press","Candlewick Press","Canongate Books","Carcanet Press","Carlton Books","Carlton Publishing Group","Carnegie Mellon University Press","Casemate Publishers","Cengage Learning","Central European University Press","Chambers Harrap","Charles Scribner's Sons","Chatto and Windus","Chick Publications","Chronicle Books","Churchill Livingstone","Cisco Press","City Lights Publishers","Cloverdale
847Corporation","D. Appleton & Company","D. Reidel","DAW Books","Da Capo Press","Daedalus Publishing","Dalkey Archive Press","Darakwon Press","David & Charles","Dedalus Books","Del Rey Books","E. P. Dutton","ECW Press","Earthscan","Edupedia Publications","Eel Pie Publishing","Eerdmans Publishing","Ellora's Cave","Elsevier","Emerald Group Publishing","Etruscan Press","FabJob","Faber and Faber","Fairview Press","Farrar, Straus & Giroux","Fearless Books","Felony & Mayhem Press","Firebrand Books","Flame Tree Publishing","Focal Press","G-Unit Books","G. P. Putnam's Sons","Gaspereau Press","Gay Men's Press","Gefen Publishing House","George H. Doran Company","George Newnes","George Routledge & Sons","Godwit Press","Golden Cockerel Press","HMSO","Hachette Book Group USA","Hackett Publishing Company","Hamish Hamilton","Happy House","Harcourt Assessment","Harcourt Trade Publishers","Harlequin Enterprises Ltd","Harper & Brothers","Harper & Row","HarperCollins","HarperPrism","HarperTrophy","Harry N. Abrams, Inc.","Harvard University Press","Harvest House","Harvill Press at Random House","Hawthorne Books","Hay House","Haynes Manuals","Heyday Books","Hodder & Stoughton","Hodder Headline","Hogarth Press","Holland Park Press","Holt McDougal","Horizon Scientific Press","Ian Allan Publishing","Ignatius Press","Imperial War Museum","Indiana University Press","J. M. Dent","Jaico Publishing House","Jarrolds Publishing","John Blake Publishing","Karadi Tales","Kensington Books","Kessinger Publishing","Kodansha","Kogan Page","Koren Publishers Jerusalem","Ladybird Books","Leaf Books","Leafwood Publishers","Left Book Club","Legend Books","Lethe Press","Libertas Academica","Liberty Fund","Library of America","Lion Hudson","Macmillan Publishers","Mainstream Publishing","Manchester University Press","Mandrake Press","Mandrake of Oxford","Manning Publications","Manor House Publishing","Mapin Publishing","Marion Boyars Publishers","Mark Batty Publisher","Marshall Cavendish","Marshall Pickering","Martinus Nijhoff Publishers","Mascot Books","Matthias Media","McClelland and Stewart","McFarland & Company","McGraw Hill Financial","McGraw-Hill Education","Medknow Publications","Naiad Press","Nauka","NavPress","New Directions Publishing","New English Library","New Holland Publishers","New Village Press","Newnes","No Starch Press","Nonesuch Press","O'Reilly Media","Oberon Books","Open Court Publishing Company","Open University Press","Orchard Books","Orion Books","Packt Publishing","Palgrave Macmillan","Pan Books","Pantheon Books at Random House","Papadakis Publisher","Parachute Publishing","Parragon","Pathfinder Press","Paulist Press","Pavilion Books","Peace Hill Press","Pecan Grove Press","Pen and Sword Books","Penguin Books","Random House","Reed Elsevier","Reed Publishing","SAGE Publications","Salt Publishing","Sams Publishing","Schocken Books","Scholastic Press","Seagull Books","Secker & Warburg","Shambhala Publications","Shire Books","Shoemaker & Hoard Publishers","Shuter & Shooter Publishers","Sidgwick & Jackson","Signet Books","Simon & Schuster","St. Martin's Press","T & T Clark","Tachyon Publications","Tammi","Target Books","Tarpaulin Sky Press","Tartarus Press","Tate Publishing & Enterprises","Taunton Press","Taylor & Francis","Ten Speed Press","UCL Press","Unfinished Monument Press","United States Government Publishing Office","University of Akron Press","University of Alaska Press","University of California Press","University of Chicago Press","University of Michigan Press","University of Minnesota Press","University of Nebraska Press","Velazquez Press","Verso Books","Victor Gollancz Ltd","Viking Press","Vintage Books","Vintage Books at Random House","Virago Press","Virgin Publishing","Voyager Books","Zed Books","Ziff Davis Media","Zondervan"],Aie=["A Song of Ice and Fire","Anna Karenina","Colonel Race","Discworld","Dune","Harry Potter","Hercule Poirot","His Dark Materials","Jane Austen Murder Mysteries","Little Women","Outlander","Percy Jackson","Sherlock Holmes","The Arc of a Scythe","The Bartimaeus Trilogy","The Border Trilogy","The Chronicles of Narnia","The Dark Tower","The Dresden Files","The Eighth Life","The Foundation Series","The Hitchhiker's Guide to the Galaxy","The Hunger Games","The Infinity Cycle","The Inheritance Cycle","The Lord of the Rings","The Maze Runner","The Prison Healer","The Red Rising Saga","The Southern Reach","The Wheel of Time","Thursday Next Series","Twilight","War and Peace"],Die=["1984","20,000 Leagues Under the Sea","A Bend in the River","A Brief History of Time","A Clockwork Orange","A Confederacy of Dunces","A Doll's House","A Handful of Dust","A Modest Proposal","A Passage to India","A Portrait of the Artist as a Young Man","A Room with a Vie
847w","A Study in Scarlet","A Tale of Two Cities","A Wrinkle in Time","Absalom, Absalom!","Adventures of Huckleberry Finn","Alice's Adventures in Wonderland","All Quiet on the Western Front","All the King's Men","American Pastoral","An American Tragedy","And Then There Were None","Animal Farm","Anna Karenina","Anne of Green Gables","Are You There God? It's Me, Margaret","As I Lay Dying","Atlas Shrugged","Atonement","Austerlitz","Beloved","Beyond Good and Evil","Bible","Bleak House","Blood Meridian","Brave New World","Brideshead Revisited","Candide","Carmilla","Catch-22","Charlie and the Chocolate Factory","Charlotte's Web","Clarissa","Cranford","Crime and Punishment","Dao De Jing: A Minimalist Translation","David Copperfield","Deliverance","Don Quixote","Dora","Dr. Zhivago","Dracula","Dubliners","Dune","East of Eden","Emma","Fahrenheit 451","Faust","For Whom the Bell Tolls","Frankenstein","Freakonomics","Go Tell It on the Mountain","Gone with the Wind","Great Expectations","Grimms' Fairy Tales","Gulliver's Travels","Hamlet","Harry Potter and the Sorcerer's Stone","Heart of Darkness","Herzog","His Dark Materials","Hitting the line","Housekeeping","I, Claudius","If on a Winter's Night a Traveler","In Cold Blood","In Search of Lost Time","Invisible Man","It","Jane Eyre","Josefine Mutzenbacher","Jude the Obscure","L.A. Confidential","Leaves of Grass","Les Miserables","Life of Pi","Little Women","Lolita","Long Walk to Freedom","Lord Jim","Lord of the Flies","Lucky Jim","Madame Bovary","Malone Dies","Meditations","Men Without Women","Metamorphosis","Middlemarch","Midnight's Children","Moby Dick","Money","Mrs. Dalloway","My Bondage and My Freedom","My Life","Native Son","Neuromancer","Never Let Me Go","Nightmare Abbey","Nineteen Eighty Four","Nostromo","Notes from the Underground","Of Mice and Men","Oliver Twist","On the Duty of Civil Disobedience","On the Road","One Flew Over the Cuckoo's Nest","One Hundred Years of Solitude","One Thousand and One Nights","Oscar and Lucinda","Pale Fire","Paradise Lost","Peter Pan","Portnoy's Complaint","Pride and Prejudice","Rabbit, Run","Republic","Revolutionary Road","Robinson Crusoe","Romeo and Juliet","Ruth Fielding in Alaska","Scoop","Second Treatise of Government","Slaughterhouse Five","Stories of Anton Chekhov","Sybil","Tess of the d'Urbervilles","The Adventures of Augie March","The Adventures of Huckleberry Finn","The Adventures of Sherlock Holmes","The Adventures of Tom Sawyer","The Aeneid","The Alchemist","The Ambassadors","The Art of War","The Big Sleep","The Black Sheep","The Blue Castle","The Brief Wondrous Life of Oscar Wao","The Brothers Karamazov","The Call of the Wild","The Canterbury Tales","The Catcher in the Rye","The Color Purple","The Complete Works of Edgar Allen Poe","The Corrections","The Count of Monte Cristo","The Day of the Locust","The Diary of a Nobody","The Diary of a Young Girl","The Divine Comedy","The Enchanted April","The Fountainhead","The Golden Bowl","The Golden Notebook","The Good Soldier","The Grapes of Wrath","The Great Gatsby","The Handmaid's Tale","The Heart is a Lonely Hunter","The Heart of the Matter","The Hobbit","The Hound of the Baskervilles","The Idiot","The Iliad","The King in Yellow","The Kite Runner","The Lion, the Witch, and the Wardrobe","The Little Prince","The Lord of the Rings","The Magic Mountain","The Maltese Falcon","The Master and Margarita","The Moviegoer","The Naked and the Dead","The Odyssey","The Old Man and the Sea","The Pickwick Papers","The Picture of Dorian Gray","The Pilgrim's Progress","The Pillars of the Earth","The Plague","The Portrait of a Lady","The Prime of Miss Jean Brodie","The Prince","The Problems of Philosophy","The Prophet","The Pursuit of Love","The Rainbow","The Red and the Black","The Remains of the Day","The Republic","The Scarlet Letter","The Sleepwalkers","The Sound and the Fury","The Stand","The Strange Case of Dr. Jekyll and Mr. Hyde","The Stranger","The Sun Also Rises","The Thirty-Nine Steps","The Three Musketeers","The Time Machine","The Tin Drum","The Trial","The War of the Worlds","The Waste Land","The Way We Live Now","The Wind in the Willows","The Woman in White","The Wonderful Wizard of Oz","The Works of Edgar Allan Poe","The Yellow Wallpaper","Things Fall Apart","Tinker, Tailor, Soldier, Spy","To Kill a Mockingbird","To the Lighthouse","Tom Jones","Treasure Island","Tristram Shandy","Tropic of Cancer","U.S.A. Trilogy","Ulysses","Uncle Tom's Cabin","Under the Volcano","Underworld","Vanity Fair","Walden","War and Peace","Watchmen","Winnie-the-Pooh","Wuthering Heights"],Tie={author:Cie,format:kie,genre:_ie,publisher:Eie,series:Aie,title:Die},Mie=Tie,Pie=["###-###-####","(###) ###-####","1-###-###-####","###.###.####"],Rie={formats:Pie},Bie=Rie,Lie=["azure","black","blue","cyan","fuchsia","gold","green","grey","indigo","ivory","lavender","lime","magenta","maroon","mint green","olive","orange","orchid","pink","plum","purple","red","salmon","silver","sky blue","tan","teal","turquoise","violet","white","yellow"],Iie={human:Lie},Oie=Iie,zie=["Automotive","Baby","Beauty","Books","Clothing","Computers","Electronics","Games","Garden","Grocery","Health","Home","Industrial","Jewelry","Kids","Movies","Music","Outdoors","Shoes","Sports","Tools","Toys"],Uie=["Discover the {{animal.type}}-like agility of our {{commerce.product}}, perfect for {{word.adjective}} users","Discover the {{word.adjective}} new {{commerce.product}} with an exciting mix of {{commerce.productMaterial}} ingredients","Ergonomic {{commerce.product}} made with {{commerce.productMaterial}} for all-day {{word.adjective}} support","Experience the {{color.human}} brilliance of our {{commerce.product}}, perfect for {{word.adjective}} environments","Featuring {{science.chemical_element.name}}-enhanced technology, our {{commerce.product}} offers unparalleled {{word.adjective}} performance","Innovative {{commerce.product}} featuring {{word.adjective}} technology and {{commerce.productMaterial}} construction","Introducing the {{location.country}}-inspired {{commerce.product}}, blending {{word.adjective}} style with local craftsmanship","New {{color.human}} {{commerce.product}} with ergonomic design for {{word.adjective}} comfort",'New {{commerce.product}} model with {{number.int({"min": 1, "max": 100})}} GB RAM, {{number.int({"min": 1, "max": 1000})}} GB storage, and {{word.adjective}} features',"Our {{animal.type}}-friendly {{commerce.product}} ensures {{word.adjective}} comfort for your pets","Our {{food.adjective}}-inspired {{commerce.product}} brings a taste of luxury to your {{word.adjective}} lifestyle","Professional-grade {{commerce.product}} perfect for {{word.adjective}} training and recreational use","Savor the {{food.adjective}} essence in our {{commerce.product}}, designed for {{word.adjective}} culinary adventures","Stylish {{commerce.product}} designed to make you stand out with {{word.adjective}} looks","The sleek and {{word.adjective}} {{commerce.product}} comes with {{color.human}} LED lighting for smart functionality","The {{color.human}} {{commerce.product}} combines {{location.country}} aesthetics with {{science.chemical_element.name}}-based durability","The {{company.catchPhrase}} {{commerce.product}} offers reliable performance and {{word.adjective}} design","The {{person.firstName}} {{commerce.product}} is the latest in a series of {{word.adjective}} products from {{company.name}}","{{commerce.productAdjective}} {{commerce.product}} designed with {{commerce.productMaterial}} for {{word.adjective}} performance","{{company.name}}'s most advanced {{commerce.product}} technology increases {{word.adjective}}
847 capabilities"],Hie={adjective:["Awesome","Bespoke","Electronic","Elegant","Ergonomic","Fantastic","Fresh","Frozen","Generic","Gorgeous","Handcrafted","Handmade","Incredible","Intelligent","Licensed","Luxurious","Modern","Oriental","Practical","Recycled","Refined","Rustic","Sleek","Small","Soft","Tasty","Unbranded"],material:["Aluminum","Bamboo","Bronze","Ceramic","Concrete","Cotton","Gold","Granite","Marble","Metal","Plastic","Rubber","Silk","Steel","Wooden"],product:["Bacon","Ball","Bike","Car","Chair","Cheese","Chicken","Chips","Computer","Fish","Gloves","Hat","Keyboard","Mouse","Pants","Pizza","Salad","Sausages","Shirt","Shoes","Soap","Table","Towels","Tuna"]},$ie={department:zie,product_description:Uie,product_name:Hie},Wie=$ie,qie=["AI-driven","Adaptive","Advanced","Automated","Balanced","Business-focused","Centralized","Compatible","Configurable","Cross-platform","Customer-focused","Customizable","Decentralized","Devolved","Digitized","Distributed","Diverse","Enhanced","Ergonomic","Exclusive","Expanded","Extended","Face to face","Focused","Front-line","Fully-configurable","Fundamental","Future-proofed","Grass-roots","Horizontal","Immersive","Implemented","Innovative","Integrated","Intuitive","Managed","Monitored","Multi-tiered","Networked","Open-architected","Open-source","Operative","Optimized","Optional","Organic","Organized","Persevering","Persistent","Phased","Polarised","Proactive","Profit-focused","Profound","Programmable","Progressive","Public-key","Quality-focused","Reactive","Realigned","Reduced","Reverse-engineered","Robust","Seamless","Secured","Self-enabling","Sharable","Smart","Stand-alone","Streamlined","Sustainable","Synchronised","Team-oriented","Total","Triple-buffered","Universal","Upgradable","User-centric","User-friendly","Versatile","Virtual","Visionary"],Gie=["24/7","AI-driven","B2B","B2C","back-end","best-of-breed","bleeding-edge","collaborative","compelling","cross-media","cross-platform","customized","cutting-edge","decentralized","distributed","dynamic","efficient","end-to-end","enterprise","extensible","frictionless","front-end","generative","global","granular","holistic","immersive","impactful","innovative","integrated","interactive","intuitive","killer","leading-edge","magnetic","mission-critical","next-generation","one-to-one","open-source","out-of-the-box","plug-and-play","proactive","quantum","real-time","revolutionary","rich","robust","scalable","seamless","smart","sticky","strategic","sustainable","synergistic","transparent","turn-key","ubiquitous","user-centric","value-added","vertical","viral","virtual","visionary","world-class"],Vie=["AI","ROI","applications","architectures","blockchains","channels","communities","content","convergence","deliverables","e-commerce","experiences","functionalities","infrastructures","initiatives","interfaces","large language models","lifetime value","markets","methodologies","metrics","mindshare","models","networks","niches","paradigms","partnerships","platforms","relationships","schemas","smart contracts","solutions","supply-chains","synergies","systems","technologies","users","web services"],Kie=["aggregate","architect","benchmark","brand","collaborate","cultivate","deliver","deploy","disintermediate","drive","embrace","empower","enable","engage","engineer","enhance","evolve","expedite","exploit","extend","facilitate","gamify","generate","grow","harness","implement","incentivize","incubate","innovate","integrate","iterate","leverage","maximize","mesh","monetize","optimize","orchestrate","productize","redefine","reinvent","repurpose","revolutionize","scale","seize","simplify","strategize","streamline","syndicate","synthesize","target","transform","transition","unleash","utilize","visualize","whiteboard"],Jie=["24 hour","24/7","AI-powered","actuating","analyzing","asymmetric","asynchronous","attitude-oriented","bifurcated","bottom-line","clear-thinking","client-driven","client-server","cloud-native","coherent","cohesive","composite","content-based","context-sensitive","contextually-based","data-driven","dedicated","demand-driven","directional","discrete","disintermediate","dynamic","eco-centric","empowering","encompassing","executive","explicit","exuding","fault-tolerant","fresh-thinking","full-range","global","heuristic","high-level","holistic","homogeneous","human-resource","hybrid","immersive","impactful","incremental","intangible","interactive","intermediate","leading edge","local","logistical","maximized","methodical","mission-critical","mobile","modular","motivating","national","needs-based","
847neutral","next generation","optimal","optimizing","radical","real-time","reciprocal","regional","resilient","responsive","scalable","secondary","stable","static","sustainable","system-worthy","systematic","systemic","tangible","tertiary","transitional","uniform","user-facing","value-added","well-modulated","zero administration","zero defect","zero tolerance","zero trust"],Yie=["Group","Inc","LLC","and Sons"],Zie=["{{person.last_name.generic}} - {{person.last_name.generic}}","{{person.last_name.generic}} {{company.legal_entity_type}}","{{person.last_name.generic}}, {{person.last_name.generic}} and {{person.last_name.generic}}"],Xie=["ability","access","adapter","algorithm","alliance","analyzer","application","approach","architecture","archive","array","artificial intelligence","attitude","benchmark","budgetary management","capability","capacity","challenge","circuit","collaboration","complexity","concept","conglomeration","contingency","core","customer loyalty","data-warehouse","database","definition","emulation","encoding","encryption","firmware","flexibility","focus group","forecast","frame","framework","function","functionalities","generative AI","hardware","help-desk","hierarchy","hub","implementation","infrastructure","initiative","installation","instruction set","interface","internet solution","intranet","knowledge base","knowledge user","leverage","local area network","matrices","matrix","methodology","microservice","middleware","migration","model","moderator","monitoring","moratorium","neural-net","open architecture","orchestration","paradigm","parallelism","policy","portal","pricing structure","process improvement","product","productivity","project","projection","protocol","service-desk","software","solution","standardization","strategy","structure","success","support","synergy","system engine","task-force","throughput","time-frame","toolset","utilisation","website","workforce"],Qie={adjective:qie,buzz_adjective:Gie,buzz_noun:Vie,buzz_verb:Kie,descriptor:Jie,legal_entity_type:Yie,name_pattern:Zie,noun:Xie},eoe=Qie,toe=["avatar","category","comment","createdAt","email","group","id","name","password","phone","status","title","token","updatedAt"],roe={column:toe},soe=roe,noe={wide:["April","August","December","February","January","July","June","March","May","November","October","September"],abbr:["Apr","Aug","Dec","Feb","Jan","Jul","Jun","Mar","May","Nov","Oct","Sep"]},aoe={wide:["Friday","Monday","Saturday","Sunday","Thursday","Tuesday","Wednesday"],abbr:["Fri","Mon","Sat","Sun","Thu","Tue","Wed"]},ioe={month:noe,weekday:aoe},ooe=ioe,loe=["Auto Loan","Checking","Credit Card","Home Loan","Investment","Money Market","Personal Loan","Savings"],coe=["34##-######-####L","37##-######-####L"],uoe=["30[0-5]#-######-###L","36##-######-###L","54##-####-####-###L"],doe=["6011-####-####-###L","64[4-9]#-####-####-###L","65##-####-####-###L"],hoe=["3528-####-####-###L","3529-####-####-###L","35[3-8]#-####-####-###L"],moe=["2[221-720]-####-####-###L","5[1-5]##-####-####-###L"],foe=["4###########L","4###-####-####-###L"],poe={american_express:coe,diners_club:uoe,discover:doe,jcb:hoe,mastercard:moe,visa:foe},goe=poe,xoe=[{name:"UAE Dirham",code:"AED",symbol:"",numericCode:"784"},{name:"Afghani",code:"AFN",symbol:"Ø",numericCode:"971"},{name:"Lek",code:"ALL",symbol:"Lek",numericCode:"008"},{name:"Armenian Dram",code:"AMD",symbol:"",numericCode:"051"},{name:"Netherlands Antillian Guilder",code:"ANG",symbol:"Æ",numericCode:"532"},{name:"Kwanza",code:"AOA",symbol:"",numericCode:"973"},{name:"Argentine Peso",code:"ARS",symbol:"$",numericCode:"032"},{name:"Australian Dollar",code:"AUD",symbol:"$",numericCode:"036"},{name:"Aruban Guilder",code:"AWG",symbol:"Æ",numericCode:"533"},{name:"Azerbaijanian Manat",code:"AZN",symbol:"ман",numericCode:"944"},{name:"Convertible Marks",code:"BAM",symbol:"KM",numericCode:"977"},{name:"Barbados Dollar",code:"BBD",symbol:"$",numericCode:"052"},{name:"Taka",code:"BDT",symbol:"",numericCode:"050"},{name:"Bulgarian Lev",code:"BGN",symbol:"лв",numericCode:"975"},{name:"Bahraini Dinar",code:"BHD",symbol:"",numericCode:"048"},{name:"Burundi Franc",code:"BIF",symbol:"",numericCode:"108"},{name:"Bermudian Dollar (customarily known as Bermuda Dollar)",code:"BMD",symbol:"$",numericCode:"060"},{name:"Brunei Dollar",code:"BND",symbol:"$",numericCode:"096"},{name:"Boliviano boliviano",code:"BOB",symbol:"Bs",numericCode:"068"},{name:"Brazilian Real",code:"BRL",symbol:"R$",numericCode:"986"},{name:"Bahamian Dollar",code:"BSD",symbol:"$",numericCode:"044"}
847,{name:"Pula",code:"BWP",symbol:"P",numericCode:"072"},{name:"Belarusian Ruble",code:"BYN",symbol:"Rbl",numericCode:"933"},{name:"Belize Dollar",code:"BZD",symbol:"BZ$",numericCode:"084"},{name:"Canadian Dollar",code:"CAD",symbol:"$",numericCode:"124"},{name:"Congolese Franc",code:"CDF",symbol:"",numericCode:"976"},{name:"Swiss Franc",code:"CHF",symbol:"CHF",numericCode:"756"},{name:"Chilean Peso",code:"CLP",symbol:"$",numericCode:"152"},{name:"Yuan Renminbi",code:"CNY",symbol:"Â¥",numericCode:"156"},{name:"Colombian Peso",code:"COP",symbol:"$",numericCode:"170"},{name:"Costa Rican Colon",code:"CRC",symbol:"â¡",numericCode:"188"},{name:"Cuban Peso",code:"CUP",symbol:"â±",numericCode:"192"},{name:"Cape Verde Escudo",code:"CVE",symbol:"",numericCode:"132"},{name:"Czech Koruna",code:"CZK",symbol:"KÄ",numericCode:"203"},{name:"Djibouti Franc",code:"DJF",symbol:"",numericCode:"262"},{name:"Danish Krone",code:"DKK",symbol:"kr",numericCode:"208"},{name:"Dominican Peso",code:"DOP",symbol:"RD$",numericCode:"214"},{name:"Algerian Dinar",code:"DZD",symbol:"",numericCode:"012"}
847,{name:"Egyptian Pound",code:"EGP",symbol:"£",numericCode:"818"},{name:"Nakfa",code:"ERN",symbol:"",numericCode:"232"},{name:"Ethiopian Birr",code:"ETB",symbol:"",numericCode:"230"},{name:"Euro",code:"EUR",symbol:"â¬",numericCode:"978"},{name:"Fiji Dollar",code:"FJD",symbol:"$",numericCode:"242"},{name:"Falkland Islands Pound",code:"FKP",symbol:"£",numericCode:"238"},{name:"Pound Sterling",code:"GBP",symbol:"£",numericCode:"826"},{name:"Lari",code:"GEL",symbol:"",numericCode:"981"},{name:"Cedi",code:"GHS",symbol:"",numericCode:"936"},{name:"Gibraltar Pound",code:"GIP",symbol:"£",numericCode:"292"},{name:"Dalasi",code:"GMD",symbol:"",numericCode:"270"},{name:"Guinea Franc",code:"GNF",symbol:"",numericCode:"324"},{name:"Quetzal",code:"GTQ",symbol:"Q",numericCode:"320"},{name:"Guyana Dollar",code:"GYD",symbol:"$",numericCode:"328"},{name:"Hong Kong Dollar",code:"HKD",symbol:"$",numericCode:"344"},{name:"Lempira",code:"HNL",symbol:"L",numericCode:"340"},{name:"Gourde",code:"HTG",symbol:"",numericCode:"332"},{name:"Forint",code:"HUF",symbol:"Ft",numericCode:"348"},{name:"Rupiah",code:"IDR",symbol:"Rp",numericCode:"360"},{name:"New Israeli Sheqel",code:"ILS",symbol:"âª",numericCode:"376"},{name:"Bhutanese Ngultrum",code:"BTN",symbol:"Nu",numericCode:"064"},{name:"Indian Rupee",code:"INR",symbol:"â¹",numericCode:"356"},{name:"Iraqi Dinar",code:"IQD",symbol:"",numericCode:"368"},{name:"Iranian Rial",code:"IRR",symbol:"ï·¼",numericCode:"364"},{name:"Iceland Krona",code:"ISK",symbol:"kr",numericCode:"352"},{name:"Jamaican Dollar",code:"JMD",symbol:"J$",numericCode:"388"},{name:"Jordanian Dinar",code:"JOD",symbol:"",numericCode:"400"},{name:"Yen",code:"JPY",symbol:"Â¥",numericCode:"392"},{name:"Kenyan Shilling",code:"KES",symbol:"",numericCode:"404"},{name:"Som",code:"KGS",symbol:"лв",numericCode:"417"},{name:"Riel",code:"KHR",symbol:"á",numericCode:"116"},{name:"Comoro Franc",code:"KMF",symbol:"",numericCode:"174"},{name:"North Korean Won",code:"KPW",symbol:"â©",numericCode:"408"},{name:"Won",code:"KRW",symbol:"â©",numericCode:"410"},{name:"Kuwaiti Dinar",code:"KWD",symbol:"",numericCode:"414"},{name:"Cayman Islands Dollar",code:"KYD",symbol:"$",numericCode:"136"},{name:"Tenge",code:"KZT",symbol:"лв",numericCode:"398"},{name:"Kip",code:"LAK",symbol:"â",numericCode:"418"},{name:"Lebanese Pound",code:"LBP",symbol:"£",numericCode:"422"},{name:"Sri Lanka Rupee",code:"LKR",symbol:"â¨",numericCode:"144"},{name:"Liberian Dollar",code:"LRD",symbol:"$",numericCode:"430"},{name:"Libyan Dinar",code:"LYD",symbol:"",numericCode:"434"},{name:"Moroccan Dirham",code:"MAD",symbol:"",numericCode:"504"},{name:"Moldovan Leu",code:"MDL",symbol:"",numericCode:"498"},{name:"Malagasy Ariary",code:"MGA",symbol:"",numericCode:"969"},{name:"Denar",code:"MKD",symbol:"ден",numericCode:"807"},{name:"Kyat",code:"MMK",symbol:"",numericCode:"104"},{name:"Tugrik",code:"MNT",symbol:"â®",numericCode:"496"},{name:"Pataca",code:"MOP",symbol:"",numericCode:"446"},{name:"Ouguiya",code:"MRU",symbol:"",numericCode:"929"},{name:"Mauritius Rupee",code:"MUR",symbol:"â¨",numericCode:"480"},{name:"Rufiyaa",code:"MVR",symbol:"",numericCode:"462"},{name:"Kwacha",code:"MWK",symbol:"",numericCode:"454"},{name:"Mexican Peso",code:"MXN",symbol:"$",numericCode:"484"},{name:"Malaysian Ringgit",code:"MYR",symbol:"RM",numericCode:"458"},{name:"Metical",code:"MZN",symbol:"MT",numericCode:"943"},{name:"Naira",code:"NGN",symbol:"â¦",numericCode:"566"},{name:"Cordoba Oro",code:"NIO",symbol:"C$",numericCode:"558"},{name:"Norwegian Krone",code:"NOK",symbol:"kr",numericCode:"578"},{name:"Nepalese Rupee",code:"NPR",symbol:"â¨",numericCode:"524"},{name:"New Zealand Dollar",code:"NZD",symbol:"$",numericCode:"554"},{name:"Rial Omani",code:"OMR",symbol:"ï·¼",numericCode:"512"},{name:"Balboa",code:"PAB",symbol:"B/.",numericCode:"590"},{name:"Nuevo Sol",code:"PEN",symbol:"S/.",numericCode:"604"},{name:"Kina",code:"PGK",symbol:"",numericCode:"598"},{name:"Philippine Peso",code:"PHP",symbol:"Php",numericCode:"608"},{name:"Pakistan Rupee",code:"PKR",symbol:"â¨",numericCode:"586"},{name:"Zloty",code:"PLN",symbol:"zÅ",numericCode:"985"}
847,{name:"Guarani",code:"PYG",symbol:"Gs",numericCode:"600"},{name:"Qatari Rial",code:"QAR",symbol:"ï·¼",numericCode:"634"},{name:"New Leu",code:"RON",symbol:"lei",numericCode:"946"},{name:"Serbian Dinar",code:"RSD",symbol:"Ðин.",numericCode:"941"},{name:"Russian Ruble",code:"RUB",symbol:"ÑÑб",numericCode:"643"},{name:"Rwanda Franc",code:"RWF",symbol:"",numericCode:"646"},{name:"Saudi Riyal",code:"SAR",symbol:"ï·¼",numericCode:"682"},{name:"Solomon Islands Dollar",code:"SBD",symbol:"$",numericCode:"090"},{name:"Seychelles Rupee",code:"SCR",symbol:"â¨",numericCode:"690"},{name:"Sudanese Pound",code:"SDG",symbol:"",numericCode:"938"},{name:"Swedish Krona",code:"SEK",symbol:"kr",numericCode:"752"},{name:"Singapore Dollar",code:"SGD",symbol:"$",numericCode:"702"},{name:"Saint Helena Pound",code:"SHP",symbol:"£",numericCode:"654"},{name:"Leone",code:"SLE",symbol:"",numericCode:"925"},{name:"Somali Shilling",code:"SOS",symbol:"S",numericCode:"706"},{name:"Surinam Dollar",code:"SRD",symbol:"$",numericCode:"968"},{name:"South Sudanese pound",code:"SSP",symbol:"",numericCode:"728"},{name:"Dobra",code:"STN",symbol:"Db",numericCode:"930"},{name:"Syrian Pound",code:"SYP",symbol:"£",numericCode:"760"},{name:"Lilangeni",code:"SZL",symbol:"",numericCode:"748"},{name:"Baht",code:"THB",symbol:"฿",numericCode:"764"},{name:"Somoni",code:"TJS",symbol:"",numericCode:"972"},{name:"Manat",code:"TMT",symbol:"",numericCode:"934"},{name:"Tunisian Dinar",code:"TND",symbol:"",numericCode:"788"},{name:"Pa'anga",code:"TOP",symbol:"",numericCode:"776"},{name:"Turkish Lira",code:"TRY",symbol:"âº",numericCode:"949"},{name:"Trinidad and Tobago Dollar",code:"TTD",symbol:"TT$",numericCode:"780"},{name:"New Taiwan Dollar",code:"TWD",symbol:"NT$",numericCode:"901"},{name:"Tanzanian Shilling",code:"TZS",symbol:"",numericCode:"834"},{name:"Hryvnia",code:"UAH",symbol:"â´",numericCode:"980"},{name:"Uganda Shilling",code:"UGX",symbol:"",numericCode:"800"},{name:"US Dollar",code:"USD",symbol:"$",numericCode:"840"},{name:"Peso Uruguayo",code:"UYU",symbol:"$U",numericCode:"858"},{name:"Uzbekistan Sum",code:"UZS",symbol:"лв",numericCode:"860"},{name:"Venezuelan bolÃvar",code:"VES",symbol:"Bs",numericCode:"928"},{name:"Dong",code:"VND",symbol:"â«",numericCode:"704"},{name:"Vatu",code:"VUV",symbol:"",numericCode:"548"},{name:"Tala",code:"WST",symbol:"",numericCode:"882"},{name:"CFA Franc BEAC",code:"XAF",symbol:"",numericCode:"950"},{name:"East Caribbean Dollar",code:"XCD",symbol:"$",numericCode:"951"},{name:"CFA Franc BCEAO",code:"XOF",symbol:"",numericCode:"952"},{name:"CFP Franc",code:"XPF",symbol:"",numericCode:"953"},{name:"Yemeni Rial",code:"YER",symbol:"ï·¼",numericCode:"886"},{name:"Rand",code:"ZAR",symbol:"R",numericCode:"710"},{name:"Lesotho Loti",code:"LSL",symbol:"",numericCode:"426"},{name:"Namibia Dollar",code:"NAD",symbol:"N$",numericCode:"516"},{name:"Zambian Kwacha",code:"ZMW",symbol:"K",numericCode:"967"},{name:"Zimbabwe Dollar",code:"ZWL",symbol:"",numericCode:"932"}],yoe=["A {{finance.transactionType}} for {{finance.currencyCode}} {{finance.amount}} was made at {{company.name}} via card ending ****{{string.numeric(4)}} on account ***{{string.numeric(4)}}.","A {{finance.transactionType}} of {{finance.currencyCode}} {{finance.amount}} occurred at {{company.name}} using a card ending in ****{{string.numeric(4)}} for account ***{{string.numeric(4)}}.","Payment of {{finance.currencyCode}} {{finance.amount}} for {{finance.transactionType}} at {{company.name}}, processed with card ending ****{{string.numeric(4)}} linked to account ***{{string.numeric(4)}}.","Transaction alert: {{finance.transactionType}} at {{company.name}} using card ending ****{{string.numeric(4)}} for an amount of {{finance.currencyCode}} {{finance.amount}} on account ***{{string.numeric(4)}}.","You made a {{finance.transactionType}} of {{finance.currencyCode}} {{finance.amount}} at {{company.name}} using card ending in ****{{string.numeric(4)}} from account ***{{string.numeric(4)}}.","Your {{finance.transactionType}} of {{finance.currencyCode}} {{finance.amount}} at {{company.name}} was successful. Charged via card ****{{string.numeric(4)}}
847 to account ***{{string.numeric(4)}}.","{{finance.transactionType}} at {{company.name}} with a card ending in ****{{string.numeric(4)}} for {{finance.currencyCode}} {{finance.amount}} from account ***{{string.numeric(4)}}.","{{finance.transactionType}} confirmed at {{company.name}} for {{finance.currencyCode}} {{finance.amount}}, card ending in ****{{string.numeric(4)}} associated with account ***{{string.numeric(4)}}.","{{finance.transactionType}} of {{finance.currencyCode}} {{finance.amount}} at {{company.name}} charged to account ending in {{string.numeric(4)}} using card ending in ****{{string.numeric(4)}}.","{{finance.transactionType}} processed at {{company.name}} for {{finance.currencyCode}} {{finance.amount}}, using card ending ****{{string.numeric(4)}}. Account: ***{{string.numeric(4)}}.","{{finance.transactionType}} transaction at {{company.name}} using card ending with ****{{string.numeric(4)}} for {{finance.currencyCode}} {{finance.amount}} in account ***{{string.numeric(4)}}."],boe=["deposit","invoice","payment","withdrawal"],voe={account_type:loe,credit_card:goe,currency:xoe,transaction_description_pattern:yoe,transaction_type:boe},woe=voe,joe=["bitter","creamy","crispy","crunchy","delicious","fluffy","fresh","golden","juicy","moist","rich","salty","savory","smoky","sour","spicy","sweet","tangy","tender","zesty"],Noe=["A classic pie filled with delicious {{food.meat}} and {{food.adjective}} {{food.ingredient}}, baked in a {{food.adjective}} pastry crust and topped with a golden-brown lattice.","A delightful tart combining {{food.adjective}} {{food.vegetable}} and sweet {{food.fruit}}, set in a buttery pastry shell and finished with a hint of {{food.spice}}.","A heartwarming {{food.ethnic_category}} soup, featuring fresh {{food.ingredient}} and an aromatic blend of traditional spices.","A robust {{food.adjective}} stew featuring {{food.ethnic_category}} flavors, loaded with {{food.adjective}} meat, {{food.adjective}} vegetables, and a {{food.adjective}}, {{food.adjective}} broth.","A simple {{food.fruit}} pie. No fancy stuff. Just pie.","A slow-roasted {{animal.bird}} with a {{food.adjective}}, {{food.adjective}} exterior. Stuffed with {{food.fruit}} and covered in {{food.fruit}} sauce. Sides with {{food.vegetable}} puree and wild {{food.vegetable}}.","A special {{color.human}} {{food.ingredient}} from {{location.country}}. To support the strong flavor it is sided with a tablespoon of {{food.spice}}.","A succulent {{food.meat}} steak, encased in a {{food.adjective}} {{food.spice}} crust, served with a side of {{food.spice}} mashed {{food.vegetable}}.","An exquisite {{food.meat}} roast, infused with the essence of {{food.fruit}}, slow-roasted to bring out its natural flavors and served with a side of creamy {{food.vegetable}}","Baked {{food.ingredient}}-stuffed {{food.meat}}, seasoned with {{food.spice}} and {{food.adjective}} herbs, accompanied by roasted {{food.vegetable}} medley.","Crispy fried {{food.meat}} bites, seasoned with {{food.spice}} and served with a tangy {{food.fruit}} dipping sauce.","Fresh mixed greens tossed with {{food.spice}}-rubbed {{food.meat}}, {{food.vegetable}}, and a light dressing.","Fresh {{food.ingredient}} with a pinch of {{food.spice}}, topped by a caramelized {{food.fruit}} with whipped cream","Grilled {{food.meat}} kebabs, marinated in {{food.ethnic_category}} spices and served with a fresh {{food.vegetable}} and {{food.fruit}} salad.","Hearty {{food.ingredient}} and {{food.meat}} stew, slow-cooked with {{food.spice}} and {{food.vegetable}} for a comforting, flavorful meal.","Juicy {{food.meat}}, grilled to your liking and drizzled with a bold {{food.spice}} sauce, served alongside roasted {{food.vegetable}}.","Our {{food.adjective}} {{food.meat}}, slow-cooked to perfection, accompanied by steamed {{food.vegetable}} and a rich, savory gravy.","Tender {{food.meat}} skewers, glazed with a sweet and tangy {{food.fruit}} sauce, served over a bed of fragrant jasmine rice.","Tenderly braised {{food.meat}} in a rich {{food.spice}} and {{food.vegetable}} sauce, served with a side of creamy {{food.vegetable}}.","Three {{food.ingredient}} with {{food.vegetable}}, {{food.vegetable}}, {{food.vegetable}}, {{food.vegetable}} and {{food.ingredient}}. With a side of baked {{food.fruit}}, and your choice of {{food.ingredient}} or {{food.ingredient}}.",'{{number.int({"min":1, "max":99})}}-day aged {{food.meat}} steak, with choice of {{number.int({"min":2, "max":4})}} sides.'],Foe=["California maki","Peking duck","Philadelphia maki","arepas","barbecue ribs","bruschette with tomato","bunny chow","caes
847ar salad","caprese salad","cauliflower penne","cheeseburger","chicken fajitas","chicken milanese","chicken parm","chicken wings","chilli con carne","ebiten maki","fettuccine alfredo","fish and chips","french fries with sausages","french toast","hummus","katsu curry","kebab","lasagne","linguine with clams","massaman curry","meatballs with sauce","mushroom risotto","pappardelle alla bolognese","pasta and beans","pasta carbonara","pasta with tomato and basil","pho","pierogi","pizza","poke","pork belly buns","pork sausage roll","poutine","ricotta stuffed ravioli","risotto with seafood","salmon nigiri","scotch eggs","seafood paella","som tam","souvlaki","stinky tofu","sushi","tacos","teriyaki chicken donburi","tiramisù","tuna sashimi","vegetable soup"],Soe=["{{food.adjective}} {{food.ethnic_category}} stew","{{food.adjective}} {{food.meat}} with {{food.vegetable}}","{{food.ethnic_category}} {{food.ingredient}} soup","{{food.fruit}} and {{food.fruit}} tart","{{food.fruit}} pie","{{food.fruit}}-glazed {{food.meat}} skewers","{{food.fruit}}-infused {{food.meat}} roast","{{food.ingredient}} and {{food.meat}} pie","{{food.ingredient}}-infused {{food.meat}}","{{food.meat}} steak","{{food.meat}} with {{food.fruit}} sauce","{{food.spice}}-crusted {{food.meat}}","{{food.spice}}-rubbed {{food.meat}} salad","{{food.vegetable}} salad","{{person.first_name.generic}}'s special {{food.ingredient}}"],Coe=["Ainu","Albanian","American","Andhra","Anglo-Indian","Arab","Argentine","Armenian","Assyrian","Awadhi","Azerbaijani","Balochi","Bangladeshi","Bashkir","Belarusian","Bengali","Berber","Brazilian","British","Buddhist","Bulgarian","Cajun","Cantonese","Caribbean","Chechen","Chinese","Chinese Islamic","Circassian","Crimean Tatar","Cypriot","Czech","Danish","Egyptian","English","Eritrean","Estonian","Ethiopian","Filipino","French","Georgian","German","Goan","Goan Catholic","Greek","Gujarati","Hyderabad","Indian","Indian Chinese","Indian Singaporean","Indonesian","Inuit","Irish","Italian","Italian-American","Jamaican","Japanese","Jewish - Israeli","Karnataka","Kazakh","Keralite","Korean","Kurdish","Laotian","Latvian","Lebanese","Lithuanian","Louisiana Creole","Maharashtrian","Malay","Malaysian Chinese","Malaysian Indian","Mangalorean","Mediterranean","Mennonite","Mexican","Mordovian","Mughal","Native American","Nepalese","New Mexican","Odia","Pakistani","Parsi","Pashtun","Pennsylvania Dutch","Peranakan","Persian","Peruvian","Polish","Portuguese","Punjabi","Québécois","Rajasthani","Romani","Romanian","Russian","Sami","Serbian","Sindhi","Slovak","Slovenian","Somali","South Indian","Soviet","Spanish","Sri Lankan","Taiwanese","Tamil","Tatar","Texan","Thai","Turkish","Udupi","Ukrainian","Vietnamese","Yamal","Zambian","Zanzibari"],koe=["apple","apricot","aubergine","avocado","banana","berry","blackberry","blood orange","blueberry","bush tomato","butternut pumpkin","cantaloupe","cavalo","cherry","corella pear","cranberry","cumquat","currant","custard apple","custard apples daikon","date","dragonfruit","dried apricot","elderberry","feijoa","fig","fingerlime","goji berry","grape","grapefruit","guava","honeydew melon","incaberry","jarrahdale pumpkin","juniper berry","kiwi fruit","kiwiberry","lemon","lime","longan","loquat","lychee","mandarin","mango","mangosteen","melon","mulberry","nashi pear","nectarine","olive","orange","papaw","papaya","passionfruit","peach","pear","pineapple","plum","pomegranate","prune","rockmelon","snowpea","sprout","starfruit","strawberry","sultana","tangelo","tomato","watermelon"],_oe=["achacha","adzuki beans","agar","agave syrup","ajowan seed","albacore tuna","alfalfa","allspice","almond oil","almonds","amaranth","amchur","anchovies","aniseed","annatto seed","apple cider vinegar","apple juice","apple juice concentrate","apples","apricots","arborio rice","arrowroot","artichoke","arugula","asafoetida","asian greens","asian noodles","asparagus","aubergine","avocado","avocado oil","avocado spread","bacon","baking powder","baking soda","balsamic vinegar","bamboo shoots","banana","barberry","barley","barramundi","basil basmati rice","bay leaves","bean shoots","bean sprouts","beans","beef","beef stock","beetroot","berries","besan","black eyed beans","blackberries","blood oranges","blue cheese","blue eye trevalla","blue swimmer crab","blueberries","bocconcini","bok choy","bonito flakes","bonza","borlotti beans","bran","brazil nut","bread","brie","broccoli","broccolini","brown flour","brown mushrooms","brown rice","brown rice vinegar","brussels sprouts","buckwheat","buckwheat flour","buckwheat noodles","bulghur","bush tomato","butter","butter beans","buttermilk","butternut lettuce","butternut pumpkin","cabbage","cacao","cake","calamari","camellia tea oil","camembert","camomile","candle nut","cannellini beans","canola oil","cantaloupe","capers","capsicum","caraway seed","cardamom","carob carrot","carrot","cashews","cassia bark","cauliflower","cavalo","cayenne","celery","celery seed","cheddar","cherries","chestnut","chia seeds","chicken","chicken stock","chickory","chickpea","chilli pepper","chinese cabbage","chinese five spice","chives","choy sum","cinnamon","clams","cloves","cocoa powder","coconut","coconut oil","coconut water","coffee","common cultivated mushrooms","corella pear","coriander leaves","coriander seed","corn oil","corn syrup","corn tortilla","cornichons","cornmeal","cos lettuce","cottage cheese","cous cous","crabs","cranberry","cream","cream cheese","cucumber","cumin","cumquat","currants","curry leaves","curry powder","custard apples","dandelion","dark chocolate","dashi","dates","dill","dragonfruit","dried apricots","dried chinese broccoli","duck","edam","edamame","eggplant","eggs","elderberry","endive","english spinach","enoki mushrooms","extra virgin olive oil","farmed prawns","feijoa","fennel","fennel seeds","fenugreek","feta","figs","file powder","fingerlime","fish sauce","fish stock","flat mushrooms","flathead","flaxseed","flaxseed oil","flounder","flour","freekeh","french eschallots","fresh chillies","fromage blanc","fruit","galangal","garam masala","garlic","goat cheese","goat milk","goji berry","grape seed oil","grapefruit","grapes","green beans","green pepper","green tea","green tea noodles","greenwheat freekeh","gruyere","guava","gula melaka","haloumi","ham","haricot beans","harissa","hazelnut","hijiki","hiramasa kingfish","hokkien noo
847dles","honey","honeydew melon","horseradish","hot smoked salmon","hummus","iceberg lettuce","incaberries","jarrahdale pumpkin","jasmine rice","jelly","jerusalem artichoke","jewfish","jicama","juniper berries","kale","kangaroo","kecap manis","kenchur","kidney beans","kidneys","kiwi berries","kiwi fruit","kohlrabi","kokam","kombu","koshihikari rice","kudzu","kumera","lamb","lavender flowers","leeks","lemon","lemongrass","lentils","lettuce","licorice","lime leaves","limes","liver","lobster","longan","loquats","lotus root","lychees","macadamia nut","macadamia oil","mace","mackerel","mahi mahi","mahlab","malt vinegar","mandarins","mango","mangosteens","maple syrup","margarine","marigold","marjoram","mastic","melon","milk","milk chocolate","mint","miso","molasses","monkfish","morwong","mountain bread","mozzarella","muesli","mulberries","mullet","mung beans","mussels","mustard","mustard seed","nashi pear","nasturtium","nectarines","nori","nutmeg","nutritional yeast","nuts","oat flour","oatmeal","oats","octopus","okra","olive oil","olives","omega spread","onion","oranges","oregano","oyster mushrooms","oyster sauce","oysters","pandanus leaves","papaw","papaya","paprik","parmesan cheese","parrotfish","parsley","parsnip","passionfruit","pasta","peaches","peanuts","pear","pear juice","pears","peas","pecan nut","pecorino","pepitas","peppercorns","peppermint","peppers","persimmon","pine nut","pineapple","pinto beans","pistachio nut","plums","polenta","pomegranate","poppy seed","porcini mushrooms","pork","potato flour","potatoes","provolone","prunes","pumpkin","pumpkin seed","purple carrot","purple rice","quark","quince","quinoa","radicchio","radish","raisin","raspberry","red cabbage","red lentils","red pepper","red wine","red wine vinegar","redfish","rhubarb","rice flour","rice noodles","rice paper","rice syrup","ricemilk","ricotta","rockmelon","rose water","rosemary","rye","rye bread","safflower oil","saffron","sage","sake","salmon","sardines","sausages","scallops","sea salt","semolina","sesame oil","sesame seeds","shark","shiitake mushrooms","silverbeet","slivered almonds","smoked trout","snapper","snowpea sprouts","snowpeas","soba","sour dough bread","soy","soy beans","soy flour","soy milk","soy sauce","soymilk","spearmint","spelt","spelt bread","spinach","spring onions","sprouts","squash","squid","star anise","star fruit","starfruit","stevia","strawberries","sugar","sultanas","sun-dried tomatoes","sunflower oil","sunflower seeds","sweet chilli sauce","sweet potato","swiss chard","swordfish","szechuan pepperberry","tabasco","tahini","taleggio cheese","tamari","tamarillo","tangelo","tapioca","tapioca flour","tarragon","tea","tea oil","tempeh","thyme","tinned","tofu","tom yum","tomatoes","trout","tuna","turkey","turmeric","turnips","unbleached flour","vanilla beans","vegetable oil","vegetable spaghetti","vegetable stock","vermicelli noodles","vinegar","wakame","walnut","warehou","wasabi","water","watercress","watermelon","wattleseed","wheat","wheatgrass juice","white bread","white flour","white rice","white wine","white wine vinegar","whiting wild rice","wholegrain bread","wholemeal","wholewheat flour","william pear","yeast","yellow papaw","yellowtail kingfish","yoghurt","yogurt","zucchini"],Eoe=["beef","chicken","crocodile","duck","emu","goose","kangaroo","lamb","ostrich","pigeon","pork","quail","rabbit","salmon","turkey","venison"],Aoe=["achiote seed","ajwain seed","ajwan seed","allspice","amchoor","anise","anise star","aniseed","annatto seed","arrowroot","asafoetida","baharat","balti masala","balti stir fry mix","basil","bay leaves","bbq","caraway seed","cardamom","cassia","cayenne pepper","celery","chamomile","chervil","chilli","chilli pepper","chillies","china star","chives","cinnamon","cloves","colombo","coriander","cumin","curly leaf parsley","curry","dhansak","dill","fennel seed","fenugreek","fines herbes","five spice","french lavender","galangal","garam masala","garlic","german chamomile","ginger","green cardamom","herbes de provence","jalfrezi","jerk","kaffir leaves","korma","lavender","lemon grass","lemon pepper","lime leaves","liquorice root","mace","mango","marjoram","methi","mint","mustard","nutmeg","onion seed","orange zest","oregano","paprika","parsley","pepper","peppercorns","pimento","piri piri","poppy seed","pot marjoram","poudre de colombo","ras-el-hanout","rice paper","rogan josh","rose baie","rosemary","saffron","sage","sesame seed","spearmint","sumac","sweet basil","sweet laurel","tagine","tandoori masala","tarragon","thyme","tikka masala","turmeric","vanilla","zahtar"],Doe=["artichoke","arugula","asian greens","asparagus","bean shoots","bean sprouts","beans","beetroot","bok choy","broccoli","broccolini","brussels sprouts","butternut lettuce","cabbage","capers","carob carrot","carrot","cauliflower","celery","chilli pepper","chinese cabbage","chives","cornichons","cos lettuce","cucumber","dried chinese broccoli","eggplant","endive","english spinach","french eschallots","fresh chillies","garlic","green beans","green pepper","hijiki","iceberg lettuce","jerusalem artichoke","jicama","kale","kohlrabi","leeks","lettuce","okra","onion","parsnip","peas","peppers","potatoes","pumpkin","purple carrot","radicchio","radish","raspberry","red cabbage","red pepper","rhubarb","snowpea sprouts","spinach","squash","sun dried tomatoes","sweet potato","swiss chard","turnips","zucchini"],Toe={adjective:joe,description_pattern:Noe,dish:Foe,dish_pattern:Soe,ethnic_category:Coe,fruit:koe,ingredient:_oe,meat:Eoe,spice:Aoe,vegetable:Doe},Moe=Toe,Poe=["1080p","auxiliary","back-end","bluetooth","cross-platform","digital","haptic","mobile","multi-byte","neural","online","open-source","optical","primary","redundant","solid state","virtual","wireless"],Roe=["backing up","bypassing","calculating","compressing","connecting","copying","generating","hacking","indexing","navigating","overriding","parsing","programming","quantifying","synthesizing","transmitting"],Boe=["alarm","application","array","bandwidth","bus","capacitor","card","circuit","driver","feed","firewall","hard drive","
847interface","matrix","microchip","monitor","panel","pixel","port","program","protocol","sensor","system","transmitter"],Loe=["I'll {{verb}} the {{adjective}} {{abbreviation}} {{noun}}, that should {{noun}} the {{abbreviation}} {{noun}}!","If we {{verb}} the {{noun}}, we can get to the {{abbreviation}} {{noun}} through the {{adjective}} {{abbreviation}} {{noun}}!","The {{abbreviation}} {{noun}} is down, {{verb}} the {{adjective}} {{noun}} so we can {{verb}} the {{abbreviation}} {{noun}}!","Try to {{verb}} the {{abbreviation}} {{noun}}, maybe it will {{verb}} the {{adjective}} {{noun}}!","Use the {{adjective}} {{abbreviation}} {{noun}}, then you can {{verb}} the {{adjective}} {{noun}}!","We need to {{verb}} the {{adjective}} {{abbreviation}} {{noun}}!","You can't {{verb}} the {{noun}} without {{ingverb}} the {{adjective}} {{abbreviation}} {{noun}}!","{{ingverb}} the {{noun}} won't do anything, we need to {{verb}} the {{adjective}} {{abbreviation}} {{noun}}!"],Ioe=["back up","bypass","calculate","compress","connect","copy","generate","hack","index","input","navigate","override","parse","program","quantify","reboot","synthesize","transmit"],Ooe={adjective:Poe,ingverb:Roe,noun:Boe,phrase:Loe,verb:Ioe},zoe=Ooe,Uoe=["biz","com","info","name","net","org"],Hoe=["example.com","example.net","example.org"],$oe=["gmail.com","hotmail.com","yahoo.com"],Woe={domain_suffix:Uoe,example_email:Hoe,free_email:$oe},qoe=Woe,Goe=["#####","####","###"],Voe=["Abilene","Akron","Alafaya","Alameda","Albany","Albuquerque","Alexandria","Alhambra","Aliso Viejo","Allen","Allentown","Aloha","Alpharetta","Altadena","Altamonte Springs","Altoona","Amarillo","Ames","Anaheim","Anchorage","Anderson","Ankeny","Ann Arbor","Annandale","Antelope","Antioch","Apex","Apopka","Apple Valley","Appleton","Arcadia","Arden-Arcade","Arecibo","Arlington","Arlington Heights","Arvada","Ashburn","Asheville","Aspen Hill","Atascocita","Athens-Clarke County","Atlanta","Attleboro","Auburn","Augusta-Richmond County","Aurora","Austin","Avondale","Azusa","Bakersfield","Baldwin Park","Baltimore","Barnstable Town","Bartlett","Baton Rouge","Battle Creek","Bayamon","Bayonne","Baytown","Beaumont","Beavercreek","Beaverton","Bedford","Bel Air South","Bell Gardens","Belleville","Bellevue","Bellflower","Bellingham","Bend","Bentonville","Berkeley","Berwyn","Bethesda","Bethlehem","Billings","Biloxi","Binghamton","Birmingham","Bismarck","Blacksburg","Blaine","Bloomington","Blue Springs","Boca Raton","Boise City","Bolingbrook","Bonita Springs","Bossier City","Boston","Bothell","Boulder","Bountiful","Bowie","Bowling Green","Boynton Beach","Bozeman","Bradenton","Brandon","Brentwood","Bridgeport","Bristol","Brockton","Broken Arrow","Brookhaven","Brookline","Brooklyn Park","Broomfield","Brownsville","Bryan","Buckeye","Buena Park","Buffalo","Buffalo Grove","Burbank","Burien","Burke","Burleson","Burlington","Burnsville","Caguas","Caldwell","Camarillo","Cambridge","Camden","Canton","Cape Coral","Carlsbad","Carmel","Carmichael","Carolina","Carrollton","Carson","Carson City","Cary","Casa Grande","Casas Adobes","Casper","Castle Rock","Castro Valley","Catalina Foothills","Cathedral City","Catonsville","Cedar Hill","Cedar Park","Cedar Rapids","Centennial","Centreville","Ceres","Cerritos","Champaign","Chandler","Chapel Hill","Charleston","Charlotte","Charlottesville","Chattanooga","Cheektowaga","Chesapeake","Chesterfield","Cheyenne","Chicago","Chico","Chicopee","Chino","Chino Hills","Chula Vista","Cicero","Cincinnati","Citrus Heights","Clarksville","Clearwater","Cleveland","Cleveland Heights","Clifton","Clovis","Coachella","Coconut Creek","Coeur d'Alene","College Station","Collierville","Colorado Springs","Colton","Columbia","Columbus","Commerce City","Compton","Concord","Conroe","Conway","Coon Rapids","Coral Gables","Coral Springs","Corona","Corpus Christi","Corvallis","Costa Mesa","Council Bluffs","Country Club","Covina","Cranston","Cupertino","Cutler Bay","Cuyahoga Falls","Cypress","Dale City","Dallas","Daly City","Danbury","Danville","Davenport","Davie","Davis","Dayton","Daytona Beach","DeKalb","DeSoto","Dearborn","Dearborn Heights","Decatur","Deerfield Beach","Delano","Delray Beach","Deltona","Denton","Denver","Des Moines","Des Plaines","Detroit","Diamond Bar","Doral","Dothan","Downers Grove","Downey","Draper","Dublin","Dubuque","Duluth","Dundalk","Dunwoody","Durham","
847Eagan","East Hartford","East Honolulu","East Lansing","East Los Angeles","East Orange","East Providence","Eastvale","Eau Claire","Eden Prairie","Edina","Edinburg","Edmond","El Cajon","El Centro","El Dorado Hills","El Monte","El Paso","Elgin","Elizabeth","Elk Grove","Elkhart","Ellicott City","Elmhurst","Elyria","Encinitas","Enid","Enterprise","Erie","Escondido","Euclid","Eugene","Euless","Evanston","Evansville","Everett","Fairfield","Fall River","Fargo","Farmington","Farmington Hills","Fayetteville","Federal Way","Findlay","Fishers","Flagstaff","Flint","Florence-Graham","Florin","Florissant","Flower Mound","Folsom","Fond du Lac","Fontana","Fort Collins","Fort Lauderdale","Fort Myers","Fort Pierce","Fort Smith","Fort Wayne","Fort Worth","Fountain Valley","Fountainebleau","Framingham","Franklin","Frederick","Freeport","Fremont","Fresno","Frisco","Fullerton","Gainesville","Gaithersburg","Galveston","Garden Grove","Gardena","Garland","Gary","Gastonia","Georgetown","Germantown","Gilbert","Gilroy","Glen Burnie","Glendale","Glendora","Glenview","Goodyear","Grand Forks","Grand Island","Grand Junction","Grand Prairie","Grand Rapids","Grapevine","Great Falls","Greeley","Green Bay","Greensboro","Greenville","Greenwood","Gresham","Guaynabo","Gulfport","Hacienda Heights","Hackensack","Haltom City","Hamilton","Hammond","Hampton","Hanford","Harlingen","Harrisburg","Harrisonburg","Hartford","Hattiesburg","Haverhill","Hawthorne","Hayward","Hemet","Hempstead","Henderson","Hendersonville","Hesperia","Hialeah","Hicksville","High Point","Highland","Highlands Ranch","Hillsboro","Hilo","Hoboken","Hoffman Estates","Hollywood","Homestead","Honolulu","Hoover","Houston","Huntersville","Huntington","Huntington Beach","Huntington Park","Huntsville","Hutchinson","Idaho Falls","Independence","Indianapolis","Indio","Inglewood","Iowa City","Irondequoit","Irvine","Irving","Jackson","Jacksonville","Janesville","Jefferson City","Jeffersonville","Jersey City","Johns Creek","Johnson City","Joliet","Jonesboro","Joplin","Jupiter","Jurupa Valley","Kalamazoo","Kannapolis","Kansas City","Kearny","Keller","Kendale Lakes","Kendall","Kenner","Kennewick","Kenosha","Kent","Kentwood","Kettering","Killeen","Kingsport","Kirkland","Kissimmee","Knoxville","Kokomo","La Crosse","La Habra","La Mesa","La Mirada","Lacey","Lafayette","Laguna Niguel","Lake Charles","Lake Elsinore","Lake Forest","Lake Havasu City","Lake Ridge","Lakeland","Lakeville","Lakewood","Lancaster","Lansing","Laredo","Largo","Las Cruces","Las Vegas","Lauderhill","Lawrence","Lawton","Layton","League City","Lee's Summit","Leesburg","Lehi","Lehigh Acres","Lenexa","Levittown","Lewisville","Lexington-Fayette","Lincoln","Linden","Little Rock","Littleton","Livermore","Livonia","Lodi","Logan","Lombard","Lompoc","Long Beach","Longmont","Longview","Lorain","Los Angeles","Louisville/Jefferson County","Loveland","Lowell","Lubbock","Lynchburg","Lynn","Lynwood","Macon-Bibb County","Madera","Madison","Malden","Manchester","Manhattan","Mansfield","Manteca","Maple Grove","Margate","Maricopa","Marietta","Marysville","Mayaguez","McAllen","McKinney","McLean","Medford","Melbourne","Memphis","Menifee","Mentor","Merced","Meriden","Meridian","Mesa","Mesquite","Metairie","Methuen Town","Miami","Miami Beach","Miami Gardens","Middletown","Midland","Midwest City","Milford","Millcreek","Milpitas","Milwaukee","Minneapolis","Minnetonka","Minot","Miramar","Mishawaka","Mission","Mission Viejo","Missoula","Missouri City","Mobile","Modesto","Moline","Monroe","Montebello","Monterey Park","Montgomery","Moore","Moreno Valley","Morgan Hill","Mount Pleasant","Mount Prospect","Mount Vernon","Mountain Vie
847w","Muncie","Murfreesboro","Murray","Murrieta","Nampa","Napa","Naperville","Nashua","Nashville-Davidson","National City","New Bedford","New Braunfels","New Britain","New Brunswick","New Haven","New Orleans","New Rochelle","New York","Newark","Newport Beach","Newport News","Newton","Niagara Falls","Noblesville","Norfolk","Normal","Norman","North Bethesda","North Charleston","North Highlands","North Las Vegas","North Lauderdale","North Little Rock","North Miami","North Miami Beach","North Port","North Richland Hills","Norwalk","Novato","Novi","O'Fallon","Oak Lawn","Oak Park","Oakland","Oakland Park","Ocala","Oceanside","Odessa","Ogden","Oklahoma City","Olathe","Olympia","Omaha","Ontario","Orange","Orem","Orland Park","Orlando","Oro Valley","Oshkosh","Overland Park","Owensboro","Oxnard","Palatine","Palm Bay","Palm Beach Gardens","Palm Coast","Palm Desert","Palm Harbor","Palm Springs","Palmdale","Palo Alto","Paradise","Paramount","Parker","Parma","Pasadena","Pasco","Passaic","Paterson","Pawtucket","Peabody","Pearl City","Pearland","Pembroke Pines","Pensacola","Peoria","Perris","Perth Amboy","Petaluma","Pflugerville","Pharr","Philadelphia","Phoenix","Pico Rivera","Pine Bluff","Pine Hills","Pinellas Park","Pittsburg","Pittsburgh","Pittsfield","Placentia","Plainfield","Plano","Plantation","Pleasanton","Plymouth","Pocatello","Poinciana","Pomona","Pompano Beach","Ponce","Pontiac","Port Arthur","Port Charlotte","Port Orange","Port St. Lucie","Portage","Porterville","Portland","Portsmouth","Potomac","Poway","Providence","Provo","Pueblo","Quincy","Racine","Raleigh","Rancho Cordova","Rancho Cucamonga","Rancho Palos Verdes","Rancho Santa Margarita","Rapid City","Reading","Redding","Redlands","Redmond","Redondo Beach","Redwood City","Reno","Renton","Reston","Revere","Rialto","Richardson","Richland","Richmond","Rio Rancho","Riverside","Riverton","Riverview","Roanoke","Rochester","Rochester Hills","Rock Hill","Rockford","Rocklin","Rockville","Rockwall","Rocky Mount","Rogers","Rohnert Park","Rosemead","Roseville","Roswell","Round Rock","Rowland Heights","Rowlett","Royal Oak","Sacramento","Saginaw","Salem","Salina","Salinas","Salt Lake City","Sammamish","San Angelo","San Antonio","San Bernardino","San Bruno","San Buenaventura (Ventura)","San Clemente","San Diego","San Francisco","San Jacinto","San Jose","San Juan","San Leandro","San Luis Obispo","San Marcos","San Mateo","San Rafael","San Ramon","San Tan Valley","Sandy","Sandy Springs","Sanford","Santa Ana","Santa Barbara","Santa Clara","Santa Clarita","Santa Cruz","Santa Fe","Santa Maria","Santa Monica","Santa Rosa","Santee","Sarasota","Savannah","Sayreville","Schaumburg","Schenectady","Scottsdale","Scranton","Seattle","Severn","Shawnee","Sheboygan","Shoreline","Shreveport","Sierra Vista","Silver Spring","Simi Valley","Sioux City","Sioux Falls","Skokie","Smyrna","Somerville","South Bend","South Gate","South Hill","South Jordan","South San Francisco","South Valley","South Whittier","Southaven","Southfield","Sparks","Spokane","Spokane Valley","Spring","Spring Hill","Spring Valley","Springdale","Springfield","St. Charles","St. Clair Shores","St. Cloud","St. George","St. Joseph","St. Louis","St. Louis Park","St. Paul","St. Peters","St. Petersburg","Stamford","State College","Sterling Heights","Stillwater","Stockton","Stratford","Strongsville","Suffolk","Sugar Land","Summerville","Sunnyvale","Sunrise","Sunrise Manor","Surprise","Syracuse","Tacoma","Tallahassee","Tamarac","Tamiami","Tampa","Taunton","Taylor","Taylorsville","Temecula","Tempe","Temple","Terre Haute","Texas City","The Hammocks","The Villages","The Woodlands","Thornton","Thousand Oaks","Tigard","Tinley Park","Titusville","Toledo","Toms River","Tonawanda","Topeka","Torrance","Town 'n' Country","Towson","Tracy","Trenton","Troy","Trujillo Alto","Tuckahoe","Tucson","Tulare","Tulsa","Turlock","Tuscaloosa","Tustin","Twin Falls","Tyler","Union City","University","Upland","Urbana","Urbandale","Utica","Vacaville","Valdosta","Vallejo","Vancouver","Victoria","Victorville","Vineland","Virginia Beach","Visalia","Vista","Waco","Waipahu","Waldorf","Walnut Creek","Waltham","Warner Robins","Warren","Warwick","Was
847hington","Waterbury","Waterloo","Watsonville","Waukegan","Waukesha","Wauwatosa","Wellington","Wesley Chapel","West Allis","West Babylon","West Covina","West Des Moines","West Hartford","West Haven","West Jordan","West Lafayette","West New York","West Palm Beach","West Sacramento","West Seneca","West Valley City","Westfield","Westland","Westminster","Weston","Weymouth Town","Wheaton","White Plains","Whittier","Wichita","Wichita Falls","Wilmington","Wilson","Winston-Salem","Woodbury","Woodland","Worcester","Wylie","Wyoming","Yakima","Yonkers","Yorba Linda","York","Youngstown","Yuba City","Yucaipa","Yuma"],Koe=["{{location.city_prefix}} {{person.first_name.generic}}{{location.city_suffix}}","{{location.city_prefix}} {{person.first_name.generic}}","{{person.first_name.generic}}{{location.city_suffix}}","{{person.last_name.generic}}{{location.city_suffix}}","{{location.city_name}}"],Joe=["North","East","West","South","New","Lake","Port","Fort"],Yoe=["town","ton","land","ville","berg","burgh","boro","borough","bury","view","port","mouth","stad","stead","furt","chester","cester","fort","field","haven","side","shire","worth"],Zoe=["Africa","Antarctica","Asia","Australia","Europe","North America","South America"],Xoe=["Afghanistan","Aland Islands","Albania","Algeria","American Samoa","Andorra","Angola","Anguilla","Antarctica","Antigua and Barbuda","Argentina","Armenia","Aruba","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bonaire, Sint Eustatius and Saba","Bosnia and Herzegovina","Botswana","Bouvet Island","Brazil","British Indian Ocean Territory (Chagos Archipelago)","Brunei Darussalam","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Cayman Islands","Central African Republic","Chad","Chile","China","Christmas Island","Cocos (Keeling) Islands","Colombia","Comoros","Congo","Cook Islands","Costa Rica","Cote d'Ivoire","Croatia","Cuba","Curacao","Cyprus","Czechia","Democratic Republic of the Congo","Denmark","Djibouti","Dominica","Dominican Republic","Ecuador","Egypt","El Salvador","Equatorial Guinea","Eritrea","Estonia","Eswatini","Ethiopia","Faroe Islands","Falkland Islands (Malvinas)","Fiji","Finland","France","French Guiana","French Polynesia","French Southern Territories","Gabon","Gambia","Georgia","Germany","Ghana","Gibraltar","Greece","Greenland","Grenada","Guadeloupe","Guam","Guatemala","Guernsey","Guinea","Guinea-Bissau","Guyana","Haiti","Heard Island and McDonald Islands","Holy See (Vatican City State)","Honduras","Hong Kong","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Isle of Man","Israel","Italy","Jamaica","Japan","Jersey","Jordan","Kazakhstan","Kenya","Kiribati","Democratic People's Republic of Korea","Republic of Korea","Kuwait","Kyrgyz Republic","Lao People's Democratic Republic","Latvia","Lebanon","Lesotho","Liberia","Libyan Arab Jamahiriya","Liechtenstein","Lithuania","Luxembourg","Macao","Madagascar","Malawi","Malaysia","Maldives","Mali","Malta","Marshall Islands","Martinique","Mauritania","Mauritius","Mayotte","Mexico","Micronesia","Moldova","Monaco","Mongolia","Montenegro","Montserrat","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepal","Netherlands","New Caledonia","New Zealand","Nicaragua","Niger","Nigeria","Niue","Norfolk Island","North Macedonia","Northern Mariana Islands","Norway","Oman","Pakistan","Palau","Palestine","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Pitcairn Islands","Poland","Portugal","Puerto Rico","Qatar","Reunion","Romania","Russian Federation","Rwanda","Saint Barthelemy","Saint Helena","Saint Kitts and Nevis","Saint Lucia","Saint Martin","Saint Pierre and Miquelon","Saint Vincent and the Grenadines","Samoa","San Marino","Sao Tome and Principe","Saudi Arabia","Senegal","Serbia","Seychelles","Sierra Leone","Singapore","Sint Maarten","Slovakia","Slovenia","Solomon Islands","Somalia","South Africa","South Georgia and the South Sandwich Islands","South Sudan","Spain","Sri Lanka","Sudan","Suriname","Svalbard & Jan Mayen Islands","Sweden","Switzerland","Syrian Arab Republic","Taiwan","Tajikistan","Tanzania","Thailand","Timor-Leste","Togo","Tokelau","Tonga","Trinidad and Tobago","Tunisia","Turkey","Turkmenistan","Turks and Caicos Islands","Tuvalu","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States of America","United States Minor Outlying Islands","Uruguay","Uzbekistan","Vanuatu","Venezuela","Vietnam","Virgin Islands, British","Virgin Islands, U.S.","Wallis and Futuna","Western Sahara","Yemen","Zambia","Zimbabwe"],Qoe=["Adams County","Calhoun County","Carroll County","Clark County","Clay County","Crawford County","Douglas County","Fayette County","Franklin County","Grant County","Greene County","Hamilton County","Hancock County","Henry County","Jackson County","Jefferson County","Johnson County","Lake County","Lawrence County","Lee County","Lincoln County","Logan County","Madison County","Marion County","Marshall County","Monroe C
847ounty","Montgomery County","Morgan County","Perry County","Pike County","Polk County","Scott County","Union County","Warren County","Washington County","Wayne County","Avon","Bedfordshire","Berkshire","Borders","Buckinghamshire","Cambridgeshire","Central","Cheshire","Cleveland","Clwyd","Cornwall","County Antrim","County Armagh","County Down","County Fermanagh","County Londonderry","County Tyrone","Cumbria","Derbyshire","Devon","Dorset","Dumfries and Galloway","Durham","Dyfed","East Sussex","Essex","Fife","Gloucestershire","Grampian","Greater Manchester","Gwent","Gwynedd County","Hampshire","Herefordshire","Hertfordshire","Highlands and Islands","Humberside","Isle of Wight","Kent","Lancashire","Leicestershire","Lincolnshire","Lothian","Merseyside","Mid Glamorgan","Norfolk","North Yorkshire","Northamptonshire","Northumberland","Nottinghamshire","Oxfordshire","Powys","Rutland","Shropshire","Somerset","South Glamorgan","South Yorkshire","Staffordshire","Strathclyde","Suffolk","Surrey","Tayside","Tyne and Wear","Warwickshire","West Glamorgan","West Midlands","West Sussex","West Yorkshire","Wiltshire","Worcestershire"],ele={cardinal:["North","East","South","West"],cardinal_abbr:["N","E","S","W"],ordinal:["Northeast","Northwest","Southeast","Southwest"],ordinal_abbr:["NE","NW","SE","SW"]},tle=[{name:"Afrikaans",alpha2:"af",alpha3:"afr"},{name:"Azerbaijani",alpha2:"az",alpha3:"aze"},{name:"Maldivian",alpha2:"dv",alpha3:"div"},{name:"Farsi/Persian",alpha2:"fa",alpha3:"fas"},{name:"Latvian",alpha2:"lv",alpha3:"lav"},{name:"Indonesian",alpha2:"id",alpha3:"ind"},{name:"Nepali",alpha2:"ne",alpha3:"nep"},{name:"Thai",alpha2:"th",alpha3:"tha"},{name:"Uzbek",alpha2:"uz",alpha3:"uzb"},{name:"Yoruba",alpha2:"yo",alpha3:"yor"},{name:"Pashto",alpha2:"ps",alpha3:"pus"},{name:"English",alpha2:"en",alpha3:"eng"},{name:"Urdu",alpha2:"ur",alpha3:"urd"},{name:"German",alpha2:"de",alpha3:"deu"},{name:"French",alpha2:"fr",alpha3:"fra"},{name:"Spanish",alpha2:"es",alpha3:"spa"},{name:"Italian",alpha2:"it",alpha3:"ita"},{name:"Dutch",alpha2:"nl",alpha3:"nld"},{name:"Russian",alpha2:"ru",alpha3:"rus"},{name:"Portuguese",alpha2:"pt",alpha3:"por"},{name:"Polish",alpha2:"pl",alpha3:"pol"},{name:"Arabic",alpha2:"ar",alpha3:"ara"},{name:"Japanese",alpha2:"ja",alpha3:"jpn"},{name:"Chinese",alpha2:"zh",alpha3:"zho"},{name:"Hindi",alpha2:"hi",alpha3:"hin"},{name:"Bengali",alpha2:"bn",alpha3:"ben"},{name:"Gujarati",alpha2:"gu",alpha3:"guj"},{name:"Tamil",alpha2:"ta",alpha3:"tam"},{name:"Telugu",alpha2:"te",alpha3:"tel"},{name:"Punjabi",alpha2:"pa",alpha3:"pan"},{name:"Vietnamese",alpha2:"vi",alpha3:"vie"},{name:"Korean",alpha2:"ko",alpha3:"kor"},{name:"Turkish",alpha2:"tr",alpha3:"tur"},{name:"Swedish",alpha2:"sv",alpha3:"swe"},{name:"Greek",alpha2:"el",alpha3:"ell"},{name:"Czech",alpha2:"cs",alpha3:"ces"},{name:"Hungarian",alpha2:"hu",alpha3:"hun"},{name:"Romanian",alpha2:"ro",alpha3:"ron"},{name:"Ukrainian",alpha2:"uk",alpha3:"ukr"},{name:"Norwegian",alpha2:"no",alpha3:"nor"},{name:"Serbian",alpha2:"sr",alpha3:"srp"},{name:"Croatian",alpha2:"hr",alpha3:"hrv"},{name:"Slovak",alpha2:"sk",alpha3:"slk"},{name:"Slovenian",alpha2:"sl",alpha3:"slv"},{name:"Icelandic",alpha2:"is",alpha3:"isl"},{name:"Finnish",alpha2:"fi",alpha3:"fin"},{name:"Danish",alpha2:"da",alpha3:"dan"},{name:"Swahili",alpha2:"sw",alpha3:"swa"},{name:"Bashkir",alpha2:"ba",alpha3:"bak"},{name:"Basque",alpha2:"eu",alpha3:"eus"},{name:"Catalan",alpha2:"ca",alpha3:"cat"},{name:"Galician",alpha2:"gl",alpha3:"glg"},{name:"Esperanto",alpha2:"eo",alpha3:"epo"},{name:"Fijian",alpha2:"fj",alpha3:"fij"},{name:"Malagasy",alpha2:"mg",alpha3:"mlg"},{name:"Maltese",alpha2:"mt",alpha3:"mlt"},{name:"Albanian",alpha2:"sq",alpha3:"sqi"},{name:"Armenian",alpha2:"hy",alpha3:"hye"},{name:"Georgian",alpha2:"ka",alpha3:"kat"},{name:"Macedonian",alpha2:"mk",alpha3:"mkd"},{name:"Kazakh",alpha2:"kk",alpha3:"kaz"},{name:"Haitian Creole",alpha2:"ht",alpha3:"hat"},{name:"Mongolian",alpha2:"mn",alpha3:"mon"},{name:"Kyrgyz",alpha2:"ky",alpha3:"kir"},{name:"Finnish",alpha2:"fi",alpha3:"fin"},{name:"Tagalog",alpha2:"tl",alpha3:"tgl"},{name:"Malay",alpha2:"ms",alpha3:"msa"},{name:"Tajik",alpha2:"tg",alpha3:"tgk"},{name:"Swati",alpha2:"ss",alpha3:"ssw"},{name:"Tatar",alpha2:"tt",alpha3:"tat"},{name:"Zulu",alpha2:"zu",alpha3:"zul"}],rle=["#####","#####-####"],sle=["Apt. ###","Suite ###"],nle=["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","N
847orth Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"],ale=["AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"],ile={normal:"{{location.buildingNumber}} {{location.street}}",full:"{{location.buildingNumber}} {{location.street}} {{location.secondaryAddress}}"},ole=["10th Street","11th Street","12th Street","13th Street","14th Street","15th Street","16th Street","1st Avenue","1st Street","2nd Avenue","2nd Street","3rd Avenue","3rd Street","4th Avenue","4th Street","5th Avenue","5th Street","6th Avenue","6th Street","7th Avenue","7th Street","8th Avenue","8th Street","9th Street","A Street","Abbey Road","Adams Avenue","Adams Street","Airport Road","Albany Road","Albert Road","Albion Street","Alexandra Road","Alfred Street","Alma Street","Ash Close","Ash Grove","Ash Road","Ash Street","Aspen Close","Atlantic Avenue","Avenue Road","Back Lane","Baker Street","Balmoral Road","Barn Close","Barton Road","Bath Road","Bath Street","Bay Street","Beach Road","Bedford Road","Beech Close","Beech Drive","Beech Grove","Beech Road","Beechwood Avenue","Bell Lane","Belmont Road","Birch Avenue","Birch Close","Birch Grove","Birch Road","Blind Lane","Bluebell Close","Boundary Road","Bramble Close","Bramley Close","Bridge Road","Bridge Street","Broad Lane","Broad Street","Broadway","Broadway Avenue","Broadway Street","Brook Lane","Brook Road","Brook Street","Brookside","Buckingham Road","Cambridge Street","Canal Street","Castle Close","Castle Lane","Castle Road","Castle Street","Cavendish Road","Cedar Avenue","Cedar Close","Cedar Grove","Cedar Road","Cedar Street","Cemetery Road","Center Avenue","Center Road","Center Street","Central Avenue","Central Street","Chapel Close","Chapel Hill","Chapel Road","Chapel Street","Charles Street","Cherry Close","Cherry Street","Cherry Tree Close","Chester Road","Chestnut Close","Chestnut Drive","Chestnut Grove","Chestnut Street","Church Avenue","Church Close","Church Hill","Church Lane","Church Path","Church Road","Church Street","Church View","Church Walk","Claremont Road","Clarence Road","Clarence Street","Clarendon Road","Clark Street","Clay Lane","Cleveland Street","Cliff Road","Clifton Road","Clinton Street","College Avenue","College Street","Columbia Avenue","Commerce Street","Commercial Road","Commercial Street","Common Lane","Coronation Avenue","Coronation Road","County Line Road","County Road","Court Street","Cow Lane","Crescent Road","Cromwell Road","Cross Lane","Cross Street","Crown Street","Cumberland Street","Dale Street","Dark Lane","Davis Street","Depot Street","Derby Road","Derwent Close","Devonshire Road","Division Street","Douglas Road","Duke Street","E 10th Street","E 11th Street","E 12th Street","E 14th Street","E 1st Street","E 2nd Street","E 3rd Street","E 4th Avenue","E 4th Street","E 5th Street","E 6th Avenue","E 6th Street","E 7th Street","E 8th Street","E 9th Street","E Bridge Street","E Broad Street","E Broadway","E Broadway Street","E Cedar Street","E Center Street","E Central Avenue","E Church Street","E Elm Street","E Franklin Street","E Front Street","E Grand Avenue","E High Street","E Jackson Street","E Jefferson Street","E Main","E Main Street","E Maple Street","E Market Street","E North Street","E Oak Street","E Park Avenue","E Pine Street","E River Road","E South Street","E State Street","E Union Street","E Walnut Street","E Washington Avenue","E Washington Street","E Water Street","East Avenue","East Road","East Street","Edward Street","Elm Close","Elm Grove","Elm Road","Elm Street","Euclid Avenue","Fairfield Road","Farm Close","Ferry Road","Field Close","Field Lane","First Avenue","First Street","Fore Street","Forest Avenue","Forest Road","Fourth Avenue","Franklin Avenue","Franklin Road","Franklin Street","Front Street","Frontage Road","Garden Close","Garden Street","George Street","Gladstone Road","Glebe Close","Gloucester Road","Gordon Road","Gordon Street","Grand Avenue","Grange Avenue","Grange Close","Grange Road","Grant Street","Green Close","Green Lane","Green Street","Greenville Road","Greenway","Greenwood Road","Grove Lane","Grove Road","Grove Street","Hall Lane","Hall Street","Harrison Avenue","Harrison Street","Hawthorn Avenue","Hawthorn Close","Hazel Close","Hazel Grove","Heath Road","Heather Close","Henry Street","Heron Close","Hickory Street","High Road","High Street","Highfield Avenue","Highfield Close","Highfield Road","Highland Avenue","Hill Road","Hill Street","Hillside","Hillside Avenue","Hillside Close","Hillside Road","Holly Close","Honeysuckle Close","Howard Road","Howard Street","Jackson Avenue","Jackson Street","James Street","Jefferson Avenue","Jefferson Street","Johnson Street","Jubilee Close","Juniper Close","Kent Road","Kestrel Close","King Street","King's Road","Kingfisher Close","Kings Highway","Kingsway","Laburnum Grove","Lafayette Street","Lake Avenue","Lake Drive","Lake Road","Lake Street","Lancaster Road","Lansdowne Road","Larch Close","Laurel Close","Lawrence Street","Lee Street","Liberty Street","Lime Grove","Lincoln Avenue","Lincoln Highway","Lincoln Road","Lincoln Street","Locust Street","Lodge Close","Lodge Lane","London Road","Long Lane","Low Road","Madison Avenue","Madison Street","Main","Main Avenue","Main Road","Main Street","Main Street E","Main Street N","Main Street S","Main Street W","Manchester Road","Manor Close","Manor Drive","Manor Gardens","Manor Road","Manor Way","Maple Avenue","Maple Close","Maple Drive","Maple Road","Maple Street","Market Place","Market Square","Market Street","Marlborough Road","Marsh Lane","Martin Luther King Boulevard","Martin Luther King Drive","Martin Luther King Jr Boulevard","Mary Street","Mayfield Road","Meadow Close","Meadow Drive","Meadow Lane","Meadow View","Meadow Way","Memorial Drive","Middle Street","Mill Close","Mill Lane","Mill Road","Mill Street","Milton Road","Milton Street","Monroe Street","Moor Lane","Moss Lane","Mount Pleasant","Mount Street","Mulberry Street","N 1st Street","N 2nd Street","N 3rd Street","N 4th Street","N 5th Street","N 6th Street","N 7th Street","N 8th Street","N 9th Street","N Bridge Street","N Broad Street","N Broadway","N Broadway Street","N Cedar Street","N Center Street","N Central Avenue","N Chestnut Street","N Church Street","N College Street","N Court Street","N Division Street","N East Street","N Elm Street","N Franklin Street","N Front Street","N Harrison Street","N High Street","N Jackson Street","N Jefferson Street","N Lincoln Street","N Locust Street","N Main","N Main Avenue","N Main Street","N Maple Street","N Market Street","N Monroe Street","N Oak Street","N Park Street","N Pearl Street","N Pine Street","N Poplar Street","N Railroad Street","N State Street","N Union Street","N Walnut Street","N Washington Avenue","N Washington Street","N Water Street","Nelson Road","Nelson Street","New L
847ane","New Road","New Street","Newton Road","Nightingale Close","Norfolk Road","North Avenue","North Lane","North Road","North Street","Northfield Road","Oak Avenue","Oak Drive","Oak Lane","Oak Road","Oak Street","Oakfield Road","Oaklands","Old Lane","Old Military Road","Old Road","Old State Road","Orchard Drive","Orchard Lane","Orchard Road","Orchard Street","Oxford Road","Oxford Street","Park Avenue","Park Crescent","Park Drive","Park Lane","Park Place","Park Road","Park Street","Park View","Parkside","Pearl Street","Pennsylvania Avenue","Pine Close","Pine Grove","Pine Street","Pinfold Lane","Pleasant Street","Poplar Avenue","Poplar Close","Poplar Road","Poplar Street","Post Road","Pound Lane","Princes Street","Princess Street","Priory Close","Priory Road","Prospect Avenue","Prospect Place","Prospect Road","Prospect Street","Quarry Lane","Quarry Road","Queen's Road","Railroad Avenue","Railroad Street","Railway Street","Rectory Close","Rectory Lane","Richmond Close","Richmond Road","Ridge Road","River Road","River Street","Riverside","Riverside Avenue","Riverside Drive","Roman Road","Roman Way","Rowan Close","Russell Street","S 10th Street","S 14th Street","S 1st Avenue","S 1st Street","S 2nd Street","S 3rd Street","S 4th Street","S 5th Street","S 6th Street","S 7th Street","S 8th Street","S 9th Street","S Bridge Street","S Broad Street","S Broadway","S Broadway Street","S Center Street","S Central Avenue","S Chestnut Street","S Church Street","S College Street","S Division Street","S East Street","S Elm Street","S Franklin Street","S Front Street","S Grand Avenue","S High Street","S Jackson Street","S Jefferson Street","S Lincoln Street","S Main","S Main Avenue","S Main Street","S Maple Street","S Market Street","S Mill Street","S Monroe Street","S Oak Street","S Park Street","S Pine Street","S Railroad Street","S State Street","S Union Street","S Walnut Street","S Washington Avenue","S Washington Street","S Water Street","S West Street","Salisbury Road","Sandringham Road","Sandy Lane","School Close","School Lane","School Road","School Street","Second Avenue","Silver Street","Skyline Drive","Smith Street","Somerset Road","South Avenue","South Drive","South Road","South Street","South View","Spring Gardens","Spring Street","Springfield Close","Springfield Road","Spruce Street","St Andrew's Road","St Andrews Close","St George's Road","St John's Road","St Mary's Close","St Mary's Road","Stanley Road","Stanley Street","State Avenue","State Line Road","State Road","State Street","Station Road","Station Street","Stoney Lane","Sycamore Avenue","Sycamore Close","Sycamore Drive","Sycamore Street","Talbot Road","Tennyson Road","The Avenue","The Beeches","The Causeway","The Chase","The Coppice","The Copse","The Crescent","The Croft","The Dell","The Drive","The Fairway","The Glebe","The Grange","The Green","The Grove","The Hawthorns","The Lane","The Laurels","The Limes","The Maltings","The Meadows","The Mews","The Mount","The Oaks","The Orchard","The Oval","The Paddock","The Paddocks","The Poplars","The Ridgeway","The Ridings","The Rise","The Sidings","The Spinney","The Square","The Willows","The Woodlands","Third Avenue","Third Street","Tower Road","Trinity Road","Tudor Close","Union Avenue","Union Street","University Avenue","University Drive","Valley Road","Veterans Memorial Drive","Veterans Memorial Highway","Vicarage Close","Vicarage Lane","Vicarage Road","Victoria Place","Victoria Road","Victoria Street","Vine Street","W 10th Street","W 11th Street","W 12th Street","W 14th Street","W 1st Street","W 2nd Street","W 3rd Street","W 4th Avenue","W 4th Street","W 5th Street","W 6th Avenue","W 6th Street","W 7th Street","W 8th Street","W 9th Street","W Bridge Street","W Broad Street","W Broadway","W Broadway Avenue","W Broadway Street","W Center Street","W Central Avenue","W Chestnut Street","W Church Street","W Division Street","W Elm Street","W Franklin Street","W Front Street","W Grand Avenue","W High Street","W Jackson Street","W Jefferson Street","W Lake Street","W Main","W Main Street","W Maple Street","W Market Street","W Monroe Street","W North Street","W Oak Street","W Park Street","W Pine Street","W River Road","W South Street","W State Street","W Union Street","W Walnut Street","W Washington Avenue","W Washington Street","Walnut Close","Walnut Street","Warren Close","Warren Road","Washington Avenue","Washington Boulevard","Was
847hington Road","Washington Street","Water Lane","Water Street","Waterloo Road","Waterside","Watery Lane","Waverley Road","Well Lane","Wellington Road","Wellington Street","West Avenue","West End","West Lane","West Road","West Street","West View","Western Avenue","Western Road","Westfield Road","Westgate","William Street","Willow Close","Willow Drive","Willow Grove","Willow Road","Willow Street","Windermere Road","Windmill Close","Windmill Lane","Windsor Avenue","Windsor Close","Windsor Drive","Wood Lane","Wood Street","Woodland Close","Woodland Road","Woodlands","Woodlands Avenue","Woodlands Close","Woodlands Road","Woodside","Woodside Road","Wren Close","Yew Tree Close","York Road","York Street"],lle=["{{person.first_name.generic}} {{location.street_suffix}}","{{person.last_name.generic}} {{location.street_suffix}}","{{location.street_name}}"],cle=["Alley","Avenue","Branch","Bridge","Brook","Brooks","Burg","Burgs","Bypass","Camp","Canyon","Cape","Causeway","Center","Centers","Circle","Circles","Cliff","Cliffs","Club","Common","Corner","Corners","Course","Court","Courts","Cove","Coves","Creek","Crescent","Crest","Crossing","Crossroad","Curve","Dale","Dam","Divide","Drive","Drives","Estate","Estates","Expressway","Extension","Extensions","Fall","Falls","Ferry","Field","Fields","Flat","Flats","Ford","Fords","Forest","Forge","Forges","Fork","Forks","Fort","Freeway","Garden","Gardens","Gateway","Glen","Glens","Green","Greens","Grove","Groves","Harbor","Harbors","Haven","Heights","Highway","Hill","Hills","Hollow","Inlet","Island","Islands","Isle","Junction","Junctions","Key","Keys","Knoll","Knolls","Lake","Lakes","Land","Landing","Lane","Light","Lights","Loaf","Lock","Locks","Lodge","Loop","Mall","Manor","Manors","Meadow","Meadows","Mews","Mill","Mills","Mission","Motorway","Mount","Mountain","Mountains","Neck","Orchard","Oval","Overpass","Park","Parks","Parkway","Parkways","Pass","Passage","Path","Pike","Pine","Pines","Place","Plain","Plains","Plaza","Point","Points","Port","Ports","Prairie","Radial","Ramp","Ranch","Rapid","Rapids","Rest","Ridge","Ridges","River","Road","Roads","Route","Row","Rue","Run","Shoal","Shoals","Shore","Shores","Skyway","Spring","Springs","Spur","Spurs","Square","Squares","Station","Stravenue","Stream","Street","Streets","Summit","Terrace","Throughway","Trace","Track","Trafficway","Trail","Tunnel","Turnpike","Underpass","Union","Unions","Valley","Valleys","Via","Viaduct","View","Views","Village","Villages","Ville","Vista","Walk","Walks","Wall","Way","Ways","Well","Wells"],ule={building_number:Goe,city_name:Voe,city_pattern:Koe,city_prefix:Joe,city_suffix:Yoe,continent:Zoe,country:Xoe,county:Qoe,direction:ele,language:tle,postcode:rle,secondary_address:sle,state:nle,state_abbr:ale,street_address:ile,street_name:ole,street_pattern:lle,street_suffix:cle},dle=ule,hle=["a","ab","abbas","abduco","abeo","abscido","absconditus","absens","absorbeo","absque","abstergo","absum","abundans","abutor","accedo","accendo","acceptus","accommodo","accusamus","accusantium","accusator","acer","acerbitas","acervus","acidus","acies","acquiro","acsi","ad","adamo","adaugeo","addo","adduco","ademptio","adeo","adeptio","adfectus","adfero","adficio","adflicto","adhaero","adhuc","adicio","adimpleo","adinventitias","adipisci","adipiscor","adiuvo","administratio","admiratio","admitto","admoneo","admoveo","adnuo","adopto","adsidue","adstringo","adsuesco","adsum","adulatio","adulescens","aduro","advenio","adversus","advoco","aedificium","aeger","aegre","aegrotatio","aegrus","aeneus","aequitas","aequus","aer","aestas","aestivus","aestus","aetas","aeternus","ager","aggero","aggredior","agnitio","agnosco","ago","ait","aiunt","alias","alienus","alii","alioqui","aliqua","aliquam","aliquid","alius","allatus","alo","alter","altus","alveus","amaritudo","ambitus","ambulo","amet","amicitia","amiculum","amissio","amita","amitto","amo","amor","amoveo","amplexus","amplitudo","amplus","ancilla","angelus","angulus","angustus","animadverto","animi","animus","annus","anser","ante","antea","antepono","antiquus","aperiam","aperio","aperte","apostolus","apparatus","appello","appono","appositus","approbo","apto","aptus","apud","aqua","ara","aranea","arbitro","arbor","arbustum","arca","arceo","arcesso","architecto","arcus","argentum","argumentum","arguo","arma","armarium","aro","ars","articulus","artificiose","arto","arx","ascisco","ascit","asper","asperiores","aspernatur","aspicio","asporto","assentator","assumenda","astrum","at","atavus","ater","atque","atqui","atrocitas","atrox","attero","attollo","attonbitus","auctor","auctus","audacia","audax","audentia","audeo","audio","auditor","aufero","aureus","aurum","aut","autem","autus","auxilium","avaritia","avarus","aveho","averto","baiulus","balbus","barba","bardus","basium","beatae","beatus","bellicus","bellum","bene","beneficium","benevolentia","benigne","bestia","bibo","bis","blandior","blanditiis","bonus","bos","brevis","cado","caecus","caelestis","caelum","calamitas","calcar","calco","calculus","callide","campana","candidus","canis","canonicus","canto","capillus","capio","capitulus","capto","caput","carbo","carcer","careo","caries","cariosus","caritas","carmen","carpo","carus","casso","caste","casus","catena","caterva","cattus","cauda","causa","caute","caveo","cavus","cedo","celebrer","celer","celo","cena","cenaculum","ceno","censura","centum","cerno","cernuus","certe","certus","cervus","cetera","charisma","chirographum","cibo","cibus","cicuta","cilicium","cimentarius","ciminatio","cinis","circumvenio","cito","civis","civitas","clam","clamo","claro","clarus","claudeo","claustrum","clementia","clibanus","coadunatio","coaegresco","coepi","coerceo","cogito","cognatus","cognomen","cogo","cohaero","cohibeo","cohors","colligo","collum","colo","color","coma","combibo","comburo","comedo","comes","cometes","comis","comitatus","commemoro","comminor","commodi","commodo","communis","comparo","compello","complectus","compono","comprehendo","comptus","conatus","concedo","concido","conculco","condico","conduco","confero","confido","conforto","confugo","congregatio","conicio","coniecto","conitor","coniuratio","conor","conqueror","conscendo","consectetur","consequatur","consequuntur","conservo","considero","conspergo","constans","consuasor","contabesco","contego","contigo","contra","conturbo","conventus","convoco","copia","copiose","cornu","corona","corporis","corpus","correptius","corrigo","corroboro","corrumpo","corrupti","coruscus","cotidie","crapula","cras","crastinus","creator","creber","crebro","credo","creo","creptio","crepusculum","cresco","creta","cribro","crinis","cruciamentum","crudelis","cruentus","crur","crustulum","crux","cubicularis","cubitum","cubo","cui","cuius","culpa","culpo","cultellus","cultura","cum","cumque","cunabula","cunae","cunctatio","cupiditas","cupiditate","cupio","cuppedia","cupressus","cur","cura","curatio","curia","curiositas","curis","curo","curriculum","currus","cursim","curso","cursus","curto","curtus","curvo","custodia","damn
847atio","damno","dapifer","debeo","debilito","debitis","decens","decerno","decet","decimus","decipio","decor","decretum","decumbo","dedecor","dedico","deduco","defaeco","defendo","defero","defessus","defetiscor","deficio","defleo","defluo","defungo","degenero","degero","degusto","deinde","delectatio","delectus","delego","deleniti","deleo","delibero","delicate","delinquo","deludo","demens","demergo","demitto","demo","demonstro","demoror","demulceo","demum","denego","denique","dens","denuncio","denuo","deorsum","depereo","depono","depopulo","deporto","depraedor","deprecator","deprimo","depromo","depulso","deputo","derelinquo","derideo","deripio","deserunt","desidero","desino","desipio","desolo","desparatus","despecto","dicta","dignissimos","distinctio","dolor","dolore","dolorem","doloremque","dolores","doloribus","dolorum","ducimus","ea","eaque","earum","eius","eligendi","enim","eos","error","esse","est","et","eum","eveniet","ex","excepturi","exercitationem","expedita","explicabo","facere","facilis","fuga","fugiat","fugit","harum","hic","id","illo","illum","impedit","in","incidunt","infit","inflammatio","inventore","ipsa","ipsam","ipsum","iste","itaque","iure","iusto","labore","laboriosam","laborum","laudantium","libero","magnam","magni","maiores","maxime","minima","minus","modi","molestiae","molestias","mollitia","nam","natus","necessitatibus","nemo","neque","nesciunt","nihil","nisi","nobis","non","nostrum","nulla","numquam","occaecati","ocer","odio","odit","officia","officiis","omnis","optio","paens","pariatur","patior","patria","patrocinor","patruus","pauci","paulatim","pauper","pax","peccatus","pecco","pecto","pectus","pecus","peior","pel","perferendis","perspiciatis","placeat","porro","possimus","praesentium","provident","quae","quaerat","quam","quas","quasi","qui","quia","quibusdam","quidem","quis","quisquam","quo","quod","quos","ratione","recusandae","reiciendis","rem","repellat","repellendus","reprehenderit","repudiandae","rerum","saepe","sapiente","sed","sequi","similique","sint","sit","socius","sodalitas","sol","soleo","solio","solitudo","solium","sollers","sollicito","solum","solus","soluta","solutio","solvo","somniculosus","somnus","sonitus","sono","sophismata","sopor","sordeo","sortitus","spargo","speciosus","spectaculum","speculum","sperno","spero","spes","spiculum","spiritus","spoliatio","sponte","stabilis","statim","statua","stella","stillicidium","stipes","stips","sto","strenuus","strues","studio","stultus","suadeo","suasoria","sub","subito","subiungo","sublime","subnecto","subseco","substantia","subvenio","succedo","succurro","sufficio","suffoco","suffragium","suggero","sui","sulum","sum","summa","summisse","summopere","sumo","sumptus","sunt","supellex","super","suppellex","supplanto","suppono","supra","surculus","surgo","sursum","suscipio","suscipit","suspendo","sustineo","suus","synagoga","tabella","tabernus","tabesco","tabgo","tabula","taceo","tactus","taedium","talio","talis","talus","tam","tamdiu","tamen","tametsi","tamisium","tamquam","tandem","tantillus","tantum","tardus","tego","temeritas","temperantia","templum","tempora","tempore","temporibus","temptatio","tempus","tenax","tendo","teneo","tener","tenetur","tenuis","tenus","tepesco","tepidus","ter","terebro","teres","terga","tergeo","tergiversatio","tergo","tergum","termes","terminatio","tero","terra","terreo","territo","terror","tersus","tertius","testimonium","texo","textilis","textor","textus","thalassinus","theatrum","theca","thema","theologus","thermae","thesaurus","thesis","thorax","thymbra","thymum","tibi","timidus","timor","titulus","tolero","tollo","tondeo","tonsor","torqueo","torrens","tot","totam","totidem","toties","totus","tracto","trado","traho","trans","tredecim","tremo","trepide","tres","tribuo","tricesimus","triduana","tripudio","tristis","triumphus","trucido","truculenter","tubineus","tui","tum","tumultus","tunc","turba","turbo","turpis","tutamen","tutis","tyrannus","uberrime","ubi","ulciscor","ullam","ullus","ulterius","ultio","ultra","umbra","umerus","umquam","una","unde","undique","universe","unus","urbanus","urbs","uredo","usitas","usque","ustilo","ustulo","usus","ut","uter","uterque","utilis","utique","utor","utpote","utrimque","utroque","utrum","uxor","vaco","vacuus","vado","vae","valde","valens","valeo","valetudo","validus","vallum","vapulus","varietas","varius","vehemens","vel","velit","velociter","velum","velut","venia","veniam","venio","ventito","ventosus","ventus","venustas","ver","verbera","verbum","vere","verecundia","vereor","vergo","veritas","veritatis","vero","versus","verto","verumtamen","verus","vesco","vesica","vesper","vespillo","vester","vestigium","vestrum","vetus","via","vicinus","vicissitudo","victoria","victus","videlicet","video","viduo","vigilo","vigor","vilicus","vilis","vilitas","villa","vinco","vinculum","vindico","vinitor","vinum","vir","virga","virgo","viridis","viriliter","virtus","vis","viscus","vita","vitae","vitiosus","vitium","vito","vivo","vix","vobis","vociferor","voco","volaticus","volo","volubilis","voluntarius","volup","voluptas","voluptate","voluptatem","voluptates","voluptatibus","voluptatum","volutabrum","volva","vomer","vomica","vomito","vorago","vorax","voro","vos","votum","voveo","vox","vulariter","vulgaris","vulgivagus","vulgo","vulgus","vulnero","vulnus","vulpes","vulticulus","xiphias"],mle={word:hle},fle=mle,ple={title:"English",code:"en",language:"en",endonym:"English",dir:"ltr",script:"Latn"},gle=ple,xle=['"Awaken, My Love!"',"(What's The Story) Morning Glory?","- Tragedy +","13 Reasons Why (Season 3)","21st Century Breakdown","30 De Febrero","432 Hz Deep Healing","5-Star","528 Hz Meditation Music","54+1","8 Mile","808s & Heartbreak","9 To 5 And Odd Jobs","A Beautiful Lie","A Day At The Races","A Day Without Rain","A Fever You Can't Sweat Out","A Gangsta's Pain","A Gift & A Curse","A Hard Day's Night","A Head Full Of Dreams","A Kind Of Magic","A Million Ways To Murder","A Moment Apart","A Song For Every Moon","A Thousand Suns","A Winter Romance","ABBA","AI You
847ngBoy","AJ Tracey","Act One","After Hours","Agent Provocateur","All About You","All I Know So Far: Setlist","All Or Nothing","All Out","All Over The Place","All Stand Together","All The Lost Souls","All The Things I Never Said","All Things Must Pass","Alleen","Alright, Still","Alta Suciedad","America","American Heartbreak","American Teen","And Justice For None","Animal Songs","Another Friday Night","Anything Goes","Ao Vivo Em São Paulo","Ao Vivo No Ibirapuera","Apricot Princess","Aqui E Agora (Ao Vivo)","Arcane League Of Legends","Ardipithecus","Aretha Now","Around The Fur","Arrival","Artist 2.0","As She Pleases","Ascend","Ashlyn","Astro Lounge","At Night, Alone.","At. Long. Last. ASAP","Atlas","Audioslave","Aura","Austin","Awake","Away From The Sun","Ayayay!","Baby On Baby","Back For Everything","Back From The Edge","Back In Black","Back To Black","Back To The Game","Bad","BahÃa Ducati","Baila","Barbie The Album","Battleground","Bayou Country","Bcos U Will Never B Free","Be","Be Here Now","Beautiful Mind","Beautiful Thugger Girls","Beautiful Trauma","Beauty And The Beast","Beggars Banquet","Being Funny In A Foreign Language","Berlin Lebt","Berry Is On Top","Best White Noise For Baby Sleep - Loopable With No Fade","Big Baby DRAM","Bigger, Better, Faster, More!","Billy Talent II","Black Star Elephant","Blackout","Blank Face LP","Bleach","Blizzard Of Ozz","Blonde","Blood Sugar Sex Magik","Bloom","Blowin' Your Mind!","Blu Celeste","Blue","Blue Banisters","Blue Hawaii","Blue Neighbourhood","Bluebird Days","Bobby Tarantino","Bobby Tarantino II","Bon Iver","Born Pink","Born To Run","Brand New Eyes","Break The Cycle","Breakfast In America","Breakthrough","Brett Young","Bridge Over Troubled Water","Bright: The Album","Brol","Buds","Buena Vista Social Club","Built On Glass","Bury Me At Makeout Creek","Busyhead","By The Way","CB6","CNCO","California Sunrise","Californication","Call Me Irresponsible","Calm","Camino Palmero","Camp","Caracal","Carbon Fiber Hits","Carnival","Carry On","Cartel De Santa","Certified Lover Boy","Chaaama","Chama Meu Nome","Chapter 1: Snake Oil","Chapter 2: Swamp Savant","Chapter One","Charlie's Angels","Cherry Bomb","Chief","Chocolate Factory","Chosen","Chris Brown","Christina Aguilera","Chromatica","Church","City Of Evil","Clandestino","Clouds","Coco","Collision Course","Colour Vision","Combat Rock","Come Around Sundown","Come Away With Me","Come Home The Kids Miss You","Come What(ever) May","Commando","Common Sense","Communion","Conditions","Confident","Confrontation","Control The Streets, Volume 2","Corinne Bailey Rae","Costello Music","Cottonwood","Covers, Vol. 2","Cozy Tapes Vol. 2: Too Cozy","Crash Talk","Crazy Love","Crazysexycool","Crowded House","Cruisin' With Junior H","Culture","Current Mood","DS2","Dale","Danger Days: The True Lives Of The Fabulous Killjoys","Dangerous Woman","Dangerous: The Double Album","Dark Horse","Day69","Daydream","De Fiesta","De Viaje","DeAnn","Death Race For Love","Delirium","Delta","Demidevil","Depression Cherry","Descendants","Desgenerados Mixtape","Destin","Destiny Fulfilled","Desvelado","Detroit 2","Dex Meets Dexter","Dharma","Die A Legend","Different World","Dig Your Roots","Digital Druglord","Dirt","Disclaimer I / II","Discovery","Disraeli Gears","Disumano","Dizzy Up The Girl","Don't Play That Song","Donda","Donde Quiero Estar","Doo-Wops & Hooligans","Down The Way","Dr. Feelgood","Dream Your Life Away","Dreaming Out Loud","Drip Harder","Drive","Drones","Dropped Outta College","Drowning","Dua Warna Cinta","Dulce Beat","Dusty In Memphis","Dutty Rock","Dying To Live","ENR","East Atlanta Love Letter","Editorial","Edna","El Abayarde","El Amor En Los Tiempos Del Perreo","El Camino","El Comienzo","El Dorado","El Karma","El Mal Querer","El Malo","El Trabajo Es La Suerte","El Viaje De Copperpot","Electric Ladyland","Emotion","En Tus Planes","Endless Summer Vacation","Enter The Wu-Tang (36 Chambers)","Equals (=)","Estrella","Euphoria","Europop","Evermore","Every Kingdom","Everyday Life","Evolve","Expectations","Face Yourself","Facelift","Fallin'","Fancy You","FantasÃa","Favourite Worst Nightmare","Fear Of The Dark","Fearless","Feel Something","Feels Like Home","Femme Fatale","Ferxxocalipsis","Fifty Shades Darker","Fifty Shades Freed","Fifty Shades Of Grey","Final (Vol.1)","Finding Beauty In Negative Spaces","Fine Line","First Impressions Of Earth","First Steps","Five Seconds Flat","Folklore","For Emma, Forever Ago","Forajido EP 1","Forever","Forever Young","Formula Of Love: O+T=<3","Free 6lack","Freudian","Frozen II","Full Moon Fever","Funhouse","Funk Wav Bounce
847s Vol.1","Future History","FutureSex/LoveSounds","Fuzzybrain","Gallery","Gangsta's Paradise","Gemini","Gemini Rights","Generationwhy","Get A Grip","Get Up","Gettin' Old","Girl","Gladiator","Glisten","Globalization","Gloria","Glory Days","God's Project","Gold Skies","Golden","Good Evening","Good Thing","Goodbye Yellow Brick Road","Gossip Columns","Got Your Six","Graceland","Graduation","Grand Champ","Grandson, Vol. 1","Green River","Guerra","Ha*Ash Primera Fila - Hecho Realidad","Haiz","Hamilton","Happy Endings","Harry Styles","Hasta La RaÃz","Hatful Of Hollow","Head In The Clouds","Heard It In A Past Life","Heart Shaped World","Heartbeat City","Heartbreak On A Full Moon / Cuffing Season - 12 Days Of Christmas","Heaven Or Hell","Heaven knows","Hellbilly Deluxe","Hellboy","Help!","Her Loss","Here Comes The Cowboy","Hey World","High School Musical","High Tide In The Snake's Nest","Historias De Un Capricornio","Hndrxx","Hombres G (Devuélveme A Mi Chica)","Homerun","Homework","Hot Fuss","Hot Pink","Hot Sauce / Hello Future","Hot Space","Hotel Diablo","Houses Of The Holy","How Big, How Blue, How Beautiful","How I'm Feeling","How To Be Human","How To Save A Life","How To: Friend, Love, Freefall","Hozier","Human","Huncho Jack, Jack Huncho","Hunter Hayes","Hysteria","I Am...Sasha Fierce","I Can't Handle Change","I Met You When I Was 18. (The Playlist)","I Never Liked You","I Never Loved A Man The Way I Love You","I See You","I Think You Think Too Much Of Me","I Used To Know Her","I Used To Think I Could Fly","I'm Comin' Over","Ich & Keine Maske","If You Can Believe Your Eyes & Ears","Il Ballo Della Vita","Ill Communication","Imagination & The Misfit Kid","Imagine","Immortalized","In A Perfect World...","In Colour","In My Own Words","In Rainbows","In Return","In The Lonely Hour","Infest","Innuendo","Inter Shibuya - La Mafia","Interstellar","Is This It","It Was Written","It's Not Me, It's You","It's Only Me","Ivory","JackBoys","Jamie","Jazz","Jibrail & Iblis","Jordi","Jordin Sparks","Jose","Just As I Am","Just Cause Y'all Waited 2","Just Like You","Justified","K-12 / After School","K.I.D.S.","K.O.","K.O.B. Live","KG0516","KOD","Kane Brown","Kid A","Kid Krow","Kids See Ghosts","Kids in Love","Kinks (You Really Got Me)","Know-It-All","Konvicted","Kring","LANY","LM5","La Criatura","La Flaca","La Melodia De La Calle","La Revolucion","Lady Lady","Lady Wood","Langit Mong Bughaw","Las Que No Iban A Salir","Last Day Of Summer","Last Year Was Complicated","Layers","Layover","Lazarus","Led Zeppelin","Left Of The Middle","Leftoverture","Legends Never Die","Let's Skip To The Wedding","Let's Talk About Love","Licensed To Ill","Life In Cartoon Motion","Life Thru A Lens","Lifelines","Like..?","Lil Big Pac","Lil Boat","Lil Boat 2","Lil Boat 3.5","Lil Kiwi","Lil Pump","Limon Y Sal","Listen Without Prejudice","Little Voice","Live On Red Barn Radio I & II","Lo Que Andábamos Buscando","Lofi Fruits Music 2021","London Calling","Los Campeones Del Pueblo","Los Extraterrestres","Los Favoritos 2","Lost","Lost In Love","Loud","Love Sick","Love Story","Love Stuff","Love Yourself: Tear","Lover","Luca Brasi 2: Gangsta Grillz","Lust For Life","Luv Is Rage","M!ssundaztood","Ma Fleur","Made In Lagos","Mafia Bidness","Magazines Or Novels","Mainstream Sellout","Majestic","Make It Big","Make Yourself","Making Mirrors","Mamma Mia! Here We Go Again","Man Of The Woods","Manic","Me And My Gang","Meduza","Meet The Orphans","Meet The Woo","Melim","Mellon Collie And The Infinite Sadness","Melly vs. Melvin","Memories...Do Not Open","Menagerie","Midnights","Minecraft - Volume Alpha","Minutes To Midnight","Mix Pa Llorar En Tu Cuarto","Modo Avión","Monkey Business","Mono.","Montana","Montevallo","Moosetape","Morning View","Motivan2","Moving Pictures","Mr. Davis","Mr. Misunderstood","Mulan","Mura Masa","Music From The Edge Of Heaven","Music Of The Sun","My House","My Kinda Party","My Krazy Life","My Liver Will Handle What My Heart Can't","My Moment","My Own Lane","My Turn","My Worlds","Na Praia (Ao Vivo)","Nakamura","Nation Of Two","Navegando","Need You Now","Neon Future III","Neotheater","Never Trust A Happy Song","New English","News Of The World","Nicole","Night & Day","Nimmerland","Nimrod","Nine Track Mind","No Angel","No Me Pidas Perdón","No More Drama","No Protection","No Strings Attached","No Time To Die","Nobody Is Listening","Non Stop Erotic Cabaret","Non-Fiction","Northsbest","Nostalgia","Nostalgia, Ultra","Notes On A Conditional Form","Now Or Never","O Embaixador (Ao Vivo)","O My Heart","OK Computer","Ocean","Ocean Avenue","Ocean Eyes","Odisea","Oh My My","Oh, What A Life","On The 6","One In A Million","One More Light","One Of These Nights","Open Up And Say...Ahh!","Ordinary Man","Origins","Out Of The Blue","Over It","OzuTochi","PTSD","Pa Las Baby's Y Belikeada","Pa Que Hablen","Pa' Luego Es Tarde","Pa' Otro La 'O","Pablo Honey","Pain Is Love","Pain Is Temporary","Painting Pictures","Palmen Aus Plastik 2","Para Mi Ex","Para Siempre","Partners In Crime","Pawn Shop","Pegasus / Neon Shark VS Pegasus","Pet Sounds","Piece By Piece","Pier Pressure","Pineapple Sunrise","Piseiro 2020 Ao Vivo","Planet Pit","Plans","Play Deep","Playa Saturno","Por Primera Vez","Por Vida","Positions","Post Human: Survival Horror","Poster Girl","Prazer, Eu Sou Ferrugem (Ao Vivo)","Pretty Girls Like Trap Music","Pretty. Odd.","Prince Royce","Prisma","Prometo","Providence","Puberty 2","Punisher","Purgatory","Purple Rain","Que Bendición","Queen Of The Clouds","Quiero Volver","R&G (Rhythm & Gangsta): The Masterpiece","Raise!","Ransom 2","Rapunzel","Rare","Re Mida","Ready To Die","Realer","Rebelde","Reclassified","Recovery","Recuerden Mi Estilo","Reggatta De Blanc","Regulate⦠G Funk Era","Reik","Reise, Reise","Relapse","Relaxing Piano Lullabies And Natural Sleep Aid For Baby Sleep Music","Religiously. The Album.","Replay","Results May Vary","Revenge","Revolve","Revolver","Ricky Martin","Rien 100 Rien","Ripcord","Rise And Fall, Rage And Grace","Rise Of An Empire","Robin Hood: Prince Of Thieves","Rock N Roll Jesus","Romance","Romances","Ronan","Royal Blood","Rumours","Sad Boyz 4 Life II","San Lucas","Santana World","Saturation III","Sauce Boyz","Savage Mode","Saxobeats","Scarlet","Schwarzes Herz","Seal The Deal & Let's Boogie","Section.80","Segundo Romance","Sehnsucht","Shake The Snow Globe","Shang-Chi And The Legend Of The Ten Rings: The Album","Sheer Heart Attack","Shiesty Season","Shock Value","Shoot For The Stars, Aim For The Moon","Signed Sealed And Delivered","Signos","Silent Alarm","Simplemente Gracias","Sin Bandera","Sing Me A Lullaby, My Sweet Temptation","Sinner","Sirio","Sit Still, Look Pretty","Skin","Slowhand","Smash","Smithereens","Snow Cougar","S
847ocial Cues","Some Girls","Song Hits From Holiday Inn","Songs For Dads","Songs For The Deaf","Songs For You, Truths For Me","Songs In The Key Of Life","Souled Out","Sounds Of Silence","Soy Como Quiero Ser","Speak Now","Speak Your Mind","Speakerboxxx/The Love Below","Spider-Man: Into The Spider-Verse","Split Decision","Square Up","SremmLife","Starboy","Stay +","Stay Dangerous","Staying At Tamara's","Steppenwolf","Stick Season","Still Bill","Straight Outta Compton","Strange Trails","Stronger","Suavemente","Sublime","Suck It and See","Sucker","Sueños","Sugar","Summer Forever","Summer,","Sunset Season","Sunshine On Leith","Surfer Rosa","Sweet Talker","SweetSexySavage","System Of A Down","TA13OO","Talk That Talk","Talking Heads: 77","Tangled Up","Tango In The Night","Taxi Driver","Taylor Swift","Tell Me It's Real","Ten","Ten Summoner's Tales","Terra Sem Cep (Ao Vivo)","Terral","Testing","Tha Carter III","Thank Me Later","That's Christmas To Me","The Academy","The Adventures Of Bobby Ray","The Album","The Andy Williams Christmas Album","The Aviary","The Balcony","The Battle Of Los Angeles","The Beatles (White Album)","The Beginning","The Better Life","The Big Day","The Book","The Breakfast Club","The Cars","The Colour And The Shape","The Death Of Peace Of Mind","The Diary Of Alicia Keys","The Documentary","The Emancipation Of Mimi","The Eminem Show","The End Of Everything","The Final Countdown","The Forever Story","The Foundation","The Goat","The Golden Child","The Good Parts","The Greatest Showman: Reimagined","The Green Trip","The Hardest Love","The Head And The Heart","The Human Condition","The Infamous","The Lady Killer","The Last Don II","The Lion King","The Lockdown Sessions","The London Sessions","The Lord Of The Rings: The Fellowship Of The Ring","The Lost Boy","The Magic Of Christmas / The Christmas Song","The Marshall Mathers LP","The Martin Garrix Collection","The Melodic Blue","The Mockingbird & The Crow","The Pains Of Growing","The Papercut Chronicles","The Perfect Luv Tape","The Pinkprint","The Predator","The Queen Is Dead","The ReVe Festival: Finale","The Rise And Fall Of Ziggy Stardust And The Spiders From Mars","The Rising Tied","The River","The Stone Roses","The Story Of Us","The Stranger","The Sufferer & The Witness","The Sun's Tirade","The Temptations Sing Smokey","The Time Of Our Lives","The Way It Is","The Wonderful World Of Sam Cooke","The Writing's On The Wall","The Young And The Hopeless","Therapy","Therapy Session","There Is More (Live)","There Is Nothing Left To Lose","These Things Happen","Third Eye Bl
847ind","This Is Me...Then","This Unruly Mess I've Made","Threat to Survival","Thrill Of The Chase","Time","Timelezz","To Let A Good Thing Die","To Pimp A Butterfly","Toast To Our Differences","Todos Os Cantos, Vol. 1 (Ao Vivo)","Too Hard","Torches X","Total Xanarchy","Toto IV","Toulouse Street","Tourist History","Toxicity","Tragic Kingdom","Tranquility Base Hotel & Casino","Traumazine","Traveler","Tres Hombres","Trip At Knight","Tron: Legacy","True Blue","True Colors","Trustfall","Tu Veneno Mortal","Tudo Em Paz","Ubuntu","Ugly Is Beautiful","Ultra 2021","Una Mattina","Unbroken","Uncovered","Under Pressure","Unsponsored Content","Unstoppable","Unwritten","Urban Flora","Urban Hymns","Use Your Illusion I","Veneer","Versions Of Me","Vibes","Vice Versa","Vices & Virtues","Victory","Vida","Viejo Marihuano","VisualÃzate","Walk Away","Walk Me Home...","Watch The Throne","Wave","We Broke The Rules","We Love You Tecca","We Love You Tecca 2","Weezer (Green Album)","Welcome To The Madhouse","Westlife","What A Time To Be Alive","What Do You Think About The Car?","What Is Love?","What Makes You Country","What Separates Me From You","What You See Is What You Get / What You See Ain't Always What You Get","When It's Dark Out","When We All Fall Asleep, Where Do We Go?","Where The Light Is","While The World Was Burning","White Pony","Whitney","Who Really Cares","Who You Are","Who's Next","Wide Open","Wilder Mind","Wildfire","Willy And The Poor Boys","Wings / You Never Walk Alone","Wish","Wish You Were Here","Without Warning","Wonder","X&Y","XOXO","Y Que Quede Claro","YBN: The Mixtape","Yo Creo","You Will Regret","Youngblood","Younger Now","Youth"],yle=["$NOT","$uicideboy$","(G)I-DLE","*NSYNC","2 Chainz","21 Savage","6LACK","? & The Mysterians","A Boogie Wit da Hoodie","A Taste of Honey","A Tribe Called Quest","A-Ha","ABBA","AC/DC","AJ Tracey","ATEEZ","Ace of Base","Adele","Ado","Aerosmith","Agust D","Aitana","Al Dexter & his Troopers","Al Green","Al Jolson","Al Martino","Alan Jackson","Alannah Myles","Alec Benjamin","Alejandro Sanz","Alesso","Alfredo Olivas","Ali Gatie","Alice In Chains","Alina Baraz","All Time Low","All-4-One","All-American Rejects","Alok","America","American Quartet","Amii Stewart","Amitabh Bhattacharya","Ana Castela","Anderson .Paak","Andy Grammer","Angus & Julia Stone","Anirudh Ravichander","Anita Ward","Anitta","Anton Karas","Anuel AA","Arcade Fire","Archie Bell & The Drells","Archies","Aretha Franklin","Arizona Zervas","Armin van Buuren","Arthur Conley","Artie Shaw","Asake","Asees Kaur","Association","Atif Aslam","Audioslave","Aventura","Avril Lavigne","Aya Nakamura","B J Thomas","B.o.B","BLACKPINK","BONES","BROCKHAMPTON","BTS","Baby Keem","Bachman-Turner Overdrive","Backstreet Boys","Bad Bunny","Badshah","Bailey Zimmerman","Banda El Recodo","Barbra Streisand","Barry White","Bazzi","Bebe Rexha","Becky G","Becky Hill","Bee Gees","Ben Bernie","Ben Howard","Ben Selvin","Berlin","Bessie Smith","Bethel Music","Bette Midler","Beyonce","Bibi Blocksberg","Bibi und Tina","BigXthaPlug","Bill Doggett","Bill Haley & his Comets","Bill Withers","Billy Davis Jr","Billy Joel","Billy Paul","Billy Preston","Billy Swan","Birdy","Bizarrap","Blake Shelton","Blur","Bob Marley & The Wailers","Bob Seger","Bobby Darin","Bobby Lewis","Bobby McFerrin","Bobby Vinton","Boney M.","Bonez MC","Bonnie Tyler","Booba","Boston","BoyWithUke","Boyce Avenue","Bradley Cooper","Bread","Brent Faiyaz","Brett Young","Bring Me The Horizon","Britney Spears","Brooks & Dunn","Bruce Channel","Bruno & Marrone","Bryan Adams","Bryce Vine","Buddy Holly","Burna Boy","C. Tangana","CKay","CRO","Camilo","Capital Bra","Captain & Tennille","Cardi B","Carin Leon","Carlos Vives","Carly Simon","Carpenters","Cavetown","Celine Dion","Central Cee","Chaka Khan","Champs","Charlie Rich","Chayanne","Cheat Codes","Cher","Chic","Chicago","Chris Brown","Chris Isaak","Chris Young","Christina Aguilera","Christina Perri","Christopher Cross","Chuck Berry","Ciara","Cigarettes After Sex","Cliff Edwards (Ukelele Ike)","Cody Johnson","Colbie Caillat","Colby O'Donis","Cole Swindell","Coleman Hawkins","Contours","Coolio","Count Basie","Cris Mj","Culture Club","Cyndi Lauper","D-Block Europe","DAY6","DJ Khaled","DJ Luian","DJ Nelson","DMX","DNCE","DaVido","Dadju","Daft Punk","Dan + Shay","Daniel Powter","Danny Ocean","Darius Rucker","Dave","David Bowie","David Guetta","Daya","Dean Martin","Deee-Lite","Deep Purple","Deftones","Demi Lovato","Dennis Lloyd","Denzel Curry","Dermot Kennedy","Desiigner","Devo","Dewa 19","Dexys Midnight Runners","Diddy","Dido","Die drei !!!","Diego & Victor Hugo","Diljit Dosanjh","Dimitri Vegas & Like Mike","Dinah Shore","Dionne Warwick","Dire Straits","Disclosure","Dixie Cups","Doja Cat","Dolly Parton","Don Diablo","Don Henley","Don McLean","Don Omar","Donna
847Summer","Donovan","Dr. Dre","Drake","Dreamville","Dua Lipa","EMF","ENHYPEN","Earth, Wind & Fire","Ed Sheeran","Eddie Cantor","Eddie Cochran","Eddy Howard","Edgar Winter Group","Edwin Hawkins Singers","Edwin Starr","El Alfa","Eladio Carrion","Electric Light Orchestra","Elevation Worship","Ella Henderson","Ellie Goulding","Elton John","Elvis Presley","Empire of the Sun","En Vogue","Enrique Iglesias","Eslabon Armado","Ethel Waters","Etta James","Evanescence","Exile","Extreme","Faith Hill","Fall Out Boy","Fanny Brice","Farruko","Fats Domino","Fats Waller","Feid","Felix Jaehn","Fergie","Fetty Wap","Fiersa Besari","Fifth Harmony","Fine Young Cannibals","Five Finger Death Punch","Fleetwood Mac","Flo-Rida","Florence + The Machine","Flume","Foo Fighters","Foreigner","Foster The People","Four Aces","Frank Ocean","Frank Sinatra","Frankie Avalon","Frankie Valli","Fred Astaire","Freda Payne","Freddie Dredd","Freddy Fender","French Montana","Fuerza Regida","Fujii Kaze","Future","G-Eazy","Garfunkel and Oates","Gary Lewis & The Playboys","Gary Numan","Gene Autry","Gene Chandler","Gene Vincent","George Michael","George Strait","Gera MX","Ghost","Ghostemane","Gigi D'Agostino","Gladys Knight & The Pips","Glass Animals","Glee Cast","Gloria Gaynor","Godsmack","Gorillaz","Gotye","Grand Funk Railroad","Green Day","Grouplove","Grupo Firme","Grupo Marca Registrada","Gryffin","Gucci Mane","Guess Who","Gunna","Gusttavo Lima","Guy Mitchell","Gwen Stefani","Gzuz","H.E.R.","HARDY","Hailee Steinfeld","Halsey","Hans Zimmer","Harris Jayaraj","Harry Chapin","Harry James","Harry Nilsson","Harry Styles","Hayley Williams","Herb Alpert","Herman's Hermits","Hillsong UNITED","Hillsong Worship","Hollywood Undead","Honey Cone","Hoobastank","Hues Corporation","I Prevail","ITZY","IVE","Ice Cube","Ice Spice","Iggy Azalea","Imagine Dragons","Incubus","Internet Money","Isaac Hayes","J Geils Band","J. Cole","JAY-Z","JJ Lin","JP Saxe","JVKE","Jack Harlow","Jack Johnson","Jackie Wilson","Jacquees","James Arthur","James Brown","James TW","James Taylor","Jamie Foxx","Janet Jackson","Janis Joplin","Jason Aldean","Jason Mraz","Jay Chou","Jay Sean","Jay Wheeler","Jaymes Young","Jean Knight","Jeezy","Jennifer Lopez","Jennifer Warnes","Jeremih","Jeremy Zucker","Jerry Lee Lewis","Jerry Murad's Harmonicats","Jess Glynne","Jessie J","Jewel","Jimi Hendrix","Jimin","Jimmie Rodgers","Jimmy Dean","Jo Stafford","Joan Jett & The Blackhearts","Joao Gilberto","Joel Corry","John Fred & The Playboy Band","John Legend","John Mayer","John Williams","Johnnie Ray","Johnnie Taylor","Johnny Cash","Johnny Horton","Johnny Mathis","Johnny Mercer","Johnny Nash","Joji","Jon Bellion","Jonas Blue","Jonas Brothers","Joni James","Jorja Smith","Juan Gabriel","Juan Luis Guerra 4.40","Juanes","Juice Newton","Julia Michaels","Justin Bieber","Justin Quiles","KALEO","KAROL G","KAYTRANADA","KK","KSI","KYLE","Kacey Musgraves","Kane Brown","Kanye West","Karan Aujla","Kate Smith","Katy Perry","Kay Kyser","Ke$ha","Kehlani","Kelly Clarkson","Kenny Chesney","Kenny Loggins","Kenny Rogers","Kenshi Yonezu","Kenya Grace","Kevin Gates","Key Glock","Khalid","Kim Carnes","Kim Petras","Kimbra","Kina","King Gnu","Kings of Leon","Kingsmen","Kitty Kallen","Kodak Black","Kodaline","Kollegah","Kool & The Gang","Kungs","Kygo","Kylie Minogue","LE SSERAFIM","LISA","LMFAO","LUDMILLA","La Adictiva Banda San José de Mesillas","La Oreja de Van Gogh","Labrinth","Lady Antebellum","Lady GaGa","Lainey Wilson","Lana Del Rey","Latto","Lauryn Hill","Lauv","League of Legends","Lee Brice","Leon Bridges","Leona Lewis","Lesley Gore","Leslie Odom Jr.","Liam Payne","Lifehouse","Lil Baby","Lil Dicky","Lil Durk","Lil Mosey","Lil Nas X","Lil Pump","Lil Skies","Lil Tjay","Lil Uzi Vert","Lil Yachty","Lil' Kim","Lil' Wayne","Lin-Manuel Miranda","Linkin Park","Lionel Richie","Lipps Inc","Lisa Loeb","Little Peggy March","Little Richard","Lofi Fruits Music","Lord Huron","Los Del Rio","Los Dos Carnales","Los Lobos","Los Temerarios","
847Los Tigres Del Norte","Los Tucanes De Tijuana","Lou Reed","Loud Luxury","Louis Jordan","Louis Tomlinson","Love Unlimited","Lovin' Spoonful","Luan Santana","Luciano","Luis Miguel","Luis R Conriquez","Lulu","Lunay","Lupe Fiasco","M","MAX","MC Hammer","MC Ryan SP","MKTO","Mabel","Machine Gun Kelly","Madison Beer","Madonna","Mahalini","Major Lazer","Mambo Kingz","Maneskin","Marco Antonio SolÃs","Margaret Whiting","Maria Becerra","Mario","Mario Lanza","Mark Ronson","Maroon 5","Marshmello","Martin Garrix","Mary Ford","Mary J Blige","Mary J. Blige","Mary Wells","Matoma","Mau y Ricky","Meek Mill","Megadeth","Melanie","Melanie Martinez","Melendi","Men At Work","Metro Boomin","Michael Bublé","Michael Jackson","Michael McDonald","Michael Sembello","Miguel","Mike Posner","Miley Cyrus","Milky Chance","Minnie Riperton","Miracle Tones","Miranda Lambert","Mohit Chauhan","Mon Laferte","Moneybagg Yo","Monsta X","Mora","Morad","Morat","Mother Mother","Motley Crue","Ms. Lauryn Hill","Mumford & Sons","Muse","Mya","Myke Towers","NCT 127","NCT DREAM","NEFFEX","Nadin Amizah","Nancy Sinatra","Nat King Cole","Nate Smith","Natti Natasha","Nayer","Neil Diamond","Neil Sedaka","Nekfeu","Nelly","New Vaudeville Band","Next","Nickelback","Nicki Minaj","Nicki Nicole","Nicky Jam","Nina Simone","Ninho","Nipsey Hussle","Nirvana","Niska","No Doubt","Norah Jones","Normani","OMI","ONE OK ROCK","Oasis","Official HIGE DANdism","Offset","Old Dominion","Oliver Heldens","Olivia Rodrigo","Omah Lay","One Direction","Otis Redding","OutKast","Owl City","P Diddy","P!nk","PLK","PNL","Pamungkas","Passenger","Pat Boone","Patsy Cline","Patti LaBelle","Patti Page","Paul & Paula","Paul Revere & the Raiders","Paul Robeson","Paul Russell","Paul Whiteman","Paula Abdul","Peaches & Herb","Pearl Jam","Pee Wee Hunt","Pee Wee King","Pentatonix","Percy Faith","Percy Sledge","Peso Pluma","Peter Cetera","Peter Gabriel","Peter, Paul & Mary","Pharrell Williams","Pierce The Veil","Pineapple StormTv","Pink Floyd","Pink Sweat$","Piso 21","Pitbull","Plan B","Player","Polo G","Pop Smoke","Portugal. The Man","Pouya","Prince","Prince Royce","Pusha T","Quality Control","Queen","Quinn XCII","R. Kelly","RAF Camora","RAYE","REM","REO Speedwagon","Radiohead","Rag'n'Bone Man","Rage Against The Machine","Rahat Fateh Ali Khan","Rainbow Kitten Surprise","Rammstein","Rauw Alejandro","Ray Charles","Ray Parker Jr","Ray Stevens","Red Foley","Red Hot Chili Peppers","Red Velvet","Regard","Regina Belle","Reik","Rels B","Rema","Ricardo Arjona","Rich The Kid","Rick Astley","Rick Dees & his Cast of Idiots","Rick Ross","Rick Springfield","Ricky Martin","Ricky Nelson","Rihanna","Rita Ora","Ritchie Valens","Rizky Febian","Rob Thomas","Roberta Flack","Robin Schulz","Robin Thicke","Rod Stewart","Rod Wave","Roddy Ricch","Roger Miller","Romeo Santos","Rosemary Clooney","Roxette","Roy Acuff","Roy Orbison","Rudimental","Ruel","Ruth B.","Ryan Lewis","SCH","SEVENTEEN","SWV","Sabaton","Sabrina Carpenter","Sachet Tandon","Sachin-Jigar","Sade","Sam Cooke","Sam Feldt","Sam Hunt","Sam Smith","Sam The Sham & The Pharaohs","Sammy Davis Jr","Sammy Kaye","Santana","Sasha Alex Sloan","Savage Garden","Saweetie","Scorpions","Sean Kingston","Sean Paul","Sebastian Yatra","Sech","Seeb","Sezen Aksu","Sfera Ebbasta","Shaggy","Shania Twain","Shawn Mendes","Sheena Easton","Shinedown","Shubh","Sia","Sid Sriram","Sidhu Moose Wala","Silk","Silver Convention","Simon & Garfunkel","Sinead O'Connor","Sir Mix-a-Lot","Sister Sledge","Ski Mask The Slump God","Skillet","Skrillex","Sleeping At Last","Smokey Robinson","Snoop Dogg","Snow Patrol","Soda Stereo","Sonu Nigam","Sophie Ellis-Bextor","Spencer Davis Group","Spice Girls","Stan Getz","Starland Vocal Band","Stephen Sanchez","Steve Aoki","Steve Lacy","Steve Winwood","Stevie B","Sting","Stormzy","Strawberry Alarm Clock","Stray Kids","Stromae","Sublime","Sum 41","Summer Walker","Supertramp","Survivor","Swedish House Mafia","System Of A Down","T-Pain","T.I.","TAEYEON","TKKG","TLC","TOMORROW X TOGETHER","TOTO","TWICE","Tag Team","Tainy","Tammi Terrell","Tanishk Bagchi","Tate McRae","Taylor Swift","Tears For Fears","Tems","Tennessee Ernie Ford","Terence Trent D'Arby","Teresa Brewer","Terry Jacks","The Ames Brothers","The Animals","The B52s","The Bangles","The Beatles","The Black Eyed Peas","The Black Keys","The Box Tops","The Chainsmokers","The Chiffons","The Chordettes","The Clash","The Coasters","The Commodores","The Cowsills","The Cranberries","The Crew-Cuts","The Cure","The Detroit Spinners","The Diamonds","The Doobie Brothers","The Doors","The Drifters","The Emotions","The Eurythmics","The Fireballs","The Flamingos","The Foundations","The Four Seasons","The Fray","The Game","The Go Gos","The Goo Goo Dolls","The Head And The Heart","The Hollies","The Ink Spots","The Isley Brothers","The Jackson 5","The Kid LAROI","The Killers","The Kingston Trio","The Kooks","The Lemon Pipers","The Living Tombstone","The Lumineers","The Mamas & The Papas","The Marvelettes","The McCoys","The Mills Brothers","The Miracles","The Monkees","The Moody Blues","The National","The Neighbourhood","The Notorious B.I.G.","The O'Jays","The Offspring","The Osmonds","The Partridge Family","The Penguins","The Pet Shop Boys","The Platters","The Righteous Brothers","The Rolling Stones","The Ronettes","The Score","The Script","The Seekers","The Shangri-Las","The Smashing Pumpkins","The Staple Singers","The Strokes","The Supremes","The Temptations","The Turtles","The Vamps","The Verve","The Village People","The Weavers","The White Stripes","The Young Rascals","The Zombies","Thelma Houston","Thomas R
847hett","Three Days Grace","Three Dog Night","Three Man Down","Timbaland","Timmy Trumpet","Toby Keith","Tom Jones","Tom Petty and the Heartbreakers","Tommy Dorsey","Tommy Edwards","Tommy James & the Shondells","Tone Loc","Toni Braxton","Topic","Tory Lanez","Tove Lo","Trevor Daniel","Trey Songz","Trippie Redd","Trueno","Tulsi Kumar","Tulus","Twenty One Pilots","Two Feet","Ty Dolla $ign","Tyga","Tyler Hubbard","U2","UB40","UZI","Ufo361","Upchurch","V","Vampire Weekend","Van McCoy","Van Morrison","Vance Joy","Vanessa Carlton","Vanessa Williams","Vera Lynn","Vernon Dalhart","Vicente Fernandez","Vishal-Shekhar","Volbeat","WILLOW","Wale","Wallows","Weezer","Wham!","Whitney Houston","Why Don't We","Wilbert Harrison","Wilson Phillips","Wiz Khalifa","Woody Guthrie","Wyclef Jean","XXXTENTACION","Xavi","YG","YNW Melly","YOASOBI","Yandel","Years & Years","Yeat","Yo Gotti","Young Dolph","Young Miko","Young Thug","YoungBoy Never Broke Again","Yung Gravy","Yuuri","Yuvan Shankar Raja","ZAYN","ZZ Top","Zac Brown Band","Zach Bryan","Zara Larsson","aespa","benny blanco","blink-182","d4vd","deadmau5","girl in red","gnash","iann dior","will.i.am"],ble=["Acid House","Acid Jazz","Acid Rock","Acoustic","Acoustic Blues","Afro-Pop","Afrobeat","Alt-Rock","Alternative","Ambient","American Trad Rock","Americana","Anime","Arena Rock","Art-Rock","Avant-Garde","Avant-Punk","Baladas y Boleros","Barbershop","Baroque","Bebop","Big Band","Black Metal","Blue Note","Bluegrass","Blues","Boogaloo","Bop","Bossa Nova","Bounce","Brazilian Funk","Breakbeat","Britpop","CCM","Cajun","Cantopop","Celtic","Celtic Folk","Chamber Music","Chant","Chanukah","Chicago Blues","Chicago House","Chicano","Childrenâs Music","Chill","Choral","Christian","Christmas","Classical","Club","College Rock","Conjunto","Cool Jazz","Country","Crunk","Dance","Dancehall","Death Metal","Deep House","Delta Blues","Detroit Techno","Dirty South","Disco","Disney","Dixieland","Doo-wop","Downtempo","Dream Pop","Drill","Drinking Songs","Drone","Drum'n'bass","Dub","Dubstep","EDM","Early Music","East Coast Rap","Easter","Easy Listening","Eclectic","Electric Blues","Electro","Electronic","Electronica","Emo","Enka","Environmental","Ethio-jazz","Experimental","Experimental Rock","Flamenco","Folk","Folk-Rock","Forro","French Pop","Funk","Fusion","Gangsta Rap","Garage","German Folk","German Pop","Glam Rock","Gospel","Goth","Grime","Grindcore","Groove","Grunge","Hair Metal","Halloween","Happy","Hard Bop","Hard Dance","Hard Rock","Hardcore","Hardcore Punk","Hardcore Rap","Hardstyle","Healing","Heavy Metal","High Classical","Hip Hop","Holiday","Honky Tonk","House","IDM","Impressionist","Indie","Industrial","Instrumental","J-Dance","J-Idol","J-Pop","J-Punk","J-Rock","J-Ska","J-Synth","Jackin House","Jam Bands","Japanese Pop","Jazz","Jungle","K-Pop","Karaoke","Kayokyoku","Kids","Kitsch","Klezmer","Krautrock","Latin","Latin Jazz","Latin Rap","Local","Lounge","Lullabies","MPB","Mainstream Jazz","Malay","Mandopop","March","Mariachi","Mawwal","Medieval","Meditation","Metal","Metalcore","Minimal Techno","Minimalism","Modern","Motown","Mugham","Musicals","Musique Concrète","Nature","Neo-Soul","Nerdcore","New Acoustic","New Age","New Mex","New Wave","No Wave","Noise","Nordic","Novelty","OPM","Oi!","Old School Rap","Opera","Orchestral","Original Score","Outlaw Country","Pagode","Party","Piano","Polka","Pop","Pop Film","Pop Latino","Post Dubstep","Power Pop","Praise & Worship","Progressive House","Progressive Rock","Proto-punk","Psych Rock","Psychedelic","Punk","Punk Rock","Qawwali","Quiet Storm","R&B","Ragtime","Rainy Day","Rap","Reggae","Reggaeton","Regional Mexicano","Relaxation","Renaissance","Retro","Rock","Rockabilly","Rocksteady","Romance","Romantic","Roots Reggae","Roots Rock","SKA","Sad","Salsa","S
847amba","Second Line","Sertanejo","Shaabi","Shoegaze","Sleep","Smooth Jazz","Soft Rock","Soul","Soundtrack","Southern Gospel","Southern Rock","Space Rock","Stage And Screen","Steampunk","Summer","Surf","Swamp Pop","Swing","Synth Pop","Tango","Techno","Teen Pop","Tejano","Tex-Mex","Thanksgiving","Traditional","Trance","Trip Hop","Tropical","Underground Rap","Urban","Urban Cowboy","West Coast Rap","Western Swing","World","Worldbeat","Zydeco"],vle=["(Everything I Do) I Do it For You","(Ghost) Riders in the Sky","(I Can't Get No) Satisfaction","(I've Got a Gal In) Kalamazoo","(I've Had) the Time of My Life","(It's No) Sin","(Just Like) Starting Over","(Let Me Be Your) Teddy Bear","(Put Another Nickel In) Music! Music! Music!","(Sexual) Healing","(Sittin' On) the Dock of the Bay","(They Long to Be) Close to You","(You Keep Me) Hangin' On","(You're My) Soul & Inspiration","(Your Love Keeps Lifting Me) Higher & Higher","12th Street Rag","1999","19th Nervous Breakdown","50 Ways to Leave Your Lover","9 to 5","96 Tears","A Boy Named Sue","A Hard Day's Night","A String of Pearls","A Thousand Miles","A Tree in the Meadow","A Whiter Shade of Pale","A Whole New World (Aladdin's Theme)","A Woman in Love","A-Tisket A-Tasket","ABC","Abracadabra","Ac-cent-tchu-ate the Positive","Addicted to Love","After You've Gone","Afternoon Delight","Again","Against All Odds (Take a Look At Me Now)","Ain't Misbehavin'","Ain't No Mountain High Enough","Ain't No Sunshine","Ain't That a Shame","Airplanes","All Along the Watchtower","All I Have to Do is Dream","All I Wanna Do","All My Lovin' (You're Never Gonna Get It)","All Night Long (All Night)","All Out of Love","All Shook Up","All You Need is Love","Alone","Alone Again (Naturally)","Always On My Mind","American Pie","American Woman","Angie","Another Brick in the Wall (part 2)","Another Day in Paradise","Another Night","Another One Bites the Dust","Apologize","April Showers","Aquarius/Let The Sunshine In","Are You Lonesome Tonight?","Arthur's Theme (Best That You Can Do)","As Time Goes By","At Last","At the Hop","Auf Wiederseh'n Sweetheart","Baby Baby","Baby Come Back","Baby Got Back","Baby Love","Baby One More Time","Bad Day","Bad Girls","Bad Moon Rising","Bad Romance","Bad, Bad Leroy Brown","Baker Street","Ball of Confusion (That's What the World is Today)","Ballad of the Green Berets","Ballerina","Band On the Run","Band of Gold","Battle of New Orleans","Be Bop a Lula","Be My Baby","Be My Love","Beat It","Beautiful Day","Beauty & the Beast","Because I Love You (The Postman Song)","Because You Loved Me","Because of You","Before The Next Teardrop Falls","Begin the Beguine","Behind Closed Doors","Being With You","Believe","Ben","Bennie & the Jets","Besame Mucho","Best of My Love","Bette Davis Eyes","Big Bad John","Big Girls Don't Cry","Billie Jean","Bitter Sweet Symphony","Black Or White","Black Velvet","Blaze of Glory","Bleeding Love","Blue Suede Shoes","Blue Tango","Blueberry Hill","Blurred Lines","Body & Soul","Bohemian Rhapsody","Boogie Oogie Oogie","Boogie Woogie Bugle Boy","Boom Boom Pow","Born in the USA","Born to Be Wild","Born to Run","Boulevard of Broken Dreams","Brand New Key","Brandy (You're A Fine Girl)","Breaking Up is Hard to Do","Breathe","Bridge Over Troubled Water","Brother Louie","Brother, Can You Spare a Dime?","Brown Eyed Girl","Brown Sugar","Build Me Up Buttercup","Burn","Buttons & Bows","Bye Bye Love","Bye Bye, Blackbird","Bye, Bye, Bye","Caldonia Boogie (What Makes Your Big Head So Hard)","California Dreamin'","California Girls","Call Me","Call Me Maybe","Can You Feel the Love Tonight","Can't Buy Me Love","Can't Get Enough of Your Love, Babe","Can't Help Falling in Love","Candle in the Wind '97","Candy Man","Car Wash","Careless Whisper","Cars","Cat's in the Cradle","Cathy's Clown","Celebration","Centerfold","Chain of Fools","Chances Are","Change the World","Chapel of Love","Chattanooga Choo Choo","Chattanoogie Shoe-Shine Boy","Check On It","Cheek to Cheek","Cherish","Cherry Pink & Apple Blossom White","Cold, Cold Heart","Colors of the Wind","Come On Eileen","Come On-a My House","Come Together","Coming Up","Cracklin' Rosie","Crazy","Crazy For You","Crazy Little Thing Called Love","Crazy in Love","Creep","Crimson &
847Clover","Crocodile Rock","Cry","Cry Like a Baby","Crying","Da Doo Ron Ron (When He Walked Me Home)","Dance to the Music","Dancing Queen","Dancing in the Dark","Dancing in the Street","Dardanella","Daydream Believer","December 1963 (Oh What a Night)","Delicado","Dilemma","Disco Duck","Disco Lady","Disturbia","Dizzy","Do That to Me One More Time","Do Wah Diddy Diddy","Do Ya Think I'm Sexy?","Do You Love Me?","Don't Be Cruel","Don't Fence Me In","Don't Go Breaking My Heart","Don't Leave Me This Way","Don't Let the Stars Get in Your Eyes","Don't Let the Sun Go Down On Me","Don't Speak","Don't Stop 'Til You Get Enough","Don't Worry Be Happy","Don't You (Forget About Me)","Don't You Want Me","Doo Wop (That Thing)","Down","Down Hearted Blues","Down Under","Downtown","Dreamlover","Dreams","Drop it Like It's Hot","Drops of Jupiter (Tell Me)","Duke of Earl","E.T.","Earth Angel","Ebony & Ivory","Eight Days a Week","Empire State Of Mind","End of the Road","Endless Love","Escape (The Pina Colada Song)","Eve of Destruction","Every Breath You Take","Every Little Thing She Does is Magic","Everybody Loves Somebody","Everybody Wants to Rule the World","Everyday People","Eye of the Tiger","Faith","Fallin'","Fame","Family Affair","Fantasy","Fast Car","Feel Good Inc","Feel Like Making Love","Fire & Rain","Firework","Flashdance. What a Feeling","Fly Robin Fly","Foolish Games","Footloose","For What It's Worth (Stop, Hey What's That Sound)","Fortunate Son","Frankenstein","Freak Me","Freebird","Frenesi","Funkytown","Gangsta's Paradise","Georgia On My Mind","Georgy Girl","Get Back","Get Down Tonight","Get Off of My Cloud","Ghostbusters","Gimme Some Lovin'","Girls Just Wanna Have Fun","Give Me Everything","Gives You Hell","Glamorous","Glory of Love","Go Your Own Way","God Bless America","God Bless the Child","Gold Digger","Gonna Make You Sweat (Everybody Dance Now)","Good Lovin'","Good Times","Good Vibrations","Goodbye Yellow Brick Road","Goodnight, Irene","Got to Give it Up","Grease","Great Balls of Fire","Greatest Love of All","Green Onions","Green River","Green Tambourine","Grenade","Groove is in the Heart","Groovin'","Gypsies, Tramps & Thieves","Hair","Hang On Sloopy","Hanging by a Moment","Hanky Panky","Happy Days Are Here Again","Happy Together","Harbour Lights","Hard to Say I'm Sorry","Harper Valley PTA","Have You Ever Really Loved a Woman?","He'll Have to Go","He's So Fine","He's a Rebel","Heart of Glass","Heart of Gold","Heartbreak Hotel","Hello Dolly","Hello, I Love You, Won't You Tell Me Your Name?","Help Me, Rhonda","Help!","Here Without You","Here in My Heart","Hero","Hey Baby","Hey Jude","Hey Paula","Hey There","Hey There Delilah","Hey Ya!","Higher Love","Hips don't lie","Hit the Road, Jack","Hold On","Hollaback Girl","Honey","Honky Tonk","Honky Tonk Woman","Horse With No Name","Hot Child In The City","Hot Stuff","Hotel California","Hound Dog","House of the Rising Sun","How Deep is Your Love?","How Do I Live?","How Do You Mend a Broken Heart","How High the Moon","How Much is That Doggy in the Window?","How Will I Know","How You Remind Me","How to Save a Life","Hungry Heart","Hurt So Good","I Believe I Can Fly","I Can Dream, Can't I?","I Can Help","I Can See Clearly Now","I Can't Get Next to You","I Can't Get Started","I Can't Go For That (No Can Do)","I Can't Help Myself (Sugar Pie, Honey Bunch)","I Can't Stop Loving You","I Don't Want to Miss a Thing","I Fall to Pieces","I Feel Fine","I Feel For You","I Feel Love","I Get Around","I Got You (I Feel Good)","I Got You Babe","I Gotta Feeling","I Heard it Through the Grapevine","I Honestly Love You","I Just Called to Say I Love You","I Just Wanna Be Your Everything","I Kissed A Girl","I Love Rock 'n' Roll","I Need You Now","I Only Have Eyes For You","I Shot the Sheriff","I Still Haven't Found What I'm Looking For","I Swear","I Think I Love You","I Walk the Line","I Wanna Dance With Somebody (Who Loves Me)","I Wanna Love You","I Want You Back","I Want to Hold Your Hand","I Want to Know What Love Is","I Went to Your Wedding","I Will Always Love You","I Will Follow Him","I Will Survive","I Write the Songs","I'll Be Missing You","I'll Be There","I'll Make Love to You","I'll Never Smile Again","I'll Take You There","I'll Walk Alone","I'll be seeing you","I'm Looking Over a Four Leaf Clover","I'm So Lonesome I Could Cry","I'm Sorry","I'm Walking Behind You","I'm Your Boogie Man","I'm Yours","I'm a Believer","I've Heard That Song Before","If (They Made Me a King)","If I Didn't Care","If You Don't Know Me By Now","If You Leave Me Now","Imagine","In Da Club","In the End","In the Ghetto","In the Mood","In the Summertime","In the Year 2525 (Exordium & Terminus)","Incense & Peppermints","Indian Reservation (The Lament Of The Cherokee Reservation Indian)","Instant Karma","Iris","Ironic","Irreplaceable","It Had to Be You","It's All in the Game","It's My Party","It's Now Or Never","It's Still Rock 'n' Roll to Me","It's Too Late","Jack & Diane","Jailhouse Rock","Jessie's Girl","Jive Talkin'","Johnny B Goode","Joy to the World","Judy in Disguise (With Glasses)","Jump","Jumpin' Jack Flash","Just Dance","Just My Imagination (Running Away With Me)","Just the Way You Are","Kansas City","Karma Chameleon","Keep On Loving You","Killing Me Softly With His Song","King of the Road","Kiss","Kiss & Say Goodbye","Kiss From a Rose","Kiss Me","Kiss On My List","Kiss You All Over","Knock On Wood","Knock Three Times","K
847okomo","Kryptonite","Kung Fu Fighting","La Bamba","Lady","Lady Marmalade (Voulez-Vous Coucher Aver Moi Ce Soir?)","Last Train to Clarksville","Layla","Le Freak","Leader of the Pack","Lean On Me","Leaving, on a Jet Plane","Let Me Call You Sweetheart","Let Me Love You","Let it Be","Let it Snow! Let it Snow! Let it Snow!","Let's Dance","Let's Get it On","Let's Groove","Let's Hear it For the Boy","Let's Stay Together","Light My Fire","Lights","Like a Prayer","Like a Rolling Stone","Like a Virgin","Little Darlin'","Little Things Mean a Lot","Live & Let Die","Livin' La Vida Loca","Livin' On a Prayer","Living For the City","Locked Out Of Heaven","Lola","Lonely Boy","Long Cool Woman in a Black Dress","Long Tall Sally","Look Away","Lookin' Out My Back Door","Lose Yourself","Losing My Religion","Louie Louie","Love Child","Love Hangover","Love In This Club","Love Is Blue (L'Amour Est Bleu)","Love Letters in the Sand","Love Me Do","Love Me Tender","Love Shack","Love Theme From 'A Star is Born' (Evergreen)","Love Train","Love Will Keep Us Together","Love is a Many Splendoured Thing","Love to Love You Baby","Love's Theme","Loving You","Low","Macarena","Mack the Knife","Maggie May","Magic","Magic Carpet Ride","Make Love to Me","Make it With You","Makin' Whoopee","Mama Told Me Not to Come","Man in the Mirror","Manana (Is Soon Enough For Me)","Maneater","Maniac","Maybellene","Me & Bobby McGee","Me & Mrs Jones","Memories Are Made of This","Mercy Mercy Me (The Ecology)","Mickey","Midnight Train to Georgia","Minnie the Moocher","Miss You","Miss You Much","Mister Sandman","Mmmbop","Mona Lisa","Monday Monday","Money For Nothing","Mony Mony","Mood Indigo","Moonlight Cocktail","Moonlight Serenade","More Than Words","More Than a Feeling","Morning Train (Nine to Five)","Mr Big Stuff","Mr Brightside","Mr Tambourine Man","Mrs Brown You've Got a Lovely Daughter","Mrs Robinson","Mule Train","Music","My Blue Heaven","My Boyfriend's Back","My Eyes Adored You","My Girl","My Guy","My Heart Will Go On","My Life","My Love","My Man","My Prayer","My Sharona","My Sweet Lord","Na Na Hey Hey (Kiss Him Goodbye)","Nature Boy","Near You","Need You Now","Need You Tonight","Never Gonna Give You Up","Night & Day","Night Fever","Nights in White Satin","No One","No Scrubs","Nobody Does it Better","Nothin' on You","Nothing Compares 2 U","Nothing's Gonna Stop Us Now","Ode To Billie Joe","Oh Happy Day","Oh My Papa (O Mein Papa)","Oh, Pretty Woman","Ol' Man River","Ole Buttermilk Sky","On Bended Knee","On My Own","On the Atchison, Topeka & the Santa Fe","One","One Bad Apple","One More Try","One O'Clock Jump","One Sweet Day","One of These Nights","One of Us","Only The Lonely (Know The Way I Feel)","Only You (And You Alone)","Open Arms","Over There","Over the Rainbow","Paint it Black","Papa Don't Preach","Papa Was a Rolling Stone","Papa's Got a Brand New Bag","Paper Doll","Paper Planes","Paperback Writer","Party Rock Anthem","Peg o' My Heart","Peggy Sue","Pennies From Heaven","Penny Lane","People","People Got to Be Free","Personality","Philadelphia Freedom","Physical","Piano Man","Pick Up the Pieces","Pistol Packin' Mama","Play That Funky Music","Please Mr Postman","Poker Face","Pon De Replay","Pony Time","Pop Muzik","Prisoner of Love","Private Eyes","Promiscuous","Proud Mary","Purple Haze","Purple Rain","Puttin' on the Ritz","Que sera sera (Whatever will be will be)","Queen of Hearts","Rag Doll","Rag Mop","Rags to Riches","Raindrops Keep Falling On My Head","Rapture","Ray of Light","Reach Out (I'll Be There)","Red Red Wine","Rehab","Respect","Return to Sender","Reunited","Revolution","Rhapsody in Blue","Rhinestone Cowboy","Rich Girl","Riders On the Storm","Right Back Where We Started From","Ring My Bell","Ring of Fire","Rock Around the Clock","Rock With You","Rock Your Baby","Rock the Boat","Rock the Casbah","Roll Over Beethoven","Roll With It","Rolling In The Deep","Rosanna","Roses Are Red","Royals","Ruby Tuesday","Rudolph, the Red-Nosed Reindeer","Rum & Coca-Cola","Runaround Sue","Runaway","Running Scared","Rush Rush","Sailing","Save the Best For Last","Save the Last Dance For Me","Say It Right","Say My Name","Say Say Say","Say You, Say Me","School's Out","Seasons in the Sun","Secret Love","Sentimental Journey","Sexyback","Sh-Boom (Life Could Be a Dream)","Shadow Dancing","Shake Down","Shake You Down","She Drives Me Crazy","She Loves You","She's a Lady","Shining Star","Shop Around","Shout","Silly Love Songs","Since U Been Gone","Sing, Sing, Sing (With A Swing)","Singing The Blues","Single Ladies (Put A Ring On It)","Sir Duke","Sixteen Tons","Sledgehammer","Sleep Walk","Sleepy Lagoon","Slow Poke","Smells Like Teen Spirit","Smoke Gets in Your Eyes","Smoke On the Water","Smoke! Smoke! Smoke! (That Cigarette)","Smooth","So Much in Love","Soldier Boy","Some Enchanted Evening","Some of These Days","Somebody That I Used to Know","Somebody to Love","Someday","Somethin' Stupid","Something","Soul Man","Spanish Harlem","Spill the Wine","Spinning Wheel","Spirit in the Sky","St George & the Dragonette","St Louis Blues","Stagger Lee","Stairway to Heaven","Stand By Me","Stardust","Stars & Stripes Forever","Stay (I Missed You)","Stayin' Alive","Stop! in the Name of Love","Stormy Weather (Keeps Rainin' All the Time)","Straight Up","Strange Fruit","Stranger On the Shore","Strangers in the Night","Strawberry Fields Forever","Streets of Philadelphia","Stronger","Stuck On You","Sugar Shack","Sugar Sugar","Summer in the City","Summertime Blues","Sunday, Monday or Always","Sunshine Superman","Sunshine of Your Love","Superstar","Superstition","Surfin' USA","Suspicious Minds","Swanee","Sweet Caroline (Good Times Never Seemed So Good)","Sweet Child O' Mine","Sweet Dreams (Are Made of This)","Sweet Georgia Brown","Sweet Home Alabama","Sweet Soul Music","Swinging O
847n a Star","T For Texas (Blue Yodel No 1)","TSOP (The Sound of Philadelphia)","Take Me Home, Country Roads","Take My Breath Away","Take On Me","Take The 'A' Train","Take a Bow","Tammy","Tangerine","Tears in Heaven","Tears of a Clown","Temperature","Tennessee Waltz","Tequila","Tha Crossroads","Thank You (Falettinme be Mice Elf Again)","That Lucky Old Sun (Just Rolls Around Heaven All Day)","That Old Black Magic","That'll Be the Day","That's Amore","That's What Friends Are For","That's the Way (I Like It)","That's the Way Love Goes","The Boy is Mine","The Boys of Summer","The Christmas Song (Chestnuts Roasting On An Open Fire)","The End of the World","The First Time Ever I Saw Your Face","The Girl From Ipanema","The Glow-Worm","The Great Pretender","The Gypsy","The Hustle","The Joker","The Last Dance","The Letter","The Loco-Motion","The Long & Winding Road","The Love You Save","The Morning After","The Power of Love","The Prisoner's Song","The Reason","The Rose","The Sign","The Song From Moulin Rouge (Where Is Your Heart)","The Sounds of Silence","The Streak","The Sweet Escape","The Thing","The Tide is High","The Tracks of My Tears","The Twist","The Wanderer","The Way We Were","The Way You Look Tonight","The Way You Move","Theme From 'A Summer Place'","Theme From 'Greatest American Hero' (Believe It Or Not)","Theme From 'Shaft'","There goes my baby","These Boots Are Made For Walking","Third Man Theme","This Diamond Ring","This Guy's in Love With You","This Land is Your Land","This Love","This Ole House","This Used to Be My Playground","Three Coins in the Fountain","Three Times a Lady","Thrift Shop","Thriller","Ticket to Ride","Tie a Yellow Ribbon 'round the Old Oak Tree","Tiger Rag","Tighten Up","Tik-Toc","Till I Waltz Again With You","Till The End of Time","Time After Time","Time of the Season","To Sir, with Love","Tom Dooley","Tonight's the Night (Gonna Be Alright)","Too Close","Too Young","Tossing & Turning","Total Eclipse of the Heart","Touch Me","Toxic","Travellin' Band","Travellin' Man","Truly Madly Deeply","Turn! Turn! Turn! (To Everything There is a Season)","Tutti Frutti","Twist & Shout","Two Hearts","U Can't Touch This","U Got it Bad","Umbrella","Un-Break My Heart","Unbelievable","Unchained Melody","Uncle Albert (Admiral Halsey)","Under the Boardwalk","Under the Bridge","Unforgettable","Up Around the Bend","Up Up & Away","Up Where We Belong","Upside Down","Use Somebody","Vaya Con Dios (may God Be With You)","Venus","Vision of Love","Viva La Vida","Vogue","Volare","Wabash Cannonball","Waiting For a Girl Like You","Wake Me Up Before You Go Go","Wake Up Little Susie","Walk Don't Run","Walk Like a Man","Walk Like an Egyptian","Walk On By","Walk On the Wild Side","Walk This Way","Wannabe","Want Ads","Wanted","War","Waterfalls","Wayward Wind","We Are Family","We Are Young","We Are the Champions","We Are the World","We Belong Together","We Built This City","We Can Work it Out","We Didn't Start the Fire","We Found Love","We Got The Beat","We Will Rock You","We've Only Just Begun","Weak","Wedding Bell Blues","West End Blues","West End Girls","What Goes Around Comes Around","What a Fool Believes","What'd I Say","What's Going On?","What's Love Got to Do With It?","Whatcha Say","Wheel of Fortune","When Doves Cry","When You Wish Upon a Star","When a Man Loves a Woman","Where Did Our Love Go","Where is the Love?","Whip It","Whispering","White Christmas","White Rabbit","Whole Lotta Love","Whole Lotta Shakin' Goin' On","Whoomp! (There it Is)","Why Do Fools Fall in Love?","Why Don't You Believe Me?","Wichita Lineman","Wicked Game","Wild Thing","Wild Wild West","Will It Go Round In Circles","Will You Love Me Tomorrow","Winchester Cathedral","Wind Beneath My Wings","Wipe Out","Wishing Well","With Or Without You","Without Me","Without You","Woman","Won't Get Fooled Again","Wooly Bully","Working My Way Back to You","YMCA","Yakety Yak","Yeah!","Yellow Rose of Texas","Yesterday","You Ain't Seen Nothin' Yet","You Always Hurt the One You Love","You Are the Sunshine of My Life","You Belong With Me","You Belong to Me","You Can't Hurry Love","You Don't Bring Me Flowers","You Don't Have to Be a Star (To Be in My Show)","You Light Up My Life","You Make Me Feel Brand New","You Make Me Feel Like Dancing","You Really Got Me","You Send Me","You Sexy Thing","You Were Meant for Me","You make Me Wanna","You'll Never Know","You're Beautiful","You're So Vain","You're Still the One","You're the One That I Want","You've Got a Friend","You've Lost That Lovin' Feelin'","Your Cheatin' Heart","Your Song"],wle={album:xle,artist:yle,genre:ble,song_name:vle},jle=wle,Nle=["activist","artist","author","blogger","business owner","coach","creator","designer","developer","dreamer","educator","engineer","entrepreneur","environmentalist","film lover","filmmaker","foodie","founder","friend","gamer","geek","grad","inventor","leader","model","musician","nerd","parent","patriot","person","philosopher","photographer","public speaker","scientist","singer","streamer","student","teacher","traveler","veteran","writer"],Fle=["{{person.bio_part}}","{{person.bio_part}}, {{person.bio_part}}","{{person.bio_part}}, {{person.bio_part}}, {{person.bio_part}}","{{person.bio_part}}, {{person.bio_part}}, {{person.bio_part}} {{internet.emoji}}","{{word.noun}} {{person.bio_supporter}}","{{word.noun}} {{person.bio_supporter}} {{internet.emoji}}","{{word.noun}} {{person.bio_supporter}}, {{person.bio_part}}","{{word.noun}} {{person.bio_supporter}}, {{person.bio_part}} {{internet.emoji}}"],Sle=["advocate","devotee","enthusiast","fan","junkie","lover","supporter"],Cle={generic:["Aaliyah","Aaron","Abagail","Abbey","Abbie","Abbigail","Abby","Abdiel","Abdul","Abdullah","Abe","Abel","Abelardo","Abigail","Abigale","Abigayle","Abner","Abraham","Ada","Adah","Adalberto","Adaline","Adam","Adan","Addie","Addison","Adela","Adelbert","Adele","Adelia","Adeline","Adell","Adella","Adelle","Aditya","Adolf","Adolfo","Adolph","Adolphus","Adonis","Adrain","Adrian","Adriana","Adrianna","Adriel","Adrien","Adrienne","Afton","Aglae","Agnes","Agustin","Agustina","Ahmad","Ahmed","Aid
847a","Aidan","Aiden","Aileen","Aimee","Aisha","Aiyana","Akeem","Al","Alaina","Alan","Alana","Alanis","Alanna","Alayna","Alba","Albert","Alberta","Albertha","Alberto","Albin","Albina","Alda","Alden","Alec","Aleen","Alejandra","Alejandrin","Alek","Alena","Alene","Alessandra","Alessandro","Alessia","Aletha","Alex","Alexa","Alexander","Alexandra","Alexandre","Alexandrea","Alexandria","Alexandrine","Alexandro","Alexane","Alexanne","Alexie","Alexis","Alexys","Alexzander","Alf","Alfonso","Alfonzo","Alford","Alfred","Alfreda","Alfredo","Ali","Alia","Alice","Alicia","Alisa","Alisha","Alison","Alivia","Aliya","Aliyah","Aliza","Alize","Allan","Allen","Allene","Allie","Allison","Ally","Alphonso","Alta","Althea","Alva","Alvah","Alvena","Alvera","Alverta","Alvina","Alvis","Alyce","Alycia","Alysa","Alysha","Alyson","Alysson","Amalia","Amanda","Amani","Amara","Amari","Amaya","Amber","Ambrose","Amelia","Amelie","Amely","America","Americo","Amie","Amina","Amir","Amira","Amiya","Amos","Amparo","Amy","Amya","Ana","Anabel","Anabelle","Anahi","Anais","Anastacio","Anastasia","Anderson","Andre","Andreane","Andreanne","Andres","Andrew","Andy","Angel","Angela","Angelica","Angelina","Angeline","Angelita","Angelo","Angie","Angus","Anibal","Anika","Anissa","Anita","Aniya","Aniyah","Anjali","Anna","Annabel","Annabell","Annabelle","Annalise","Annamae","Annamarie","Anne","Annetta","Annette","Annie","Ansel","Ansley","Anthony","Antoinette","Antone","Antonetta","Antonette","Antonia","Antonietta","Antonina","Antonio","Antwan","Antwon","Anya","April","Ara","Araceli","Aracely","Arch","Archibald","Ardella","Arden","Ardith","Arely","Ari","Ariane","Arianna","Aric","Ariel","Arielle","Arjun","Arlene","Arlie","Arlo","Armand","Armando","Armani","Arnaldo","Arne","Arno","Arnold","Arnoldo","Arnulfo","Aron","Art","Arthur","Arturo","Arvel","Arvid","Arvilla","Aryanna","Asa","Asha","Ashlee","Ashleigh","Ashley","Ashly","Ashlynn","Ashton","Ashtyn","Asia","Assunta","Astrid","Athena","Aubree","Aubrey","Audie","Audra","Audreanne","Audrey","August","Augusta","Augustine","Augustus","Aurelia","Aurelie","Aurelio","Aurore","Austen","Austin","Austyn","Autumn","Ava","Avery","Avis","Axel","Ayana","Ayden","Ayla","Aylin","Baby","Bailee","Bailey","Barbara","Barney","Baron","Barrett","Barry","Bart","Bartholome","Barton","Baylee","Beatrice","Beau","Beaulah","Bell","Bella","Belle","Ben","Benedict","Benjamin","Bennett","Bennie","Benny","Benton","Berenice","Bernadette","Bernadine","Bernard","Bernardo","Berneice","Bernhard","Bernice","Bernie","Berniece","Bernita","Berry","Bert","Berta","Bertha","Bertram","Bertrand","Beryl","Bessie","Beth","Bethany","Bethel","Betsy","Bette","Bettie","Betty","Bettye","Beulah","Beverly","Bianka","Bill","Billie","Billy","Birdie","Blair","Blaise","Blake","Blanca","Blanche","Blaze","Bo","Bobbie","Bobby","Bonita","Bonnie","Boris","Boyd","Brad","Braden","Bradford","Bradley","Bradly","Brady","Braeden","Brain","Brandi","Brando","Brandon","Brandt","Brandy","Brandyn","Brannon","Branson","Brant","Braulio","Braxton","Brayan","Breana","Breanna","Breanne","Brenda","Brendan","Brenden","Brendon","Brenna","Brennan","Brennon","Brent","Bret","Brett","Bria","Brian","Briana","Brianne","Brice","Bridget","Bridgette","Bridie","Brielle","Brigitte","Brionna","Brisa","Britney","Brittany","Brock","Broderick","Brody","Brook","Brooke","Brooklyn","Brooks","Brown","Bruce","Bryana","Bryce","Brycen","Bryon","Buck","Bud","Buddy","Buford","Bulah","Burdette","Burley","Burnice","Buster","Cade","Caden","Caesar","Caitlyn","Cale","Caleb","Caleigh","Cali","Calista","Callie","Camden","Cameron","Camila","Camilla","Camille","Camren","Camron","Camryn","Camylle","Candace","Candelario","Candice","Candida","Candido","Cara","Carey","Carissa","Carlee","Carleton","Carley","Carli","Carlie","Carlo","Carlos","Carlotta","Carmel","Carmela","Carmella","Carmelo","Carmen","Carmine","Carol","Carolanne","Carole","Carolina","Caroline","Carolyn","Carolyne","Carrie","Carroll","Carson","Carter","Cary","Casandra","Casey","Casimer","Casimir","Casper","Cassandra","Cassandre","Cassidy","Cassie","Catalina","Caterina","Catharine","Catherine","Cathrine","Cathryn","Cathy","Cayla","Ceasar","Cecelia","Cecil","Cecile","Cecilia","Cedrick","Celestine","Celestino","Celia","Celine","Cesar","Chad","Chadd","Chadrick","Chaim","Chance","Chandler","Chanel","Chanelle","Charity","Charlene","Charles","Charley","Charlie","Charlotte","Chase","Chasity","Chauncey","Chaya","Chaz","Chelsea","Chelsey","Chelsie","Chesley","Chester","Chet","Cheyanne","Cheyenne","Chloe","Chris","Christ","Christa","Christelle","Christian","Christiana","Christina","Christine","Christop","Christophe","Christopher","Christy","Chyna","Ciara","Cicero","Cielo","Cierra","Cindy","Citlalli","Clair","Claire","Clara","Clarabelle","Clare","Clarissa","Clark","Claud","Claude","Claudia","Claudie","Claudine","Clay","Clemens","Clement","Clementina","Clementine","Clemmie","Cleo","Cleora","Cleta","Cletus","Cleve","Cleveland","Clifford","Clifton","Clint","Clinton","Clotilde","Clovis","Cloyd","Clyde","Coby","Cody","Colby","Cole","Coleman","Colin","Colleen","Collin","Colt","Colten","Colton","Columbus","Concepcion","Conner","Connie","Connor","Conor","Conrad","Constance","Constantin","Consuelo","Cooper","Cora","Coralie","Corbin","Cordelia","Cordell","Cordia","Cordie","Corene","Corine","Cornelius","Cornell","Corrine","Cortez","Cortney","Cory","Coty","Courtney","Coy","Craig","Crawford","Creola","Cristal","Cristian","Cristina","Cristobal","Cristopher","Cruz","Crystal","Crystel","Cullen","Curt","Curtis","Cydney","Cynthia","Cyril","Cyrus","D'angelo","Dagmar","Dahlia","Daija","Daisha","Daisy","Dakota","Dale","Dallas","Dallin","Dalton","Damaris","Dameon","Damian","Damien","Damion","Damon","Dan","Dana","Dandre","Dane
vendor: 20,735 bytes, line 847
847","Dangelo","Danial","Daniela","Daniella","Danielle","Danika","Dannie","Danny","Dante","Danyka","Daphne","Daphnee","Daphney","Darby","Daren","Darian","Dariana","Darien","Dario","Darion","Darius","Darlene","Daron","Darrel","Darrell","Darren","Darrick","Darrin","Darrion","Darron","Darryl","Darwin","Daryl","Dashawn","Dasia","Dave","David","Davin","Davion","Davon","Davonte","Dawn","Dawson","Dax","Dayana","Dayna","Dayne","Dayton","Dean","Deangelo","Deanna","Deborah","Declan","Dedric","Dedrick","Dee","Deion","Deja","Dejah","Dejon","Dejuan","Delaney","Delbert","Delfina","Delia","Delilah","Dell","Della","Delmer","Delores","Delpha","Delphia","Delphine","Delta","Demarco","Demarcus","Demario","Demetris","Demetrius","Demond","Dena","Denis","Dennis","Deon","Deondre","Deontae","Deonte","Dereck","Derek","Derick","Deron","Derrick","Deshaun","Deshawn","Desiree","Desmond","Dessie","Destany","Destin","Destinee","Destiney","Destini","Destiny","Devan","Devante","Deven","Devin","Devon","Devonte","Devyn","Dewayne","Dewitt","Dexter","Diamond","Diana","Dianna","Diego","Dillan","Dillon","Dimitri","Dina","Dino","Dion","Dixie","Dock","Dolly","Dolores","Domenic","Domenica","Domenick","Domenico","Domingo","Dominic","Dominique","Don","Donald","Donato","Donavon","Donna","Donnell","Donnie","Donny","Dora","Dorcas","Dorian","Doris","Dorothea","Dorothy","Dorris","Dortha","Dorthy","Doug","Douglas","Dovie","Doyle","Drake","Drew","Duane","Dudley","Dulce","Duncan","Durward","Dustin","Dusty","Dwight","Dylan","Earl","Earlene","Earline","Earnest","Earnestine","Easter","Easton","Ebba","Ebony","Ed","Eda","Edd","Eddie","Eden","Edgar","Edgardo","Edison","Edmond","Edmund","Edna","Eduardo","Edward","Edwardo","Edwin","Edwina","Edyth","Edythe","Effie","Efrain","Efren","Eileen","Einar","Eino","Eladio","Elaina","Elbert","Elda","Eldon","Eldora","Eldred","Eldridge","Eleanora","Eleanore","Eleazar","Electa","Elena","Elenor","Elenora","Eleonore","Elfrieda","Eli","Elian","Eliane","Elias","Eliezer","Elijah","Elinor","Elinore","Elisa","Elisabeth","Elise","Eliseo","Elisha","Elissa","Eliza","Elizabeth","Ella","Ellen","Ellie","Elliot","Elliott","Ellis","Ellsworth","Elmer","Elmira","Elmo","Elmore","Elna","Elnora","Elody","Eloisa","Eloise","Elouise","Eloy","Elroy","Elsa","Else","Elsie","Elta","Elton","Elva","Elvera","Elvie","Elvis","Elwin","Elwyn","Elyse","Elyssa","Elza","Emanuel","Emelia","Emelie","Emely","Emerald","Emerson","Emery","Emie","Emil","Emile","Emilia","Emiliano","Emilie","Emilio","Emily","Emma","Emmalee","Emmanuel","Emmanuelle","Emmet","Emmett","Emmie","Emmitt","Emmy","Emory","Ena","Enid","Enoch","Enola","Enos","Enrico","Enrique","Ephraim","Era","Eriberto","Eric","Erica","Erich","Erick","Ericka","Erik","Erika","Erin","Erling","Erna","Ernest","Ernestina","Ernestine","Ernesto","Ernie","Ervin","Erwin","Eryn","Esmeralda","Esperanza","Esta","Esteban","Estefania","Estel","Estell","Estella","Estelle","Estevan","Esther","Estrella","Etha","Ethan","Ethel","Ethelyn","Ethyl","Ettie","Eudora","Eugene","Eugenia","Eula","Eulah","Eulalia","Euna","Eunice","Eusebio","Eva","Evalyn","Evan","Evangeline","Evans","Eve","Eveline","Evelyn","Everardo","Everett","Everette","Evert","Evie","Ewald","Ewell","Ezekiel","Ezequiel","Ezra","Fabian","Fabiola","Fae","Fannie","Fanny","Fatima","Faustino","Fausto","Favian","Fay","Faye","Federico","Felicia","Felicita","Felicity","Felipa","Felipe","Felix","Felton","Fermin","Fern","Fernando","Ferne","Fidel","Filiberto","Filomena","Finn","Fiona","Flavie","Flavio","Fleta","Fletcher","Flo","Florence","Florencio","Florian","Florida","Florine","Flossie","Floy","Floyd","Ford","Forest","Forrest","Foster","Frances","Francesca","Francesco","Francis","Francisca","Francisco","Franco","Frank","Frankie","Franz","Fred","Freda","Freddie","Freddy","Frederic","Frederick","Frederik","Frederique","Fredrick","Fredy","Freeda","Freeman","Freida","Frida","Frieda","Friedrich","Fritz","Furman","Gabe","Gabriel","Gabriella","Gabrielle","Gaetano","Gage","Gail","Gardner","Garett","Garfield","Garland","Garnet","Garnett","Garret","Garrett","Garrick","Garrison","Garry","Garth","Gaston","Gavin","Gayle","Gene","General","Genesis","Genevieve","Gennaro","Genoveva","Geo","Geoffrey","George","Georgette","Georgiana","Georgianna","Geovanni","Geovanny","Geovany","Gerald","Geraldine","Gerard","Gerardo","Gerda","Gerhard","Germaine","German","Gerry","Gerson","Gertrude","Gia","Gianni","Gideon","Gilbert","Gilberto","Gilda","Giles","Gillian","Gina","Gino","Giovani","Giovanna","Giovanni","Giovanny","Gisselle","Giuseppe","Gladyce","Gladys","Glen","Glenda","Glenna","Glennie","Gloria","Godfrey","Golda","Golden","Gonzalo","Gordon","Grace","Gracie","Graciela","Grady","Graham","Grant","Granville","Grayce","Grayson","Green","Greg","Gregg","Gregoria","Gregorio","Gregory","Greta","Gretchen","Greyson","Griffin","Grover","Guadalupe","Gudrun","Guido","Guillermo","Guiseppe","Gunnar","Gunner","Gus","Gussie","Gust","Gustave","Guy","Gwen","Gwendolyn","Hadley","Hailee","Hailey","Hailie","Hal","Haleigh","Haley","Halie","Halle","Hallie","Hank","Hanna","Hannah","Hans","Hardy","Harley","Harmon","Harmony","Harold","Harrison","Harry","Harvey","Haskell","Hassan","Hassie","Hattie","Haven","Hayden","Haylee","Hayley","Haylie","Hazel","Hazle","Heath","Heather","Heaven","Heber","Hector","Heidi","Helen","Helena","Helene","Helga","Hellen","Helmer","Heloise","Henderson","Henri","Henriette","Henry","Herbert","Herman","Hermann","Hermina","Herminia","Herminio","Hershel","Herta","Hertha","Hester","Hettie","Hilario","Hilbert","Hilda","Hildegard","Hillard","Hillary","Hilma","Hilton","Hipolito","Hiram","Hobart","Holden","Hollie","Hollis","Holly","Hope","Horace","Horacio","Hortense","Hosea","Houston","Howard","Howell","Hoyt","Hubert","Hudson","Hugh","Hulda","Humberto","Hunter","Hyman","Ian","Ibrahim","Icie","Ida","Idell","Idella","Ignacio","Ignatius","Ike","Ila","Ilene","Iliana","Ima","Imani","Imelda","Immanuel","Imogene","Ines","Irma","Irving","Irwin","Isaac","Isabel","Isabell","Isabella","Isabelle","Isac","Isadore","Isai","Isaiah","Isaias","Isidro","Ismael","Isobel","Isom","Israel","Issac","Itzel","Iva","Ivah","Ivory","Ivy","Izabella","Izaiah","Jabari","Jace","Jacey","Jacinthe","Jacinto","Jack","Jackeline","Jackie","Jacklyn","Jackson","Jacky","Jaclyn","Jacquelyn","Jacques","Jacynthe","Jada","Jade","Jaden","Jadon","Jadyn","Jaeden","Jaida","Jaiden","Jailyn","Jaime","Jairo","Jakayla","Jake","Jakob","Jaleel","Jalen","Jalon","Jalyn","Jamaal","Jamal","Jamar","Jamarcus","Jamel","Jameson","Jamey","Jamie","Jamil","Jamir","Jamison","Jammie","Jan","Jana","Janae","Jane","Janelle","Janessa","Janet","Janice","Janick","Janie","Janis","Janiya","Jannie","Jany","Jaquan","Jaquelin","Jaqueline","Jared","Jaren","Jarod","Jaron","Jarred","Jarrell","Jarret","Jarrett","Jarrod","Jarvis","Jasen","Jasmin","Jason","Jasper","Jaunita","Javier","Javon","Javonte","Jay","Jayce","Jaycee","Jayda","Jayde","Jayden","Jaydon","Jaylan","Jaylen","Jaylin","Jaylon","Jayme","Jayne","Jayson","Jazlyn","Jazmin","Jazmyn","Jazmyne","Jean","Jeanette","Jeanie","Jeanne","Jed","Jedediah","Jedidiah","Jeff","Jefferey","Jeffery","Jeffrey","Jeffry","Jena","Jenifer","Jennie","Jennifer","Jennings","Jennyfer","Jensen","Jerad","Jerald","Jeramie","Jeramy","Jerel","Jeremie","Jeremy","Jermain","Jermaine","Jermey","Jerod","Jerome","Jeromy","Jerrell","Jerrod","Jerrold","Jerry","Jess","Jesse","Jessica","Jessie","Jessika","Jessy","Jessyca","Jesus","Jett","Jettie","Jevon","Jewel","Jewell","Jillian","Jimmie","Jimmy","Jo","Joan","Joana","Joanie","Joanne","Joannie","Joanny","Joany","Joaquin","Jocelyn","Jodie","Jody","Joe","Joel","Joelle","Joesph","Joey","Johan","Johann","Johanna","Johathan","John","Johnathan","Johnathon","Johnnie","Johnny","Johnpaul","Johnson","Jolie","Jon","Jonas","Jonatan","Jonathan","Jonathon","Jordan","Jordane","Jordi","Jordon","Jordy","Jordyn","Jorge","Jose","Josefa","Josefina","Joseph","Josephine","Josh","Joshua","Joshuah","Josiah","Josiane","Josianne","Josie","Josue","Jovan","Jovani","Jovanny","Jovany","Joy","Joyce","Juana","Juanita","Judah","Judd","Jude","Judge","Judson","Judy","Jules","Julia","Julian","Juliana","Julianne","Julie","Julien","Juliet","Julio","Julius","June","Junior","Junius","Justen","Justice","Justina","Justine","Juston","Justus","Justyn","Juvenal","Juwan","Kacey","Kaci","Kacie","Kade","Kaden","Kadin","Kaela","Kaelyn","Kaia","Kailee","Kailey","Kailyn","Kaitlin","Kaitlyn","Kale","Kaleb","Kaleigh","Kaley","Kali","Kallie","Kameron","Kamille","Kamren","Kamron","Kamryn","Kane","Kara","Kareem","Karelle","Karen","Kari","Kariane","Karianne","Karina","Karine","Karl","Karlee","Karley","Karli","Karlie","Karolann","Karson","Kasandra","Kasey","Kassandra","Katarina","Katelin","Katelyn","Katelynn","Katharina","Katherine","Katheryn","Kathleen","Kathlyn","Kathryn","Kathryne","Katlyn","Katlynn","Katrina","Katrine","Kattie","Kavon","Kay","Kaya","Kaycee","Kayden","Kayla","Kaylah","Kaylee","Kayleigh","Kayley","Kayli","Kaylie","Kaylin","Keagan","Keanu","Keara","Keaton","Keegan","Keeley","Keely","Keenan","Keira","Keith","Kellen","Kelley","Kelli","Kellie","Kelly","Kelsi","Kelsie","Kelton","Kelvin","Ken","Kendall","Kendra","Kendrick","Kenna","Kennedi","Kennedy","Kenneth","Kennith","Kenny","Kenton","Kenya","Kenyatta","Kenyon","Keon","Keshaun","Keshawn","Keven","Kevin","Kevon","Keyon","Keyshawn","Khalid","Khalil","Kian","Kiana","Kianna","Kiara","Kiarra","Kiel","Kiera","Kieran","Kiley","Kim","Kimberly","King","Kip","Kira","Kirk","Kirsten","Kirstin","Kitty","Kobe","Koby","Kody","Kolby","Kole","Korbin","Korey","Kory","Kraig","Kris","Krista","Kristian","Kristin","Kristina","Kristofer","Kristoffer","Kristopher","Kristy","Krystal","Krystel","Krystina","Kurt","Kurtis","Kyla","Kyle","Kylee","Kyleigh","Kyler","Kylie","Kyra","Lacey","Lacy","Ladarius","Lafayette","Laila","Laisha","Lamar","Lambert","Lamont","Lance","Landen","Lane","Laney","Larissa","Laron","Larry","Larue","Laura","Laurel","Lauren","Laurence","Lauretta","Lauriane","Laurianne","Laurie","Laurine","Laury","Lauryn","Lavada","Lavern","Laverna","Laverne","Lavina","Lavinia","Lavon","Lavonne","Lawrence","Lawson","Layla","Layne","Lazaro","Lea","Leann","Leanna","Leanne","Leatha","Leda","Lee","Leif","Leila","Leilani","Lela","Lelah","Leland","Lelia","Lempi","Lemuel","Lenna","Lennie","Lenny","Lenora","Lenore","Leo","Leola","Leon","Leonard","Leonardo","Leone","Leonel","Leonie","Leonor","Leonora","Leopold","Leopoldo","Leora","Lera","Lesley","Leslie","Lesly","Lessie","Lester","Leta","Letha","Letitia","Levi","Lew","Lewis","Lexi","Lexie","Lexus","Lia","Liam","Liana","Libbie","Libby","Lila","Lilian","Liliana","Liliane","Lilla","Lillian","Lilliana","Lillie","Lilly","Lily","Lilyan","Lina","Lincoln","Linda","Lindsay","Lindsey","Linnea","Linnie","Linwood","Lionel","Lisa","Lisandro","Lisette","Litzy","Liza","Lizeth","Lizzie","Llewellyn","Lloyd","Logan","Lois","Lola","Lolita","Loma","Lon","London","Lonie","Lonnie","Lonny","Lonzo","Lora","Loraine","Loren","Lorena","Lorenz","Lorenza","Lorenzo","Lori","Lorine","Lorna","Lottie","Lou","Louie","Louisa","Lourdes","Louvenia","Lowell","Loy","Loyal","Loyce","Lucas","Luciano","Lucie","Lucienne","Lucile","Lucinda","Lucio","Lucious","Lucius","Lucy","Ludie","Ludwig","Lue","Luella","Luigi","Luis","Luisa","Lukas","Lula","Lulu","Luna","Lupe","Lura","Lurline","Luther","Luz","Lyda","Lydia","Lyla","Lynn","Lyric","Lysanne","Mabel","Mabelle","Mable","Mac","Macey","Maci","Macie","Mack","Mackenzie","Macy","Madaline","Madalyn","Maddison","Madeline","Madelyn","Madelynn","Madge","Madie","Madilyn","Madisen","Madison","Madisyn","Madonna","Madyson","Mae","Maegan","Maeve","Mafalda","Magali","Magdalen","Magdalena","Maggie","Magnolia","Magnus","Maia","Maida","Maiya","Major","Makayla","Makenna","Makenzie","Malachi","Malcolm","Malika","Malinda","Mallie","Mallory","Malvina","Mandy","Manley","Manuel","Manuela","Mara","Marc","Marcel","Marcelina","Marcelino","Marcella","Marcelle","Marcellus","Marcelo","Marcia","Marco","Marcos","Marcus","Margaret","Margarete","Margarett","Margaretta","Margarette","Margarita","Marge","Margie","Margot","Margret","Marguerite","Maria","Mariah","Mariam","Marian","Mariana","Mariane","Marianna","Marianne","Mariano","Maribel","Marie","Mariela","Marielle","Marietta","Marilie","Marilou","Marilyne","Marina","Mario","Marion","Marisa","Marisol","Maritza","Marjolaine","Marjorie","Marjory","Mark","Markus","Marlee","Marlen","Marlene","Marley","Marlin","Marlon","Marques","Marquis","Marquise","Marshall","Marta","Martin","Martina","Martine","Marty","Marvin","Mary","Maryam","Maryjane","Maryse","Mason","Mateo","Mathew","Mathias","Mathilde","Matilda","Matilde","Matt","Matteo","Mattie","Maud","Maude","Maudie","Maureen","Maurice","Mauricio","Maurine","Maverick","Mavis","Max","Maxie","Maxime","Maximilian","Maximillia","Maximillian","Maximo","Maximus","Maxine","Maxwell","May","Maya","Maybell","Maybelle","Maye","Maymie","Maynard","Mayra","Mazie","Mckayla","Mckenna","Mckenzie","Meagan","Meaghan","Meda","Megane","Meggie","Meghan","Mekhi","Melany","Melba","Melisa","Melissa","Mellie","Melody","Melvin","Melvina","Melyna","Melyssa","Mercedes","Meredith","Merl","Merle","Merlin","Merritt","Mertie","Mervin","Meta","Mia","Micaela","Micah","Michael","Michaela","Michale","Micheal","Michel","Michele","Michelle","Miguel","Mikayla","Mike","Mikel","Milan","Miles","Milford","Miller","Millie","Milo","Milton","Mina","Minerva","Minnie","Miracle","Mireille","Mireya","Misael","Missouri","Misty","Mitchel","Mitchell","Mittie","Modesta","Modesto","Mohamed","Mohammad","Mohammed","Moises","Mollie","Molly","Mona","Monica","Monique","Monroe","Monserrat","Monserrate","Montana","Monte","Monty","Morgan","Moriah","Morris","Mortimer","Morton","Mose","Moses","Moshe","Mossie","Mozell","Mozelle","Muhammad","Muriel","Murl","Murphy","Murray","Mustafa","Mya","Myah","Mylene","Myles","Myra","Myriam","Myrl","Myrna","Myron","Myrtice","Myrtie","Myrtis","Myrtle","Nadia","Nakia","Name","Nannie","Naomi","Naomie","Napoleon","Narciso","Nash","Nasir","Nat","Natalia","Natalie","Natasha","Nathan","Nathanael","Nathanial","Nathaniel","Nathen","Nayeli","Neal","Ned","Nedra","Neha","Neil","Nelda","Nella","Nelle","Nellie","Nels","Nelson","Neoma","Nestor","Nettie","Neva","Newell","Newton","Nia","Nicholas","Nicholaus","Nichole","Nick","Nicklaus","Nickolas","Nico","Nicola","Nicolas","Nicole","Nicolette","Nigel","Nikita","Nikki","Nikko","Niko","Nikolas","Nils","Nina","Noah","Noble","Noe","Noel","Noelia","Noemi","Noemie","Noemy","Nola","Nolan","Nona","Nora","Norbert","Norberto","Norene","Norma","Norris","Norval","Norwood","Nova","Novella","Nya","Nyah","Nyasia","Obie","Oceane","Ocie","Octavia","Oda","Odell","Odessa","Odie","Ofelia","Okey","Ola","Olaf","Ole","Olen","Oleta","Olga","Olin","Oliver","Ollie","Oma","Omari","Omer","Ona","Onie","Opal","Ophelia","Ora","Oral","Oran","Oren","Orie","Orin","Orion","Orland","Orlando","Orlo","Orpha","Orrin","Orval","Orville","Osbaldo","Osborne","Oscar","Osvaldo","Oswald","Oswaldo","Otha","Otho","Otilia","Otis","Ottilie","Ottis","Otto","Ova","Owen","Ozella","Pablo","Paige","Palma","Pamela","Pansy","Paolo","Paris","Parker","Pascale","Pasquale","Pat","Patience","Patricia","Patrick","Patsy","Pattie","Paul","Paula","Pauline","Paxton","Payton","Pearl","Pearlie","Pearline","Pedro","Peggie","Penelope","Percival","Percy","Perry","Pete","Peter","Petra","Peyton","Philip","Phoebe","Phyllis","Pierce","Pierre","Pietro","Pink","Pinkie","Piper","Polly","Porter","Precious","Presley","Preston","Price","Prince","Princess","Priscilla","Providenci","Prudence","Queen","Queenie","Quentin","Quincy","Quinn","Quinten","Quinton","Rachael","Rachel","Rachelle","Rae","Raegan","Rafael","Rafaela","Raheem","Rahsaan","Rahul","Raina","Raleigh","Ralph","Ramiro","Ramon","Ramona","Randal","Randall","Randi","Randy","Ransom","Raoul","Raphael","Raphaelle","Raquel","Rashad","Rashawn","Rasheed","Raul","Raven","Ray","Raymond","Raymundo","Reagan","Reanna","Reba","Rebeca","Rebecca","Rebeka","Rebekah","Reece","Reed","Reese","Regan","Reggie","Reginald","Reid","Reilly","Reina","Reinhold","Remington","Rene","Renee","Ressie","Reta","Retha","Retta","Reuben","Reva","Rex","Rey","Reyes","Reymundo","Reyna","Reynold","Rhea","Rhett","Rhianna","Rhiannon","Rhoda","Ricardo","Richard","Richie","Richmond","Rick","Rickey","Rickie","Ricky","Rico","Rigoberto","Riley","Rita","River","Robb","Robbie","Robert","Roberta","Roberto","Robin","Robyn","Rocio","Rocky","Rod","Roderick","Rodger","Rodolfo","Rodrick","Rodrigo","Roel","Rogelio","Roger","Rogers","Rolando","Rollin","Roma","Romaine","Roman","Ron","Ronaldo","Ronny","Roosevelt","Rory","Rosa","Rosalee","Rosalia","Rosalind","Rosalinda","Rosalyn","Rosamond","Rosanna","Rosario","Roscoe","Rose","Rosella","Roselyn","Rosemarie","Rosemary","Rosendo","Rosetta","Rosie","Rosina","Roslyn","Ross","Rossie","Rowan","Rowena","Rowland","Roxane","Roxanne","Roy","Royal","Royce","Rozella","Ruben","Rubie","Ruby","Rubye","Rudolph","Rudy","Rupert","Russ","Russel","Russell","Rusty","Ruth","Ruthe","Ruthie","Ryan","Ryann","Ryder","Rylan","Rylee","Ryleigh","Ryley","Sabina","Sabrina","Sabryna","Sadie","Sadye","Sage","Saige","Sallie","Sally","Salma","Salvador","Salvatore","Sam","Samanta","Samantha","Samara","Samir","Sammie","Sammy","Samson","Sandra","Sandrine","Sandy","Sanford","Santa","Santiago","Santina","Santino","Santos","Sarah","Sarai","Sarina","Sasha","Saul","Savanah","Savanna","Savannah","Savion","Scarlett","Schuyler","Scot","Scottie","Scotty","Seamus","Sean","Sebastian","Sedrick","Selena","Selina","Selmer","Serena","Serenity","Seth","Shad","Shaina","Shakira","Shana","Shane","Shanel","Shanelle","Shania","Shanie","Shaniya","Shanna","Shannon","Shanny","Shanon","Shany","Sharon","Shaun","Shawn","Shawna","Shaylee","Shayna","Shayne","Shea","Sheila","Sheldon","Shemar","Sheridan","Sherman","Sherwood","Shirley","Shyann","Shyanne","Sibyl","Sid","Sidney","Sienna","Sierra","Sigmund","Sigrid","Sigurd","Silas","Sim","Simeon","Simone","Sincere","Sister","Skye","Skyla","Skylar","Sofia","Soledad","Solon","Sonia","Sonny","Sonya","Sophia","Sophie","Spencer","Stacey","Stacy","Stan","Stanford","Stanley","Stanton","Stefan","Stefanie","Stella","Stephan","Stephania","Stephanie","Stephany","Stephen","Stephon","Sterling","Steve","Stevie","Stewart","Stone","Stuart","Summer","Sunny","Susan","Susana","Susanna","Susie","Suzanne","Sven","Syble","Sydnee","Sydney","Sydni","Sydnie","Sylvan","Sylvester","Sylvia","Tabitha","Tad","Talia","Talon","Tamara","Tamia","Tania","Tanner","Tanya","Tara","Taryn","Tate","Tatum","Tatyana","Taurean","Tavares","Taya","Taylor","Teagan","Ted","Telly","Terence","Teresa","Terrance","Terrell","Terrence","Terrill","Terry","Tess","Tessie","Tevin","Thad","Thaddeus","Thalia","Thea","Thelma","Theo","Theodora","Theodore","Theresa","Therese","Theresia","Theron","Thomas","Thora","Thurman","Tia","Tiana","Tianna","Tiara","Tierra","Tiffany","Tillman","Timmothy","Timmy","Timothy","Tina","Tito","Titus","Tobin","Toby","Tod","Tom","Tomas","Tomasa","Tommie","Toney","Toni","Tony","Torey","Torrance","Torrey","Toy","Trace","Tracey","Tracy","Travis","Travon","Tre","Tremaine","Tremayne","Trent","Trenton","Tressa","Tressie","Treva","Trever","Trevion","Trevor","Trey","Trinity","Trisha","Tristian","Tristin","Triston","Troy","Trudie","Trycia","Trystan","Turner","Twila","Tyler","Tyra","Tyree","Tyreek","Tyrel","Tyrell","Tyrese","Tyrique","Tyshawn","Tyson","Ubaldo","Ulices","Ulises","Una","Unique","Urban","Uriah","Uriel","Ursula","Vada","Valentin","Valentina","Valentine","Valerie","Vallie","Van","Vance","Vanessa","Vaughn","Veda","Velda","Vella","Velma","Velva","Vena","Verda","Verdie","Vergie","Verla","Verlie","Vern","Verna","Verner","Vernice","Vernie","Vernon","Verona","Veronica","Vesta","Vicenta","Vicente","Vickie","Vicky","Victor","Victoria","Vida","Vidal","Vilma","Vince","Vincent","Vincenza","Vincenzo","Vinnie","Viola","Violet","Violette","Virgie","Virgil","Virginia","Virginie","Vita","Vito","Viva","Vivian","Viviane","Vivianne","Vivien","Vivienne","Vladimir","Wade","Waino","Waldo","Walker","Wallace","Walter","Walton","Wanda","Ward","Warren","Watson","Wava","Waylon","Wayne","Webster","Weldon","Wellington","Wendell","Wendy","Werner","Westley","Weston","Whitney","Wilber","Wilbert","Wilburn","Wiley","Wilford","Wilfred","Wilfredo","Wilfrid","Wilhelm","Wilhelmine","Will","Willa","Willard","William","Willie","Willis","Willow","Willy","Wilma","Wilmer","Wilson","Wilton","Winfield","Winifred","Winnifred","Winona","Winston","Woodrow","Wyatt","Wyman","Xander","Xavier","Xzavier","Yadira","Yasmeen","Yasmin","Yasmine","Yazmin","Yesenia","Yessenia","Yolanda","Yoshiko","Yvette","Yvonne","Zachariah","Zachary","Zachery","Zack","Zackary","Zackery","Zakary","Zander","Zane","Zaria","Zechariah","Zelda","Zella","Zelma","Zena","Zetta","Zion","Zita","Zoe","Zoey","Zoie","Zoila","Zola","Zora","Zula"],
847female:["Ada","Adrienne","Agnes","Alberta","Alexandra","Alexis","Alice","Alicia","Alison","Allison","Alma","Alyssa","Amanda","Amber","Amelia","Amy","Ana","Andrea","Angel","Angela","Angelica","Angelina","Angie","Anita","Ann","Anna","Anne","Annette","Annie","Antoinette","Antonia","April","Arlene","Ashley","Audrey","Barbara","Beatrice","Becky","Belinda","Bernadette","Bernice","Bertha","Bessie","Beth","Bethany","Betsy","Betty","Beulah","Beverly","Billie","Blanca","Blanche","Bobbie","Bonnie","Brandi","Brandy","Brenda","Bridget","Brittany","Brooke","Camille","Candace","Candice","Carla","Carmen","Carol","Carole","Caroline","Carolyn","Carrie","Casey","Cassandra","Catherine","Cathy","Cecelia","Cecilia","Celia","Charlene","Charlotte","Chelsea","Cheryl","Christie","Christina","Christine","Christy","Cindy","Claire","Clara","Claudia","Colleen","Connie","Constance","Cora","Courtney","Cristina","Crystal","Cynthia","Daisy","Dana","Danielle","Darla","Darlene","Dawn","Deanna","Debbie","Deborah","Debra","Delia","Della","Delores","Denise","Desiree","Diana","Diane","Dianna","Dianne","Dixie","Dolores","Donna","Dora","Doreen","Doris","Dorothy","Ebony","Edith","Edna","Eileen","Elaine","Eleanor","Elena","Elisa","Elizabeth","Ella","Ellen","Eloise","Elsa","Elsie","Elvira","Emily","Emma","Erica","Erika","Erin","Erma","Ernestine","Essie","Estelle","Esther","Ethel","Eula","Eunice","Eva","Evelyn","Faith","Fannie","Faye","Felicia","Flora","Florence","Frances","Francis","Freda","Gail","Gayle","Geneva","Genevieve","Georgia","Geraldine","Gertrude","Gina","Ginger","Gladys","Glenda","Gloria","Grace","Gretchen","Guadalupe","Gwen","Gwendolyn","Hannah","Harriet","Hattie","Hazel","Heather","Heidi","Helen","Henrietta","Hilda","Holly","Hope","Ida","Inez","Irene","Iris","Irma","Isabel","Jackie","Jacqueline","Jacquelyn","Jaime","Jamie","Jan","Jana","Jane","Janet","Janice","Janie","Janis","Jasmine","Jean","Jeanette","Jeanne","Jeannette","Jeannie","Jenna","Jennie","Jennifer","Jenny","Jessica","Jessie","Jill","Jo","Joan","Joann","Joanna","Joanne","Jodi","Jody","Johanna","Johnnie","Josefina","Josephine","Joy","Joyce","Juana","Juanita","Judith","Judy","Julia","Julie","June","Kara","Karen","Kari","Karla","Kate","Katherine","Kathleen","Kathryn","Kathy","Katie","Katrina","Kay","Kayla","Kelley","Kelli","Kellie","Kelly","Kendra","Kerry","Kim","Kimberly","Krista","Kristen","Kristi","Kristie","Kristin","Kristina","Kristine","Kristy","Krystal","Lana","Latoya","Laura","Lauren","Laurie","Laverne","Leah","Lee","Leigh","Lela","Lena","Leona","Leslie","Leticia","Lila","Lillian","Lillie","Linda","Lindsay","Lindsey","Lisa","Lois","Lola","Lora","Lorena","Lorene","Loretta","Lori","Lorraine","Louise","Lucia","Lucille","Lucy","Lula","Luz","Lydia","Lynda","Lynette","Lynn","Lynne","Mabel","Mable","Madeline","Mae","Maggie","Mamie","Mandy","Marcella","Marcia","Margaret","Margarita","Margie","Marguerite","Maria","Marian","Marianne","Marie","Marilyn","Marion","Marjorie","Marlene","Marsha","Marta","Martha","Mary","Maryann","Mattie","Maureen","Maxine","May","Megan","Meghan","Melanie","Melba","Melinda","Melissa","Melody","Mercedes","Meredith","Michele","Michelle","Mildred","Mindy","Minnie","Miranda","Miriam","Misty","Molly","Mona","Monica","Monique","Muriel","Myra","Myrtle","Nadine","Nancy","Naomi","Natalie","Natasha","Nellie","Nettie","Nichole","Nicole","Nina","Nora","Norma","Olga","Olive","Olivia","Ollie","Opal","Ora","Pam","Pamela","Pat","Patricia","Patsy","Patti","Patty","Paula","Paulette","Pauline","Pearl","Peggy","Penny","Phyllis","Priscilla","Rachael","Rachel","Ramona","Raquel","Rebecca","Regina","Renee","Rhonda","Rita","Roberta","Robin","Robyn","Rochelle","Rosa","Rosalie","Rose","Rosemarie","Rosemary","Rosie","Roxanne","Ruby","Ruth","Sabrina","Sadie","Sally","Samantha","Sandra","Sandy","Sara","Sarah","Shannon","Shari","Sharon","Shawna","Sheila","Shelia","Shelley","Shelly","Sheri","Sherri","Sherry","Sheryl","Shirley","Silvia","Sonia","Sonja","Sonya","Sophia","Sophie","Stacey","Stacy","Stella","Stephanie","Sue","Susan","Susie","Suzanne","Sylvia","Tabitha","Tamara","Tami","Tammy","Tanya","Tara","Tasha","Teresa","Teri","Terri","Terry","Thelma","Theresa","Tiffany","Tina","Toni","Tonya","Tracey","Traci","Tracy","Tricia","Valerie","Vanessa","Velma","Vera","Verna","Veronica","Vicki","Vickie","Vicky","Victoria","Viola","Violet","Virginia","Vivian","Wanda","Wendy","Whitney","Willie","Wilma","Winifred","Yolanda","Yvette","Yvonne"],male:["Aaron","Abel","Abraham","Adam","Adrian","Al","Alan","Albert","Alberto","Alejandro","Alex","Alexander","Alfonso","Alfred","Alfredo","Allan","Allen","Alonzo","Alton","Alvin","Amos","Andre","Andres","Andrew","Andy","Angel","Angelo","Anthony","Antonio","Archie","Armando","Arnold","Arthur","Arturo","Aubrey","Austin","Barry","Ben","Benjamin","Bennie","Benny","Bernard","Bert","Bill","Billy","Blake","Bob","Bobby","Boyd","Brad","Bradford","Bradley","Brandon","Brendan","Brent","Brett","Brian","Bruce","Bryan","Bryant","Byron","Caleb","Calvin","Cameron","Carl","Carlos","Carlton","Carroll","Cary","Casey","Cecil","Cedric","Cesar","Chad","Charles","Charlie","Chester","Chris","Christian","Christopher","Clarence","Clark","Claude","Clay","Clayton","Clifford","Clifton","Clint","Clinton","Clyde","Cody","Colin","Conrad","Corey","Cornelius","Cory","Courtney","Craig","Curtis","Dale","Dallas","Damon","Dan","Dana","Daniel","Danny","Darin","Darnell","Darrel","Darrell","Darren","Darrin","Darryl","Daryl","Dave","David","Dean","Delbert","Dennis","Derek","Derrick","Devin","Dewey","Dexter","Domingo","Dominic","Dominick","Don","Donald","Donnie","Doug","Douglas","Doyle","Drew","Duane","Dustin","Dwayne","Dwight","Earl","Earnest","Ed","Eddie","Edgar","Edmond","Edmund","Eduardo","Edward","Edwin","Elbert","Elias","Elijah","Ellis","Elmer","Emanuel","Emilio","Emmett","Enrique","Eric","Erick","Erik","Ernest","Ernesto","Ervin","Eugene","Evan","Everett","Felipe","Felix","Fernando","Floyd","Forrest","Francis","Francisco","Frank","Frankie","Franklin","Fred","Freddie","Frederick","Fredrick","Gabriel","Garrett","Garry","Gary","Gene","Geoffrey","George","Gerald","Gerard","Gerardo","Gilbert","Gilberto","Glen","Glenn","Gordon","Grady","Grant","Greg","Gregg","Gregory","Guadalupe","Guillermo","Gustavo","Guy","Harold","Harry","Harvey","Hector","Henry","Herbert","Herman","Homer","Horace","Howard","Hubert","Hugh","Hugo","Ian","Ignacio","Ira","Irvin","Irving","Isaac","Ismael","Israel","Ivan","Jack","Jackie","Jacob","Jaime","Jake","James","Jamie","Jan","Jared","Jason","Javier","Jay","Jean","Jeff","Jeffery","Jeffrey","Jerald","Jeremiah","Jeremy","Jermaine","Jerome","Jerry","Jesse","Jessie","Jesus","Jim","Jimmie","Jimmy","Jody","Joe","Joel","Joey","John","Johnathan","Johnnie","Johnny","Jon","Jonathan","Jonathon","Jordan","Jorge","Jose","Joseph","Josh","Joshua","Juan","Julian","Julio","Julius","Justin","Karl","Keith","Kelly","Kelvin","Ken","Kenneth","Kenny","Kent","Kerry","Kevin","Kim","Kirk","Kristopher","Kurt","Kyle","Lamar","Lance","Larry","Laurence","Lawrence","Lee","Leland","Leo","Leon","Leonard","Leroy","Leslie","Lester","Levi","Lewis","Lionel","Lloyd","Lonnie","Loren","Lorenzo","Louis","Lowell","Lucas","
847Luis","Luke","Luther","Lyle","Lynn","Mack","Malcolm","Manuel","Marc","Marco","Marcos","Marcus","Mario","Marion","Mark","Marlon","Marshall","Martin","Marty","Marvin","Mathew","Matt","Matthew","Maurice","Max","Melvin","Merle","Michael","Micheal","Miguel","Mike","Milton","Mitchell","Morris","Moses","Myron","Nathan","Nathaniel","Neal","Neil","Nelson","Nicholas","Nick","Nicolas","Noah","Noel","Norman","Oliver","Omar","Orlando","Orville","Oscar","Otis","Owen","Pablo","Pat","Patrick","Paul","Pedro","Percy","Perry","Pete","Peter","Phil","Philip","Phillip","Preston","Rafael","Ralph","Ramiro","Ramon","Randal","Randall","Randolph","Randy","Raul","Ray","Raymond","Reginald","Rene","Rex","Ricardo","Richard","Rick","Rickey","Ricky","Robert","Roberto","Robin","Roderick","Rodney","Rodolfo","Rogelio","Roger","Roland","Rolando","Roman","Ron","Ronald","Ronnie","Roosevelt","Ross","Roy","Ruben","Rudolph","Rudy","Rufus","Russell","Ryan","Salvador","Salvatore","Sam","Sammy","Samuel","Santiago","Santos","Saul","Scott","Sean","Sergio","Seth","Shane","Shannon","Shaun","Shawn","Sheldon","Sherman","Sidney","Simon","Spencer","Stanley","Stephen","Steve","Steven","Stewart","Stuart","Sylvester","Taylor","Ted","Terence","Terrance","Terrell","Terrence","Terry","Theodore","Thomas","Tim","Timmy","Timothy","Toby","Todd","Tom","Tomas","Tommie","Tommy","Tony","Tracy","Travis","Trevor","Troy","Tyler","Tyrone","Van","Vernon","Victor","Vincent","Virgil","Wade","Wallace","Walter","Warren","Wayne","Wendell","Wesley","Wilbert","Wilbur","Wilfred","Willard","William","Willie","Willis","Wilson","Winston","Wm","Woodrow","Zachary"]},kle=["Agender","Androgyne","Androgynous","Bigender","Cis female","Cis male","Cis man","Cis woman","Cis","Cisgender female","Cisgender male","Cisgender man","Cisgender woman","Cisgender","Demi-boy","Demi-girl","Demi-man","Demi-woman","Demiflux","Demigender","F2M","FTM","Female to male trans man","Female to male transgender man","Female to male transsexual man","Female to male","Gender fluid","Gender neutral","Gender nonconforming","Gender questioning","Gender variant","Genderflux","Genderqueer","Hermaphrodite","Intersex man","Intersex person","Intersex woman","Intersex","M2F","MTF","Male to female trans woman","Male to female transgender woman","Male to female transsexual woman","Male to female","Man","Multigender","Neither","Neutrois","Non-binary","Omnigender","Other","Pangender","Polygender","T* man","T* woman","Trans female","Trans male","Trans man","Trans person","Trans woman","Trans","Transsexual female","Transsexual male","Transsexual man","Transsexual person","Transsexual woman","Transsexual","Transgender female","Transgender person","Transmasculine","Trigender","Two* person","Two-spirit person","Two-spirit","Woman","Xenogender"],_le=["Solutions","Program","Brand","Security","Research","Marketing","Directives","Implementation","Integration","Functionality","Response","Paradigm","Tactics","Identity","Markets","Group","Division","Applications","Optimization","Operations","Infrastructure","Intranet","Communications","Web","Branding","Quality","Assurance","Mobility","Accounts","Data","Creative","Configuration","Accountability","Interactions","Factors","Usability","Metrics"],Ele=["Lead","Senior","Direct","Corporate","Dynamic","Future","Product","National","Regional","District","Central","Global","Customer","Investor","International","Legacy","Forward","Internal","Human","Chief","Principal"],Ale=["{{person.jobDescriptor}} {{person.jobArea}} {{person.jobType}}"],Dle=["Supervisor","Associate","Executive","Liaison","Officer","Manager","Engineer","Specialist","Director","Coordinator","Administrator","Architect","Analyst","Designer","Planner","Orchestrator","Technician","Developer","Producer","Consultant","Assistant","Facilitator","Agent","Representative","Strategist"],Tle={generic:["Abbott","Abernathy","Abshire","Adams","Altenwerth","Anderson","Ankunding","Armstrong","Auer","Aufderhar","Bahringer","Bailey","Balistreri","Barrows","Bartell","Bartoletti","Barton","Bashirian","Batz","Bauch","Baumbach","Bayer","Beahan","Beatty","Bechtelar","Becker","Bednar","Beer","Beier","Berge","Bergnaum","Bergstrom","Bernhard","Bernier","Bins","Blanda","Blick","Block","Bode","Boehm","Bogan","Bogisich","Borer","Bosco","Botsford","Boyer","Boyle","Bradtke","Brakus","Braun","Breitenberg","Brekke","Brown","Bruen","Buckridge","Carroll","Carter","Cartwright","Casper","Cassin","Champlin","Christiansen","Cole","Collier","Collins","Conn","Connelly","Conroy","Considine","Corkery","Cormier","Corwin","Cremin","Crist","Crona","Cronin","Crooks","Cruickshank","Cummerata","Cummings","D'Amore","Dach","Daniel","Dare","Daugherty","Davis","Deckow","Denesik","Dibbert","Dickens","Dicki","Dickinson","Dietrich","Donnelly","Dooley","Douglas","Doyle","DuBuque","Durgan","Ebert","Effertz","Emard","Emmerich","Erdman","Ernser","Fadel","Fahey","Farrell","Fay","Feeney","Feest","Feil","Ferry","Fisher","Flatley","Frami","Franecki","Franey","Friesen","Fritsch","Funk","Gerhold","Gerlach","Gibson","Gislason","Gleason","Gleichner","Glover","Goldner","Goodwin","Gorczany","Gottlieb","Goyette","Grady","Graham","Grant","Green","Greenfelder","Greenholt","Grimes","Gulgowski","Gusikowski","Gutkowski","Gutmann","Haag","Hackett","Hagenes","Hahn","Haley","Halvorson","Hamill","Hammes","Hand","Hane","Hansen","Harber","Harris","Hartmann","Harvey","Hauck","Hayes","Heaney","Heathcote","Hegmann","Heidenreich","Heller","Herman","Hermann","Hermiston","Herzog","Hessel","Hettinger","Hickle","Hilll","Hills","Hilpert","Hintz","Hirthe","Hodkiewicz","Hoeger","Homenick","Hoppe","Howe","Howell","Hudson","Huel","Huels","Hyatt","Jacobi","Jacobs","Jacobson","Jakubowski","Jaskolski","Jast","Jenkins","Jerde","Johns","Johnson","Johnston","Jones","Kassulke","Kautzer","Keebler","Keeling","Kemmer","Kerluke","Kertzmann","Kessler","Kiehn","Kihn","Kilback","King","Kirlin","Klein","Kling","Klocko","Koch","Koelpin","Koepp","Kohler","Konopelski","Koss","Kovacek","K
847ozey","Krajcik","Kreiger","Kris","Kshlerin","Kub","Kuhic","Kuhlman","Kuhn","Kulas","Kunde","Kunze","Kuphal","Kutch","Kuvalis","Labadie","Lakin","Lang","Langosh","Langworth","Larkin","Larson","Leannon","Lebsack","Ledner","Leffler","Legros","Lehner","Lemke","Lesch","Leuschke","Lind","Lindgren","Littel","Little","Lockman","Lowe","Lubowitz","Lueilwitz","Luettgen","Lynch","MacGyver","Macejkovic","Maggio","Mann","Mante","Marks","Marquardt","Marvin","Mayer","Mayert","McClure","McCullough","McDermott","McGlynn","McKenzie","McLaughlin","Medhurst","Mertz","Metz","Miller","Mills","Mitchell","Moen","Mohr","Monahan","Moore","Morar","Morissette","Mosciski","Mraz","Mueller","Muller","Murazik","Murphy","Murray","Nader","Nicolas","Nienow","Nikolaus","Nitzsche","Nolan","O'Connell","O'Conner","O'Hara","O'Keefe","O'Kon","O'Reilly","Oberbrunner","Okuneva","Olson","Ondricka","Orn","Ortiz","Osinski","Pacocha","Padberg","Pagac","Parisian","Parker","Paucek","Pfannerstill","Pfeffer","Pollich","Pouros","Powlowski","Predovic","Price","Prohaska","Prosacco","Purdy","Quigley","Quitzon","Rath","Ratke","Rau","Raynor","Reichel","Reichert","Reilly","Reinger","Rempel","Renner","Reynolds","Rice","Rippin","Ritchie","Robel","Roberts","Rodriguez","Rogahn","Rohan","Rolfson","Romaguera","Roob","Rosenbaum","Rowe","Ruecker","Runolfsdottir","Runolfsson","Runte","Russel","Rutherford","Ryan","Sanford","Satterfield","Sauer","Sawayn","Schaden","Schaefer","Schamberger","Schiller","Schimmel","Schinner","Schmeler","Schmidt","Schmitt","Schneider","Schoen","Schowalter","Sc
847hroeder","Schulist","Schultz","Schumm","Schuppe","Schuster","Senger","Shanahan","Shields","Simonis","Sipes","Skiles","Smith","Smitham","Spencer","Spinka","Sporer","Stamm","Stanton","Stark","Stehr","Steuber","Stiedemann","Stokes","Stoltenberg","Stracke","Streich","Stroman","Strosin","Swaniawski","Swift","Terry","Thiel","Thompson","Tillman","Torp","Torphy","Towne","Toy","Trantow","Tremblay","Treutel","Tromp","Turcotte","Turner","Ullrich","Upton","Vandervort","Veum","Volkman","Von","VonRueden","Waelchi","Walker","Walsh","Walter","Ward","Waters","Watsica","Weber","Wehner","Weimann","Weissnat","Welch","West","White","Wiegand","Wilderman","Wilkinson","Will","Williamson","Willms","Windler","Wintheiser","Wisoky","Wisozk","Witting","Wiza","Wolf","Wolff","Wuckert","Wunsch","Wyman","Yost","Yundt","Zboncak","Zemlak","Ziemann","Zieme","Zulauf"]},Mle={generic:[{value:"{{person.last_name.generic}}",weight:95},{value:"{{person.last_name.generic}}-{{person.last_name.generic}}",weight:5}]},Ple={generic:["Addison","Alex","Anderson","Angel","Arden","August","Austin","Avery","Bailey","Billie","Blake","Bowie","Brooklyn","Cameron","Charlie","Corey","Dakota","Drew","Elliott","Ellis","Emerson","Finley","Gray","Greer","Harper","Hayden","Jaden","James","Jamie","Jordan","Jules","Kai","Kendall","Kennedy","Kyle","Leslie","Logan","London","Marlowe","Micah","Nico","Noah","North","Parker","Phoenix","Quinn","Reagan","Reese","Reign","Riley","River","Robin","Rory","Rowan","Ryan","Sage","Sasha","Sawyer","Shawn","Shiloh","Skyler","Taylor"],female:["Abigail","Adele","Alex","Alice","Alisha","Amber","Amelia","Amora","Anaïs","Angelou","Anika","Anise","Annabel","Anne","Aphrodite","Aretha","Arya","Ashton","Aster","Audrey","Avery","Bailee","Bay","Belle","Beth","Billie","Blair","Blaise","Blake","Blanche","Blue","Bree","Brielle","Brienne","Brooke","Caleen","Candice","Caprice","Carelyn","Caylen","Celine","Cerise","Cia","Claire","Claudia","Clementine","Coral","Coraline","Dahlia","Dakota","Dawn","Della","Demi","Denise","Denver","Devine","Devon","Diana","Dylan","Ebony","Eden","Eleanor","Elein","Elizabeth","Ellen","Elodie","Eloise","Ember","Emma","Erin","Eyre","Faith","Farrah","Fawn","Fayre","Fern","France","Francis","Frida","Genisis","Georgia","Grace","Gwen","Harley","Harper","Hazel","Helen","Hippolyta","Holly","Hope","Imani","Iowa","Ireland","Irene","Iris","Isa","Isla","Ivy","Jade","Jane","Jazz","Jean","Jess","Jett","Jo","Joan","Jolie","Jordan","Josie","Journey","Joy","Jules","Julien","Juliet","Juniper","Justice","Kali","Karma","Kat","Kate","Kennedy","Keva","Kylie","Lake","Lane","Lark","Layla","Lee","Leigh","Leona","Lexi","London","Lou","Louise","Love","Luna","Lux","Lynn","Lyric","Maddie","Mae","Marie","Matilda","Maude","Maybel","Meadow","Medusa","Mercy","Michelle","Mirabel","Monroe","Morgan","Nalia","Naomi","Nova","Olive","Paige","Parker","Pax","Pearl","Penelope","Phoenix","Quinn","Rae","Rain","Raven","Ray","Raye","Rebel","Reese","Reeve","Regan","Riley","River","Robin","Rory","Rose","Royal","Ruth","Rylie","Sage","Sam","Saturn","Scout","Serena","Sky","Skylar","Sofia","Sophia","Storm","Sue","Suzanne","Sydney","Taylen","Taylor","Teagan","Tempest","Tenley","Thea","Trinity","Valerie","Venus","Vera","Violet","Willow","Winter","Xena","Zaylee","Zion","Zoe"],male:["Ace","Aiden","Alexander","Ander","Anthony","Asher","August","Aziel","Bear","Beckham","Benjamin","Buddy","Calvin","Carter","Charles","Christopher","Clyde","Cooper","Daniel","David","Dior","Dylan","Elijah","Ellis","Emerson","Ethan","Ezra","Fletcher","Flynn","Gabriel","Grayson","Gus","Hank","Harrison","Hendrix","Henry","Houston","Hudson","Hugh","Isaac","Jack","Jackson","Jacob","Jakobe","James","Jaxon","Jaxtyn","Jayden","John","Joseph","Josiah","Jude","Julian","Karsyn","Kenji","Kobe","Kylo","Lennon","Leo","Levi","Liam","Lincoln","Logan","Louis","Lucas","Lucky","Luke","Mason","Mateo","Matthew","Maverick","Michael","Monroe","Nixon","Ocean","Oliver","Otis","Otto","Owen","Ozzy","Parker","Rocky","Samuel","Sebastian","Sonny","Teddy","Theo","Theodore","Thomas","Truett","Walter","Warren","Watson","William","Wison","Wyatt","Ziggy","Zyair"]},Rle=[{value:"{{person.firstName}} {{person.lastName}}",weight:49},{value:"{{person.prefix}} {{person.firstName}} {{person.lastName}}",weight:7},{value:"{{person.firstName}} {{person.lastName}} {{person.suffix}}",weight:7},{value:"{{person.prefix}} {{person.firstName}} {{person.lastName}} {{person.suffix}}",weight:1}],Ble={generic:["Dr.","Miss","Mr.","Mrs.","Ms."],female:["Dr.","Miss","Mrs.","Ms."],male:["Dr.","Mr."]},Lle=["female","male"],Ile=["Jr.","Sr.","I","II","III","IV","V","MD","DDS","PhD","DVM"],Ole=["Aquarius","Pisces","Aries","Taurus","Gemini","Cancer","Leo","Virgo","Libra","Scorpio","Sagittarius","Capricorn"],zle={bio_part:Nle,bio_pattern:
847Fle,bio_supporter:Sle,first_name:Cle,gender:kle,job_area:_le,job_descriptor:Ele,job_title_pattern:Ale,job_type:Dle,last_name:Tle,last_name_pattern:Mle,middle_name:Ple,name:Rle,prefix:Ble,sex:Lle,suffix:Ile,western_zodiac_sign:Ole},Ule=zle,Hle=["!##-!##-####","(!##) !##-####","1-!##-!##-####","!##.!##.####","!##-!##-#### x###","(!##) !##-#### x###","1-!##-!##-#### x###","!##.!##.#### x###","!##-!##-#### x####","(!##) !##-#### x####","1-!##-!##-#### x####","!##.!##.#### x####","!##-!##-#### x#####","(!##) !##-#### x#####","1-!##-!##-#### x#####","!##.!##.#### x#####"],$le=["+1!##!######"],Wle=["(!##) !##-####"],qle={human:Hle,international:$le,national:Wle},Gle=qle,Vle={format:Gle},Kle=Vle,Jle=[{symbol:"H",name:"Hydrogen",atomicNumber:1},{symbol:"He",name:"Helium",atomicNumber:2},{symbol:"Li",name:"Lithium",atomicNumber:3},{symbol:"Be",name:"Beryllium",atomicNumber:4},{symbol:"B",name:"Boron",atomicNumber:5},{symbol:"C",name:"Carbon",atomicNumber:6},{symbol:"N",name:"Nitrogen",atomicNumber:7},{symbol:"O",name:"Oxygen",atomicNumber:8},{symbol:"F",name:"Fluorine",atomicNumber:9},{symbol:"Ne",name:"Neon",atomicNumber:10},{symbol:"Na",name:"Sodium",atomicNumber:11},{symbol:"Mg",name:"Magnesium",atomicNumber:12},{symbol:"Al",name:"Aluminium",atomicNumber:13},{symbol:"Si",name:"Silicon",atomicNumber:14},{symbol:"P",name:"Phosphorus",atomicNumber:15},{symbol:"S",name:"Sulfur",atomicNumber:16},{symbol:"Cl",name:"Chlorine",atomicNumber:17},{symbol:"Ar",name:"Argon",atomicNumber:18},{symbol:"K",name:"Potassium",atomicNumber:19},{symbol:"Ca",name:"Calcium",atomicNumber:20},{symbol:"Sc",name:"Scandium",atomicNumber:21},{symbol:"Ti",name:"Titanium",atomicNumber:22},{symbol:"V",name:"Vanadium",atomicNumber:23},{symbol:"Cr",name:"Chromium",atomicNumber:24},{symbol:"Mn",name:"Manganese",atomicNumber:25},{symbol:"Fe",name:"Iron",atomicNumber:26},{symbol:"Co",name:"Cobalt",atomicNumber:27},{symbol:"Ni",name:"Nickel",atomicNumber:28},{symbol:"Cu",name:"Copper",atomicNumber:29},{symbol:"Zn",name:"Zinc",atomicNumber:30},{symbol:"Ga",name:"Gallium",atomicNumber:31},{symbol:"Ge",name:"Germanium",atomicNumber:32},{symbol:"As",name:"Arsenic",atomicNumber:33},{symbol:"Se",name:"Selenium",atomicNumber:34},{symbol:"Br",name:"Bromine",atomicNumber:35},{symbol:"Kr",name:"Krypton",atomicNumber:36},{symbol:"Rb",name:"Rubidium",atomicNumber:37},{symbol:"Sr",name:"Strontium",atomicNumber:38},{symbol:"Y",name:"Yttrium",atomicNumber:39},{symbol:"Zr",name:"Zirconium",atomicNumber:40},{symbol:"Nb",name:"Niobium",atomicNumber:41},{symbol:"Mo",name:"Molybdenum",atomicNumber:42},{symbol:"Tc",name:"Technetium",atomicNumber:43},{symbol:"Ru",name:"Ruthenium",atomicNumber:44},{symbol:"Rh",name:"Rhodium",atomicNumber:45},{symbol:"Pd",name:"Palladium",atomicNumber:46},{symbol:"Ag",name:"Silver",atomicNumber:47},{symbol:"Cd",name:"Cadmium",atomicNumber:48},{symbol:"In",name:"Indium",atomicNumber:49},{symbol:"Sn",name:"Tin",atomicNumber:50},{symbol:"Sb",name:"Antimony",atomicNumber:51},{symbol:"Te",name:"Tellurium",atomicNumber:52},{symbol:"I",name:"Iodine",atomicNumber:53},{symbol:"Xe",name:"Xenon",atomicNumber:54},{symbol:"Cs",name:"Caesium",atomicNumber:55},{symbol:"Ba",name:"Barium",atomicNumber:56},{symbol:"La",name:"Lanthanum",atomicNumber:57},{symbol:"Ce",name:"Cerium",atomicNumber:58},{symbol:"Pr",name:"Praseodymium",atomicNumber:59},{symbol:"Nd",name:"Neodymium",atomicNumber:60},{symbol:"Pm",name:"Promethium",atomicNumber:61},{symbol:"Sm",name:"Samarium",atomicNumber:62},{symbol:"Eu",name:"Europium",atomicNumber:63},{symbol:"Gd",name:"Gadolinium",atomicNumber:64},{symbol:"Tb",name:"Terbium",atomicNumber:65},{symbol:"Dy",name:"Dysprosium",atomicNumber:66},{symbol:"Ho",name:"Holmium",atomicNumber:67},{symbol:"Er",name:"Erbium",atomicNumber:68},{symbol:"Tm",name:"Thulium",atomicNumber:69},{symbol:"Yb",name:"Ytterbium",atomicNumber:70},{symbol:"Lu",name:"Lutetium",atomicNumber:71},{symbol:"Hf",name:"Hafnium",atomicNumber:72},{symbol:"Ta",name:"Tantalum",atomicNumber:73},{symbol:"W",name:"Tungsten",atomicNumber:74},{symbol:"Re",name:"Rhenium",atomicNumber:75},{symbol:"Os",name:"Osmium",atomicNumber:76},{symbol:"Ir",name:"Iridium",atomicNumber:77},{symbol:"Pt",name:"Platinum",atomicNumber:78},{symbol:"Au",name:"Gold",atomicNumber:79},{symbol:"Hg",name:"Mercury",atomicNumber:80},{symbol:"Tl",name:"Thallium",atomicNumber:81},{symbol:"Pb",name:"Lead",atomicNumber:82},{symbol:"Bi",name:"Bismuth",atomicNumber:83},{symbol:"Po",name:"Polonium",atomicNumber:84},{symbol:"At",name:"Astatine",atomicNumber:85},{symbol:"Rn",name:"Radon",atomicNumber:86},{symbol:"Fr",name:"Francium",atomicNumber:87},{symbol:"Ra",name:"Radium",atomicNumber:88},{symbol:"Ac",name:"Actinium",atomicNumber:89},{symbol:"Th",name:"Thorium",atomicNumber:90},{symbol:"Pa",name:"Protactinium",atomicNumber:91},{symbol:"U",name:"Uranium",atomicNumber:92},{symbol:"Np",name:"Neptunium",atomicNumber:93},{symbol:"Pu",name:"Plutonium",atomicNumber:94},{symbol:"Am",name:"Americium",atomicNumber:95},{symbol:"Cm",name:"Curium",atomicNumber:96},{symbol:"Bk",name:"Berkelium",atomicNumber:97},{symbol:"Cf",name:"Californium",atomicNumber:98},{symbol:"Es",name:"Einsteinium",atomicNumber:99},{symbol:"Fm",name:"Fermium",atomicNumber:100},{symbol:"Md",name:"Mendelevium",atomicNumber:101},{symbol:"No",name:"Nobelium",atomicNumber:102},{symbol:"Lr",name:"Lawrencium",atomicNumber:103},{symbol:"Rf",name:"Rutherfordium",atomicNumber:104},{symbol:"Db",name:"Dubnium",atomicNumber:105},{symbol:"Sg",name:"Seaborgium",atomicNumber:106},{symbol:"Bh",name:"Bohrium",atomicNumber:107},{symbol:"Hs",name:"Hassium",atomicNumber:108},{symbol:"Mt",name:"Meitnerium",atomicNumber:109},{symbol:"Ds",name:"Darmstadtium",atomicNumber:110},{symbol:"Rg",name:"Roentgenium",atomicNumber:111},{symbol:"Cn",name:"Copernicium",atomicNumber:112},{symbol:"Nh",name:"Nihonium",atomicNumber:113}
847,{symbol:"Fl",name:"Flerovium",atomicNumber:114},{symbol:"Mc",name:"Moscovium",atomicNumber:115},{symbol:"Lv",name:"Livermorium",atomicNumber:116},{symbol:"Ts",name:"Tennessine",atomicNumber:117},{symbol:"Og",name:"Oganesson",atomicNumber:118}],Yle=[{name:"meter",symbol:"m"},{name:"second",symbol:"s"},{name:"mole",symbol:"mol"},{name:"ampere",symbol:"A"},{name:"kelvin",symbol:"K"},{name:"candela",symbol:"cd"},{name:"kilogram",symbol:"kg"},{name:"radian",symbol:"rad"},{name:"hertz",symbol:"Hz"},{name:"newton",symbol:"N"},{name:"pascal",symbol:"Pa"},{name:"joule",symbol:"J"},{name:"watt",symbol:"W"},{name:"coulomb",symbol:"C"},{name:"volt",symbol:"V"},{name:"ohm",symbol:"Ω"},{name:"tesla",symbol:"T"},{name:"degree Celsius",symbol:"°C"},{name:"lumen",symbol:"lm"},{name:"becquerel",symbol:"Bq"},{name:"gray",symbol:"Gy"},{name:"sievert",symbol:"Sv"},{name:"steradian",symbol:"sr"},{name:"farad",symbol:"F"},{name:"siemens",symbol:"S"},{name:"weber",symbol:"Wb"},{name:"henry",symbol:"H"},{name:"lux",symbol:"lx"},{name:"katal",symbol:"kat"}],Zle={chemical_element:Jle,unit:Yle},Xle=Zle,Qle=["ants","bats","bears","bees","birds","buffalo","cats","chickens","cattle","dogs","dolphins","ducks","elephants","fishes","foxes","frogs","geese","goats","horses","kangaroos","lions","monkeys","owls","oxen","penguins","people","pigs","rabbits","sheep","tigers","whales","wolves","zebras","banshees","crows","black cats","chimeras","ghosts","conspirators","dragons","dwarves","elves","enchanters","exorcists","sons","foes","giants","gnomes","goblins","gooses","griffins","lycanthropes","nemesis","ogres","oracles","prophets","sorcerors","spiders","spirits","vampires","warlocks","vixens","werewolves","witches","worshipers","zombies","druids"],ece=["{{location.state}} {{team.creature}}"],tce={creature:Qle,name:ece},rce=tce,sce=["Adventure Road Bicycle","BMX Bicycle","City Bicycle","Cruiser Bicycle","Cyclocross Bicycle","Dual-Sport Bicycle","Fitness Bicycle","Flat-Foot Comfort Bicycle","Folding Bicycle","Hybrid Bicycle","Mountain Bicycle","Recumbent Bicycle","Road Bicycle","Tandem Bicycle","Touring Bicycle","Track/Fixed-Gear Bicycle","Triathlon/Time Trial Bicycle","Tricycle"],nce=["Diesel","Electric","Gasoline","Hybrid"],ace=["Aston Martin","Audi","BMW","BYD","Bentley","Bugatti","Cadillac","Chevrolet","Chrysler","Citroën","Dodge","Ferrari","Fiat","Ford","Honda","Hyundai","Jaguar","Jeep","Kia","Lamborghini","Land Rover","MG","Mahindra & Mahindra","Maruti","Maserati","Mazda","Mercedes Benz","Mini","Mitsubishi","NIO","Nissan","Peugeot","Polestar","Porsche","Renault","Rivian","Rolls Royce","Skoda","Smart","Subaru","Suzuki","Tata","Tesla","Toyota","Vauxhall","Volkswagen","Volvo"],ice=["1","2","911","A4","A8","ATS","Accord","Alpine","Altima","Aventador","Beetle","CTS","CX-9","Camaro","Camry","Challenger","Charger","Civic","Colorado","Corvette","Countach","Cruze","Durango","El Camino","Element","Escalade","Expedition","Explorer","F-150","Fiesta","Focus","Fortwo","Golf","Grand Caravan","Grand Cherokee","Impala","Jetta","Land Cruiser","LeBaron","Malibu","Mercielago","Model 3","Model S","Model T","Model X","Model Y","Mustang","PT Cruiser","Prius","Ranchero","Roadster","Sentra","Silverado","Spyder","Taurus","V90","Volt","Wrangler","XC90","XTS"],oce=["Cargo Van","Convertible","Coupe","Crew Cab Pickup","Extended Cab Pickup","Hatchback","Minivan","Passenger Van","SUV","Sedan","Wagon"],lce={bicycle_type:sce,fuel:nce,manufacturer:ace,model:ice,type:oce},cce=lce,uce=["abandoned","able","acceptable","acclaimed","accomplished","accurate","aching","acidic","actual","admired","adolescent","advanced","affectionate","afraid","aged","aggravating","aggressive","agile","agitated","agreeable","ajar","alarmed","alert","alienated","alive","all","altruistic","amazing","ambitious","ample","amused","angelic","anguished","animated","annual","another","antique","any","apprehensive","appropriate","apt","arid","artistic","ashamed","assured","astonishing","athletic","austere","authentic","authorized","avaricious","average","aware","awesome","awful","babyish","back","bad","baggy","bare","basic","beloved","beneficial","best","better","big","biodegradable","bitter","black","black-and-white","blank","blaring","bleak","blind","blond","blue","blushing","bogus","boiling","bony","boring","bossy","both","bouncy","bowed","brave","breakable","bright","brilliant","brisk","broken","brown","bruised","bulky","burde
847nsome","burly","bustling","busy","buttery","buzzing","calculating","candid","carefree","careless","caring","cautious","cavernous","celebrated","charming","cheap","cheerful","chilly","chubby","circular","classic","clean","clear","clear-cut","close","closed","cloudy","clueless","clumsy","cluttered","coarse","colorful","colorless","colossal","comfortable","common","compassionate","competent","complete","complicated","concerned","concrete","confused","considerate","content","cool","cooperative","coordinated","corny","corrupt","courageous","courteous","crafty","crazy","creamy","creative","criminal","critical","crooked","crowded","cruel","crushing","cuddly","cultivated","cumbersome","curly","cute","damaged","damp","dapper","dark","darling","dazzling","dead","deadly","deafening","dearest","decent","decisive","deep","defenseless","defensive","deficient","definite","definitive","delectable","delicious","delirious","dense","dental","dependable","dependent","descriptive","deserted","determined","devoted","different","difficult","digital","diligent","dim","direct","dirty","discrete","disloyal","dismal","distant","distinct","distorted","doting","downright","drab","dramatic","dreary","dual","dull","dutiful","each","early","earnest","easy","ecstatic","edible","educated","elastic","elderly","electric","elegant","elementary","elliptical","eminent","emotional","empty","enchanted","enchanting","energetic","enlightened","enraged","entire","equatorial","essential","esteemed","ethical","everlasting","every","evil","exalted","excellent","excitable","excited","exhausted","exotic","expensive","experienced","expert","extra-large","extroverted","failing","faint","fair","fake","familiar","fantastic","far","far-flung","far-off","faraway","fat","fatal","fatherly","favorable","favorite","fearless","feline","filthy","fine","finished","firm","first","firsthand","fixed","flashy","flawed","flawless","flickering","flimsy","flowery","fluffy","flustered","focused","fond","foolhardy","foolish","forceful","formal","forsaken","fortunate","fragrant","frail","frank","free","french","frequent","friendly","frightened","frilly","frivolous","frizzy","front","frozen","frugal","fruitful","functional","funny","fussy","fuzzy","gaseous","general","gentle","genuine","gifted","gigantic","giving","glaring","glass","gleaming","glittering","gloomy","glorious","glossy","glum","golden","good","good-natured","gorgeous","graceful","gracious","grandiose","granular","grave","gray","great","greedy","grim","grimy","gripping","grizzled","grouchy","grounded","growing","grown","grubby","gruesome","grumpy","guilty","gullible","gummy","hairy","handsome","handy","happy","happy-go-lucky","hard-to-find","harmful","hasty","hateful","haunting","heartfelt","heavenly","heavy","hefty","helpful","helpless","hidden","hoarse","hollow","homely","honorable","honored","hopeful","hospitable","hot","huge","humble","humiliating","hungry","hurtful","husky","icy","ideal","idealistic","idolized","ignorant","ill","ill-fated","illiterate","illustrious","imaginary","imaginative","immaculate","immediate","immense","impartial","impassioned","impeccable","impish","impolite","important","impossible","impractical","impressionable","impressive","improbable","impure","inborn","incomparable","incomplete","inconsequential","indelible","indolent","inexperienced","infamous","infatuated","inferior","infinite","informal","innocent","insecure","insidious","insignificant","insistent","instructive","intelligent","intent","interesting","internal","international","intrepid","ironclad","irresponsible","jagged","jam-packed","jaunty","jealous","jittery","joyful","joyous","jubilant","judicious","juicy","jumbo","junior","juvenile","kaleidoscopic","key","knotty","knowledgeable","known","kooky","kosher","lanky","last","lasting","late","lavish","lawful","lazy","leading","lean","left","legal","light","lighthearted","likable","likely","limited","limp","limping","linear","lined","liquid","little","live","lively","livid","lone","lonely","long","long-term","lost","lovable","lovely","low","lucky","lumbering","lumpy","lustrous","mad","made-up","magnificent","majestic","major","male","mammoth","married","marvelous","massive","mature","meager","mealy","mean","measly","meaty","mediocre","medium","memorable","menacing","merry","messy","metallic","mild","milky","mindless","minor","minty","miserable","miserly","misguided","mixed","moist","monstrous","monthly","monumental","moral","motionless","muddy","muffled","multicolored","mundane","murky","mushy","musty","muted","mysterious","narrow","natural","naughty","nautical","near","neat","necessary","needy","negative","neglected","negligible","neighboring","nervous","new","next","nice","nifty","nimble","nippy","nocturnal","normal","noted","noteworthy","noxious","numb","nutritious","obedient","oblong","obvious","odd","oddball","official","oily","old","old-fashioned","only","optimal","optimistic","orange","orderly","ordinary","ornate","ornery","other","our","outgoing","outlandish","outlying","outrageous","outstanding","oval","overcooked","overdue","palatable","pale","paltry","parallel","parched","partial","passionate","pastel","peaceful","peppery","perfumed","perky","personal","pertinent","pessimistic","petty","phony","physical","pink","pitiful","plain","pleasant","pleased","pleasing","plump","pointed","pointless","polished","polite","political","poor","portly","posh","possible","potable","powerful","powerless","practical","precious","present","prestigious","pretty","pricey","prickly","primary","prime","private","probable","productive","profitable","profuse","proper","proud","prudent","punctual","puny","pure","purple","pushy","putrid","puzzled","qualified","quarrelsome","quarterly","queasy","querulous","questionable","quick","quick-witted","quiet","quintessential","quixotic","radiant","ragged","rapid","rare","raw","realistic","reasonable","recent","reckless","rectangular","red","reflecting","regal","regular","remarkable","remorseful","repentant","respectful","responsible","rewarding","rich","right","rigid","ripe","roasted","robust","rosy","rotating","rotten","rough","round","rowdy","royal","rubbery","ruddy","rundown","runny","rural","rusty","sad","salty","same","sandy","sarcastic","sardonic","scaly","scared","scary","scented","scientific","scornful","scratchy","second","second-hand","secondary","secret","self-assured","self-reliant","selfish","sentimental","separate","serene","serpentine","severe","shabby","shadowy","shady","shallow","shameful","shameless","shimmering","shiny","shocked","shoddy","short","short-term","showy","shrill","shy","sick","silent","silky","silver","similar","simple","simplistic","sinful","sizzling","skeletal","sleepy","slight","slimy","slow","slushy","
847small","smart","smoggy","smooth","smug","snappy","snarling","sneaky","sniveling","snoopy","sociable","soft","soggy","somber","some","sophisticated","sore","sorrowful","soulful","soupy","sour","spanish","sparkling","sparse","specific","speedy","spherical","spiffy","spirited","spiteful","splendid","spotless","square","squeaky","squiggly","stable","staid","stained","stale","standard","stark","steel","steep","sticky","stiff","stingy","stormy","straight","strange","strict","strident","striking","strong","stunning","stupendous","sturdy","stylish","subdued","submissive","substantial","subtle","suburban","sudden","sugary","sunny","super","superb","superficial","superior","supportive","sure-footed","surprised","svelte","sweet","swift","talkative","tall","tame","tangible","tasty","tattered","taut","tedious","teeming","tempting","tender","tense","tepid","terrible","that","these","thick","thin","thorny","thorough","those","thrifty","tidy","tight","timely","tinted","tiny","tired","torn","total","tough","tragic","trained","triangular","tricky","trim","trivial","troubled","true","trusting","trustworthy","trusty","turbulent","twin","ugly","ultimate","unaware","uncomfortable","uncommon","unconscious","understated","uneven","unfinished","unfit","unfortunate","unhappy","unhealthy","uniform","unimportant","unique","unkempt","unknown","unlawful","unlined","unlucky","unpleasant","unrealistic","unripe","unruly","unselfish","unsightly","unsteady","unsung","untidy","untimely","untried","untrue","unused","unusual","unwelcome","unwieldy","unwilling","unwritten","upbeat","upright","upset","urban","usable","useless","utilized","utter","vague","vain","valuable","variable","vast","velvety","vengeful","vibrant","victorious","violent","vivacious","vivid","voluminous","warlike","warm","warmhearted","warped","wasteful","waterlogged","watery","wavy","wealthy","weary","webbed","wee","weekly","weighty","weird","well-documented","well-groomed","well-lit","well-made","well-off","well-to-do","well-worn","which","whimsical","whirlwind","whispered","white","whole","whopping","wicked","wide","wide-eyed","wiggly","willing","wilted","winding","windy","winged","wise","witty","wobbly","woeful","wonderful","wordy","worldly","worse","worst","worthless","worthwhile","worthy","wrathful","wretched","writhing","wrong","wry","yearly","yellow","yellowish","young","youthful","yummy","zany","zealous","zesty"],dce=["abnormally","absentmindedly","accidentally","acidly","actually","adventurously","afterwards","almost","always","angrily","annually","anxiously","arrogantly","awkwardly","badly","bashfully","beautifully","bitterly","bleakly","blindly","blissfully","boastfully","boldly","bravely","briefly","brightly","briskly","broadly","busily","calmly","carefully","carelessly","cautiously","certainly","cheerfully","clearly","cleverly","closely","co
847axingly","colorfully","commonly","continually","coolly","correctly","courageously","crossly","cruelly","curiously","daily","daintily","dearly","deceivingly","deeply","defiantly","deliberately","delightfully","diligently","dimly","doubtfully","dreamily","easily","elegantly","energetically","enormously","enthusiastically","equally","especially","even","evenly","eventually","exactly","excitedly","extremely","fairly","faithfully","famously","far","fast","fatally","ferociously","fervently","fiercely","fondly","foolishly","fortunately","frankly","frantically","freely","frenetically","frightfully","fully","furiously","generally","generously","gently","gladly","gleefully","gracefully","gratefully","greatly","greedily","happily","hastily","healthily","heavily","helpfully","helplessly","highly","honestly","hopelessly","hourly","hungrily","immediately","innocently","inquisitively","instantly","intensely","intently","interestingly","inwardly","irritably","jaggedly","jealously","joshingly","jovially","joyfully","joyously","jubilantly","judgementally","justly","keenly","kiddingly","kindheartedly","kindly","kissingly","knavishly","knottily","knowingly","knowledgeably","kookily","lazily","less","lightly","likely","limply","lively","loftily","longingly","loosely","loudly","lovingly","loyally","madly","majestically","meaningfully","mechanically","merrily","miserably","mockingly","monthly","more","mortally","mostly","mysteriously","naturally","nearly","neatly","needily","nervously","never","nicely","noisily","not","obediently","obnoxiously","oddly","offensively","officially","often","only","openly","optimistically","overconfidently","owlishly","painfully","partially","patiently","perfectly","physically","playfully","politely","poorly","positively","potentially","powerfully","promptly","properly","punctually","quaintly","quarrelsomely","queasily","questionably","questioningly","quicker","quickly","quietly","quirkily","quizzically","rapidly","rarely","readily","really","reassuringly","recklessly","regularly","reluctantly","repeatedly","reproachfully","restfully","righteously","rightfully","rigidly","roughly","rudely","sadly","safely","scarcely","scarily","searchingly","sedately","seemingly","seldom","selfishly","separately","seriously","shakily","sharply","sheepishly","shrilly","shyly","silently","sleepily","slowly","smoothly","softly","solemnly","solidly","sometimes","soon","speedily","stealthily","sternly","strictly","successfully","suddenly","surprisingly","suspiciously","sweetly","swiftly","sympathetically","tenderly","tensely","terribly","thankfully","thoroughly","thoughtfully","tightly","tomorrow","too","tremendously","triumphantly","truly","truthfully","ultimately","unabashedly","unaccountably","unbearably","unethically","unexpectedly","unfortunately","unimpressively","unnaturally","unnecessarily","upbeat","upliftingly","upright","upside-down","upward","upwardly","urgently","usefully","uselessly","usually","utterly","vacantly","vaguely","vainly","valiantly","vastly","verbally","very","viciously","victoriously","violently","vivaciously","voluntarily","warmly","weakly","wearily","well","wetly","wholly","wildly","willfully","wisely","woefully","wonderfully","worriedly","wrongly","yawningly","yearly","yearningly","yesterday","yieldingly","youthfully"],hce=["after","although","and","as","because","before","but","consequently","even","finally","for","furthermore","hence","how","however","if","inasmuch","incidentally","indeed","instead","lest","likewise","meanwhile","nor","now","once","or","provided","since","so","supposing","than","that","though","till","unless","until","what","when","whenever","where","whereas","wherever","whether","which","while","who","whoever","whose","why","yet"],mce=["yuck","oh","phooey","blah","boo","whoa","yowza","huzzah","boohoo","fooey","geez","pfft","ew","ah","yum","brr","hm","yahoo","aha","woot","drat","gah","meh","psst","aw","ugh","yippee","eek","gee","bah","gadzooks","duh","ha","mmm","ouch","phew","ack","uh-huh","gosh","hmph","pish","zowie","er","ick","oof","um"],fce=["CD","SUV","abacus","academics","accelerator","accompanist","account","accountability","acquaintance","ad","adaptation","address","adrenalin","adult","advancement","advertisement","adviser","affect","affiliate","aftermath","agreement","airbus","aircraft","airline","airmail","airman","airport","alb","alert","allegation","alliance","alligator","allocation","almighty","amendment","amnesty","analogy","angle","annual","antelope","anticodon","apparatus","appliance","approach","apricot","arca
847de","archaeology","armchair","armoire","asset","assist","atrium","attraction","availability","avalanche","awareness","babushka","backbone","backburn","bakeware","bandwidth","bar","barge","baritone","barracks","baseboard","basket","bathhouse","bathrobe","battle","begonia","behest","bell","bench","bend","beret","best-seller","bid","bidet","bin","birdbath","birdcage","birth","blight","blossom","blowgun","bob","bog","bonfire","bonnet","bookcase","bookend","boulevard","bourgeoisie","bowler","bowling","boyfriend","brace","bracelet","bran","breastplate","brief","brochure","brook","brush","bug","bump","bungalow","cafe","cake","calculus","cannon","cantaloupe","cap","cappelletti","captain","caption","carboxyl","cardboard","carnival","case","casement","cash","casket","cassava","castanet","catalyst","cauliflower","cellar","celsius","cemetery","ceramic","ceramics","certification","chainstay","chairperson","challenge","championship","chap","chapel","character","characterization","charlatan","charm","chasuble","cheese","cheetah","chiffonier","chops","chow","cinder","cinema","circumference","citizen","clamp","clavicle","cleaner","climb","co-producer","coal","coast","cod","coil","coin","coliseum","collaboration","collectivization","colon","colonialism","comestible","commercial","commodity","community","comparison","completion","complication","compromise","concentration","configuration","confusion","conservation","conservative","consistency","contractor","contrail","convection","conversation","cook","coordination","cop-out","cope","cork","cornet","corporation","corral","cosset","costume","couch","council","councilman","countess","courtroom","cow","creator","creature","crest","cricket","crocodile","cross-contamination","cruelty","cuckoo","curl","custody","custom","cutlet","cutover","cycle","daddy","dandelion","dash","daughter","dead","decision","deck","declaration","decongestant","decryption","deduction","deed","deer","defendant","density","department","dependency","deployment","depot","derby","descendant","descent","design","designation","desk","detective","devastation","developing","developmental","devil","diagram","digestive","digit","dime","director","disadvantage","disappointment","disclosure","disconnection","discourse","dish","disk","disposer","distinction","diver","diversity","dividend","divine","doing","doorpost","doubter","draft","draw","dream","dredger","dress","drive","drug","duffel","dulcimer","dusk","duster","dwell","e-mail","earth","ecliptic","ectoderm","edge","editor","effector","eggplant","electronics","elevation","elevator","elver","embarrassment","embossing","emergent","encouragement","entry","epic","equal","essence","eternity","ethyl","euphonium","event","exasperation","excess","executor","exhaust","expansion","expense","experience","exploration","extension","extent","exterior","eyebrow","eyeliner","farm","farmer","fat","fax","feather","fedora","fellow","fen","fencing","ferret","festival","fibre","filter","final","finding","finer","finger","fireplace","fisherman","fishery","fit","flame","flat","fledgling","flight","flint","flood","flu","fog","fold","folklore","follower","following","foodstuffs","footrest","forage","forager","forgery","fork","formamide","formation","formula","fort","fowl","fraudster","freckle","freezing","freight","fuel","fun","fund","fundraising","futon","gallery","galoshes","gastropod","gazebo","gerbil","ghost","giant","gift","giggle","glider","gloom","goat","godfather","godparent","going","goodwill","governance","government","gown","gradient","graffiti","grandpa","grandson","granny","grass","gray","gripper","grouper","guacamole","guard","guidance","guide","gym","gymnast","habit","haircut","halt","hamburger","hammock","handful","handle","handover","harp","haversack","hawk","heartache","heartbeat","heating","hello","help","hepatitis","heroine","hexagon","hierarchy","hippodrome","honesty","hoof","hope","horde","hornet","horst","hose","hospitalization","hovel","hovercraft","hubris","humidity","humor","hundred","hunger","hunt","husband","hutch","hydrant","hydrocarbon","hydrolyse","hydrolyze","hyena","hygienic","hyphenation","ice-cream","icebreaker","igloo","ignorance","illusion","impact","import","importance","impostor","in-joke","incandescence","independence","individual","information","injunction","innovation","insolence","inspection","instance","institute","instruction","instructor","integer","intellect","
847intent","interchange","interior","intervention","interviewer","invite","iridescence","issue","jacket","jazz","jellyfish","jet","jogging","joy","juggernaut","jump","jungle","junior","jury","kettledrum","kick","kielbasa","kinase","king","kiss","kit","knickers","knight","knitting","knuckle","label","labourer","lace","lady","lamp","language","larva","lashes","laughter","lava","lawmaker","lay","leading","league","legend","legging","legislature","lender","license","lid","lieu","lifestyle","lift","linseed","litter","loaf","lobster","longboat","lotion","lounge","louse","lox","loyalty","luck","lyre","maestro","mainstream","maintainer","majority","makeover","making","mallard","management","manner","mantua","marathon","march","marimba","marketplace","marksman","markup","marten","massage","masterpiece","mathematics","meadow","meal","meander","meatloaf","mechanic","median","membership","mentor","merit","metabolite","metal","middle","midwife","milestone","millet","minion","minister","minor","minority","mixture","mobility","molasses","mom","moment","monasticism","monocle","monster","morbidity","morning","mortise","mountain","mouser","mousse","mozzarella","muscat","mythology","napkin","necklace","nectarine","negotiation","nephew","nerve","netsuke","newsletter","newsprint","newsstand","nightlife","noon","nougat","nucleotidase","nudge","numeracy","numeric","nun","obedience","obesity","object","obligation","ocelot","octave","offset","oil","omelet","onset","opera","operating","optimal","orchid","order","ostrich","other","outlaw","outrun","outset","overcoat","overheard","overload","ownership","pacemaker","packaging","paintwork","palate","pants","pantyhose","papa","parade","parsnip","partridge","passport","pasta","patroller","pear","pearl","pecan","pendant","peninsula","pension","peony","pepper","perfection","permafrost","perp","petal","petticoat","pharmacopoeia","phrase","pick","piglet","pigpen","pigsty","pile","pillbox","pillow","pilot","pine","pinstripe","place","plain","planula","plastic","platter","platypus","pleasure","pliers","plugin","plumber","pneumonia","pocket-watch","poetry","polarisation","polyester","pomelo","pop","poppy","popularity","populist","porter","possession","postbox","precedent","premeditation","premier","premise","premium","pressure","presume","priesthood","printer","privilege","procurement","produce","programme","prohibition","promise","pronoun","providence","provider","provision","publication","publicity","pulse","punctuation","pupil","puppet","puritan","quart","quinoa","quit","railway","range","rationale","ravioli","rawhide","reach","reasoning","reboot","receptor","recommendation","reconsideration","recovery","redesign","relative","release","remark","reorganisation","repeat","replacement","reporter","representation","republican","request","requirement","reservation","resolve","resource","responsibility","restaurant","retention","retrospectivity","reward","ribbon","rim","riser","roadway","role","rosemary","roundabout","rubric","ruin","rule","runway","rust","safe","sailor","saloon","sand","sandbar","sanity","sarong","sauerkraut","saw","scaffold","scale","scarification","scenario","schedule","schnitzel","scholarship","scorn","scorpion","scout","scrap","scratch","seafood","seagull","seal","season","secrecy","secret","section","sediment","self-confidence","sermon","sesame","settler","shadowbox","shark","shipper","shore","shoulder","sideboard","siege","sightseeing","signature","silk","simple","singing","skean","skeleton","skyline","skyscraper","slide","slime","slipper","smog","smoke","sock","soliloquy","solution","solvency","someplace","sonar","sonata","sonnet","soup","soybean","space","spear","spirit","spork","sport","spring","sprinkles","squid","stall","starboard","statue","status","stay","steak","steeple","step","step-mother","sticker","stir-fry","stitcher","stock","stool","story","strait","stranger","strategy","straw","stump","subexpression","submitter","subsidy","substitution","suitcase","summary","summer","sunbeam","sundae","supplier","surface","sushi","suspension","sustenance","swanling","swath","sweatshop","swim","swine","swing","switch","switchboard","swordfish","synergy","t-shirt","tabletop","tackle","tail","tapioca","taro","tarragon","taxicab","teammate","technician","technologist","tectonics","tenant","tenement","tennis","tentacle","teriyaki","term","testimonial","testing","thigh","thongs","thorn","thread","thunderbolt","thyme","tinderbox","toaster","tomatillo","tomb","tomography","tool","tooth","toothbrush","toothpick","topsail","traditionalism","traffic","translation","transom","transparency","trash","travel","tray","trench","tribe","tributary","trick","trolley","tuba","tuber","tune-up","turret","tusk","tuxedo","typeface","typewriter","unblinking","underneath","underpants","understanding","unibody","unique","unit","utilization","valentine","validity","valley","valuable","vanadyl","vein","velocity","venom","version","verve","vestment","veto","viability","vibraphone","vibration","vicinity","video","violin","vision","vista","vol","volleyball","wafer","waist","wallaby","warming","wasabi","waterspout","wear","wedding","whack","whale","wheel","widow","wilderness","willow","window","wombat","word","worth","wriggler","yak","yarmulke","yeast","yin","yogurt","zebra","zen"],pce=["a","abaft","aboard","about","above","absent","across","afore","after","against","along","alongside","amid","am
847idst","among","amongst","an","anenst","anti","apropos","apud","around","as","aside","astride","at","athwart","atop","barring","before","behind","below","beneath","beside","besides","between","beyond","but","by","circa","concerning","considering","despite","down","during","except","excepting","excluding","failing","following","for","forenenst","from","given","in","including","inside","into","lest","like","mid","midst","minus","modulo","near","next","notwithstanding","of","off","on","onto","opposite","out","outside","over","pace","past","per","plus","pro","qua","regarding","round","sans","save","since","than","the","through","throughout","till","times","to","toward","towards","under","underneath","unlike","until","unto","up","upon","versus","via","vice","with","within","without","worth"],gce=["abnegate","abscond","abseil","absolve","accentuate","accept","access","accessorise","accompany","account","accredit","achieve","acknowledge","acquire","adjourn","adjudge","admonish","adumbrate","advocate","afford","airbrush","ameliorate","amend","amount","anaesthetise","analyse","anesthetize","anneal","annex","antagonize","ape","apologise","apostrophize","appertain","appreciate","appropriate","approximate","arbitrate","archive","arraign","arrange","ascertain","ascribe","assail","atomize","attend","attest","attribute","augment","avow","axe","baa","banish","bank","baptise","battle","beard","beep","behold","belabor","bemuse","besmirch","bestride","better","bewail","bicycle","bide","bind","biodegrade","blacken","blaspheme","bleach","blend","blink","bliss","bloom","bludgeon","bobble","boggle","bolster","book","boom","bootleg","border","bore","boss","braid","brand","brandish","break","breed","broadcast","broadside","brood","browse","buck","burgeon","bus","butter","buzzing","camouflage","cannibalise","canter","cap","capitalise","capitalize","capsize","card","carouse","carp","carpool","catalog","catalyze","catch","categorise","cease","celebrate","censor","certify","char","charter","chase","chatter","chime","chip","christen","chromakey","chunder","chunter","cinch","circle","circulate","circumnavigate","clamor","clamour","claw","cleave","clinch","clinking","clone","clonk","coagulate","coexist","coincide","collaborate","colligate","colorize","colour","comb","come","commandeer","commemorate","communicate","compete","conceal","conceptualize","conclude","concrete","condense","cone","confide","confirm","confiscate","confound","confute","congregate","conjecture","connect","consign","construe","contradict","contrast","contravene","controvert","convalesce","converse","convince","convoke","coop","cop","corner","covenant","cow","crackle","cram","crank","creak","creaking","cripple","croon","cross","crumble","crystallize","culminate","culture","curry","curse","customise","cycle","dally","dampen","darn","debit","debut","decide","decode","decouple","decriminalize","deduce","deduct","deflate","deflect","deform","defrag","degenerate","degrease","delete","delight","deliquesce","demob","demobilise","democratize","demonstrate","denitrify","deny","depart","depend","deplore","deploy","deprave","depute","dereference","describe","desecrate","deselect","destock","detain","develop","devise","dial","dicker","digitize","dilate","disapprove","disarm","disbar","discontinue","disgorge","dishearten","dishonor","disinherit","dislocate","dispense","display","dispose","disrespect","dissemble","ditch","divert","dock","doodle","downchange","downshift","dowse","draft","drag","drain","dramatize","drowse","drum","dwell","economise","edge","efface","egg","eke","electrify","embalm","embed","embody","emboss","emerge","emphasise","emphasize","emulsify","encode","endow","enfold","engage","engender","enhance","enlist","enrage","enrich","enroll","entice","entomb","entrench","entwine","equate","essay","etch","eulogise","even","evince","exacerbate","exaggerate","exalt","exempt","exonerate","expatiate","explode","expostulate","extract","extricate","eyeglasses","fabricate","facilitate","factorise","factorize","fail","fall","familiarize","fashion","father","fathom","fax","federate","feminize","fence","fess","fictionalize","fiddle","fidget","fill","flash","fleck","flight","floodlight","floss","fluctuate","fluff","fly","focalise","foot","forearm","forecast","foretell","forgather","forgo","fork","form","forswear","founder","fraternise","fray","frizz","fumigate","function","furlough","fuss","gad","gallivant","galvanize","gape","garage","garrote","gasp","gestate","give","glimmer","glisten","gloat","gloss","glow","gnash","gnaw","goose","govern","grade","graduate","graft","grok","guest","guilt","gulp","gum","gurn","gust","gut","guzzle","ham","harangue","harvest","hassle","haul","haze","headline","hearten","heighten","highlight","hoick","hold","hole","hollow","holster","home","homeschool","hoot","horn","horse","hotfoot","house","hover","howl","huddle","huff","hunger","hunt","husk","hype","hypothesise","hypothesize","idle","ignite","imagineer","impact","impanel","implode","incinerate","incline","inculcate","industrialize","ingratiate","inhibit","inject","innovate","inscribe","insert","insist","inspect","institute","institutionalize","intend","intermarry","intermesh","intermix","internalise","internalize","internationalize","intrigue","inure","inveigle","inventory","investigate","irk","iterate","jaywalk","jell","jeopardise","jiggle","jive","joint","jot","jut","keel","knife","knit","know","kowtow","lack","lampoon","large","leap","lecture","legitimize","lend","libel","liberalize","license","ligate","list","lobotomise","lock","log","loose","low","lowball","machine","magnetize","major","make","malfunction","manage","manipulate","maroon","masculinize","mash","mask","masquerade","massage","masticate","materialise","matter","maul","memorise","merge","mesh","metabolise","microblog","microchip","micromanage","militate","mill","minister","minor","misappropriate","miscalculate","misfire","misjudge","miskey","mismatch","mispronounce","misread","misreport","misspend","mob","mobilise","mobilize","moisten","mooch","moor","moralise","mortar","mosh","mothball","motivate","motor","mould","mount","muddy","mummify","mutate","mystify","nab","narrate","narrowcast","nasalise","nauseate","navigate","neaten","neck","neglect","norm","notarize","object","obscure","observe","obsess","obstruct","obtrude","offend","offset","option","orchestrate","orient","orientate","outbid","outdo","outfit","outflank","outfox","outnumber","outrank","outrun","outsource","overburden","overcharge","overcook","overdub","overfeed","overload","overplay","overproduce","overreact","override","overspend","overstay","overtrain","overvalue","overwork","own","oxidise","oxidize","oxygenate","pace","pack","pale","pant","paralyse","parody","part","pause","pave","penalise","persecute","personalise","perspire","pertain","peter","pike","pillory","pinion","pip","pity","pivot","pixellate","plagiarise","plait","plan","please","pluck","ponder","popularize","portray","prance","preclude","preheat","prejudge","preregister","presell","preside","pretend","print","prioritize","probate","probe","proceed","procrastinate","profane","progress","proliferate","proofread","propound","proselytise","provision","pry","publicize","puff","pull","pulp","pulverize","purse","put","putrefy","quadruple","quaff","quantify","quarrel","quash","quaver","question","quiet","quintuple","quip","quit","rag","rally","ramp","randomize","rationalise","rationalize","ravage","ravel","react","readies","readjust","readmit","ready","reapply","rear","reassemble","rebel","reboot","reborn","rebound","rebuff","rebuild","rebuke","recede","reckon","reclassify","recompense","reconstitute","record","recount","redact","redevelop","redound","redraw","redress","reel","refer","reference","refine","reflate","refute","regulate","reiterate","rejigger","rejoin","rekindle","relaunch","relieve","remand","remark","reopen","reorient","replicate","repossess","represent","reprimand","reproach","reprove","repurpose","requite","reschedule","resort","respray","restructure","retool","retract","revere","revitalise","revoke","reword","rewrite","ride","ridge","rim","ring","rise","rival","roger","rosin","rot","rout","row","rue","rule","safeguard","sashay","sate","satirise","satirize","satisfy","saturate","savour","scale","scamper","scar","scare","scarper","scent","schematise","scheme","schlep","scoff","scoop","scope","scotch","scowl","scrabble","scram","scramble","scrape","screw","scruple","scrutinise","scuffle","scuttle","search","secularize","see","segregate","sell","sense","sensitize","sequester","serenade","serialize","serve","service","settle","sew","shaft","sham","shampoo","shanghai","shear","sheathe","shell","shinny","shirk","shoot","shoulder","shout","shovel","showboat","shred","shrill","shudder","shush","sidetrack","sign","silt","sin","singe","sit","sizzle","skateboard","ski","slake","slap","slather","sleet","slink","slip","slope","slump","smarten","smuggle","snack","sneak","
847sniff","snoop","snow","snowplow","snuggle","soap","solace","solder","solicit","source","spark","spattering","spectacles","spectate","spellcheck","spew","spice","spirit","splash","splay","split","splosh","splurge","spook","square","squirm","stabilise","stable","stack","stage","stake","starch","state","statement","stiffen","stigmatize","sting","stint","stoop","store","storyboard","stratify","structure","stuff","stunt","substantiate","subtract","suckle","suffice","suffocate","summarise","sun","sunbathe","sunder","sup","surge","surprise","swat","swathe","sway","swear","swelter","swerve","swill","swing","symbolise","synthesise","syringe","table","tabulate","tag","tame","tank","tankful","tarry","task","taxicab","team","telescope","tenant","terraform","terrorise","testify","think","throbbing","thump","tighten","toady","toe","tough","tousle","traduce","train","transcend","transplant","trash","treasure","treble","trek","trial","tromp","trouser","trust","tune","tut","twine","twist","typify","unbalance","uncork","uncover","underachieve","undergo","underplay","unearth","unfreeze","unfurl","unlearn","unscramble","unzip","uproot","upsell","usher","vacation","vamoose","vanish","vary","veg","venture","verify","vet","veto","volunteer","vulgarise","waft","wallop","waltz","warp","wash","waver","weary","weatherize","wedge","weep","weight","welcome","westernise","westernize","while","whine","whisper","whistle","whitewash","whup","wilt","wing","wire","wisecrack","wolf","wound","wring","writ","yak","yawn","yearn","yuppify"],xce={adjective:uce,adverb:dce,conjunction:hce,interjection:mce,noun:fce,preposition:pce,verb:gce},yce=xce,bce={airline:rie,animal:vie,app:Sie,book:Mie,cell_phone:Bie,color:Oie,commerce:Wie,company:eoe,database:soe,date:ooe,finance:woe,food:Moe,hacker:zoe,internet:qoe,location:dle,lorem:fle,metadata:gle,music:jle,person:Ule,phone_number:Kle,science:Xle,team:rce,vehicle:cce,word:yce},vce=bce,Tr=class extends Error{};function wce(t){let e=Object.getPrototypeOf(t);do{for(let r of Object.getOwnPropertyNames(e))typeof t[r]=="function"&&r!=="constructor"&&(t[r]=t[r].bind(t));e=Object.getPrototypeOf(e)}while(e!==Object.prototype)}var fp=class{constructor(e){this.faker=e,wce(this)}},pa=class extends fp{constructor(e){super(e),this.faker=e}},uI=(t=>(t.Narrowbody="narrowbody",t.Regional="regional",t.Widebody="widebody",t))(uI||{}),jce=["0","1","2","3","4","5","6","7","8","9"],Nce=["0","O","1","I","L"],Fce={regional:20,narrowbody:35,widebody:60},Sce={regional:["A","B","C","D"],narrowbody:["A","B","C","D","E","F"],widebody:["A","B","C","D","E","F","G","H","J","K"]},Cce=class extends pa{airport(){return this.faker.helpers.arrayElement(this.faker.definitions.airline.airport)}airline(){return this.faker.helpers.arrayElement(this.faker.definitions.airline.airline)}airplane(){return this.faker.helpers.arrayElement(this.faker.definitions.airline.airplane)}recordLocator(e={}){let{allowNumerics:r=!1,allowVisuallySimilarCharacters:n=!1}=e,a=[];return r||a.push(...jce),n||a.push(...Nce),this.faker.string.alphanumeric({length:6,casing:"upper",exclude:a})}seat(e={}){let{aircraftType:r="narrowbody"}=e,n=Fce[r],a=Sce[r],i=this.faker.number.int({min:1,max:n}),o=this.faker.helpers.arrayElement(a);return`${i}${o}`}aircraftType(){return this.faker.helpers.enumValue(uI)}flightNumber(e={}){let{length:r={min:1,max:4},addLeadingZeros:n=!1}=e,a=this.faker.string.numeric({length:r,allowLeadingZeros:!1});return n?a.padStart(4,"0"):a}},dI=(t=>(t.SRGB="sRGB",t.DisplayP3="display-p3",t.REC2020="rec2020",t.A98RGB="a98-rgb",t.ProphotoRGB="prophoto-rgb",t))(dI||{}),hI=(t=>(t.RGB="rgb",t.RGBA="rgba",t.HSL="hsl",t.HSLA="hsla",t.HWB="hwb",t.CMYK="cmyk",t.LAB="lab",t.LCH="lch",t.COLOR="color",t))(hI||{});function kce(t,e){let{prefix:r,casing:n}=e;switch(n){case"upper":{t=t.toUpperCase();break}case"lower":{t=t.toLowerCase();break}}return r&&(t=r+t),t}function mI(t){return t.map(e=>{if(e%1!==0){let r=new ArrayBuffer(4);new DataView(r).setFloat32(0,e);let n=new Uint8Array(r);return mI([...n]).replaceAll(" ","")}return(e>>>0).toString(2).padStart(8,"0")}).join(" ")}function rl(t){return Math.round(t*100)}function _ce(t,e="rgb",r="sRGB"){switch(e){case"rgba":return`rgba(${t[0]}, ${t[1]}, ${t[2]}, ${t[3]})`;case"color":return`color(${r} ${t[0]} ${t[1]} ${t[2]})`;case"cmyk":return`cmyk(${rl(t[0])}%, ${rl(t[1])}%, ${rl(t[2])}%, ${rl(t[3])}%)`;case"hsl":return`hsl(${t[0]}deg ${rl(t[1])}
847% ${rl(t[2])}%)`;case"hsla":return`hsl(${t[0]}deg ${rl(t[1])}% ${rl(t[2])}% / ${rl(t[3])})`;case"hwb":return`hwb(${t[0]} ${rl(t[1])}% ${rl(t[2])}%)`;case"lab":return`lab(${rl(t[0])}% ${t[1]} ${t[2]})`;case"lch":return`lch(${rl(t[0])}% ${t[1]} ${t[2]})`;case"rgb":return`rgb(${t[0]}, ${t[1]}, ${t[2]})`}}function lf(t,e,r="rgb",n="sRGB"){switch(e){case"css":return _ce(t,r,n);case"binary":return mI(t);case"decimal":return t}}var Ece=class extends pa{human(){return this.faker.helpers.arrayElement(this.faker.definitions.color.human)}space(){return this.faker.helpers.arrayElement(this.faker.definitions.color.space)}cssSupportedFunction(){return this.faker.helpers.enumValue(hI)}cssSupportedSpace(){return this.faker.helpers.enumValue(dI)}rgb(e={}){let{format:r="hex",includeAlpha:n=!1,prefix:a="#",casing:i="lower"}=e,o,l="rgb";return r==="hex"?(o=this.faker.string.hexadecimal({length:n?8:6,prefix:""}),o=kce(o,{prefix:a,casing:i}),o):(o=Array.from({length:3},()=>this.faker.number.int(255)),n&&(o.push(this.faker.number.float({multipleOf:.01})),l="rgba"),lf(o,r,l))}cmyk(e={}){let{format:r="decimal"}=e,n=Array.from({length:4},()=>this.faker.number.float({multipleOf:.01}));return lf(n,r,"cmyk")}hsl(e={}){let{format:r="decimal",includeAlpha:n=!1}=e,a=[this.faker.number.int(360)];for(let i=0;i<(e!=null&&e.includeAlpha?3:2);i++)a.push(this.faker.number.float({multipleOf:.01}));return lf(a,r,n?"hsla":"hsl")}hwb(e={}){let{format:r="decimal"}=e,n=[this.faker.number.int(360)];for(let a=0;a<2;a++)n.push(this.faker.number.float({multipleOf:.01}));return lf(n,r,"hwb")}lab(e={}){let{format:r="decimal"}=e,n=[this.faker.number.float({multipleOf:1e-6})];for(let a=0;a<2;a++)n.push(this.faker.number.float({min:-100,max:100,multipleOf:1e-4}));return lf(n,r,"lab")}lch(e={}){let{format:r="decimal"}=e,n=[this.faker.number.float({multipleOf:1e-6})];for(let a=0;a<2;a++)n.push(this.faker.number.float({max:230,multipleOf:.1}));return lf(n,r,"lch")}colorByCSSColorSpace(e={}){let{format:r="decimal",space:n="sRGB"}=e,a=Array.from({length:3},()=>this.faker.number.float({multipleOf:1e-4}));return lf(a,r,"color",n)}},fI=(t=>(t.Legacy="legacy",t.Segwit="segwit",t.Bech32="bech32",t.Taproot="taproot",t))(fI||{}),Ace=(t=>(t.Mainnet="mainnet",t.Testnet="testnet",t))(Ace||{}),Dce={legacy:{prefix:{mainnet:"1",testnet:"m"},length:{min:26,max:34},casing:"mixed",exclude:"0OIl"},segwit:{prefix:{mainnet:"3",testnet:"2"},length:{min:26,max:34},casing:"mixed",exclude:"0OIl"},bech32:{prefix:{mainnet:"bc1",testnet:"tb1"},length:{min:42,max:42},casing:"lower",exclude:"1bBiIoO"},taproot:{prefix:{mainnet:"bc1p",testnet:"tb1p"},length:{min:62,max:62},casing:"lower",exclude:"1bBiIoO"}},pI=typeof Buffer>"u"||!gI("base64")?t=>{let e=new TextEncoder().encode(t),r=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(r)}:t=>Buffer.from(t).toString("base64"),P5=typeof Buffer>"u"||!gI("base64url")?t=>pI(t).replaceAll("+","-").replaceAll("/","_").replaceAll(/=+$/g,""):t=>Buffer.from(t).toString("base64url");function gI(t){try{return typeof Buffer.from("test").toString(t)=="string"}catch{return!1}}function Yf(t){let{deprecated:e,since:r,until:n,proposed:a}=t,i=`[@faker-js/faker]: ${e} is deprecated`;r&&(i+=` since v${r}`),n&&(i+=` and will be removed in v${n}`),a&&(i+=`. Please use ${a} instead`),console.warn(`${i}.`)}var Tce=Object.fromEntries([["Ð","A"],["а","a"],["Ð","B"],["б","b"],["Ð","V"],["в","v"],["Ð","G"],["г","g"],["Ð","D"],["д","d"],["Ñе","ye"],["Ъе","Ye"],["ÑÐ","yE"],["ЪÐ","YE"],["Ð","E"],["е","e"],["Ð","Yo"],["Ñ","yo"],["Ð","Zh"],["ж","zh"],["Ð","Z"],["з","z"],["Ð","I"],["и","i"],["Ñй","iy"],["Ый","Iy"],["ЫÐ","IY"],["ÑÐ","iY"],["Ð","Y"],["й","y"],["Ð","K"],["к","k"],["Ð","L"],["л","l"],["Ð","M"],["м","m"],["Ð","N"],["н","n"],["Ð","O"],["о","o"],["Ð","P"],["п","p"],["Ð ","R"],["Ñ","r"],["С","S"],["Ñ","s"],["Т","T"],["Ñ","t"],["У","U"],["Ñ","u"],["Ф","F"],["Ñ","f"],["Ð¥","Kh"],["Ñ
","kh"],["Ц","Ts"],["Ñ","ts"],["Ч","Ch"],["Ñ","ch"],["Ш","Sh"],["Ñ","sh"],["Щ","Sch"],["Ñ","sch"],["Ъ",""],["Ñ",""],["Ы","Y"],["Ñ","y"],["Ь",""],["Ñ",""],["Ð","E"],["Ñ","e"],["Ю","Yu"],["Ñ","yu"],["Я","Ya"],["Ñ","ya"]]),Mce=Object.fromEntries([["α","a"],["β","v"],["γ","g"],["δ","d"],["ε","e"],["ζ","z"],["η","i"],["θ","th"],["ι","i"],["κ","k"],["λ","l"],["μ","m"],["ν","n"],["ξ","ks"],["ο","o"],["Ï","p"],["Ï","r"],["Ï","s"],["Ï","t"],["Ï
","y"],["Ï","f"],["Ï","x"],["Ï","ps"],["Ï","o"],["ά","a"],["Î","e"],["ί","
847i"],["Ï","o"],["Ï","y"],["ή","i"],["Ï","o"],["Ï","s"],["Ï","i"],["ΰ","y"],["Ï","y"],["Î","i"],["Î","A"],["Î","B"],["Î","G"],["Î","D"],["Î","E"],["Î","Z"],["Î","I"],["Î","TH"],["Î","I"],["Î","K"],["Î","L"],["Î","M"],["Î","N"],["Î","KS"],["Î","O"],["Î ","P"],["Ρ","R"],["Σ","S"],["Τ","T"],["Î¥","Y"],["Φ","F"],["Χ","X"],["Ψ","PS"],["Ω","O"],["Î","A"],["Î","E"],["Î","I"],["Î","O"],["Î","Y"],["Î","I"],["Î","O"],["Ϊ","I"],["Ϋ","Y"]]),Pce=Object.fromEntries([["Ø¡","e"],["Ø¢","a"],["Ø£","a"],["ؤ","w"],["Ø¥","i"],["ئ","y"],["ا","a"],["ب","b"],["Ø©","t"],["ت","t"],["Ø«","th"],["ج","j"],["Ø","h"],["Ø®","kh"],["د","d"],["ذ","dh"],["ر","r"],["ز","z"],["س","s"],["Ø´","sh"],["ص","s"],["ض","d"],["Ø·","t"],["ظ","z"],["ع","e"],["غ","gh"],["Ù","_"],["Ù","f"],["Ù","q"],["Ù","k"],["Ù","l"],["Ù
","m"],["Ù","n"],["Ù","h"],["Ù","w"],["Ù","a"],["Ù","y"],["Ùâ","a"],["Ù","u"],["Ùâ","i"]]),Rce=Object.fromEntries([["Õ¡","a"],["Ô±","A"],["Õ¢","b"],["Ô²","B"],["Õ£","g"],["Ô³","G"],["Õ¤","d"],["Ô´","D"],["Õ¥","ye"],["Ôµ","Ye"],["Õ¦","z"],["Ô¶","Z"],["Õ§","e"],["Ô·","E"],["Õ¨","y"],["Ô¸","Y"],["Õ©","t"],["Ô¹","T"],["Õª","zh"],["Ôº","Zh"],["Õ«","i"],["Ô»","I"],["Õ¬","l"],["Ô¼","L"],["Õ","kh"],["Ô½","Kh"],["Õ®","ts"],["Ô¾","Ts"],["Õ¯","k"],["Ô¿","K"],["Õ°","h"],["Õ","H"],["Õ±","dz"],["Õ","Dz"],["Õ²","gh"],["Õ","Gh"],["Õ³","tch"],["Õ","Tch"],["Õ´","m"],["Õ","M"],["Õµ","y"],["Õ
","Y"],["Õ¶","n"],["Õ","N"],["Õ·","sh"],["Õ","Sh"],["Õ¸","vo"],["Õ","Vo"],["Õ¹","ch"],["Õ","Ch"],["Õº","p"],["Õ","P"],["Õ»","j"],["Õ","J"],["Õ¼","r"],["Õ","R"],["Õ½","s"],["Õ","S"],["Õ¾","v"],["Õ","V"],["Õ¿","t"],["Õ","T"],["Ö","r"],["Õ","R"],["Ö","c"],["Õ","C"],["Õ¸Ö","u"],["ÕÕ","U"],["ÕÖ","U"],["Ö","p"],["Õ","P"],["Ö","q"],["Õ","Q"],["Ö
","o"],["Õ","O"],["Ö","f"],["Õ","F"],["Ö","yev"]]),Bce=Object.fromEntries([["Ú","ch"],["Ú©","k"],["Ú¯","g"],["Ù¾","p"],["Ú","zh"],["Û","y"]]),Lce=Object.fromEntries([["×","a"],["×","b"],["×","g"],["×","d"],["×","h"],["×","v"],["×","z"],["×","ch"],["×","t"],["×","y"],["×","k"],["×","kh"],["×","l"],["×","m"],["×","m"],["×","n"],["× ","n"],["ס","s"],["×¢","a"],["פ","f"],["×£","ph"],["צ","ts"],["×¥","ts"],["×§","k"],["ר","r"],["ש","sh"],["ת","t"],["×","v"]]),R5={...Tce,...Mce,...Pce,...Bce,...Rce,...Lce},Ice=(t=>(t.Any="any",t.Loopback="loopback",t.PrivateA="private-a",t.PrivateB="private-b",t.PrivateC="private-c",t.TestNet1="test-net-1",t.TestNet2="test-net-2",t.TestNet3="test-net-3",t.LinkLocal="link-local",t.Multicast="multicast",t))(Ice||{}),Oce={any:"0.0.0.0/0",loopback:"127.0.0.0/8","private-a":"10.0.0.0/8","private-b":"172.16.0.0/12","private-c":"192.168.0.0/16","test-net-1":"192.0.2.0/24","test-net-2":"198.51.100.0/24","test-net-3":"203.0.113.0/24","link-local":"169.254.0.0/16",multicast:"224.0.0.0/4"};function B5(t){return/^[a-z][a-z-]*[a-z]$/i.exec(t)!==null}function L5(t,e){let r=t.helpers.slugify(e);if(B5(r))return r;let n=t.helpers.slugify(t.lorem.word());return B5(n)?n:t.string.alpha({casing:"lower",length:t.number.int({min:4,max:8})})}function L2(t,e){return Math.floor((t.number.int(256)+e)/2).toString(16).padStart(2,"0")}var zce=class extends pa{email(e={}){let{firstName:r,lastName:n,provider:a=this.faker.helpers.arrayElement(this.faker.definitions.internet.free_email),allowSpecialCharacters:i=!1}=e,o=this.username({firstName:r,lastName:n});if(o=o.replaceAll(/[^A-Za-z0-9._+-]+/g,""),o=o.substring(0,50),i){let l=[..."._-"],c=[...".!#$%&'*+-/=?^_`{|}~"];o=o.replace(this.faker.helpers.arrayElement(l),this.faker.helpers.arrayElement(c))}return o=o.replaceAll(/\.{2,}/g,"."),o=o.replace(/^\./,""),o=o.replace(/\.$/,""),`${o}@${a}`}exampleEmail(e={}){let{firstName:r,lastName:n,allowSpecialCharacters:a=!1}=e,i=this.faker.helpers.arrayElement(this.faker.definitions.internet.example_email);return this.email({firstName:r,lastName:n,provider:i,allowSpecialCharacters:a})}userName(e={}){return Yf({deprecated:"faker.internet.userName()",proposed:"faker.internet.username()",since:"9.1.0",until:"10.0.0"}),this.username(e)}username(e={}){let{firstName:r=this.faker.person.firstName(),lastName:n=this.faker.person.lastName(),lastName:a}=e,i=this.faker.helpers.arrayElement([".","_"]),o=this.faker.number.int(99),l=[()=>`${r}${i}${n}${o}`,()=>`${r}${i}${n}`];a||l.push(()=>`${r}${o}`);let c=this.faker.helpers.arrayElement(l)();return c=c.normalize("NFKD").replaceAll(/[\u0300-\u036F]/g,""),c=[...c].map(u=>{if(R5[u])return R5[u];let d=u.codePointAt(0)??Number.NaN;return d<128?u:d.toString(36)}).join(""),c=c.toString().replaceAll("'",""),c=c.replaceAll(" ",""),c}displayName(e={}){let{firstName:r=this.faker.person.firstName(),lastName:n=this.faker.person.lastName()}=e,a=this.faker.helpers.arrayElement([".","_"]),i=this.faker.number.int(99),o=[()=>`${r}${i}`,()=>`${r}${a}${n}`,()=>`${r}${a}${n}${i}`],l=this.faker.helpers.arrayElement(o)();return l=l.toString().replaceAll("'",""),l=l.replaceAll(" ",""),l}protocol(){let e=["http","https"];return this.faker.helpers.arrayElement(e)}httpMethod(){let e=["GET","POST","PUT","DELETE","PATCH"];return this.faker.helpers.arrayElement(e)}httpStatusCode(e={}){let{types:r=Object.keys(this.faker.definitions.internet.http_status_code)}=e,n=this.faker.helpers.arrayElement(r);return this.faker.helpers.arrayElement(this.faker.definitions.internet.http_status_code[n])}url(e={}){let{appendSlash:r=this.faker.datatype.boolean(),protocol:n="https"}=e;return`${n}://${this.domainName()}${r?"/":""}`}domainName(){return`${this.domainWord()}.${this.domainSuffix()}`}domainSuffix(){return this.faker.helpers.arrayElement(this.faker.definitions.internet.domain_suffix)}domainWord(){let e=L5(this.faker,this.faker.word.adjective()),r=L5(this.faker,this.faker.word.noun());return`${e}-${r}`.toLowerCase()}ip(){return this.faker.datatype.boolean()?this.ipv4():this.ipv6()}ipv4(e={}){let{network:r="any",cidrBlock:n=Oce[r]}=e;if(!/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/\d{1,2}$/.test(n))throw new Tr(`Invalid CIDR block provided: ${n}. Must be in the format x.x.x.x/y.`);let[a,i]=n.split("/"),o=4294967295>>>Number.parseInt(i),[l,c,u,d]=a.split(".").map(Number),h=(l<<24|c<<16|u<<8|d)&~o,f=this.faker.number.int(o),m=h|f;return[m>>>24&255,m>>>16&255,m>>>8&255,m&255].join(".")}ipv6(){return Array.from({length:8},()=>this.faker.string.hexadecimal({length:4,casing:"lower",prefix:""})).join(":")}port(){return this.faker.number.int(65535)}userAgent(){return this.faker.helpers.fake(this.faker.definitions.internet.user_agent_pattern)}
847color(e={}){Yf({deprecated:"faker.internet.color()",proposed:"faker.color.rgb()",since:"9.6.0",until:"10.0.0"});let{redBase:r=0,greenBase:n=0,blueBase:a=0}=e,i=L2(this.faker,r),o=L2(this.faker,n),l=L2(this.faker,a);return`#${i}${o}${l}`}mac(e={}){typeof e=="string"&&(e={separator:e});let{separator:r=":"}=e,n,a="";for([":","-",""].includes(r)||(r=":"),n=0;n<12;n++)a+=this.faker.number.hex(15),n%2===1&&n!==11&&(a+=r);return a}password(e={}){let r=/[aeiouAEIOU]$/,n=/[bcdfghjklmnpqrstvwxyzBCDFGHJKLMNPQRSTVWXYZ]$/,a=(u,d,h,f)=>{if(f.length>=u)return f;d&&(h=n.test(f)?r:n);let m=this.faker.number.int(94)+33,g=String.fromCodePoint(m);return d&&(g=g.toLowerCase()),h.test(g)?a(u,d,h,f+g):a(u,d,h,f)},{length:i=15,memorable:o=!1,pattern:l=/\w/,prefix:c=""}=e;return a(i,o,l,c)}emoji(e={}){let{types:r=Object.keys(this.faker.definitions.internet.emoji)}=e,n=this.faker.helpers.arrayElement(r);return this.faker.helpers.arrayElement(this.faker.definitions.internet.emoji[n])}jwtAlgorithm(){return this.faker.helpers.arrayElement(this.faker.definitions.internet.jwt_algorithm)}jwt(e={}){let{refDate:r=this.faker.defaultRefDate()}=e,n=this.faker.date.recent({refDate:r}),{header:a={alg:this.jwtAlgorithm(),typ:"JWT"},payload:i={iat:Math.round(n.valueOf()/1e3),exp:Math.round(this.faker.date.soon({refDate:n}).valueOf()/1e3),nbf:Math.round(this.faker.date.anytime({refDate:r}).valueOf()/1e3),iss:this.faker.company.name(),sub:this.faker.string.uuid(),aud:this.faker.string.uuid(),jti:this.faker.string.uuid()}}=e,o=P5(JSON.stringify(a)),l=P5(JSON.stringify(i)),c=this.faker.string.alphanumeric(64);return`${o}.${l}.${c}`}},xI=(t=>(t.Female="female",t.Male="male",t))(xI||{});function fy(t,e,r){let{generic:n,female:a,male:i}=r;switch(e){case"female":return a??n;case"male":return i??n;default:return n??t.helpers.arrayElement([a,i])??[]}}var Uce=class extends pa{firstName(e){return this.faker.helpers.arrayElement(fy(this.faker,e,this.faker.definitions.person.first_name))}lastName(e){var r;if(((r=this.faker.rawDefinitions.person)==null?void 0:r.last_name_pattern)!=null){let n=this.faker.helpers.weightedArrayElement(fy(this.faker,e,this.faker.rawDefinitions.person.last_name_pattern));return this.faker.helpers.fake(n)}return this.faker.helpers.arrayElement(fy(this.faker,e,this.faker.definitions.person.last_name))}middleName(e){return this.faker.helpers.arrayElement(fy(this.faker,e,this.faker.definitions.person.middle_name))}fullName(e={}){let{sex:r=this.faker.helpers.arrayElement(["female","male"]),firstName:n=this.firstName(r),lastName:a=this.lastName(r)}=e,i=this.faker.helpers.weightedArrayElement(this.faker.definitions.person.name);return this.faker.helpers.mustache(i,{"person.prefix":()=>this.prefix(r),"person.firstName":()=>n,"person.middleName":()=>this.middleName(r),"person.lastName":()=>a,"person.suffix":()=>this.suffix()})}gender(){return this.faker.helpers.arrayElement(this.faker.definitions.person.gender)}sex(){return this.faker.helpers.arrayElement(this.faker.definitions.person.sex)}sexType(){return this.faker.helpers.enumValue(xI)}bio(){let{bio_pattern:e}=this.faker.definitions.person;return this.faker.helpers.fake(e)}prefix(e){return this.faker.helpers.arrayElement(fy(this.faker,e,this.faker.definitions.person.prefix))}suffix(){return this.faker.helpers.arrayElement(this.faker.definitions.person.suffix)}jobTitle(){return this.faker.helpers.fake(this.faker.definitions.person.job_title_pattern)}jobDescriptor(){return this.faker.helpers.arrayElement(this.faker.definitions.person.job_descriptor)}jobArea(){return this.faker.helpers.arrayElement(this.faker.definitions.person.job_area)}jobType(){return this.faker.helpers.arrayElement(this.faker.definitions.person.job_type)}zodiacSign(){return this.faker.helpers.arrayElement(this.faker.definitions.person.western_zodiac_sign)}},Hce=23283064365386963e-26,$ce=1/9007199254740992,{imul:VF,trunc:KF}=Math;function I5(t){return typeof t=="number"?yI(t):Wce(t)}function yI(t){let e=Array.from({length:624});e[0]=t;for(let r=1;r!==624;++r){let n=e[r-1]^e[r-1]>>>30;e[r]=KF(VF(1812433253,n)+r)}return e}function Wce(t){let e=yI(19650218),r=1,n=0;for(let a=Math.max(624,t.length);a!==0;--a){let i=e[r-1]^e[r-1]>>>30;e[r]=KF((e[r]^VF(i,1664525))+t[n]+n),r++,n++,r>=624&&(e[0]=e[623],r=1),n>=t.length&&(n=0)}for(let a=623;a!==0;a--)e[r]=KF((e[r]^VF(e[r-1]^e[r-1]>>>30,1566083941))-r),r++,r>=624&&(e[0]=e[623],r=1);return e[0]=2147483648,e}function I2(t){for(let r=0;r!==227;++r){let n=(t[r]&2147483648)+(t[r+1]&2147483647);t[r]=t[r+397]^n>>>1^-(n&1)&2567483615}for(let r=227;r!==623;++r){let n=(t[r]&2147483648)+(t[r+1]&2147483647);t[r]=t[r+397-624]^n>>>1^-(n&1)&2567483615}let e=(t[623]&2147483648)+(t[0]&2147483647);return t[623]=t[396]^e>>>1^-(e&1)&2567483615,t}var qce=class{constructor(e=Math.random()*Number.MAX_SAFE_INTEGER,r=I2(I5(e)),n=0){this.states=r,this.index=n}nextU32(){let e=this.states[this.index];return e^=this.states[this.index]>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,++this.index>=624&&(this.states=I2(this.states),this.index=0),e>>>0}nextF32(){return this.nextU32()*Hce}nextU53(){let e=this.nextU32()>>>5,r=this.nextU32()>>>6;return e*67108864+r}nextF53(){return this.nextU53()*$ce}seed(e){this.states=I2(I5(e)),this.index=0}};function bI(){return Math.ceil(Math.random()*Number.MAX_SAFE_INTEGER)}function Gce(t=bI()){let e=new qce(t);return{next(){return e.nextF53()},seed(r){e.seed(r)}}}var Vce=class extends fp{boolean(e={}){typeof e=="number"&&(e={probability:e});let{probability:r=.5}=e;return r<=0?!1:r>=1?!0:this.faker.number.float()<r}};function od(t,e="refDate"){let r=new Date(t);if(Number.isNaN(r.valueOf()))throw new Tr(`Invalid ${e} date: ${t.toString()}`);return r}var _1=()=>{throw new Tr("You cannot edit the locale data on the faker instance")};function Kce(t){let e={};return new Proxy(t,{has(){return!0},get(r,n){return typeof n=="symbol"||n==="nodeType"?r[n]:n in e?e[n]:e[n]=Jce(n,r[n])},set:_1,deleteProperty:_1})}function JF(t,...e){if(t===null)throw new Tr(`The locale data for '${e.join(".")}' aren't applicable to this locale. 848 If you think this is a bug, please report it at: https://github.com/faker-js/faker`);if(t===void 0)throw new Tr(`The locale data for '${e.join(".")}' are missing in this locale. 849 If this is a custom Faker instance, please make sure all required locales are used e.g. '[de_AT, de, en, base]'. 850 Please contribute the missing data to the project or use a locale/Faker instance that has these data. 851 For more information see https://fakerjs.dev/guide/localization.html`)}
vendor: 6,569 bytes, lines 851-854
851function Jce(t,e={}){return new Proxy(e,{has(r,n){return r[n]!=null},get(r,n){let a=r[n];return typeof n=="symbol"||n==="nodeType"||JF(a,t,n.toString()),a},set:_1,deleteProperty:_1})}var vI=class extends fp{anytime(e={}){let{refDate:r=this.faker.defaultRefDate()}=e,n=od(r).getTime();return this.between({from:n-1e3*60*60*24*365,to:n+1e3*60*60*24*365})}past(e={}){let{years:r=1,refDate:n=this.faker.defaultRefDate()}=e;if(r<=0)throw new Tr("Years must be greater than 0.");let a=od(n).getTime();return this.between({from:a-r*365*24*3600*1e3,to:a-1e3})}future(e={}){let{years:r=1,refDate:n=this.faker.defaultRefDate()}=e;if(r<=0)throw new Tr("Years must be greater than 0.");let a=od(n).getTime();return this.between({from:a+1e3,to:a+r*365*24*3600*1e3})}between(e){if(e==null||e.from==null||e.to==null)throw new Tr("Must pass an options object with `from` and `to` values.");let{from:r,to:n}=e,a=od(r,"from").getTime(),i=od(n,"to").getTime();if(a>i)throw new Tr("`from` date must be before `to` date.");return new Date(this.faker.number.int({min:a,max:i}))}betweens(e){if(e==null||e.from==null||e.to==null)throw new Tr("Must pass an options object with `from` and `to` values.");let{from:r,to:n,count:a=3}=e;return this.faker.helpers.multiple(()=>this.between({from:r,to:n}),{count:a}).sort((i,o)=>i.getTime()-o.getTime())}recent(e={}){let{days:r=1,refDate:n=this.faker.defaultRefDate()}=e;if(r<=0)throw new Tr("Days must be greater than 0.");let a=od(n).getTime();return this.between({from:a-r*24*3600*1e3,to:a-1e3})}soon(e={}){let{days:r=1,refDate:n=this.faker.defaultRefDate()}=e;if(r<=0)throw new Tr("Days must be greater than 0.");let a=od(n).getTime();return this.between({from:a+1e3,to:a+r*24*3600*1e3})}birthdate(e={}){let{mode:r="age",min:n=18,max:a=80,refDate:i=this.faker.defaultRefDate(),mode:o,min:l,max:c}=e;if([l,c,o].filter(h=>h!=null).length%3!==0)throw new Tr("The 'min', 'max', and 'mode' options must be set together.");let u=od(i),d=u.getUTCFullYear();switch(r){case"age":{let h=new Date(u).setUTCFullYear(d-a-1)+864e5,f=new Date(u).setUTCFullYear(d-n);if(h>f)throw new Tr(`Max age ${a} should be greater than or equal to min age ${n}.`);return this.between({from:h,to:f})}case"year":{let h=new Date(Date.UTC(0,0,2)).setUTCFullYear(n),f=new Date(Date.UTC(0,11,30)).setUTCFullYear(a);if(h>f)throw new Tr(`Max year ${a} should be greater than or equal to min year ${n}.`);return this.between({from:h,to:f})}}}},Yce=class extends vI{constructor(e){super(e),this.faker=e}month(e={}){let{abbreviated:r=!1,context:n=!1}=e,a=this.faker.definitions.date.month,i;r?i=n&&a.abbr_context!=null?"abbr_context":"abbr":i=n&&a.wide_context!=null?"wide_context":"wide";let o=a[i];return JF(o,"date.month",i),this.faker.helpers.arrayElement(o)}weekday(e={}){let{abbreviated:r=!1,context:n=!1}=e,a=this.faker.definitions.date.weekday,i;r?i=n&&a.abbr_context!=null?"abbr_context":"abbr":i=n&&a.wide_context!=null?"wide_context":"wide";let o=a[i];return JF(o,"date.weekday",i),this.faker.helpers.arrayElement(o)}timeZone(){return this.faker.helpers.arrayElement(this.faker.definitions.date.time_zone)}},Zce=/\.|\(/;function Xce(t,e,r=[e,e.rawDefinitions]){if(t.length===0)throw new Tr("Eval expression cannot be empty.");if(r.length===0)throw new Tr("Eval entrypoints cannot be empty.");let n=r,a=t;do{let o;a.startsWith("(")?[o,n]=Qce(a,n,t):[o,n]=tue(a,n),a=a.substring(o),n=n.filter(l=>l!=null).map(l=>Array.isArray(l)?e.helpers.arrayElement(l):l)}while(a.length>0&&n.length>0);if(n.length===0)throw new Tr(`Cannot resolve expression '${t}'`);let i=n[0];return typeof i=="function"?i():i}function Qce(t,e,r){let[n,a]=eue(t),i=t[n+1];switch(i){case".":case"(":case void 0:break;default:throw new Tr(`Expected dot ('.'), open parenthesis ('('), or nothing after function call but got '${i}'`)}return[n+(i==="."?2:1),e.map(o=>typeof o=="function"?o(...a):(console.warn(`[@faker-js/faker]: Invoking expressions which are not functions is deprecated since v9.0 and will be removed in v10.0. 852Please remove the parentheses or replace the expression with an actual function. 853${r} 854${" ".repeat(r.length-t.length)}^`),o))]}function eue(t){let e=t.indexOf(")",1);if(e===-1)throw new Tr(`Missing closing parenthesis in '${t}'`);for(;e!==-1;){let n=t.substring(1,e);try{return[e,JSON.parse(`[${n}]`)]}catch{if(!n.includes("'")&&!n.includes('"'))try{return[e,JSON.parse(`["${n}"]`)]}catch{}}e=t.indexOf(")",e+1)}e=t.lastIndexOf(")");let r=t.substring(1,e);return[e,[r]]}function tue(t,e){let r=Zce.exec(t),n=((r==null?void 0:r[0])??"")===".",a=(r==null?void 0:r.index)??t.length,i=t.substring(0,a);if(i.length===0)throw new Tr(`Expression parts cannot be empty in '${t}'`);let o=t[a+1];if(n&&(o==null||o==="."||o==="("))throw new Tr(`Found dot without property name in '${t}'`);return[a+(n?1:0),e.map(l=>rue(l,i))]}function rue(t,e){switch(typeof t){case"function":{try{t=t()}catch{return}return t==null?void 0:t[e]}case"object":return t==null?void 0:t[e];default:return}}function sue(t){let e=nue(t.replace(/L?$/,"0"));return e===0?0:10-e}function nue(t){t=t.replaceAll(/[\s-]/g,"");let e=0,r=!1;for(let n=t.length-1;n>=0;n--){let a=Number.parseInt(t[n]);r&&(a*=2,a>9&&(a=a%10+1)),e+=a,r=!r}return e%10}function O5(t,e,r,n){let a=1;if(e)switch(e){case"?":{a=t.datatype.boolean()?0:1;break}case"*":{let i=1;for(;t.datatype.boolean();)i*=2;a=t.number.int({min:0,max:i});break}case"+":{let i=1;for(;t.datatype.boolean();)i*=2;a=t.number.int({min:1,max:i});break}default:throw new Tr("Unknown quantifier symbol provided.")}else r!=null&&n!=null?a=t.number.int({min:Number.parseInt(r),max:Number.parseInt(n)}):r!=null&&n==null&&(a=Number.parseInt(r));return a}function aue(t,e=""){let r=/(.)\{(\d+),(\d+)\}/,n=/(.)\{(\d+)\}/,a=/\[(\d+)-(\d+)\]/,i,o,l,c,u=r.exec(e);for(;u!=null;)i=Number.parseInt(u[2]),o=Number.parseInt(u[3]),i>o&&(l=o,o=i,i=l),c=t.number.int({min:i,max:o}),e=e.slice(0,u.index)+u[1].repeat(c)+e.slice(u.index+u[0].length),u=r.exec(e);for(u=n.exec(e);u!=null;)c=Number.parseInt(u[2]),e=e.slice(0,u.index)+u[1].repeat(c)+e.slice(u.index+u[0].length),u=n.exec(e);for(u=a.exec(e);u!=null;)i=Number.parseInt(u[1]),o=Number.parseInt(u[2]),i>o&&(l=o,o=i,i=l),e=e.slice(0,u.index)+t.number.int({min:i,max:o}).toString()+e.slice(u.index+u[0].length),u=a.exec(e);return e}function wI(t,e="",r="#"){let n="";for(let a=0;a<e.length;a++)e.charAt(a)===r?n+=t.number.int(9):e.charAt(a)==="!"?n+=t.number.int({min:2,max:9}):n+=e.charAt(a);return n}var jI=class extends fp{slugify(e=""){return e.normalize("NFKD").replaceAll(/[\u0300-\u036F]/g,"").replaceAll(" ","-").replaceAll(/[^\
854w.-]+/g,"")}replaceSymbols(e=""){let r=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],n="";for(let a=0;a<e.length;a++)e.charAt(a)==="#"?n+=this.faker.number.int(9):e.charAt(a)==="?"?n+=this.arrayElement(r):e.charAt(a)==="*"?n+=this.faker.datatype.boolean()?this.arrayElement(r):this.faker.number.int(9):n+=e.charAt(a);return n}replaceCreditCardSymbols(e="6453-####-####-####-###L",r="#"){e=aue(this.faker,e),e=wI(this.faker,e,r);let n=sue(e);return e.replace("L",String(n))}fromRegExp(e){var f;let r=!1;e instanceof RegExp&&(r=e.flags.includes("i"),e=e.toString(),e=((f=/\/(.+?)\//.exec(e))==null?void 0:f[1])??"");let n,a,i,o=/([.A-Za-z0-9])(?:\{(\d+)(?:,(\d+)|)\}|(\?|\*|\+))(?![^[]*]|[^{]*})/,l=o.exec(e);for(;l!=null;){let m=l[2],g=l[3],y=l[4];i=O5(this.faker,y,m,g);let b;l[1]==="."?b=this.faker.string.alphanumeric(i):r?b=this.faker.string.fromCharacters([l[1].toLowerCase(),l[1].toUpperCase()],i):b=l[1].repeat(i),e=e.slice(0,l.index)+b+e.slice(l.index+l[0].length),l=o.exec(e)}let c=/(\d-\d|\w-\w|\d|\w|[-!@#$&()`.+,/"])/,u=/\[(\^|)(-|)(.+?)\](?:\{(\d+)(?:,(\d+)|)\}|(\?|\*|\+)|)/;for(l=u.exec(e);l!=null;){let m=l[1]==="^",g=l[2]==="-",y=l[4],b=l[5],w=l[6],j=[],N=l[3],S=c.exec(N);for(g&&j.push(45);S!=null;){if(S[0].includes("-")){let C=S[0].split("-").map(T=>T.codePointAt(0)??Number.NaN);if(n=C[0],a=C[1],n>a)throw new Tr("Character range provided is out of order.");for(let T=n;T<=a;T++)if(r&&Number.isNaN(Number(String.fromCodePoint(T)))){let D=String.fromCodePoint(T);j.push(D.toUpperCase().codePointAt(0)??Number.NaN,D.toLowerCase().codePointAt(0)??Number.NaN)}else j.push(T)}else r&&Number.isNaN(Number(S[0]))?j.push(S[0].toUpperCase().codePointAt(0)??Number.NaN,S[0].toLowerCase().codePointAt(0)??Number.NaN):j.push(S[0].codePointAt(0)??Number.NaN);N=N.substring(S[0].length),S=c.exec(N)}if(i=O5(this.faker,w,y,b),m){let C=-1;for(let T=48;T<=57;T++){if(C=j.indexOf(T),C>-1){j.splice(C,1);continue}j.push(T)}for(let T=65;T<=90;T++){if(C=j.indexOf(T),C>-1){j.splice(C,1);continue}j.push(T)}for(let T=97;T<=122;T++){if(C=j.indexOf(T),C>-1){j.splice(C,1);continue}j.push(T)}}let E=this.multiple(()=>String.fromCodePoint(this.arrayElement(j)),{count:i}).join("");e=e.slice(0,l.index)+E+e.slice(l.index+l[0].length),l=u.exec(e)}let d=/(.)\{(\d+),(\d+)\}/;for(l=d.exec(e);l!=null;){if(n=Number.parseInt(l[2]),a=Number.parseInt(l[3]),n>a)throw new Tr("Numbers out of order in {} quantifier.");i=this.faker.number.int({min:n,max:a}),e=e.slice(0,l.index)+l[1].repeat(i)+e.slice(l.index+l[0].length),l=d.exec(e)}let h=/(.)\{(\d+)\}/;for(l=h.exec(e);l!=null;)i=Number.parseInt(l[2]),e=e.slice(0,l.index)+l[1].repeat(i)+e.slice(l.index+l[0].length),l=h.exec(e);return e}shuffle(e,r={}){let{inplace:n=!1}=r;n||(e=[...e]);for(let a=e.length-1;a>0;--a){let i=this.faker.number.int(a);[e[a],e[i]]=[e[i],e[a]]}return e}uniqueArray(e,r){if(Array.isArray(e)){let a=[...new Set(e)];return this.shuffle(a).splice(0,r)}let n=new Set;try{if(typeof e=="function"){let a=1e3*r,i=0;for(;n.size<r&&i<a;)n.add(e()),i++}}catch{}return[...n]}mustache(e,r){if(e==null)return"";for(let n in r){let a=new RegExp(`{{${n}}}`,"g"),i=r[n];typeof i=="string"&&(i=i.replaceAll("$","$$$$")),e=e.replace(a,i)}return e}maybe(e,r={}){if(this.faker.datatype.boolean(r))return e()}objectKey(e){let r=Object.keys(e);return this.arrayElement(r)}objectValue(e){let r=this.faker.helpers.objectKey(e);return e[r]}objectEntry(e){let r=this.faker.helpers.objectKey(e);return[r,e[r]]}arrayElement(e){if(e.length===0)throw new Tr("Cannot get value from empty dataset.");let r=e.length>1?this.faker.number.int({max:e.length-1}):0;return e[r]}weightedArrayElement(e){if(e.length===0)throw new Tr("weightedArrayElement expects an array with at least one element");if(!e.every(i=>i.weight>0))throw new Tr("weightedArrayElement expects an array of { weight, value } objects where weight is a positive number");let r=e.reduce((i,{weight:o})=>i+o,0),n=this.faker.number.float({min:0,max:r}),a=0;for(let{weight:i,value:o}of e)if(a+=i,n<a)return o;return e.at(-1).value}arrayElements(e,r){if(e.length===0)return[];let n=this.rangeToNumber(r??{min:1,max:e.length});if(n>=e.length)return this.shuffle(e);if(n<=0)return[];let a=[...e],i=e.length,o=i-n,l,c;for(;i-- >o;)c=this.faker.number.int(i),l=a[c],a[c]=a[i],a[i]=l;return a.slice(o)}enumValue(e){let r=Object.keys(e).filter(a=>Number.isNaN(Number(a))),n=this.arrayElement(r);return e[n]}rangeToNumber(e){return typeof e=="number"?e:this.faker.number.int(e)}multiple(e,r={}){let n=this.rangeToNumber(r.count??3);return n<=0?[]:Array.from({length:n},e)}},iue=class extends jI{constructor(e){super(e),this.faker=e}fake(e){e=typeof e=="string"?e:this.arrayElement(e);let r=e.search(/{{[a-z]/),n=e.indexOf("}}",r);
854if(r===-1||n===-1)return e;let a=e.substring(r+2,n+2).replace("}}","").replace("{{",""),i=Xce(a,this.faker),o=String(i),l=e.substring(0,r)+o+e.substring(n+2);return this.fake(l)}},NI=class extends fp{latitude(e={}){let{max:r=90,min:n=-90,precision:a=4}=e;return this.faker.number.float({min:n,max:r,fractionDigits:a})}longitude(e={}){let{max:r=180,min:n=-180,precision:a=4}=e;return this.faker.number.float({max:r,min:n,fractionDigits:a})}nearbyGPSCoordinate(e={}){let{origin:r,radius:n=10,isMetric:a=!1}=e;if(r==null)return[this.latitude(),this.longitude()];let i=this.faker.number.float({max:2*Math.PI,fractionDigits:5}),o=a?n:n*1.60934,l=this.faker.number.float({max:o,fractionDigits:3})*.995,c=4e4/360,u=l/c,d=[r[0]+Math.sin(i)*u,r[1]+Math.cos(i)*u];return d[0]=d[0]%180,(d[0]<-90||d[0]>90)&&(d[0]=Math.sign(d[0])*180-d[0],d[1]+=180),d[1]=(d[1]%360+540)%360-180,[d[0],d[1]]}},oue=class extends NI{constructor(e){super(e),this.faker=e}zipCode(e={}){typeof e=="string"&&(e={format:e});let{state:r}=e;if(r!=null){let a=this.faker.definitions.location.postcode_by_state[r];if(a==null)throw new Tr(`No zip code definition found for state "${r}"`);return this.faker.helpers.fake(a)}let{format:n=this.faker.definitions.location.postcode}=e;return typeof n=="string"&&(n=[n]),n=this.faker.helpers.arrayElement(n),this.faker.helpers.replaceSymbols(n)}city(){return this.faker.helpers.fake(this.faker.definitions.location.city_pattern)}buildingNumber(){return this.faker.helpers.arrayElement(this.faker.definitions.location.building_number).replaceAll(/#+/g,e=>this.faker.string.numeric({length:e.length,allowLeadingZeros:!1}))}street(){return this.faker.helpers.fake(this.faker.definitions.location.street_pattern)}streetAddress(e={}){typeof e=="boolean"&&(e={useFullAddress:e});let{useFullAddress:r}=e,n=this.faker.definitions.location.street_address[r?"full":"normal"];return this.faker.helpers.fake(n)}secondaryAddress(){return this.faker.helpers.fake(this.faker.definitions.location.secondary_address).replaceAll(/#+/g,e=>this.faker.string.numeric({length:e.length,allowLeadingZeros:!1}))}county(){return this.faker.helpers.arrayElement(this.faker.definitions.location.county)}country(){return this.faker.helpers.arrayElement(this.faker.definitions.location.country)}continent(){return this.faker.helpers.arrayElement(this.faker.definitions.location.continent)}countryCode(e={}){typeof e=="string"&&(e={variant:e});let{variant:r="alpha-2"}=e,n=(()=>{switch(r){case"numeric":return"numeric";case"alpha-3":return"alpha3";case"alpha-2":return"alpha2"}})();return this.faker.helpers.arrayElement(this.faker.definitions.location.country_code)[n]}state(e={}){let{abbreviated:r=!1}=e,n=r?this.faker.definitions.location.state_abbr:this.faker.definitions.location.state;return this.faker.helpers.arrayElement(n)}direction(e={}){let{abbreviated:r=!1}=e;return r?this.faker.helpers.arrayElement([...this.faker.definitions.location.direction.cardinal_abbr,...this.faker.definitions.location.direction.ordinal_abbr]):this.faker.helpers.arrayElement([...this.faker.definitions.location.direction.cardinal,...this.faker.definitions.location.direction.ordinal])}cardinalDirection(e={}){let{abbreviated:r=!1}=e;return r?this.faker.helpers.arrayElement(this.faker.definitions.location.direction.cardinal_abbr):this.faker.helpers.arrayElement(this.faker.definitions.location.direction.cardinal)}ordinalDirection(e={}){let{abbreviated:r=!1}=e;return r?this.faker.helpers.arrayElement(this.faker.definitions.location.direction.ordinal_abbr):this.faker.helpers.arrayElement(this.faker.definitions.location.direction.ordinal)}timeZone(){return this.faker.helpers.arrayElement(this.faker.definitions.location.time_zone)}language(){return this.faker.helpers.arrayElement(this.faker.definitions.location.language)}},lue=class extends fp{int(e={}){typeof e=="number"&&(e={max:e});let{min:r=0,max:n=Number.MAX_SAFE_INTEGER,multipleOf:a=1}=e;if(!Number.isInteger(a))throw new Tr("multipleOf should be an integer.");if(a<=0)throw new Tr("multipleOf should be greater than 0.");let i=Math.ceil(r/a),o=Math.floor(n/a);if(i===o)return i*a;if(o<i)throw n>=r?new Tr(`No suitable integer value between ${r} and ${n} found.`):new Tr(`Max ${n} should be greater than min ${r}.`);let l=this.faker._randomizer.next(),c=o-i+1;return Math.floor(l*c+i)*a}float(e={}){typeof e=="number"&&(e={max:e});let{min:r=0,max:n=1,fractionDigits:a,multipleOf:i,multipleOf:o=a==null?void 0:10**-a}=e;if(n<r)throw new Tr(`Max ${n} should be greater than min ${r}.`);if(a!=null){if(i!=null)throw new Tr("multipleOf and fractionDigits cannot be set at the same time.");if(!Number.isInteger(a))throw new Tr("fractionDigits should be an integer.");if(a<0)throw new Tr("fractionDigits should be greater than or equal to 0.")}if(o!=null){if(o<=0)throw new Tr("multipleOf should be greater than 0.");let l=Math.log10(o),c=o<1&&Number.isInteger(l)?10**-l:1/o;return this.int({min:r*c,max:n*c})/c}return this.faker._randomizer.next()*(n-r)+r}binary(e={}){typeof e=="number"&&(e={max:e});let{min:r=0,max:n=1}=e;return this.int({max:n,min:r}).toString(2)}octal(e={}){typeof e=="number"&&(e={max:e});let{min:r=0,max:n=7}=e;return this.int({max:n,min:r}).toString(8)}hex(e={}){typeof e=="number"&&(e={max:e});let{min:r=0,max:n=15}=e;return this.int({max:n,min:r}).toString(16)}bigInt(e={}){(typeof e=="bigint"||typeof e=="number"||typeof e=="string"||typeof e=="boolean")&&(e={max:e});let r=BigInt(e.min??0),n=BigInt(e.max??r+BigInt(999999999999999)),a=BigInt(e.multipleOf??1);if(n<r)throw new Tr(`Max ${n} should be larger than min ${r}.`);if(a<=BigInt(0))throw new Tr("multipleOf should be greater than 0.");let i=r/a+(r%a>0n?1n:0n),o=n/a-(n%a<0n?1n:0n);if(i===o)return i*a;if(o<i)throw new Tr(`No suitable bigint value between ${r} and ${n} found.`);let l=o-i+1n,c=BigInt(this.faker.string.numeric({length:l.toString(10).length,allowLeadingZeros:!0}))%l;return(i+c)*a}romanNumeral(e={}){typeof e=="number"&&(e={max:e});let{min:r=1,max:n=3999}=e;if(r<1)throw new Tr(`Min value ${r} should be 1 or greater.`);if(n>3999)throw new Tr(`Max value ${n} should be 3999 or less.`);let a=this.int({min:r,max:n}),i=[["M",1e3],["CM",900],["D",500],["CD",400],["C",100],["XC",90],["L",50],["XL",40],["X",10],["IX",9],["V",5],["IV",4],["I",1]],o="";for(let[l,c]of i)o+=l.repeat(Math.floor(a/c)),a%=c;return o}},FI="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function cue(t){let e=t.valueOf(),r="";for(let n=10;n>0;n--){let a=e%32;r=FI[a]+r,e=(e-a)/32}return r}var mv=[..."ABCDEFGHIJKLMNOPQRSTUVWXYZ"],fv=[..."abcdefghijklmnopqrstuvwxyz"],z5=[..."0123456789"],uue=class extends fp{fromCharacters(e,r=1){if(r=this.faker.helpers.rangeToNumber(r),r<=0)return"";if(typeof e=="string"&&(e=[...e]),e.length===0)throw new Tr("Unable to generate string: No characters to select from.");return this.faker.helpers.multiple(()=>this.faker.helpers.arrayElement(e),{count:r}).join("")}alpha(e={}){typeof e=="number"&&(e={length:e});let r=this.faker.helpers.rangeToNumber(e.length??1);if(r<=0)return"";let{casing:n="mixed"}=e,{exclude:a=[]}=e;
854typeof a=="string"&&(a=[...a]);let i;switch(n){case"upper":{i=[...mv];break}case"lower":{i=[...fv];break}case"mixed":{i=[...fv,...mv];break}}return i=i.filter(o=>!a.includes(o)),this.fromCharacters(i,r)}alphanumeric(e={}){typeof e=="number"&&(e={length:e});let r=this.faker.helpers.rangeToNumber(e.length??1);if(r<=0)return"";let{casing:n="mixed"}=e,{exclude:a=[]}=e;typeof a=="string"&&(a=[...a]);let i=[...z5];switch(n){case"upper":{i.push(...mv);break}case"lower":{i.push(...fv);break}case"mixed":{i.push(...fv,...mv);break}}return i=i.filter(o=>!a.includes(o)),this.fromCharacters(i,r)}binary(e={}){let{prefix:r="0b"}=e,n=r;return n+=this.fromCharacters(["0","1"],e.length??1),n}octal(e={}){let{prefix:r="0o"}=e,n=r;return n+=this.fromCharacters(["0","1","2","3","4","5","6","7"],e.length??1),n}hexadecimal(e={}){let{casing:r="mixed",prefix:n="0x"}=e,a=this.faker.helpers.rangeToNumber(e.length??1);if(a<=0)return n;let i=this.fromCharacters(["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","A","B","C","D","E","F"],a);return r==="upper"?i=i.toUpperCase():r==="lower"&&(i=i.toLowerCase()),`${n}${i}`}numeric(e={}){typeof e=="number"&&(e={length:e});let r=this.faker.helpers.rangeToNumber(e.length??1);if(r<=0)return"";let{allowLeadingZeros:n=!0}=e,{exclude:a=[]}=e;typeof a=="string"&&(a=[...a]);let i=z5.filter(l=>!a.includes(l));if(i.length===0||i.length===1&&!n&&i[0]==="0")throw new Tr("Unable to generate numeric string, because all possible digits are excluded.");let o="";return!n&&!a.includes("0")&&(o+=this.faker.helpers.arrayElement(i.filter(l=>l!=="0"))),o+=this.fromCharacters(i,r-o.length),o}sample(e=10){e=this.faker.helpers.rangeToNumber(e);let r={min:33,max:125},n="";for(;n.length<e;)n+=String.fromCodePoint(this.faker.number.int(r));return n}uuid(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replaceAll("x",()=>this.faker.number.hex({min:0,max:15})).replaceAll("y",()=>this.faker.number.hex({min:8,max:11}))}ulid(e={}){let{refDate:r=this.faker.defaultRefDate()}=e,n=od(r);return cue(n)+this.fromCharacters(FI,16)}nanoid(e=21){if(e=this.faker.helpers.rangeToNumber(e),e<=0)return"";let r=[{value:()=>this.alphanumeric(1),weight:62},{value:()=>this.faker.helpers.arrayElement(["_","-"]),weight:2}],n="";for(;n.length<e;){let a=this.faker.helpers.weightedArrayElement(r);n+=a()}return n}symbol(e=1){return this.fromCharacters(["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_","`","{","|","}","~"],e)}},SI=class{constructor(e={}){sr(this,"_defaultRefDate",()=>new Date);sr(this,"_randomizer");sr(this,"datatype",new Vce(this));sr(this,"date",new vI(this));sr(this,"helpers",new jI(this));sr(this,"location",new NI(this));sr(this,"number",new lue(this));sr(this,"string",new uue(this));let{randomizer:r,seed:n}=e;r!=null&&n!=null&&r.seed(n),this._randomizer=r??Gce(n)}get defaultRefDate(){return this._defaultRefDate}setDefaultRefDate(e=()=>new Date){typeof e=="function"?this._defaultRefDate=e:this._defaultRefDate=()=>new Date(e)}seed(e=bI()){return this._randomizer.seed(e),e}};new SI;function due(t){let e={};for(let r of t)for(let n in r){let a=r[n];e[n]===void 0?e[n]={...a}:e[n]={...a,...e[n]}}return e}var hue=class extends pa{dog(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.dog)}cat(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.cat)}snake(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.snake)}bear(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.bear)}lion(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.lion)}cetacean(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.cetacean)}horse(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.horse)}bird(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.bird)}cow(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.cow)}fish(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.fish)}crocodilia(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.crocodilia)}insect(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.insect)}rabbit(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.rabbit)}rodent(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.rodent)}type(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.type)}petName(){return this.faker.helpers.arrayElement(this.faker.definitions.animal.pet_name)}},mue=class extends pa{author(){return this.faker.helpers.arrayElement(this.faker.definitions.book.author)}format(){return this.faker.helpers.arrayElement(this.faker.definitions.book.format)}genre(){return this.faker.helpers.arrayElement(this.faker.definitions.book.genre)}publisher(){return this.faker.helpers.arrayElement(this.faker.definitions.book.publisher)}series(){return this.faker.helpers.arrayElement(this.faker.definitions.book.series)}title(){return this.faker.helpers.arrayElement(this.faker.definitions.book.title)}},fue={0:[[1999999,2],[2279999,3],[2289999,4],[3689999,3],[3699999,4],[6389999,3],[6397999,4],[6399999,7],[6449999,3],[6459999,7],[6479999,3],[6489999,7],[6549999,3],[6559999,4],[6999999,3],[8499999,4],[8999999,5],[9499999,6],[9999999,7]],1:[[99999,3],[299999,2],[349999,3],[399999,4],[499999,3],[699999,2],[999999,4],[3979999,3],[5499999,4],[6499999,5],[6799999,4],[6859999,5],[7139999,4],[7169999,3],[7319999,4],[7399999,7],[7749999,5],[7753999,7],[7763999,5],[7764999,7],[7769999,5],[7782999,7],[7899999,5],[7999999,4],[8004999,5],[8049999,5],[8379999,5],[8384999,7],[8671999,5],[8675999,4],[8697999,5],[9159999,6],[9165059,7],[9168699,6],[9169079,7],[9195999,6],[9196549,7],[9729999,6],[9877999,4],[9911499,6],[9911999,7],[9989899,6],[9999999,7]]},pue=class extends pa{department(){return this.faker.helpers.arrayElement(this.faker.definitions.commerce.department)}productName(){return`${this.productAdjective()} ${this.productMaterial()} ${this.product()}`}price(e={}){let{dec:r=2,max:n=1e3,min:a=1,symbol:i=""}=e;if(a<0||n<0)return`${i}0`;if(a===n)return`${i}${a.toFixed(r)}`;let o=this.faker.number.float({min:a,max:n,fractionDigits:r});if(r===0)return`${i}${o.toFixed(r)}`;let l=o*10**r%10,c=this.faker.helpers.weightedArrayElement([{weight:5,value:9},{weight:3,value:5},{weight:1,value:0},{weight:1,value:this.faker.number.int({min:0,max:9})}]),u=(1/10)**r,d=l*u,h=c*u,f=o-d+h;return a<=f&&f<=n?`${i}${f.toFixed(r)}`:`${i}${o.toFixed(r)}`}productAdjective(){return this.faker.helpers.arrayElement(this.faker.definitions.commerce.product_name.adjective)}productMaterial(){return this.faker.helpers.arrayElement(this.faker.definitions.commerce.product_name.material)}product(){return this.faker.helpers.arrayElement(this.faker.definitions.commerce.product_name.product)}productDescription(){return this.faker.helpers.fake(this.faker.definitions.commerce.product_description)}isbn(e={}){var y;typeof e=="number"&&(e={variant:e});let{variant:r=13,separator:n="-"}=e,a="978",[i,o]=this.faker.helpers.objectEntry(fue),l=this.faker.string.numeric(8),c=Number.parseInt(l.slice(0,-1)),u=(y=o.find(([b])=>c<=b))==null?void 0:y[1];if(!u)throw new Tr(`Unable to find a registrant length for the group ${i}`);let d=l.slice(0,u),h=l.slice(u),f=[a,i,d,h];r===10&&f.shift();let m=f.join(""),g=0;for(let b=0;b<r-1;b++){let w=r===10?b+1:b%2?3:1;g+=w*Number.parseInt(m[b])}
vendor: 4,185 bytes, line 854
854return g=r===10?g%11:(10-g%10)%10,f.push(g===10?"X":g.toString()),f.join(n)}},gue=class extends pa{name(){return this.faker.helpers.fake(this.faker.definitions.company.name_pattern)}catchPhrase(){return[this.catchPhraseAdjective(),this.catchPhraseDescriptor(),this.catchPhraseNoun()].join(" ")}buzzPhrase(){return[this.buzzVerb(),this.buzzAdjective(),this.buzzNoun()].join(" ")}catchPhraseAdjective(){return this.faker.helpers.arrayElement(this.faker.definitions.company.adjective)}catchPhraseDescriptor(){return this.faker.helpers.arrayElement(this.faker.definitions.company.descriptor)}catchPhraseNoun(){return this.faker.helpers.arrayElement(this.faker.definitions.company.noun)}buzzAdjective(){return this.faker.helpers.arrayElement(this.faker.definitions.company.buzz_adjective)}buzzVerb(){return this.faker.helpers.arrayElement(this.faker.definitions.company.buzz_verb)}buzzNoun(){return this.faker.helpers.arrayElement(this.faker.definitions.company.buzz_noun)}},xue=class extends pa{column(){return this.faker.helpers.arrayElement(this.faker.definitions.database.column)}type(){return this.faker.helpers.arrayElement(this.faker.definitions.database.type)}collation(){return this.faker.helpers.arrayElement(this.faker.definitions.database.collation)}engine(){return this.faker.helpers.arrayElement(this.faker.definitions.database.engine)}mongodbObjectId(){return this.faker.string.hexadecimal({length:24,casing:"lower",prefix:""})}},yue={alpha:["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],formats:[{country:"AL",total:28,bban:[{type:"n",count:8},{type:"c",count:16}],format:"ALkk bbbs sssx cccc cccc cccc cccc"},{country:"AD",total:24,bban:[{type:"n",count:8},{type:"c",count:12}],format:"ADkk bbbb ssss cccc cccc cccc"},{country:"AT",total:20,bban:[{type:"n",count:5},{type:"n",count:11}],format:"ATkk bbbb bccc cccc cccc"},{country:"AZ",total:28,bban:[{type:"a",count:4},{type:"n",count:20}],format:"AZkk bbbb cccc cccc cccc cccc cccc"},{country:"BH",total:22,bban:[{type:"a",count:4},{type:"c",count:14}],format:"BHkk bbbb cccc cccc cccc cc"},{country:"BE",total:16,bban:[{type:"n",count:3},{type:"n",count:9}],format:"BEkk bbbc cccc ccxx"},{country:"BA",total:20,bban:[{type:"n",count:6},{type:"n",count:10}],format:"BAkk bbbs sscc cccc ccxx"},{country:"BR",total:29,bban:[{type:"n",count:13},{type:"n",count:10},{type:"a",count:1},{type:"c",count:1}],format:"BRkk bbbb bbbb ssss sccc cccc ccct n"},{country:"BG",total:22,bban:[{type:"a",count:4},{type:"n",count:6},{type:"c",count:8}],format:"BGkk bbbb ssss ddcc cccc cc"},{country:"CR",total:22,bban:[{type:"n",count:1},{type:"n",count:3},{type:"n",count:14}],format:"CRkk xbbb cccc cccc cccc cc"},{country:"HR",total:21,bban:[{type:"n",count:7},{type:"n",count:10}],format:"HRkk bbbb bbbc cccc cccc c"},{country:"CY",total:28,bban:[{type:"n",count:8},{type:"c",count:16}],format:"CYkk bbbs ssss cccc cccc cccc cccc"},{country:"CZ",total:24,bban:[{type:"n",count:10},{type:"n",count:10}],format:"CZkk bbbb ssss sscc cccc cccc"},{country:"DK",total:18,bban:[{type:"n",count:4},{type:"n",count:10}],format:"DKkk bbbb cccc cccc cc"},{country:"DO",total:28,bban:[{type:"a",count:4},{type:"n",count:20}],format:"DOkk bbbb cccc cccc cccc cccc cccc"},{country:"TL",total:23,bban:[{type:"n",count:3},{type:"n",count:16}],format:"TLkk bbbc cccc cccc cccc cxx"},{country:"EE",total:20,bban:[{type:"n",count:4},{type:"n",count:12}],format:"EEkk bbss cccc cccc cccx"},{country:"FO",total:18,bban:[{type:"n",count:4},{type:"n",count:10}],format:"FOkk bbbb cccc cccc cx"},{country:"FI",total:18,bban:[{type:"n",count:6},{type:"n",count:8}],format:"FIkk bbbb bbcc cccc cx"},{country:"FR",total:27,bban:[{type:"n",count:10},{type:"c",count:11},{type:"n",count:2}],format:"FRkk bbbb bggg ggcc cccc cccc cxx"},{country:"GE",total:22,bban:[{type:"a",count:2},{type:"n",count:16}],format:"GEkk bbcc cccc cccc cccc cc"},{country:"DE",total:22,bban:[{type:"n",count:8},{type:"n",count:10}],format:"DEkk bbbb bbbb cccc cccc cc"},{country:"GI",total:23,bban:[{type:"a",count:4},{type:"c",count:15}],format:"GIkk bbbb cccc cccc cccc ccc"},{country:"GR",total:27,bban:[{type:"n",count:7}
854,{type:"c",count:16}],format:"GRkk bbbs sssc cccc cccc cccc ccc"},{country:"GL",total:18,bban:[{type:"n",count:4},{type:"n",count:10}],format:"GLkk bbbb cccc cccc cc"},{country:"GT",total:28,bban:[{type:"c",count:4},{type:"c",count:4},{type:"c",count:16}],format:"GTkk bbbb mmtt cccc cccc cccc cccc"},{country:"HU",total:28,bban:[{type:"n",count:8},{type:"n",count:16}],format:"HUkk bbbs sssk cccc cccc cccc cccx"},{country:"IS",total:26,bban:[{type:"n",count:6},{type:"n",count:16}],format:"ISkk bbbb sscc cccc iiii iiii ii"},{country:"IE",total:22,bban:[{type:"a",count:4},{type:"n",count:6},{type:"n",count:8}],format:"IEkk aaaa bbbb bbcc cccc cc"},{country:"IL",total:23,bban:[{type:"n",count:6},{type:"n",count:13}],format:"ILkk bbbn nncc cccc cccc ccc"},{country:"IT",total:27,bban:[{type:"a",count:1},{type:"n",count:10},{type:"c",count:12}],format:"ITkk xaaa aabb bbbc cccc cccc ccc"},{country:"JO",total:30,bban:[{type:"a",count:4},{type:"n",count:4},{type:"n",count:18}],format:"JOkk bbbb nnnn cccc cccc cccc cccc cc"},{country:"KZ",total:20,bban:[{type:"n",count:3},{type:"c",count:13}],format:"KZkk bbbc cccc cccc cccc"},{country:"XK",total:20,bban:[{type:"n",count:4},{type:"n",count:12}],format:"XKkk bbbb cccc cccc cccc"},{country:"KW",total:30,bban:[{type:"a",count:4},{type:"c",count:22}],format:"KWkk bbbb cccc cccc cccc cccc cccc cc"},{country:"LV",total:21,bban:[{type:"a",count:4},{type:"c",count:13}],format:"LVkk bbbb cccc cccc cccc c"},{country:"LB",total:28,bban:[{type:"n",count:4},{type:"c",count:20}],format:"LBkk bbbb cccc cccc cccc cccc cccc"},{country:"LI",total:21,bban:[{type:"n",count:5},{type:"c",count:12}],format:"LIkk bbbb bccc cccc cccc c"},{country:"LT",total:20,bban:[{type:"n",count:5},{type:"n",count:11}],format:"LTkk bbbb bccc cccc cccc"},{country:"LU",total:20,bban:[{type:"n",count:3},{type:"c",count:13}],format:"LUkk bbbc cccc cccc cccc"},{country:"MK",total:19,bban:[{type:"n",count:3},{type:"c",count:10},{type:"n",count:2}],format:"MKkk bbbc cccc cccc cxx"},{country:"MT",total:31,bban:[{type:"a",count:4},{type:"n",count:5},{type:"c",count:18}],format:"MTkk bbbb ssss sccc cccc cccc cccc ccc"},{country:"MR",total:27,bban:[{type:"n",count:10},{type:"n",count:13}],format:"MRkk bbbb bsss sscc cccc cccc cxx"},{country:"MU",total:30,bban:[{type:"a",count:4},{type:"n",count:4},{type:"n",count:15},{type:"a",count:3}],format:"MUkk bbbb bbss cccc cccc cccc 000d dd"},{country:"MC",total:27,bban:[{type:"n",count:10},{type:"c",count:11},{type:"n",count:2}],format:"MCkk bbbb bsss sscc cccc cccc cxx"},{country:"MD",total:24,bban:[{type:"c",count:2},{type:"c",count:18}],format:"MDkk bbcc cccc cccc cccc cccc"},{country:"ME",total:22,bban:[{type:"n",count:3},{type:"n",count:15}],format:"MEkk bbbc cccc cccc cccc xx"},{country:"NL",total:18,bban:[{type:"a",count:4},{type:"n",count:10}],format:"NLkk bbbb cccc cccc cc"},{country:"NO",total:15,bban:[{type:"n",count:4},{type:"n",count:7}],format:"NOkk bbbb cccc ccx"},{country:"PK",total:24,bban:[{type:"a",count:4},{type:"n",count:16}],format:"PKkk bbbb cccc cccc cccc cccc"},{country:"PS",total:29,bban:[{type:"a",count:4},{type:"n",count:9},{type:"n",count:12}],format:"PSkk bbbb xxxx xxxx xccc cccc cccc c"},{country:"PL",total:28,bban:[{type:"n",count:8},{type:"n",count:16}],format:"PLkk bbbs sssx cccc cccc cccc cccc"},{country:"PT",total:25,bban:[{type:"n",count:8},{type:"n",count:13}],format:"PTkk bbbb ssss cccc cccc cccx x"},{country:"QA",total:29,bban:[{type:"a",count:4},{type:"c",count:21}],format:"QAkk bbbb cccc cccc cccc cccc cccc c"},{country:"RO",total:24,bban:[{type:"a",count:4},{type:"c",count:16}],format:"ROkk bbbb cccc cccc cccc cccc"},{country:"SM",total:27,bban:[{type:"a",count:1},{type:"n",count:10},{type:"c",count:12}],format:"SMkk xaaa aabb bbbc cccc cccc ccc"},{country:"SA",total:24,bban:[{type:"n",count:2},{type:"c",count:18}],format:"SAkk bbcc cccc cccc cccc cccc"},{country:"RS",total:22,bban:[{type:"n",count:3},{type:"n",count:15}],format:"RSkk bbbc cccc cccc cccc xx"},{country:"SK",total:24,bban:[{type:"n",count:10},{type:"n",count:10}],format:"SKkk bbbb ssss sscc cccc cccc"},{country:"SI",total:19,bban:[{type:"n",count:5},{type:"n",count:10}
vendor: 6,180 bytes, line 854
854],format:"SIkk bbss sccc cccc cxx"},{country:"ES",total:24,bban:[{type:"n",count:10},{type:"n",count:10}],format:"ESkk bbbb gggg xxcc cccc cccc"},{country:"SE",total:24,bban:[{type:"n",count:3},{type:"n",count:17}],format:"SEkk bbbc cccc cccc cccc cccc"},{country:"CH",total:21,bban:[{type:"n",count:5},{type:"c",count:12}],format:"CHkk bbbb bccc cccc cccc c"},{country:"TN",total:24,bban:[{type:"n",count:5},{type:"n",count:15}],format:"TNkk bbss sccc cccc cccc cccc"},{country:"TR",total:26,bban:[{type:"n",count:5},{type:"n",count:1},{type:"n",count:16}],format:"TRkk bbbb bxcc cccc cccc cccc cc"},{country:"AE",total:23,bban:[{type:"n",count:3},{type:"n",count:16}],format:"AEkk bbbc cccc cccc cccc ccc"},{country:"GB",total:22,bban:[{type:"a",count:4},{type:"n",count:6},{type:"n",count:8}],format:"GBkk bbbb ssss sscc cccc cc"},{country:"VG",total:24,bban:[{type:"a",count:4},{type:"n",count:16}],format:"VGkk bbbb cccc cccc cccc cccc"}],iso3166:["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","XK","YE","YT","ZA","ZM","ZW"],mod97:t=>{let e=0;for(let r of t)e=(e*10+ +r)%97;return e},pattern10:["01","02","03","04","05","06","07","08","09"],pattern100:["001","002","003","004","005","006","007","008","009"],toDigitString:t=>t.replaceAll(/[A-Z]/gi,e=>String((e.toUpperCase().codePointAt(0)??Number.NaN)-55))},rd=yue;function bue(t){let e="";for(let r=0;r<t.length;r+=4)e+=`${t.substring(r,r+4)} `;return e.trimEnd()}var vue=class extends pa{accountNumber(e={}){typeof e=="number"&&(e={length:e});let{length:r=8}=e;return this.faker.string.numeric({length:r,allowLeadingZeros:!0})}accountName(){return[this.faker.helpers.arrayElement(this.faker.definitions.finance.account_type),"Account"].join(" ")}routingNumber(){let e=this.faker.string.numeric({length:8,allowLeadingZeros:!0}),r=0;for(let n=0;n<e.length;n+=3)r+=Number(e[n])*3,r+=Number(e[n+1])*7,r+=Number(e[n+2])||0;return`${e}${Math.ceil(r/10)*10-r}`}maskedNumber(e={}){Yf({deprecated:"faker.finance.maskedNumber()",proposed:"faker.finance.iban().replace(/(?<=.{4})\\w(?=.{2})/g, '*') or a similar approach",since:"9.3.0",until:"10.0.0"}),typeof e=="number"&&(e={length:e});let{ellipsis:r=!0,length:n=4,parens:a=!0}=e,i=this.faker.string.numeric({length:n});return r&&(i=`...${i}`),a&&(i=`(${i})`),i}amount(e={}){let{autoFormat:r=!1,dec:n=2,max:a=1e3,min:i=0,symbol:o=""}=e,l=this.faker.number.float({max:a,min:i,fractionDigits:n}),c=r?l.toLocaleString(void 0,{minimumFractionDigits:n}):l.toFixed(n);return o+c}transactionType(){return this.faker.helpers.arrayElement(this.faker.definitions.finance.transaction_type)}currency(){return this.faker.helpers.arrayElement(this.faker.definitions.finance.currency)}currencyCode(){return this.currency().code}currencyName(){return this.currency().name}currencySymbol(){let e;do e=this.currency().symbol;while(e.length===0);return e}currencyNumericCode(){return this.currency().numericCode}bitcoinAddress(e={}){let{type:r=this.faker.helpers.enumValue(fI),network:n="mainnet"}=e,a=Dce[r],i=a.prefix[n],o=this.faker.number.int(a.length),l=this.faker.string.alphanumeric({length:o-i.length,casing:a.casing,exclude:a.exclude});return i+l}litecoinAddress(){let e=this.faker.number.int({min:26,max:33});return this.faker.string.fromCharacters("LM3")+this.faker.string.fromCharacters("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ",e-1)}creditCardNumber(e={}){typeof e=="string"&&(e={issuer:e});let{issuer:r=""}=e,n,a=this.faker.definitions.finance.credit_card,i=r.toLowerCase();if(i in a)n=this.faker.helpers.arrayElement(a[i]);else if(r.includes("#"))n=r;else{let o=this.faker.helpers.objectValue(a);n=this.faker.helpers.arrayElement(o)}return n=n.replaceAll("/",""),this.faker.helpers.replaceCreditCardSymbols(n)}creditCardCVV(){return this.faker.string.numeric({length:3,allowLeadingZeros:!0})}creditCardIssuer(){return this.faker.helpers.objectKey(this.faker.definitions.finance.credit_card)}pin(e={}){typeof e=="number"&&(e={length:e});let{length:r=4}=e;if(r<1)throw new Tr("minimum length is 1");return this.faker.string.numeric({length:r,allowLeadingZeros:!0})}ethereumAddress(){return this.faker.string.hexadecimal({length:40,casing:"lower"})}iban(e={}){let{countryCode:r,formatted:n=!1}=e,a=r?rd.formats.find(u=>u.country===r):this.faker.helpers.arrayElement(rd.formats);if(!a)throw new Tr(`Country code ${r} not supported.`);let i="",o=0;for(let u of a.bban){let d=u.count;for(o+=u.count;d>0;)u.type==="a"?i+=this.faker.helpers.arrayElement(rd.alpha):u.type==="c"?this.faker.datatype.boolean(.8)?i+=this.faker.number.int(9):i+=this.faker.helpers.arrayElement(rd.alpha):d>=3&&this.faker.datatype.boolean(.3)?this.faker.datatype.boolean()?(i+=this.faker.helpers.arrayElement(rd.pattern100),d-=2):(i+=this.faker.helpers.arrayElement(rd.pattern10),d--):i+=this.faker.number.int(9),d--;i=i.substring(0,o)}let l=98-rd.mod97(rd.toDigitString(`${i}${a.country}00`));l<10&&(l=`0${l}`);let c=`${a.country}${l}${i}`;return n?bue(c):c}bic(e={}){let{includeBranchCode:r=this.faker.datatype.boolean()}
854=e,n=this.faker.string.alpha({length:4,casing:"upper"}),a=this.faker.helpers.arrayElement(rd.iso3166),i=this.faker.string.alphanumeric({length:2,casing:"upper"}),o=r?this.faker.datatype.boolean()?this.faker.string.alphanumeric({length:3,casing:"upper"}):"XXX":"";return`${n}${a}${i}${o}`}transactionDescription(){return this.faker.helpers.fake(this.faker.definitions.finance.transaction_description_pattern)}};function U5(t){return t.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}var wue=class extends pa{adjective(){return this.faker.helpers.arrayElement(this.faker.definitions.food.adjective)}description(){return this.faker.helpers.fake(this.faker.definitions.food.description_pattern)}dish(){return this.faker.datatype.boolean()?U5(this.faker.helpers.fake(this.faker.definitions.food.dish_pattern)):U5(this.faker.helpers.arrayElement(this.faker.definitions.food.dish))}ethnicCategory(){return this.faker.helpers.arrayElement(this.faker.definitions.food.ethnic_category)}fruit(){return this.faker.helpers.arrayElement(this.faker.definitions.food.fruit)}ingredient(){return this.faker.helpers.arrayElement(this.faker.definitions.food.ingredient)}meat(){return this.faker.helpers.arrayElement(this.faker.definitions.food.meat)}spice(){return this.faker.helpers.arrayElement(this.faker.definitions.food.spice)}vegetable(){return this.faker.helpers.arrayElement(this.faker.definitions.food.vegetable)}},jue="Â ",Nue=class extends pa{branch(){let e=this.faker.hacker.noun().replace(" ","-"),r=this.faker.hacker.verb().replace(" ","-");return`${e}-${r}`}commitEntry(e={}){let{merge:r=this.faker.datatype.boolean({probability:.2}),eol:n="CRLF",refDate:a}=e,i=[`commit ${this.faker.git.commitSha()}`];r&&i.push(`Merge: ${this.commitSha({length:7})} ${this.commitSha({length:7})}`);let o=this.faker.person.firstName(),l=this.faker.person.lastName(),c=this.faker.person.fullName({firstName:o,lastName:l}),u=this.faker.internet.username({firstName:o,lastName:l}),d=this.faker.helpers.arrayElement([c,u]),h=this.faker.internet.email({firstName:o,lastName:l});d=d.replaceAll(/^[.,:;"\\']|[<>\n]|[.,:;"\\']$/g,""),i.push(`Author: ${d} <${h}>`,`Date: ${this.commitDate({refDate:a})}`,"",`${jue.repeat(4)}${this.commitMessage()}`,"");let f=n==="CRLF"?`\r 855`:` 856`;return i.join(f)}commitMessage(){return`${this.faker.hacker.verb()} ${this.faker.hacker.adjective()} ${this.faker.hacker.noun()}`}commitDate(e={}){let{refDate:r=this.faker.defaultRefDate()}=e,n=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],i=this.faker.date.recent({days:1,refDate:r}),o=n[i.getUTCDay()],l=a[i.getUTCMonth()],c=i.getUTCDate(),u=i.getUTCHours().toString().padStart(2,"0"),d=i.getUTCMinutes().toString().padStart(2,"0"),h=i.getUTCSeconds().toString().padStart(2,"0"),f=i.getUTCFullYear(),m=this.faker.number.int({min:-11,max:12}),g=Math.abs(m).toString().padStart(2,"0"),y="00",b=m>=0?"+":"-";return`${o} ${l} ${c} ${u}:${d}:${h} ${f} ${b}${g}${y}`}commitSha(e={}){let{length:r=40}=e;return this.faker.string.hexadecimal({length:r,casing:"lower",prefix:""})}},Fue=class extends pa{abbreviation(){return this.faker.helpers.arrayElement(this.faker.definitions.hacker.abbreviation)}adjective(){return this.faker.helpers.arrayElement(this.faker.definitions.hacker.adjective)}noun(){return this.faker.helpers.arrayElement(this.faker.definitions.hacker.noun)}verb(){return this.faker.helpers.arrayElement(this.faker.definitions.hacker.verb)}ingverb(){return this.faker.helpers.arrayElement(this.faker.definitions.hacker.ingverb)}phrase(){let e={abbreviation:this.abbreviation,adjective:this.adjective,ingverb:this.ingverb,noun:this.noun,verb:this.verb},r=this.faker.helpers.arrayElement(this.faker.definitions.hacker.phrase);return this.faker.helpers.mustache(r,e)}},Sue=class extends pa{avatar(){return this.faker.helpers.arrayElement([this.personPortrait,this.avatarGitHub])()}avatarGitHub(){return`https://avatars.githubusercontent.com/u/${this.faker.number.int(1e8)}`}personPortrait(e={}){let{sex:r=this.faker.person.sexType(),size:n=512}=e;
vendor: 4,762 bytes, lines 856-858
856return`https://cdn.jsdelivr.net/gh/faker-js/assets-person-portrait/${r}/${n}/${this.faker.number.int({min:0,max:99})}.jpg`}avatarLegacy(){return Yf({deprecated:"faker.image.avatarLegacy()",proposed:"faker.image.avatar() or faker.image.personPortrait()",since:"9.0.2",until:"10.0.0"}),`https://cloudflare-ipfs.com/ipfs/Qmd3W5DuhgHirLHGVixi6V76LhCkZUz6pnFt5AJBiyvHye/avatar/${this.faker.number.int(1249)}.jpg`}url(e={}){let{width:r=this.faker.number.int({min:1,max:3999}),height:n=this.faker.number.int({min:1,max:3999})}=e;return this.faker.helpers.arrayElement([this.urlLoremFlickr,({width:a,height:i})=>this.urlPicsumPhotos({width:a,height:i,grayscale:!1,blur:0})])({width:r,height:n})}urlLoremFlickr(e={}){let{width:r=this.faker.number.int({min:1,max:3999}),height:n=this.faker.number.int({min:1,max:3999}),category:a}=e;return`https://loremflickr.com/${r}/${n}${a==null?"":`/${a}`}?lock=${this.faker.number.int()}`}urlPicsumPhotos(e={}){let{width:r=this.faker.number.int({min:1,max:3999}),height:n=this.faker.number.int({min:1,max:3999}),grayscale:a=this.faker.datatype.boolean(),blur:i=this.faker.number.int({max:10})}=e,o=`https://picsum.photos/seed/${this.faker.string.alphanumeric({length:{min:5,max:10}})}/${r}/${n}`,l=typeof i=="number"&&i>=1&&i<=10;return(a||l)&&(o+="?",a&&(o+="grayscale"),a&&l&&(o+="&"),l&&(o+=`blur=${i}`)),o}urlPlaceholder(e={}){Yf({deprecated:"faker.image.urlPlaceholder()",proposed:"faker.image.url() or faker.image.dataUri()",since:"9.4.0",until:"10.0.0"});let{width:r=this.faker.number.int({min:1,max:3500}),height:n=this.faker.number.int({min:1,max:3500}),backgroundColor:a=this.faker.color.rgb({format:"hex",prefix:""}),textColor:i=this.faker.color.rgb({format:"hex",prefix:""}),format:o=this.faker.helpers.arrayElement(["gif","jpeg","jpg","png","webp"]),text:l=this.faker.lorem.words()}=e,c="https://via.placeholder.com";return c+=`/${r}`,c+=`x${n}`,c+=`/${a}`,c+=`/${i}`,c+=`.${o}`,c+=`?text=${encodeURIComponent(l)}`,c}dataUri(e={}){let{width:r=this.faker.number.int({min:1,max:3999}),height:n=this.faker.number.int({min:1,max:3999}),color:a=this.faker.color.rgb(),type:i=this.faker.helpers.arrayElement(["svg-uri","svg-base64"])}=e,o=`<svg xmlns="http://www.w3.org/2000/svg" version="1.1" baseProfile="full" width="${r}" height="${n}"><rect width="100%" height="100%" fill="${a}"/><text x="${r/2}" y="${n/2}" font-size="20" alignment-baseline="middle" text-anchor="middle" fill="white">${r}x${n}</text></svg>`;return i==="svg-uri"?`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(o)}`:`data:image/svg+xml;base64,${pI(o)}`}};function Cue(t,e,r=n=>n){let n={};for(let a of t){let i=e(a);n[i]===void 0&&(n[i]=[]),n[i].push(r(a))}return n}var O2={fail:()=>{throw new Tr("No words found that match the given length.")},closest:(t,e)=>{let r=Cue(t,l=>l.length),n=Object.keys(r).map(Number),a=Math.min(...n),i=Math.max(...n),o=Math.min(e.min-a,i-e.max);return t.filter(l=>l.length===e.min-o||l.length===e.max+o)},shortest:t=>{let e=Math.min(...t.map(r=>r.length));return t.filter(r=>r.length===e)},longest:t=>{let e=Math.max(...t.map(r=>r.length));return t.filter(r=>r.length===e)},"any-length":t=>[...t]};function bh(t){let{wordList:e,length:r,strategy:n="any-length"}=t;if(r!=null){let a=typeof r=="number"?o=>o.length===r:o=>o.length>=r.min&&o.length<=r.max,i=e.filter(a);return i.length>0?i:typeof r=="number"?O2[n](e,{min:r,max:r}):O2[n](e,r)}else if(n==="shortest"||n==="longest")return O2[n](e);return[...e]}var kue=class extends pa{word(e={}){return typeof e=="number"&&(e={length:e}),this.faker.helpers.arrayElement(bh({...e,wordList:this.faker.definitions.lorem.word}))}words(e=3){return this.faker.helpers.multiple(()=>this.word(),{count:e}).join(" ")}sentence(e={min:3,max:10}){let r=this.words(e);return`${r.charAt(0).toUpperCase()+r.substring(1)}.`}slug(e=3){let r=this.words(e);return this.faker.helpers.slugify(r)}sentences(e={min:2,max:6},r=" "){return this.faker.helpers.multiple(()=>this.sentence(),{count:e}).join(r)}paragraph(e=3){return this.sentences(e)}paragraphs(e=3,r=` 857`){return this.faker.helpers.multiple(()=>this.paragraph(),{count:e}).join(r)}text(){let e=["sentence","sentences","paragraph","paragraphs","lines"],r=this.faker.helpers.arrayElement(e);return this[r]()}lines(e={min:1,max:5}){return this.sentences(e,` 858`)}},_ue=class extends pa{album(){return this.faker.helpers.arrayElement(this.faker.definitions.music.album)}artist(){return this.faker.helpers.arrayElement(this.faker.definitions.music.artist)}genre(){return this.faker.helpers.arrayElement(this.faker.definitions.music.genre)}songName(){return this.faker.helpers.arrayElement(this.faker.definitions.music.song_name)}},Eue=class extends pa{number(e={}){let{style:r="human"}=e,n=this.faker.definitions.phone_number.format[r];
858if(!n)throw new Error(`No definitions for ${r} in this locale`);let a=this.faker.helpers.arrayElement(n);return wI(this.faker,a)}imei(){return this.faker.helpers.replaceCreditCardSymbols("##-######-######-L","#")}},Aue=class extends pa{chemicalElement(){return this.faker.helpers.arrayElement(this.faker.definitions.science.chemical_element)}unit(){return this.faker.helpers.arrayElement(this.faker.definitions.science.unit)}},Due=["video","audio","image","text","application"],Tue=["application/pdf","audio/mpeg","audio/wav","image/png","image/jpeg","image/gif","video/mp4","video/mpeg","text/html"],Mue=["en","wl","ww"],H5={index:"o",slot:"s",mac:"x",pci:"p"},Pue=["SUN","MON","TUE","WED","THU","FRI","SAT"],Rue=class extends pa{fileName(e={}){let{extensionCount:r=1}=e,n=this.faker.word.words().toLowerCase().replaceAll(/\W/g,"_"),a=this.faker.helpers.multiple(()=>this.fileExt(),{count:r}).join(".");return a.length===0?n:`${n}.${a}`}commonFileName(e){return`${this.fileName({extensionCount:0})}.${e||this.commonFileExt()}`}mimeType(){let e=Object.keys(this.faker.definitions.system.mime_type);return this.faker.helpers.arrayElement(e)}commonFileType(){return this.faker.helpers.arrayElement(Due)}commonFileExt(){return this.fileExt(this.faker.helpers.arrayElement(Tue))}fileType(){let e=this.faker.definitions.system.mime_type,r=new Set(Object.keys(e).map(n=>n.split("/")[0]));return this.faker.helpers.arrayElement([...r])}fileExt(e){let r=this.faker.definitions.system.mime_type;if(typeof e=="string")return this.faker.helpers.arrayElement(r[e].extensions);let n=new Set(Object.values(r).flatMap(({extensions:a})=>a));return this.faker.helpers.arrayElement([...n])}directoryPath(){let e=this.faker.definitions.system.directory_path;return this.faker.helpers.arrayElement(e)}filePath(){return`${this.directoryPath()}/${this.fileName()}`}semver(){return[this.faker.number.int(9),this.faker.number.int(20),this.faker.number.int(20)].join(".")}networkInterface(e={}){let{interfaceType:r=this.faker.helpers.arrayElement(Mue),interfaceSchema:n=this.faker.helpers.objectKey(H5)}=e,a,i="";switch(n){case"index":{a=this.faker.string.numeric();break}case"slot":{a=`${this.faker.string.numeric()}${this.faker.helpers.maybe(()=>`f${this.faker.string.numeric()}`)??""}${this.faker.helpers.maybe(()=>`d${this.faker.string.numeric()}`)??""}`;break}case"mac":{a=this.faker.internet.mac("");break}case"pci":{i=this.faker.helpers.maybe(()=>`P${this.faker.string.numeric()}`)??"",a=`${this.faker.string.numeric()}s${this.faker.string.numeric()}${this.faker.helpers.maybe(()=>`f${this.faker.string.numeric()}`)??""}${this.faker.helpers.maybe(()=>`d${this.faker.string.numeric()}`)??""}`;break}}return`${i}${r}${H5[n]}${a}`}cron(e={}){let{includeYear:r=!1,includeNonStandard:n=!1}=e,a=[this.faker.number.int(59),"*"],i=[this.faker.number.int(23),"*"],o=[this.faker.number.int({min:1,max:31}),"*","?"],l=[this.faker.number.int({min:1,max:12}),"*"],c=[this.faker.number.int(6),this.faker.helpers.arrayElement(Pue),"*","?"],u=[this.faker.number.int({min:1970,max:2099}),"*"],d=this.faker.helpers.arrayElement(a),h=this.faker.helpers.arrayElement(i),f=this.faker.helpers.arrayElement(o),m=this.faker.helpers.arrayElement(l),g=this.faker.helpers.arrayElement(c),y=this.faker.helpers.arrayElement(u),b=`${d} ${h} ${f} ${m} ${g}`;r&&(b+=` ${y}`);let w=["@annually","@daily","@hourly","@monthly","@reboot","@weekly","@yearly"];return!n||this.faker.datatype.boolean()?b:this.faker.helpers.arrayElement(w)}},Bue=class extends pa{vehicle(){return`${this.manufacturer()} ${this.model()}`}manufacturer(){return this.faker.helpers.arrayElement(this.faker.definitions.vehicle.manufacturer)}model(){return this.faker.helpers.arrayElement(this.faker.definitions.vehicle.model)}type(){return this.faker.helpers.arrayElement(this.faker.definitions.vehicle.type)}fuel(){return this.faker.helpers.arrayElement(this.faker.definitions.vehicle.fuel)}vin(){let e=["o","i","q","O","I","Q"];return`${this.faker.string.alphanumeric({length:10,casing:"upper",exclude:e})}${this.faker.string.alpha({length:1,casing:"upper",exclude:e})}
858${this.faker.string.alphanumeric({length:1,casing:"upper",exclude:e})}${this.faker.string.numeric({length:5,allowLeadingZeros:!0})}`}color(){return this.faker.color.human()}vrm(){return`${this.faker.string.alpha({length:2,casing:"upper"})}${this.faker.string.numeric({length:2,allowLeadingZeros:!0})}${this.faker.string.alpha({length:3,casing:"upper"})}`}bicycle(){return this.faker.helpers.arrayElement(this.faker.definitions.vehicle.bicycle_type)}},Lue=class extends pa{adjective(e={}){return typeof e=="number"&&(e={length:e}),this.faker.helpers.arrayElement(bh({...e,wordList:this.faker.definitions.word.adjective}))}adverb(e={}){return typeof e=="number"&&(e={length:e}),this.faker.helpers.arrayElement(bh({...e,wordList:this.faker.definitions.word.adverb}))}conjunction(e={}){return typeof e=="number"&&(e={length:e}),this.faker.helpers.arrayElement(bh({...e,wordList:this.faker.definitions.word.conjunction}))}interjection(e={}){return typeof e=="number"&&(e={length:e}),this.faker.helpers.arrayElement(bh({...e,wordList:this.faker.definitions.word.interjection}))}noun(e={}){return typeof e=="number"&&(e={length:e}),this.faker.helpers.arrayElement(bh({...e,wordList:this.faker.definitions.word.noun}))}preposition(e={}){return typeof e=="number"&&(e={length:e}),this.faker.helpers.arrayElement(bh({...e,wordList:this.faker.definitions.word.preposition}))}verb(e={}){return typeof e=="number"&&(e={length:e}),this.faker.helpers.arrayElement(bh({...e,wordList:this.faker.definitions.word.verb}))}sample(e={}){let r=this.faker.helpers.shuffle([this.adjective,this.adverb,this.conjunction,this.interjection,this.noun,this.preposition,this.verb]);for(let n of r)try{return n(e)}catch{continue}throw new Tr("No matching word data available for the current locale")}words(e={}){typeof e=="number"&&(e={count:e});let{count:r={min:1,max:3}}=e;return this.faker.helpers.multiple(()=>this.sample(),{count:r}).join(" ")}},Iue=class extends SI{constructor(e){super({randomizer:e.randomizer,seed:e.seed});sr(this,"rawDefinitions");sr(this,"definitions");sr(this,"airline",new Cce(this));sr(this,"animal",new hue(this));sr(this,"book",new mue(this));sr(this,"color",new Ece(this));sr(this,"commerce",new pue(this));sr(this,"company",new gue(this));sr(this,"database",new xue(this));sr(this,"date",new Yce(this));sr(this,"finance",new vue(this));sr(this,"food",new wue(this));sr(this,"git",new Nue(this));sr(this,"hacker",new Fue(this));sr(this,"helpers",new iue(this));sr(this,"image",new Sue(this));sr(this,"internet",new zce(this));sr(this,"location",new oue(this));sr(this,"lorem",new kue(this));sr(this,"music",new _ue(this));sr(this,"person",new Uce(this));sr(this,"phone",new Eue(this));sr(this,"science",new Aue(this));sr(this,"system",new Rue(this));sr(this,"vehicle",new Bue(this));sr(this,"word",new Lue(this));let{locale:r}=e;if(Array.isArray(r)){if(r.length===0)throw new Tr("The locale option must contain at least one locale definition.");r=due(r)}this.rawDefinitions=r,this.definitions=Kce(this.rawDefinitions)}get address(){return Yf({deprecated:"faker.address",proposed:"faker.location",since:"8.0",until:"10.0"}),this.location}get name(){return Yf({deprecated:"faker.name",proposed:"faker.person",since:"8.0",until:"10.0"}),this.person}getMetadata(){return this.rawDefinitions.metadata??{}}}
858,Oue=["Academy Color Encoding System (ACES)","Adobe RGB","Adobe Wide Gamut RGB","British Standard Colour (BS)","CIE 1931 XYZ","CIELAB","CIELUV","CIEUVW","CMY","CMYK","DCI-P3","Display-P3","Federal Standard 595C","HKS","HSL","HSLA","HSLuv","HSV","HWB","LCh","LMS","Munsell Color System","Natural Color System (NSC)","Pantone Matching System (PMS)","ProPhoto RGB Color Space","RAL","RG","RGBA","RGK","Rec. 2020","Rec. 2100","Rec. 601","Rec. 709","Uniform Color Spaces (UCSs)","YDbDr","YIQ","YPbPr","sRGB","sYCC","scRGB","xvYCC"],zue={space:Oue},Uue=zue,Hue=["ascii_bin","ascii_general_ci","cp1250_bin","cp1250_general_ci","utf8_bin","utf8_general_ci","utf8_unicode_ci"],$ue=["ARCHIVE","BLACKHOLE","CSV","InnoDB","MEMORY","MyISAM"],Wue=["bigint","binary","bit","blob","boolean","date","datetime","decimal","double","enum","float","geometry","int","mediumint","point","real","serial","set","smallint","text","time","timestamp","tinyint","varchar"],que={collation:Hue,engine:$ue,type:Wue},Gue=que,CI=["Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmara","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Atikokan","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Ciudad_Juarez","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Fort_Nelson","America/Fortaleza","America/Glace_Bay","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Indianapolis","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Inuvik","America/Iqaluit","America/Jamaica","America/Juneau","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montserrat","America/Nassau","America/New_York","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Nuuk","America/Ojinaga","America/Panama","America/Paramaribo","America/Phoenix","America/Port-au-Prince","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Punta_Arenas","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Atyrau","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Chita","Asia/Choibalsan","Asia/Colombo","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Famagusta","Asia/Gaza","Asia/Hebron","Asia/Ho_Chi_Minh","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Kathmandu","Asia/Khandyga","Asia/Kolkata","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qostanay","Asia/Qyzylorda","Asia/Riyadh","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ulaanbaatar","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yangon","Asia/Yekaterinburg","Asia/Yerevan","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faroe","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/Perth","Australia/Sydney","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kirov","Europe/Kyiv","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Saratov","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Ulyanovsk","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zurich","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Chuuk","Pacific/Easter","Pacific/Efate","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Kanton","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Wake","Pacific/Wallis"],Vue={time_zone:CI},Kue=Vue,Jue=["ADP","AGP","AI","API","ASCII","CLI","COM","CSS","DNS","DRAM","EXE","FTP","GB","HDD","HEX","HTTP","IB","IP","JBOD","JSON","OCR","PCI","PNG","RAM","RSS","SAS","SCSI","SDD","SMS","SMTP","SQL","SSD","SSL","TCP","THX","TLS","UDP","USB","UTF8","VGA","XML","XSS"],Yue={abbreviation:Jue},Zue=Yue,Xue={smiley:["â ï¸","â¹ï¸","âºï¸","â£ï¸","â¤ï¸","â¤ï¸âð¥","â¤ï¸âð©¹","ðï¸âð¨ï¸","ð¹","ðº","ð»","ð½","ð¾","ð¿","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð¢","ð£","ð¤","ð¥","ð¦","ð¨","ð©","ð«","ð¬","ð","ð¯","ð³ï¸","ð¤","ð¨ï¸","ð¯ï¸","ð","ð","ð","ð","ð","ð
","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð ","ð¡","ð¢","ð£","ð¤","ð¥","ð¦","ð§","ð¨","ð©","ðª","ð«","ð¬","ð","ð®","ð®âð¨","ð¯","ð°","ð±","ð²","ð³","ð´","ðµ","ðµâð«","ð¶","ð¶âð«ï¸","ð·","ð¸","ð¹","ðº","ð»","ð¼","ð½","ð¾","ð¿","ð","ð","ð","ð","ð","ð","ð","ð","ð¤","ð¤","ð¤","ð¤","ð¤","ð¤","ð¤","ð¤","ð¤","ð¤","ð¤ ","ð¤¡","ð¤¢","ð¤£","ð¤¤","ð¤¥","ð¤§","ð¤¨","ð¤©","ð¤ª","ð¤«","ð¤¬","ð¤","ð¤®","ð¤¯","ð¥°","ð¥±","ð¥²","ð¥³","ð¥´","ð¥µ","ð¥¶","ð¥¸","ð¥º","ð§","ð§¡"],body:["âð»","âð¼","âð½","âð¾","âð¿","âï¸","â","âð
858»","âð¼","âð½","âð¾","âð¿","â","âð»","âð¼","âð½","âð¾","âð¿","âð»","âð¼","âð½","âð¾","âð¿","âï¸","âð»","âð¼","âð½","âð¾","âð¿","âï¸","ð","ðï¸","ð","ðð»","ðð¼","ðð½","ðð¾","ðð¿","ð","ðð»","ðð¼","ðð½","ðð¾","ðð¿","ð","ð
","ð","ðð»","ðð¼","ðð½","ðð¾","ðð¿","ð","ðð»","ðð¼","ðð½","ðð¾","ðð¿","ð","ðð»","ðð¼","ðð½","ðð¾","ðð¿","ð","ðð»","ðð¼","ðð½","ðð¾","ðð¿","ð","ðð»","ðð¼","ðð½","ðð¾","ðð¿","ð","ðð»","ðð¼","ðð½","ðð¾","ðð¿","ð","ðð»","ðð¼","ðð½","ðð¾","ðð¿","ð","ðð»","ðð¼","ðð½","ðð¾","ðð¿","ð","ðð»","ðð¼","ðð½","ðð¾","ðð¿","ð","ðð»","ðð¼","ðð½","ðð¾","ðð¿","ð","ðð»","ðð¼","ðð½","ðð¾","ðð¿","ð
","ð
ð»","ð
ð¼","ð
ð½","ð
ð¾","ð
ð¿","ðª","ðªð»","ðªð¼","ðªð½","ðªð¾","ðªð¿","ðð»","ðð¼","ðð½","ðð¾","ðð¿","ðï¸","ð","ðð»","ðð¼","ðð½","ðð¾","ðð¿","ð","ðð»","ðð¼","ðð½","ðð¾","ðð¿","ð","ðð»","ðð¼","ðð½","ðð¾","ðð¿","ð","ðð»","ðð¼","ðð½","ðð¾","ðð¿","ð¤","ð¤ð»","ð¤ð¼","ð¤ð½","ð¤ð¾","ð¤ð¿","ð¤","ð¤ð»","ð¤ð¼","ð¤ð½","ð¤ð¾","ð¤ð¿","ð¤","ð¤ð»","ð¤ð¼","ð¤ð½","ð¤ð¾","ð¤ð¿","ð¤","ð¤ð»","ð¤ð¼","ð¤ð½","ð¤ð¾","ð¤ð¿","ð¤","ð¤ð»","ð¤ð¼","ð¤ð½","ð¤ð¾","ð¤ð¿","ð¤","ð¤ð»","ð¤ð¼","ð¤ð½","ð¤ð¾","ð¤ð¿","ð¤","ð¤ð»","ð¤ð¼","ð¤ð½","ð¤ð¾","ð¤ð¿","ð¤","ð¤","ð¤ð»","ð¤ð¼","ð¤ð½","ð¤ð¾","ð¤ð¿","ð¤","ð¤ð»","ð¤ð¼","ð¤ð½","ð¤ð¾","ð¤ð¿","ð¤²","ð¤²ð»","ð¤²ð¼","ð¤²ð½","ð¤²ð¾","ð¤²ð¿","ð¤³","ð¤³ð»","ð¤³ð¼","ð¤³ð½","ð¤³ð¾","ð¤³ð¿","ð¦´","ð¦µ","ð¦µð»","ð¦µð¼","ð¦µð½","ð¦µð¾","ð¦µð¿","ð¦¶","ð¦¶ð»","ð¦¶ð¼","ð¦¶ð½","ð¦¶ð¾","ð¦¶ð¿","ð¦·","ð¦»","ð¦»ð»","ð¦»ð¼","ð¦»ð½","ð¦»ð¾","ð¦»ð¿","ð¦¾","ð¦¿","ð§ ","ð«","ð«"],person:["ð
","ð
ð»","ð
ð¼","ð
ð½","ð
ð¾","ð
ð¿","ð¦","ð¦ð»","ð¦ð¼","ð¦ð½","ð¦ð¾","ð¦ð¿","ð§","ð§ð»","ð§ð¼","ð§ð½","ð§ð¾","ð§ð¿","ð¨","ð¨ââï¸","ð¨ââï¸","ð¨ââï¸","ð¨âð¾","ð¨âð³","ð¨âð¼","ð¨âð","ð¨âð¤","ð¨âð¨","ð¨âð«","ð¨âð","ð¨âð»","ð¨âð¼","ð¨âð§","ð¨âð¬","ð¨âð","ð¨âð","ð¨âð¦°","ð¨âð¦±","ð¨âð¦²","ð¨âð¦³","ð¨ð»","ð¨ð»ââï¸","ð¨ð»ââï¸","ð¨ð»ââï¸","ð¨ð»âð¾","ð¨ð»âð³","ð¨ð»âð¼","ð¨ð»âð","ð¨ð»âð¤","ð¨ð»âð¨","ð¨ð»âð«","ð¨ð»âð","ð¨ð»âð»","ð¨ð»âð¼","ð¨ð»âð§","ð¨ð»âð¬","ð¨ð»âð","ð¨ð»âð","ð¨ð»âð¦°","ð¨ð»âð¦±","ð¨ð»âð¦²","ð¨ð»âð¦³","ð¨ð¼","ð¨ð¼ââï¸","ð¨ð¼ââï¸","ð¨ð¼ââï¸","ð¨ð¼âð¾","ð¨ð¼âð³","ð¨ð¼âð¼","ð¨ð¼âð","ð¨ð¼âð¤","ð¨ð¼âð¨","ð¨ð¼âð«","ð¨ð¼âð","ð¨ð¼âð»","ð¨ð¼âð¼","ð¨ð¼âð§","ð¨ð¼âð¬","ð¨ð¼âð","ð¨ð¼âð","ð¨ð¼âð¦°","ð¨ð¼âð¦±","ð¨ð¼âð¦²","ð¨ð¼âð¦³","ð¨ð½","ð¨ð½ââï¸","ð¨ð½ââï¸","ð¨ð½ââï¸","ð¨ð½âð¾","ð¨ð½âð³","ð¨ð½âð¼","ð¨ð½âð","ð¨ð½âð¤","ð¨ð½âð¨","ð¨ð½âð«","ð¨ð½âð","ð¨ð½âð»","ð¨ð½âð¼","ð¨ð½âð§","ð¨ð½âð¬","ð¨ð½âð","ð¨ð½âð","ð¨ð½âð¦°","ð¨ð½âð¦±","ð¨ð½âð¦²","ð¨ð½âð¦³","ð¨ð¾","ð¨ð¾ââï¸","ð¨ð¾ââï¸","ð¨ð¾ââï¸","ð¨ð¾âð¾","ð¨ð¾âð³","ð¨ð¾âð¼","ð¨ð¾âð","ð¨ð¾âð¤","ð¨ð¾âð¨","ð¨ð¾âð«","ð¨ð¾âð","ð¨ð¾âð»","ð¨ð¾âð¼","ð¨ð¾âð§","ð¨ð¾âð¬","ð¨ð¾âð","ð¨ð¾âð","ð¨ð¾âð¦°","ð¨ð¾âð¦±","ð¨ð¾âð¦²","ð¨ð¾âð¦³","ð¨ð¿","ð¨ð¿ââï¸","ð¨ð¿ââï¸","ð¨ð¿ââï¸","ð¨ð¿âð¾","ð¨ð¿âð³","ð¨ð¿âð¼","ð¨ð¿âð","ð¨ð¿âð¤","ð¨ð¿âð¨","ð¨ð¿âð«","ð¨ð¿âð","ð¨ð¿âð»","ð¨ð¿âð¼","ð¨ð¿âð§","ð¨ð¿âð¬","ð¨ð¿âð","ð¨ð¿âð","ð¨ð¿âð¦°","ð¨ð¿âð¦±","ð¨ð¿âð¦²","ð¨ð¿âð¦³","ð©","ð©ââï¸","ð©ââï¸","ð©ââï¸","ð©âð¾","ð©âð³","ð©âð¼","ð©âð","ð©âð¤","ð©âð¨","ð©âð«","ð©âð","ð©âð»","ð©âð¼","ð©âð§","ð©âð¬","ð©âð","ð©âð","ð©âð¦°","ð©âð¦±","ð©âð¦²","ð©âð¦³","ð©ð»","ð©ð»ââï¸","ð©ð»ââï¸","ð©ð»ââï¸","ð©ð»âð¾","ð©ð»âð³","ð©ð»âð¼","ð©ð»âð","ð©ð»âð¤","ð©ð»âð¨","ð©ð»âð«","ð©ð»âð","ð©ð»âð»","ð©ð»âð¼","ð©ð»âð§","ð©ð»âð¬","ð©ð»âð","ð©ð»âð","ð©ð»âð¦°","ð©ð»âð¦±","ð©ð»âð¦²","ð©ð»âð¦³","ð©ð¼","ð©ð¼ââï¸","ð©ð¼ââï¸","ð©ð¼ââï¸","ð©ð¼âð¾","ð©ð¼âð³","ð©ð¼âð¼","ð©ð¼âð","ð©ð¼âð¤","ð©ð¼âð¨","ð©ð¼âð«","ð©ð¼âð","ð©ð¼âð»","ð©ð¼âð¼","ð©ð¼âð§","ð©ð¼âð¬","ð©ð¼âð","ð©ð¼âð","ð©ð¼âð¦°","ð©ð¼âð¦±","ð©ð¼âð¦²","ð©ð¼âð¦³","ð©ð½","ð©ð½ââï¸","ð©ð½ââï¸","ð©ð½ââï¸","ð©ð½âð¾","ð©ð½âð³","ð©ð½âð¼","ð©ð½âð","ð©ð½âð¤","ð©ð½âð¨","ð©ð½âð«","ð©ð½âð","ð©ð½âð»","ð©ð½âð¼","ð©ð½âð§","ð©ð½âð¬","ð©ð½âð","ð©ð½âð","ð©ð½âð¦°","ð©ð½âð¦±","ð©ð½âð¦²","ð©ð½âð¦³","ð©ð¾","ð©ð¾ââï¸","ð©ð¾ââï¸","ð©ð¾ââï¸","ð©ð¾âð¾","ð©ð¾âð³","ð©ð¾âð¼","ð©ð¾âð","ð©ð¾âð¤","ð©ð¾âð¨","ð©ð¾âð«","ð©ð¾âð","ð©ð¾âð»","ð©ð¾âð¼","ð©ð¾âð§","ð©ð¾âð¬","ð©ð¾âð","ð©ð¾âð","ð©ð¾âð¦°","ð©ð¾âð¦±","ð©ð¾âð¦²","ð©ð¾âð¦³","ð©ð¿","ð©ð¿ââï¸","ð©ð¿ââï¸","ð©ð¿ââï¸","ð©ð¿âð¾","ð©ð¿âð³","ð©ð¿âð¼","ð©ð¿âð","ð©ð¿âð¤","ð©ð¿âð¨","ð©ð¿âð«","ð©ð¿âð","ð©ð¿âð»","ð©ð¿âð¼","ð©ð¿âð§","ð©ð¿âð¬","ð©ð¿âð","ð©ð¿âð","ð©ð¿âð¦°","ð©ð¿âð¦±","ð©ð¿âð¦²","ð©ð¿âð¦³","ð®","ð®ââï¸","ð®ââï¸","ð®ð»","ð®ð»ââï¸","ð®ð»ââï¸","ð®ð¼","ð®ð¼ââï¸","ð®ð¼ââï¸","ð®ð½","ð®ð½ââï¸","ð®ð½ââï¸","ð®ð¾","ð®ð¾ââï¸","ð®ð¾ââï¸","ð®ð¿","ð®ð¿ââï¸","ð®ð¿ââï¸","ð°","ð°ââï¸","ð°ââï¸","ð°ð»","ð°ð»ââï¸","ð°ð»ââï¸","ð°ð¼","ð°ð¼ââï¸","ð°ð¼ââï¸","ð°ð½","ð°ð½ââï¸","ð°ð½ââï¸","ð°ð¾","ð°ð¾ââï¸","ð°ð¾ââï¸","ð°ð¿","ð°ð¿ââï¸","ð°ð¿ââï¸","ð±","ð±ââï¸","ð±ââï¸","ð±ð»","ð±ð»ââï¸","ð±ð»ââï¸","ð±ð¼","ð±ð¼ââï¸","ð±ð¼ââï¸","ð±ð½","ð±ð½ââï¸","ð±ð½ââï¸","ð±ð¾","ð±ð¾ââï¸","ð±ð¾ââï¸","ð±ð¿","ð±ð¿ââï¸","ð±ð¿ââï¸","ð²","ð²ð»","ð²ð¼","ð²ð½","ð²ð¾","ð²ð¿","ð³","ð³ââï¸","ð³ââï¸","ð³ð»","ð³ð»ââï¸","ð³ð»ââï¸","ð³ð¼","ð³ð¼ââï¸","ð³ð¼ââï¸","ð³ð½","ð³ð½ââï¸","ð³ð½ââï¸","ð³ð¾","ð³ð¾ââï¸","ð³ð¾ââï¸","ð³ð¿","ð³ð¿ââï¸","ð³ð¿ââï¸","ð´","ð´ð»","ð´ð¼","ð´ð½","ð´ð¾","ð´ð¿","ðµ","ðµð»","ðµð¼","ðµð½","ðµð¾","ðµð¿","ð¶","ð¶ð»","ð¶ð¼","ð¶ð½","ð¶ð¾","ð¶ð¿","ð·","ð·ââï¸","ð·ââï¸","ð·ð»","ð·ð»ââï¸","ð·ð»ââï¸","ð·ð¼","ð·ð¼ââï¸","ð·ð¼ââï¸","ð·ð½","ð·ð½ââï¸","ð·ð½ââï¸","ð·ð¾","ð·ð¾ââï¸","ð·ð¾ââï¸","ð·ð¿","ð·ð¿ââï¸","ð·ð¿ââï¸","ð¸","ð¸ð»","ð¸ð¼","ð¸ð½","ð¸ð¾","ð¸ð¿","ð¼","ð¼ð»","ð¼ð¼","ð¼ð½","ð¼ð¾","ð¼ð¿","ð","ðââï¸","ðââï¸","ðð»","ðð»ââï¸","ðð»ââï¸","ðð¼","ðð¼ââï¸","ðð¼ââï¸","ðð½","ðð½ââï¸","ðð½ââï¸","ðð¾","ðð¾ââï¸","ðð¾ââï¸","ðð¿","ðð¿ââï¸","ðð¿ââï¸","ð","ðââï¸","ðââï¸","ðð»","ðð»ââï¸","ðð»ââï¸","ðð¼","ðð¼ââï¸","ðð¼ââï¸","ðð½","ðð½ââï¸","ðð½ââï¸","ðð¾","ðð¾ââï¸","ðð¾ââï¸","ðð¿","ðð¿ââï¸","ðð¿ââï¸","ð","ðââï¸","ðââï¸","ðð»","ðð»ââï¸","ðð»ââï¸","ðð¼","ðð¼ââï¸","ðð¼ââï¸","ðð½","ðð½ââï¸","ðð½ââï¸","ðð¾","ðð¾ââï¸","ðð¾ââï¸","ðð¿","ðð¿ââï¸","ðð¿ââï¸","ð","ðð»","ðð¼","ðð½","ðµð»","ðµð»ââï¸","ðµð»ââï¸","ðµð¼","ðµð¼ââï¸","ðµð¼ââï¸","ðµð½","ðµð½ââï¸","ðµð½ââï¸","ðµð¾","ðµð¾ââï¸","ðµð¾ââï¸","ðµð¿","ðµð¿ââï¸","ðµð¿ââï¸","ðµï¸","ðµï¸ââï¸","ðµï¸ââï¸","ð
","ð
ââï¸","ð
ââï¸","ð
ð»","ð
ð»ââï¸","ð
ð»ââï¸","ð
ð¼","ð
ð¼ââï¸","ð
ð¼ââï¸","ð
ð½","ð
ð½ââï¸","ð
ð½ââï¸","ð
ð¾","ð
ð¾ââï¸","ð
ð¾ââï¸","ð
ð¿","ð
ð¿ââï¸","ð
ð¿ââï¸","ð","ðââï¸","ðââï¸","ðð»","ðð»ââï¸","ðð»ââï¸","ðð¼","ðð¼ââï¸","ðð¼ââï¸","ðð½","ðð½ââï¸","ðð½ââï¸","ðð¾","ðð¾ââï¸","ðð¾ââï¸","ðð¿","ðð¿ââï¸","ðð¿ââï¸","ð","ðââï¸","ðââï¸","ðð»","ðð»ââï¸","ðð»ââï¸","ðð¼","ðð¼ââï¸","ðð¼ââï¸","ðð½","ðð½ââï¸","ðð½ââï¸","ðð¾","ðð¾ââï¸","ðð¾ââï¸","ðð¿","ðð¿ââï¸","ðð¿ââï¸","ð","ðââï¸","ðââï¸","ðð»","ðð»ââï¸","ðð»ââï¸","ðð¼","ðð¼ââï¸","ðð¼ââï¸","ðð½","ðð½ââï¸","ðð½ââï¸","ðð¾","ðð¾ââï¸","ðð¾ââï¸","ðð¿","ðð¿ââï¸","ðð¿ââï¸","ð","ðââï¸","ðââï¸","ðð»","ðð»ââï¸","ðð»ââï¸","ðð¼","ðð¼ââï¸","ðð¼ââï¸","ðð½","ðð½ââï¸","ðð½ââï¸","ðð¾","ðð¾ââï¸","ðð¾ââï¸","ðð¿","ðð¿ââï¸","ðð¿ââï¸","ð","ðââï¸","ðââï¸","ðð»","ðð»ââï¸","ðð»ââï¸","ðð¼","ðð¼ââï¸","ðð¼ââï¸","ðð½","ðð½ââï¸","ðð½ââï¸","ðð¾","ðð¾ââï¸","ðð¾ââï¸","ðð¿","ðð¿ââï¸","ðð¿ââï¸","ð¤¦","ð¤¦ââï¸","ð¤¦ââï¸","ð¤¦ð»","ð¤¦ð»ââï¸","ð¤¦ð»ââï¸","ð¤¦ð¼","ð¤¦ð¼ââï¸","ð¤¦ð¼ââï¸","ð¤¦ð½","ð¤¦ð½ââï¸","ð¤¦ð½ââï¸","ð¤¦ð¾","ð¤¦ð¾ââï¸","ð¤¦ð¾ââï¸","ð¤¦ð¿","ð¤¦ð¿ââï¸","ð¤¦ð¿ââï¸","ð¤°","ð¤°ð»","ð¤°ð¼","ð¤°ð½","ð¤°ð¾","ð¤°ð¿","ð¤±","ð¤±ð»","ð¤±ð¼","ð¤±ð½","ð¤±ð¾","ð¤±ð¿","ð¤´","ð¤´ð»","ð¤´ð¼","ð¤´ð½","ð¤´ð¾","ð¤´ð¿","ð¤µ","ð¤µââï¸","ð¤µââï¸","ð¤µð»","ð¤µð»ââï¸","ð¤µð»ââï¸","ð¤µð¼","ð¤µð¼ââï¸","ð¤µð¼ââï¸","ð¤µð½","ð¤µð½ââï¸","ð¤µð½ââï¸","ð¤µð¾","ð¤µð¾ââï¸","ð¤µð¾ââï¸","ð¤µð¿","ð¤µð¿ââï¸","ð¤µð¿ââï¸","ð¤¶","ð¤¶ð»","ð¤¶ð¼","ð¤¶ð½","ð¤¶ð¾","ð¤¶ð¿","ð¤·","ð¤·ââï¸","ð¤·ââï¸","ð¤·ð»","ð¤·ð»ââï¸","ð¤·ð»ââï¸","ð¤·ð¼","ð¤·ð¼ââï¸","ð¤·ð¼ââï¸","ð¤·ð½","ð¤·ð½ââï¸","ð¤·ð½ââï¸","ð¤·ð¾","ð¤·ð¾ââï¸","ð¤·ð¾ââï¸","ð¤·ð¿","ð¤·ð¿ââï¸","ð¤·ð¿ââï¸","ð¥·","ð¥·ð»","ð¥·ð¼","ð¥·ð½","ð¥·ð¾","ð¥·ð¿","ð¦¸","ð¦¸ââï¸","ð¦¸ââï¸","ð¦¸ð»","ð¦¸ð»ââï¸","ð¦¸ð»ââï¸","ð¦¸ð¼","ð¦¸ð¼ââï¸","ð¦¸ð¼ââï¸","ð¦¸ð½","ð¦¸ð½ââï¸","ð¦¸ð½ââï¸","ð¦¸ð¾","ð¦¸ð¾ââï¸","ð¦¸ð¾ââï¸","ð¦¸ð¿","ð¦¸ð¿ââï¸","ð¦¸ð¿ââï¸","ð¦¹","ð¦¹ââï¸","ð¦¹ââï¸","ð¦¹ð»","ð¦¹ð»ââï¸","ð¦¹ð»ââï¸","ð¦¹ð¼","ð¦¹ð¼ââï¸","ð¦¹ð¼ââï¸","ð¦¹ð½","ð¦¹ð½ââï¸","ð¦¹ð½ââï¸","ð¦¹ð¾","ð¦¹ð¾ââï¸","ð¦¹ð¾ââï¸","ð¦¹ð¿","ð¦¹ð¿ââï¸","ð¦¹ð¿ââï¸","ð§","ð§ââï¸","ð§ââï¸","ð§ð»","ð§ð»ââï¸","ð§ð»ââï¸","ð§ð¼","ð§ð¼ââï¸","ð§ð¼ââï¸","ð§ð½","ð§ð½ââï¸","ð§ð½ââï¸","ð§ð¾","ð§ð¾ââï¸","ð§ð¾ââï¸","ð§ð¿","ð§ð¿ââï¸","ð§ð¿ââï¸","ð§","ð§ââï¸","ð§ââï¸","ð§ââï¸","ð§âð¾","ð§âð³","ð§âð¼","ð§âð","ð§âð","ð§âð¤","ð§âð¨","ð§âð«","ð§âð","ð§âð»","ð§âð¼","ð§âð§","ð§âð¬","ð§âð","ð§âð","ð§âð¦°","ð§âð¦±","ð§âð¦²","ð§âð¦³","ð§ð»","ð§ð»ââï¸","ð§ð»ââï¸","ð§ð»ââï¸","ð§ð»âð¾","ð§ð»âð³","ð§ð»âð¼","ð§ð»âð","ð§ð»âð","ð§ð»âð¤","ð§ð»âð¨","ð§ð»âð«","ð§ð»âð","ð§ð»âð»","ð§ð»âð¼","ð§ð»âð§","ð§ð»âð¬","ð§ð»âð","ð§ð»âð","ð§ð»âð¦°","ð§ð»âð¦±","ð§ð»âð¦²","ð§ð»âð¦³","ð§ð¼","ð§ð¼ââï¸","ð§ð¼ââï¸","ð§ð¼ââï¸","ð§ð¼âð¾","ð§ð¼âð³","ð§ð¼âð¼","ð§ð¼âð","ð§ð¼âð","ð§ð¼âð¤","ð§ð¼âð¨","ð§ð¼âð«","ð§ð¼âð","ð§ð¼âð»","ð§ð¼âð¼","ð§ð¼âð§","ð§ð¼âð¬","ð§ð¼âð","ð§ð¼âð","ð§ð¼âð¦°","ð§ð¼âð¦±","ð§ð¼âð¦²","ð§ð¼âð¦³","ð§ð½","ð§ð½ââï¸","ð§ð½ââï¸","ð§ð½ââï¸","ð§ð½âð¾","ð§ð½âð³","ð§ð½âð¼","ð§ð½âð","ð§ð½âð","ð§ð½âð¤","ð§ð½âð¨","ð§ð½âð«","ð§ð½âð","ð§ð½âð»","ð§ð½âð¼","ð§ð½âð§","ð§ð½âð¬","ð§ð½âð","ð§ð½âð","ð§ð½âð¦°","ð§ð½âð¦±","ð§ð½âð¦²","ð§ð½âð¦³","ð§ð¾","ð§ð¾ââï¸","ð§ð¾ââï¸","ð§ð¾ââï¸","ð§ð¾âð¾","ð§ð¾âð³","ð§ð¾âð¼","ð§ð¾âð","ð§ð¾âð","ð§ð¾âð¤","ð§ð¾âð¨","ð§ð¾âð«","ð§ð¾âð","ð§ð¾âð»","ð§ð¾âð¼","ð§ð¾âð§","ð§ð¾âð¬","ð§ð¾âð","ð§ð¾âð","ð§ð¾âð¦°","ð§ð¾âð¦±","ð§ð¾âð¦²","ð§ð¾âð¦³","ð§ð¿","ð§ð¿ââï¸","ð§ð¿ââï¸","ð§ð¿ââï¸","ð§ð¿âð¾","ð§ð¿âð³","ð§ð¿âð¼","ð§ð¿âð","ð§ð¿âð","ð§ð¿âð¤","ð§ð¿âð¨","ð§ð¿âð«","ð§ð¿âð","ð§ð¿âð»","ð§ð¿âð¼","ð§ð¿âð§","ð§ð¿âð¬","ð§ð¿âð","ð§ð
858¿âð","ð§ð¿âð¦°","ð§ð¿âð¦±","ð§ð¿âð¦²","ð§ð¿âð¦³","ð§","ð§ð»","ð§ð¼","ð§ð½","ð§ð¾","ð§ð¿","ð§","ð§ð»","ð§ð¼","ð§ð½","ð§ð¾","ð§ð¿","ð§","ð§ââï¸","ð§ââï¸","ð§ð»","ð§ð»ââï¸","ð§ð»ââï¸","ð§ð¼","ð§ð¼ââï¸","ð§ð¼ââï¸","ð§ð½","ð§ð½ââï¸","ð§ð½ââï¸","ð§ð¾","ð§ð¾ââï¸","ð§ð¾ââï¸","ð§ð¿","ð§ð¿ââï¸","ð§ð¿ââï¸","ð§","ð§ð»","ð§ð¼","ð§ð½","ð§ð¾","ð§ð¿","ð§","ð§ââï¸","ð§ââï¸","ð§ð»","ð§ð»ââï¸","ð§ð»ââï¸","ð§ð¼","ð§ð¼ââï¸","ð§ð¼ââï¸","ð§ð½","ð§ð½ââï¸","ð§ð½ââï¸","ð§ð¾","ð§ð¾ââï¸","ð§ð¾ââï¸","ð§ð¿","ð§ð¿ââï¸","ð§ð¿ââï¸","ð§","ð§ââï¸","ð§ââï¸","ð§ð»","ð§ð»ââï¸","ð§ð»ââï¸","ð§ð¼","ð§ð¼ââï¸","ð§ð¼ââï¸","ð§ð½","ð§ð½ââï¸","ð§ð½ââï¸","ð§ð¾","ð§ð¾ââï¸","ð§ð¾ââï¸","ð§ð¿","ð§ð¿ââï¸","ð§ð¿ââï¸","ð§","ð§ââï¸","ð§ââï¸","ð§ð»","ð§ð»ââï¸","ð§ð»ââï¸","ð§ð¼","ð§ð¼ââï¸","ð§ð¼ââï¸","ð§ð½","ð§ð½ââï¸","ð§ð½ââï¸","ð§ð¾","ð§ð¾ââï¸","ð§ð¾ââï¸","ð§ð¿","ð§ð¿ââï¸","ð§ð¿ââï¸","ð§","ð§ââï¸","ð§ââï¸","ð§ð»","ð§ð»ââï¸","ð§ð»ââï¸","ð§ð¼","ð§ð¼ââï¸","ð§ð¼ââï¸","ð§ð½","ð§ð½ââï¸","ð§ð½ââï¸","ð§ð¾","ð§ð¾ââï¸","ð§ð¾ââï¸","ð§ð¿","ð§ð¿ââï¸","ð§ð¿ââï¸","ð§","ð§ââï¸","ð§ââï¸","ð§ð»","ð§ð»ââï¸","ð§ð»ââï¸","ð§ð¼","ð§ð¼ââï¸","ð§ð¼ââï¸","ð§ð½","ð§ð½ââï¸","ð§ð½ââï¸","ð§ð¾","ð§ð¾ââï¸","ð§ð¾ââï¸","ð§ð¿","ð§ð¿ââï¸","ð§ð¿ââï¸","ð§","ð§ââï¸","ð§ââï¸","ð§","ð§ââï¸","ð§ââï¸"],nature:["âï¸","ð±","ð²","ð³","ð´","ðµ","ð·","ð¸","ð¹","ðº","ð»","ð¼","ð¾","ð¿","ð","ð","ð","ð","ðµï¸","ð","ð","ð","ð","ð","ð
","ð","ð","ð","ðââ¬","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ðâð¦º","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð ","ð¡","ð¢","ð£","ð¤","ð¥","ð¦","ð§","ð¨","ð©","ðª","ð«","ð¬","ð","ð®","ð¯","ð°","ð±","ð²","ð³","ð´","ðµ","ð¶","ð·","ð¸","ð¹","ðº","ð»","ð»ââï¸","ð¼","ð½","ð¾","ð¿ï¸","ð","ð®","ðï¸","ð·ï¸","ð¸ï¸","ð¥","ð¦","ð¦","ð¦","ð¦","ð¦
","ð¦","ð¦","ð¦","ð¦","ð¦","ð¦","ð¦","ð¦","ð¦","ð¦","ð¦","ð¦","ð¦","ð¦","ð¦","ð¦","ð¦","ð¦","ð¦","ð¦","ð¦","ð¦","ð¦","ð¦ ","ð¦¡","ð¦¢","ð¦£","ð¦¤","ð¦¥","ð¦¦","ð¦§","ð¦¨","ð¦©","ð¦«","ð¦¬","ð¦","ð¦®","ðª°","ðª±","ðª²","ðª³","ðª´","ðª¶"],food:["â","ð","ð®","ð¯","ð°","ð¶ï¸","ð½","ð","ð
","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð ","ð¡","ð¢","ð£","ð¤","ð¥","ð¦","ð§","ð¨","ð©","ðª","ð«","ð¬","ð","ð®","ð¯","ð°","ð±","ð²","ð³","ð´","ðµ","ð¶","ð·","ð¸","ð¹","ðº","ð»","ð¼","ð½ï¸","ð¾","ð¿","ð","ðº","ðª","ð¥","ð¥","ð¥","ð¥","ð¥","ð¥","ð¥","ð¥","ð¥","ð¥","ð¥","ð¥","ð¥","ð¥","ð¥","ð¥","ð¥","ð¥","ð¥","ð¥ ","ð¥¡","ð¥¢","ð¥£","ð¥¤","ð¥¥","ð¥¦","ð¥§","ð¥¨","ð¥©","ð¥ª","ð¥«","ð¥¬","ð¥","ð¥®","ð¥¯","ð¦","ð¦","ð¦","ð¦","ð¦ª","ð§","ð§","ð§","ð§","ð§","ð§
","ð§","ð§","ð§","ð§","ð§","ð§","ð«","ð«","ð«","ð«","ð«","ð«","ð«"],travel:["â","â","â°","â±ï¸","â²ï¸","â³","âï¸","âï¸","âï¸","âï¸","âï¸","â","â¨ï¸","â","â¡","â","â
","âï¸","â©ï¸","âª","â°ï¸","â±ï¸","â²","â´ï¸","âµ","âº","â½","âï¸","âï¸","â","ð","ð","ð","ð","ð","ð
","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð ","ð¡ï¸","ð¤ï¸","ð¥ï¸","ð¦ï¸","ð§ï¸","ð¨ï¸","ð©ï¸","ðªï¸","ð«ï¸","ð¬ï¸","ð ","ð¡","ð¢","ðª","ðï¸","ðï¸","ðï¸","ðï¸","ðï¸","ðï¸","ðï¸","ðï¸","ðï¸","ðï¸","ðï¸","ðï¸","ðï¸","ðï¸","ð ","ð¡","ð¢","ð£","ð¤","ð¥","ð¦","ð¨","ð©","ðª","ð«","ð¬","ð","ð¯","ð°","ð","ð","ð§","ðº","ð¥","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð ","ð¡","ð¢","ð£","ð¤","ð¥","ð¦","ð§","ð°ï¸","ðºï¸","ð»","ð¼","ð½","ð¾","ð","ð","ð","ð","ð","ð
","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð ","ð¡","ð¢","ð¤","ð¥","ð¦","ð§","ð¨","ð²","ðï¸","ð","ð","ð","ð¢ï¸","ð£ï¸","ð¤ï¸","ð¥ï¸","ð©ï¸","ð«","ð¬","ð°ï¸","ð³ï¸","ð´","ðµ","ð¶","ð¸","ð¹","ðº","ð»","ð¼","ð¦¼","ð¦½","ð§","ð§±","ð§³","ðª","ðª","ðª¨","ðªµ"],activity:["âï¸","â ï¸","â£ï¸","â¥ï¸","â¦ï¸","â½","â¾","â³","â¸ï¸","â¨","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ðï¸","ðï¸","ðï¸","ð£","ð¨","ð«","ð","ð®","ð¯","ð°","ð±","ð²","ð³","ð´","ð½","ð¾","ð¿","ð","ð
","ð","ð","ð","ð","ð","ð","ð","ð","ð¸","ð®","ð¹ï¸","ð¼ï¸","ð·","ð¤¿","ð¥
","ð¥","ð¥","ð¥","ð¥","ð¥","ð¥","ð¥","ð¥","ð¥","ð§§","ð§¨","ð§©","ð§µ","ð§¶","ð§¸","ð§¿","ðª","ðª","ðª","ðª
","ðª","ðª¡","ðª¢"],object:["â¨ï¸","âï¸","âï¸","âï¸","âï¸","âï¸","âï¸","â°ï¸","â±ï¸","âï¸","âï¸","âï¸","âï¸","âï¸","âï¸","âï¸","ð","ð","ðï¸","ðï¸","ðï¸","ðï¸","ð¤","ð¥","ð§","ð©","ð¬","ðµ","ð¶","ð·","ð¸","ð¹","ðº","ð»","ð¼","ð®","ð·ï¸","ð¹","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð ","ð¡","ð¢","ð","ð","ð","ð","ð","ð¡","ð°","ð³","ð´","ðµ","ð¶","ð·","ð¸","ð¹","ð»","ð¼","ð½","ð¾","ð¿","ð","ð","ð","ð","ð","ð
","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð ","ð¡","ð¢","ð£","ð¤","ð¥","ð¦","ð§","ð¨","ð©","ðª","ð«","ð¬","ð","ð®","ð¯","ð°","ð±","ð²","ð·","ð¸","ð¹","ðº","ð»","ð¼","ð½ï¸","ð¿","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð¦","ð§","ð¨","ð©","ð«","ð¬","ð","ð¯ï¸","ð¶ï¸","ðï¸","ðï¸","ðï¸","ðï¸","ðï¸","ð¥ï¸","ð¨ï¸","ð±ï¸","ð²ï¸","ðï¸","ðï¸","ðï¸","ðï¸","ðï¸","ðï¸","ðï¸","ðï¸","ðï¸","ð¡ï¸","ð³ï¸","ð¿","ðª","ð¬","ð½","ð¿","ð","ðï¸","ðï¸","ðï¸","ð","ð","ð ï¸","ð¡ï¸","ð¥","ð¥»","ð¥¼","ð¥½","ð¥¾","ð¥¿","ð¦¯","ð¦º","ð§¢","ð§£","ð§¤","ð§¥","ð§¦","ð§ª","ð§«","ð§¬","ð§®","ð§¯","ð§°","ð§²","ð§´","ð§·","ð§¹","ð§º","ð§»","ð§¼","ð§½","ð§¾","ð©°","ð©±","ð©²","ð©³","ð©´","ð©¸","ð©¹","ð©º","ðª","ðª","ðª","ðª","ðª","ðª","ðª","ðª","ðª","ðª","ðª","ðª","ðª","ðª","ðª","ðª","ðª ","ðª£","ðª¤","ðª¥","ðª¦","ðª§"],symbol:["#ï¸â£","*ï¸â£","0ï¸â£","1ï¸â£","2ï¸â£","3ï¸â£","4ï¸â£","5ï¸â£","6ï¸â£","7ï¸â£","8ï¸â£","9ï¸â£","©ï¸","®ï¸","â¼ï¸","âï¸","â¢ï¸","â¹ï¸","âï¸","âï¸","âï¸","âï¸","âï¸","âï¸","â©ï¸","âªï¸","âï¸","â©","âª","â«","â¬","âï¸","â®ï¸","â¯ï¸","â¸ï¸","â¹ï¸","âºï¸","âï¸","âªï¸","â«ï¸","â¶ï¸","âï¸","â»ï¸","â¼ï¸","â½","â¾","âï¸","â¢ï¸","â£ï¸","â¦ï¸","âªï¸","â®ï¸","â¯ï¸","â¸ï¸","âï¸","âï¸","â","â","â","â","â","â","â","â","â","â","â","â","â»ï¸","â¾ï¸","â¿","âï¸","âï¸","âï¸","â ï¸","â§ï¸","âª","â«","â","â","â
","âï¸","âï¸","âï¸","â
858¡ï¸","â³ï¸","â´ï¸","âï¸","â","â","â","â","â","â","â","â","â","â¡ï¸","â°","â¿","⤴ï¸","⤵ï¸","â¬
ï¸","â¬ï¸","â¬ï¸","â¬","â¬","â","ã°ï¸","ã½ï¸","ãï¸","ãï¸","ð
°ï¸","ð
±ï¸","ð
¾ï¸","ð
¿ï¸","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð","ðï¸","ð","ð¯","ð²","ð³","ð´","ðµ","ð¶","ð·ï¸","ð¸","ð¹","ðº","ð","ð","ð¦","ð§","ð ","ð±","ð²","ð","ð³","ð´","ðµ","ð¶","ð","ð","ð","ð","ð","ð
","ð","ð","ð","ð","ð","ð","ð","ð","ð","ð ","ð¡","ð¢","ð£","ð¤","ð¯","ð°","ð±","ð²","ð³","ð´","ðµ","ð¶","ð·","ð¸","ð¹","ðº","ð»","ð¼","ð½","ðï¸","ð","ð«","ð","ð®","ð¯","ð°","ð±","ð³","ð·","ð¸","ð¹","ðº","ð»","ð¼","ð¾","ð","ð","ð","ð
","ð","ð ","ð¡","ð¢","ð£","ð¤","ð¥","ð¦","ð§","ð¨","ð©","ðª","ð«"],flag:["ð¦ð¨","ð¦ð©","ð¦ðª","ð¦ð«","ð¦ð¬","ð¦ð®","ð¦ð±","ð¦ð²","ð¦ð´","ð¦ð¶","ð¦ð·","ð¦ð¸","ð¦ð¹","ð¦ðº","ð¦ð¼","ð¦ð½","ð¦ð¿","ð§ð¦","ð§ð§","ð§ð©","ð§ðª","ð§ð«","ð§ð¬","ð§ð","ð§ð®","ð§ð¯","ð§ð±","ð§ð²","ð§ð³","ð§ð´","ð§ð¶","ð§ð·","ð§ð¸","ð§ð¹","ð§ð»","ð§ð¼","ð§ð¾","ð§ð¿","ð¨ð¦","ð¨ð¨","ð¨ð©","ð¨ð«","ð¨ð¬","ð¨ð","ð¨ð®","ð¨ð°","ð¨ð±","ð¨ð²","ð¨ð³","ð¨ð´","ð¨ðµ","ð¨ð·","ð¨ðº","ð¨ð»","ð¨ð¼","ð¨ð½","ð¨ð¾","ð¨ð¿","ð©ðª","ð©ð¬","ð©ð¯","ð©ð°","ð©ð²","ð©ð´","ð©ð¿","ðªð¦","ðªð¨","ðªðª","ðªð¬","ðªð","ðªð·","ðªð¸","ðªð¹","ðªðº","ð«ð®","ð«ð¯","ð«ð°","ð«ð²","ð«ð´","ð«ð·","ð¬ð¦","ð¬ð§","ð¬ð©","ð¬ðª","ð¬ð«","ð¬ð¬","ð¬ð","ð¬ð®","ð¬ð±","ð¬ð²","ð¬ð³","ð¬ðµ","ð¬ð¶","ð¬ð·","ð¬ð¸","ð¬ð¹","ð¬ðº","ð¬ð¼","ð¬ð¾","ðð°","ðð²","ðð³","ðð·","ðð¹","ððº","ð®ð¨","ð®ð©","ð®ðª","ð®ð±","ð®ð²","ð®ð³","ð®ð´","ð®ð¶","ð®ð·","ð®ð¸","ð®ð¹","ð¯ðª","ð¯ð²","ð¯ð´","ð¯ðµ","ð°ðª","ð°ð¬","ð°ð","ð°ð®","ð°ð²","ð°ð³","ð°ðµ","ð°ð·","ð°ð¼","ð°ð¾","ð°ð¿","ð±ð¦","ð±ð§","ð±ð¨","ð±ð®","ð±ð°","ð±ð·","ð±ð¸","ð±ð¹","ð±ðº","ð±ð»","ð±ð¾","ð²ð¦","ð²ð¨","ð²ð©","ð²ðª","ð²ð«","ð²ð¬","ð²ð","ð²ð°","ð²ð±","ð²ð²","ð²ð³","ð²ð´","ð²ðµ","ð²ð¶","ð²ð·","ð²ð¸","ð²ð¹","ð²ðº","ð²ð»","ð²ð¼","ð²ð½","ð²ð¾","ð²ð¿","ð³ð¦","ð³ð¨","ð³ðª","ð³ð«","ð³ð¬","ð³ð®","ð³ð±","ð³ð´","ð³ðµ","ð³ð·","ð³ðº","ð³ð¿","ð´ð²","ðµð¦","ðµðª","ðµð«","ðµð¬","ðµð","ðµð°","ðµð±","ðµð²","ðµð³","ðµð·","ðµð¸","ðµð¹","ðµð¼","ðµð¾","ð¶ð¦","ð·ðª","ð·ð´","ð·ð¸","ð·ðº","ð·ð¼","ð¸ð¦","ð¸ð§","ð¸ð¨","ð¸ð©","ð¸ðª","ð¸ð¬","ð¸ð","ð¸ð®","ð¸ð¯","ð¸ð°","ð¸ð±","ð¸ð²","ð¸ð³","ð¸ð´","ð¸ð·","ð¸ð¸","ð¸ð¹","ð¸ð»","ð¸ð½","ð¸ð¾","ð¸ð¿","ð¹ð¦","ð¹ð¨","ð¹ð©","ð¹ð«","ð¹ð¬","ð¹ð","ð¹ð¯","ð¹ð°","ð¹ð±","ð¹ð²","ð¹ð³","ð¹ð´","ð¹ð·","ð¹ð¹","ð¹ð»","ð¹ð¼","ð¹ð¿","ðºð¦","ðºð¬","ðºð²","ðºð³","ðºð¸","ðºð¾","ðºð¿","ð»ð¦","ð»ð¨","ð»ðª","ð»ð¬","ð»ð®","ð»ð³","ð»ðº","ð¼ð«","ð¼ð¸","ð½ð°","ð¾ðª","ð¾ð¹","ð¿ð¦","ð¿ð²","ð¿ð¼","ð","ð","ð³ï¸","ð³ï¸ââ§ï¸","ð³ï¸âð","ð´","ð´ââ ï¸","ð©"]},Que={informational:[100,101,102,103],success:[200,201,202,203,204,205,206,207,208,226],redirection:[300,301,302,303,304,305,306,307,308],clientError:[400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,421,422,423,424,425,426,428,429,431,451],serverError:[500,501,502,503,504,505,506,507,508,510,511]},ede=["ES256","ES384","ES512","HS256","HS384","HS512","PS256","PS384","PS512","RS256","RS384","RS512","none"],tde=["FakerBot/{{system.semver}}","Googlebot/2.1 (+http://www.google.com/bot.html)",'Mozilla/5.0 (Linux; Android {{number.int({"min":5,"max":13})}}; {{helpers.arrayElement(["SM-G998U","SM-G998B","SM-G998N","SM-G998P","SM-T800"])}}) AppleWebKit/{{number.int({"min":536,"max":605})}}.{{number.int({"min":0,"max":99})}} (KHTML, like Gecko) Chrome/{{number.int({"min":55,"max":131})}}.{{system.semver}} Mobile Safari/{{number.int({"min":536,"max":605})}}.{{number.int({"min":0,"max":99})}}','Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:{{number.int({"min":75, "max":133})}}.0) Gecko/20100101 Firefox/{{number.int({"min":75, "max":133})}}.0','Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/{{number.int({"min":536,"max":605})}}.{{number.int({"min":0,"max":99})}}.{{number.int({"min":0,"max":99})}} (KHTML, like Gecko) Version/16.1 Safari/{{number.int({"min":536,"max":605})}}.{{number.int({"min":0,"max":99})}}.{{number.int({"min":0,"max":99})}}','Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_15_7) AppleWebKit/{{number.int({"min":536,"max":605})}}.{{number.int({"min":0,"max":99})}}.{{number.int({"min":0,"max":99})}} (KHTML, like Gecko) Chrome/{{number.int({"min":55,"max":131})}}.{{system.semver}} Safari/{{number.int({"min":536,"max":605})}}.{{number.int({"min":0,"max":99})}}.{{number.int({"min":0,"max":99})}}','Mozilla/5.0 (Windows NT {{helpers.arrayElement(["5.1","5.2","6.0","6.1","6.2","6.3","10.0"])}}; Win64; x64) AppleWebKit/{{number.int({"min":536,"max":605})}}.{{number.int({"min":0,"max":99})}} (KHTML, like Gecko) Chrome/{{number.int({"min":55,"max":131})}}.{{system.semver}} Safari/{{number.int({"min":536,"max":605})}}.{{number.int({"min":0,"max":99})}} Edg/{{number.int({"min":110,"max":131})}}.{{system.semver}}','Mozilla/5.0 (X11; Linux x86_64; rv:{{number.int({"min":75,"max":133})}}.0) Gecko/20100101 Firefox/{{number.int({"min":75,"max":133})}}.0','Mozilla/5.0 (compatible; MSIE {{number.int({"min":6,"max":10})}}.0; Windows NT {{helpers.arrayElement(["5.1","5.2","6.0","6.1","6.2","6.3","10.0"])}}; Trident/{{number.int({"min":4,"max":7})}}.0)','Mozilla/5.0 (iPhone; CPU iPhone OS {{number.int({"min":10,"max":18})}}_{{number.int({"min":0,"max":4})}} like Mac OS X) AppleWebKit/{{number.int({"min":536,"max":605})}}.{{number.int({"min":0,"max":99})}}.{{number.int({"min":0,"max":99})}} (KHTML, like Gecko) Version/{{number.int({"min":10,"max":18})}}_{{number.int({"min":0,"max":4})}} Mobile/15E148 Safari/{{number.int({"min":536,"max":605})}}.{{number.int({"min":0,"max":99})}}'],rde={emoji:Xue,http_status_code:Que,jwt_algorithm:ede,user_agent_pattern:tde},sde=rde,nde=[{alpha2:"AD",alpha3:"AND",numeric:"020"},{alpha2:"AE",alpha3:"ARE",numeric:"784"},{alpha2:"AF",alpha3:"AFG",numeric:"004"},{alpha2:"AG",alpha3:"ATG",numeric:"028"},{alpha2:"AI",alpha3:"AIA",numeric:"660"},{alpha2:"AL",alpha3:"ALB",numeric:"008"},{alpha2:"AM",alpha3:"ARM",numeric:"051"},{alpha2:"AO",alpha3:"AGO",numeric:"024"},{alpha2:"AQ",alpha3:"ATA",numeric:"010"},{alpha2:"AR",alpha3:"ARG",numeric:"032"},{alpha2:"AS",alpha3:"ASM",numeric:"016"},{alpha2:"AT",alpha3:"AUT",numeric:"040"},{alpha2:"AU",alpha3:"AUS",numeric:"036"},{alpha2:"AW",alpha3:"ABW",numeric:"533"},{alpha2:"AX",alpha3:"ALA",numeric:"248"},{alpha2:"AZ",alpha3:"AZE",numeric:"031"},{alpha2:"BA",alpha3:"BIH",numeric:"070"},{alpha2:"BB",alpha3:"BRB",numeric:"052"},{alpha2:"BD",alpha3:"BGD",numeric:"050"},{alpha2:"BE",alpha3:"BEL",numeric:"056"},{alpha2:"BF",alpha3:"BFA",numeric:"854"},{alpha2:"BG",alpha3:"BGR",numeric:"100"},{alpha2:"BH",alpha3:"BHR",numeric:"048"}
858,{alpha2:"BI",alpha3:"BDI",numeric:"108"},{alpha2:"BJ",alpha3:"BEN",numeric:"204"},{alpha2:"BL",alpha3:"BLM",numeric:"652"},{alpha2:"BM",alpha3:"BMU",numeric:"060"},{alpha2:"BN",alpha3:"BRN",numeric:"096"},{alpha2:"BO",alpha3:"BOL",numeric:"068"},{alpha2:"BQ",alpha3:"BES",numeric:"535"},{alpha2:"BR",alpha3:"BRA",numeric:"076"},{alpha2:"BS",alpha3:"BHS",numeric:"044"},{alpha2:"BT",alpha3:"BTN",numeric:"064"},{alpha2:"BV",alpha3:"BVT",numeric:"074"},{alpha2:"BW",alpha3:"BWA",numeric:"072"},{alpha2:"BY",alpha3:"BLR",numeric:"112"},{alpha2:"BZ",alpha3:"BLZ",numeric:"084"},{alpha2:"CA",alpha3:"CAN",numeric:"124"},{alpha2:"CC",alpha3:"CCK",numeric:"166"},{alpha2:"CD",alpha3:"COD",numeric:"180"},{alpha2:"CF",alpha3:"CAF",numeric:"140"},{alpha2:"CG",alpha3:"COG",numeric:"178"},{alpha2:"CH",alpha3:"CHE",numeric:"756"},{alpha2:"CI",alpha3:"CIV",numeric:"384"},{alpha2:"CK",alpha3:"COK",numeric:"184"},{alpha2:"CL",alpha3:"CHL",numeric:"152"},{alpha2:"CM",alpha3:"CMR",numeric:"120"},{alpha2:"CN",alpha3:"CHN",numeric:"156"},{alpha2:"CO",alpha3:"COL",numeric:"170"},{alpha2:"CR",alpha3:"CRI",numeric:"188"},{alpha2:"CU",alpha3:"CUB",numeric:"192"},{alpha2:"CV",alpha3:"CPV",numeric:"132"},{alpha2:"CW",alpha3:"CUW",numeric:"531"},{alpha2:"CX",alpha3:"CXR",numeric:"162"},{alpha2:"CY",alpha3:"CYP",numeric:"196"},{alpha2:"CZ",alpha3:"CZE",numeric:"203"},{alpha2:"DE",alpha3:"DEU",numeric:"276"},{alpha2:"DJ",alpha3:"DJI",numeric:"262"},{alpha2:"DK",alpha3:"DNK",numeric:"208"},{alpha2:"DM",alpha3:"DMA",numeric:"212"},{alpha2:"DO",alpha3:"DOM",numeric:"214"},{alpha2:"DZ",alpha3:"DZA",numeric:"012"},{alpha2:"EC",alpha3:"ECU",numeric:"218"},{alpha2:"EE",alpha3:"EST",numeric:"233"},{alpha2:"EG",alpha3:"EGY",numeric:"818"},{alpha2:"EH",alpha3:"ESH",numeric:"732"},{alpha2:"ER",alpha3:"ERI",numeric:"232"},{alpha2:"ES",alpha3:"ESP",numeric:"724"},{alpha2:"ET",alpha3:"ETH",numeric:"231"},{alpha2:"FI",alpha3:"FIN",numeric:"246"},{alpha2:"FJ",alpha3:"FJI",numeric:"242"},{alpha2:"FK",alpha3:"FLK",numeric:"238"},{alpha2:"FM",alpha3:"FSM",numeric:"583"},{alpha2:"FO",alpha3:"FRO",numeric:"234"},{alpha2:"FR",alpha3:"FRA",numeric:"250"},{alpha2:"GA",alpha3:"GAB",numeric:"266"},{alpha2:"GB",alpha3:"GBR",numeric:"826"},{alpha2:"GD",alpha3:"GRD",numeric:"308"},{alpha2:"GE",alpha3:"GEO",numeric:"268"},{alpha2:"GF",alpha3:"GUF",numeric:"254"},{alpha2:"GG",alpha3:"GGY",numeric:"831"},{alpha2:"GH",alpha3:"GHA",numeric:"288"},{alpha2:"GI",alpha3:"GIB",numeric:"292"},{alpha2:"GL",alpha3:"GRL",numeric:"304"},{alpha2:"GM",alpha3:"GMB",numeric:"270"},{alpha2:"GN",alpha3:"GIN",numeric:"324"},{alpha2:"GP",alpha3:"GLP",numeric:"312"},{alpha2:"GQ",alpha3:"GNQ",numeric:"226"},{alpha2:"GR",alpha3:"GRC",numeric:"300"},{alpha2:"GS",alpha3:"SGS",numeric:"239"},{alpha2:"GT",alpha3:"GTM",numeric:"320"},{alpha2:"GU",alpha3:"GUM",numeric:"316"},{alpha2:"GW",alpha3:"GNB",numeric:"624"},{alpha2:"GY",alpha3:"GUY",numeric:"328"},{alpha2:"HK",alpha3:"HKG",numeric:"344"},{alpha2:"HM",alpha3:"HMD",numeric:"334"},{alpha2:"HN",alpha3:"HND",numeric:"340"},{alpha2:"HR",alpha3:"HRV",numeric:"191"},{alpha2:"HT",alpha3:"HTI",numeric:"332"},{alpha2:"HU",alpha3:"HUN",numeric:"348"},{alpha2:"ID",alpha3:"IDN",numeric:"360"},{alpha2:"IE",alpha3:"IRL",numeric:"372"},{alpha2:"IL",alpha3:"ISR",numeric:"376"},{alpha2:"IM",alpha3:"IMN",numeric:"833"},{alpha2:"IN",alpha3:"IND",numeric:"356"},{alpha2:"IO",alpha3:"IOT",numeric:"086"},{alpha2:"IQ",alpha3:"IRQ",numeric:"368"},{alpha2:"IR",alpha3:"IRN",numeric:"364"},{alpha2:"IS",alpha3:"ISL",numeric:"352"},{alpha2:"IT",alpha3:"ITA",numeric:"380"},{alpha2:"JE",alpha3:"JEY",numeric:"832"},{alpha2:"JM",alpha3:"JAM",numeric:"388"},{alpha2:"JO",alpha3:"JOR",numeric:"400"},{alpha2:"JP",alpha3:"JPN",numeric:"392"},{alpha2:"KE",alpha3:"KEN",numeric:"404"},{alpha2:"KG",alpha3:"KGZ",numeric:"417"},{alpha2:"KH",alpha3:"KHM",numeric:"116"},{alpha2:"KI",alpha3:"KIR",numeric:"296"},{alpha2:"KM",alpha3:"COM",numeric:"174"},{alpha2:"KN",alpha3:"KNA",numeric:"659"},{alpha2:"KP",alpha3:"PRK",numeric:"408"},{alpha2:"KR",alpha3:"KOR",numeric:"410"},{alpha2:"KW",alpha3:"KWT",numeric:"414"},{alpha2:"KY",alpha3:"CYM",numeric:"136"},{alpha2:"KZ",alpha3:"KAZ",numeric:"398"},{alpha2:"LA",alpha3:"LAO",numeric:"418"},{alpha2:"LB",alpha3:"LBN",numeric:"422"},{alpha2:"LC",alpha3:"LCA",numeric:"662"},{alpha2:"LI",alpha3:"LIE",numeric:"438"},{alpha2:"LK",alpha3:"LKA",numeric:"144"},{alpha2:"LR",alpha3:"LBR",numeric:"430"},{alpha2:"LS",alpha3:"LSO",numeric:"426"},{alpha2:"LT",alpha3:"LTU",numeric:"440"},{alpha2:"LU",alpha3:"LUX",numeric:"442"},{alpha2:"LV",alpha3:"LVA",numeric:"428"},{alpha2:"LY",alpha3:"LBY",numeric:"434"},{alpha2:"MA",alpha3:"MAR",numeric:"504"},{alpha2:"MC",alpha3:"MCO",numeric:"492"},{alpha2:"MD",alpha3:"MDA",numeric:"498"},{alpha2:"ME",alpha3:"MNE",numeric:"499"},{alpha2:"MF",alpha3:"MAF",numeric:"663"},{alpha2:"MG",alpha3:"MDG",numeric:"450"},{alpha2:"MH",alpha3:"MHL",numeric:"584"},{alpha2:"MK",alpha3:"MKD",numeric:"807"},{alpha2:"ML",alpha3:"MLI",numeric:"466"},{alpha2:"MM",alpha3:"MMR",numeric:"104"},{alpha2:"MN",alpha3:"MNG",numeric:"496"},{alpha2:"MO",alpha3:"MAC",numeric:"446"},{alpha2:"MP",alpha3:"MNP",numeric:"580"}
858,{alpha2:"MQ",alpha3:"MTQ",numeric:"474"},{alpha2:"MR",alpha3:"MRT",numeric:"478"},{alpha2:"MS",alpha3:"MSR",numeric:"500"},{alpha2:"MT",alpha3:"MLT",numeric:"470"},{alpha2:"MU",alpha3:"MUS",numeric:"480"},{alpha2:"MV",alpha3:"MDV",numeric:"462"},{alpha2:"MW",alpha3:"MWI",numeric:"454"},{alpha2:"MX",alpha3:"MEX",numeric:"484"},{alpha2:"MY",alpha3:"MYS",numeric:"458"},{alpha2:"MZ",alpha3:"MOZ",numeric:"508"},{alpha2:"NA",alpha3:"NAM",numeric:"516"},{alpha2:"NC",alpha3:"NCL",numeric:"540"},{alpha2:"NE",alpha3:"NER",numeric:"562"},{alpha2:"NF",alpha3:"NFK",numeric:"574"},{alpha2:"NG",alpha3:"NGA",numeric:"566"},{alpha2:"NI",alpha3:"NIC",numeric:"558"},{alpha2:"NL",alpha3:"NLD",numeric:"528"},{alpha2:"NO",alpha3:"NOR",numeric:"578"},{alpha2:"NP",alpha3:"NPL",numeric:"524"},{alpha2:"NR",alpha3:"NRU",numeric:"520"},{alpha2:"NU",alpha3:"NIU",numeric:"570"},{alpha2:"NZ",alpha3:"NZL",numeric:"554"},{alpha2:"OM",alpha3:"OMN",numeric:"512"},{alpha2:"PA",alpha3:"PAN",numeric:"591"},{alpha2:"PE",alpha3:"PER",numeric:"604"},{alpha2:"PF",alpha3:"PYF",numeric:"258"},{alpha2:"PG",alpha3:"PNG",numeric:"598"},{alpha2:"PH",alpha3:"PHL",numeric:"608"},{alpha2:"PK",alpha3:"PAK",numeric:"586"},{alpha2:"PL",alpha3:"POL",numeric:"616"},{alpha2:"PM",alpha3:"SPM",numeric:"666"},{alpha2:"PN",alpha3:"PCN",numeric:"612"},{alpha2:"PR",alpha3:"PRI",numeric:"630"},{alpha2:"PS",alpha3:"PSE",numeric:"275"},{alpha2:"PT",alpha3:"PRT",numeric:"620"},{alpha2:"PW",alpha3:"PLW",numeric:"585"},{alpha2:"PY",alpha3:"PRY",numeric:"600"},{alpha2:"QA",alpha3:"QAT",numeric:"634"},{alpha2:"RE",alpha3:"REU",numeric:"638"},{alpha2:"RO",alpha3:"ROU",numeric:"642"},{alpha2:"RS",alpha3:"SRB",numeric:"688"},{alpha2:"RU",alpha3:"RUS",numeric:"643"},{alpha2:"RW",alpha3:"RWA",numeric:"646"},{alpha2:"SA",alpha3:"SAU",numeric:"682"},{alpha2:"SB",alpha3:"SLB",numeric:"090"},{alpha2:"SC",alpha3:"SYC",numeric:"690"},{alpha2:"SD",alpha3:"SDN",numeric:"729"},{alpha2:"SE",alpha3:"SWE",numeric:"752"},{alpha2:"SG",alpha3:"SGP",numeric:"702"},{alpha2:"SH",alpha3:"SHN",numeric:"654"},{alpha2:"SI",alpha3:"SVN",numeric:"705"},{alpha2:"SJ",alpha3:"SJM",numeric:"744"},{alpha2:"SK",alpha3:"SVK",numeric:"703"},{alpha2:"SL",alpha3:"SLE",numeric:"694"},{alpha2:"SM",alpha3:"SMR",numeric:"674"},{alpha2:"SN",alpha3:"SEN",numeric:"686"},{alpha2:"SO",alpha3:"SOM",numeric:"706"},{alpha2:"SR",alpha3:"SUR",numeric:"740"},{alpha2:"SS",alpha3:"SSD",numeric:"728"},{alpha2:"ST",alpha3:"STP",numeric:"678"},{alpha2:"SV",alpha3:"SLV",numeric:"222"},{alpha2:"SX",alpha3:"SXM",numeric:"534"},{alpha2:"SY",alpha3:"SYR",numeric:"760"},{alpha2:"SZ",alpha3:"SWZ",numeric:"748"},{alpha2:"TC",alpha3:"TCA",numeric:"796"},{alpha2:"TD",alpha3:"TCD",numeric:"148"},{alpha2:"TF",alpha3:"ATF",numeric:"260"},{alpha2:"TG",alpha3:"TGO",numeric:"768"},{alpha2:"TH",alpha3:"THA",numeric:"764"},{alpha2:"TJ",alpha3:"TJK",numeric:"762"},{alpha2:"TK",alpha3:"TKL",numeric:"772"},{alpha2:"TL",alpha3:"TLS",numeric:"626"},{alpha2:"TM",alpha3:"TKM",numeric:"795"},{alpha2:"TN",alpha3:"TUN",numeric:"788"},{alpha2:"TO",alpha3:"TON",numeric:"776"},{alpha2:"TR",alpha3:"TUR",numeric:"792"},{alpha2:"TT",alpha3:"TTO",numeric:"780"},{alpha2:"TV",alpha3:"TUV",numeric:"798"},{alpha2:"TW",alpha3:"TWN",numeric:"158"},{alpha2:"TZ",alpha3:"TZA",numeric:"834"},{alpha2:"UA",alpha3:"UKR",numeric:"804"},{alpha2:"UG",alpha3:"UGA",numeric:"800"},{alpha2:"UM",alpha3:"UMI",numeric:"581"},{alpha2:"US",alpha3:"USA",numeric:"840"},{alpha2:"UY",alpha3:"URY",numeric:"858"},{alpha2:"UZ",alpha3:"UZB",numeric:"860"},{alpha2:"VA",alpha3:"VAT",numeric:"336"},{alpha2:"VC",alpha3:"VCT",numeric:"670"},{alpha2:"VE",alpha3:"VEN",numeric:"862"},{alpha2:"VG",alpha3:"VGB",numeric:"092"},{alpha2:"VI",alpha3:"VIR",numeric:"850"},{alpha2:"VN",alpha3:"VNM",numeric:"704"},{alpha2:"VU",alpha3:"VUT",numeric:"548"},{alpha2:"WF",alpha3:"WLF",numeric:"876"},{alpha2:"WS",alpha3:"WSM",numeric:"882"},{alpha2:"YE",alpha3:"YEM",numeric:"887"},{alpha2:"YT",alpha3:"MYT",numeric:"175"},{alpha2:"ZA",alpha3:"ZAF",numeric:"710"},{alpha2:"ZM",alpha3:"ZMB",numeric:"894"},{alpha2:"ZW",alpha3:"ZWE",numeric:"716"}],ade={country_code:nde,time_zone:CI},ide=ade,ode={title:"Base",code:"base"},lde=ode,cde=["/Applications","/bin","/boot","/boot/defaults","/dev","/etc","/etc/defaults","/etc/mail","/etc/namedb","/etc/periodic","/etc/ppp","/home","/home/user","/home/user/dir","/lib","/Library","/lost+found","/media","/mnt","/net","/Network","/opt","/opt/bin","/opt/include","/opt/lib","/opt/sbin","/opt/share","/private","/private/tmp","/private/var","/proc","/rescue","/root","/sbin","/selinux","/srv","/sys","/System","/tmp","/Users","/usr","/usr/X11R6","/usr/bin","/usr/include","/usr/lib","/usr/libdata","/usr/libexec","/usr/local/bin","/usr/local/src","/usr/obj","/usr/ports","/usr/sbin","/usr/share","/usr/src","/var","/var/log","/var/mail","/var/spool","/var/tmp","/var/yp"],ude={"application/epub+zip":{extensions:["epub"]},"application/gzip":{extensions:["gz"]},"application/java-archive":{extensions:["jar","war","ear"]},"application/json":{extensions:["json","map"]},"application/ld+json":{extensions:["jsonld"]},"application/msword":{extensions:["doc","dot"]},"application/octet-stream":{extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/ogg":{extensions:["ogx"]},"application/pdf":{extensions:["pdf"]},"application/rtf":{extensions:["rtf"]},"application/vnd.amazon.ebook":{extensions:["azw"]},"application/vnd.apple.installer+xml":{extensions:["mpkg"]},"application/vnd.mozilla.xul+xml":{extensions:["xul"]},"application/vnd.ms-excel":{extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-fontobject":{extensions:["eot"]},"application/vnd.ms-powerpoint":{extensions:["ppt","pps","pot"]},"application/vnd.oasis.opendocument.presentation":{extensions:["odp"]},"application/vnd.oasis.opendocument.spreadsheet":{extensions:["ods"]},"application/vnd.oasis.opendocument.text":{extensions:["odt"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{extensions:["docx"]},"application/vnd.rar":{extensions:["rar"]},"application/vnd.visio":{extensions:["vsd","vst","vss","vsw"]},"application/x-7z-compressed":{extensions:["7z"]},"application/x-abiword":{extensions:["abw"]},"application/x-bzip":{extensions:["bz"]},"application/x-bzip2":{extensions:["bz2","boz"]},"application/x-csh":{extensions:["csh"]},"application/x-freearc":{extensions:["arc"]},"application/x-httpd-php":{extensions:["php"]},"application/x-sh":{extensions:["sh"]},"application/x-tar":{extensions:["tar"]},"application/xhtml+xml":{extensions:["xhtml","xht"]},"application/xml":{extensions:["xml","xsl","xsd","rng"]},"application/zip":{extensions:["zip"]},"audio/3gpp":{extensions:["3gpp"]},"audio/3gpp2":{extensions:["3g2"]},"audio/aac":{extensions:["aac"]},"audio/midi":{extensions:["mid","midi","kar","rmi"]},"audio/mpeg":{extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/ogg":{extensions:["oga","ogg","spx","opus"]},"audio/opus":{extensions:["opus"]}
858,"audio/wav":{extensions:["wav"]},"audio/webm":{extensions:["weba"]},"font/otf":{extensions:["otf"]},"font/ttf":{extensions:["ttf"]},"font/woff":{extensions:["woff"]},"font/woff2":{extensions:["woff2"]},"image/avif":{extensions:["avif"]},"image/bmp":{extensions:["bmp"]},"image/gif":{extensions:["gif"]},"image/jpeg":{extensions:["jpeg","jpg","jpe"]},"image/png":{extensions:["png"]},"image/svg+xml":{extensions:["svg","svgz"]},"image/tiff":{extensions:["tif","tiff"]},"image/vnd.microsoft.icon":{extensions:["ico"]},"image/webp":{extensions:["webp"]},"text/calendar":{extensions:["ics","ifb"]},"text/css":{extensions:["css"]},"text/csv":{extensions:["csv"]},"text/html":{extensions:["html","htm","shtml"]},"text/javascript":{extensions:["js","mjs"]},"text/plain":{extensions:["txt","text","conf","def","list","log","in","ini"]},"video/3gpp":{extensions:["3gp","3gpp"]},"video/3gpp2":{extensions:["3g2"]},"video/mp2t":{extensions:["ts"]},"video/mp4":{extensions:["mp4","mp4v","mpg4"]},"video/mpeg":{extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/ogg":{extensions:["ogv"]},"video/webm":{extensions:["webm"]},"video/x-msvideo":{extensions:["avi"]}},dde={directory_path:cde,mime_type:ude},hde=dde,mde={color:Uue,database:Gue,date:Kue,hacker:Zue,internet:sde,location:ide,metadata:lde,system:hde},fde=mde,Tl=new Iue({locale:[vce,fde]});const YF=async(t,e)=>{try{console.log(`Checking if category "${t}" (${e}) exists...`);const{data:r,error:n}=await Q.from("post_categories").select("id").eq("slug",e).maybeSingle();if(n)throw console.error("Error checking if category exists:",n),n;if(r)return console.log(`Category "${t}" exists with ID: ${r.id}`),r.id;console.log(`Category "${t}" doesn't exist, creating it now...`);const{data:a,error:i}=await Q.from("post_categories").insert({name:t,slug:e}).select("id").single();if(i)throw console.error("Error creating post category:",i),i;return console.log(`Created new category "${t}" with ID: ${a.id}`),a.id}catch(r){return console.error("Error in ensurePostCategory:",r),"00000000-0000-0000-0000-000000000111"}},kI=async(t=!1)=>{var e,r;try{console.log("Starting to insert mock news data...");const{data:n}=await Q.auth.getSession();if(!!!(n!=null&&n.session))throw console.log("User is not authenticated. Cannot insert data without a user ID."),new Error("Authentication required: Please login before importing mock news data");console.log("User is authenticated as:",(e=n.session)==null?void 0:e.user.email);const i=(r=n.session)==null?void 0:r.user.id,{data:o,error:l}=await Q.from("profiles").select("id").eq("id",i).single();if(l||!o)throw console.error("User exists in auth but not in profiles table:",l),new Error("User profile not found. Please ensure your profile is set up correctly before importing data.");console.log(`Ensuring "What's New" category exists...`);const c=await YF("What's New","whats-new");console.log("Using post_categories table, category ID:",c),console.log("Creating mock news posts with author ID:",i);const u=Zae(i);console.log(`Created ${u.length} mock posts ready for insertion`),console.log("Inserting posts into database one by one to handle potential conflicts...");let d=0;const h=[];for(const f of u)try{const{data:m,error:g}=await Q.from("blog_posts").insert(f).select("id").single();if(g){console.error(`Error inserting post ${f.title}:`,g),h.push(`${f.title}: ${g.message}`);continue}m&&m.id&&(await YF("What's New","whats-new").then(y=>Q.from("post_category_mapping").insert({post_id:m.id,category_id:y})),d++,console.log(`Successfully inserted post: ${f.title}`))}catch(m){console.error(`Exception inserting post ${f.title}:`,m),h.push(`${f.title}: ${m instanceof Error?m.message:"Unknown error"}`)}return d===0&&h.length>0?{success:!1,message:`Failed to insert any news posts. Errors: ${h.join("; ")}`,count:0}:{success:d>0,count:d,message:d>0?`Successfully inserted ${d} mock news posts`:`Failed to insert news posts: ${h.join("; ")}`}}catch(n){console.error("Error in insertMockNewsData:",n);let a="Unknown error";if(n instanceof Error)a=n.message;else if(n&&typeof n=="object")if("code"in n&&"message"in n)a=`Database error ${n.code}: ${n.message}`;else try{a=JSON.stringify(n)}
858catch{a="Error object could not be converted to string"}else n!=null&&(a=String(n));return t?(console.log("Using fallback mode after error: returning mock data success"),{success:!1,count:0,message:`Error inserting mock news data: ${a}`}):{success:!1,count:0,message:`Error inserting mock news data: ${a}`}}},pde=async(t=!1)=>{console.log("Setting up mock news data in Supabase...");const e=await kI(t);return console.log("Setup complete:",e),e};window.setupMockNewsData=pde;const gde=async()=>{var r,n;const{data:t}=await Q.auth.getSession();if(!!!(t!=null&&t.session))throw console.log("User is not authenticated. Cannot insert job data without a user ID."),new Error("Authentication required: Please login before importing mock job data");return console.log("User is authenticated as:",(r=t.session)==null?void 0:r.user.email),(n=t.session)==null?void 0:n.user.id},xde=async t=>{const{data:e,error:r}=await Q.from("profiles").select("id").eq("id",t).single();if(r||!e)throw console.error("User exists in auth but not in profiles table:",r),new Error("User profile not found. Please ensure your profile is set up correctly before importing data.");return!0},$5=["full-time","part-time","contract","temporary","internship"],yde=[{id:"1",title:"Marketing Manager",company:"Riverside Marketing Solutions",location:"Downtown",description:"We're looking for an experienced Marketing Manager to lead our marketing team and develop comprehensive marketing strategies for our clients in various industries.",salary:"$75,000 - $95,000",jobType:"Full-time",postedAt:new Date(2025,3,1),featured:!0,imageUrl:"https://images.unsplash.com/photo-1551434678-e076c223a692?auto=format&fit=crop&w=300&h=200&q=80",categories:["Marketing","Management"]},{id:"2",title:"Software Developer",company:"Tech Innovations Inc.",location:"Tech District",description:"Join our dynamic development team creating next-generation software solutions. Experience with React, TypeScript, and Node.js required.",salary:"$85,000 - $110,000",jobType:"Full-time",postedAt:new Date(2025,3,2),featured:!0,imageUrl:"https://images.unsplash.com/photo-1498050108023-c5249f4df085?auto=format&fit=crop&w=300&h=200&q=80",categories:["IT","Engineering"]},{id:"3",title:"Administrative Assistant",company:"Global Enterprises",location:"Business Park",description:"Seeking a detail-oriented Administrative Assistant to support our executive team. Strong organizational skills and proficiency in Microsoft Office required.",salary:"$45,000 - $55,000",jobType:"Full-time",postedAt:new Date(2025,3,3),featured:!0,imageUrl:"https://images.unsplash.com/photo-1568992687947-868a62a9f521?auto=format&fit=crop&w=300&h=200&q=80",categories:["Administration"]},{id:"4",title:"Registered Nurse",company:"Community Health Center",location:"Medical District",description:"Registered Nurse needed for our growing healthcare facility. Must have current RN license and at least 2 years of clinical experience.",salary:"$70,000 - $85,000",jobType:"Full-time",postedAt:new Date(2025,3,4),featured:!1,imageUrl:"https://images.unsplash.com/photo-1584982751601-97dcc096659c?auto=format&fit=crop&w=300&h=200&q=80",categories:["Healthcare"]},{id:"5",title:"Restaurant Manager",company:"Fine Dining Restaurant",location:"Downtown",description:"Experienced Restaurant Manager needed to oversee daily operations, staff management, and ensure exceptional customer service.",salary:"$60,000 - $70,000",jobType:"Full-time",postedAt:new Date(2025,3,5),featured:!1,imageUrl:"https://images.unsplash.com/photo-1414235077428-338989a2e8c0?auto=format&fit=crop&w=300&h=200&q=80",categories:["Hospitality","Management"]},{id:"6",title:"Sales Representative",company:"Regional Sales Company",location:"Various",description:"Motivated Sales Representatives needed to drive business growth in assigned territories. Commission-based compensation with base salary.",salary:"$50,000 + Commission",jobType:"Full-time",postedAt:new Date(2025,3,6),featured:!1,imageUrl:"https://images.unsplash.com/photo-1573497620053-ea5300f94f21?auto=format&fit=crop&w=300&h=200&q=80",categories:["Sales"]},{id:"7",title:"Customer Support Specialist",company:"TechHelp Services",location:"Remote",description:"Remote Customer Support Specialist to assist customers with technical problems and inquiries via phone, email, and chat.",salary:"$48,000 - $55,000",jobType:"Remote",postedAt:new Date(2025,3,7),featured:!1,imageUrl:"https://images.unsplash.com/photo-1560264280-88b68371db39?auto=format&fit=crop&w=300&h=200&q=80",categories:["Customer Service","IT"]},{id:"8",title:"Financial Analyst",company:"Investment Firm",location:"Financial District",description:"Seeking a detail-oriented Financial Analyst to conduct financial modeling, forecasting, and market analysis for our investment team.",salary:"$80,000 - $95,000",jobType:"Full-time",postedAt:new Date(2025,3,8),featured:!1,imageUrl:"https://images.unsplash.com/photo-1560520653-9e0e4c89eb11?auto=format&fit=crop&w=300&h=200&q=80",categories:["Finance"]},{id:"9",title:"Human Resources Coordinator",company:"Corporate Services Inc.",location:"Business Park",description:"HR Coordinator to assist with recruitment, employee relations, and HR administrative tasks. Great opportunity for growth in HR field.",salary:"$52,000 - $60,000",jobType:"Full-time",postedAt:new Date(2025,3,9),featured:!1,imageUrl:"https://images.unsplash.com/photo-1529400971008-f566de0e6dfc?auto=format&fit=crop&w=300&h=200&q=80",categories:["Human Resources"]},{id:"10",title:"Web Designer",company:"Creative Digital Agency",location:"Design District",description:"Creative Web Designer with strong UI/UX skills to design visually appealing and user-friendly websites for our diverse client base.",salary:"$65,000 - $8
8580,000",jobType:"Full-time",postedAt:new Date(2025,3,10),featured:!1,imageUrl:"https://images.unsplash.com/photo-1522542550221-31fd19575a2d?auto=format&fit=crop&w=300&h=200&q=80",categories:["IT","Marketing"]},{id:"11",title:"Warehouse Associate",company:"Distribution Center",location:"Industrial Park",description:"Reliable Warehouse Associate for inventory management, order picking, and shipping preparation. Physical stamina required for this position.",salary:"$35,000 - $42,000",jobType:"Full-time",postedAt:new Date(2025,3,11),featured:!1,imageUrl:"https://images.unsplash.com/photo-1553413077-190dd305871c?auto=format&fit=crop&w=300&h=200&q=80",categories:["Manufacturing"]},{id:"12",title:"Elementary School Teacher",company:"Community School District",location:"North Side",description:"Licensed Elementary Teacher for 3rd grade. Strong classroom management skills and passion for child education required.",salary:"$52,000 - $65,000",jobType:"Full-time",postedAt:new Date(2025,3,12),featured:!1,imageUrl:"https://images.unsplash.com/photo-1503676260728-1c00da094a0b?auto=format&fit=crop&w=300&h=200&q=80",categories:["Education"]},{id:"13",title:"Legal Assistant",company:"Law Partners LLP",location:"Downtown",description:"Detail-oriented Legal Assistant to support attorneys with case preparation, document filing, and client communications.",salary:"$50,000 - $60,000",jobType:"Full-time",postedAt:new Date(2025,3,13),featured:!1,imageUrl:"https://images.unsplash.com/photo-1589994965851-a7f82d10864c?auto=format&fit=crop&w=300&h=200&q=80",categories:["Legal"]},{id:"14",title:"Retail Sales Associate",company:"Fashion Outlet",location:"Mall",description:"Energetic Sales Associate for busy fashion retail store. Customer service experience and flexible availability required.",salary:"$28,000 + Commission",jobType:"Part-time",postedAt:new Date(2025,3,14),featured:!1,imageUrl:"https://images.unsplash.com/photo-1567401893414-76b7b1e5a7a5?auto=format&fit=crop&w=300&h=200&q=80",categories:["Retail","Sales"]},{id:"15",title:"IT Support Technician",company:"Tech Solutions Provider",location:"Various",description:"IT Support Technician to provide on-site and remote technical assistance to clients. CompTIA A+ certification preferred.",salary:"$55,000 - $65,000",jobType:"Full-time",postedAt:new Date(2025,3,15),featured:!1,imageUrl:"https://images.unsplash.com/photo-1573496527892-904f897eb744?auto=format&fit=crop&w=300&h=200&q=80",categories:["IT"]},{id:"16",title:"Social Media Coordinator",company:"Digital Marketing Firm",location:"Creative District",description:"Creative Social Media Coordinator to develop and implement social media strategies for various clients across different industries.",salary:"$45,000 - $55,000",jobType:"Full-time",postedAt:new Date(2025,3,16),featured:!1,imageUrl:"https://images.unsplash.com/photo-1516251193007-45ef944ab0c6?auto=format&fit=crop&w=300&h=200&q=80",categories:["Marketing"]},{id:"17",title:"Part-time Bookkeeper",company:"Small Business Services",location:"Various",description:"Experienced Bookkeeper needed for part-time position working with multiple small business clients. QuickBooks experience required.",salary:"$25-30/hour",jobType:"Part-time",postedAt:new Date(2025,3,17),featured:!1,imageUrl:"https://images.unsplash.com/photo-1554224155-6726b3ff858f?auto=format&fit=crop&w=300&h=200&q=80",categories:["Finance","Administration"]}],_I=async(t=!0)=>{try{console.log("Starting to insert JOBS-ONLY mock data...");const e=await gde();await xde(e);const r=await bde(e);if(!r)throw new Error("Failed to create mock business for job listings");console.log(`Created mock business with ID: ${r}`);const n=vde(r),{data:a,error:i}=await Q.from("jobs").insert(n).select("id");if(i)throw console.error("Error inserting jobs:",i),new Error(`Failed to insert jobs: ${i.message}`);return console.log(`Successfully inserted ${a.length} jobs into the database`),{success:!0,count:a.length,message:`Successfully inserted ${a.length} mock job listings into the database.`}}catch(e){console.error("Error in insertMockJobData:",e);let r="Unknown error";return e instanceof Error?r=e.message:typeof e=="object"&&e!==null&&(r=JSON.stringify(e)),{success:!1,count:0,message:`Error inserting mock job data: ${r}`}}},bde=async t=>{try{const e={name:"Chamber Business Directory",description:"Mock business for job listings",phone:"555-123-4567",address:"123 Main St, Anytown, USA",categories:["Technology","Services"],owner_id:t,status:"approved",logo_url:null,featured:!0},{data:r,error:n}=await Q.from("businesses").insert(e).select("id").single();return n?(console.error("Error creating mock business:",n),null):r.id}catch(e){return console.error("Error in createMockBusiness:",e),null}},vde=t=>yde.map(e=>{const r=new Date,n=new Date;return n.setDate(r.getDate()+90),{id:Wn(),title:e.title,business_id:t,description:e.description,location:e.location,job_type:e.jobType,salary_range:e.salary||"Competitive",is_remote:e.location.toLowerCase().includes("remote"),expire_date:n.toISOString(),requirements:`Requirements for ${e.title} position at ${e.company}`,application_url:`https://apply.example.com/${Wn().substring(0,8)}`,contact_email:"[email protected]",status:"active",featured_image:e.imageUrl||null,created_at:e.postedAt.toISOString(),updated_at:r.toISOString(),categories:e.categories,featured:e.featured}}),wde=async(t=!0)=>{console.log("Setting up mock job data...");const e=await _I(t);return console.log("Setup complete:",e),e};window.setupMockJobData=wde;const jde=t=>[{title:"Local Business Strategies for Digital Marketing",excerpt:"Discover effective digital marketing techniques tailored for local businesses to enhance their online presence and reach more customers."},{title:"Networking Tips for Young Entrepreneurs",excerpt:"Learn essential networking techniques that can help young entrepreneurs build meaningful professional relationships in the business community."},{title:"How Small Businesses Can Leverage Social Media",excerpt:"Practical strategies for small business owners to maximize their social media impact without spending a fortune on marketing."},{title:"The Benefits of Chamber Membership",excerpt:"Explore the many ways that joining your local Chamber of Commerce can help your business grow and thrive in today's economy."},{title:"Business Leadership in Challenging Times",excerpt:"Insights and advice for business leaders navigating through economic uncertainty and rapidly changing market conditions."}].map((r,n)=>{const a=n*2+1,i=new Date;return i.setDate(i.getDate()-a),{id:Tl.string.uuid(),title:r.title,slug:Tl.helpers.slugify(r.title).toLowerCase(),content:Nde(r.title),excerpt:r.excerpt,featured_image:`https://images.unsplash.com/photo-${155e7+n*1e3}?auto=format&fit=crop&w=800&h=500&q=80`,author_id:t,status:"published",publish_date:i.toISOString()}});function Nde(t){return` 859 <h1>${t}</h1> 860 <p>${Tl.lorem.paragraph(5)}</p> 861 <h2>Key Strategies</h2> 862 <p>${Tl.lorem.paragraph(3)}</p> 863 <ul> 864 <li>${Tl.lorem.sentence()}</li> 865 <li>${Tl.lorem.sentence()}</li> 866 <li>${Tl.lorem.sentence()}</li> 867 </ul> 868 <p>${Tl.lorem.paragraph(2)}</p> 869 <h2>Implementation Tips</h2> 870 <p>${Tl.lorem.paragraph(4)}</p> 871 <blockquote>${Tl.lorem.sentence(10)}</blockquote> 872 <p>${Tl.lorem.paragraph(3)}</p> 873 <h2>Conclusion</h2> 874 <p>${Tl.lorem.paragraph(2)}</p> 875 `}const EI=async(t=!1)=>{var e,r;try{console.log("Starting to insert mock blog data...");const{data:n}=await Q.auth.getSession();if(!!!(n!=null&&n.session))throw console.log("User is not authenticated. Cannot insert data without a user ID."),new Error("Authentication required: Please login before importing mock blog data");console.log("User is authenticated as:",(e=n.session)==null?void 0:e.user.email);const i=(r=n.session)==null?void 0:r.user.id,{data:o,error:l}=await Q.from("profiles").select("id").eq("id",i).single();if(l||!o)throw console.error("User exists in auth but not in profiles table:",l),new Error("User profile not found. Please ensure your profile is set up correctly before importing data.");console.log('Ensuring "Blog" category exists...');const c=await YF("Blog","blog");console.log("Using post_categories table, category ID:",c),console.log("Creating mock blog posts with author ID:",i);const u=jde(i);console.log(`Created ${u.length} mock blog posts ready for insertion`),console.log("Inserting posts into database one by one to handle potential conflicts...");let d=0;const h=[];for(const f of u)try{const{data:m,error:g}=await Q.from("blog_posts").insert(f).select("id").single();if(g){console.error(`Error inserting blog post ${f.title}:`,g),h.push(`${f.title}: ${g.message}`);continue}
875m&&m.id&&(await Q.from("post_category_mapping").insert({post_id:m.id,category_id:c}),d++,console.log(`Successfully inserted blog post: ${f.title}`))}catch(m){console.error(`Exception inserting blog post ${f.title}:`,m),h.push(`${f.title}: ${m instanceof Error?m.message:"Unknown error"}`)}return d===0&&h.length>0?{success:!1,message:`Failed to insert any blog posts. Errors: ${h.join("; ")}`,count:0}:{success:d>0,count:d,message:d>0?`Successfully inserted ${d} mock blog posts`:`Failed to insert blog posts: ${h.join("; ")}`}}catch(n){console.error("Error in insertMockBlogData:",n);let a="Unknown error";if(n instanceof Error)a=n.message;else if(n&&typeof n=="object")if("code"in n&&"message"in n)a=`Database error ${n.code}: ${n.message}`;else try{a=JSON.stringify(n)}catch{a="Error object could not be converted to string"}else n!=null&&(a=String(n));return t?(console.log("Using fallback mode after error: returning mock data success"),{success:!1,count:0,message:`Error inserting mock blog data: ${a}`}):{success:!1,count:0,message:`Error inserting mock blog data: ${a}`}}},Fde=async(t=!1)=>{console.log("Setting up mock blog data in Supabase...");const e=await EI(t);return console.log("Setup complete:",e),e};window.setupMockBlogData=Fde;const Sde=async()=>{try{console.log("Starting to import mock businesses...");const t=await cI();if(!t.success)return console.log("Business import failed:",t.message),{success:t.success,message:t.message,count:0};console.log("Businesses imported successfully:",t.count,"businesses"),console.log("Now importing events...");const e=await rre();console.log("Now importing news data...");const r=await kI(!0);console.log("Now importing job data...");const n=await _I(!0);console.log("Now importing blog data...");const a=await EI(!0),i=[],o=[];let l=t.count||0;l+=e.count||0,e.success?i.push(`${e.count} events imported`):o.push(`Event import: ${e.message}`),l+=r.count||0,r.success?i.push(`${r.count} news items imported`):o.push(`News import: ${r.message}`),l+=n.count||0,n.success?i.push(`${n.count} jobs imported`):o.push(`Job import: ${n.message}`),l+=a.count||0,a.success?i.push(`${a.count} blog posts imported`):o.push(`Blog import: ${a.message}`);let c="";return i.length>0&&(c+=i.join("; ")),o.length>0&&(c+=c?"; ":"",c+=o.join("; ")),console.log("Mock data import complete. Total items imported:",l),console.log("Import details:",c),{success:l>0,message:c||"No data was imported",count:l}}catch(t){return console.error("Error in insertMockData:",t),{success:!1,message:`Unexpected error: ${t instanceof Error?t.message:"Unknown error"}`,count:0}}},Zf={getMockBusinesses:()=>l0,listBusinesses:Ly,getBusinessById:Jf,createBusiness:Jae,updateBusiness:lI,populateWithMockData:cI,insertMockData:Sde},Cde=t=>{const e=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],r={monday:{open:"closed",close:"closed"},tuesday:{open:"closed",close:"closed"},wednesday:{open:"closed",close:"closed"},thursday:{open:"closed",close:"closed"},friday:{open:"closed",close:"closed"},saturday:{open:"closed",close:"closed"},sunday:{open:"closed",close:"closed"}};return t.forEach(n=>{const a=e[n.open.day];if(a){let i,o;if(typeof n.open.hour=="number"&&typeof n.open.minute=="number")i=`${n.open.hour.toString().padStart(2,"0")}:${n.open.minute.toString().padStart(2,"0")}`;else if(n.open.time)n.open.time.includes(":")?i=n.open.time:i=n.open.time.substring(0,2)+":"+n.open.time.substring(2);else return;n.close?typeof n.close.hour=="number"&&typeof n.close.minute=="number"?o=`${n.close.hour.toString().padStart(2,"0")}:${n.close.minute.toString().padStart(2,"0")}`:n.close.time?n.close.time.includes(":")?o=n.close.time:o=n.close.time.substring(0,2)+":"+n.close.time.substring(2):o="17:00":o="17:00",r[a]={open:i,close:o}}}),r},kde=({onSuccess:t,userId:e,businessData:r,isEditing:n=!1})=>{var G,B,$,W,oe,K,H,X,me;const{toast:a}=St(),[i,o]=x.useState(null),[l,c]=x.useState(""),[u,d]=x.useState([]),[h,f]=x.useState([]),[m,g]=x.useState(!1),[y,b]=x.useState(!1),[w,j]=x.useState(!1),[N,S]=x.useState(null),[E,C]=x.useState(""),[T,D]=x.useState(!1),A={monday:{open:"09:00",close:"17:00"},tuesday:{open:"09:00",close:"17:00"},wednesday:{open:"09:00",close:"17:00"},thursday:{open:"09:00",close:"17:00"},friday:{open:"09:00",close:"17:00"},saturday:{open:"10:00",close:"15:00"},sunday:{open:"closed",close:"closed"}},R=n&&r?{name:r.name||"",short_description:r.short_description||((G=r.description)==null?void 0:G.substring(0,150))||"",business_description:r.business_description||r.description||"",logo_url:r.logo_url||"",cover_image_url:r.cover_image_url||"",phone:r.phone||"",email:r.email||"",website:r.website||"",business_type:r.business_type||"physical_location",address:((B=r.location)==null?void 0:B.address)||"",city:(($=r.location)==null?void 0:$.city)||"Valley Stream",state:((W=r.location)==null?void 0:W.state)||"NY",zipCode:((oe=r.location)==null?void 0:oe.zipCode)||"",latitude:((K=r.location)==null?void 0:K.latitude)||void 0,longitude:((H=r.location)==null?void 0:H.longitude)||void 0,service_area_description:((X=r.service_area)==null?void 0:X.description)||"",service_radius_miles:((me=r.service_area)==null?void 0:me.radiusMiles)||void 0,categories:r.categories||[],gallery_urls:r.gallery_urls||[],facebook_url:r.facebook_url||"",instagram_url:r.instagram_url||"",twitter_url:r.twitter_url||"",business_hours_json:r.business_hours_json||A,tags:r.tags||[]}:{name:"",short_description:"",business_description:"",logo_url:"",cover_image_url:"",phone:"",email:"",website:"",business_type:"physical_location",address:"",city:"Valley Stream",state:"NY",zipCode:"",latitude:void 0,longitude:void 0,service_area_description:"",service_radius_miles:void 0,categories:[],gallery_urls:[],facebook_url:"",instagram_url:"",twitter_url:"",business_hours_json:A,tags:[]},M=K0({defaultValues:R});x.useEffect(()=>{n&&r&&(r.logo_url&&c(r.logo_url),r.cover_image_url&&C(r.cover_image_url))},[n,r]);const P=ie=>{var he,ve,Ce,re,we,Ee,Me,ae;if(!((he=ie.name)!=null&&he.trim()))return a({title:"Missing field",description:"Business name is required",variant:"destructive"}),!1;if(!((ve=ie.phone)!=null&&ve.trim()))return a({title:"Missing field",description:"Phone number is required",variant:"destructive"}),!1;if(!((Ce=ie.email)!=null&&Ce.trim()))return a({title:"Missing field",description:"Email is required",variant:"destructive"}),!1;if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(ie.email))return a({title:"Invalid email",description:"Please enter a valid email address",variant:"destructive"}),!1;if(ie.business_type==="physical_location"){if(!((re=ie.address)!=null&&re.trim())||!((we=ie.city)!=null&&we.trim())||!((Ee=ie.state)!=null&&Ee.trim())||!((Me=ie.zipCode)!=null&&Me.trim()))return a({title:"Missing location fields",description:"Address, city, state, and zip code are required for physical locations",variant:"destructive"}),!1}else if(ie.business_type==="service_area"&&!((ae=ie.service_area_description)!=null&&ae.trim()))return a({title:"Missing service area",description:"Service area description is required",variant:"destructive"}),!1;return ie.categories.length===0?(a({title:"Categories required",description:"Please select at least one business category",variant:"destructive"}),!1):!0};x.useEffect(()=>{const ie=M.watch((ee,{name:he})=>
875{if(he==="website"&&ee.website){const ve=ee.website;ve&&!ve.startsWith("http")&&M.setValue("website",`https://${ve}`)}if(he==="facebook_url"&&ee.facebook_url){const ve=ee.facebook_url;ve&&!ve.startsWith("http")&&M.setValue("facebook_url",`https://${ve}`)}if(he==="instagram_url"&&ee.instagram_url){const ve=ee.instagram_url;ve&&!ve.startsWith("http")&&M.setValue("instagram_url",`https://${ve}`)}if(he==="twitter_url"&&ee.twitter_url){const ve=ee.twitter_url;ve&&!ve.startsWith("http")&&M.setValue("twitter_url",`https://${ve}`)}});return()=>ie.unsubscribe()},[M]);const U=ie=>{var he,ve,Ce,re;if(M.setValue("address",ie.address||""),M.setValue("city",ie.city||""),M.setValue("state",ie.state||""),M.setValue("zipCode",ie.zipCode||""),M.setValue("latitude",ie.latitude),M.setValue("longitude",ie.longitude),M.setValue("name",ie.businessName||""),M.setValue("phone",ie.phoneNumber||""),M.setValue("email",ie.businessEmail||""),M.setValue("website",ie.website||""),M.setValue("facebook_url",ie.facebookUrl||""),M.setValue("instagram_url",ie.instagramUrl||""),M.setValue("twitter_url",ie.twitterUrl||""),M.setValue("business_description",ie.editorialSummary||""),M.setValue("short_description",ie.editorialSummary?ie.editorialSummary.slice(0,150):""),M.setValue("logo_url",ie.logo||""),ie.logo?(c(ie.logo),o(null)):(c(""),o(null)),ie.photos&&ie.photos.length>0?(M.setValue("gallery_urls",ie.photos),M.setValue("cover_image_url",ie.photos[0]),C(ie.photos[0]),S(null),h.forEach(we=>{we.startsWith("blob:")&&URL.revokeObjectURL(we)}),d([]),f([])):(M.setValue("gallery_urls",[]),M.setValue("cover_image_url",""),C(""),S(null)),(he=ie.openingHours)!=null&&he.periods&&ie.openingHours.periods.length>0){const we=Cde(ie.openingHours.periods);M.setValue("business_hours_json",we||A)}else M.setValue("business_hours_json",A);const ee=[];ie.businessName&&ee.push("Business Name"),ie.phoneNumber&&ee.push("Phone"),ie.businessEmail&&ee.push("Business Email"),ie.website&&ee.push("Website"),(ie.facebookUrl||ie.instagramUrl||ie.twitterUrl)&&ee.push("Social Media"),ie.editorialSummary&&ee.push("Description"),(ve=ie.photos)!=null&&ve.length&&ee.push("Photos"),(re=(Ce=ie.openingHours)==null?void 0:Ce.periods)!=null&&re.length&&ee.push("Business Hours"),ee.length>0&&a({title:"Business details auto-populated",description:`Found and filled: ${ee.join(", ")}. Review and adjust as needed.`})},I=(ie,ee)=>{const he=M.getValues("categories");if(he.find(Ce=>Ce.id===ie)){const Ce=he.filter(re=>re.id!==ie);M.setValue("categories",Ce)}else{const Ce=he.length===0,re={id:ie,name:ee,isPrimary:Ce};he.length<2?M.setValue("categories",[...he,re]):a({title:"Category limit reached",description:"You can only select up to 2 categories",variant:"destructive"})}},O=ie=>{const he=M.getValues("categories").filter(ve=>ve.id!==ie);he.length===1&&!he[0].isPrimary&&(he[0].isPrimary=!0),M.setValue("categories",he)},V=async ie=>{var ee;if(!m&&P(ie))try{g(!0);let he=ie.logo_url;if(i){b(!0);try{const Me=`${e}/${Date.now()}_${i.name.replace(/[^a-zA-Z0-9.]/g,"_")}`,{data:ae,error:ze}=await Q.storage.from("business-logos").upload(Me,i);if(ze)throw ze;const{data:{publicUrl:mt}}=Q.storage.from("business-logos").getPublicUrl(Me);he=mt}catch(Me){console.error("Failed to upload logo:",Me),a({title:"Logo upload failed",description:"Could not upload your logo. Using URL if provided instead.",variant:"destructive"})}finally{b(!1)}}let ve=ie.cover_image_url;if(N){D(!0);try{const Me=`business_covers/${e}/${Date.now()}_${N.name.replace(/[^a-zA-Z0-9.]/g,"_")}`,{data:ae,error:ze}=await Q.storage.from("business_assets").upload(Me,N);if(ze)throw ze;const{data:{publicUrl:mt}}=Q.storage.from("business_assets").getPublicUrl(Me);ve=mt}catch(Me){console.error("Failed to upload cover image:",Me),a({title:"Cover image upload failed",description:"Could not upload your cover image. Using URL if provided instead.",variant:"destructive"})}finally{D(!1)}}let Ce=[...ie.gallery_urls||[]];if(u.length>0){j(!0);try{const Me=u.map(async ze=>{const mt=`business_gallery/${e}/${Date.now()}_${ze.name.replace(/[^a-zA-Z0-9.]/g,"_")}`,{data:tt,error:Xe}=await Q.storage.from("business_assets").upload(mt,ze);if(Xe)throw Xe;const{data:{publicUrl:Ft}}=Q.storage.from("business_assets").getPublicUrl(mt);return Ft}),ae=await Promise.all(Me);Ce=[...Ce,...ae]}catch(Me){console.error("Failed to upload some gallery images:",Me),a({title:"Gallery upload issue",description:"Some images could not be uploaded. You can try again later.",variant:"destructive"})}finally{j(!1)}}let re=e;if(!re){const{data:Me}=await Q.auth.getSession();if(!Me.session){a({title:"Authentication required",description:"You must be logged in to create a business.",variant:"destructive"}),g(!1);return}re=Me.session.user.id}const we={ownerId:re,name:ie.name,short_description:ie.short_description,business_description:ie.business_description,logo_url:he,cover_image_url:ve,phone:ie.phone,email:ie.email,website:ie.website,facebook_url:ie.facebook_url,instagram_url:ie.instagram_url,twitter_url:ie.twitter_url,business_type:ie.business_type,categories:ie.categories.map(Me=>({id:Me.id,name:Me.name,isPrimary:Me.isPrimary})),location:ie.business_type==="physical_location"?{id:n&&((ee=r==null?void 0:r.location)!=null&&ee.id)?r.location.id:Math.random().toString(36).substring(2,11),address:ie.address,city:ie.city,state:ie.state,zipCode:ie.zipCode,latitude:ie.latitude,longitude:ie.longitude}:void 0,service_area:ie.business_type==="service_area"?{description:ie.service_area_description||"",radiu
875sMiles:ie.service_radius_miles}:void 0,gallery_urls:Ce,business_hours_json:ie.business_hours_json,tags:ie.tags||[]};let Ee;n&&r?(await Zf.updateBusiness(r.id,we),a({title:"Business updated",description:"Your business has been updated successfully."})):(Ee=await Zf.createBusiness(we),a({title:"Business created",description:"Your business has been created successfully and is pending approval."})),n||(M.reset(),o(null),c(""),S(null),C(""),d([]),f([])),t&&t(Ee)}catch(he){console.error(`Failed to ${n?"update":"create"} business:`,he),a({title:"Error",description:`Failed to ${n?"update":"create"} business. Please try again.`,variant:"destructive"})}finally{g(!1)}};return x.useEffect(()=>()=>{l&&l.startsWith("blob:")&&URL.revokeObjectURL(l),E&&E.startsWith("blob:")&&URL.revokeObjectURL(E),h.forEach(ie=>{ie.startsWith("blob:")&&URL.revokeObjectURL(ie)})},[l,E,h]),{form:M,logoFile:i,setLogoFile:o,logoPreview:l,setLogoPreview:c,coverImageFile:N,setCoverImageFile:S,coverImagePreview:E,setCoverImagePreview:C,galleryFiles:u,setGalleryFiles:d,galleryPreviews:h,setGalleryPreviews:f,onSubmit:V,isSubmitting:m,uploadingLogo:y,uploadingCoverImage:T,uploadingGallery:w,handleCategorySelect:I,removeCategory:O,handlePlaceSelect:U}},_de=({form:t,logoFile:e,setLogoFile:r,logoPreview:n,setLogoPreview:a,uploadingLogo:i=!1,coverImageFile:o,setCoverImageFile:l,coverImagePreview:c,setCoverImagePreview:u,uploadingCoverImage:d=!1,galleryPreviews:h=[],handlePlaceSelect:f})=>{St();const[m,g]=Oe.useState(!1),[y,b]=Oe.useState(!1),[w,j]=Oe.useState(!1),[N,S]=Oe.useState(!1),[E,C]=Oe.useState(""),[T,D]=Oe.useState(""),A=G=>{t.setValue("logo_url",G),a(G),e&&r(null)},R=G=>{r(G);const B=URL.createObjectURL(G);a(B),t.setValue("logo_url","")},M=G=>{t.setValue("cover_image_url",G),u(G),o&&l(null)},P=G=>{l(G);const B=URL.createObjectURL(G);u(B),t.setValue("cover_image_url","")},U=()=>{r(null),a(""),t.setValue("logo_url","")},I=()=>{l(null),u(""),t.setValue("cover_image_url","")},O=(G,B)=>{const $=new File([G],"cover-image.jpg",{type:"image/jpeg"});l($),u(B),j(!1),E&&(URL.revokeObjectURL(E),C(""))},V=(G,B)=>{const $=new File([G],"logo.jpg",{type:"image/jpeg"});r($),a(B),S(!1),T&&(URL.revokeObjectURL(T),D(""))};return s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-lg font-medium",children:"Basic Information"}),s.jsx(aa,{control:t.control,name:"name",render:({field:G})=>s.jsxs(Vn,{children:[s.jsx(Bn,{children:"Business Name"}),s.jsx(Qa,{children:s.jsx(Mw,{placeholder:"Start typing your business name or type manually...",value:G.value||"",onChange:B=>G.onChange(B),onPlaceSelect:B=>{f&&f(B)},id:"name",name:"name",searchType:"business",required:!0})}),s.jsx(zh,{children:"Search and select your business to auto-populate details."}),s.jsx(Ln,{})]})}),s.jsx(aa,{control:t.control,name:"short_description",render:({field:G})=>{var B;return s.jsxs(Vn,{children:[s.jsx(Bn,{children:"Short Description"}),s.jsx(Qa,{children:s.jsx(zt,{placeholder:"Brief description of your business (max 150 characters)...",className:"min-h-[80px]",maxLength:150,...G})}),s.jsxs(zh,{children:[((B=G.value)==null?void 0:B.length)||0,"/150 characters"]}),s.jsx(Ln,{})]})}}),s.jsx(aa,{control:t.control,name:"business_description",render:({field:G})=>s.jsxs(Vn,{children:[s.jsx(Bn,{children:"Business Description"}),s.jsx(Qa,{children:s.jsx(zt,{placeholder:"Detailed description of your business, products, services, and mission...",className:"min-h-[120px]",...G})}),s.jsx(Ln,{})]})}),s.jsx(aa,{control:t.control,name:"cover_image_url",render:({field:G})=>s.jsxs(Vn,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Bn,{children:"Cover Image"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"(only .jpg or .png)"})]}),c||G.value?s.jsxs("div",{className:"relative w-full h-32 border rounded-lg overflow-hidden",children:[s.jsx("img",{src:c||G.value,alt:"Cover image preview",className:"w-full h-full object-cover",onError:B=>{B.target.src="https://placehold.co/600x400?text=Image+Error"}}),s.jsxs("div",{className:"absolute top-2 right-2 flex gap-1",children:[s.jsx(Y,{type:"button",size:"sm",variant:"secondary",onClick:()=>{C(c||G.value),j(!0)},className:"flex items-center gap-1 bg-white/90 hover:bg-white",children:s.jsx(Jg,{className:"h-3 w-3"})}),s.jsx(Y,{type:"button",size:"sm",variant:"secondary",onClick:()=>b(!0),className:"flex items-center gap-1 bg-white/90 hover:bg-white",children:s.jsx(bu,{className:"h-3 w-3"})}),s.jsx(Y,{type:"button",size:"sm",variant:"destructive",onClick:I,className:"flex items-center gap-1 bg-red-500/90 hover:bg-red-500",children:s.jsx(vr,{className:"h-3 w-3"})})]}),(c||G.value).includes("placehold.co")&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/30",children:s.jsx("div",{className:"bg-yellow-500 text-white p-2 rounded",children:s.jsx("p",{className:"text-sm",children:"Image could not be loaded"})})})]}):s.jsxs("div",{className:"flex flex-col items-center justify-center border-2 border-dashed border-gray-300 rounded-lg p-8",children:[s.jsx(vi,{className:"h-12 w-12 text-gray-400 mb-4"}),s.jsx("p",{className:"text-sm text-gray-500 mb-4",children:"No cover image selected"}),s.jsxs(Y,{type:"button",variant:"outline",onClick:()=>b(!0),className:"flex items-center gap-2",children:[s.jsx(vn,{className:"h-4 w-4"}),"Add Cover Image"]})]}),(()=>{const B=t.getValues("gallery_urls")||[],$=h||[],W=[...B,...$];return W.length>0&&s.jsxs("div",{className:"mt-4 space-y-2",children:[s.jsx(zh,{className:"text-sm font-medium",children:"Qu
875ick select from gallery:"}),s.jsx("div",{className:"grid grid-cols-4 gap-2",children:W.slice(0,8).map((oe,K)=>s.jsxs("button",{type:"button",className:`relative rounded-md overflow-hidden border-2 transition-all hover:border-primary/50 ${G.value===oe?"border-primary ring-2 ring-primary/20":"border-gray-300"}`,onClick:()=>{G.onChange(oe),M(oe)},children:[s.jsx("div",{className:"w-full h-16",children:s.jsx("img",{src:oe,alt:`Gallery suggestion ${K+1}`,className:"w-full h-full object-cover",onError:H=>{H.target.src="https://placehold.co/300x200?text=Image+Error"}})}),G.value===oe&&s.jsx("div",{className:"absolute inset-0 bg-primary/20 flex items-center justify-center",children:s.jsx("div",{className:"bg-primary text-white rounded-full p-1",children:s.jsx("svg",{className:"w-3 h-3",fill:"currentColor",viewBox:"0 0 20 20",children:s.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})})})]},`gallery-suggestion-${K}`))}),W.length>8&&s.jsx(zh,{className:"text-xs text-muted-foreground",children:"Showing first 8 gallery images. Add more to gallery to see more suggestions."})]})})(),s.jsx(Ln,{})]})}),s.jsx(aa,{control:t.control,name:"logo_url",render:({field:G})=>s.jsxs(Vn,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Bn,{children:"Business Logo"}),s.jsx("span",{className:"text-xs text-muted-foreground",children:"(only .jpg or .png)"})]}),n||G.value?s.jsx("div",{className:"flex justify-center",children:s.jsxs("div",{className:"relative w-40 h-40 border rounded-lg overflow-hidden",children:[s.jsx("img",{src:n||G.value,alt:"Logo preview",className:"w-full h-full object-cover",onError:B=>{B.target.src="https://placehold.co/400x400?text=Image+Error"}}),s.jsxs("div",{className:"absolute top-1 right-1 flex gap-1",children:[s.jsx(Y,{type:"button",size:"sm",variant:"secondary",onClick:()=>{D(n||G.value),S(!0)},className:"flex items-center gap-1 bg-white/90 hover:bg-white text-xs px-1 py-1",children:s.jsx(Jg,{className:"h-2 w-2"})}),s.jsx(Y,{type:"button",size:"sm",variant:"secondary",onClick:()=>g(!0),className:"flex items-center gap-1 bg-white/90 hover:bg-white text-xs px-1 py-1",children:s.jsx(bu,{className:"h-2 w-2"})}),s.jsx(Y,{type:"button",size:"sm",variant:"destructive",onClick:U,className:"flex items-center gap-1 bg-red-500/90 hover:bg-red-500 text-xs px-1 py-1",children:s.jsx(vr,{className:"h-2 w-2"})})]}),(n||G.value).includes("placehold.co")&&s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/30",children:s.jsx("div",{className:"bg-yellow-500 text-white p-1 rounded text-xs",children:"Error"})})]})}):s.jsxs("div",{className:"flex flex-col items-center justify-center border-2 border-dashed border-gray-300 rounded-lg p-6",children:[s.jsx(vi,{className:"h-8 w-8 text-gray-400 mb-2"}),s.jsx("p",{className:"text-sm text-gray-500 mb-3",children:"No logo selected"}),s.jsxs(Y,{type:"button",variant:"outline",onClick:()=>g(!0),className:"flex items-center gap-2",children:[s.jsx(vn,{className:"h-4 w-4"}),"Add Logo"]})]}),s.jsx(Ln,{})]})}),s.jsx(ex,{open:m,onOpenChange:g,title:"Edit Business Logo",currentUrl:t.getValues("logo_url"),currentFile:e,currentPreview:n,onUrlSubmit:A,onFileSubmit:R,uploading:i,aspectRatio:"square",onCropComplete:V}),s.jsx(ex,{open:y,onOpenChange:b,title:"Edit Cover Image",currentUrl:t.getValues("cover_image_url"),currentFile:o,currentPreview:c,onUrlSubmit:M,onFileSubmit:P,uploading:d,aspectRatio:"wide",onCropComplete:O}),s.jsx(i0,{isOpen:w,onClose:()=>{j(!1),E&&(URL.revokeObjectURL(E),C(""))},imageSrc:E,onCropComplete:O,aspectRatio:3,title:"Crop Cover Image"}),s.jsx(i0,{isOpen:N,onClose:()=>{S(!1),T&&(URL.revokeObjectURL(T),D(""))},imageSrc:T,onCropComplete:V,aspectRatio:1,title:"Crop Logo"})]})},Ede=({form:t})=>{const e=r=>{const n=Ire(r.target.value);t.setValue("website",n)};return s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-lg font-medium",children:"Contact Information"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsx(aa,{control:t.control,name:"phone",render:({field:{value:r,onChange:n,...a}})=>s.jsxs(Vn,{children:[s.jsx(Bn,{children:"Phone Number"}),s.jsx(Qa,{children:s.jsxs("div",{className:"flex items-center",children:[s.jsx(wi,{className:"mr-2 h-4 w-4 text-muted-foreground"}),s.jsx(Ne,{placeholder:"(555) 123-4567",value:r,onChange:i=>{const o=Ore(i);t.setValue("phone",o)},...a})]})}),s.jsx(Ln,{})]})}),s.jsx(aa,{control:t.control,name:"email",render:({field:r})=>s.jsxs(Vn,{children:[s.jsx(Bn,{children:"Email Address"}),s.jsx(Qa,{children:s.jsxs("div",{className:"flex items-center",children:[s.jsx(fs,{className:"mr-2 h-4 w-4 text-muted-foreground"}),s.jsx(Ne,{placeholder:"[email protected]",...r})]})}),s.jsx(Ln,{})]})})]}),s.jsx(aa,{control:t.control,name:"website",render:({field:{value:r,onChange:n,...a}})=>
875s.jsxs(Vn,{children:[s.jsx(Bn,{children:"Website (optional)"}),s.jsx(Qa,{children:s.jsxs("div",{className:"flex items-center",children:[s.jsx(Bc,{className:"mr-2 h-4 w-4 text-muted-foreground"}),s.jsx(Ne,{placeholder:"https://www.yourbusiness.com",value:r,onChange:e,...a})]})}),s.jsx(Ln,{})]})})]})},Ade=[{value:"AL",label:"Alabama"},{value:"AK",label:"Alaska"},{value:"AZ",label:"Arizona"},{value:"AR",label:"Arkansas"},{value:"CA",label:"California"},{value:"CO",label:"Colorado"},{value:"CT",label:"Connecticut"},{value:"DE",label:"Delaware"},{value:"FL",label:"Florida"},{value:"GA",label:"Georgia"},{value:"HI",label:"Hawaii"},{value:"ID",label:"Idaho"},{value:"IL",label:"Illinois"},{value:"IN",label:"Indiana"},{value:"IA",label:"Iowa"},{value:"KS",label:"Kansas"},{value:"KY",label:"Kentucky"},{value:"LA",label:"Louisiana"},{value:"ME",label:"Maine"},{value:"MD",label:"Maryland"},{value:"MA",label:"Massachusetts"},{value:"MI",label:"Michigan"},{value:"MN",label:"Minnesota"},{value:"MS",label:"Mississippi"},{value:"MO",label:"Missouri"},{value:"MT",label:"Montana"},{value:"NE",label:"Nebraska"},{value:"NV",label:"Nevada"},{value:"NH",label:"New Hampshire"},{value:"NJ",label:"New Jersey"},{value:"NM",label:"New Mexico"},{value:"NY",label:"New York"},{value:"NC",label:"North Carolina"},{value:"ND",label:"North Dakota"},{value:"OH",label:"Ohio"},{value:"OK",label:"Oklahoma"},{value:"OR",label:"Oregon"},{value:"PA",label:"Pennsylvania"},{value:"RI",label:"Rhode Island"},{value:"SC",label:"South Carolina"},{value:"SD",label:"South Dakota"},{value:"TN",label:"Tennessee"},{value:"TX",label:"Texas"},{value:"UT",label:"Utah"},{value:"VT",label:"Vermont"},{value:"VA",label:"Virginia"},{value:"WA",label:"Washington"},{value:"WV",label:"West Virginia"},{value:"WI",label:"Wisconsin"},{value:"WY",label:"Wyoming"}],Dde=({form:t,handlePlaceSelect:e})=>{const r=t.watch("business_type");return s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-lg font-medium",children:"Business Location"}),s.jsx(aa,{control:t.control,name:"business_type",render:({field:n})=>s.jsxs(Vn,{className:"space-y-3",children:[s.jsx(Bn,{children:"What type of business location do you have?"}),s.jsx(Qa,{children:s.jsxs(lk,{onValueChange:n.onChange,defaultValue:n.value,className:"flex flex-col space-y-2",children:[s.jsxs("div",{className:"flex items-center space-x-2 p-3 border rounded-lg",children:[s.jsx(o0,{value:"physical_location",id:"physical_location"}),s.jsxs(Z,{htmlFor:"physical_location",className:"flex items-center cursor-pointer",children:[s.jsx(ka,{className:"mr-2 h-4 w-4"}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium",children:"Physical Business Location"}),s.jsx("div",{className:"text-sm text-gray-500",children:"Customers visit your business at a specific address"})]})]})]}),s.jsxs("div",{className:"flex items-center space-x-2 p-3 border rounded-lg",children:[s.jsx(o0,{value:"service_area",id:"service_area"}),s.jsxs(Z,{htmlFor:"service_area",className:"flex items-center cursor-pointer",children:[s.jsx(r6,{className:"mr-2 h-4 w-4"}),s.jsxs("div",{children:[s.jsx("div",{className:"font-medium",children:"Service Area Business"}),s.jsx("div",{className:"text-sm text-gray-500",children:"You provide services to customers in their locations"})]})]})]})]})}),s.jsx(Ln,{})]})}),r==="physical_location"&&s.jsxs(s.Fragment,{children:[s.jsx(Mw,{label:"Business Address",placeholder:"Start typing your business address...",required:!0,value:t.watch("address"),onPlaceSelect:n=>{e&&e(n)},onChange:n=>{t.setValue("address",n)},id:"address",name:"address",searchType:"address"}),s.jsx("div",{className:"text-xs text-gray-500 mt-2",children:"Can't find your address? You can also fill in the fields manually below."}),s.jsx(aa,{control:t.control,name:"address",render:({field:n})=>s.jsxs(Vn,{children:[s.jsx(Bn,{children:"Street Address"}),s.jsx(Qa,{children:s.jsx(Ne,{placeholder:"123 Main Street",...n})}),s.jsx(Ln,{})]})}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[s.jsx(aa,{control:t.control,name:"city",render:({field:n})=>s.jsxs(Vn,{children:[s.jsx(Bn,{children:"City"}),s.jsx(Qa,{children:s.jsx(Ne,{placeholder:"City",...n})}),s.jsx(Ln,{})]})}),s.jsx(aa,{control:t.control,name:"state",render:({field:n})=>s.jsxs(Vn,{children:[s.jsx(Bn,{children:"State"}),s.jsxs(Wt,{defaultValue:n.value,onValueChange:n.onChange,children:[s.jsx(Qa,{children:s.jsx(Ht,{children:s.jsx(qt,{placeholder:"Select a state"})})}),s.jsx($t,{className:"max-h-[300px]",children:Ade.map(a=>s.jsx(Ae,{value:a.value,children:a.label},a.value))})]}),s.jsx(Ln,{})]})}),s.jsx(aa,{control:t.control,name:"zipCode",render:({field:{value:n,onChange:a,...i}})=>s.jsxs(Vn,{children:[s.jsx(Bn,{children:"Zip Code"}),s.jsx(Qa,{children:s.jsx(Ne,{placeholder:"12345",value:n,onChange:o=>{const l=zre(o.target.value);t.setValue("zipCode",l)},maxLength:5,...i})}),s.jsx(Ln,{})]})})]})]}),r==="service_area"&&s.jsxs(s.Fragment,{children:[s.jsx(aa,{control:t.control,name:"service_area_description",render:({field:n})=>{var a;return s.jsxs(Vn,{children:[s.jsx(Bn,{children:"Service Area Description"}),s.jsx(Qa,{children:s.jsx(zt,{placeholder:"Describe the areas you serve (e.g., 'Serving all of Nassau County and western Suffolk County' or 'Within 25 miles of Valley Stream, NY')",className:"min-h-[100px]",maxLength:100,...n})}),s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx(zh,{className:"text-sm text-gray-500",children:"Be specific about the cities, counties, or regions you serve to help customers find you."}),s.jsxs("span",{className:"text-sm text-gray-400",children:[((a=n.value)==null?void 0:a.length)||0,"/100 characters"]})]}),s.jsx(Ln,{})]})}}),s.jsx(aa,{control:t.control,name:"service_radius_miles",render:({field:n})=>s.jsxs(Vn,{children:[s.jsx(Bn,{children:"Service Radius (Optional)"}),s.jsx(Qa,{children:s.jsxs("div",{className:"flex items-center",children:[s.jsx(Ne,{type:"number",placeholder:"25",min:"1",max:"500",...n,onChange:a=>n.onChange(a.target.value?parseInt(a.target.value):void 0)}),s.jsx("span",{className:"ml-2 text-sm text-gray-500",children:"miles"})]})}),s.jsx(Ln,{})]})})]})]})},Tde=({form:t,categories:e,handleCategorySelect:r,removeCategory:n})=>{var i;const a=t.watch("categories");return s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-lg font-medium",children:"Categories"}),a.length>0&&s.jsx("div",{className:"flex flex-wrap gap-2 mb-3",children:a.map(o=>s.jsxs(ke,{className:"pl-2 pr-1 py-1.5 flex items-center gap-1 text-sm",variant:o.isPrimary?"default":"secondary",children:[o.name,s.jsxs("span",{className:"text-xs ml-1 opacity-75",children:["(",o.isPrimary?"Primary":"Secondary",")"]}),s.jsx("button",{type:"button",onClick:()=>n(o.id),className:"ml-1 rounded-full hover:bg-destructive/20 p-1",children:s.jsx(Ir,{className:"h-3 w-3"})})]},o.id))}),s.jsx("div",{className:"flex flex-wrap gap-2",children:e.map(o=>{const l=a.some(c=>c.id===o.id);return s.jsxs("label",{className:`px-3 py-1.5 rounded-full text-sm border cursor-pointer transition-colors 876 ${l?"bg-chamber-blue text-white":"bg-gray-100 text-gray-700 hover:bg-gray-200"}`,children:[s.jsx("input",{type:"checkbox",value:o.id,checked:l,onChange:()=>r(o.id,o.name),className:"sr-only"}),o.name]},o.id)})}),s.jsx("div",{className:"text-sm text-muted-foreground",children:a.length===0?s.jsx(s.Fragment,{children:"Select at least one category. The first selected will be Primary."}):a.length===1?s.jsx(s.Fragment,{children:"You can add 1 more category."}):null}),s.jsx(Ln,{children:(i=t.formState.errors.categories)==null?void 0:i.message})]})},Mde=({form:t})=>s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Business Tags"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Add tags to help customers find your business more easily. Use keywords that describe your products, services, or specialties."})]}),s.jsx(aa,{control:t.control,name:"tags",render:({field:e})=>s.jsxs(Vn,{children:[s.jsx(Bn,{children:"Tags"}),s.jsx(Qa,{children:s.jsx(FB,{value:e.value||[],onChange:e.onChange,placeholder:"e.g., organic, delivery, 24/7, family-owned...",maxTags:10})}),s.jsx(zh,{children:'Add up to 10 tags. Press Enter or comma to add a tag. Examples: "organic", "delivery", "24/7", "family-owned", "eco-friendly"'}),s.jsx(Ln,{})]})})]}),Pde=({form:t})=>s.jsxs("div",{className:"space-y-4 rounded-md border p-4",children:[s.jsx("h3",{className:"font-medium text-lg",children:"Social Media"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Connect your business to social media platforms"}),s.jsx(aa,{control:t.control,name:"facebook_url",render:({field:e})=>s.jsxs(Vn,{children:[s.jsx(Bn,{children:"Facebook"}),s.jsx(Qa,{children:s.jsx(Ne,{placeholder:"https://facebook.com/yourbusiness",...e,value:e.value||""})}),s.jsx(Ln,{})]})}),s.jsx(aa,{control:t.control,name:"instagram_url",render:({field:e})=>s.jsxs(Vn,{children:[s.jsx(Bn,{children:"Instagram"}),s.jsx(Qa,{children:s.jsx(Ne,{placeholder:"https://instagram.com/yourbusiness",...e,value:e.value||""})}),s.jsx(Ln,{})]})}),s.jsx(aa,{control:t.control,name:"twitter_url",render:({field:e})=>s.jsxs(Vn,{children:[s.jsx(Bn,{children:"Twitter"}),s.jsx(Qa,{children:s.jsx(Ne,{placeholder:"https://twitter.com/yourbusiness",...e,value:e.value||""})}),s.jsx(Ln,{})]})})]}),qw=({onSuccess:t,userId:e,onCancel:r,submitLabel:n="Add Business",businessData:a,isEditing:i=!1})=>{const{categories:o,loading:l}=ck(),{form:c,logoFile:u,setLogoFile:d,logoPreview:h,setLogoPreview:f,coverImageFile:m,setCoverImageFile:g,coverImagePreview:y,setCoverImagePreview:b,galleryFiles:w,setGalleryFiles:j,galleryPreviews:N,setGalleryPreviews:S,onSubmit:E,isSubmitting:C,uploadingLogo:T,uploadingCoverImage:D,uploadingGallery:A,handleCategorySelect:R,removeCategory:M,handlePlaceSelect:P}=kde({onSuccess:t,userId:e,businessData:a,isEditing:i});return s.jsx(BB,{...c,children:s.jsxs("form",{onSubmit:c.handleSubmit(E),className:"space-y-6",children:[s.jsx(_de,{form:c,logoFile:u,setLogoFile:d,logoPreview:h,setLogoPreview:f,uploadingLogo:T,coverImageFile:m,setCoverImageFile:g,coverImagePreview:y,setCoverImagePreview:b,uploadingCoverImage:D,galleryPreviews:N,handlePlaceSelect:P}),s.jsx($L,{form:c,galleryFiles:w,setGalleryFiles:j,galleryPreviews:N,setGalleryPreviews:S,uploadingGallery:A}),s.jsx(_L,{form:c}),s.jsx(Ede,{form:c}),s.jsx(Pde,{form:c}),s.jsx(Dde,{form:c,handlePlaceSelect:P}),l?s.jsxs("div",{className:"text-center py-4",children:[s.jsx(Mt,{className:"h-5 w-5 animate-spin mx-auto"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Loading c
876ategories..."})]}):s.jsx(Tde,{form:c,categories:o,handleCategorySelect:R,removeCategory:M}),s.jsx(Mde,{form:c}),s.jsxs("div",{className:"flex justify-end space-x-4 pt-4",children:[r&&s.jsx(Y,{type:"button",variant:"outline",onClick:r,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:C,children:C?"Submitting...":n})]})]})})},Rde=()=>{const t=ks();return s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs(rt,{to:"/dashboard/businesses",className:"inline-flex items-center text-chamber-blue hover:underline mb-6",children:[s.jsx(pn,{className:"mr-1 h-4 w-4"})," Back to My Businesses"]}),s.jsx("h1",{className:"text-3xl font-bold mb-6",children:"Add New Business"}),s.jsxs(De,{children:[s.jsx(ot,{children:s.jsx("p",{className:"text-gray-600",children:"Enter your business details below. Once submitted, it will be reviewed by our team."})}),s.jsx(Be,{children:s.jsx(qw,{onSuccess:()=>t("/dashboard/businesses"),userId:"guest",onCancel:()=>t("/dashboard/businesses"),submitLabel:"Add Business"})})]})]})})},Bde=({deal:t})=>{const e=o=>{switch(o){case"percentage":return s.jsx(a6,{size:16,className:"mr-1"});case"bogo":return s.jsx(i6,{size:16,className:"mr-1"});case"free":return s.jsx(Io,{size:16,className:"mr-1"});default:return s.jsx(ji,{size:16,className:"mr-1"})}},r=o=>{switch(o){case"percentage":return"bg-blue-100 text-blue-800 hover:bg-blue-200";case"fixed":return"bg-green-100 text-green-800 hover:bg-green-200";case"bogo":return"bg-purple-100 text-purple-800 hover:bg-purple-200";case"free":return"bg-orange-100 text-orange-800 hover:bg-orange-200";default:return"bg-gray-100 text-gray-800 hover:bg-gray-200"}},n=o=>new Date(o).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),a=()=>{const o=new Date(t.valid_until),l=new Date,c=Math.ceil((o.getTime()-l.getTime())/(1e3*60*60*24));return c<=7&&c>0},i=()=>new Date(t.valid_until)<new Date;return s.jsxs(De,{className:`h-full overflow-hidden hover:shadow-lg transition-shadow duration-300 ${i()?"opacity-60":""}`,children:[s.jsxs("div",{className:"relative",children:[s.jsx(Qg,{ratio:16/9,className:"bg-gray-100",children:t.image_url?s.jsx("img",{src:t.image_url,alt:t.title,className:"w-full h-full object-cover"}):s.jsx("div",{className:"flex items-center justify-center w-full h-full",children:s.jsx(Io,{size:64,className:"text-gray-400"})})}),s.jsxs("div",{className:"absolute top-2 right-2 flex flex-col gap-2",children:[s.jsx(ke,{variant:"outline",className:`${r(t.deal_type)} shadow-sm`,children:s.jsxs("div",{className:"flex items-center",children:[e(t.deal_type),t.deal_value]})}),a()&&s.jsx(ke,{variant:"destructive",className:"shadow-sm",children:"Expires Soon"}),i()&&s.jsx(ke,{variant:"secondary",className:"shadow-sm",children:"Expired"})]})]}),s.jsxs(Be,{className:"pt-4",children:[s.jsx("h3",{className:"text-xl font-semibold mb-2 text-gray-900 line-clamp-2",children:t.title}),s.jsx("p",{className:"text-gray-600 text-sm mb-4 line-clamp-3",children:t.description}),t.business&&s.jsxs("div",{className:"space-y-2 mb-4",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Offered by:"}),s.jsx(rt,{to:`/businesses/${t.business_id}`,className:"text-sm text-chamber-blue hover:underline ml-2 font-medium",children:t.business.business_name})]}),t.business.address_line1&&s.jsxs("div",{className:"flex items-start text-xs text-gray-500",children:[s.jsx(_n,{size:12,className:"mr-1 mt-0.5 flex-shrink-0"}),s.jsxs("span",{children:[t.business.address_line1,t.business.city&&`, ${t.business.city}`,t.business.state&&`, ${t.business.state}`]})]})]}),s.jsxs("div",{className:"text-xs text-gray-500 space-y-1",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"flex items-center",children:[s.jsx(Br,{size:12,className:"mr-1"}),"Valid Until:"]}),s.jsx("span",{className:"font-medium",children:n(t.valid_until)})]}),t.redemption_code&&s.jsxs("div",{className:"mt-3 bg-gray-50 p-2 rounded-md text-center",children:[s.jsx("span",{className:"block text-xs text-gray-500",children:"Redemption Code:"}),s.jsx("span",{className:"font-mono font-bold text-sm text-chamber-blue",children:t.redemption_code})]})]})]}),s.jsxs(co,{className:"pt-2 pb-4 flex flex-col items-start gap-3",children:[t.terms_and_conditions&&s.jsxs("div",{className:"text-xs text-gray-500 mb-0 w-full",children:[s.jsx("p",{className:"font-semibold mb-1",children:"Terms & Conditions:"}),s.jsx("p",{className:"line-clamp-2",children:t.terms_and_conditions})]}),s.jsx(rt,{to:`/businesses/insider-deals/${t.id}`,className:"w-full",children:s.jsx(Y,{variant:"outline",className:"w-full hover:bg-chamber-blue hover:text-white transition-colors",children:"View Details"})}),s.jsx(rt,{to:`/businesses/${t.business_id}`,className:"w-full text-center text-white bg-chamber-blue py-2 rounded-md hover:bg-chamber-blue-dark transition-colors disabled:opacity-50",children:i()?"Deal Expired":"View Business"})]})]})}
876,Lde=({deal:t})=>{const e=ks(),r=l=>{switch(l){case"percentage":return s.jsx(a6,{size:16,className:"mr-1"});case"bogo":return s.jsx(i6,{size:16,className:"mr-1"});case"free":return s.jsx(Io,{size:16,className:"mr-1"});default:return s.jsx(ji,{size:16,className:"mr-1"})}},n=l=>{switch(l){case"percentage":return"bg-blue-100 text-blue-800 hover:bg-blue-200";case"fixed":return"bg-green-100 text-green-800 hover:bg-green-200";case"bogo":return"bg-purple-100 text-purple-800 hover:bg-purple-200";case"free":return"bg-orange-100 text-orange-800 hover:bg-orange-200";default:return"bg-gray-100 text-gray-800 hover:bg-gray-200"}},a=l=>new Date(l).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),i=()=>{const l=new Date(t.valid_until),c=new Date,u=Math.ceil((l.getTime()-c.getTime())/(1e3*60*60*24));return u<=7&&u>0},o=()=>new Date(t.valid_until)<new Date;return s.jsxs(De,{className:`h-full overflow-hidden hover:shadow-lg transition-shadow duration-300 ${o()?"opacity-60":""}`,children:[s.jsxs("div",{className:"relative",children:[s.jsx(Qg,{ratio:16/9,className:"bg-gray-100",children:t.image_url?s.jsx("img",{src:t.image_url,alt:t.title,className:"w-full h-full object-cover"}):s.jsx("div",{className:"flex items-center justify-center w-full h-full",children:s.jsx(Io,{size:64,className:"text-gray-400"})})}),s.jsxs("div",{className:"absolute top-2 right-2 flex flex-col gap-2",children:[s.jsx(ke,{variant:"outline",className:`${n(t.deal_type)} shadow-sm`,children:s.jsxs("div",{className:"flex items-center",children:[r(t.deal_type),t.deal_value]})}),i()&&s.jsx(ke,{variant:"destructive",className:"shadow-sm",children:"Expires Soon"}),o()&&s.jsx(ke,{variant:"secondary",className:"shadow-sm",children:"Expired"})]}),s.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center",children:s.jsxs("div",{className:"text-center text-white p-4",children:[s.jsx(Xy,{size:32,className:"mx-auto mb-2"}),s.jsx("p",{className:"text-lg font-semibold mb-1",children:"Join to see the deal"}),s.jsx("p",{className:"text-sm opacity-90",children:"Sign in to access exclusive insider deals"})]})})]}),s.jsxs(Be,{className:"pt-4",children:[s.jsx("h3",{className:"text-xl font-semibold mb-2 text-gray-900 line-clamp-2",children:t.title}),t.business&&s.jsxs("div",{className:"space-y-2 mb-4",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Offered by:"}),s.jsx(rt,{to:`/businesses/${t.business_id}`,className:"text-sm text-chamber-blue hover:underline ml-2 font-medium",children:t.business.business_name})]}),t.business.address_line1&&s.jsxs("div",{className:"flex items-start text-xs text-gray-500",children:[s.jsx(_n,{size:12,className:"mr-1 mt-0.5 flex-shrink-0"}),s.jsxs("span",{children:[t.business.address_line1,t.business.city&&`, ${t.business.city}`,t.business.state&&`, ${t.business.state}`]})]})]}),s.jsx("div",{className:"text-xs text-gray-500",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("span",{className:"flex items-center",children:[s.jsx(Br,{size:12,className:"mr-1"}),"Valid Until:"]}),s.jsx("span",{className:"font-medium",children:a(t.valid_until)})]})})]}),s.jsx(co,{className:"pt-2 pb-4",children:s.jsxs("div",{className:"w-full space-y-3",children:[s.jsxs("div",{className:"bg-gradient-to-r from-chamber-blue-light to-blue-50 rounded-lg p-4 text-center mb-3",children:[s.jsx(Xy,{size:20,className:"mx-auto mb-2 text-chamber-blue"}),s.jsx("p",{className:"text-sm font-medium text-gray-800 mb-1",children:"Join to see the deal"}),s.jsx("p",{className:"text-xs text-gray-600 mb-3",children:"Become a chamber member to access exclusive discounts"}),s.jsxs("button",{onClick:()=>e("/auth/login"),className:"inline-flex items-center px-4 py-2 bg-chamber-blue text-white text-sm rounded-md hover:bg-chamber-blue-dark transition-colors",children:[s.jsx(gC,{size:14,className:"mr-2"}),"Sign In"]})]}),s.jsx(rt,{to:`/businesses/${t.business_id}`,className:"w-full text-center text-white bg-chamber-blue py-2 rounded-md hover:bg-chamber-blue-dark transition-colors block",children:"View Business"})]})})]})},J0=()=>{var e,r;const t=x.useContext(VC);if(!t)throw new Error("useAuth must be used within an AuthProvider");
876return{...t,profile:{user_type:t.userType,first_name:((e=t.userName)==null?void 0:e.split(" ")[0])||"",last_name:((r=t.userName)==null?void 0:r.split(" ").slice(1).join(" "))||""},loading:t.isLoading,isAdmin:t.userType==="admin",isBusiness:t.userType==="business",isResidential:t.userType==="residential",isAuthenticated:t.isAuthenticated}},W5=[{value:"all",label:"All Types"},{value:"percentage",label:"Percentage Off"},{value:"fixed",label:"Fixed Amount Off"},{value:"bogo",label:"Buy One Get One"},{value:"free",label:"Free Item/Service"},{value:"other",label:"Other Deals"}],Ide=({showFilters:t=!0,showSearch:e=!0,limit:r,businessId:n,showCreateButton:a=!1})=>{const{profile:i,isAuthenticated:o}=J0(),l=ks(),[c,u]=x.useState([]),[d,h]=x.useState(!0),[f,m]=x.useState(null),[g,y]=x.useState(""),[b,w]=x.useState("all"),[j,N]=x.useState("newest"),[S,E]=x.useState(!1),[C,T]=x.useState(1),[D,A]=x.useState(6),R=async()=>{try{h(!0),m(null);let $;if(n){if(!o){u([]),h(!1);return}$=await yi.getBusinessDeals(n)}else $=await yi.getPublicDeals();u($)}catch($){console.error("Error fetching deals:",$),m("Failed to load deals. Please try again.")}finally{h(!1)}};x.useEffect(()=>{R()},[n,o]);const M=c.filter($=>{var W,oe;if(g){const K=g.toLowerCase();return $.title.toLowerCase().includes(K)||$.description.toLowerCase().includes(K)||((oe=(W=$.business)==null?void 0:W.business_name)==null?void 0:oe.toLowerCase().includes(K))}return!0}).filter($=>b&&b!=="all"?$.deal_type===b:!0).sort(($,W)=>{var oe,K;return j==="business"?(((oe=$.business)==null?void 0:oe.business_name)||"").localeCompare(((K=W.business)==null?void 0:K.business_name)||""):j==="expiring"?new Date($.valid_until).getTime()-new Date(W.valid_until).getTime():j==="newest"?new Date(W.created_at).getTime()-new Date($.created_at).getTime():j==="oldest"?new Date($.created_at).getTime()-new Date(W.created_at).getTime():0}),P=M.length,U=Math.ceil(P/D),I=C*D,O=I-D,V=r?M.slice(0,r):M.slice(O,I),G=$=>{T($),window.scrollTo({top:0,behavior:"smooth"})},B=()=>{if(U<=1)return null;const $=5;let W=Math.max(1,C-Math.floor($/2)),oe=Math.min(U,W+$-1);return oe-W+1<$&&(W=Math.max(1,oe-$+1)),s.jsx(Pd,{className:"mt-8",children:s.jsxs(Rd,{children:[s.jsx(Qr,{children:s.jsx(Bd,{onClick:()=>C>1&&G(C-1),className:C===1?"pointer-events-none opacity-50":"cursor-pointer"})}),W>1&&s.jsxs(s.Fragment,{children:[s.jsx(Qr,{children:s.jsx(ca,{onClick:()=>G(1),children:"1"})}),W>2&&s.jsx(Qr,{children:s.jsx(nm,{})})]}),Array.from({length:oe-W+1},(K,H)=>W+H).map(K=>s.jsx(Qr,{children:s.jsx(ca,{isActive:C===K,onClick:()=>G(K),children:K})},K)),oe<U&&s.jsxs(s.Fragment,{children:[oe<U-1&&s.jsx(Qr,{children:s.jsx(nm,{})}),s.jsx(Qr,{children:s.jsx(ca,{onClick:()=>G(U),children:U})})]}),s.jsx(Qr,{children:s.jsx(Ld,{onClick:()=>C<U&&G(C+1),className:C===U?"pointer-events-none opacity-50":"cursor-pointer"})})]})})};return d?s.jsx("div",{className:"flex justify-center items-center py-12",children:s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-chamber-blue"})}):f?s.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-6 text-center",children:[s.jsx("p",{className:"text-red-600 mb-4",children:f}),s.jsx(Y,{onClick:()=>R(),variant:"outline",className:"text-red-600 border-red-300 hover:bg-red-50",children:"Try Again"})]}):s.jsxs("div",{className:"space-y-8",children:[a&&(i==null?void 0:i.user_type)==="business"&&s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Your Insider Deals"}),s.jsxs(Y,{onClick:()=>l("/dashboard?tab=deals"),className:"bg-chamber-blue hover:bg-chamber-blue-dark",children:[s.jsx(vs,{size:16,className:"mr-2"}),"Create Deal"]})]}),(e||t)&&s.jsxs("div",{className:"bg-white shadow-sm rounded-lg p-4",children:[s.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center gap-4",children:[e&&s.jsxs("div",{className:"relative w-full md:w-1/2",children:[s.jsx(Uc,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400",size:18}),s.jsx(Ne,{type:"text",placeholder:"Search deals...",className:"pl-10",value:g,onChange:$=>y($.target.value)})]}),t&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"hidden md:flex items-center space-x-4 flex-grow",children:[s.jsxs(Wt,{value:b,onValueChange:w,children:[s.jsx(Ht,{className:"w-[180px]",children:s.jsx(qt,{placeholder:"All Deal Types"})}),s.jsx($t,{children:W5.map($=>s.jsx(Ae,{value:$.value,children:$.label},$.value))})]}),s.jsxs(Wt,{value:j,onValueChange:N,children:[s.jsx(Ht,{className:"w-[180px]",children:s.jsx(qt,{placeholder:"Sort By"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"newest",children:"Newest First"}),s.jsx(Ae,{value:"oldest",children:"Oldest First"}),s.jsx(Ae,{value:"business",children:"Business (A-Z)"}),s.jsx(Ae,{value:"expiring",children:"Expiring Soon"})]})]})]}),s.jsx("div",{className:"md:hidden w-full",children:s.jsxs(Y,{onClick:()=>E(!S),variant:"outline",className:"w-full flex items-center justify-center",children:[s.jsx(Yg,{size:16,className:"mr-2"}),S?"Hide Filters":"Show Filters"]})})]})]}),t&&S&&s.jsxs("div",{className:"md:hidden mt-4 space-y-4",children:[s.jsxs(Wt,{value:b,onValueChange:w,children:[s.jsx(Ht,{className:"w-full",children:s.jsx(qt,{placeholder:"All Deal Types"})}),s.jsx($t,{children:W5.map($=>s.jsx(Ae,{value:$.value,children:$.label},$.value))})]}),s.jsxs(Wt,{value:j,onValueChange:N,children:[s.jsx(Ht,{className:"w-full",children:s.jsx(qt,{placeholder:"Sort By"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"newest",children:"Newest First"}),s.jsx(Ae,{value:"oldest",children:"Oldest First"}),s.jsx(Ae,{value:"business",children:"Business (A-Z)"}),s.jsx(Ae,{value:"expiring",children:"Expiring Soon"})]})]})]})]}),V.length>0?s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:V.map($=>o?s.jsx(Bde,{deal:$},$.id):s.jsx(Lde,{deal:$},$.id))}):s.jsxs("div",{className:"bg-gray-50 rounded-lg p-8 text-center",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-800 mb
876-2",children:"No deals found"}),s.jsx("p",{className:"text-gray-600",children:g||b!=="all"?"Try adjusting your search or filter criteria to find deals.":n?"This business hasn't created any deals yet.":"No deals are currently available. Check back soon!"})]}),!r&&P>0&&s.jsxs("div",{className:"mt-8",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-center gap-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("span",{className:"text-sm text-gray-500",children:"Items per page:"}),s.jsxs(Wt,{value:String(D),onValueChange:$=>{A(Number($)),T(1)},children:[s.jsx(Ht,{className:"w-[80px]",children:s.jsx(qt,{placeholder:"6"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"6",children:"6"}),s.jsx(Ae,{value:"12",children:"12"}),s.jsx(Ae,{value:"24",children:"24"}),s.jsx(Ae,{value:"48",children:"48"})]})]})]}),s.jsxs("div",{className:"text-sm text-gray-500",children:["Showing ",O+1,"-",Math.min(I,P)," of ",P," deals"]})]}),B()]})]})},Ode=()=>{const{profile:t,isAuthenticated:e}=J0(),r=ks();return s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs("div",{className:"mb-12 text-center",children:[s.jsx("div",{className:"inline-flex items-center justify-center p-3 bg-chamber-blue-light text-chamber-blue-dark rounded-full mb-4",children:s.jsx(Io,{size:24})}),s.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Chamber Member Insider Deals"}),s.jsx("p",{className:"max-w-2xl mx-auto text-gray-600 text-lg mb-6",children:e?"Exclusive deals and discounts for chamber members from local businesses. Present your chamber membership ID to redeem these offers.":"Discover exclusive deals from chamber member businesses. Join to unlock member-only discounts and special offers."}),!e&&s.jsxs("div",{className:"bg-gradient-to-r from-chamber-blue-light to-blue-50 rounded-lg p-6 max-w-lg mx-auto mb-8",children:[s.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Join to Access Exclusive Deals"}),s.jsx("p",{className:"text-gray-600 text-sm mb-4",children:"Become a chamber member to unlock insider deals and special discounts from local businesses."}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[s.jsx("button",{onClick:()=>r("/auth/signup"),className:"bg-chamber-blue hover:bg-chamber-blue-dark text-white px-6 py-2 rounded-md font-medium transition-colors",children:"Join Chamber"}),s.jsx("button",{onClick:()=>r("/auth/login"),className:"bg-white hover:bg-gray-50 text-chamber-blue border border-chamber-blue px-6 py-2 rounded-md font-medium transition-colors",children:"Sign In"})]})]})]}),s.jsxs("div",{className:"bg-gray-50 rounded-lg p-6 mb-12",children:[s.jsx("h2",{className:"text-2xl font-semibold text-gray-800 mb-4",children:"How It Works"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[s.jsxs("div",{className:"bg-white p-4 rounded-md shadow-sm",children:[s.jsxs("div",{className:"text-chamber-blue font-bold text-xl mb-2",children:["1. ",e?"Find a Deal":"Browse Deals"]}),s.jsx("p",{className:"text-gray-600",children:e?"Browse through our collection of exclusive member deals from local businesses.":"Explore insider deals from chamber member businesses in your community."})]}),s.jsxs("div",{className:"bg-white p-4 rounded-md shadow-sm",children:[s.jsxs("div",{className:"text-chamber-blue font-bold text-xl mb-2",children:["2. ",e?"Join Chamber":"Become a Member"]}),s.jsx("p",{className:"text-gray-600",children:e?"Ensure you have an active chamber membership to access these exclusive offers.":"Join the chamber to unlock access to these exclusive deals and discounts."})]}),s.jsxs("div",{className:"bg-white p-4 rounded-md shadow-sm",children:[s.jsxs("div",{className:"text-chamber-blue font-bold text-xl mb-2",children:["3. ",e?"Redeem & Save":"Save Money"]}),s.jsx("p",{className:"text-gray-600",children:e?"Show your chamber membership ID or use the provided code to redeem your deal.":"Start saving on products and services from local chamber member businesses."})]})]})]}),s.jsx(Ide,{showFilters:!0,showSearch:!0}
876),s.jsx("div",{className:"mt-16 bg-chamber-blue-light rounded-lg p-6",children:s.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between",children:[s.jsxs("div",{className:"mb-6 md:mb-0 md:mr-6",children:[s.jsx("h3",{className:"text-xl font-bold text-chamber-blue-dark mb-2",children:"Own a Business?"}),s.jsx("p",{className:"text-gray-700",children:(t==null?void 0:t.user_type)==="business"?"Create and manage your exclusive deals through your business dashboard.":"Chamber business members can create their own exclusive deals for other members."})]}),(t==null?void 0:t.user_type)==="business"?s.jsx(rt,{to:"/dashboard/deals",className:"px-6 py-3 bg-chamber-blue text-white rounded-md font-medium hover:bg-chamber-blue-dark transition-colors",children:"Manage Deals"}):s.jsx(rt,{to:"/contact",className:"px-6 py-3 bg-chamber-blue text-white rounded-md font-medium hover:bg-chamber-blue-dark transition-colors",children:"Learn More"})]})})]})})},zde=()=>{const t=ks();return s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs(Y,{variant:"ghost",onClick:()=>t("/businesses/insider-deals"),className:"mb-6 text-chamber-blue hover:text-chamber-blue-dark",children:[s.jsx(pn,{size:16,className:"mr-2"}),"Back to Deals"]}),s.jsxs("div",{className:"flex flex-col lg:flex-row gap-8 mb-8",children:[s.jsx("div",{className:"w-full lg:w-2/3",children:s.jsx(cs,{className:"h-80 w-full rounded-lg mb-4"})}),s.jsx("div",{className:"w-full lg:w-1/3",children:s.jsx(cs,{className:"h-96 w-full rounded-lg"})})]}),s.jsxs("div",{className:"grid md:grid-cols-3 gap-8",children:[s.jsxs("div",{className:"md:col-span-2",children:[s.jsx(cs,{className:"h-10 w-3/4 mb-4"}),s.jsx(cs,{className:"h-20 w-full mb-4"}),s.jsx(cs,{className:"h-40 w-full"})]}),s.jsxs("div",{className:"md:col-span-1",children:[s.jsx(cs,{className:"h-10 w-full mb-4"}),s.jsx(cs,{className:"h-28 w-full mb-4"}),s.jsx(cs,{className:"h-28 w-full mb-4"}),s.jsx(cs,{className:"h-28 w-full"})]})]})]})})},Ude=()=>{const t=ks();return s.jsxs("div",{className:"container-wrapper py-12 text-center",children:[s.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Deal Not Found"}),s.jsx("p",{className:"mb-6",children:"The deal you're looking for doesn't exist or is no longer available."}),s.jsxs(Y,{onClick:()=>t("/businesses/insider-deals"),className:"bg-chamber-blue hover:bg-chamber-blue-dark",children:[s.jsx(pn,{size:16,className:"mr-2"}),"Back to Deals"]})]})},Hde=({deal:t})=>{const[e,r]=x.useState(!1);return s.jsx("div",{className:"w-full lg:w-2/3",children:s.jsx("div",{className:"relative h-64 sm:h-80 md:h-96 bg-gray-200 rounded-lg overflow-hidden mb-4",children:t.image_url?s.jsxs(Tt,{open:e,onOpenChange:r,children:[s.jsx(Aw,{asChild:!0,children:s.jsx("img",{src:t.image_url,alt:t.title,className:"w-full h-full object-contain bg-gray-100 cursor-pointer hover:opacity-90 transition-opacity"})}),s.jsx(Dt,{className:"max-w-6xl max-h-[95vh] p-0 bg-transparent border-none shadow-none [&>button]:text-white [&>button]:hover:text-gray-200",children:s.jsx("div",{className:"relative flex items-center justify-center min-h-[60vh] max-h-[95vh]",children:s.jsx("img",{src:t.image_url,alt:t.title,className:"max-w-full max-h-full object-contain",onClick:()=>r(!1)})})})]}):s.jsx("div",{className:"w-full h-full flex items-center justify-center bg-chamber-blue-light",children:s.jsx(Io,{size:64,className:"text-chamber-blue"})})})})},$de=({deal:t,showMemberDealContent:e=!0})=>{var l,c,u,d,h,f,m;const{toast:r}=St(),n=g=>new Date(g).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),a=(l=t.business)!=null&&l.address_line1||(c=t.business)!=null&&c.city||(u=t.business)!=null&&u.state?[(d=t.business)==null?void 0:d.address_line1,(h=t.business)==null?void 0:h.city,(f=t.business)==null?void 0:f.state].filter(Boolean).join(", "):"Service area",i=()=>{e&&(t.redemption_code?navigator.clipboard.writeText(t.redemption_code).then(()=>{r({title:"Coupon copied",description:`"${t.redemption_code}" has been copied to your clipboard.`})}):r({title:"No coupon needed",description:"This deal does not require a coupon code."}))},o=()=>{const g=window.location.href;navigator.clipboard.writeText(g).then(()=>{r({title:"Link copied",description:"Deal link has been copied to your clipboard."})}).catch(()=>
876{r({title:"Share deal",description:`Deal: ${t.title} - ${g}`})})};return s.jsx(De,{className:"h-full",children:s.jsxs(Be,{className:"pt-6",children:[s.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Deal Details"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(Br,{size:20,className:"mt-1 text-chamber-blue flex-shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Valid Until"}),s.jsx("p",{className:"text-gray-600",children:n(t.valid_until)})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(ji,{size:20,className:"mt-1 text-chamber-blue flex-shrink-0"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium",children:"Coupon Code"}),e?s.jsx("p",{className:"text-gray-600",children:t.redemption_code||"No Coupon Needed"}):s.jsx("div",{className:"rounded-lg border border-dashed border-gray-200 bg-gray-50/80 p-3 text-sm text-gray-600",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(Xy,{size:16,className:"mt-0.5 shrink-0 text-chamber-blue"}),s.jsxs("span",{children:["Hidden until you sign in."," ",s.jsx(rt,{to:"/auth/login",className:"font-medium text-chamber-blue hover:underline",children:"Sign in"})," ","to see your code."]})]})})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(_n,{size:20,className:"mt-1 text-chamber-blue flex-shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Location"}),s.jsx("p",{className:"text-gray-600",children:a})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(ma,{size:20,className:"mt-1 text-chamber-blue flex-shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Organizer"}),s.jsx("p",{className:"text-gray-600",children:((m=t.business)==null?void 0:m.business_name)||"â"})]})]}),s.jsxs("div",{className:"pt-4 space-y-3",children:[s.jsx(Y,{className:"w-full bg-chamber-blue hover:bg-chamber-blue-dark inline-flex items-center justify-center gap-2",asChild:!0,children:s.jsxs(rt,{to:`/businesses/${t.business_id}`,children:[s.jsx(up,{size:16,className:"shrink-0"}),"View Business"]})}),e?s.jsxs(Y,{variant:"outline",className:"w-full inline-flex items-center justify-center gap-2",onClick:i,children:[s.jsx(Io,{size:16,className:"shrink-0"}),"Show Coupon"]}):s.jsx(Y,{variant:"outline",className:"w-full inline-flex items-center justify-center gap-2",asChild:!0,children:s.jsxs(rt,{to:"/auth/login",children:[s.jsx(gC,{size:16,className:"shrink-0"}),"Sign in for coupon"]})}),s.jsxs(Y,{variant:"outline",className:"w-full inline-flex items-center justify-center gap-2",onClick:o,children:[s.jsx(bC,{size:16,className:"shrink-0"}),"Share"]})]})]})]})})},Wde=({deals:t,showViewDetails:e=!0})=>{const r=ks();return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Recent Deals"}),t.length>0?s.jsx("div",{className:"space-y-4",children:t.map(n=>s.jsx(De,{className:"overflow-hidden",children:s.jsxs("div",{className:"flex",children:[s.jsx("div",{className:"w-24 h-24 bg-gray-200 flex-shrink-0",children:n.image_url?s.jsx("img",{src:n.image_url,alt:n.title,className:"w-full h-full object-cover"}):s.jsx("div",{className:"w-full h-full flex items-center justify-center bg-chamber-blue-light",children:s.jsx(Io,{size:24,className:"text-chamber-blue"})})}),s.jsxs(Be,{className:"py-3 px-4",children:[s.jsx("h3",{className:"font-medium line-clamp-1",children:n.title}),e?s.jsx(Y,{variant:"link",className:"text-chamber-blue p-0 h-auto text-sm",onClick:()=>r(`/businesses/insider-deals/${n.id}`),children:"View Details"}):s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Sign in to view"})]})]})},n.id))}):s.jsx("div",{className:"text-center p-6 bg-gray-50 rounded-lg",children:s.jsx("p",{className:"text-gray-600",children:"No other deals at this time"})})]})},qde=()=>{const{id:t}=Dd(),e=ks(),{isAuthenticated:r,isLoading:n}=ts(),[a,i]=x.useState(null),[o,l]=x.useState([]),[c,u]=x.useState(!0);if(x.useEffect(()=>{(async()=>
876{if(t){u(!0);try{const f=await yi.getDealById(t);if(i(f??null),f)if(!(f.approval_status==="approved"&&f.is_active&&new Date(f.valid_until)>=new Date))i(null);else{const b=[...(await yi.getPublicDeals()).filter(w=>w.id!==t)].sort(()=>Math.random()-.5);l(b.slice(0,3))}}catch(f){console.error("Error fetching deal details:",f),i(null)}finally{u(!1)}}})()},[t]),c||n)return s.jsx(zde,{});if(!a)return s.jsx(Ude,{});const d=r;return s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs(Y,{variant:"ghost",onClick:()=>e("/businesses/insider-deals"),className:"mb-6 text-chamber-blue hover:text-chamber-blue-dark",children:[s.jsx(pn,{size:16,className:"mr-2"}),"Back to Deals"]}),s.jsxs("div",{className:"flex flex-col lg:flex-row gap-8 mb-8",children:[s.jsx(Hde,{deal:a}),s.jsx("div",{className:"w-full lg:w-1/3",children:s.jsx($de,{deal:a,showMemberDealContent:d})})]}),s.jsxs("div",{className:"grid md:grid-cols-3 gap-8",children:[s.jsxs("div",{className:"md:col-span-2",children:[s.jsx("h1",{className:"text-3xl font-bold mb-6",children:a.title}),d?s.jsxs("div",{className:"prose prose-lg max-w-none",children:[s.jsx("p",{className:"text-gray-700 whitespace-pre-wrap",children:a.description}),a.terms_and_conditions&&s.jsxs("div",{className:"mt-6 pt-6 border-t",children:[s.jsx("h3",{className:"font-semibold text-gray-900 mb-2",children:"Terms & Conditions"}),s.jsx("p",{className:"text-sm text-gray-600 whitespace-pre-wrap",children:a.terms_and_conditions})]})]}):s.jsxs("div",{className:"rounded-xl border border-chamber-blue/20 bg-gradient-to-br from-chamber-blue-light/80 to-blue-50/90 p-8 text-center",children:[s.jsx(Xy,{className:"mx-auto mb-4 h-10 w-10 text-chamber-blue"}),s.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Sign in to see the full deal"}),s.jsx("p",{className:"text-gray-600 mb-6 max-w-md mx-auto text-sm sm:text-base",children:"Coupon codes, offer details, and terms are available to signed-in chamber members only."}),s.jsx(Y,{asChild:!0,className:"bg-chamber-blue hover:bg-chamber-blue-dark",children:s.jsxs(rt,{to:"/auth/login",className:"inline-flex items-center justify-center gap-2",children:[s.jsx(gC,{size:18}),"Sign in to unlock"]})})]})]}),s.jsx("div",{className:"md:col-span-1",children:s.jsx(Wde,{deals:o,showViewDetails:d})})]})]})})},q5=(t,e,r)=>{if(t&&"reportValidity"in t){const n=Kt(r,e);t.setCustomValidity(n&&n.message||""),t.reportValidity()}},ZF=(t,e)=>{for(const r in e.fields){const n=e.fields[r];n&&n.ref&&"reportValidity"in n.ref?q5(n.ref,r,t):n&&n.refs&&n.refs.forEach(a=>q5(a,r,t))}},G5=(t,e)=>{e.shouldUseNativeValidation&&ZF(t,e);const r={};for(const n in t){const a=Kt(e.fields,n),i=Object.assign(t[n]||{},{ref:a&&a.ref});if(Gde(e.names||Object.keys(t),n)){const o=Object.assign({},Kt(r,n));Ks(o,"root",i),Ks(r,n,o)}else Ks(r,n,i)}return r},Gde=(t,e)=>{const r=V5(e);return t.some(n=>V5(n).match(`^${r}\\.\\d+`))};function V5(t){return t.replace(/\]|\[/g,"")}function AI(t,e,r){function n(l,c){var u;Object.defineProperty(l,"_zod",{value:l._zod??{},enumerable:!1}),(u=l._zod).traits??(u.traits=new Set),l._zod.traits.add(t),e(l,c);for(const d in o.prototype)d in l||Object.defineProperty(l,d,{value:o.prototype[d].bind(l)});l._zod.constr=o,l._zod.def=c}const a=(r==null?void 0:r.Parent)??Object;class i extends a{}Object.defineProperty(i,"name",{value:t});function o(l){var c;const u=r!=null&&r.Parent?new i:this;n(u,l),(c=u._zod).deferred??(c.deferred=[]);for(const d of u._zod.deferred)d();return u}return Object.defineProperty(o,"init",{value:n}),Object.defineProperty(o,Symbol.hasInstance,{value:l=>{var c,u;return r!=null&&r.Parent&&l instanceof r.Parent?!0:(u=(c=l==null?void 0:l._zod)==null?void 0:c.traits)==null?void 0:u.has(t)}}),Object.defineProperty(o,"name",{value:t}),o}class Vde extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const Kde={};function DI(t){return Kde}function Jde(t,e){return typeof e=="bigint"?e.toString():e}const TI=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};function pv(t){return typeof t=="string"?t:t==null?void 0:t.message}function MI(t,e,r){var a,i,o,l,c,u;const n={...t,path:t.path??[]};if(!t.message){const d=pv((o=(i=(a=t.inst)==null?void 0:a._zod.def)==null?void 0:i.error)==null?void 0:o.call(i,t))??pv((l=e==null?void 0:e.error)==null?void 0:l.call(e,t))??pv((c=r.customError)==null?void 0:c.call(r,t))??pv((u=r.localeError)==null?void 0:u.call(r,t))??"Invalid input";n.message=d}return delete n.inst,delete n.continue,e!=null&&e.reportInput||delete n.input,n}const PI=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),Object.defineProperty(t,"message",{get(){return JSON.stringify(e,Jde,2)},enumerable:!0}),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},Yde=AI("$ZodError",PI),RI=AI("$ZodError",PI,{Parent:Error}),Zde=t=>(e,r,n,a)=>{const i=n?Object.assign(n,{async:!1}):{async:!1},o=e._zod.run({value:r,issues:[]},i);if(o instanceof Promise)throw new Vde;if(o.issues.length){const l=new((a==null?void 0:a.Err)??t)(o.issues.map(c=>MI(c,i,DI())));throw TI(l,a==null?void 0:a.callee),l}return o.value},Xde=Zde(RI),Qde=t=>async(e,r,n,a)=>{const i=n?Object.assign(n,{async:!0}):{async:!0};let o=e._zod.run({value:r,issues:[]},i);if(o instanceof Promise&&(o=await o),o.issues.length){const l=new((a==null?void 0:a.Err)??t)(o.issues.map(c=>MI(c,i,DI())));throw TI(l,a==null?void 0:a.callee),l}return o.value},ehe=Qde(RI);function K5(t,e){try{var r=t()}catch(n){return e(n)}return r&&r.then?r.then(void 0,e):r}function the(t,e){for(var r={};t.length;
876){var n=t[0],a=n.code,i=n.message,o=n.path.join(".");if(!r[o])if("unionErrors"in n){var l=n.unionErrors[0].errors[0];r[o]={message:l.message,type:l.code}}else r[o]={message:i,type:a};if("unionErrors"in n&&n.unionErrors.forEach(function(d){return d.errors.forEach(function(h){return t.push(h)})}),e){var c=r[o].types,u=c&&c[n.code];r[o]=xk(o,e,r,a,u?[].concat(u,n.message):n.message)}t.shift()}return r}function rhe(t,e){for(var r={};t.length;){var n=t[0],a=n.code,i=n.message,o=n.path.join(".");if(!r[o])if(n.code==="invalid_union"&&n.errors.length>0){var l=n.errors[0][0];r[o]={message:l.message,type:l.code}}else r[o]={message:i,type:a};if(n.code==="invalid_union"&&n.errors.forEach(function(d){return d.forEach(function(h){return t.push(h)})}),e){var c=r[o].types,u=c&&c[n.code];r[o]=xk(o,e,r,a,u?[].concat(u,n.message):n.message)}t.shift()}return r}function Ek(t,e,r){if(r===void 0&&(r={}),function(n){return"_def"in n&&typeof n._def=="object"&&"typeName"in n._def}(t))return function(n,a,i){try{return Promise.resolve(K5(function(){return Promise.resolve(t[r.mode==="sync"?"parse":"parseAsync"](n,e)).then(function(o){return i.shouldUseNativeValidation&&ZF({},i),{errors:{},values:r.raw?Object.assign({},n):o}})},function(o){if(function(l){return Array.isArray(l==null?void 0:l.issues)}(o))return{values:{},errors:G5(the(o.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw o}))}catch(o){return Promise.reject(o)}};if(function(n){return"_zod"in n&&typeof n._zod=="object"}(t))return function(n,a,i){try{return Promise.resolve(K5(function(){return Promise.resolve((r.mode==="sync"?Xde:ehe)(t,n,e)).then(function(o){return i.shouldUseNativeValidation&&ZF({},i),{errors:{},values:r.raw?Object.assign({},n):o}})},function(o){if(function(l){return l instanceof Yde}(o))return{values:{},errors:G5(rhe(o.issues,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw o}))}catch(o){return Promise.reject(o)}};throw new Error("Invalid input: not a Zod schema")}var Is;(function(t){t.assertEqual=a=>{};function e(a){}t.assertIs=e;function r(a){throw new Error}t.assertNever=r,t.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},t.getValidEnumValues=a=>{const i=t.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),o={};for(const l of i)o[l]=a[l];return t.objectValues(o)},t.objectValues=a=>t.objectKeys(a).map(function(i){return a[i]}),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},t.find=(a,i)=>{for(const o of a)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=n,t.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(Is||(Is={}));var J5;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(J5||(J5={}));const gr=Is.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),jh=t=>{switch(typeof t){case"undefined":return gr.undefined;case"string":return gr.string;case"number":return Number.isNaN(t)?gr.nan:gr.number;case"boolean":return gr.boolean;case"function":return gr.function;case"bigint":return gr.bigint;case"symbol":return gr.symbol;case"object":return Array.isArray(t)?gr.array:t===null?gr.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?gr.promise:typeof Map<"u"&&t instanceof Map?gr.map:typeof Set<"u"&&t instanceof Set?gr.set:typeof Date<"u"&&t instanceof Date?gr.date:gr.object;default:return gr.unknown}}
vendor: 4,379 bytes, line 876
876,Et=Is.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class kd extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(i){return i.message},n={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let l=n,c=0;for(;c<o.path.length;){const u=o.path[c];c===o.path.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(r(o))):l[u]=l[u]||{_errors:[]},l=l[u],c++}}};return a(this),n}static assert(e){if(!(e instanceof kd))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Is.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];r[i]=r[i]||[],r[i].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}kd.create=t=>new kd(t);const XF=(t,e)=>{let r;switch(t.code){case Et.invalid_type:t.received===gr.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Et.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Is.jsonStringifyReplacer)}`;break;case Et.unrecognized_keys:r=`Unrecognized key(s) in object: ${Is.joinValues(t.keys,", ")}`;break;case Et.invalid_union:r="Invalid input";break;case Et.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Is.joinValues(t.options)}`;break;case Et.invalid_enum_value:r=`Invalid enum value. Expected ${Is.joinValues(t.options)}, received '${t.received}'`;break;case Et.invalid_arguments:r="Invalid function arguments";break;case Et.invalid_return_type:r="Invalid function return type";break;case Et.invalid_date:r="Invalid date";break;case Et.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Is.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Et.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Et.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Et.custom:r="Invalid input";break;
vendor: 5,030 bytes, line 876
876case Et.invalid_intersection_types:r="Intersection results could not be merged";break;case Et.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Et.not_finite:r="Number must be finite";break;default:r=e.defaultError,Is.assertNever(t)}return{message:r}};let she=XF;function nhe(){return she}const ahe=t=>{const{data:e,path:r,errorMaps:n,issueData:a}=t,i=[...r,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let l="";const c=n.filter(u=>!!u).slice().reverse();for(const u of c)l=u(o,{data:e,defaultError:l}).message;return{...a,path:i,message:l}};function nr(t,e){const r=nhe(),n=ahe({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===XF?void 0:XF].filter(a=>!!a)});t.common.issues.push(n)}class gl{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const a of r){if(a.status==="aborted")return Yr;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const a of r){const i=await a.key,o=await a.value;n.push({key:i,value:o})}return gl.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const a of r){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return Yr;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(n[i.value]=o.value)}return{status:e.value,value:n}}}const Yr=Object.freeze({status:"aborted"}),Sy=t=>({status:"dirty",value:t}),Yl=t=>({status:"valid",value:t}),Y5=t=>t.status==="aborted",Z5=t=>t.status==="dirty",sx=t=>t.status==="valid",E1=t=>typeof Promise<"u"&&t instanceof Promise;var br;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(br||(br={}));class am{constructor(e,r,n,a){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const X5=(t,e)=>{if(sx(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new kd(t.common.issues);return this._error=r,this._error}}};function bs(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:a}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(o,l)=>{const{message:c}=t;return o.code==="invalid_enum_value"?{message:c??l.defaultError}:typeof l.data>"u"?{message:c??n??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:c??r??l.defaultError}},description:a}}class Ls{get description(){return this._def.description}_getType(e){return jh(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:jh(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new gl,ctx:{common:e.parent.common,data:e.data,parsedType:jh(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(E1(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:jh(e)},a=this._parseSync({data:e,path:n.path,parent:n});return X5(n,a)}"~validate"(e){var n,a;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:jh(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:r});return sx(i)?{value:i.value}:{issues:r.common.issues}}catch(i){(a=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(i=>sx(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:jh(e)},a=this._parse({data:e,path:n.path,parent:n}),i=await(E1(a)?a:Promise.resolve(a));return X5(n,i)}refine(e,r){const n=a=>typeof r=="string"||typeof r>"u"?{message:r}
vendor: 6,231 bytes, line 876
876:typeof r=="function"?r(a):r;return this._refinement((a,i)=>{const o=e(a),l=()=>i.addIssue({code:Et.custom,...n(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(c=>c?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(e,r){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(e){return new ix({schema:this,typeName:Zr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Yh.create(this,this._def)}nullable(){return ox.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return wu.create(this)}promise(){return M1.create(this,this._def)}or(e){return D1.create([this,e],this._def)}and(e){return T1.create(this,e,this._def)}transform(e){return new ix({...bs(this._def),schema:this,typeName:Zr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new tS({...bs(this._def),innerType:this,defaultValue:r,typeName:Zr.ZodDefault})}brand(){return new _he({typeName:Zr.ZodBranded,type:this,...bs(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new rS({...bs(this._def),innerType:this,catchValue:r,typeName:Zr.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Ak.create(this,e)}readonly(){return sS.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ihe=/^c[^\s-]{8,}$/i,ohe=/^[0-9a-z]+$/,lhe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,che=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,uhe=/^[a-z0-9_-]{21}$/i,dhe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,hhe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,mhe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,fhe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let z2;const phe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ghe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,xhe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,yhe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,bhe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,vhe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,BI="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",whe=new RegExp(`^${BI}$`);function LI(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function jhe(t){return new RegExp(`^${LI(t)}$`)}function Nhe(t){let e=`${BI}T${LI(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Fhe(t,e){return!!((e==="v4"||!e)&&phe.test(t)||(e==="v6"||!e)&&xhe.test(t))}function She(t,e){if(!dhe.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function Che(t,e){return!!((e==="v4"||!e)&&ghe.test(t)||(e==="v6"||!e)&&yhe.test(t))}class Uh extends Ls{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==gr.string){const i=this._getOrReturnCtx(e);
vendor: 19,335 bytes, line 876
876return nr(i,{code:Et.invalid_type,expected:gr.string,received:i.parsedType}),Yr}const n=new gl;let a;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),nr(a,{code:Et.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),nr(a,{code:Et.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,l=e.data.length<i.value;(o||l)&&(a=this._getOrReturnCtx(e,a),o?nr(a,{code:Et.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&nr(a,{code:Et.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")mhe.test(e.data)||(a=this._getOrReturnCtx(e,a),nr(a,{validation:"email",code:Et.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")z2||(z2=new RegExp(fhe,"u")),z2.test(e.data)||(a=this._getOrReturnCtx(e,a),nr(a,{validation:"emoji",code:Et.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")che.test(e.data)||(a=this._getOrReturnCtx(e,a),nr(a,{validation:"uuid",code:Et.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")uhe.test(e.data)||(a=this._getOrReturnCtx(e,a),nr(a,{validation:"nanoid",code:Et.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")ihe.test(e.data)||(a=this._getOrReturnCtx(e,a),nr(a,{validation:"cuid",code:Et.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")ohe.test(e.data)||(a=this._getOrReturnCtx(e,a),nr(a,{validation:"cuid2",code:Et.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")lhe.test(e.data)||(a=this._getOrReturnCtx(e,a),nr(a,{validation:"ulid",code:Et.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),nr(a,{validation:"url",code:Et.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),nr(a,{validation:"regex",code:Et.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),nr(a,{code:Et.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),nr(a,{code:Et.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),nr(a,{code:Et.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Nhe(i).test(e.data)||(a=this._getOrReturnCtx(e,a),nr(a,{code:Et.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?whe.test(e.data)||(a=this._getOrReturnCtx(e,a),nr(a,{code:Et.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?jhe(i).test(e.data)||(a=this._getOrReturnCtx(e,a),nr(a,{code:Et.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?hhe.test(e.data)||(a=this._getOrReturnCtx(e,a),nr(a,{validation:"duration",code:Et.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?Fhe(e.data,i.version)||(a=this._getOrReturnCtx(e,a),nr(a,{validation:"ip",code:Et.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?She(e.data,i.alg)||(a=this._getOrReturnCtx(e,a),nr(a,{validation:"jwt",code:Et.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?Che(e.data,i.version)||(a=this._getOrReturnCtx(e,a),nr(a,{validation:"cidr",code:Et.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?bhe.test(e.data)||(a=this._getOrReturnCtx(e,a),nr(a,{validation:"base64",code:Et.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?vhe.test(e.data)||(a=this._getOrReturnCtx(e,a),nr(a,{validation:"base64url",code:Et.invalid_string,message:i.message}),n.dirty()):Is.assertNever(i);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(a=>e.test(a),{validation:r,code:Et.invalid_string,...br.errToObj(n)})}_addCheck(e){return new Uh({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...br.errToObj(e)})}url(e){return this._addCheck({kind:"url",...br.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...br.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...br.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...br.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...br.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...br.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...br.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...br.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...br.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...br.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...br.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...br.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...br.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...br.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...br.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...br.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...br.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...br.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...br.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...br.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...br.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...br.errToObj(r)})}nonempty(e){return this.min(1,br.errToObj(e))}trim(){return new Uh({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Uh({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Uh({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Uh.create=t=>new Uh({checks:[],typeName:Zr.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...bs(t)});function khe(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=r>n?r:n,i=Number.parseInt(t.toFixed(a).replace(".","")),o=Number.parseInt(e.toFixed(a).replace(".",""));return i%o/10**a}class nx extends Ls{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==gr.number){const i=this._getOrReturnCtx(e);return nr(i,{code:Et.invalid_type,expected:gr.number,received:i.parsedType}),Yr}let n;const a=new gl;for(const i of this._def.checks)i.kind==="int"?Is.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),nr(n,{code:Et.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),nr(n,{code:Et.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),nr(n,{code:Et.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?khe(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),nr(n,{code:Et.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),nr(n,{code:Et.not_finite,message:i.message}),a.dirty()):Is.assertNever(i);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,br.toString(r))}gt(e,r){return this.setLimit("min",e,!1,br.toString(r))}lte(e,r){return this.setLimit("max",e,!0,br.toString(r))}lt(e,r){return this.setLimit("max",e,!1,br.toString(r))}setLimit(e,r,n,a){return new nx({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:br.toString(a)}]})}_addCheck(e){return new nx({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:br.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:br.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:br.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:br.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:br.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:br.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:br.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:br.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:br.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Is.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}nx.create=t=>new nx({checks:[],typeName:Zr.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...bs(t)});class c0 extends Ls{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==gr.bigint)return this._getInvalidInput(e);let n;const a=new gl;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),nr(n,{code:Et.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),nr(n,{code:Et.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),nr(n,{code:Et.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):Is.assertNever(i);return{status:a.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return nr(r,{code:Et.invalid_type,expected:gr.bigint,received:r.parsedType}),Yr}gte(e,r){return this.setLimit("min",e,!0,br.toString(r))}gt(e,r){return this.setLimit("min",e,!1,br.toString(r))}lte(e,r){return this.setLimit("max",e,!0,br.toString(r))}lt(e,r){return this.setLimit("max",e,!1,br.toString(r))}setLimit(e,r,n,a){return new c0({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:br.toString(a)}]})}_addCheck(e){return new c0({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:br.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:br.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:br.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:br.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:br.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}c0.create=t=>new c0({checks:[],typeName:Zr.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...bs(t)});class Q5 extends Ls{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==gr.boolean){const n=this._getOrReturnCtx(e);return nr(n,{code:Et.invalid_type,expected:gr.boolean,received:n.parsedType}),Yr}return Yl(e.data)}}Q5.create=t=>new Q5({typeName:Zr.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...bs(t)});class A1 extends Ls{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==gr.date){const i=this._getOrReturnCtx(e);return nr(i,{code:Et.invalid_type,expected:gr.date,received:i.parsedType}),Yr}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return nr(i,{code:Et.invalid_date}),Yr}const n=new gl;let a;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),nr(a,{code:Et.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),nr(a,{code:Et.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Is.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new A1({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:br.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:br.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}A1.create=t=>new A1({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Zr.ZodDate,...bs(t)});class eA extends Ls{_parse(e){if(this._getType(e)!==gr.symbol){const n=this._getOrReturnCtx(e);return nr(n,{code:Et.invalid_type,expected:gr.symbol,received:n.parsedType}),Yr}return Yl(e.data)}}eA.create=t=>new eA({typeName:Zr.ZodSymbol,...bs(t)});class tA extends Ls{_parse(e){if(this._getType(e)!==gr.undefined){const n=this._getOrReturnCtx(e);return nr(n,{code:Et.invalid_type,expected:gr.undefined,received:n.parsedType}),Yr}return Yl(e.data)}}tA.create=t=>new tA({typeName:Zr.ZodUndefined,...bs(t)});class rA extends Ls{_parse(e){if(this._getType(e)!==gr.null){const n=this._getOrReturnCtx(e);return nr(n,{code:Et.invalid_type,expected:gr.null,received:n.parsedType}),Yr}return Yl(e.data)}}rA.create=t=>new rA({typeName:Zr.ZodNull,...bs(t)});class sA extends Ls{constructor(){super(...arguments),this._any=!0}_parse(e){return Yl(e.data)}}sA.create=t=>new sA({typeName:Zr.ZodAny,...bs(t)});class nA extends Ls{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Yl(e.data)}}nA.create=t=>new nA({typeName:Zr.ZodUnknown,...bs(t)});class im extends Ls{_parse(e){const r=this._getOrReturnCtx(e);return nr(r,{code:Et.invalid_type,expected:gr.never,received:r.parsedType}),Yr}}im.create=t=>new im({typeName:Zr.ZodNever,...bs(t)});class aA extends Ls{_parse(e){if(this._getType(e)!==gr.undefined){const n=this._getOrReturnCtx(e);return nr(n,{code:Et.invalid_type,expected:gr.void,received:n.parsedType}),Yr}return Yl(e.data)}}aA.create=t=>new aA({typeName:Zr.ZodVoid,...bs(t)});class wu extends Ls{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),a=this._def;if(r.parsedType!==gr.array)return nr(r,{code:Et.invalid_type,expected:gr.array,received:r.parsedType}),Yr;if(a.exactLength!==null){const o=r.data.length>a.exactLength.value,l=r.data.length<a.exactLength.value;(o||l)&&(nr(r,{code:o?Et.too_big:Et.too_small,minimum:l?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(nr(r,{code:Et.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(nr(r,{code:Et.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,l)=>a.type._parseAsync(new am(r,o,r.path,l)))).then(o=>gl.mergeArray(n,o));const i=[...r.data].map((o,l)=>a.type._parseSync(new am(r,o,r.path,l)));return gl.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new wu({...this._def,minLength:{value:e,message:br.toString(r)}})}max(e,r){return new wu({...this._def,maxLength:{value:e,message:br.toString(r)}})}length(e,r){return new wu({...this._def,exactLength:{value:e,message:br.toString(r)}})}nonempty(e){return this.min(1,e)}}wu.create=(t,e)=>new wu({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Zr.ZodArray,...bs(e)});function cg(t){if(t instanceof Fa){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=Yh.create(cg(n))}return new Fa({...t._def,shape:()=>e})}else return t instanceof wu?new wu({...t._def,type:cg(t.element)}):t instanceof Yh?Yh.create(cg(t.unwrap())):t instanceof ox?ox.create(cg(t.unwrap())):t instanceof Xf?Xf.create(t.items.map(e=>cg(e))):t}class Fa extends Ls{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;
vendor: 4,147 bytes, line 876
876const e=this._def.shape(),r=Is.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==gr.object){const u=this._getOrReturnCtx(e);return nr(u,{code:Et.invalid_type,expected:gr.object,received:u.parsedType}),Yr}const{status:n,ctx:a}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof im&&this._def.unknownKeys==="strip"))for(const u in a.data)o.includes(u)||l.push(u);const c=[];for(const u of o){const d=i[u],h=a.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new am(a,h,a.path,u)),alwaysSet:u in a.data})}if(this._def.catchall instanceof im){const u=this._def.unknownKeys;if(u==="passthrough")for(const d of l)c.push({key:{status:"valid",value:d},value:{status:"valid",value:a.data[d]}});else if(u==="strict")l.length>0&&(nr(a,{code:Et.unrecognized_keys,keys:l}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const d of l){const h=a.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new am(a,h,a.path,d)),alwaysSet:d in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const u=[];for(const d of c){const h=await d.key,f=await d.value;u.push({key:h,value:f,alwaysSet:d.alwaysSet})}return u}).then(u=>gl.mergeObjectSync(n,u)):gl.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return br.errToObj,new Fa({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,o;const a=((o=(i=this._def).errorMap)==null?void 0:o.call(i,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:br.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new Fa({...this._def,unknownKeys:"strip"})}passthrough(){return new Fa({...this._def,unknownKeys:"passthrough"})}extend(e){return new Fa({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Fa({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Zr.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Fa({...this._def,catchall:e})}pick(e){const r={};for(const n of Is.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Fa({...this._def,shape:()=>r})}omit(e){const r={};for(const n of Is.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new Fa({...this._def,shape:()=>r})}deepPartial(){return cg(this)}partial(e){const r={};for(const n of Is.objectKeys(this.shape)){const a=this.shape[n];e&&!e[n]?r[n]=a:r[n]=a.optional()}return new Fa({...this._def,shape:()=>r})}required(e){const r={};for(const n of Is.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Yh;)i=i._def.innerType;r[n]=i}return new Fa({...this._def,shape:()=>r})}keyof(){return II(Is.objectKeys(this.shape))}}Fa.create=(t,e)=>new Fa({shape:()=>t,unknownKeys:"strip",catchall:im.create(),typeName:Zr.ZodObject,...bs(e)});Fa.strictCreate=(t,e)=>new Fa({shape:()=>t,unknownKeys:"strict",catchall:im.create(),typeName:Zr.ZodObject,...bs(e)});Fa.lazycreate=(t,e)=>new Fa({shape:t,unknownKeys:"strip",catchall:im.create(),typeName:Zr.ZodObject,...bs(e)});class D1 extends Ls{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function a(i){for(const l of i)if(l.result.status==="valid")return l.result;for(const l of i)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;const o=i.map(l=>new kd(l.ctx.common.issues));return nr(r,{code:Et.invalid_union,unionErrors:o}),Yr}if(r.common.async)return Promise.all(n.map(async i=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const c of n){const u={...r,common:{...r.common,issues:[]},parent:null},d=c._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!i&&(i={result:d,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const l=o.map(c=>new kd(c));
vendor: 2,728 bytes, line 876
876return nr(r,{code:Et.invalid_union,unionErrors:l}),Yr}}get options(){return this._def.options}}D1.create=(t,e)=>new D1({options:t,typeName:Zr.ZodUnion,...bs(e)});function QF(t,e){const r=jh(t),n=jh(e);if(t===e)return{valid:!0,data:t};if(r===gr.object&&n===gr.object){const a=Is.objectKeys(e),i=Is.objectKeys(t).filter(l=>a.indexOf(l)!==-1),o={...t,...e};for(const l of i){const c=QF(t[l],e[l]);if(!c.valid)return{valid:!1};o[l]=c.data}return{valid:!0,data:o}}else if(r===gr.array&&n===gr.array){if(t.length!==e.length)return{valid:!1};const a=[];for(let i=0;i<t.length;i++){const o=t[i],l=e[i],c=QF(o,l);if(!c.valid)return{valid:!1};a.push(c.data)}return{valid:!0,data:a}}else return r===gr.date&&n===gr.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class T1 extends Ls{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=(i,o)=>{if(Y5(i)||Y5(o))return Yr;const l=QF(i.value,o.value);return l.valid?((Z5(i)||Z5(o))&&r.dirty(),{status:r.value,value:l.data}):(nr(n,{code:Et.invalid_intersection_types}),Yr)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}T1.create=(t,e,r)=>new T1({left:t,right:e,typeName:Zr.ZodIntersection,...bs(r)});class Xf extends Ls{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==gr.array)return nr(n,{code:Et.invalid_type,expected:gr.array,received:n.parsedType}),Yr;if(n.data.length<this._def.items.length)return nr(n,{code:Et.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Yr;!this._def.rest&&n.data.length>this._def.items.length&&(nr(n,{code:Et.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((o,l)=>{const c=this._def.items[l]||this._def.rest;return c?c._parse(new am(n,o,n.path,l)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>gl.mergeArray(r,o)):gl.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new Xf({...this._def,rest:e})}}Xf.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Xf({items:t,typeName:Zr.ZodTuple,rest:null,...bs(e)})};class iA extends Ls{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==gr.map)return nr(n,{code:Et.invalid_type,expected:gr.map,received:n.parsedType}),Yr;const a=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([l,c],u)=>
vendor: 4,124 bytes, line 876
876({key:a._parse(new am(n,l,n.path,[u,"key"])),value:i._parse(new am(n,c,n.path,[u,"value"]))}));if(n.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const c of o){const u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return Yr;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(u.value,d.value)}return{status:r.value,value:l}})}else{const l=new Map;for(const c of o){const u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return Yr;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),l.set(u.value,d.value)}return{status:r.value,value:l}}}}iA.create=(t,e,r)=>new iA({valueType:e,keyType:t,typeName:Zr.ZodMap,...bs(r)});class u0 extends Ls{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==gr.set)return nr(n,{code:Et.invalid_type,expected:gr.set,received:n.parsedType}),Yr;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(nr(n,{code:Et.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(nr(n,{code:Et.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const i=this._def.valueType;function o(c){const u=new Set;for(const d of c){if(d.status==="aborted")return Yr;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}const l=[...n.data.values()].map((c,u)=>i._parse(new am(n,c,n.path,u)));return n.common.async?Promise.all(l).then(c=>o(c)):o(l)}min(e,r){return new u0({...this._def,minSize:{value:e,message:br.toString(r)}})}max(e,r){return new u0({...this._def,maxSize:{value:e,message:br.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}u0.create=(t,e)=>new u0({valueType:t,minSize:null,maxSize:null,typeName:Zr.ZodSet,...bs(e)});class oA extends Ls{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}oA.create=(t,e)=>new oA({getter:t,typeName:Zr.ZodLazy,...bs(e)});class eS extends Ls{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return nr(r,{received:r.data,code:Et.invalid_literal,expected:this._def.value}),Yr}return{status:"valid",value:e.data}}get value(){return this._def.value}}eS.create=(t,e)=>new eS({value:t,typeName:Zr.ZodLiteral,...bs(e)});function II(t,e){return new ax({values:t,typeName:Zr.ZodEnum,...bs(e)})}class ax extends Ls{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return nr(r,{expected:Is.joinValues(n),received:r.parsedType,code:Et.invalid_type}),Yr}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),n=this._def.values;return nr(r,{received:r.data,code:Et.invalid_enum_value,options:n}),Yr}return Yl(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return ax.create(e,{...this._def,...r})}exclude(e,r=this._def){return ax.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}ax.create=II;class lA extends Ls{_parse(e){const r=Is.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==gr.string&&n.parsedType!==gr.number){const a=Is.objectValues(r);return nr(n,{expected:Is.joinValues(a),received:n.parsedType,code:Et.invalid_type}),Yr}if(this._cache||(this._cache=new Set(Is.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=Is.objectValues(r);return nr(n,{received:n.data,code:Et.invalid_enum_value,options:a}),Yr}return Yl(e.data)}get enum(){return this._def.values}}lA.create=(t,e)=>new lA({values:t,typeName:Zr.ZodNativeEnum,...bs(e)});class M1 extends Ls{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==gr.promise&&r.common.async===!1)return nr(r,{code:Et.invali
vendor: 4,075 bytes, line 876
876d_type,expected:gr.promise,received:r.parsedType}),Yr;const n=r.parsedType===gr.promise?r.data:Promise.resolve(r.data);return Yl(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}M1.create=(t,e)=>new M1({type:t,typeName:Zr.ZodPromise,...bs(e)});class ix extends Ls{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Zr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:o=>{nr(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async l=>{if(r.value==="aborted")return Yr;const c=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return c.status==="aborted"?Yr:c.status==="dirty"||r.value==="dirty"?Sy(c.value):c});{if(r.value==="aborted")return Yr;const l=this._def.schema._parseSync({data:o,path:n.path,parent:n});return l.status==="aborted"?Yr:l.status==="dirty"||r.value==="dirty"?Sy(l.value):l}}if(a.type==="refinement"){const o=l=>{const c=a.refinement(l,i);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?Yr:(l.status==="dirty"&&r.dirty(),o(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?Yr:(l.status==="dirty"&&r.dirty(),o(l.value).then(()=>({status:r.value,value:l.value}))))}if(a.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!sx(o))return Yr;const l=a.transform(o.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>sx(o)?Promise.resolve(a.transform(o.value,i)).then(l=>({status:r.value,value:l})):Yr);Is.assertNever(a)}}ix.create=(t,e,r)=>new ix({schema:t,typeName:Zr.ZodEffects,effect:e,...bs(r)});ix.createWithPreprocess=(t,e,r)=>new ix({schema:e,effect:{type:"preprocess",transform:t},typeName:Zr.ZodEffects,...bs(r)});class Yh extends Ls{_parse(e){return this._getType(e)===gr.undefined?Yl(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Yh.create=(t,e)=>new Yh({innerType:t,typeName:Zr.ZodOptional,...bs(e)});class ox extends Ls{_parse(e){return this._getType(e)===gr.null?Yl(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ox.create=(t,e)=>new ox({innerType:t,typeName:Zr.ZodNullable,...bs(e)});class tS extends Ls{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===gr.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}tS.create=(t,e)=>new tS({innerType:t,typeName:Zr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...bs(e)});class rS extends Ls{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return E1(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new kd(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new kd(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}rS.create=(t,e)=>new rS({innerType:t,typeName:Zr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...bs(e)});class cA extends Ls{_parse(e){if(this._getType(e)!==gr.nan){const n=this._getOrReturnCtx(e);
876return nr(n,{code:Et.invalid_type,expected:gr.nan,received:n.parsedType}),Yr}return{status:"valid",value:e.data}}}cA.create=t=>new cA({typeName:Zr.ZodNaN,...bs(t)});class _he extends Ls{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class Ak extends Ls{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Yr:i.status==="dirty"?(r.dirty(),Sy(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Yr:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,r){return new Ak({in:e,out:r,typeName:Zr.ZodPipeline})}}class sS extends Ls{_parse(e){const r=this._def.innerType._parse(e),n=a=>(sx(a)&&(a.value=Object.freeze(a.value)),a);return E1(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}}sS.create=(t,e)=>new sS({innerType:t,typeName:Zr.ZodReadonly,...bs(e)});var Zr;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Zr||(Zr={}));const sa=Uh.create,Ehe=nx.create;im.create;wu.create;const Dk=Fa.create;D1.create;T1.create;Xf.create;const Ahe=eS.create,Dhe=ax.create;M1.create;Yh.create;ox.create;const d0={async createRequest(t){try{const{data:e}=await Q.auth.getUser();if(!e.user)return{success:!1,error:"User not authenticated"};const{data:r,error:n}=await Q.from("profiles").select("user_type").eq("id",e.user.id).single();if(n)return console.error("Error fetching user profile:",n),{success:!1,error:"Failed to verify user permissions"};if(r.user_type==="residential")return{success:!1,error:"Ribbon cutting requests are only available for business members"};const{data:a,error:i}=await Q.from("ribbon_cutting_requests").insert({...t,created_by:e.user.id}).select().single();return i?(console.error("Error creating ribbon cutting request:",i),{success:!1,error:i.message}):{success:!0,data:a}}catch(e){return console.error("Error creating ribbon cutting request:",e),{success:!1,error:"Failed to create request"}}},async getUserRequests(){try{const{data:t}=await Q.auth.getUser();if(!t.user)return{success:!1,error:"User not authenticated"};const{data:e,error:r}=await Q.from("ribbon_cutting_requests").select("*").eq("created_by",t.user.id).order("created_at",{ascending:!1});return r?(console.error("Error fetching user ribbon cutting requests:",r),{success:!1,error:r.message}):{success:!0,data:e||[]}}catch(t){return console.error("Error fetching user ribbon cutting requests:",t),{success:!1,error:"Failed to fetch requests"}}},async getAllRequests(t){try{let e=Q.from("ribbon_cutting_requests").select("*");t&&(e=e.eq("status",t));const{data:r,error:n}=await e.order("created_at",{ascending:!1});return n?(console.error("Error fetching all ribbon cutting requests:",n),{success:!1,error:n.message}):{success:!0,data:r||[]}}catch(e){return console.error("Error fetching all ribbon cutting requests:",e),{success:!1,error:"Failed to fetch requests"}}},async updateRequest(t,e){try{const{data:r}=await Q.auth.getUser();if(!r.user)return{success:!1,error:"User not authenticated"};const n={...e,reviewed_by:r.user.id},{data:a,error:i}=await Q.from("ribbon_cutting_requests").update(n).eq("id",t).select().single();return i?(console.error("Error updating ribbon cutting request:",i),{success:!1,error:i.message}):{success:!0,data:a}}catch(r){return console.error("Error updating ribbon cutting request:",r),{success:!1,error:"Failed to update request"}}},async getRequestById(t){try{const{data:e,error:r}=await Q.from("ribbon_cutting_requests").select("*").eq("id",t).single();return r?(console.error("Error fetching ribbon cutting request:",r),{success:!1,error:r.message}):{success:!0,data:e}}catch(e){return console.error("Error fetching ribbon cutting request:",e),{success:!1,error:"Failed to fetch request"}}},async getStats(){try{const{data:t,error:e}=await Q.from("ribbon_cutting_requests").select("status");return e?(console.error("Error fetching ribbon cutting stats:",e),{success:!1,error:e.message}):{success:!0,data:{total:t.length,pending:t.filter(n=>n.status==="pending").length,in_progress:t.filter(n=>n.status==="in_progress").length,approved:t.filter(n=>n.status==="approved").length,completed:t.filter(n=>n.status==="completed").length}}}catch(t){return console.error("Error fetching ribbon cutting stats:",t),{success:!1,error:"Failed to fetch stats"}}}}
876,The=Dk({business_name:sa().min(1,"Business name is required"),contact_person:sa().min(1,"Contact person is required"),email:sa().email("Valid email is required"),phone:sa().optional(),business_address:sa().min(1,"Business address is required"),preferred_date:sa().optional(),preferred_time:sa().optional(),alternative_date:sa().optional(),alternative_time:sa().optional(),event_description:sa().optional(),expected_attendees:Ehe().min(1,"Expected attendees must be at least 1").optional(),special_requirements:sa().optional()}),Mhe=({onSuccess:t})=>{const[e,r]=x.useState(!1),{register:n,handleSubmit:a,formState:{errors:i},reset:o}=K0({resolver:Ek(The)}),l=async c=>{r(!0);try{const u={business_name:c.business_name,contact_person:c.contact_person,email:c.email,business_address:c.business_address,phone:c.phone,preferred_date:c.preferred_date,preferred_time:c.preferred_time,alternative_date:c.alternative_date,alternative_time:c.alternative_time,event_description:c.event_description,special_requirements:c.special_requirements,expected_attendees:c.expected_attendees||void 0},d=await d0.createRequest(u);d.success?(ct.success("Ribbon cutting request submitted successfully!"),o(),t==null||t()):ct.error(d.error||"Failed to submit request")}catch(u){console.error("Error submitting ribbon cutting request:",u),ct.error("Failed to submit request")}finally{r(!1)}};return s.jsxs(De,{className:"max-w-4xl mx-auto",children:[s.jsxs(ot,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(zl,{className:"h-6 w-6 text-chamber-blue"}),s.jsx(ut,{children:"Ribbon Cutting Request"})]}),s.jsx(us,{children:"Request a ribbon cutting ceremony for your new business or grand opening."})]}),s.jsx(Be,{children:s.jsxs("form",{onSubmit:a(l),className:"space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("h3",{className:"text-lg font-semibold flex items-center gap-2",children:[s.jsx(_n,{className:"h-5 w-5"}),"Business Information"]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"business_name",className:"mb-2 block",children:"Business Name *"}),s.jsx(Ne,{id:"business_name",...n("business_name"),placeholder:"Enter business name"}),i.business_name&&s.jsx("p",{className:"text-sm text-red-500 mt-1",children:i.business_name.message})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"contact_person",className:"mb-2 block",children:"Contact Person *"}),s.jsx(Ne,{id:"contact_person",...n("contact_person"),placeholder:"Enter contact person name"}),i.contact_person&&s.jsx("p",{className:"text-sm text-red-500 mt-1",children:i.contact_person.message})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"email",className:"mb-2 block",children:"Email *"}),s.jsx(Ne,{id:"email",type:"email",...n("email"),placeholder:"Enter email address"}),i.email&&s.jsx("p",{className:"text-sm text-red-500 mt-1",children:i.email.message})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"phone",className:"mb-2 block",children:"Phone"}),s.jsx(Ne,{id:"phone",...n("phone"),placeholder:"Enter phone number"})]})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"business_address",className:"mb-2 block",children:"Business Address *"}),s.jsx(zt,{id:"business_address",...n("business_address"),placeholder:"Enter complete business address",rows:2}),i.business_address&&s.jsx("p",{className:"text-sm text-red-500 mt-1",children:i.business_address.message})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("h3",{className:"text-lg font-semibold flex items-center gap-2",children:[s.jsx(Br,{className:"h-5 w-5"}),"Event Details"]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"preferred_date",className:"mb-2 block",children:"Preferred Date"}),s.jsx(Ne,{id:"preferred_date",type:"date",...n("preferred_date")})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"preferred_time",className:"mb-2 block",children:"Preferred Time"}),s.jsx(Ne,{id:"preferred_time",type:"time",...n("preferred_time")})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"alternative_date",className:"mb-2 block",children:"Alternative Date"}),s.jsx(Ne,{id:"alternative_date",type:"date",...n("alternative_date")})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"alternative_time",className:"mb-2 block",children:"Alternative Time"}),s.jsx(Ne,{id:"alternative_time",type:"time",...n("alternative_time")}
876)]})]}),s.jsxs("div",{children:[s.jsxs(Z,{htmlFor:"expected_attendees",className:"flex items-center gap-2 mb-2",children:[s.jsx(Os,{className:"h-4 w-4"}),"Expected Attendees"]}),s.jsx(Ne,{id:"expected_attendees",type:"number",min:"1",...n("expected_attendees",{valueAsNumber:!0}),placeholder:"Estimated number of attendees"})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"event_description",className:"mb-2 block",children:"Event Description"}),s.jsx(zt,{id:"event_description",...n("event_description"),placeholder:"Describe your ribbon cutting event, any special themes, or additional details",rows:3})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"special_requirements",className:"mb-2 block",children:"Special Requirements"}),s.jsx(zt,{id:"special_requirements",...n("special_requirements"),placeholder:"Any special requirements, accessibility needs, or additional services needed",rows:3})]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsx(Y,{type:"submit",disabled:e,className:"bg-chamber-blue hover:bg-chamber-blue-dark",children:e?"Submitting...":"Submit Request"})})]})})]})},Phe=()=>{const{isAuthenticated:t}=ts(),{isResidential:e,isLoading:r}=KC(),n=ks(),a=()=>{n("/dashboard")};return r?s.jsx("div",{className:"container-wrapper py-8",children:s.jsx("div",{className:"max-w-4xl mx-auto",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-chamber-blue mx-auto"}),s.jsx("p",{className:"mt-2 text-gray-600",children:"Loading..."})]})})}):t&&e?s.jsx("div",{className:"container-wrapper py-8",children:s.jsxs("div",{className:"max-w-4xl mx-auto",children:[s.jsxs("div",{className:"text-center mb-8",children:[s.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Ribbon Cutting Ceremonies"}),s.jsx("p",{className:"text-lg text-gray-600",children:"Celebrate business milestones with official Chamber ribbon cutting ceremonies"})]}),s.jsxs(De,{className:"mb-8",children:[s.jsxs(ot,{children:[s.jsxs(ut,{className:"flex items-center gap-2",children:[s.jsx(Ts,{className:"h-6 w-6 text-amber-500"}),"Business Feature Only"]}),s.jsx(us,{children:"Ribbon cutting ceremonies are available exclusively for business members."})]}),s.jsxs(Be,{children:[s.jsx("p",{className:"text-gray-600 mb-4",children:"This feature is designed for businesses to celebrate grand openings, expansions, and other significant milestones. If you own a business and would like to request a ribbon cutting ceremony, please create a business account."}),s.jsxs("div",{className:"flex gap-4",children:[s.jsx(Y,{onClick:()=>n("/dashboard"),className:"bg-chamber-blue hover:bg-chamber-blue-dark",children:"Return to Dashboard"}),s.jsx(Y,{onClick:()=>n("/businesses"),variant:"outline",children:"View Business Directory"})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8",children:[s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs(ut,{className:"flex items-center gap-2",children:[s.jsx(ri,{className:"h-5 w-5 text-chamber-gold"}),"What We Provide"]})}),s.jsx(Be,{children:s.jsxs("ul",{className:"space-y-2 text-sm",children:[s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx(Or,{className:"h-4 w-4 text-green-500"}),"Official Chamber ribbon and scissors"]}),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx(Or,{className:"h-4 w-4 text-green-500"}),"Chamber representative attendance"]}),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx(Or,{className:"h-4 w-4 text-green-500"}),"Professional photography"]}),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx(Or,{className:"h-4 w-4 text-green-500"}),"Social media promotion"]}),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx(Or,{className:"h-4 w-4 text-green-500"}),"Press release assistance"]})]})})]}),s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs(ut,{className:"flex items-center gap-2",children:[s.jsx(rn,{className:"h-5 w-5 text-chamber-blue"}),"Process Timeline"]})}),s.jsx(Be,{children:s.jsxs("ul",{className:"space-y-2 text-sm",children:[s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-2 h-2 bg-chamber-blue rounded-full"}),"Submit your request online"]}),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-2 h-2 bg-chamber-blue rounded-full"}),"Chamber staff reviews within 2-3 business days"]}),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-2 h-2 bg-chamber-blue rounded-full"}),"Schedule confirmation and details"]}
876),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-2 h-2 bg-chamber-blue rounded-full"}),"Event coordination and promotion"]}),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-2 h-2 bg-chamber-blue rounded-full"}),"Your special day!"]})]})})]})]})]})}):t?s.jsx("div",{className:"container-wrapper py-8",children:s.jsxs("div",{className:"max-w-4xl mx-auto",children:[s.jsxs("div",{className:"text-center mb-8",children:[s.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Request a Ribbon Cutting Ceremony"}),s.jsx("p",{className:"text-lg text-gray-600",children:"Celebrate your business milestone with an official Chamber ribbon cutting ceremony"})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-8",children:[s.jsxs(De,{children:[s.jsxs(ot,{className:"text-center",children:[s.jsx(zl,{className:"h-8 w-8 text-chamber-blue mx-auto mb-2"}),s.jsx(ut,{className:"text-lg",children:"Official Ceremony"})]}),s.jsx(Be,{className:"text-center",children:s.jsx("p",{className:"text-sm text-gray-600",children:"Professional ribbon cutting with Chamber officials and community leaders"})})]}),s.jsxs(De,{children:[s.jsxs(ot,{className:"text-center",children:[s.jsx(Br,{className:"h-8 w-8 text-chamber-blue mx-auto mb-2"}),s.jsx(ut,{className:"text-lg",children:"Flexible Scheduling"})]}),s.jsx(Be,{className:"text-center",children:s.jsx("p",{className:"text-sm text-gray-600",children:"We work with your schedule to find the perfect date and time"})})]}),s.jsxs(De,{children:[s.jsxs(ot,{className:"text-center",children:[s.jsx(Os,{className:"h-8 w-8 text-chamber-blue mx-auto mb-2"}),s.jsx(ut,{className:"text-lg",children:"Community Event"})]}),s.jsx(Be,{className:"text-center",children:s.jsx("p",{className:"text-sm text-gray-600",children:"Invite the community to celebrate your business success"})})]})]}),s.jsx(Mhe,{onSuccess:a})]})}):s.jsx("div",{className:"container-wrapper py-8",children:s.jsxs("div",{className:"max-w-4xl mx-auto",children:[s.jsxs("div",{className:"text-center mb-8",children:[s.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Ribbon Cutting Ceremonies"}),s.jsx("p",{className:"text-lg text-gray-600",children:"Celebrate your business milestone with an official Chamber ribbon cutting ceremony"})]}),s.jsxs(De,{className:"mb-8",children:[s.jsxs(ot,{children:[s.jsxs(ut,{className:"flex items-center gap-2",children:[s.jsx(zl,{className:"h-6 w-6 text-chamber-blue"}),"Authentication Required"]}),s.jsx(us,{children:"Please log in to submit a ribbon cutting request."})]}),s.jsx(Be,{children:s.jsxs("div",{className:"flex gap-4",children:[s.jsx(Y,{onClick:()=>n("/auth/login"),className:"bg-chamber-blue hover:bg-chamber-blue-dark",children:"Log In"}),s.jsx(Y,{onClick:()=>n("/auth/signup"),variant:"outline",children:"Sign Up"})]})})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 mb-8",children:[s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs(ut,{className:"flex items-center gap-2",children:[s.jsx(ri,{className:"h-5 w-5 text-chamber-gold"}),"What We Provide"]})}),s.jsx(Be,{children:s.jsxs("ul",{className:"space-y-2 text-sm",children:[s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx(Or,{className:"h-4 w-4 text-green-500"}),"Official Chamber ribbon and scissors"]}),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx(Or,{className:"h-4 w-4 text-green-500"}),"Chamber representative attendance"]}),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx(Or,{className:"h-4 w-4 text-green-500"}),"Professional photography"]}),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx(Or,{className:"h-4 w-4 text-green-500"}),"Social media promotion"]}),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx(Or,{className:"h-4 w-4 text-green-500"}),"Press release assistance"]})]})})]}),s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs(ut,{className:"flex items-center gap-2",children:[s.jsx(rn,{className:"h-5 w-5 text-chamber-blue"}),"Process Timeline"]})}),s.jsx(Be,{children:s.jsxs("ul",{className:"space-y-2 text-sm",children:[s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-2 h-2 bg-chamber-blue rounded-full"}),"Submit your request online"]}),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-2 h-2 bg-chamber-blue rounded-full"}),"Chamber staff reviews within 2-3 business days"]}),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-2 h-2 bg-chamber-blue rounded-full"}),"Schedule confirmation and details"]}
876),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-2 h-2 bg-chamber-blue rounded-full"}),"Event coordination and promotion"]}),s.jsxs("li",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-2 h-2 bg-chamber-blue rounded-full"}),"Your special day!"]})]})})]})]})]})})},Rhe=()=>{const[t,e]=Td(),r=t.get("tab"),n=t.get("page"),a=n?parseInt(n,10):1,[i,o]=x.useState(a),[l,c]=x.useState(a),[u,d]=x.useState(r==="past"?"past":"upcoming"),[h,f]=x.useState([]),[m,g]=x.useState([]),[y,b]=x.useState(0),[w,j]=x.useState(0),[N,S]=x.useState(!0),E=12;x.useEffect(()=>{r==="past"?d("past"):r==="upcoming"&&d("upcoming")},[r]),x.useEffect(()=>{const U=new URLSearchParams(t);u==="upcoming"?U.set("page",i.toString()):U.set("page",l.toString()),U.set("tab",u),e(U)},[i,l,u,e,t]);const C=async()=>{S(!0),console.log("Fetching events with pagination:",{activeTab:u,upcomingPage:i,pastPage:l,eventsPerPage:E});try{const U=await Mf({upcoming:!0,limit:E,page:i});console.log("Upcoming events fetched:",U.events.length,"Total:",U.count),f(U.events),b(U.count);const I=await Mf({upcoming:!1,limit:E,page:l});console.log("Past events fetched:",I.events.length,"Total:",I.count),g(I.events),j(I.count)}catch(U){console.error("Failed to fetch events:",U)}finally{S(!1)}};x.useEffect(()=>{C()},[i,l]);const T=Math.max(1,Math.ceil(y/E)),D=Math.max(1,Math.ceil(w/E));return{activeTab:u,upcomingEvents:h,pastEvents:m,isLoading:N,currentUpcomingPage:i,currentPastPage:l,totalUpcomingPages:T,totalPastPages:D,paginateUpcoming:U=>{o(U),window.scrollTo(0,0)},paginatePast:U=>{c(U),window.scrollTo(0,0)},handleTabChange:U=>{d(U)},handleDataChanged:()=>{console.log("Data changed, refreshing events..."),o(1),c(1),C()}}},Bhe=({onDataChanged:t})=>s.jsxs("div",{className:"text-center mb-8",children:[s.jsx("div",{className:"inline-flex items-center justify-center p-3 bg-chamber-blue-light text-chamber-blue-dark rounded-full mb-4",children:s.jsx(Br,{size:24})}),s.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Chamber Events"}),s.jsx("p",{className:"max-w-2xl mx-auto text-gray-600 text-lg mb-6",children:"Join us for upcoming events, workshops, and networking opportunities designed to help your business grow."})]}),uA=({events:t,currentPage:e,totalPages:r,onPageChange:n,isLoading:a,emptyMessage:i,emptyDescription:o})=>{const l=()=>s.jsx("div",{className:"grid md:grid-cols-3 gap-6 mb-8",children:Array.from({length:6}).map((u,d)=>s.jsxs("div",{className:"flex flex-col rounded-lg overflow-hidden border h-full",children:[s.jsx(cs,{className:"h-[200px] w-full"}),s.jsxs("div",{className:"p-4 space-y-3",children:[s.jsx(cs,{className:"h-6 w-2/3"}),s.jsx(cs,{className:"h-4 w-1/2"}),s.jsx(cs,{className:"h-4 w-4/5"}),s.jsx(cs,{className:"h-20 w-full"})]}),s.jsx("div",{className:"p-4 mt-auto",children:s.jsx(cs,{className:"h-10 w-full"})})]},d))}),c=Array.from({length:r},(u,d)=>d+1);return a?l():t.length===0?s.jsxs("div",{className:"text-center py-10 bg-gray-50 rounded-lg",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-700",children:i}),s.jsx("p",{className:"text-gray-600 mt-2",children:o})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid md:grid-cols-3 gap-6 mb-8",children:t.map(u=>s.jsx(vR,{event:u},u.id))}),r>1&&s.jsx(Pd,{children:s.jsxs(Rd,{children:[e>1&&s.jsx(Qr,{children:s.jsx(Bd,{onClick:()=>n(e-1)})}),c.map(u=>s.jsx(Qr,{children:s.jsx(ca,{onClick:()=>n(u),isActive:e===u,children:u})},u)),e<r&&s.jsx(Qr,{children:s.jsx(Ld,{onClick:()=>n(e+1)})})]})})]})},Lhe=({activeTab:t,onTabChange:e,upcomingEvents:r,pastEvents:n,isLoading:a,currentUpcomingPage:i,currentPastPage:o,totalUpcomingPages:l,totalPastPages:c,paginateUpcoming:u,paginatePast:d})=>s.jsxs(sn,{value:t,onValueChange:e,className:"mb-6",children:[s.jsxs(Qs,{className:"grid w-full max-w-md mx-auto grid-cols-2",children:[s.jsx(Gt,{value:"upcoming",children:"Upcoming Events"}),s.jsx(Gt,{value:"past",children:"Past Events"})]}),s.jsx(Rt,{value:"upcoming",children:s.jsx(uA,{events:r,currentPage:i,totalPages:l,onPageChange:u,isLoading:a,emptyMessage:"No upcoming events found",emptyDescription:"Check back later or import mock data to see events."})}),s.jsx(Rt,{value:"past",children:s.jsx(uA,{events:n,currentPage:o,totalPages:c,onPageChange:d,isLoading:a,emptyMessage:"No past events found",emptyDescription:"Import mock data to see past events."})})]}),Ihe=()=>{const{activeTab:t,upcomingEvents:e,pastEvents:r,isLoading:n,currentUpcomingPage:a,currentPastPage:i,totalUpcomingPages:o,totalPastPages:l,paginateUpcoming:c,paginatePast:u,handleTabChange:d,handleDataChanged:h}=Rhe();return s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsx(Bhe,{onDataChanged:h}),s.jsx(Lhe,{activeTab:t,onTabChange:d,upcomingEvents:e,pastEvents:r,isLoading:n,currentUpcomingPage:a,currentPastPage:i,totalUpcomingPages:o,totalPastPages:l,paginateUpcoming:c,paginatePast:u})]})})},Ohe=()=>s.jsx(Ihe,{}),zhe=()=>{const t=ks();return s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs(Y,{variant:"ghost",onClick:()=>t("/events"),className:"mb-6 text-chamber-blue hover:text-chamber-blue-dark",children:[s.jsx(pn,{size:16,className:"mr-2"}),"Back to Events"]}),s.jsxs("div",{className:"flex flex-col lg:flex-row gap-8 mb-8",children:[s.jsx("div",{className:"w-full lg:w-2/3",children:s.jsx(cs,{className:"h-80 w-full rounded-lg mb-4"})}),s.jsx("div",{className:"w-full lg:w-1/3",children:s.jsx(cs,{className:"h-96 w-full rounded-lg"})})]}),s.jsxs("div",{className:"grid md:grid-cols-3 gap-8",children:[s.jsxs("div",{className:"md:col-span-2",children:[s.jsx(cs,{className:"h-10 w-3/4 mb-4"}),s.jsx(cs,{className:"h-20 w-full mb-4"}),s.jsx(cs,{className:"h-40 w-full"})]}),s.jsxs("div",{className:"md:col-span-1",children:[s.jsx(cs,{className:"h-10 w-full mb-4"}),s.jsx(cs,{className:"h-28 w-full mb-4"}),s.jsx(cs,{className:"h-28 w-full mb-4"}),s.jsx(cs,{className:"h-28 w-full"})]})]})]})})},Uhe=()=>{const t=ks();return s.jsxs("div",{className:"container-wrapper py-12 text-center",children:[s.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Event Not Found"}),s.jsx("p",{className:"mb-6",children:"The event you're looking for doesn't exist or has been removed."}),s.jsxs(Y,{onClick:()=>t("/events"),children:[s.jsx(pn,{size:16,className:"mr-2"}),"Back to Events"]})]})},Hhe=({event:t,isPastEvent:e})=>{const[r,n]=x.useState(!1);return s.jsxs("div",{className:"w-full lg:w-2/3",children:[s.jsx("div",{className:"relative h-64 sm:h-80 md:h-96 bg-gray-200 rounded-lg overflow-hidden mb-4",children:t.imageUrl?s.jsxs(Tt,{open:r,onOpenChange:n,children:[s.jsx(Aw,{asChild:!0,children:s.jsx("img",{src:t.imageUrl,alt:t.title,className:"w-full h-full object-contain bg-gray-100 cursor-pointer hover:opacity-90 transition-opacity"})}),s.jsx(Dt,{className:"max-w-6xl max-h-[95vh] p-0 bg-transparent border-none shadow-none [&>button]:text-white [&>button]:hover:text-gray-200",children:s.jsx("div",{className:"relative flex items-center justify-center min-h-[60vh] max-h-[95vh]",children:s.jsx("img",{src:t.imageUrl,alt:t.title,className:"max-w-full max-h-full object-contain",onClick:()=>n(!1)})})})]}):s.jsx("div",{className:"w-full h-full flex items-center justify-center bg-chamber-blue-light",children:s.jsx(Br,{size:64,className:"text-chamber-blue"})})}),e&&s.jsx("div",{className:"inline-block bg-amber-100 text-amber-800 text-sm font-medium px-3 py-1 rounded-full mb-4",children:"Past Event"})]})},$he=t=>{const e="https://calendar.google.com/calendar/render",r=o=>o.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),n=r(t.startDate),a=r(t.endDate),i=new URLSearchParams({action:"TEMPLATE",text:t.title,dates:`${n}/${a}`,details:t.description||"",location:t.location||"",...t.url&&{url:t.url}});return`${e}?${i.toString()}`},Whe=t=>{const e=$he(t);window.open(e,"_blank","noopener,noreferrer")},qhe=(t,e,r)=>
876({title:t.title,description:t.description||"",location:t.location||"",startDate:new Date(e),endDate:new Date(r),url:t.event_website}),Ghe=({event:t,isPastEvent:e})=>{const{user:r,isAuthenticated:n}=ts(),a=ks(),i=Wi(),{toast:o}=St(),[l,c]=x.useState(!1),[u,d]=x.useState(!1),[h,f]=x.useState(null);x.useEffect(()=>{(async()=>{if(n&&r&&t.id){const j=await ire(t.id,r.id);c(j.isRegistered),f(j.status||null)}})()},[n,r,t.id]);const m=async()=>{if(!n){o({title:"Authentication Required",description:"Please log in to register for events",variant:"destructive"}),a(`/login?redirect=${encodeURIComponent(i.pathname)}`);return}d(!0);try{if(l&&h!=="canceled"){const w=await are(t.id,r.id);w.success?(c(!1),f("canceled"),Ia.cancelEventRegistration(t.id,t.title,t.date),o({title:"Registration Canceled",description:w.message})):o({title:"Error",description:w.message,variant:"destructive"})}else{const w=await nre(t.id,r.id);w.success?(c(!0),f("confirmed"),Ia.registerForEvent(t.id,t.title,t.date,"standard"),o({title:"Success",description:w.message})):o({title:"Error",description:w.message,variant:"destructive"})}}catch(w){console.error("Error handling event registration:",w),o({title:"Error",description:"An unexpected error occurred",variant:"destructive"})}finally{d(!1)}},g=()=>{if(u)return"Processing...";if(l){if(h==="confirmed")return"Cancel Registration";if(h==="canceled")return"Register Again";if(h==="waiting")return"On Waiting List"}return"Register for Event"},y=()=>l&&h==="confirmed"?"outline":"default",b=()=>{if(!t.rawStartDate||!t.rawEndDate){o({title:"Error",description:"Unable to add event to calendar. Date information is not available.",variant:"destructive"});return}try{const w=qhe({title:t.title,description:t.description,location:t.location,event_website:t.event_website},t.rawStartDate,t.rawEndDate);Ia.clickEventCTA(t.id,t.title,"add_to_calendar"),Whe(w),o({title:"Opening Google Calendar",description:"The event will be added to your Google Calendar."})}catch(w){console.error("Error adding event to calendar:",w),o({title:"Error",description:"Unable to add event to calendar. Please try again.",variant:"destructive"})}};return s.jsx(De,{className:"h-full",children:s.jsxs(Be,{className:"pt-6",children:[s.jsx("h2",{className:"text-2xl font-bold mb-6",children:"Event Details"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(Br,{size:20,className:"mt-1 text-chamber-blue"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Date"}),s.jsx("p",{className:"text-gray-600",children:t.date})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(rn,{size:20,className:"mt-1 text-chamber-blue"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Time"}),s.jsx("p",{className:"text-gray-600",children:t.time})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(_n,{size:20,className:"mt-1 text-chamber-blue"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Location"}),s.jsx("p",{className:"text-gray-600",children:t.location})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(ma,{size:20,className:"mt-1 text-chamber-blue"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Organizer"}),s.jsx("p",{className:"text-gray-600",children:t.organization_name||"Chamber of Commerce"})]})]}),t.event_type&&s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(ji,{size:20,className:"mt-1 text-chamber-blue"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Event Type"}),s.jsx("p",{className:"text-gray-600 capitalize",children:t.event_type})]})]}),t.ticket_price!==void 0&&t.ticket_price!==null&&s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(yu,{size:20,className:"mt-1 text-chamber-blue"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Ticket Price"}),s.jsx("p",{className:"text-gray-600",children:t.ticket_price===0?"Free":`$${t.ticket_price.toFixed(2)}`})]})]}),s.jsxs("div",{className:"pt-4",children:[e?s.jsx(Y,{className:"w-full",variant:"outline",disabled:!0,children:"Event Completed"}):s.jsx(Y,{className:`w-full ${y()==="default"?"bg-chamber-blue hover:bg-chamber-blue-dark":""}`,variant:y(),onClick:()=>{Ia.clickEventCTA(t.id,t.title,"register"),m()},disabled:u||l&&h==="waiting",children:g()}),s.jsxs(Y,{variant:"outline",className:"w-full mt-3",onClick:()=>{Ia.clickEventCTA(t.id,t.title,"share"),Ia.shareEvent(t.id,t.title,"button_click");const w=window.location.href;navigator.clipboard.writeText(w).then(()=>{o({title:"Link Copied!",description:"Event link has been copied to your clipboard."})}).catch(()=>{o({title:"Share Event",description:`Event: ${t.title} - ${w}`})})},children:[s.jsx(bC,{size:16,className:"mr-2"}),"Share Event"]}),s.jsxs(Y,{variant:"outline",className:"w-full mt-3",onClick:b,children:[s.jsx(BV,{size:16,className:"mr-2"}),"Add to Google Calendar"]})]})]})]})})};function Vhe(t,e){const r={};return(t[t.length-1]===""?[...t,""]:t).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const Khe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Jhe=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Yhe={};function dA(t,e){return(Yhe.jsx?Jhe:Khe).test(t)}const Zhe=/[ \t\n\f\r]/g;function Xhe(t){return typeof t=="object"?t.type==="text"?hA(t.value):!1:hA(t)}function hA(t){return t.replace(Zhe,"")===""}let Y0=class{constructor(e,r,n){this.normal=r,this.property=e,n&&(this.space=n)}};Y0.prototype.normal={};Y0.prototype.property={};Y0.prototype.space=void 0;function OI(t,e){const r={},n={};for(const a of t)Object.assign(r,a.property),Object.assign(n,a.normal);return new Y0(r,n,e)}function nS(t){return t.toLowerCase()}class Oo{constructor(e,r){this.attribute=r,this.property=e}}Oo.prototype.attribute="";Oo.prototype.booleanish=!1;Oo.prototype.boolean=!1;Oo.prototype.commaOrSpaceSeparated=!1;Oo.prototype.commaSeparated=!1;Oo.prototype.defined=!1;Oo.prototype.mustUseProperty=!1;Oo.prototype.number=!1;Oo.prototype.overloadedBoolean=!1;Oo.prototype.property="";Oo.prototype.spaceSeparated=!1;Oo.prototype.space=void 0;let Qhe=0;
vendor: 4,642 bytes, line 876
876const ls=pp(),Na=pp(),aS=pp(),kt=pp(),fn=pp(),kg=pp(),al=pp();function pp(){return 2**++Qhe}const iS=Object.freeze(Object.defineProperty({__proto__:null,boolean:ls,booleanish:Na,commaOrSpaceSeparated:al,commaSeparated:kg,number:kt,overloadedBoolean:aS,spaceSeparated:fn},Symbol.toStringTag,{value:"Module"})),U2=Object.keys(iS);class Tk extends Oo{constructor(e,r,n,a){let i=-1;if(super(e,r),mA(this,"space",a),typeof n=="number")for(;++i<U2.length;){const o=U2[i];mA(this,U2[i],(n&iS[o])===iS[o])}}}Tk.prototype.defined=!0;function mA(t,e,r){r&&(t[e]=r)}function Bx(t){const e={},r={};for(const[n,a]of Object.entries(t.properties)){const i=new Tk(n,t.transform(t.attributes||{},n),a,t.space);t.mustUseProperty&&t.mustUseProperty.includes(n)&&(i.mustUseProperty=!0),e[n]=i,r[nS(n)]=n,r[nS(i.attribute)]=n}return new Y0(e,r,t.space)}const zI=Bx({properties:{ariaActiveDescendant:null,ariaAtomic:Na,ariaAutoComplete:null,ariaBusy:Na,ariaChecked:Na,ariaColCount:kt,ariaColIndex:kt,ariaColSpan:kt,ariaControls:fn,ariaCurrent:null,ariaDescribedBy:fn,ariaDetails:null,ariaDisabled:Na,ariaDropEffect:fn,ariaErrorMessage:null,ariaExpanded:Na,ariaFlowTo:fn,ariaGrabbed:Na,ariaHasPopup:null,ariaHidden:Na,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:fn,ariaLevel:kt,ariaLive:null,ariaModal:Na,ariaMultiLine:Na,ariaMultiSelectable:Na,ariaOrientation:null,ariaOwns:fn,ariaPlaceholder:null,ariaPosInSet:kt,ariaPressed:Na,ariaReadOnly:Na,ariaRelevant:null,ariaRequired:Na,ariaRoleDescription:fn,ariaRowCount:kt,ariaRowIndex:kt,ariaRowSpan:kt,ariaSelected:Na,ariaSetSize:kt,ariaSort:null,ariaValueMax:kt,ariaValueMin:kt,ariaValueNow:kt,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function UI(t,e){return e in t?t[e]:e}function HI(t,e){return UI(t,e.toLowerCase())}const eme=Bx({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:kg,acceptCharset:fn,accessKey:fn,action:null,allow:null,allowFullScreen:ls,allowPaymentRequest:ls,allowUserMedia:ls,alt:null,as:null,async:ls,autoCapitalize:null,autoComplete:fn,autoFocus:ls,autoPlay:ls,blocking:fn,capture:null,charSet:null,checked:ls,cite:null,className:fn,cols:kt,colSpan:null,content:null,contentEditable:Na,controls:ls,controlsList:fn,coords:kt|kg,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ls,defer:ls,dir:null,dirName:null,disabled:ls,download:aS,draggable:Na,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ls,formTarget:null,headers:fn,height:kt,hidden:aS,high:kt,href:null,hrefLang:null,htmlFor:fn,httpEquiv:fn,id:null,imageSizes:null,imageSrcSet:null,inert:ls,inputMode:null,integrity:null,is:null,isMap:ls,itemId:null,itemProp:fn,itemRef:fn,itemScope:ls,itemType:fn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ls,low:kt,manifest:null,max:null,maxLength:kt,media:null,method:null,min:null,minLength:kt,multiple:ls,muted:ls,name:null,nonce:null,noModule:ls,noValidate:ls,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:ls,optimum:kt,pattern:null,ping:fn,placeholder:null,playsInl
876ine:ls,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ls,referrerPolicy:null,rel:fn,required:ls,reversed:ls,rows:kt,rowSpan:kt,sandbox:fn,scope:null,scoped:ls,seamless:ls,selected:ls,shadowRootClonable:ls,shadowRootDelegatesFocus:ls,shadowRootMode:null,shape:null,size:kt,sizes:null,slot:null,span:kt,spellCheck:Na,src:null,srcDoc:null,srcLang:null,srcSet:null,start:kt,step:null,style:null,tabIndex:kt,target:null,title:null,translate:null,type:null,typeMustMatch:ls,useMap:null,value:Na,width:kt,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:fn,axis:null,background:null,bgColor:null,border:kt,borderColor:null,bottomMargin:kt,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ls,declare:ls,event:null,face:null,frame:null,frameBorder:null,hSpace:kt,leftMargin:kt,link:null,longDesc:null,lowSrc:null,marginHeight:kt,marginWidth:kt,noResize:ls,noHref:ls,noShade:ls,noWrap:ls,object:null,profile:null,prompt:null,rev:null,rightMargin:kt,rules:null,scheme:null,scrolling:Na,standby:null,summary:null,text:null,topMargin:kt,valueType:null,version:null,vAlign:null,vLink:null,vSpace:kt,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ls,disableRemotePlayback:ls,prefix:null,property:null,results:kt,security:null,unselectable:null},space:"html",transform:HI}),tme=Bx({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",colorRendering:"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
876-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:al,accentHeight:kt,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:kt,amplitude:kt,arabicForm:null,ascent:kt,attributeName:null,attributeType:null,azimuth:kt,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:kt,by:null,calcMode:null,capHeight:kt,className:fn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:kt,diffuseConstant:kt,direction:null,display:null,dur:null,divisor:kt,dominantBaseline:null,download:ls,dx:null,dy:null,edgeMode:null,editable:null,elevation:kt,enableBackground:null,end:null,event:null,exponent:kt,externalResourcesRequired:null,fill:null,fillOpacity:kt,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:kg,g2:kg,glyphName:kg,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:kt,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:kt,horizOriginX:kt,horizOriginY:kt,id:null,ideographic:kt,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:kt,k:kt,k1:kt,k2:kt,k3:kt,k4:kt,kernelMatrix:al,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:kt,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:kt,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,on
vendor: 5,558 bytes, lines 876-877
876Zoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:kt,overlineThickness:kt,paintOrder:null,panose1:null,path:null,pathLength:kt,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:fn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:kt,pointsAtY:kt,pointsAtZ:kt,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:al,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:al,rev:al,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:al,requiredFeatures:al,requiredFonts:al,requiredFormats:al,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:kt,specularExponent:kt,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:kt,strikethroughThickness:kt,string:null,stroke:null,strokeDashArray:al,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:kt,strokeOpacity:kt,strokeWidth:null,style:null,surfaceScale:kt,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:al,tabIndex:kt,tableValues:null,target:null,targetX:kt,targetY:kt,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:al,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:kt,underlineThickness:kt,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:kt,values:null,vAlphabetic:kt,vMathematical:kt,vectorEffect:null,vHanging:kt,vIdeographic:kt,version:null,vertAdvY:kt,vertOriginX:kt,vertOriginY:kt,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:kt,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:UI}),$I=Bx({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),WI=Bx({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:HI}),qI=Bx({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),rme={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"},sme=/[A-Z]/g,fA=/-[a-z]/g,nme=/^data[-\w.:]+$/i;function ame(t,e){const r=nS(e);let n=e,a=Oo;if(r in t.normal)return t.property[t.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&nme.test(e)){if(e.charAt(4)==="-"){const i=e.slice(5).replace(fA,ome);n="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=e.slice(4);if(!fA.test(i)){let o=i.replace(sme,ime);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}a=Tk}return new a(n,e)}function ime(t){return"-"+t.toLowerCase()}function ome(t){return t.charAt(1).toUpperCase()}const lme=OI([zI,eme,$I,WI,qI],"html"),Mk=OI([zI,tme,$I,WI,qI],"svg");function cme(t){return t.join(" ").trim()}var Pk={},pA=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ume=/\n/g,dme=/^\s*/,hme=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,mme=/^:\s*/,fme=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,pme=/^[;\s]*/,gme=/^\s+|\s+$/g,xme=` 877`,gA="/",xA="*",ff="",yme="comment",bme="declaration";function vme(t,e){if(typeof t!="string")throw new TypeError("First argument must be a string");if(!t)return[];e=e||{};var r=1,n=1;function a(g){var y=g.match(ume);y&&(r+=y.length);var b=g.lastIndexOf(xme);n=~b?g.length-b:n+g.length}function i(){var g={line:r,column:n};return function(y){return y.position=new o(g),u(),y}}function o(g){this.start=g,this.end={line:r,column:n},this.source=e.source}o.prototype.content=t;function l(g){var y=new Error(e.source+":"+r+":"+n+": "+g);if(y.reason=g,y.filename=e.source,y.line=r,y.column=n,y.source=t,!e.silent)throw y}function c(g){var y=g.exec(t);if(y){var b=y[0];return a(b),t=t.slice(b.length),y}}function u(){c(dme)}function d(g){var y;for(g=g||[];y=h();)y!==!1&&g.push(y);return g}function h(){var g=i();if(!(gA!=t.charAt(0)||xA!=t.charAt(1))){for(var y=2;ff!=t.charAt(y)&&(xA!=t.charAt(y)||gA!=t.charAt(y+1));)++y;if(y+=2,ff===t.charAt(y-1))return l("End of comment missing");var b=t.slice(2,y-2);return n+=2,a(b),t=t.slice(y),n+=2,g({type:yme,comment:b})}}function f(){var g=i(),y=c(hme);if(y){if(h(),!c(mme))return l("property missing ':'");var b=c(fme),w=g({type:bme,property:yA(y[0].replace(pA,ff)),value:b?yA(b[0].replace(pA,ff)):ff});return c(pme),w}}function m(){var g=[];d(g);for(var y;y=f();)y!==!1&&(g.push(y),d(g));return g}return u(),m()}function yA(t){return t?t.replace(gme,ff):ff}var wme=vme,jme=io&&io.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Pk,"__esModule",{value:!0});Pk.default=Fme;const Nme=jme(wme);function Fme(t,e){let r=null;if(!t||typeof t!="string")return r;const n=(0,Nme.default)(t),a=typeof e=="function";
vendor: 3,461 bytes, line 877
877return n.forEach(i=>{if(i.type!=="declaration")return;const{property:o,value:l}=i;a?e(o,l,i):l&&(r=r||{},r[o]=l)}),r}var Gw={};Object.defineProperty(Gw,"__esModule",{value:!0});Gw.camelCase=void 0;var Sme=/^--[a-zA-Z0-9_-]+$/,Cme=/-([a-z])/g,kme=/^[^-]+$/,_me=/^-(webkit|moz|ms|o|khtml)-/,Eme=/^-(ms)-/,Ame=function(t){return!t||kme.test(t)||Sme.test(t)},Dme=function(t,e){return e.toUpperCase()},bA=function(t,e){return"".concat(e,"-")},Tme=function(t,e){return e===void 0&&(e={}),Ame(t)?t:(t=t.toLowerCase(),e.reactCompat?t=t.replace(Eme,bA):t=t.replace(_me,bA),t.replace(Cme,Dme))};Gw.camelCase=Tme;var Mme=io&&io.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Pme=Mme(Pk),Rme=Gw;function oS(t,e){var r={};return!t||typeof t!="string"||(0,Pme.default)(t,function(n,a){n&&a&&(r[(0,Rme.camelCase)(n,e)]=a)}),r}oS.default=oS;var Bme=oS;const Lme=iC(Bme),GI=VI("end"),Rk=VI("start");function VI(t){return e;function e(r){const n=r&&r.position&&r.position[t]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function Ime(t){const e=Rk(t),r=GI(t);if(e&&r)return{start:e,end:r}}function Iy(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?vA(t.position):"start"in t||"end"in t?vA(t):"line"in t||"column"in t?lS(t):""}function lS(t){return wA(t&&t.line)+":"+wA(t&&t.column)}function vA(t){return lS(t&&t.start)+"-"+lS(t&&t.end)}function wA(t){return t&&typeof t=="number"?t:1}class qi extends Error{constructor(e,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let a="",i={},o=!1;if(r&&("line"in r&&"column"in r?i={place:r}:"start"in r&&"end"in r?i={place:r}:"type"in r?i={ancestors:[r],place:r.position}:i={...r}),typeof e=="string"?a=e:!i.cause&&e&&(o=!0,a=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n=="string"){const c=n.indexOf(":");c===-1?i.ruleId=n:(i.source=n.slice(0,c),i.ruleId=n.slice(c+1))}if(!i.place&&i.ancestors&&i.ancestors){const c=i.ancestors[i.ancestors.length-1];c&&(i.place=c.position)}const l=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=l?l.line:void 0,this.name=Iy(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=o&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}qi.prototype.file="";qi.prototype.name="";qi.prototype.reason="";qi.prototype.message="";qi.prototype.stack="";qi.prototype.column=void 0;qi.prototype.line=void 0;qi.prototype.ancestors=void 0;qi.prototype.cause=void 0;qi.prototype.fatal=void 0;qi.prototype.place=void 0;qi.prototype.ruleId=void 0;qi.prototype.source=void 0;const Bk={}.hasOwnProperty,Ome=new Map,zme=/[A-Z]/g,Ume=new Set(["table","tbody","thead","tfoot","tr"]),Hme=new Set(["td","th"]),KI="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $me(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=e.filePath||void 0;let n;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=Zme(r,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");
vendor: 10,587 bytes, line 877
877if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=Yme(r,e.jsx,e.jsxs)}const a={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:n,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Mk:lme,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},i=JI(a,t,void 0);return i&&typeof i!="string"?i:a.create(t,a.Fragment,{children:i||void 0},void 0)}function JI(t,e,r){if(e.type==="element")return Wme(t,e,r);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return qme(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Vme(t,e,r);if(e.type==="mdxjsEsm")return Gme(t,e);if(e.type==="root")return Kme(t,e,r);if(e.type==="text")return Jme(t,e)}function Wme(t,e,r){const n=t.schema;let a=n;e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(a=Mk,t.schema=a),t.ancestors.push(e);const i=ZI(t,e.tagName,!1),o=Xme(t,e);let l=Ik(t,e);return Ume.has(e.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!Xhe(c):!0})),YI(t,o,i,e),Lk(o,l),t.ancestors.pop(),t.schema=n,t.create(e,i,o,r)}function qme(t,e){if(e.data&&e.data.estree&&t.evaluater){const n=e.data.estree.body[0];return n.type,t.evaluater.evaluateExpression(n.expression)}h0(t,e.position)}function Gme(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);h0(t,e.position)}function Vme(t,e,r){const n=t.schema;let a=n;e.name==="svg"&&n.space==="html"&&(a=Mk,t.schema=a),t.ancestors.push(e);const i=e.name===null?t.Fragment:ZI(t,e.name,!0),o=Qme(t,e),l=Ik(t,e);return YI(t,o,i,e),Lk(o,l),t.ancestors.pop(),t.schema=n,t.create(e,i,o,r)}function Kme(t,e,r){const n={};return Lk(n,Ik(t,e)),t.create(e,t.Fragment,n,r)}function Jme(t,e){return e.value}function YI(t,e,r,n){typeof r!="string"&&r!==t.Fragment&&t.passNode&&(e.node=n)}function Lk(t,e){if(e.length>0){const r=e.length>1?e:e[0];r&&(t.children=r)}}function Yme(t,e,r){return n;function n(a,i,o,l){const u=Array.isArray(o.children)?r:e;return l?u(i,o,l):u(i,o)}}function Zme(t,e){return r;function r(n,a,i,o){const l=Array.isArray(i.children),c=Rk(n);return e(a,i,o,l,{columnNumber:c?c.column-1:void 0,fileName:t,lineNumber:c?c.line:void 0},void 0)}}function Xme(t,e){const r={};let n,a;for(a in e.properties)if(a!=="children"&&Bk.call(e.properties,a)){const i=efe(t,a,e.properties[a]);if(i){const[o,l]=i;t.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Hme.has(e.tagName)?n=l:r[o]=l}}if(n){const i=r.style||(r.style={});i[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function Qme(t,e){const r={};for(const n of e.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&t.evaluater){const i=n.data.estree.body[0];i.type;const o=i.expression;o.type;const l=o.properties[0];l.type,Object.assign(r,t.evaluater.evaluateExpression(l.argument))}else h0(t,e.position);else{const a=n.name;let i;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&t.evaluater){const l=n.value.data.estree.body[0];l.type,i=t.evaluater.evaluateExpression(l.expression)}else h0(t,e.position);else i=n.value===null?!0:n.value;r[a]=i}return r}function Ik(t,e){const r=[];let n=-1;const a=t.passKeys?new Map:Ome;for(;++n<e.children.length;){const i=e.children[n];let o;if(t.passKeys){const c=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(c){const u=a.get(c)||0;o=c+"-"+u,a.set(c,u+1)}}const l=JI(t,i,o);l!==void 0&&r.push(l)}return r}function efe(t,e,r){const n=ame(t.schema,e);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=n.commaSeparated?Vhe(r):cme(r)),n.property==="style"){let a=typeof r=="object"?r:tfe(t,String(r));return t.stylePropertyNameCase==="css"&&(a=rfe(a)),["style",a]}return[t.elementAttributeNameCase==="react"&&n.space?rme[n.property]||n.property:n.attribute,r]}}function tfe(t,e){try{return Lme(e,{reactCompat:!0})}catch(r){if(t.ignoreInvalidStyle)return{};const n=r,a=new qi("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=t.filePath||void 0,a.url=KI+"#cannot-parse-style-attribute",a}}function ZI(t,e,r){let n;if(!r)n={type:"Literal",value:e};else if(e.includes(".")){const a=e.split(".");let i=-1,o;for(;++i<a.length;){const l=dA(a[i])?{type:"Identifier",name:a[i]}:{type:"Literal",value:a[i]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(i&&l.type==="Literal"),optional:!1}:l}n=o}else n=dA(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(n.type==="Literal"){const a=n.value;return Bk.call(t.components,a)?t.components[a]:a}if(t.evaluater)return t.evaluater.evaluateExpression(n);h0(t)}function h0(t,e){const r=new qi("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=t.filePath||void 0,r.url=KI+"#cannot-handle-mdx-estrees-without-createevaluater",r}function rfe(t){const e={};let r;for(r in t)Bk.call(t,r)&&(e[sfe(r)]=t[r]);return e}function sfe(t){let e=t.replace(zme,nfe);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function nfe(t){return"-"+t.toLowerCase()}const H2={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"]},afe={};function Ok(t,e){const r=afe,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,a=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return XI(t,n,a)}function XI(t,e,r){if(ife(t)){if("value"in t)return t.type==="html"&&!r?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return jA(t.children,e,r)}return Array.isArray(t)?jA(t,e,r):""}function jA(t,e,r){const n=[];let a=-1;for(;++a<t.length;)n[a]=XI(t[a],e,r);return n.join("")}function ife(t){return!!(t&&typeof t=="object")}const NA=document.createElement("i");function zk(t){const e="&"+t+";";NA.innerHTML=e;const r=NA.textContent;return r.charCodeAt(r.length-1)===59&&t!=="semi"||r===e?!1:r}function fl(t,e,r,n){const a=t.length;let i=0,o;if(e<0?e=-e>a?0:a+e:e=e>a?a:e,r=r>0?r:0,n.length<1e4)o=Array.from(n),o.unshift(e,r),t.splice(...o);else for(r&&t.splice(e,r);i<n.length;)o=n.slice(i,i+1e4),o.unshift(e,0),t.splice(...o),i+=1e4,e+=1e4}function Il(t,e){return t.length>0?(fl(t,t.length,0,e),t):e}const FA={}.hasOwnProperty;function QI(t){const e={};let r=-1;for(;++r<t.length;)ofe(e,t[r]);return e}function ofe(t,e){let r;for(r in e){const a=(FA.call(t,r)?t[r]:void 0)||(t[r]={}),i=e[r];let o;if(i)for(o in i){FA.call(a,o)||(a[o]=[]);const l=i[o];lfe(a[o],Array.isArray(l)?l:l?[l]:[])}}}function lfe(t,e){let r=-1;const n=[];for(;++r<e.length;)(e[r].add==="after"?t:n).push(e[r]);fl(t,0,0,n)}function eO(t,e){const r=Number.parseInt(t,e);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function Lc(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const lo=pm(/[A-Za-z]/),Li=pm(/[\dA-Za-z]/),cfe=pm(/[#-'*+\--9=?A-Z^-~]/);function P1(t){return t!==null&&(t<32||t===127)}const cS=pm(/\d/),ufe=pm(/[\dA-Fa-f]/),dfe=pm(/[!-/:-@[-`{-~]/);function Ar(t){return t!==null&&t<-2}function cn(t){return t!==null&&(t<0||t===32)}function Ss(t){return t===-2||t===-1||t===32}const Vw=pm(new RegExp("\\p{P}|\\p{S}","u")),Qf=pm(/\s/);function pm(t){return e;function e(r){return r!==null&&r>-1&&t.test(String.fromCharCode(r))}}function Lx(t){const e=[];let r=-1,n=0,a=0;for(;++r<t.length;){const i=t.charCodeAt(r);let o="";if(i===37&&Li(t.charCodeAt(r+1))&&Li(t.charCodeAt(r+2)))a=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(o=String.fromCharCode(i));else if(i>55295&&i<57344){const l=t.charCodeAt(r+1);i<56320&&l>56319&&l<57344?(o=String.fromCharCode(i,l),a=1):o="�"}else o=String.fromCharCode(i);o&&(e.push(t.slice(n,r),encodeURIComponent(o)),n=r+a+1,o=""),a&&(r+=a,a=0)}return e.join("")+t.slice(n)}function Ms(t,e,r,n){const a=n?n-1:Number.POSITIVE_INFINITY;let i=0;return o;function o(c){return Ss(c)?(t.enter(r),l(c)):e(c)}function l(c){return Ss(c)&&i++<a?(t.consume(c),l):(t.exit(r),e(c))}}const hfe={tokenize:mfe};function mfe(t){const e=t.attempt(this.parser.constructs.contentInitial,n,a);let r;return e;function n(l){if(l===null){t.consume(l);return}return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),Ms(t,e,"linePrefix")}function a(l){return t.enter("paragraph"),i(l)}function i(l){const c=t.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=c),r=c,o(l)}function o(l){if(l===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(l);return}return Ar(l)?(t.consume(l),t.exit("chunkText"),i):(t.consume(l),o)}}const ffe={tokenize:pfe},SA={tokenize:gfe};function pfe(t){const e=this,r=[];let n=0,a,i,o;return l;function l(N){if(n<r.length){const S=r[n];return e.containerState=S[1],t.attempt(S[0].continuation,c,u)(N)}return u(N)}function c(N){if(n++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,a&&j();const S=e.events.length;let E=S,C;for(;E--;)if(e.events[E][0]==="exit"&&e.events[E][1].type==="chunkFlow"){C=e.events[E][1].end;break}w(n);let T=S;for(;T<e.events.length;)e.events[T][1].end={...C},T++;return fl(e.events,E+1,0,e.events.slice(S)),e.events.length=T,u(N)}return l(N)}function u(N){if(n===r.length){if(!a)return f(N);if(a.currentConstruct&&a.currentConstruct.concrete)return g(N);e.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(SA,d,h)(N)}function d(N){return a&&j(),w(n),f(N)}function h(N){return e.parser.lazy[e.now().line]=n!==r.length,o=e.now().offset,g(N)}function f(N){return e.containerState={},t.attempt(SA,m,g)(N)}function m(N){return n++,r.push([e.currentConstruct,e.containerState]),f(N)}function g(N){if(N===null){a&&j(),w(0),t.consume(N);return}return a=a||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:i}),y(N)}function y(N){if(N===null){b(t.exit("chunkFlow"),!0),w(0),t.consume(N);return}return Ar(N)?(t.consume(N),b(t.exit("chunkFlow")),n=0,e.interrupt=void 0,l):(t.consume(N),y)}function b(N,S){const E=e.sliceStream(N);
vendor: 6,679 bytes, line 877
877if(S&&E.push(null),N.previous=i,i&&(i.next=N),i=N,a.defineSkip(N.start),a.write(E),e.parser.lazy[N.start.line]){let C=a.events.length;for(;C--;)if(a.events[C][1].start.offset<o&&(!a.events[C][1].end||a.events[C][1].end.offset>o))return;const T=e.events.length;let D=T,A,R;for(;D--;)if(e.events[D][0]==="exit"&&e.events[D][1].type==="chunkFlow"){if(A){R=e.events[D][1].end;break}A=!0}for(w(n),C=T;C<e.events.length;)e.events[C][1].end={...R},C++;fl(e.events,D+1,0,e.events.slice(T)),e.events.length=C}}function w(N){let S=r.length;for(;S-- >N;){const E=r[S];e.containerState=E[1],E[0].exit.call(e,t)}r.length=N}function j(){a.write([null]),i=void 0,a=void 0,e.containerState._closeFlow=void 0}}function gfe(t,e,r){return Ms(t,t.attempt(this.parser.constructs.document,e,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function lx(t){if(t===null||cn(t)||Qf(t))return 1;if(Vw(t))return 2}function Kw(t,e,r){const n=[];let a=-1;for(;++a<t.length;){const i=t[a].resolveAll;i&&!n.includes(i)&&(e=i(e,r),n.push(i))}return e}const uS={name:"attention",resolveAll:xfe,tokenize:yfe};function xfe(t,e){let r=-1,n,a,i,o,l,c,u,d;for(;++r<t.length;)if(t[r][0]==="enter"&&t[r][1].type==="attentionSequence"&&t[r][1]._close){for(n=r;n--;)if(t[n][0]==="exit"&&t[n][1].type==="attentionSequence"&&t[n][1]._open&&e.sliceSerialize(t[n][1]).charCodeAt(0)===e.sliceSerialize(t[r][1]).charCodeAt(0)){if((t[n][1]._close||t[r][1]._open)&&(t[r][1].end.offset-t[r][1].start.offset)%3&&!((t[n][1].end.offset-t[n][1].start.offset+t[r][1].end.offset-t[r][1].start.offset)%3))continue;c=t[n][1].end.offset-t[n][1].start.offset>1&&t[r][1].end.offset-t[r][1].start.offset>1?2:1;const h={...t[n][1].end},f={...t[r][1].start};CA(h,-c),CA(f,c),o={type:c>1?"strongSequence":"emphasisSequence",start:h,end:{...t[n][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...t[r][1].start},end:f},i={type:c>1?"strongText":"emphasisText",start:{...t[n][1].end},end:{...t[r][1].start}},a={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},t[n][1].end={...o.start},t[r][1].start={...l.end},u=[],t[n][1].end.offset-t[n][1].start.offset&&(u=Il(u,[["enter",t[n][1],e],["exit",t[n][1],e]])),u=Il(u,[["enter",a,e],["enter",o,e],["exit",o,e],["enter",i,e]]),u=Il(u,Kw(e.parser.constructs.insideSpan.null,t.slice(n+1,r),e)),u=Il(u,[["exit",i,e],["enter",l,e],["exit",l,e],["exit",a,e]]),t[r][1].end.offset-t[r][1].start.offset?(d=2,u=Il(u,[["enter",t[r][1],e],["exit",t[r][1],e]])):d=0,fl(t,n-1,r-n+3,u),r=n+u.length-d-2;break}}for(r=-1;++r<t.length;)t[r][1].type==="attentionSequence"&&(t[r][1].type="data");return t}function yfe(t,e){const r=this.parser.constructs.attentionMarkers.null,n=this.previous,a=lx(n);let i;return o;function o(c){return i=c,t.enter("attentionSequence"),l(c)}function l(c){if(c===i)return t.consume(c),l;const u=t.exit("attentionSequence"),d=lx(c),h=!d||d===2&&a||r.includes(c),f=!a||a===2&&d||r.includes(n);return u._open=!!(i===42?h:h&&(a||!f)),u._close=!!(i===42?f:f&&(d||!h)),e(c)}}function CA(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const bfe={name:"autolink",tokenize:vfe};function vfe(t,e,r){let n=0;return a;function a(m){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),i}function i(m){return lo(m)?(t.consume(m),o):m===64?r(m):u(m)}function o(m){return m===43||m===45||m===46||Li(m)?(n=1,l(m)):u(m)}function l(m){return m===58?(t.consume(m),n=0,c):(m===43||m===45||m===46||Li(m))&&n++<32?(t.consume(m),l):(n=0,u(m))}function c(m){return m===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.exit("autolink"),e):m===null||m===32||m===60||P1(m)?r(m):(t.consume(m),c)}function u(m){return m===64?(t.consume(m),d):cfe(m)?(t.consume(m),u):r(m)}function d(m){return Li(m)?h(m):r(m)}function h(m){return m===46?(t.consume(m),n=0,d):m===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(m),t.exit("autolinkMarker"),t.exit("autolink"),e):f(m)}function f(m){if((m===45||Li(m))&&n++<63){const g=m===45?f:h;return t.consume(m),g}return r(m)}}const Z0={partial:!0,tokenize:wfe};function wfe(t,e,r){return n;function n(i){return Ss(i)?Ms(t,a,"linePrefix")(i):a(i)}function a(i){return i===null||Ar(i)?e(i):r(i)}}const tO={continuation:{tokenize:Nfe},exit:Ffe,name:"blockQuote",tokenize:jfe};function jfe(t,e,r){const n=this;return a;function a(o){if(o===62){const l=n.containerState;return l.open||(t.enter("blockQuote",{_container:!0}),l.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(o),t.exit("blockQuoteMarker"),i}return r(o)}function i(o){return Ss(o)?(t.enter("blockQuotePrefixWhitespace"),t.consume(o),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(o))}}function Nfe(t,e,r){const n=this;return a;function a(o){return Ss(o)?Ms(t,i,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):i(o)}function i(o){return t.attempt(tO,e,r)(o)}}function Ffe(t){t.exit("blockQuote")}const rO={name:"characterEscape",tokenize:Sfe};function Sfe(t,e,r){return n;function n(i){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(i),t.exit("escapeMarker"),a}function a(i){return dfe(i)?(t.enter("characterEscapeValue"),t.consume(i),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):r(i)}}const sO={name:"characterReference",tokenize:Cfe};function Cfe(t,e,r){const n=this;let a=0,i,o;return l;function l(h){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(h),t.exit("characterReferenceMarker"),c}function c(h){return h===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(h),t.exit("characterReferenceMarkerNumeric"),u):(t.enter("characterReferenceValue"),i=31,o=Li,d(h))}function u(h){return h===88||h===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(h),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),i=6,o=ufe,d):(t.enter("characterReferenceValue"),i=7,o=cS,d(h))}function d(h){if(h===59&&a){const f=t.exit("characterReferenceValue");return o===Li&&!zk(n.sliceSerialize(f))?r(h):(t.enter("characterReferenceMarker"),t.consume(h),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return o(h)&&a++<i?(t.consume(h),d):r(h)}}const kA={partial:!0,tokenize:_fe},_A={concrete:!0,name:"codeFenced",tokenize:kfe};function kfe(t,e,r){const n=this,a={partial:!0,tokenize:E};let i=0,o=0,l;return c;function c(C){return u(C)}function u(C){const T=n.events[n.events.length-1];return i=T&&T[1].type==="linePrefix"?T[2].sliceSerialize(T[1],!0).length:0,l=C,t.enter("co
877deFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),d(C)}function d(C){return C===l?(o++,t.consume(C),d):o<3?r(C):(t.exit("codeFencedFenceSequence"),Ss(C)?Ms(t,h,"whitespace")(C):h(C))}function h(C){return C===null||Ar(C)?(t.exit("codeFencedFence"),n.interrupt?e(C):t.check(kA,y,S)(C)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),f(C))}function f(C){return C===null||Ar(C)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),h(C)):Ss(C)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Ms(t,m,"whitespace")(C)):C===96&&C===l?r(C):(t.consume(C),f)}function m(C){return C===null||Ar(C)?h(C):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),g(C))}function g(C){return C===null||Ar(C)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),h(C)):C===96&&C===l?r(C):(t.consume(C),g)}function y(C){return t.attempt(a,S,b)(C)}function b(C){return t.enter("lineEnding"),t.consume(C),t.exit("lineEnding"),w}function w(C){return i>0&&Ss(C)?Ms(t,j,"linePrefix",i+1)(C):j(C)}function j(C){return C===null||Ar(C)?t.check(kA,y,S)(C):(t.enter("codeFlowValue"),N(C))}function N(C){return C===null||Ar(C)?(t.exit("codeFlowValue"),j(C)):(t.consume(C),N)}function S(C){return t.exit("codeFenced"),e(C)}function E(C,T,D){let A=0;return R;function R(O){return C.enter("lineEnding"),C.consume(O),C.exit("lineEnding"),M}function M(O){return C.enter("codeFencedFence"),Ss(O)?Ms(C,P,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):P(O)}function P(O){return O===l?(C.enter("codeFencedFenceSequence"),U(O)):D(O)}function U(O){return O===l?(A++,C.consume(O),U):A>=o?(C.exit("codeFencedFenceSequence"),Ss(O)?Ms(C,I,"whitespace")(O):I(O)):D(O)}function I(O){return O===null||Ar(O)?(C.exit("codeFencedFence"),T(O)):D(O)}}}function _fe(t,e,r){const n=this;return a;function a(o){return o===null?r(o):(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),i)}function i(o){return n.parser.lazy[n.now().line]?r(o):e(o)}}const $2={name:"codeIndented",tokenize:Afe},Efe={partial:!0,tokenize:Dfe};function Afe(t,e,r){const n=this;return a;function a(u){return t.enter("codeIndented"),Ms(t,i,"linePrefix",5)(u)}function i(u){const d=n.events[n.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(u):r(u)}function o(u){return u===null?c(u):Ar(u)?t.attempt(Efe,o,c)(u):(t.enter("codeFlowValue"),l(u))}function l(u){return u===null||Ar(u)?(t.exit("codeFlowValue"),o(u)):(t.consume(u),l)}function c(u){return t.exit("codeIndented"),e(u)}}function Dfe(t,e,r){const n=this;return a;function a(o){return n.parser.lazy[n.now().line]?r(o):Ar(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),a):Ms(t,i,"linePrefix",5)(o)}function i(o){const l=n.events[n.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(o):Ar(o)?a(o):r(o)}}const Tfe={name:"codeText",previous:Pfe,resolve:Mfe,tokenize:Rfe};function Mfe(t){let e=t.length-4,r=3,n,a;if((t[r][1].type==="lineEnding"||t[r][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(n=r;++n<e;)if(t[n][1].type==="codeTextData"){t[r][1].type="codeTextPadding",t[e][1].type="codeTextPadding",r+=2,e-=2;break}}for(n=r-1,e++;++n<=e;)a===void 0?n!==e&&t[n][1].type!=="lineEnding"&&(a=n):(n===e||t[n][1].type==="lineEnding")&&(t[a][1].type="codeTextData",n!==a+2&&(t[a][1].end=t[n-1][1].end,t.splice(a+2,n-a-2),e-=n-a-2,n=a+2),a=void 0);return t}function Pfe(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Rfe(t,e,r){let n=0,a,i;return o;function o(h){return t.enter("codeText"),t.enter("codeTextSequence"),l(h)}function l(h){return h===96?(t.consume(h),n++,l):(t.exit("codeTextSequence"),c(h))}function c(h){return h===null?r(h):h===32?(t.enter("space"),t.consume(h),t.exit("space"),c):h===96?(i=t.enter("codeTextSequence"),a=0,d(h)):Ar(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),c):(t.enter("codeTextData"),u(h))}function u(h){return h===null||h===32||h===96||Ar(h)?(t.exit("codeTextData"),c(h)):(t.consume(h),u)}function d(h){return h===96?(t.consume(h),a++,d):a===n?(t.exit("codeTextSequence"),t.exit("codeText"),e(h)):(i.type="codeTextData",u(h))}}class Bfe{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,r){const n=r??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,r,n){const a=r||0;this.setCursor(Math.trunc(e));const i=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return n&&py(this.left,n),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),py(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),py(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const r=this.left.splice(e,Number.POSITIVE_INFINITY);py(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);py(this.left,r.reverse())}}}function py(t,e){let r=0;if(e.length<1e4)t.push(...e);else for(;r<e.length;)t.push(...e.slice(r,r+1e4)),r+=1e4}function nO(t){const e={};let r=-1,n,a,i,o,l,c,u;const d=new Bfe(t);for(;++r<d.length;){for(;r in e;)r=e[r];if(n=d.get(r),r&&n[1].type==="chunkFlow"&&d.get(r-1)[1].type==="listItemPrefix"&&(c=n[1]._tokenizer.events,i=0,i<c.length&&c[i][1].type==="lineEndingBlank"&&(i+=2),i<c.length&&c[i][1].type==="content"))for(;++i<c.length&&c[i][1].type!=="content";)c[i][1].type==="chunkText"&&(c[i][1]._isInFirstContentOfListItem=!0,i++);if(n[0]==="enter")n[1].contentType&&(Object.assign(e,Lfe(d,r)),r=e[r],u=!0);else if(n[1]._container){for(i=r,a=void 0;i--;)if(o=d.get(i),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(a&&(d.get(a)[1].type="lineEndingBlank"),o[1].type="lineEnding",a=i);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;a&&(n[1].end={...d.get(a)[1].start},l=d.slice(a,r),l.unshift(n),d.splice(a,r-a+1,l))}}return fl(t,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function Lfe(t,e){const r=t.get(e)[1],n=t.get(e)[2];let a=e-1;const i=[];let o=r._tokenizer;o||(o=n.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const l=o.events,c=[],u={};let d,h,f=-1,m=r,g=0,y=0;const b=[y];for(;m;){for(;t.get(++a)[1]!==m;);i.push(a),m._tokenizer||(d=n.sliceStream(m),m.next||d.push(null),h&&o.defineSki
vendor: 18,639 bytes, line 877
877p(m.start),m._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),m._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),h=m,m=m.next}for(m=r;++f<l.length;)l[f][0]==="exit"&&l[f-1][0]==="enter"&&l[f][1].type===l[f-1][1].type&&l[f][1].start.line!==l[f][1].end.line&&(y=f+1,b.push(y),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(o.events=[],m?(m._tokenizer=void 0,m.previous=void 0):b.pop(),f=b.length;f--;){const w=l.slice(b[f],b[f+1]),j=i.pop();c.push([j,j+w.length-1]),t.splice(j,2,w)}for(c.reverse(),f=-1;++f<c.length;)u[g+c[f][0]]=g+c[f][1],g+=c[f][1]-c[f][0]-1;return u}const Ife={resolve:zfe,tokenize:Ufe},Ofe={partial:!0,tokenize:Hfe};function zfe(t){return nO(t),t}function Ufe(t,e){let r;return n;function n(l){return t.enter("content"),r=t.enter("chunkContent",{contentType:"content"}),a(l)}function a(l){return l===null?i(l):Ar(l)?t.check(Ofe,o,i)(l):(t.consume(l),a)}function i(l){return t.exit("chunkContent"),t.exit("content"),e(l)}function o(l){return t.consume(l),t.exit("chunkContent"),r.next=t.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,a}}function Hfe(t,e,r){const n=this;return a;function a(o){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),Ms(t,i,"linePrefix")}function i(o){if(o===null||Ar(o))return r(o);const l=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(o):t.interrupt(n.parser.constructs.flow,r,e)(o)}}function aO(t,e,r,n,a,i,o,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return h;function h(w){return w===60?(t.enter(n),t.enter(a),t.enter(i),t.consume(w),t.exit(i),f):w===null||w===32||w===41||P1(w)?r(w):(t.enter(n),t.enter(o),t.enter(l),t.enter("chunkString",{contentType:"string"}),y(w))}function f(w){return w===62?(t.enter(i),t.consume(w),t.exit(i),t.exit(a),t.exit(n),e):(t.enter(l),t.enter("chunkString",{contentType:"string"}),m(w))}function m(w){return w===62?(t.exit("chunkString"),t.exit(l),f(w)):w===null||w===60||Ar(w)?r(w):(t.consume(w),w===92?g:m)}function g(w){return w===60||w===62||w===92?(t.consume(w),m):m(w)}function y(w){return!d&&(w===null||w===41||cn(w))?(t.exit("chunkString"),t.exit(l),t.exit(o),t.exit(n),e(w)):d<u&&w===40?(t.consume(w),d++,y):w===41?(t.consume(w),d--,y):w===null||w===32||w===40||P1(w)?r(w):(t.consume(w),w===92?b:y)}function b(w){return w===40||w===41||w===92?(t.consume(w),y):y(w)}}function iO(t,e,r,n,a,i){const o=this;let l=0,c;return u;function u(m){return t.enter(n),t.enter(a),t.consume(m),t.exit(a),t.enter(i),d}function d(m){return l>999||m===null||m===91||m===93&&!c||m===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?r(m):m===93?(t.exit(i),t.enter(a),t.consume(m),t.exit(a),t.exit(n),e):Ar(m)?(t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),d):(t.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===null||m===91||m===93||Ar(m)||l++>999?(t.exit("chunkString"),d(m)):(t.consume(m),c||(c=!Ss(m)),m===92?f:h)}function f(m){return m===91||m===92||m===93?(t.consume(m),l++,h):h(m)}}function oO(t,e,r,n,a,i){let o;return l;function l(f){return f===34||f===39||f===40?(t.enter(n),t.enter(a),t.consume(f),t.exit(a),o=f===40?41:f,c):r(f)}function c(f){return f===o?(t.enter(a),t.consume(f),t.exit(a),t.exit(n),e):(t.enter(i),u(f))}function u(f){return f===o?(t.exit(i),c(o)):f===null?r(f):Ar(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),Ms(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),d(f))}function d(f){return f===o||f===null||Ar(f)?(t.exit("chunkString"),u(f)):(t.consume(f),f===92?h:d)}function h(f){return f===o||f===92?(t.consume(f),d):d(f)}}function Oy(t,e){let r;return n;function n(a){return Ar(a)?(t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),r=!0,n):Ss(a)?Ms(t,n,r?"linePrefix":"lineSuffix")(a):e(a)}}const $fe={name:"definition",tokenize:qfe},Wfe={partial:!0,tokenize:Gfe};function qfe(t,e,r){const n=this;let a;return i;function i(m){return t.enter("definition"),o(m)}function o(m){return iO.call(n,t,l,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function l(m){return a=Lc(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),m===58?(t.enter("definitionMarker"),t.consume(m),t.exit("definitionMarker"),c):r(m)}function c(m){return cn(m)?Oy(t,u)(m):u(m)}function u(m){return aO(t,d,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return t.attempt(Wfe,h,h)(m)}function h(m){return Ss(m)?Ms(t,f,"whitespace")(m):f(m)}function f(m){return m===null||Ar(m)?(t.exit("definition"),n.parser.defined.push(a),e(m)):r(m)}}function Gfe(t,e,r){return n;function n(l){return cn(l)?Oy(t,a)(l):r(l)}function a(l){return oO(t,i,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function i(l){return Ss(l)?Ms(t,o,"whitespace")(l):o(l)}function o(l){return l===null||Ar(l)?e(l):r(l)}}const Vfe={name:"hardBreakEscape",tokenize:Kfe};function Kfe(t,e,r){return n;function n(i){return t.enter("hardBreakEscape"),t.consume(i),a}function a(i){return Ar(i)?(t.exit("hardBreakEscape"),e(i)):r(i)}}const Jfe={name:"headingAtx",resolve:Yfe,tokenize:Zfe};function Yfe(t,e){let r=t.length-2,n=3,a,i;return t[n][1].type==="whitespace"&&(n+=2),r-2>n&&t[r][1].type==="whitespace"&&(r-=2),t[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&t[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(a={type:"atxHeadingText",start:t[n][1].start,end:t[r][1].end},i={type:"chunkText",start:t[n][1].start,end:t[r][1].end,contentType:"text"},fl(t,n,r-n+1,[["enter",a,e],["enter",i,e],["exit",i,e],["exit",a,e]])),t}function Zfe(t,e,r){let n=0;return a;function a(d){return t.enter("atxHeading"),i(d)}function i(d){return t.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&n++<6?(t.consume(d),o):d===null||cn(d)?(t.exit("atxHeadingSequence"),l(d)):r(d)}function l(d){return d===35?(t.enter("atxHeadingSequence"),c(d)):d===null||Ar(d)?(t.exit("atxHeading"),e(d)):Ss(d)?Ms(t,l,"whitespace")(d):(t.enter("atxHeadingText"),u(d))}function c(d){return d===35?(t.consume(d),c):(t.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||cn(d)?(t.exit("atxHeadingText"),l(d)):(t.consume(d),u)}}const Xfe=["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"],EA=["pre","script","style","textarea"],Qfe={concrete:!0,name:"htmlFlow",resolveTo:rpe,tokenize:spe},epe={partial:!0,tokenize:ape},tpe={partial:!0,tokenize:npe};function rpe(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function spe(t,e,r){const n=this;let a,i,o,l,c;return u;function u(H){return d(H)}function d(H){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(H),h}function h(H){return H===33?(t.consume(H),f):H===47?(t.consume(H),i=!0,y):H===63?(t.consume(H),a=3,n.interrupt?e:W):lo(H)?(t.consume(H),o=String.fromCharCode(H),b):r(H)}function f(H){return H===45?(t.consume(H),a=2,m):H===91?(t.consume(H),a=5,l=0,g):lo(H)?(t.consume(H),a=4,n.interrupt?e:W):r(H)}function m(H){return H===45?(t.consume(H),n.interrupt?e:W):r(H)}function g(H){const X="CDATA[";return H===X.charCodeAt(l++)?(t.consume(H),l===X.length?n.interrupt?e:P:g):r(H)}function y(H){return lo(H)?(t.consume(H),o=String.fromCharCode(H),b):r(H)}function b(H){if(H===null||H===47||H===62||cn(H)){const X=H===47,me=o.toLowerCase();return!X&&!i&&EA.includes(me)?(a=1,n.interrupt?e(H):P(H)):Xfe.includes(o.toLowerCase())?(a=6,X?(t.consume(H),w):n.interrupt?e(H):P(H)):(a=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(H):i?j(H):N(H))}return H===45||Li(H)?(t.consume(H),o+=String.fromCharCode(H),b):r(H)}function w(H){return H===62?(t.consume(H),n.interrupt?e:P):r(H)}function j(H){return Ss(H)?(t.consume(H),j):R(H)}function N(H){return H===47?(t.consume(H),R):H===58||H===95||lo(H)?(t.consume(H),S):Ss(H)?(t.consume(H),N):R(H)}function S(H){return H===45||H===46||H===58||H===95||Li(H)?(t.consume(H),S):E(H)}function E(H){return H===61?(t.consume(H),C):Ss(H)?(t.consume(H),E):N(H)}function C(H){return H===null||H===60||H===61||H===62||H===96?r(H):H===34||H===39?(t.consume(H),c=H,T):Ss(H)?(t.consume(H),C):D(H)}function T(H){return H===c?(t.consume(H),c=null,A):H===null||Ar(H)?r(H):(t.consume(H),T)}function D(H){return H===null||H===34||H===39||H===47||H===60||H===61||H===62||H===96||cn(H)?E(H):(t.consume(H),D)}function A(H){return H===47||H===62||Ss(H)?N(H):r(H)}function R(H){return H===62?(t.consume(H),M):r(H)}function M(H){return H===null||Ar(H)?P(H):Ss(H)?(t.consume(H),M):r(H)}function P(H){return H===45&&a===2?(t.consume(H),V):H===60&&a===1?(t.consume(H),G):H===62&&a===4?(t.consume(H),oe):H===63&&a===3?(t.consume(H),W):H===93&&a===5?(t.consume(H),$):Ar(H)&&(a===6||a===7)?(t.exit("htmlFlowData"),t.check(epe,K,U)(H)):H===null||Ar(H)?(t.exit("htmlFlowData"),U(H)):(t.consume(H),P)}function U(H){return t.check(tpe,I,K)(H)}function I(H){return t.enter("lineEnding"),t.consume(H),t.exit("lineEnding"),O}function O(H){return H===null||Ar(H)?U(H):(t.enter("htmlFlowData"),P(H))}function V(H){return H===45?(t.consume(H),W):P(H)}function G(H){return H===47?(t.consume(H),o="",B):P(H)}function B(H){if(H===62){const X=o.toLowerCase();return EA.includes(X)?(t.consume(H),oe):P(H)}return lo(H)&&o.length<8?(t.consume(H),o+=String.fromCharCode(H),B):P(H)}function $(H){return H===93?(t.consume(H),W):P(H)}function W(H){return H===62?(t.consume(H),oe):H===45&&a===2?(t.consume(H),W):P(H)}function oe(H){return H===null||Ar(H)?(t.exit("htmlFlowData"),K(H)):(t.consume(H),oe)}function K(H){return t.exit("htmlFlow"),e(H)}}function npe(t,e,r){const n=this;return a;function a(o){return Ar(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),i):r(o)}function i(o){return n.parser.lazy[n.now().line]?r(o):e(o)}}function ape(t,e,r){return n;function n(a){return t.enter("lineEnding"),t.consume(a),t.exit("lineEnding"),t.attempt(Z0,e,r)}}const ipe={name:"htmlText",tokenize:ope};function ope(t,e,r){const n=this;let a,i,o;return l;function l(W){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(W),c}function c(W){return W===33?(t.consume(W),u):W===47?(t.consume(W),E):W===63?(t.consume(W),N):lo(W)?(t.consume(W),D):r(W)}function u(W){return W===45?(t.consume(W),d):W===91?(t.consume(W),i=0,g):lo(W)?(t.consume(W),j):r(W)}function d(W){return W===45?(t.consume(W),m):r(W)}function h(W){return W===null?r(W):W===45?(t.consume(W),f):Ar(W)?(o=h,G(W)):(t.consume(W),h)}function f(W){return W===45?(t.consume(W),m):h(W)}function m(W){return W===62?V(W):W===45?f(W):h(W)}function g(W){const oe="CDATA[";return W===oe.charCodeAt(i++)?(t.consume(W),i===oe.length?y:g):r(W)}function y(W){return W===null?r(W):W===93?(t.consume(W),b):Ar(W)?(o=y,G(W)):(t.consume(W),y)}function b(W){return W===93?(t.consume(W),w):y(W)}function w(W){return W===62?V(W):W===93?(t.consume(W),w):y(W)}function j(W){return W===null||W===62?V(W):Ar(W)?(o=j,G(W)):(t.consume(W),j)}function N(W){return W===null?r(W):W===63?(t.consume(W),S):Ar(W)?(o=N,G(W)):(t.consume(W),N)}function S(W){return W===62?V(W):N(W)}function E(W){return lo(W)?(t.consume(W),C):r(W)}function C(W){return W===45||Li(W)?(t.consume(W),C):T(W)}function T(W){return Ar(W)?(o=T,G(W)):Ss(W)?(t.consume(W),T):V(W)}function D(W){return W===45||Li(W)?(t.consume(W),D):W===47||W===62||cn(W)?A(W):r(W)}function A(W){return W===47?(t.consume(W),V):W===58||W===95||lo(W)?(t.consume(W),R):Ar(W)?(o=A,G(W)):Ss(W)?(t.consume(W),A):V(W)}function R(W){return W===45||W===46||W===58||W===95||Li(W)?(t.consume(W),R):M(W)}function M(W){return W===61?(t.consume(W),P):Ar(W)?(o=M,G(W)):Ss(W)?(t.consume(W),M):A(W)}function P(W){return W===null||W===60||W===61||W===62||W===96?r(W):W===34||W===39?(t.consume(W),a=W,U):Ar(W)?(o=P,G(W)):Ss(W)?(t.consume(W),P):(t.consume(W),I)}function U(W){return W===a?(t.consume(W),a=void 0,O):W===null?r(W):Ar(W)?(o=U,G(W)):(t.consume(W),U)}function I(W){return W===null||W===34||W===39||W===60||W===61||W===96?r(W):W===47||W===62||cn(W)?A(W):(t.consume(W),I)}function O(W){return W===47||W===62||cn(W)?A(W):r(W)}function V(W){return W===62?(t.consume(W),t.exit("htmlTextData"),t.exit("htmlText"),e):r(W)}function G(W){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(W),t.exit("lineEnding"),B}function B(W){return Ss(W)?Ms(t,$,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):$(W)}function $(W){return t.enter("htmlTextData"),o(W)}}const Uk={name:"labelEnd",resolveAll:dpe,resolveTo:hpe,tokenize:mpe},lpe={tokenize:fpe},cpe={tokenize:ppe},upe={tokenize:gpe};function dpe(t){let e=-1;const r=[];for(;++e<t.length;){const n=t[e][1];if(r.push(t[e]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){const a=n.type==="labelImage"?4:2;n.type="data",e+=a}}return t.length!==r.length&&fl(t,0,t.length,r),t}function hpe(t,e){let r=t.length,n=0,a,i,o,l;for(;r--;)if(a=t[r][1],i){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;t[r][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(o){if(t[r][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(i=r,a.type!=="labelLink")){n=2;break}}else a.type==="labelEnd"&&(o=r);const c={type:t[i][1].type==="labelLink"?"link":"image",start:{...t[i][1].start},end:{...t[t.length-1][1].end}},u={type:"label",start:{...t[i][1].start},end:{...t[o][1].end}},d={type:"labelText",start:{...t[i+n+2][1].end},end:{...t[o-2][1].start}};return l=[["enter",c,e],["enter",u,e]],l=Il(l,t.slice(i+1,i+n+3)),l=Il(l,[["enter",d,e]]),l=Il(l,Kw(e.parser.constructs.insideSpan.null,t.slice(i+n+4,o-3),e)),l=Il(l,[["exit",d,e],t[o-2],t[o-1],["exit",u,e]]),l=Il(l,t.slice(o+1)),l=Il(l,[["exit",c,e]]),fl(t,i,t.length,l),t}function mpe(t,e,r){const n=this;let a=n.events.length,i,o;for(;a--;)if((n.events[a][1].type==="labelImage"||n.events[a][1].type==="labelLink")&&!n.events[a][1]._balanced){i=n.events[a][1];break}return l;function l(f){return i?i._inactive?h(f):(o=n.parser.defined.includes(Lc(n.sliceSerialize({start:i.end,end:n.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(f),t.exit("labelMarker"),t.exit("labelEnd"),c):r(f)}function c(f){return f===40?t.attempt(lpe,d,o?d:h)(f):f===91?t.attempt(cpe,d,o?u:h)(f):o?d(f):h(f)}function u(f){return t.attempt(upe,d,h)(f)}function d(f){return e(f)}function h(f){return i._balanced=!0,r(f)}}function fpe(t,e,r){return n;function n(h){return t.enter("resource"),t.enter("resourceMarker"),t.consume(h),t.exit("resourceMarker"),a}function a(h){return cn(h)?Oy(t,i)(h):i(h)}function i(h){return h===41?d(h):aO(t,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function o(h){return cn(h)?Oy(t,c)(h):d(h)}function l(h){return r(h)}function c(h){return h===34||h===39||h===40?oO(t,u,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function u(h){return cn(h)?Oy(t,d)(h):d(h)}function d(h){return h===41?(t.enter("resourceMarker"),t.consume(h),t.exit("resourceMarker"),t.exit("resource"),e):r(h)}}function ppe(t,e,r){const n=this;return a;function a(l){return iO.call(n,t,i,o,"reference","referenceMarker","referenceString")(l)}function i(l){return n.parser.defined.includes(Lc(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?e(l):r(l)}function o(l){return r(l)}}function gpe(t,e,r){return n;function n(i){return t.enter("reference"),t.enter("referenceMarker"),t.consume(i),t.exit("referenceMarker"),a}function a(i){return i===93?(t.enter("referenceMarker"),t.consume(i),t.exit("referenceMarker"),t.exit("reference"),e):r(i)}}const xpe={name:"labelStartImage",resolveAll:Uk.resolveAll,tokenize:ype};function ype(t,e,r){const n=this;return a;function a(l){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(l),t.exit("labelImageMarker"),i}function i(l){return l===91?(t.enter("labelMarker"),t.consume(l),t.exit("labelMarker"),t.exit("labelImage"),o):r(l)}function o(l){return l===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(l):e(l)}}const bpe={name:"labelStartLink",resolveAll:Uk.resolveAll,tokenize:vpe};function vpe(t,e,r){const n=this;return a;function a(o){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelLink"),i}function i(o){return o===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(o):e(o)}}const W2={name:"lineEnding",tokenize:wpe};function wpe(t,e){return r;function r(n){return t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),Ms(t,e,"linePrefix")}}const Kv={name:"thematicBreak",tokenize:jpe};function jpe(t,e,r){let n=0,a;return i;function i(u){return t.enter("thematicBreak"),o(u)}function o(u){return a=u,l(u)}function l(u){return u===a?(t.enter("thematicBreakSequence"),c(u)):n>=3&&(u===null||Ar(u))?(t.exit("thematicBreak"),e(u)):r(u)}function c(u){return u===a?(t.consume(u),n++,c):(t.exit("thematicBreakSequence"),Ss(u)?Ms(t,l,"whitespace")(u):l(u))}}const Eo={continuation:{tokenize:Cpe},exit:_pe,name:"list",tokenize:Spe},Npe={partial:!0,tokenize:Epe},Fpe={partial:!0,tokenize:kpe};function Spe(t,e,r){const n=this,a=n.events[n.events.length-1];let i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,o=0;return l;function l(m){const g=n.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!n.containerState.marker||m===n.containerState.marker:cS(m)){if(n.containerState.type||(n.containerState.type=g,t.enter(g,{_container:!0})),g==="listUnordered")return t.enter("listItemPrefix"),m===42||m===45?t.check(Kv,r,u)(m):u(m);if(!n.interrupt||m===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),c(m)}return r(m)}function c(m){return cS(m)&&++o<10?(t.consume(m),c):(!n.interrupt||o<2)&&(n.containerState.marker?m===n.containerState.marker:m===41||m===46)?(t.exit("listItemValue"),u(m)):r(m)}function u(m){return t.enter("listItemMarker"),t.consume(m),t.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||m,t.check(Z0,n.interrupt?r:d,t.attempt(Npe,f,h))}
vendor: 5,407 bytes, line 877
877function d(m){return n.containerState.initialBlankLine=!0,i++,f(m)}function h(m){return Ss(m)?(t.enter("listItemPrefixWhitespace"),t.consume(m),t.exit("listItemPrefixWhitespace"),f):r(m)}function f(m){return n.containerState.size=i+n.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(m)}}function Cpe(t,e,r){const n=this;return n.containerState._closeFlow=void 0,t.check(Z0,a,i);function a(l){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,Ms(t,e,"listItemIndent",n.containerState.size+1)(l)}function i(l){return n.containerState.furtherBlankLines||!Ss(l)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,o(l)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,t.attempt(Fpe,e,o)(l))}function o(l){return n.containerState._closeFlow=!0,n.interrupt=void 0,Ms(t,t.attempt(Eo,e,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function kpe(t,e,r){const n=this;return Ms(t,a,"listItemIndent",n.containerState.size+1);function a(i){const o=n.events[n.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===n.containerState.size?e(i):r(i)}}function _pe(t){t.exit(this.containerState.type)}function Epe(t,e,r){const n=this;return Ms(t,a,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(i){const o=n.events[n.events.length-1];return!Ss(i)&&o&&o[1].type==="listItemPrefixWhitespace"?e(i):r(i)}}const AA={name:"setextUnderline",resolveTo:Ape,tokenize:Dpe};function Ape(t,e){let r=t.length,n,a,i;for(;r--;)if(t[r][0]==="enter"){if(t[r][1].type==="content"){n=r;break}t[r][1].type==="paragraph"&&(a=r)}else t[r][1].type==="content"&&t.splice(r,1),!i&&t[r][1].type==="definition"&&(i=r);const o={type:"setextHeading",start:{...t[n][1].start},end:{...t[t.length-1][1].end}};return t[a][1].type="setextHeadingText",i?(t.splice(a,0,["enter",o,e]),t.splice(i+1,0,["exit",t[n][1],e]),t[n][1].end={...t[i][1].end}):t[n][1]=o,t.push(["exit",o,e]),t}function Dpe(t,e,r){const n=this;let a;return i;function i(u){let d=n.events.length,h;for(;d--;)if(n.events[d][1].type!=="lineEnding"&&n.events[d][1].type!=="linePrefix"&&n.events[d][1].type!=="content"){h=n.events[d][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||h)?(t.enter("setextHeadingLine"),a=u,o(u)):r(u)}function o(u){return t.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===a?(t.consume(u),l):(t.exit("setextHeadingLineSequence"),Ss(u)?Ms(t,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Ar(u)?(t.exit("setextHeadingLine"),e(u)):r(u)}}const Tpe={tokenize:Mpe};function Mpe(t){const e=this,r=t.attempt(Z0,n,t.attempt(this.parser.constructs.flowInitial,a,Ms(t,t.attempt(this.parser.constructs.flow,a,t.attempt(Ife,a)),"linePrefix")));return r;function n(i){if(i===null){t.consume(i);return}return t.enter("lineEndingBlank"),t.consume(i),t.exit("lineEndingBlank"),e.currentConstruct=void 0,r}function a(i){if(i===null){t.consume(i);return}return t.enter("lineEnding"),t.consume(i),t.exit("lineEnding"),e.currentConstruct=void 0,r}}const Ppe={resolveAll:cO()},Rpe=lO("string"),Bpe=lO("text");function lO(t){return{resolveAll:cO(t==="text"?Lpe:void 0),tokenize:e};function e(r){const n=this,a=this.parser.constructs[t],i=r.attempt(a,o,l);return o;function o(d){return u(d)?i(d):l(d)}function l(d){if(d===null){r.consume(d);return}return r.enter("data"),r.consume(d),c}function c(d){return u(d)?(r.exit("data"),i(d)):(r.consume(d),c)}function u(d){if(d===null)return!0;const h=a[d];let f=-1;if(h)for(;++f<h.length;){const m=h[f];if(!m.previous||m.previous.call(n,n.previous))return!0}return!1}}}function cO(t){return e;function e(r,n){let a=-1,i;for(;++a<=r.length;)i===void 0?r[a]&&r[a][1].type==="data"&&(i=a,a++):(!r[a]||r[a][1].type!=="data")&&(a!==i+2&&(r[i][1].end=r[a-1][1].end,r.splice(i+2,a-i-2),a=i+2),i=void 0);return t?t(r,n):r}}function Lpe(t,e){let r=0;for(;++r<=t.length;)if((r===t.length||t[r][1].type==="lineEnding")&&t[r-1][1].type==="data"){const n=t[r-1][1],a=e.sliceStream(n);let i=a.length,o=-1,l=0,c;for(;i--;){const u=a[i];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(u===-2)c=!0,l++;else if(u!==-1){i++;break}}if(e._contentTypeTextTrailing&&r===t.length&&(l=0),l){const u={type:r===t.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?o:n.start._bufferIndex+o,_index:n.start._index+i,line:n.end.line,column:n.end.column-l,offset:n.end.offset-l},end:{...n.end}};n.end={...u.start},n.start.offset===n.end.offset?Object.assign(n,u):(t.splice(r,0,["enter",u,e],["exit",u,e]),r+=2)}r++}return t}const Ipe={42:Eo,43:Eo,45:Eo,48:Eo,49:Eo,50:Eo,51:Eo,52:Eo,53:Eo,54:Eo,55:Eo,56:Eo,57:Eo,62:tO},Ope={91:$fe},zpe={[-2]:$2,[-1]:$2,32:$2},Upe={35:Jfe,42:Kv,45:[AA,Kv],60:Qfe,61:AA,95:Kv,96:_A,126:_A},Hpe={38:sO,92:rO},$pe={[-5]:W2,[-4]:W2,[-3]:W2,33:xpe,38:sO,42:uS,60:[bfe,ipe],91:bpe,92:[Vfe,rO],93:Uk,95:uS,96:Tfe},Wpe={null:[uS,Ppe]},qpe={null:[42,95]},Gpe={null:[]},Vpe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:qpe,contentInitial:Ope,disable:Gpe,document:Ipe,flow:Upe,flowInitial:zpe,insideSpan:Wpe,string:Hpe,text:$pe},Symbol.toStringTag,{value:"Module"}));function Kpe(t,e,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,c
vendor: 14,840 bytes, lines 877-879
877olumn:r&&r.column||1,offset:r&&r.offset||0};const a={},i=[];let o=[],l=[];const c={attempt:T(E),check:T(C),consume:j,enter:N,exit:S,interrupt:T(C,{interrupt:!0})},u={code:null,containerState:{},defineSkip:y,events:[],now:g,parser:t,previous:null,sliceSerialize:f,sliceStream:m,write:h};let d=e.tokenize.call(u,c);return e.resolveAll&&i.push(e),u;function h(M){return o=Il(o,M),b(),o[o.length-1]!==null?[]:(D(e,0),u.events=Kw(i,u.events,u),u.events)}function f(M,P){return Ype(m(M),P)}function m(M){return Jpe(o,M)}function g(){const{_bufferIndex:M,_index:P,line:U,column:I,offset:O}=n;return{_bufferIndex:M,_index:P,line:U,column:I,offset:O}}function y(M){a[M.line]=M.column,R()}function b(){let M;for(;n._index<o.length;){const P=o[n._index];if(typeof P=="string")for(M=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===M&&n._bufferIndex<P.length;)w(P.charCodeAt(n._bufferIndex));else w(P)}}function w(M){d=d(M)}function j(M){Ar(M)?(n.line++,n.column=1,n.offset+=M===-3?2:1,R()):M!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===o[n._index].length&&(n._bufferIndex=-1,n._index++)),u.previous=M}function N(M,P){const U=P||{};return U.type=M,U.start=g(),u.events.push(["enter",U,u]),l.push(U),U}function S(M){const P=l.pop();return P.end=g(),u.events.push(["exit",P,u]),P}function E(M,P){D(M,P.from)}function C(M,P){P.restore()}function T(M,P){return U;function U(I,O,V){let G,B,$,W;return Array.isArray(I)?K(I):"tokenize"in I?K([I]):oe(I);function oe(ie){return ee;function ee(he){const ve=he!==null&&ie[he],Ce=he!==null&&ie.null,re=[...Array.isArray(ve)?ve:ve?[ve]:[],...Array.isArray(Ce)?Ce:Ce?[Ce]:[]];return K(re)(he)}}function K(ie){return G=ie,B=0,ie.length===0?V:H(ie[B])}function H(ie){return ee;function ee(he){return W=A(),$=ie,ie.partial||(u.currentConstruct=ie),ie.name&&u.parser.constructs.disable.null.includes(ie.name)?me():ie.tokenize.call(P?Object.assign(Object.create(u),P):u,c,X,me)(he)}}function X(ie){return M($,W),O}function me(ie){return W.restore(),++B<G.length?H(G[B]):V}}}function D(M,P){M.resolveAll&&!i.includes(M)&&i.push(M),M.resolve&&fl(u.events,P,u.events.length-P,M.resolve(u.events.slice(P),u)),M.resolveTo&&(u.events=M.resolveTo(u.events,u))}function A(){const M=g(),P=u.previous,U=u.currentConstruct,I=u.events.length,O=Array.from(l);return{from:I,restore:V};function V(){n=M,u.previous=P,u.currentConstruct=U,u.events.length=I,l=O,R()}}function R(){n.line in a&&n.column<2&&(n.column=a[n.line],n.offset+=a[n.line]-1)}}function Jpe(t,e){const r=e.start._index,n=e.start._bufferIndex,a=e.end._index,i=e.end._bufferIndex;let o;if(r===a)o=[t[r].slice(n,i)];else{if(o=t.slice(r,a),n>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(n):o.shift()}i>0&&o.push(t[a].slice(0,i))}return o}function Ype(t,e){let r=-1;const n=[];let a;for(;++r<t.length;){const i=t[r];let o;if(typeof i=="string")o=i;else switch(i){case-5:{o="\r";break}case-4:{o=` 878`;break}case-3:{o=`\r 879`;break}case-2:{o=e?" ":" ";break}case-1:{if(!e&&a)continue;o=" ";break}default:o=String.fromCharCode(i)}a=i===-2,n.push(o)}return n.join("")}function Zpe(t){const n={constructs:QI([Vpe,...(t||{}).extensions||[]]),content:a(hfe),defined:[],document:a(ffe),flow:a(Tpe),lazy:{},string:a(Rpe),text:a(Bpe)};return n;function a(i){return o;function o(l){return Kpe(n,i,l)}}}function Xpe(t){for(;!nO(t););return t}const DA=/[\0\t\n\r]/g;function Qpe(){let t=1,e="",r=!0,n;return a;function a(i,o,l){const c=[];let u,d,h,f,m;for(i=e+(typeof i=="string"?i.toString():new TextDecoder(o||void 0).decode(i)),h=0,e="",r&&(i.charCodeAt(0)===65279&&h++,r=void 0);h<i.length;){if(DA.lastIndex=h,u=DA.exec(i),f=u&&u.index!==void 0?u.index:i.length,m=i.charCodeAt(f),!u){e=i.slice(h);break}if(m===10&&h===f&&n)c.push(-3),n=void 0;else switch(n&&(c.push(-5),n=void 0),h<f&&(c.push(i.slice(h,f)),t+=f-h),m){case 0:{c.push(65533),t++;break}case 9:{for(d=Math.ceil(t/4)*4,c.push(-2);t++<d;)c.push(-1);break}case 10:{c.push(-4),t=1;break}default:n=!0,t=1}h=f+1}return l&&(n&&c.push(-5),e&&c.push(e),c.push(null)),c}}const ege=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function tge(t){return t.replace(ege,rge)}function rge(t,e,r){if(e)return e;if(r.charCodeAt(0)===35){const a=r.charCodeAt(1),i=a===120||a===88;return eO(r.slice(i?2:1),i?16:10)}return zk(r)||t}const uO={}.hasOwnProperty;function sge(t,e,r){return e&&typeof e=="object"&&(r=e,e=void 0),nge(r)(Xpe(Zpe(r).document().write(Qpe()(t,e,!0))))}function nge(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(Xe),autolinkProtocol:A,autolinkEmail:A,atxHeading:i(ae),blockQuote:i(Ce),characterEscape:A,characterReference:A,codeFenced:i(re),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:i(re,o),codeText:i(we,o),codeTextData:A,data:A,codeFlowValue:A,definition:i(Ee),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:i(Me),hardBreakEscape:i(ze),hardBreakTrailing:i(ze),htmlFlow:i(mt,o),htmlFlowData:A,htmlText:i(mt,o),htmlTextData:A,image:i(tt),label:o,link:i(Xe),listItem:i(ce),listItemValue:f,listOrdered:i(Ft,h),listUnordered:i(Ft),paragraph:i(fe),reference:H,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:i(ae),strong:i(ge),thematicBreak:i(Je)},exit:{atxHeading:c(),atxHeadingSequence:E,autolink:c(),autolinkEmail:ve,autolinkProtocol:he,blockQuote:c(),characterEscapeValue:R,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:ie,characterReference:ee,codeFenced:c(b),codeFencedFence:y,codeFencedFenceInfo:m,codeFencedFenceMeta:g,codeFlowValue:R,codeIndented:c(w),codeText:c(O),codeTextData:R,data:R,definition:c(),definitionDestinationString:S,definitionLabelString:j,definitionTitleString:N,emphasis:c(),hardBreakEscape:c(P),hardBreakTrailing:c(P),htmlFlow:c(U),htmlFlowData:R,htmlText:c(I),htmlTextData:R,image:c(G),label:$,labelText:B,lineEnding:M,link:c(V),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:X,resourceDestinationString:W,resourceTitleString:oe,resource:K,setextHeading:c(D),setextHeadingLineSequence:T,setextHeadingText:C,strong:c(),thematicBreak:c()}};dO(e,(t||{}).mdastExtensions||[]);const r={};return n;function n(be){let Pe={type:"root",children:[]};const qe={stack:[Pe],tokenStack:[],config:e,enter:l,exit:u,buffer:o,resume:d,data:r},Qe=[];let We=-1;for(;++We<be.length;)if(be[We][1].type==="listOrdered"||be[We][1].type==="listUnordered")if(be[We][0]==="enter")Qe.push(We);else{const dt=Qe.pop();We=a(be,dt,We)}for(We=-1;++We<be.length;){const dt=e[be[We][0]];uO.call(dt,be[We][1].type)&&dt[be[We][1].type].call(Object.assign({sliceSerialize:be[We][2].sliceSerialize},qe),be[We][1])}if(qe.tokenStack.length>0){const dt=qe.tokenStack[qe.tokenStack.length-1];(dt[1]||TA).call(qe,void 0,dt[0])}for(Pe.position={start:mh(be.length>0?be[0][1].start:{line:1,column:1,offset:0}),end:mh(be.length>0?be[be.length-2][1].end:{line:1,column:1,offset:0})},We=-1;++We<e.transforms.length;)Pe=e.transforms[We](Pe)||Pe;return Pe}function a(be,Pe,qe){let Qe=Pe-1,We=-1,dt=!1,Bt,Lt,Vt,cr;for(;++Qe<=qe;){const wr=be[Qe];switch(wr[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{wr[0]==="enter"?We++:We--,cr=void 0;break}case"lineEndingBlank":{wr[0]==="enter"&&(Bt&&!cr&&!We&&!Vt&&(Vt=Qe),cr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:cr=void 0}if(!We&&wr[0]==="enter"&&wr[1].type==="listItemPrefix"||We===-1&&wr[0]==="exit"&&(wr[1].type==="listUnordered"||wr[1].type==="listOrdered")){if(Bt){let Xt=Qe;for(Lt=void 0;Xt--;){const pt=be[Xt];if(pt[1].type==="lineEnding"||pt[1].type==="lineEndingBlank"){if(pt[0]==="exit")continue;Lt&&(be[Lt][1].type="lineEndingBlank",dt=!0),pt[1].type="lineEnding",Lt=Xt}else if(!(pt[1].type==="linePrefix"||pt[1].type==="blockQuotePrefix"||pt[1].type==="blockQuotePrefixWhitespace"||pt[1].type==="blockQuoteMarker"||pt[1].type==="listItemIndent"))break}Vt&&(!Lt||Vt<Lt)&&(Bt._spread=!0),Bt.end=Object.assign({},Lt?be[Lt][1].start:wr[1].end),be.splice(Lt||Qe,0,["exit",Bt,wr[2]]),Qe++,qe++}if(wr[1].type==="listItemPrefix"){const Xt={type:"listItem",_spread:!1,start:Object.assign({},wr[1].start),end:void 0};Bt=Xt,be.splice(Qe,0,["enter",Xt,wr[2]]),Qe++,qe++,Vt=void 0,cr=!0}}}return be[Pe][1]._spread=dt,qe}function i(be,Pe){return qe;function qe(Qe){l.call(this,be(Qe),Qe),Pe&&Pe.call(this,Qe)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(be,Pe,qe){this.stack[this.stack.length-1].children.push(be),this.stack.push(be),this.tokenStack.push([Pe,qe||void 0]),be.position={start:mh(Pe.start),end:void 0}}function c(be){return Pe;function Pe(qe){be&&be.call(this,qe),u.call(this,qe)}}function u(be,Pe){const qe=this.stack.pop(),Qe=this.tokenStack.pop();if(Qe)Qe[0].type!==be.type&&(Pe?Pe.call(this,be,Qe[0]):(Qe[1]||TA).call(this,be,Qe[0]));else throw new Error("Cannot close `"+be.type+"` ("+Iy({start:be.start,end:be.end})+"): itâs not open");qe.position.end=mh(be.end)}function d(){return Ok(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function f(be){if(this.data.expectingFirstListItemValue){const Pe=this.stack[this.stack.length-2];Pe.start=Number.parseInt(this.sliceSerialize(be),10),this.data.expectingFirstListItemValue=void 0}}function m(){const be=this.resume(),Pe=this.stack[this.stack.length-1];Pe.lang=be}function g(){const be=this.resume(),Pe=this.stack[this.stack.length-1];Pe.meta=be}function y(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function b(){const be=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=be.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const be=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=be.replace(/(\r?\n|\r)$/g,"")}function j(be){const Pe=this.resume(),qe=this.stack[this.stack.length-1];qe.label=Pe,qe.identifier=Lc(this.sliceSerialize(be)).toLowerCase()}function N(){const be=this.resume(),Pe=this.stack[this.stack.length-1];Pe.title=be}function S(){const be=this.resume(),Pe=this.stack[this.stack.length-1];Pe.url=be}function E(be){const Pe=this.stack[this.stack.length-1];if(!Pe.depth){const qe=this.sliceSerialize(be).length;Pe.depth=qe}}function C(){this.data.setextHeadingSlurpLineEnding=!0}function T(be){const Pe=this.stack[this.stack.length-1];Pe.depth=this.sliceSerialize(be).codePointAt(0)===61?1:2}function D(){this.data.setextHeadingSlurpLineEnding=void 0}function A(be){const qe=this.stack[this.stack.length-1].children;let Qe=qe[qe.length-1];(!Qe||Qe.type!=="text")&&(Qe=Ge(),Qe.position={start:mh(be.start),end:void 0},qe.push(Qe)),this.stack.push(Qe)}function R(be){const Pe=this.stack.pop();Pe.value+=this.sliceSerialize(be),Pe.position.end=mh(be.end)}function M(be){const Pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const qe=Pe.children[Pe.children.length-1];qe.position.end=mh(be.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(Pe.type)&&(A.call(this,be),R.call(this,be))}function P(){this.data.atHardBreak=!0}function U(){const be=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=be}function I(){const be=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=be}function O(){const be=this.resume(),Pe=this.stack[this.stack.length-1];Pe.value=be}function V(){const be=this.stack[this.stack.length-1];if(this.data.inReference){const Pe=this.data.referenceType||"shortcut";be.type+="Reference",be.referenceType=Pe,delete be.url,delete be.title}else delete be.identifier,delete be.label;this.data.referenceType=void 0}function G(){const be=this.stack[this.stack.length-1];if(this.data.inReference){const Pe=this.data.referenceType||"shortcut";be.type+="Reference",be.referenceType=Pe,delete be.url,delete be.title}else delete be.identifier,delete be.label;this.data.referenceType=void 0}function B(be){const Pe=this.sliceSerialize(be),qe=this.stack[this.stack.length-2];qe.label=tge(Pe),qe.identifier=Lc(Pe).toLowerCase()}function $(){const be=this.stack[this.stack.length-1],Pe=this.resume(),qe=this.stack[this.stack.length-1];if(this.data.inReference=!0,qe.type==="link"){const Qe=be.children;qe.children=Qe}else qe.alt=Pe}function W(){const be=this.resume(),Pe=this.stack[this.stack.length-1];Pe.url=be}function oe(){const be=this.resume(),Pe=this.stack[this.stack.length-1];Pe.title=be}function K(){this.data.inReference=void 0}function H(){this.data.referenceType="collapsed"}function X(be){const Pe=this.resume(),qe=this.stack[this.stack.length-1];qe.label=Pe,qe.identifier=Lc(this.sliceSerialize(be)).toLowerCase(),this.data.referenceType="full"}function me(be){this.data.characterReferenceType=be.type}function ie(be){const Pe=this.sliceSerialize(be),qe=this.data.characterReferenceType;let Qe;qe?(Qe=eO(Pe,qe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Qe=zk(Pe);const We=this.stack[this.stack.length-1];We.value+=Qe}function ee(be){const Pe=this.stack.pop();Pe.position.end=mh(be.end)}function he(be){R.call(this,be);const Pe=this.stack[this.stack.length-1];Pe.url=this.sliceSerialize(be)}function ve(be){R.call(this,be);const Pe=this.stack[this.stack.length-1];Pe.url="mailto:"+this.sliceSerialize(be)}function Ce(){return{type:"blockquote",children:[]}}function re(){return{type:"code",lang:null,meta:null,value:""}}function we(){return{type:"inlineCode",value:""}}function Ee(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Me(){return{type:"emphasis",children:[]}}function ae(){return{type:"heading",depth:0,children:[]}}function ze(){return{type:"break"}}function mt(){return{type:"html",value:""}}function tt(){return{type:"image",title:null,url:"",alt:null}}function Xe(){return{type:"link",title:null,url:"",children:[]}}function Ft(be){return{type:"list",ordered:be.type==="listOrdered",start:null,spread:be._spread,children:[]}}function ce(be){return{type:"listItem",spread:be._spread,checked:null,children:[]}}function fe(){return{type:"paragraph",children:[]}}function ge(){return{type:"strong",children:[]}}function Ge(){return{type:"text",value:""}}function Je(){return{type:"thematicBreak"}}}function mh(t){return{line:t.line,column:t.column,offset:t.offset}}function dO(t,e){let r=-1;for(;++r<e.length;){const n=e[r];Array.isArray(n)?dO(t,n):age(t,n)}}function age(t,e){let r;for(r in e)if(uO.call(e,r))switch(r){case"canContainEols":{const n=e[r];n&&t[r].push(...n);break}case"transforms":{const n=e[r];n&&t[r].push(...n);break}case"enter":case"exit":{const n=e[r];n&&Object.assign(t[r],n);break}}}function TA(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+Iy({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+Iy({start:e.start,end:e.end}
vendor: 10,813 bytes, lines 879-883
879)+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Iy({start:e.start,end:e.end})+") is still open")}function ige(t){const e=this;e.parser=r;function r(n){return sge(n,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function oge(t,e){const r={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,r),t.applyData(e,r)}function lge(t,e){const r={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,r),[t.applyData(e,r),{type:"text",value:` 880`}]}function cge(t,e){const r=e.value?e.value+` 881`:"",n={},a=e.lang?e.lang.split(/\s+/):[];a.length>0&&(n.className=["language-"+a[0]]);let i={type:"element",tagName:"code",properties:n,children:[{type:"text",value:r}]};return e.meta&&(i.data={meta:e.meta}),t.patch(e,i),i=t.applyData(e,i),i={type:"element",tagName:"pre",properties:{},children:[i]},t.patch(e,i),i}function uge(t,e){const r={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function dge(t,e){const r={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function hge(t,e){const r=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=String(e.identifier).toUpperCase(),a=Lx(n.toLowerCase()),i=t.footnoteOrder.indexOf(n);let o,l=t.footnoteCounts.get(n);l===void 0?(l=0,t.footnoteOrder.push(n),o=t.footnoteOrder.length):o=i+1,l+=1,t.footnoteCounts.set(n,l);const c={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+a,id:r+"fnref-"+a+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};t.patch(e,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return t.patch(e,u),t.applyData(e,u)}function mge(t,e){const r={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function fge(t,e){if(t.options.allowDangerousHtml){const r={type:"raw",value:e.value};return t.patch(e,r),t.applyData(e,r)}}function hO(t,e){const r=e.referenceType;let n="]";if(r==="collapsed"?n+="[]":r==="full"&&(n+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+n}];const a=t.all(e),i=a[0];i&&i.type==="text"?i.value="["+i.value:a.unshift({type:"text",value:"["});const o=a[a.length-1];return o&&o.type==="text"?o.value+=n:a.push({type:"text",value:n}),a}function pge(t,e){const r=String(e.identifier).toUpperCase(),n=t.definitionById.get(r);if(!n)return hO(t,e);const a={src:Lx(n.url||""),alt:e.alt};n.title!==null&&n.title!==void 0&&(a.title=n.title);const i={type:"element",tagName:"img",properties:a,children:[]};return t.patch(e,i),t.applyData(e,i)}function gge(t,e){const r={src:Lx(e.url)};e.alt!==null&&e.alt!==void 0&&(r.alt=e.alt),e.title!==null&&e.title!==void 0&&(r.title=e.title);const n={type:"element",tagName:"img",properties:r,children:[]};return t.patch(e,n),t.applyData(e,n)}function xge(t,e){const r={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,r);const n={type:"element",tagName:"code",properties:{},children:[r]};return t.patch(e,n),t.applyData(e,n)}function yge(t,e){const r=String(e.identifier).toUpperCase(),n=t.definitionById.get(r);if(!n)return hO(t,e);const a={href:Lx(n.url||"")};n.title!==null&&n.title!==void 0&&(a.title=n.title);const i={type:"element",tagName:"a",properties:a,children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function bge(t,e){const r={href:Lx(e.url)};e.title!==null&&e.title!==void 0&&(r.title=e.title);const n={type:"element",tagName:"a",properties:r,children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function vge(t,e,r){const n=t.all(e),a=r?wge(r):mO(e),i={},o=[];if(typeof e.checked=="boolean"){const d=n[0];let h;d&&d.type==="element"&&d.tagName==="p"?h=d:(h={type:"element",tagName:"p",properties:{},children:[]},n.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),i.className=["task-list-item"]}let l=-1;for(;++l<n.length;){const d=n[l];(a||l!==0||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:` 882`}),d.type==="element"&&d.tagName==="p"&&!a?o.push(...d.children):o.push(d)}const c=n[n.length-1];c&&(a||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:` 883`});const u={type:"element",tagName:"li",properties:i,children:o};return t.patch(e,u),t.applyData(e,u)}function wge(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const r=t.children;let n=-1;for(;!e&&++n<r.length;)e=mO(r[n])}return e}function mO(t){const e=t.spread;return e??t.children.length>1}function jge(t,e){const r={},n=t.all(e);let a=-1;for(typeof e.start=="number"&&e.start!==1&&(r.start=e.start);++a<n.length;){const o=n[a];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const i={type:"element",tagName:e.ordered?"ol":"ul",properties:r,children:t.wrap(n,!0)};return t.patch(e,i),t.applyData(e,i)}function Nge(t,e){const r={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function Fge(t,e){const r={type:"root",children:t.wrap(t.all(e))};return t.patch(e,r),t.applyData(e,r)}function Sge(t,e){const r={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function Cge(t,e){const r=t.all(e),n=r.shift(),a=[];if(n){const o={type:"element",tagName:"thead",properties:{},children:t.wrap([n],!0)};t.patch(e.children[0],o),a.push(o)}if(r.length>0){const o={type:"element",tagName:"tbody",properties:{},children:t.wrap(r,!0)},l=Rk(e.children[1]),c=GI(e.children[e.children.length-1]);l&&c&&(o.position={start:l,end:c}),a.push(o)}const i={type:"element",tagName:"table",properties:{},children:t.wrap(a,!0)};return t.patch(e,i),t.applyData(e,i)}function kge(t,e,r){const n=r?r.children:void 0,i=(n?n.indexOf(e):1)===0?"th":"td",o=r&&r.type==="table"?r.align:void 0,l=o?o.length:e.children.length;let c=-1;const u=[];for(;++c<l;){const h=e.children[c],f={},m=o?o[c]:void 0;m&&(f.align=m);let g={type:"element",tagName:i,properties:f,children:[]};h&&(g.children=t.all(h),t.patch(h,g),g=t.applyData(h,g)),u.push(g)}const d={type:"element",tagName:"tr",properties:{},children:t.wrap(u,!0)};return t.patch(e,d),t.applyData(e,d)}function _ge(t,e){const r={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}const MA=9,PA=32;function Ege(t){const e=String(t),r=/\r?\n|\r/g;let n=r.exec(e),a=0;const i=[];for(;n;)i.push(RA(e.slice(a,n.index),a>0,!0),n[0]),a=n.index+n[0].length,n=r.exec(e);return i.push(RA(e.slice(a),a>0,!1)),i.join("")}function RA(t,e,r){let n=0,a=t.length;if(e){let i=t.codePointAt(n);for(;i===MA||i===PA;)n++,i=t.codePointAt(n)}if(r){let i=t.codePointAt(a-1);for(;i===MA||i===PA;)a--,i=t.codePointAt(a-1)}return a>n?t.slice(n,a):""}function Age(t,e){const r={type:"text",value:Ege(String(e.value))};return t.patch(e,r),t.applyData(e,r)}function Dge(t,e){const r={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,r),t.applyData(e,r)}const Tge={blockquote:oge,break:lge,code:cge,delete:uge,emphasis:dge,footnoteReference:hge,heading:mge,html:fge,imageReference:pge,image:gge,inlineCode:xge,linkReference:yge,link:bge,listItem:vge,list:jge,paragraph:Nge,root:Fge,strong:Sge,table:Cge,tableCell:_ge,tableRow:kge,text:Age,thematicBreak:Dge,toml:gv,yaml:gv,definition:gv,footnoteDefinition:gv};function gv(){}const fO=-1,Jw=0,zy=1,R1=2,Hk=3,$k=4,Wk=5,qk=6,pO=7,gO=8,BA=typeof self=="object"?self:globalThis,Mge=(t,e)=>{const r=(a,i)=>(t.set(i,a),a),n=a=>{if(t.has(a))return t.get(a);const[i,o]=e[a];switch(i){case Jw:case fO:return r(o,a);case zy:{const l=r([],a);for(const c of o)l.push(n(c));return l}case R1:{const l=r({},a);for(const[c,u]of o)l[n(c)]=n(u);return l}case Hk:return r(new Date(o),a);case $k:{const{source:l,flags:c}=o;return r(new RegExp(l,c),a)}case Wk:{const l=r(new Map,a);for(const[c,u]of o)l.set(n(c),n(u));return l}case qk:{const l=r(new Set,a);for(const c of o)l.add(n(c));return l}case pO:{const{name:l,message:c}=o;return r(new BA[l](c),a)}case gO:return r(BigInt(o),a);case"BigInt":return r(Object(BigInt(o)),a);case"ArrayBuffer":return r(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return r(new DataView(l),o)}}return r(new BA[i](o),a)};return n},LA=t=>Mge(new Map,t)(0),rg="",{toString:Pge}={},{keys:Rge}=Object,gy=t=>{const e=typeof t;if(e!=="object"||!t)return[Jw,e];const r=Pge.call(t).slice(8,-1);switch(r){case"Array":return[zy,rg];case"Object":return[R1,rg];case"Date":return[Hk,rg];case"RegExp":return[$k,rg];case"Map":return[Wk,rg];case"Set":return[qk,rg];case"DataView":return[zy,r]}return r.includes("Array")?[zy,r]:r.includes("Error")?[pO,r]:[R1,r]},xv=([t,e])=>t===Jw&&(e==="function"||e==="symbol"),Bge=(t,e,r,n)=>{const a=(o,l)=>{const c=n.push(o)-1;return r.set(l,c),c},i=o=>{if(r.has(o))return r.get(o);let[l,c]=gy(o);switch(l){case Jw:{let d=o;switch(c){case"bigint":l=gO,d=o.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return a([fO],o)}return a([l,d],o)}case zy:{if(c){let f=o;return c==="DataView"?f=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(f=new Uint8Array(o)),a([c,[...f]],o)}const d=[],h=a([l,d],o);for(const f of o)d.push(i(f));return h}case R1:{if(c)switch(c){case"BigInt":return a([c,o.toString()],o);case"Boolean":case"Number":case"String":return a([c,o.valueOf()],o)}if(e&&"toJSON"in o)return i(o.toJSON());const d=[],h=a([l,d],o);for(const f of Rge(o))(t||!xv(gy(o[f])))&&d.push([i(f),i(o[f])]);return h}case Hk:return a([l,o.toISOString()],o);case $k:{const{source:d,flags:h}=o;return a([l,{source:d,flags:h}],o)}case Wk:{const d=[],h=a([l,d],o);for(const[f,m]of o)(t||!(xv(gy(f))||xv(gy(m))))&&d.push([i(f),i(m)]);return h}case qk:{const d=[],h=a([l,d],o);for(const f of o)(t||!xv(gy(f)))&&d.push(i(f));return h}}const{message:u}=o;return a([l,{name:c,message:u}],o)};return i},IA=(t,{json:e,lossy:r}={})=>{const n=[];return Bge(!(e||r),!!e,new Map,n)(t),n},B1=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?LA(IA(t,e)):structuredClone(t):(t,e)=>LA(IA(t,e));function Lge(t,e){const r=[{type:"text",value:"â©"}];return e>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),r}function Ige(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function Oge(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",r=t.options.footnoteBackContent||Lge,
vendor: 20,600 bytes, lines 883-889
883n=t.options.footnoteBackLabel||Ige,a=t.options.footnoteLabel||"Footnotes",i=t.options.footnoteLabelTagName||"h2",o=t.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<t.footnoteOrder.length;){const u=t.footnoteById.get(t.footnoteOrder[c]);if(!u)continue;const d=t.all(u),h=String(u.identifier).toUpperCase(),f=Lx(h.toLowerCase());let m=0;const g=[],y=t.footnoteCounts.get(h);for(;y!==void 0&&++m<=y;){g.length>0&&g.push({type:"text",value:" "});let j=typeof r=="string"?r:r(c,m);typeof j=="string"&&(j={type:"text",value:j}),g.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+f+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(c,m),className:["data-footnote-backref"]},children:Array.isArray(j)?j:[j]})}const b=d[d.length-1];if(b&&b.type==="element"&&b.tagName==="p"){const j=b.children[b.children.length-1];j&&j.type==="text"?j.value+=" ":b.children.push({type:"text",value:" "}),b.children.push(...g)}else d.push(...g);const w={type:"element",tagName:"li",properties:{id:e+"fn-"+f},children:t.wrap(d,!0)};t.patch(u,w),l.push(w)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:i,properties:{...B1(o),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:` 884`},{type:"element",tagName:"ol",properties:{},children:t.wrap(l,!0)},{type:"text",value:` 885`}]}}const Yw=function(t){if(t==null)return $ge;if(typeof t=="function")return Zw(t);if(typeof t=="object")return Array.isArray(t)?zge(t):Uge(t);if(typeof t=="string")return Hge(t);throw new Error("Expected function, string, or object as test")};function zge(t){const e=[];let r=-1;for(;++r<t.length;)e[r]=Yw(t[r]);return Zw(n);function n(...a){let i=-1;for(;++i<e.length;)if(e[i].apply(this,a))return!0;return!1}}function Uge(t){const e=t;return Zw(r);function r(n){const a=n;let i;for(i in t)if(a[i]!==e[i])return!1;return!0}}function Hge(t){return Zw(e);function e(r){return r&&r.type===t}}function Zw(t){return e;function e(r,n,a){return!!(Wge(r)&&t.call(this,r,typeof n=="number"?n:void 0,a||void 0))}}function $ge(){return!0}function Wge(t){return t!==null&&typeof t=="object"&&"type"in t}const xO=[],qge=!0,dS=!1,Gge="skip";function yO(t,e,r,n){let a;typeof e=="function"&&typeof r!="function"?(n=r,r=e):a=e;const i=Yw(a),o=n?-1:1;l(t,void 0,[])();function l(c,u,d){const h=c&&typeof c=="object"?c:{};if(typeof h.type=="string"){const m=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(c.type+(m?"<"+m+">":""))+")"})}return f;function f(){let m=xO,g,y,b;if((!e||i(c,u,d[d.length-1]||void 0))&&(m=Vge(r(c,d)),m[0]===dS))return m;if("children"in c&&c.children){const w=c;if(w.children&&m[0]!==Gge)for(y=(n?w.children.length:-1)+o,b=d.concat(w);y>-1&&y<w.children.length;){const j=w.children[y];if(g=l(j,y,b)(),g[0]===dS)return g;y=typeof g[1]=="number"?g[1]:y+o}}return m}}}function Vge(t){return Array.isArray(t)?t:typeof t=="number"?[qge,t]:t==null?xO:[t]}function Gk(t,e,r,n){let a,i,o;typeof e=="function"&&typeof r!="function"?(i=void 0,o=e,a=r):(i=e,o=r,a=n),yO(t,i,l,a);function l(c,u){const d=u[u.length-1],h=d?d.children.indexOf(c):void 0;return o(c,h,d)}}const hS={}.hasOwnProperty,Kge={};function Jge(t,e){const r=e||Kge,n=new Map,a=new Map,i=new Map,o={...Tge,...r.handlers},l={all:u,applyData:Zge,definitionById:n,footnoteById:a,footnoteCounts:i,footnoteOrder:[],handlers:o,one:c,options:r,patch:Yge,wrap:Qge};return Gk(t,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const h=d.type==="definition"?n:a,f=String(d.identifier).toUpperCase();h.has(f)||h.set(f,d)}}),l;function c(d,h){const f=d.type,m=l.handlers[f];if(hS.call(l.handlers,f)&&m)return m(l,d,h);if(l.options.passThrough&&l.options.passThrough.includes(f)){if("children"in d){const{children:y,...b}=d,w=B1(b);return w.children=l.all(d),w}return B1(d)}return(l.options.unknownHandler||Xge)(l,d,h)}function u(d){const h=[];if("children"in d){const f=d.children;let m=-1;for(;++m<f.length;){const g=l.one(f[m],d);if(g){if(m&&f[m-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=OA(g.value)),!Array.isArray(g)&&g.type==="element")){const y=g.children[0];y&&y.type==="text"&&(y.value=OA(y.value))}Array.isArray(g)?h.push(...g):h.push(g)}}}return h}}function Yge(t,e){t.position&&(e.position=Ime(t))}function Zge(t,e){let r=e;if(t&&t.data){const n=t.data.hName,a=t.data.hChildren,i=t.data.hProperties;if(typeof n=="string")if(r.type==="element")r.tagName=n;else{const o="children"in r?r.children:[r];r={type:"element",tagName:n,properties:{},children:o}}r.type==="element"&&i&&Object.assign(r.properties,B1(i)),"children"in r&&r.children&&a!==null&&a!==void 0&&(r.children=a)}return r}function Xge(t,e){const r=e.data||{},n="value"in e&&!(hS.call(r,"hProperties")||hS.call(r,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Qge(t,e){const r=[];let n=-1;for(e&&r.push({type:"text",value:` 886`});++n<t.length;)n&&r.push({type:"text",value:` 887`}),r.push(t[n]);return e&&t.length>0&&r.push({type:"text",value:` 888`}),r}function OA(t){let e=0,r=t.charCodeAt(e);for(;r===9||r===32;)e++,r=t.charCodeAt(e);return t.slice(e)}function zA(t,e){const r=Jge(t,e),n=r.one(t,void 0),a=Oge(r),i=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return a&&i.children.push({type:"text",value:` 889`},a),i}function exe(t,e){return t&&"run"in t?async function(r,n){const a=zA(r,{file:n,...e});await t.run(a,n)}:function(r,n){return zA(r,{file:n,...t||e})}}function UA(t){if(t)throw t}var Jv=Object.prototype.hasOwnProperty,bO=Object.prototype.toString,HA=Object.defineProperty,$A=Object.getOwnPropertyDescriptor,WA=function(e){return typeof Array.isArray=="function"?Array.isArray(e):bO.call(e)==="[object Array]"},qA=function(e){if(!e||bO.call(e)!=="[object Object]")return!1;var r=Jv.call(e,"constructor"),n=e.constructor&&e.constructor.prototype&&Jv.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!r&&!n)return!1;var a;for(a in e);return typeof a>"u"||Jv.call(e,a)},GA=function(e,r){HA&&r.name==="__proto__"?HA(e,r.name,{enumerable:!0,configurable:!0,value:r.newValue,writable:!0}):e[r.name]=r.newValue},VA=function(e,r){if(r==="__proto__")if(Jv.call(e,r)){if($A)return $A(e,r).value}else return;return e[r]},txe=function t(){var e,r,n,a,i,o,l=arguments[0],c=1,u=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});c<u;++c)if(e=arguments[c],e!=null)for(r in e)n=VA(l,r),a=VA(e,r),l!==a&&(d&&a&&(qA(a)||(i=WA(a)))?(i?(i=!1,o=n&&WA(n)?n:[]):o=n&&qA(n)?n:{},GA(l,{name:r,newValue:t(d,o,a)})):typeof a<"u"&&GA(l,{name:r,newValue:a}));return l};const q2=iC(txe);function mS(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function rxe(){const t=[],e={run:r,use:n};return e;function r(...a){let i=-1;const o=a.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...a);function l(c,...u){const d=t[++i];let h=-1;if(c){o(c);return}for(;++h<a.length;)(u[h]===null||u[h]===void 0)&&(u[h]=a[h]);a=u,d?sxe(d,l)(...u):o(null,...u)}}function n(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return t.push(a),e}}function sxe(t,e){let r;return n;function n(...o){const l=t.length>o.length;let c;l&&o.push(a);try{c=t.apply(this,o)}catch(u){const d=u;if(l&&r)throw d;return a(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(i,a):c instanceof Error?a(c):i(c))}function a(o,...l){r||(r=!0,e(o,...l))}function i(o){a(null,o)}}const uu={basename:nxe,dirname:axe,extname:ixe,join:oxe,sep:"/"};function nxe(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');X0(t);let r=0,n=-1,a=t.length,i;if(e===void 0||e.length===0||e.length>t.length){for(;a--;)if(t.codePointAt(a)===47){if(i){r=a+1;break}}else n<0&&(i=!0,n=a+1);return n<0?"":t.slice(r,n)}if(e===t)return"";let o=-1,l=e.length-1;for(;a--;)if(t.codePointAt(a)===47){if(i){r=a+1;break}}else o<0&&(i=!0,o=a+1),l>-1&&(t.codePointAt(a)===e.codePointAt(l--)?l<0&&(n=a):(l=-1,n=o));return r===n?n=o:n<0&&(n=t.length),t.slice(r,n)}function axe(t){if(X0(t),t.length===0)return".";let e=-1,r=t.length,n;for(;--r;)if(t.codePointAt(r)===47){if(n){e=r;break}}else n||(n=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function ixe(t){X0(t);let e=t.length,r=-1,n=0,a=-1,i=0,o;for(;e--;){const l=t.codePointAt(e);if(l===47){if(o){n=e+1;break}continue}r<0&&(o=!0,r=e+1),l===46?a<0?a=e:i!==1&&(i=1):a>-1&&(i=-1)}return a<0||r<0||i===0||i===1&&a===r-1&&a===n+1?"":t.slice(a,r)}function oxe(...t){let e=-1,r;for(;++e<t.length;)X0(t[e]),t[e]&&(r=r===void 0?t[e]:r+"/"+t[e]);return r===void 0?".":lxe(r)}function lxe(t){X0(t);const e=t.codePointAt(0)===47;let r=cxe(t,!e);return r.length===0&&!e&&(r="."),r.length>0&&t.codePointAt(t.length-1)===47&&(r+="/"),e?"/"+r:r}function cxe(t,e){let r="",n=0,a=-1,i=0,o=-1,l,c;for(;++o<=t.length;){if(o<t.length)l=t.codePointAt(o);else{if(l===47)break;l=47}if(l===47){if(!(a===o-1||i===1))if(a!==o-1&&i===2){if(r.length<2||n!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(c=r.lastIndexOf("/"),c!==r.length-1){c<0?(r="",n=0):(r=r.slice(0,c),n=r.length-1-r.lastIndexOf("/")),a=o,i=0;continue}}else if(r.length>0){r="",n=0,a=o,i=0;continue}}e&&(r=r.length>0?r+"/..":"..",n=2)}else r.length>0?r+="/"+t.slice(a+1,o):r=t.slice(a+1,o),n=o-a-1;a=o,i=0}else l===46&&i>-1?i++:i=-1}return r}function X0(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const uxe={cwd:dxe};function dxe(){return"/"}function fS(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function hxe(t){if(typeof t=="string")t=new URL(t);else if(!fS(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return mxe(t)}function mxe(t){if(t.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const e=t.pathname;let r=-1;for(;++r<e.length;)if(e.codePointAt(r)===37&&e.codePointAt(r+1)===50){const n=e.codePointAt(r+2);if(n===70||n===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(e)}const G2=["history","path","basename","stem","extname","dirname"];class vO{constructor(e){let r;e?fS(e)?r={path:e}:typeof e=="string"||fxe(e)?r={value:e}:r=e:r={},this.cwd="cwd"in r?"":uxe.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<G2.length;){const i=G2[n];i in r&&r[i]!==void 0&&r[i]!==null&&(this[i]=i==="history"?[...r[i]]:r[i])}let a;for(a in r)G2.includes(a)||(this[a]=r[a])}get basename(){return typeof this.path=="string"?uu.basename(this.path):void 0}set basename(e){K2(e,"basename"),V2(e,"basename"),this.path=uu.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?uu.dirname(this.path):void 0}set dirname(e){KA(this.basename,"dirname"),this.path=uu.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?uu.extname(this.path):void 0}set extname(e){if(V2(e,"extname"),KA(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=uu.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){fS(e)&&(e=hxe(e)),K2(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?uu.basename(this.path,this.extname):void 0}set stem(e){K2(e,"stem"),V2(e,"stem"),this.path=uu.join(this.dirname||"",e+(this.extname||""))}fail(e,r,n){const a=this.message(e,r,n);throw a.fatal=!0,a}info(e,r,n){const a=this.message(e,r,n);return a.fatal=void 0,a}message(e,r,n){const a=new qi(e,r,n);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function V2(t,e){if(t&&t.includes(uu.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+uu.sep+"`")}function K2(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function KA(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function fxe(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const pxe=function(t){const n=this.constructor.prototype,a=n[t],i=function(){return a.apply(i,arguments)};return Object.setPrototypeOf(i,n),i},gxe={}.hasOwnProperty;class Vk extends pxe{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=rxe()}copy(){const e=new Vk;let r=-1;for(;++r<this.attachers.length;){const n=this.attachers[r];e.use(...n)}return e.data(q2(!0,{},this.namespace)),e}data(e,r){return typeof e=="string"?arguments.length===2?(Z2("data",this.frozen),this.namespace[e]=r,this):gxe.call(this.namespace,e)&&this.namespace[e]||void 0:e?(Z2("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);const a=r.call(e,...n);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const r=yv(e),n=this.parser||this.Parser;return J2("parse",n),n(String(r),r)}process(e,r){const n=this;return this.freeze(),J2("process",this.parser||this.Parser),Y2("process",this.compiler||this.Compiler),r?a(void 0,r):new Promise(a);function a(i,o){const l=yv(e),c=n.parse(l);n.run(c,l,function(d,h,f){if(d||!h||!f)return u(d);const m=h,g=n.stringify(m,f);bxe(g)?f.value=g:f.result=g,u(d,f)});function u(d,h){d||!h?o(d):i?i(h):r(void 0,h)}}}processSync(e){let r=!1,n;return this.freeze(),J2("processSync",this.parser||this.Parser),Y2("processSync",this.compiler||this.Compiler),this.process(e,a),YA("processSync","process",r),n;function a(i,o){r=!0,UA(i),n=o}}run(e,r,n){JA(e),this.freeze();const a=this.transformers;return!n&&typeof r=="function"&&(n=r,r=void 0),n?i(void 0,n):new Promise(i);function i(o,l){const c=yv(r);a.run(e,c,u);function u(d,h,f){const m=h||e;d?l(d):o?o(m):n(void 0,m,f)}}}runSync(e,r){let n=!1,a;return this.run(e,r,i),YA("runSync","run",n),a;function i(o,l){UA(o),a=l,n=!0}}stringify(e,r){this.freeze();const n=yv(r),a=this.compiler||this.Compiler;return Y2("stringify",a),JA(e),a(e,n)}use(e,...r){const n=this.attachers,a=this.namespace;if(Z2("use",this.frozen),e!=null)if(typeof e=="function")c(e,r);else if(typeof e=="object")Array.isArray(e)?l(e):o(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function i(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...h]=u;c(d,h)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))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(u.plugins),u.settings&&(a.settings=q2(!0,a.settings,u.settings))}function l(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const h=u[d];i(h)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let h=-1,f=-1;for(;++h<n.length;)if(n[h][0]===u){f=h;break}if(f===-1)n.push([u,...d]);else if(d.length>0){let[m,...g]=d;const y=n[f][1];mS(y)&&mS(m)&&(m=q2(!0,y,m)),n[f]=[u,m,...g]}}}}const xxe=new Vk().freeze();function J2(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function Y2(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function Z2(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function JA(t){if(!mS(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function YA(t,e,r){if(!r)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function yv(t){return yxe(t)?t:new vO(t)}function yxe(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function bxe(t){return typeof t=="string"||vxe(t)}function vxe(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const wxe="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",ZA=[],XA={allowDangerousHtml:!0},jxe=/^(https?|ircs?|mailto|xmpp)$/i,Nxe=[{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 Xw(t){const e=Fxe(t),r=Sxe(t);return Cxe(e.runSync(e.parse(r),r),t)}function Fxe(t){const e=t.rehypePlugins||ZA,r=t.remarkPlugins||ZA,n=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...XA}:XA;return xxe().use(ige).use(r).use(exe,n).use(e)}function Sxe(t){const e=t.children||"",r=new vO;return typeof e=="string"&&(r.value=e),r}function Cxe(t,e){const r=e.allowedElements,n=e.allowElement,a=e.components,i=e.disallowedElements,o=e.skipHtml,l=e.unwrapDisallowed,c=e.urlTransform||kxe;for(const d of Nxe)Object.hasOwn(e,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+wxe+d.id,void 0);return Gk(t,u),$me(t,{Fragment:s.Fragment,components:a,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function u(d,h,f){if(d.type==="raw"&&f&&typeof h=="number")return o?f.children.splice(h,1):f.children[h]={type:"text",value:d.value},h;if(d.type==="element"){let m;for(m in H2)if(Object.hasOwn(H2,m)&&Object.hasOwn(d.properties,m)){const g=d.properties[m],y=H2[m];(y===null||y.includes(d.tagName))&&(d.properties[m]=c(String(g||""),m,d))}}if(d.type==="element"){let m=r?!r.includes(d.tagName):i?i.includes(d.tagName):!1;if(!m&&n&&typeof h=="number"&&(m=!n(d,h,f)),m&&f&&typeof h=="number")return l&&d.children?f.children.splice(h,1,...d.children):f.children.splice(h,1),h}}}function kxe(t){const e=t.indexOf(":"),r=t.indexOf("?"),n=t.indexOf("#"),a=t.indexOf("/");return e===-1||a!==-1&&e>a||r!==-1&&e>r||n!==-1&&e>n||jxe.test(t.slice(0,e))?t:""}function QA(t,e){const r=String(t);if(typeof e!="string")throw new TypeError("Expected character");let n=0,a=r.indexOf(e);for(;a!==-1;)n++,a=r.indexOf(e,a+e.length);return n}function _xe(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Exe(t,e,r){const a=Yw((r||{}).ignore||[]),i=Axe(e);let o=-1;for(;++o<i.length;)yO(t,"text",l);function l(u,d){let h=-1,f;for(;++h<d.length;){const m=d[h],g=f?f.children:void 0;if(a(m,g?g.indexOf(m):void 0,f))return;f=m}if(f)return c(u,d)}
vendor: 4,954 bytes, lines 889-890
889function c(u,d){const h=d[d.length-1],f=i[o][0],m=i[o][1];let g=0;const b=h.children.indexOf(u);let w=!1,j=[];f.lastIndex=0;let N=f.exec(u.value);for(;N;){const S=N.index,E={index:N.index,input:N.input,stack:[...d,u]};let C=m(...N,E);if(typeof C=="string"&&(C=C.length>0?{type:"text",value:C}:void 0),C===!1?f.lastIndex=S+1:(g!==S&&j.push({type:"text",value:u.value.slice(g,S)}),Array.isArray(C)?j.push(...C):C&&j.push(C),g=S+N[0].length,w=!0),!f.global)break;N=f.exec(u.value)}return w?(g<u.value.length&&j.push({type:"text",value:u.value.slice(g)}),h.children.splice(b,1,...j)):j=[u],b+j.length}}function Axe(t){const e=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const r=!t[0]||Array.isArray(t[0])?t:[t];let n=-1;for(;++n<r.length;){const a=r[n];e.push([Dxe(a[0]),Txe(a[1])])}return e}function Dxe(t){return typeof t=="string"?new RegExp(_xe(t),"g"):t}function Txe(t){return typeof t=="function"?t:function(){return t}}const X2="phrasing",Q2=["autolink","link","image","label"];function Mxe(){return{transforms:[zxe],enter:{literalAutolink:Rxe,literalAutolinkEmail:eN,literalAutolinkHttp:eN,literalAutolinkWww:eN},exit:{literalAutolink:Oxe,literalAutolinkEmail:Ixe,literalAutolinkHttp:Bxe,literalAutolinkWww:Lxe}}}function Pxe(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:X2,notInConstruct:Q2},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:X2,notInConstruct:Q2},{character:":",before:"[ps]",after:"\\/",inConstruct:X2,notInConstruct:Q2}]}}function Rxe(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function eN(t){this.config.enter.autolinkProtocol.call(this,t)}function Bxe(t){this.config.exit.autolinkProtocol.call(this,t)}function Lxe(t){this.config.exit.data.call(this,t);const e=this.stack[this.stack.length-1];e.type,e.url="http://"+this.sliceSerialize(t)}function Ixe(t){this.config.exit.autolinkEmail.call(this,t)}function Oxe(t){this.exit(t)}function zxe(t){Exe(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Uxe],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),Hxe]],{ignore:["link","linkReference"]})}function Uxe(t,e,r,n,a){let i="";if(!wO(a)||(/^w/i.test(e)&&(r=e+r,e="",i="http://"),!$xe(r)))return!1;const o=Wxe(r+n);if(!o[0])return!1;const l={type:"link",title:null,url:i+e+o[0],children:[{type:"text",value:e+o[0]}]};return o[1]?[l,{type:"text",value:o[1]}]:l}function Hxe(t,e,r,n){return!wO(n,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+e+"@"+r,children:[{type:"text",value:e+"@"+r}]}}function $xe(t){const e=t.split(".");return!(e.length<2||e[e.length-1]&&(/_/.test(e[e.length-1])||!/[a-zA-Z\d]/.test(e[e.length-1]))||e[e.length-2]&&(/_/.test(e[e.length-2])||!/[a-zA-Z\d]/.test(e[e.length-2])))}function Wxe(t){const e=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!e)return[t,void 0];t=t.slice(0,e.index);let r=e[0],n=r.indexOf(")");const a=QA(t,"(");let i=QA(t,")");for(;n!==-1&&a>i;)t+=r.slice(0,n+1),r=r.slice(n+1),n=r.indexOf(")"),i++;return[t,r]}function wO(t,e){const r=t.input.charCodeAt(t.index-1);return(t.index===0||Qf(r)||Vw(r))&&(!e||r!==47)}jO.peek=Qxe;function qxe(){this.buffer()}function Gxe(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function Vxe(){this.buffer()}function Kxe(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function Jxe(t){const e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Lc(this.sliceSerialize(t)).toLowerCase(),r.label=e}function Yxe(t){this.exit(t)}function Zxe(t){const e=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=Lc(this.sliceSerialize(t)).toLowerCase(),r.label=e}function Xxe(t){this.exit(t)}function Qxe(){return"["}function jO(t,e,r,n){const a=r.createTracker(n);let i=a.move("[^");const o=r.enter("footnoteReference"),l=r.enter("reference");return i+=a.move(r.safe(r.associationId(t),{after:"]",before:i})),l(),o(),i+=a.move("]"),i}function eye(){return{enter:{gfmFootnoteCallString:qxe,gfmFootnoteCall:Gxe,gfmFootnoteDefinitionLabelString:Vxe,gfmFootnoteDefinition:Kxe},exit:{gfmFootnoteCallString:Jxe,gfmFootnoteCall:Yxe,gfmFootnoteDefinitionLabelString:Zxe,gfmFootnoteDefinition:Xxe}}}function tye(t){let e=!1;return t&&t.firstLineBlank&&(e=!0),{handlers:{footnoteDefinition:r,footnoteReference:jO},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(n,a,i,o){const l=i.createTracker(o);let c=l.move("[^");const u=i.enter("footnoteDefinition"),d=i.enter("label");return c+=l.move(i.safe(i.associationId(n),{before:c,after:"]"})),d(),c+=l.move("]:"),n.children&&n.children.length>0&&(l.shift(4),c+=l.move((e?` 890`:" ")+i.indentLines(i.containerFlow(n,l.current()),e?NO:rye))),u(),c}}function rye(t,e,r){return e===0?t:NO(t,e,r)}function NO(t,e,r){return(r?"":" ")+t}const sye=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];FO.peek=lye;
vendor: 13,715 bytes, lines 890-902
890function nye(){return{canContainEols:["delete"],enter:{strikethrough:iye},exit:{strikethrough:oye}}}function aye(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:sye}],handlers:{delete:FO}}}function iye(t){this.enter({type:"delete",children:[]},t)}function oye(t){this.exit(t)}function FO(t,e,r,n){const a=r.createTracker(n),i=r.enter("strikethrough");let o=a.move("~~");return o+=r.containerPhrasing(t,{...a.current(),before:o,after:"~"}),o+=a.move("~~"),i(),o}function lye(){return"~"}function cye(t){return t.length}function uye(t,e){const r=e||{},n=(r.align||[]).concat(),a=r.stringLength||cye,i=[],o=[],l=[],c=[];let u=0,d=-1;for(;++d<t.length;){const y=[],b=[];let w=-1;for(t[d].length>u&&(u=t[d].length);++w<t[d].length;){const j=dye(t[d][w]);if(r.alignDelimiters!==!1){const N=a(j);b[w]=N,(c[w]===void 0||N>c[w])&&(c[w]=N)}y.push(j)}o[d]=y,l[d]=b}let h=-1;if(typeof n=="object"&&"length"in n)for(;++h<u;)i[h]=e3(n[h]);else{const y=e3(n);for(;++h<u;)i[h]=y}h=-1;const f=[],m=[];for(;++h<u;){const y=i[h];let b="",w="";y===99?(b=":",w=":"):y===108?b=":":y===114&&(w=":");let j=r.alignDelimiters===!1?1:Math.max(1,c[h]-b.length-w.length);const N=b+"-".repeat(j)+w;r.alignDelimiters!==!1&&(j=b.length+j+w.length,j>c[h]&&(c[h]=j),m[h]=j),f[h]=N}o.splice(1,0,f),l.splice(1,0,m),d=-1;const g=[];for(;++d<o.length;){const y=o[d],b=l[d];h=-1;const w=[];for(;++h<u;){const j=y[h]||"";let N="",S="";if(r.alignDelimiters!==!1){const E=c[h]-(b[h]||0),C=i[h];C===114?N=" ".repeat(E):C===99?E%2?(N=" ".repeat(E/2+.5),S=" ".repeat(E/2-.5)):(N=" ".repeat(E/2),S=N):S=" ".repeat(E)}r.delimiterStart!==!1&&!h&&w.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&j==="")&&(r.delimiterStart!==!1||h)&&w.push(" "),r.alignDelimiters!==!1&&w.push(N),w.push(j),r.alignDelimiters!==!1&&w.push(S),r.padding!==!1&&w.push(" "),(r.delimiterEnd!==!1||h!==u-1)&&w.push("|")}g.push(r.delimiterEnd===!1?w.join("").replace(/ +$/,""):w.join(""))}return g.join(` 891`)}function dye(t){return t==null?"":String(t)}function e3(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function hye(t,e,r,n){const a=r.enter("blockquote"),i=r.createTracker(n);i.move("> "),i.shift(2);const o=r.indentLines(r.containerFlow(t,i.current()),mye);return a(),o}function mye(t,e,r){return">"+(r?"":" ")+t}function fye(t,e){return t3(t,e.inConstruct,!0)&&!t3(t,e.notInConstruct,!1)}function t3(t,e,r){if(typeof e=="string"&&(e=[e]),!e||e.length===0)return r;let n=-1;for(;++n<e.length;)if(t.includes(e[n]))return!0;return!1}function r3(t,e,r,n){let a=-1;for(;++a<r.unsafe.length;)if(r.unsafe[a].character===` 892`&&fye(r.stack,r.unsafe[a]))return/[ \t]/.test(n.before)?"":" ";return`\\ 893`}function pye(t,e){const r=String(t);let n=r.indexOf(e),a=n,i=0,o=0;if(typeof e!="string")throw new TypeError("Expected substring");for(;n!==-1;)n===a?++i>o&&(o=i):i=1,a=n+e.length,n=r.indexOf(e,a);return o}function gye(t,e){return!!(e.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function xye(t){const e=t.options.fence||"`";if(e!=="`"&&e!=="~")throw new Error("Cannot serialize code with `"+e+"` for `options.fence`, expected `` ` `` or `~`");return e}function yye(t,e,r,n){const a=xye(r),i=t.value||"",o=a==="`"?"GraveAccent":"Tilde";if(gye(t,r)){const h=r.enter("codeIndented"),f=r.indentLines(i,bye);return h(),f}const l=r.createTracker(n),c=a.repeat(Math.max(pye(i,a)+1,3)),u=r.enter("codeFenced");let d=l.move(c);if(t.lang){const h=r.enter(`codeFencedLang${o}`);d+=l.move(r.safe(t.lang,{before:d,after:" ",encode:["`"],...l.current()})),h()}if(t.lang&&t.meta){const h=r.enter(`codeFencedMeta${o}`);d+=l.move(" "),d+=l.move(r.safe(t.meta,{before:d,after:` 894`,encode:["`"],...l.current()})),h()}return d+=l.move(` 895`),i&&(d+=l.move(i+` 896`)),d+=l.move(c),u(),d}function bye(t,e,r){return(r?"":" ")+t}function Kk(t){const e=t.options.quote||'"';if(e!=='"'&&e!=="'")throw new Error("Cannot serialize title with `"+e+"` for `options.quote`, expected `\"`, or `'`");return e}function vye(t,e,r,n){const a=Kk(r),i=a==='"'?"Quote":"Apostrophe",o=r.enter("definition");let l=r.enter("label");const c=r.createTracker(n);let u=c.move("[");return u+=c.move(r.safe(r.associationId(t),{before:u,after:"]",...c.current()})),u+=c.move("]: "),l(),!t.url||/[\0- \u007F]/.test(t.url)?(l=r.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(r.safe(t.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=r.enter("destinationRaw"),u+=c.move(r.safe(t.url,{before:u,after:t.title?" ":` 897`,...c.current()}))),l(),t.title&&(l=r.enter(`title${i}`),u+=c.move(" "+a),u+=c.move(r.safe(t.title,{before:u,after:a,...c.current()})),u+=c.move(a),l()),o(),u}function wye(t){const e=t.options.emphasis||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize emphasis with `"+e+"` for `options.emphasis`, expected `*`, or `_`");return e}function m0(t){return"&#x"+t.toString(16).toUpperCase()+";"}function L1(t,e,r){const n=lx(t),a=lx(e);return n===void 0?a===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:n===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}SO.peek=jye;function SO(t,e,r,n){const a=wye(r),i=r.enter("emphasis"),o=r.createTracker(n),l=o.move(a);let c=o.move(r.containerPhrasing(t,{after:a,before:l,...o.current()}));const u=c.charCodeAt(0),d=L1(n.before.charCodeAt(n.before.length-1),u,a);d.inside&&(c=m0(u)+c.slice(1));const h=c.charCodeAt(c.length-1),f=L1(n.after.charCodeAt(0),h,a);f.inside&&(c=c.slice(0,-1)+m0(h));const m=o.move(a);return i(),r.attentionEncodeSurroundingInfo={after:f.outside,before:d.outside},l+c+m}function jye(t,e,r){return r.options.emphasis||"*"}function Nye(t,e){let r=!1;return Gk(t,function(n){if("value"in n&&/\r?\n|\r/.test(n.value)||n.type==="break")return r=!0,dS}),!!((!t.depth||t.depth<3)&&Ok(t)&&(e.options.setext||r))}function Fye(t,e,r,n){const a=Math.max(Math.min(6,t.depth||1),1),i=r.createTracker(n);if(Nye(t,r)){const d=r.enter("headingSetext"),h=r.enter("phrasing"),f=r.containerPhrasing(t,{...i.current(),before:` 898`,after:` 899`});return h(),d(),f+` 900`+(a===1?"=":"-").repeat(f.length-(Math.max(f.lastIndexOf("\r"),f.lastIndexOf(` 901`))+1))}const o="#".repeat(a),l=r.enter("headingAtx"),c=r.enter("phrasing");i.move(o+" ");let u=r.containerPhrasing(t,{before:"# ",after:` 902`,...i.current()});return/^[\t ]/.test(u)&&(u=m0(u.charCodeAt(0))+u.slice(1)),u=u?o+" "+u:o,r.options.closeAtx&&(u+=" "+o),c(),l(),u}CO.peek=Sye;function CO(t){return t.value||""}function Sye(){return"<"}kO.peek=Cye;function kO(t,e,r,n){const a=Kk(r),i=a==='"'?"Quote":"Apostrophe",o=r.enter("image");let l=r.enter("label");const c=r.createTracker(n);let u=c.move("![");return u+=c.move(r.safe(t.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),l(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(l=r.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(r.safe(t.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(l=r.enter("destinationRaw"),u+=c.move(r.safe(t.url,{before:u,after:t.title?" ":")",...c.current()}))),l(),t.title&&(l=r.enter(`title${i}`),u+=c.move(" "+a),u+=c.move(r.safe(t.title,{before:u,after:a,...c.current()})),u+=c.move(a),l()),u+=c.move(")"),o(),u}function Cye(){return"!"}_O.peek=kye;function _O(t,e,r,n){const a=t.referenceType,i=r.enter("imageReference");let o=r.enter("label");const l=r.createTracker(n);let c=l.move("![");const u=r.safe(t.alt,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=r.stack;r.stack=[],o=r.enter("reference");const h=r.safe(r.associationId(t),{before:c,after:"]",...l.current()});return o(),r.stack=d,i(),a==="full"||!u||u!==h?c+=l.move(h+"]"):a==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function kye(){return"!"}EO.peek=_ye;function EO(t,e,r){let n=t.value||"",a="`",i=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(n);)a+="`";for(/[^ \r\n]/.test(n)&&(/^[ \r\n]/.test(n)&&/[ \r\n]$/.test(n)||/^`|`$/.test(n))&&(n=" "+n+" ");++i<r.unsafe.length;){const o=r.unsafe[i],l=r.compilePattern(o);let c;if(o.atBreak)for(;c=l.exec(n);){let u=c.index;n.charCodeAt(u)===10&&n.charCodeAt(u-1)===13&&u--,n=n.slice(0,u)+" "+n.slice(c.index+1)}}return a+n+a}function _ye(){return"`"}function AO(t,e){const r=Ok(t);return!!(!e.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(r===t.url||"mailto:"+r===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}DO.peek=Eye;function DO(t,e,r,n){const a=Kk(r),i=a==='"'?"Quote":"Apostrophe",o=r.createTracker(n);let l,c;if(AO(t,r)){const d=r.stack;r.stack=[],l=r.enter("autolink");let h=o.move("<");return h+=o.move(r.containerPhrasing(t,{before:h,after:">",...o.current()})),h+=o.move(">"),l(),r.stack=d,h}l=r.enter("link"),c=r.enter("label");let u=o.move("[");return u+=o.move(r.containerPhrasing(t,{before:u,after:"](",...o.current()})),u+=o.move("]("),c(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(c=r.enter("destinationLiteral"),u+=o.move("<"),u+=o.move(r.safe(t.url,{before:u,after:">",...o.current()})),u+=o.move(">")):(c=r.enter("destinationRaw"),u+=o.move(r.safe(t.url,{before:u,after:t.title?" ":")",...o.current()}))),c(),t.title&&(c=r.enter(`title${i}`),u+=o.move(" "+a),u+=o.move(r.safe(t.title,{before:u,after:a,...o.current()})),u+=o.move(a),c()),u+=o.move(")"),l(),u}function Eye(t,e,r){return AO(t,r)?"<":"["}TO.peek=Aye;function TO(t,e,r,n){const a=t.referenceType,i=r.enter("linkReference");let o=r.enter("label");const l=r.createTracker(n);let c=l.move("[");const u=r.containerPhrasing(t,{before:c,after:"]",...l.current()});c+=l.move(u+"]["),o();const d=r.stack;r.stack=[],o=r.enter("reference");const h=r.safe(r.associationId(t),{before:c,after:"]",...l.current()});return o(),r.stack=d,i(),a==="full"||!u||u!==h?c+=l.move(h+"]"):a==="shortcut"?c=c.slice(0,-1):c+=l.move("]"),c}function Aye(){return"["}function Jk(t){const e=t.options.bullet||"*";if(e!=="*"&&e!=="+"&&e!=="-")throw new Error("Cannot serialize items with `"+e+"` for `options.bullet`, expected `*`, `+`, or `-`");return e}function Dye(t){const e=Jk(t),r=t.options.bulletOther;if(!r)return e==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===e)throw new Error("Expected `bullet` (`"+e+"`) and `bulletOther` (`"+r+"`) to be different");return r}function Tye(t){const e=t.options.bulletOrdered||".";if(e!=="."&&e!==")")throw new Error("Cannot serialize items with `"+e+"` for `options.bulletOrdered`, expected `.` or `)`");return e}function MO(t){const e=t.options.rule||"*";if(e!=="*"&&e!=="-"&&e!=="_")throw new Error("Cannot serialize rules with `"+e+"` for `options.rule`, expected `*`, `-`, or `_`");return e}function Mye(t,e,r,n){const a=r.enter("list"),i=r.bulletCurrent;let o=t.ordered?Tye(r):Jk(r);const l=t.ordered?o==="."?")":".":Dye(r);let c=e&&r.bulletLastUsed?o===r.bulletLastUsed:!1;if(!t.ordered){const d=t.children?t.children[0]:void 0;if((o==="*"||o==="-")&&d&&(!d.children||!d.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(c=!0),MO(r)===o&&d){let h=-1;for(;++h<t.children.length;){const f=t.children[h];if(f&&f.type==="listItem"&&f.children&&f.children[0]&&f.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(o=l),r.bulletCurrent=o;const u=r.containerFlow(t,n);return r.bulletLastUsed=o,r.bulletCurrent=i,a(),u}function Pye(t){const e=t.options.listItemIndent||"one";if(e!=="tab"&&e!=="one"&&e!=="mixed")throw new Error("Cannot serialize items with `"+e+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return e}function Rye(t,e,r,n){const a=Pye(r);let i=r.bulletCurrent||Jk(r);e&&e.type==="list"&&e.ordered&&(i=(typeof e.start=="number"&&e.start>-1?e.start:1)+(r.options.incrementListMarker===!1?0:e.children.indexOf(t))+i);let o=i.length+1;(a==="tab"||a==="mixed"&&(e&&e.type==="list"&&e.spread||t.spread))&&(o=Math.ceil(o/4)*4);const l=r.createTracker(n);l.move(i+" ".repeat(o-i.length)),l.shift(o);const c=r.enter("listItem"),u=r.indentLines(r.containerFlow(t,l.current()),d);return c(),u;function d(h,f,m){return f?(m?"":" ".repeat(o))+h:(m?i:i+" ".repeat(o-i.length))+h}}function Bye(t,e,r,n){const a=r.enter("paragraph"),i=r.enter("phrasing"),o=r.containerPhrasing(t,n);return i(),a(),o}const Lye=Yw(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Iye(t,e,r,n){return(t.children.some(function(o){return Lye(o)})?r.containerPhrasing:r.containerFlow).call(r,t,n)}function Oye(t){const e=t.options.strong||"*";if(e!=="*"&&e!=="_")throw new Error("Cannot serialize strong with `"+e+"` for `options.strong`, expected `*`, or `_`");return e}PO.peek=zye;function PO(t,e,r,n){const a=Oye(r),i=r.enter("strong"),o=r.createTracker(n),l=o.move(a+a);let c=o.move(r.containerPhrasing(t,{after:a,before:l,...o.current()}));const u=c.charCodeAt(0),d=L1(n.before.charCodeAt(n.before.length-1),u,a);d.inside&&(c=m0(u)+c.slice(1));const h=c.charCodeAt(c.length-1),f=L1(n.after.charCodeAt(0),h,a);f.inside&&(c=c.slice(0,-1)+m0(h));const m=o.move(a+a);return i(),r.attentionEncodeSurroundingInfo={after:f.outside,before:d.outside},l+c+m}function zye(t,e,r){return r.options.strong||"*"}
vendor: 5,116 bytes, lines 902-904
902function Uye(t,e,r,n){return r.safe(t.value,n)}function Hye(t){const e=t.options.ruleRepetition||3;if(e<3)throw new Error("Cannot serialize rules with repetition `"+e+"` for `options.ruleRepetition`, expected `3` or more");return e}function $ye(t,e,r){const n=(MO(r)+(r.options.ruleSpaces?" ":"")).repeat(Hye(r));return r.options.ruleSpaces?n.slice(0,-1):n}const RO={blockquote:hye,break:r3,code:yye,definition:vye,emphasis:SO,hardBreak:r3,heading:Fye,html:CO,image:kO,imageReference:_O,inlineCode:EO,link:DO,linkReference:TO,list:Mye,listItem:Rye,paragraph:Bye,root:Iye,strong:PO,text:Uye,thematicBreak:$ye};function Wye(){return{enter:{table:qye,tableData:s3,tableHeader:s3,tableRow:Vye},exit:{codeText:Kye,table:Gye,tableData:tN,tableHeader:tN,tableRow:tN}}}function qye(t){const e=t._align;this.enter({type:"table",align:e.map(function(r){return r==="none"?null:r}),children:[]},t),this.data.inTable=!0}function Gye(t){this.exit(t),this.data.inTable=void 0}function Vye(t){this.enter({type:"tableRow",children:[]},t)}function tN(t){this.exit(t)}function s3(t){this.enter({type:"tableCell",children:[]},t)}function Kye(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,Jye));const r=this.stack[this.stack.length-1];r.type,r.value=e,this.exit(t)}function Jye(t,e){return e==="|"?e:t}function Yye(t){const e=t||{},r=e.tableCellPadding,n=e.tablePipeAlign,a=e.stringLength,i=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:` 903`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:l}};function o(m,g,y,b){return u(d(m,y,b),m.align)}function l(m,g,y,b){const w=h(m,y,b),j=u([w]);return j.slice(0,j.indexOf(` 904`))}function c(m,g,y,b){const w=y.enter("tableCell"),j=y.enter("phrasing"),N=y.containerPhrasing(m,{...b,before:i,after:i});return j(),w(),N}function u(m,g){return uye(m,{align:g,alignDelimiters:n,padding:r,stringLength:a})}function d(m,g,y){const b=m.children;let w=-1;const j=[],N=g.enter("table");for(;++w<b.length;)j[w]=h(b[w],g,y);return N(),j}function h(m,g,y){const b=m.children;let w=-1;const j=[],N=g.enter("tableRow");for(;++w<b.length;)j[w]=c(b[w],m,g,y);return N(),j}function f(m,g,y){let b=RO.inlineCode(m,g,y);return y.stack.includes("tableCell")&&(b=b.replace(/\|/g,"\\$&")),b}}function Zye(){return{exit:{taskListCheckValueChecked:n3,taskListCheckValueUnchecked:n3,paragraph:Qye}}}function Xye(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:e0e}}}function n3(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function Qye(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const n=r.children[0];if(n&&n.type==="text"){const a=e.children;let i=-1,o;for(;++i<a.length;){const l=a[i];if(l.type==="paragraph"){o=l;break}}o===r&&(n.value=n.value.slice(1),n.value.length===0?r.children.shift():r.position&&n.position&&typeof n.position.start.offset=="number"&&(n.position.start.column++,n.position.start.offset++,r.position.start=Object.assign({},n.position.start)))}}this.exit(t)}function e0e(t,e,r,n){const a=t.children[0],i=typeof t.checked=="boolean"&&a&&a.type==="paragraph",o="["+(t.checked?"x":" ")+"] ",l=r.createTracker(n);i&&l.move(o);let c=RO.listItem(t,e,r,{...n,...l.current()});return i&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(d){return d+o}}function t0e(){return[Mxe(),eye(),nye(),Wye(),Zye()]}function r0e(t){return{extensions:[Pxe(),tye(t),aye(),Yye(t),Xye()]}}const s0e={tokenize:c0e,partial:!0},BO={tokenize:u0e,partial:!0},LO={tokenize:d0e,partial:!0},IO={tokenize:h0e,partial:!0},n0e={tokenize:m0e,partial:!0},OO={name:"wwwAutolink",tokenize:o0e,previous:UO},zO={name:"protocolAutolink",tokenize:l0e,previous:HO},Id={name:"emailAutolink",tokenize:i0e,previous:$O},_u={};function a0e(){return{text:_u}}let cf=48;for(;cf<123;)_u[cf]=Id,cf++,cf===58?cf=65:cf===91&&(cf=97);_u[43]=Id;_u[45]=Id;_u[46]=Id;_u[95]=Id;_u[72]=[Id,zO];_u[104]=[Id,zO];_u[87]=[Id,OO];_u[119]=[Id,OO];function i0e(t,e,r){const n=this;let a,i;return o;function o(h){return!pS(h)||!$O.call(n,n.previous)||Yk(n.events)?r(h):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),l(h))}function l(h){return pS(h)?(t.consume(h),l):h===64?(t.consume(h),c):r(h)}function c(h){return h===46?t.check(n0e,d,u)(h):h===45||h===95||Li(h)?(i=!0,t.consume(h),c):d(h)}function u(h){return t.consume(h),a=!0,c}function d(h){return i&&a&&lo(n.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(h)):r(h)}}function o0e(t,e,r){const n=this;return a;function a(o){return o!==87&&o!==119||!UO.call(n,n.previous)||Yk(n.events)?r(o):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(s0e,t.attempt(BO,t.attempt(LO,i),r),r)(o))}function i(o){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(o)}}function l0e(t,e,r){const n=this;let a="",i=!1;return o;
vendor: 4,857 bytes, line 904
904function o(h){return(h===72||h===104)&&HO.call(n,n.previous)&&!Yk(n.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),a+=String.fromCodePoint(h),t.consume(h),l):r(h)}function l(h){if(lo(h)&&a.length<5)return a+=String.fromCodePoint(h),t.consume(h),l;if(h===58){const f=a.toLowerCase();if(f==="http"||f==="https")return t.consume(h),c}return r(h)}function c(h){return h===47?(t.consume(h),i?u:(i=!0,c)):r(h)}function u(h){return h===null||P1(h)||cn(h)||Qf(h)||Vw(h)?r(h):t.attempt(BO,t.attempt(LO,d),r)(h)}function d(h){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(h)}}function c0e(t,e,r){let n=0;return a;function a(o){return(o===87||o===119)&&n<3?(n++,t.consume(o),a):o===46&&n===3?(t.consume(o),i):r(o)}function i(o){return o===null?r(o):e(o)}}function u0e(t,e,r){let n,a,i;return o;function o(u){return u===46||u===95?t.check(IO,c,l)(u):u===null||cn(u)||Qf(u)||u!==45&&Vw(u)?c(u):(i=!0,t.consume(u),o)}function l(u){return u===95?n=!0:(a=n,n=void 0),t.consume(u),o}function c(u){return a||n||!i?r(u):e(u)}}function d0e(t,e){let r=0,n=0;return a;function a(o){return o===40?(r++,t.consume(o),a):o===41&&n<r?i(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?t.check(IO,e,i)(o):o===null||cn(o)||Qf(o)?e(o):(t.consume(o),a)}function i(o){return o===41&&n++,t.consume(o),a}}function h0e(t,e,r){return n;function n(l){return l===33||l===34||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===63||l===95||l===126?(t.consume(l),n):l===38?(t.consume(l),i):l===93?(t.consume(l),a):l===60||l===null||cn(l)||Qf(l)?e(l):r(l)}function a(l){return l===null||l===40||l===91||cn(l)||Qf(l)?e(l):n(l)}function i(l){return lo(l)?o(l):r(l)}function o(l){return l===59?(t.consume(l),n):lo(l)?(t.consume(l),o):r(l)}}function m0e(t,e,r){return n;function n(i){return t.consume(i),a}function a(i){return Li(i)?r(i):e(i)}}function UO(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||cn(t)}function HO(t){return!lo(t)}function $O(t){return!(t===47||pS(t))}function pS(t){return t===43||t===45||t===46||t===95||Li(t)}function Yk(t){let e=t.length,r=!1;for(;e--;){const n=t[e][1];if((n.type==="labelLink"||n.type==="labelImage")&&!n._balanced){r=!0;break}if(n._gfmAutolinkLiteralWalkedInto){r=!1;break}}return t.length>0&&!r&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const f0e={tokenize:j0e,partial:!0};function p0e(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:b0e,continuation:{tokenize:v0e},exit:w0e}},text:{91:{name:"gfmFootnoteCall",tokenize:y0e},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:g0e,resolveTo:x0e}}}}function g0e(t,e,r){const n=this;let a=n.events.length;const i=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let o;for(;a--;){const c=n.events[a][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return l;function l(c){if(!o||!o._balanced)return r(c);const u=Lc(n.sliceSerialize({start:o.end,end:n.now()}));return u.codePointAt(0)!==94||!i.includes(u.slice(1))?r(c):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(c),t.exit("gfmFootnoteCallLabelMarker"),e(c))}}function x0e(t,e){let r=t.length;for(;r--;)if(t[r][1].type==="labelImage"&&t[r][0]==="enter"){t[r][1];break}t[r+1][1].type="data",t[r+3][1].type="gfmFootnoteCallLabelMarker";const n={type:"gfmFootnoteCall",start:Object.assign({},t[r+3][1].start),end:Object.assign({},t[t.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},t[r+3][1].end),end:Object.assign({},t[r+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},t[t.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},l=[t[r+1],t[r+2],["enter",n,e],t[r+3],t[r+4],["enter",a,e],["exit",a,e],["enter",i,e],["enter",o,e],["exit",o,e],["exit",i,e],t[t.length-2],t[t.length-1],["exit",n,e]];return t.splice(r,t.length-r+1,...l),t}function y0e(t,e,r){const n=this,a=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let i=0,o;return l;function l(h){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),c}function c(h){return h!==94?r(h):(t.enter("gfmFootnoteCallMarker"),t.consume(h),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",u)}function u(h){if(i>999||h===93&&!o||h===null||h===91||cn(h))return r(h);if(h===93){t.exit("chunkString");const f=t.exit("gfmFootnoteCallString");return a.includes(Lc(n.sliceSerialize(f)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):r(h)}
vendor: 4,554 bytes, line 904
904return cn(h)||(o=!0),i++,t.consume(h),h===92?d:u}function d(h){return h===91||h===92||h===93?(t.consume(h),i++,u):u(h)}}function b0e(t,e,r){const n=this,a=n.parser.gfmFootnotes||(n.parser.gfmFootnotes=[]);let i,o=0,l;return c;function c(g){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(g){return g===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",d):r(g)}function d(g){if(o>999||g===93&&!l||g===null||g===91||cn(g))return r(g);if(g===93){t.exit("chunkString");const y=t.exit("gfmFootnoteDefinitionLabelString");return i=Lc(n.sliceSerialize(y)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(g),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),f}return cn(g)||(l=!0),o++,t.consume(g),g===92?h:d}function h(g){return g===91||g===92||g===93?(t.consume(g),o++,d):d(g)}function f(g){return g===58?(t.enter("definitionMarker"),t.consume(g),t.exit("definitionMarker"),a.includes(i)||a.push(i),Ms(t,m,"gfmFootnoteDefinitionWhitespace")):r(g)}function m(g){return e(g)}}function v0e(t,e,r){return t.check(Z0,e,t.attempt(f0e,e,r))}function w0e(t){t.exit("gfmFootnoteDefinition")}function j0e(t,e,r){const n=this;return Ms(t,a,"gfmFootnoteDefinitionIndent",5);function a(i){const o=n.events[n.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?e(i):r(i)}}function N0e(t){let r=(t||{}).singleTilde;const n={name:"strikethrough",tokenize:i,resolveAll:a};return r==null&&(r=!0),{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function a(o,l){let c=-1;for(;++c<o.length;)if(o[c][0]==="enter"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._close){let u=c;for(;u--;)if(o[u][0]==="exit"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._open&&o[c][1].end.offset-o[c][1].start.offset===o[u][1].end.offset-o[u][1].start.offset){o[c][1].type="strikethroughSequence",o[u][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},o[u][1].start),end:Object.assign({},o[c][1].end)},h={type:"strikethroughText",start:Object.assign({},o[u][1].end),end:Object.assign({},o[c][1].start)},f=[["enter",d,l],["enter",o[u][1],l],["exit",o[u][1],l],["enter",h,l]],m=l.parser.constructs.insideSpan.null;m&&fl(f,f.length,0,Kw(m,o.slice(u+1,c),l)),fl(f,f.length,0,[["exit",h,l],["enter",o[c][1],l],["exit",o[c][1],l],["exit",d,l]]),fl(o,u-1,c-u+3,f),c=u+f.length-2;break}}for(c=-1;++c<o.length;)o[c][1].type==="strikethroughSequenceTemporary"&&(o[c][1].type="data");return o}function i(o,l,c){const u=this.previous,d=this.events;let h=0;return f;function f(g){return u===126&&d[d.length-1][1].type!=="characterEscape"?c(g):(o.enter("strikethroughSequenceTemporary"),m(g))}function m(g){const y=lx(u);if(g===126)return h>1?c(g):(o.consume(g),h++,m);if(h<2&&!r)return c(g);const b=o.exit("strikethroughSequenceTemporary"),w=lx(g);return b._open=!w||w===2&&!!y,b._close=!y||y===2&&!!w,l(g)}}}class F0e{constructor(){this.map=[]}add(e,r,n){S0e(this,e,r,n)}consume(e){if(this.map.sort(function(i,o){return i[0]-o[0]}),this.map.length===0)return;let r=this.map.length;const n=[];for(;r>0;)r-=1,n.push(e.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),e.length=this.map[r][0];n.push(e.slice()),e.length=0;let a=n.pop();for(;a;){for(const i of a)e.push(i);a=n.pop()}this.map.length=0}}function S0e(t,e,r,n){let a=0;if(!(r===0&&n.length===0)){for(;a<t.map.length;){if(t.map[a][0]===e){t.map[a][1]+=r,t.map[a][2].push(...n);return}a+=1}t.map.push([e,r,n])}}function C0e(t,e){let r=!1;const n=[];for(;e<t.length;){const a=t[e];if(r){if(a[0]==="enter")a[1].type==="tableContent"&&n.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const i=n.length-1;n[i]=n[i]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(r=!0);e+=1}return n}function k0e(){return{flow:{null:{name:"table",tokenize:_0e,resolveAll:E0e}}}}function _0e(t,e,r){const n=this;let a=0,i=0,o;return l;function l(R){let M=n.events.length-1;for(;M>-1;){const I=n.events[M][1].type;if(I==="lineEnding"||I==="linePrefix")M--;else break}const P=M>-1?n.events[M][1].type:null,U=P==="tableHead"||P==="tableRow"?C:c;
vendor: 5,145 bytes, line 904
904return U===C&&n.parser.lazy[n.now().line]?r(R):U(R)}function c(R){return t.enter("tableHead"),t.enter("tableRow"),u(R)}function u(R){return R===124||(o=!0,i+=1),d(R)}function d(R){return R===null?r(R):Ar(R)?i>1?(i=0,n.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),m):r(R):Ss(R)?Ms(t,d,"whitespace")(R):(i+=1,o&&(o=!1,a+=1),R===124?(t.enter("tableCellDivider"),t.consume(R),t.exit("tableCellDivider"),o=!0,d):(t.enter("data"),h(R)))}function h(R){return R===null||R===124||cn(R)?(t.exit("data"),d(R)):(t.consume(R),R===92?f:h)}function f(R){return R===92||R===124?(t.consume(R),h):h(R)}function m(R){return n.interrupt=!1,n.parser.lazy[n.now().line]?r(R):(t.enter("tableDelimiterRow"),o=!1,Ss(R)?Ms(t,g,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):g(R))}function g(R){return R===45||R===58?b(R):R===124?(o=!0,t.enter("tableCellDivider"),t.consume(R),t.exit("tableCellDivider"),y):E(R)}function y(R){return Ss(R)?Ms(t,b,"whitespace")(R):b(R)}function b(R){return R===58?(i+=1,o=!0,t.enter("tableDelimiterMarker"),t.consume(R),t.exit("tableDelimiterMarker"),w):R===45?(i+=1,w(R)):R===null||Ar(R)?S(R):E(R)}function w(R){return R===45?(t.enter("tableDelimiterFiller"),j(R)):E(R)}function j(R){return R===45?(t.consume(R),j):R===58?(o=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(R),t.exit("tableDelimiterMarker"),N):(t.exit("tableDelimiterFiller"),N(R))}function N(R){return Ss(R)?Ms(t,S,"whitespace")(R):S(R)}function S(R){return R===124?g(R):R===null||Ar(R)?!o||a!==i?E(R):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(R)):E(R)}function E(R){return r(R)}function C(R){return t.enter("tableRow"),T(R)}function T(R){return R===124?(t.enter("tableCellDivider"),t.consume(R),t.exit("tableCellDivider"),T):R===null||Ar(R)?(t.exit("tableRow"),e(R)):Ss(R)?Ms(t,T,"whitespace")(R):(t.enter("data"),D(R))}function D(R){return R===null||R===124||cn(R)?(t.exit("data"),T(R)):(t.consume(R),R===92?A:D)}function A(R){return R===92||R===124?(t.consume(R),D):D(R)}}function E0e(t,e){let r=-1,n=!0,a=0,i=[0,0,0,0],o=[0,0,0,0],l=!1,c=0,u,d,h;const f=new F0e;for(;++r<t.length;){const m=t[r],g=m[1];m[0]==="enter"?g.type==="tableHead"?(l=!1,c!==0&&(a3(f,e,c,u,d),d=void 0,c=0),u={type:"table",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(r,0,[["enter",u,e]])):g.type==="tableRow"||g.type==="tableDelimiterRow"?(n=!0,h=void 0,i=[0,0,0,0],o=[0,r+1,0,0],l&&(l=!1,d={type:"tableBody",start:Object.assign({},g.start),end:Object.assign({},g.end)},f.add(r,0,[["enter",d,e]])),a=g.type==="tableDelimiterRow"?2:d?3:1):a&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")?(n=!1,o[2]===0&&(i[1]!==0&&(o[0]=o[1],h=bv(f,e,i,a,void 0,h),i=[0,0,0,0]),o[2]=r)):g.type==="tableCellDivider"&&(n?n=!1:(i[1]!==0&&(o[0]=o[1],h=bv(f,e,i,a,void 0,h)),i=o,o=[i[1],r,0,0])):g.type==="tableHead"?(l=!0,c=r):g.type==="tableRow"||g.type==="tableDelimiterRow"?(c=r,i[1]!==0?(o[0]=o[1],h=bv(f,e,i,a,r,h)):o[1]!==0&&(h=bv(f,e,o,a,r,h)),a=0):a&&(g.type==="data"||g.type==="tableDelimiterMarker"||g.type==="tableDelimiterFiller")&&(o[3]=r)}for(c!==0&&a3(f,e,c,u,d),f.consume(e.events),r=-1;++r<e.events.length;){const m=e.events[r];m[0]==="enter"&&m[1].type==="table"&&(m[1]._align=C0e(e.events,r))}return t}function bv(t,e,r,n,a,i){const o=n===1?"tableHeader":n===2?"tableDelimiter":"tableData",l="tableContent";r[0]!==0&&(i.end=Object.assign({},ug(e.events,r[0])),t.add(r[0],0,[["exit",i,e]]));const c=ug(e.events,r[1]);if(i={type:o,start:Object.assign({},c),end:Object.assign({},c)},t.add(r[1],0,[["enter",i,e]]),r[2]!==0){const u=ug(e.events,r[2]),d=ug(e.events,r[3]),h={type:l,start:Object.assign({},u),end:Object.assign({},d)};if(t.add(r[2],0,[["enter",h,e]]),n!==2){const f=e.events[r[2]],m=e.events[r[3]];if(f[1].end=Object.assign({},m[1].end),f[1].type="chunkText",f[1].contentType="text",r[3]>r[2]+1){const g=r[2]+1,y=r[3]-r[2]-1;t.add(g,y,[])}}t.add(r[3]+1,0,[["exit",h,e]])}return a!==void 0&&(i.end=Object.assign({},ug(e.events,a)),t.add(a,0,[["exit",i,e]]),i=void 0),i}function a3(t,e,r,n,a){const i=[],o=ug(e.events,r);a&&(a.end=Object.assign({},o),i.push(["exit",a,e])),n.end=Object.assign({},o),i.push(["exit",n,e]),t.add(r+1,0,i)}function ug(t,e){const r=t[e],n=r[0]==="enter"?"start":"end";return r[1][n]}const A0e={name:"tasklistCheck",tokenize:T0e};function D0e(){return{text:{91:A0e}}}function T0e(t,e,r){const n=this;return a;function a(c){return n.previous!==null||!n._gfmTasklistFirstContentOfListItem?r(c):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(c),t.exit("taskListCheckMarker"),i)}function i(c){return cn(c)?(t.enter("taskListCheckValueUnchecked"),t.consume(c),t.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(t.enter("taskListCheckValueChecked"),t.consume(c),t.exit("taskListCheckValueChecked"),o):r(c)}function o(c){return c===93?(t.enter("taskListCheckMarker"),t.consume(c),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),l):r(c)}function l(c){return Ar(c)?e(c):Ss(c)?t.check({tokenize:M0e},e,r)(c):r(c)}}function M0e(t,e,r){return Ms(t,n,"whitespace");
904function n(a){return a===null?r(a):e(a)}}function P0e(t){return QI([a0e(),p0e(),N0e(t),k0e(),D0e()])}const R0e={};function Qw(t){const e=this,r=t||R0e,n=e.data(),a=n.micromarkExtensions||(n.micromarkExtensions=[]),i=n.fromMarkdownExtensions||(n.fromMarkdownExtensions=[]),o=n.toMarkdownExtensions||(n.toMarkdownExtensions=[]);a.push(P0e(r)),i.push(t0e()),o.push(r0e(r))}const B0e=({event:t})=>s.jsxs(s.Fragment,{children:[s.jsx("h1",{className:"text-3xl font-bold mb-6",children:t.title}),s.jsx("div",{className:"prose prose-lg max-w-none",children:s.jsx(Xw,{remarkPlugins:[Qw],children:t.description})})]}),L0e=({events:t})=>{const e=ks();return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"text-xl font-semibold mb-4",children:"Upcoming Events"}),t.length>0?s.jsx("div",{className:"space-y-4",children:t.map(r=>s.jsx(De,{className:"overflow-hidden",children:s.jsxs("div",{className:"flex",children:[s.jsx("div",{className:"w-24 h-24 bg-gray-200",children:r.imageUrl?s.jsx("img",{src:r.imageUrl,alt:r.title,className:"w-full h-full object-cover"}):s.jsx("div",{className:"w-full h-full flex items-center justify-center bg-chamber-blue-light",children:s.jsx(Br,{size:24,className:"text-chamber-blue"})})}),s.jsxs(Be,{className:"py-3 px-4",children:[s.jsx("h3",{className:"font-medium line-clamp-1",children:r.title}),s.jsx("p",{className:"text-sm text-gray-600",children:r.date}),s.jsx(Y,{variant:"link",className:"text-chamber-blue p-0 h-auto text-sm",onClick:()=>e(`/events/${r.id}`),children:"View Details"})]})]})},r.id))}):s.jsx("div",{className:"text-center p-6 bg-gray-50 rounded-lg",children:s.jsx("p",{className:"text-gray-600",children:"No upcoming events at this time"})})]})},I0e=()=>{const{id:t}=Dd(),e=ks(),[r,n]=x.useState(null),[a,i]=x.useState(!0),[o,l]=x.useState([]),[c]=x.useState(Date.now());if(x.useEffect(()=>{(async()=>{if(t){i(!0);try{const m=await sre(t);n(m),m&&(Ia.viewEvent(m.id,m.title,m.date,m.location),qC(`/events/${m.id}`,`${m.title} - Event Details | Local Business Hub`),GC({event_name:m.title,event_date:m.date,event_location:m.location,page_type:"event_details"}));const{events:g}=await Mf({upcoming:!0,limit:4}),y=g.filter(b=>b.id!==t);l(y.slice(0,3))}catch(m){console.error("Error fetching event details:",m)}finally{i(!1)}}})()},[t]),x.useEffect(()=>()=>{if(r){const f=Math.round((Date.now()-c)/1e3);typeof window<"u"&&window.gtag&&window.gtag("event","event_page_time",{event_id:r.id,event_name:r.title,time_spent_seconds:f,event_category:"event_engagement"})}},[r,c]),a)return s.jsx(zhe,{});if(!r)return s.jsx(Uhe,{});const h=new Date(r.date)<new Date;return s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs(Y,{variant:"ghost",onClick:()=>e("/events"),className:"mb-6 text-chamber-blue hover:text-chamber-blue-dark",children:[s.jsx(pn,{size:16,className:"mr-2"}),"Back to Events"]}),s.jsxs("div",{className:"flex flex-col lg:flex-row gap-8 mb-8",children:[s.jsx(Hhe,{event:r,isPastEvent:h}),s.jsx("div",{className:"w-full lg:w-1/3",children:s.jsx(Ghe,{event:r,isPastEvent:h})})]}),s.jsxs("div",{className:"grid md:grid-cols-3 gap-8",children:[s.jsx("div",{className:"md:col-span-2",children:s.jsx(B0e,{event:r,isPastEvent:h})}),s.jsx("div",{className:"md:col-span-1",children:s.jsx(L0e,{events:o})})]})]})})},O0e=({value:t,onChange:e,disabled:r=!1,label:n="Event Image",placeholder:a="https://example.com/event-image.jpg",error:i})=>{const{toast:o}=St(),l=x.useRef(null),[c,u]=x.useState(!1),[d,h]=x.useState(!1),f=async N=>{var S;try{if(u(!0),!N.type.startsWith("image/"))throw new Error("Please select an image file");if(N.size>5*1024*1024)throw new Error("Image size must be less than 5MB");const E=((S=N.name.split(".").pop())==null?void 0:S.toLowerCase())||"jpg",T=`events/${`event-${Date.now()}-${Math.random().toString(36).substring(2)}.${E}`}`,{data:D,error:A}=await Q.storage.from("deal-images").upload(T,N,{cacheControl:"3600",upsert:!1});if(A)throw console.error("Supabase upload error:",A),new Error(A.message||"Failed to upload image");const{data:{publicUrl:R}}=Q.storage.from("deal-images").getPublicUrl(D.path);e(R),o({title:"Success",description:"Event image uploaded successfully"})}catch(E){console.error("Error uploading event image:",E),o({title:"Upload Error",description:E.message||"Failed to upload event image",variant:"destructive"})}finally{u(!1)}},m=N=>{var E;const S=(E=N.target.files)==null?void 0:E[0];S&&f(S)},g=N=>{N.preventDefault(),h(!1);const S=N.dataTransfer.files[0];S&&f(S)},y=N=>{N.preventDefault(),h(!0)},b=N=>{N.preventDefault(),h(!1)},w=()=>{e("")},j=N=>{e(N)};return s.jsxs("div",{className:"space-y-4",children:[s.jsx(Z,{className:i?"text-red-600":"",children:n}),s.jsxs(sn,{defaultValue:"upload",className:"w-full",children:[s.jsxs(Qs,{className:"grid w-full grid-cols-2",children:[s.jsxs(Gt,{value:"upload",className:"flex items-center gap-2",children:[s.jsx(vn,{className:"h-4 w-4"}),"Upload"]}),s.jsxs(Gt,{value:"url",className:"flex items-center gap-2",children:[s.jsx(dp,{className:"h-4 w-4"}),"URL"]})]}),s.jsxs(Rt,{value:"upload",className:"space-y-3",children:[t&&s.jsxs("div",{className:"relative",children:[s.jsx("img",{src:t,alt:"Event preview",className:"w-full h-48 object-cover rounded-lg border"}),s.jsx(Y,{type:"button",variant:"destructive",size:"sm",onClick:w,className:"absolute top-2 right-2",disabled:r,children:s.jsx(Ir,{className:"h-4 w-4"})})]}),s.jsx("div",{className:`border-2 border-dashed rounded-lg p-6 text-center transition-colors ${d?"border-blue-500 bg-blue-50":"border-gray-300"}`,onDrop:g,onDragOver:y,onDragLeave:b,children:c?s.jsxs("div",{className:"flex items-center justify-center gap-2",children:[s.jsx(Mt,{className:"h-6 w-6 animate-spin"}),s.jsx("span",{children:"Uploading..."})]}):s.jsxs("div",{children:[s.jsx(vi,{className:"h-12 w-12 mx-auto text-gray-400 mb-4"}),s.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Drag and drop an image here, or click to browse"}),s.jsx("p",{className:"text-xs text-gray-500",children:"Supports JPG, PNG, GIF. Max 5MB."})]})}),s.jsx("input",{ref:l,type:"file",accept:"image/*",onChange:m,className:"hidden",disabled:r||c}),s.jsxs(Y,{type:"button",variant:"outline",onClick:()=>{var N;return(N=l.current)==null?void 0:N.click()},disabled:r||c,className:"w-full",children:[s.jsx(vn,{className:"h-4 w-4 mr-2"}),"Choose Event Image"]})]}),s.jsxs(Rt,{value:"url",className:"space-y-3",children:[s.jsx(Ne,{value:t,onChange:N=>j(N.target.value),placeholder:a,disabled:r,type:"url",className:i?"border-red-500":""}),s.jsx("p",{className:"text-xs text-gray-500",children:"Enter a direct URL to an image for your event"})]})]}),i&&s.jsx("p",{className:"text-sm text-red-600",children:i})]})},z0e=()=>{const{toast:t}
904=St(),[e,r]=x.useState(!1),[n,a]=x.useState({title:"",description:"",location:"",eventDate:"",startTime:"",endTime:"",imageUrl:"",contactName:"",contactEmail:"",contactPhone:"",organizationName:"",eventWebsite:"",additionalInfo:"",ticketPrice:"",eventType:""}),i=l=>{const{name:c,value:u}=l.target;a(d=>({...d,[c]:u}))},o=async l=>{l.preventDefault(),r(!0);try{if(!n.title.trim()||!n.description.trim()||!n.location.trim()||!n.eventDate||!n.startTime||!n.endTime||!n.contactName.trim()||!n.contactEmail.trim()){t({title:"Missing Information",description:"Please fill in all required fields marked with *",variant:"destructive"});return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n.contactEmail)){t({title:"Invalid Email",description:"Please enter a valid email address",variant:"destructive"});return}const u=new Date(`${n.eventDate}T${n.startTime}`),d=new Date(`${n.eventDate}T${n.endTime}`);if(u>=d){t({title:"Invalid Time",description:"End time must be after start time",variant:"destructive"});return}if(u<new Date){t({title:"Invalid Date",description:"Event date cannot be in the past",variant:"destructive"});return}const h={title:n.title,description:n.description,location:n.location,start_date:u.toISOString(),end_date:d.toISOString(),image_url:n.imageUrl||void 0,contact_name:n.contactName,contact_email:n.contactEmail,contact_phone:n.contactPhone||void 0,organization_name:n.organizationName||void 0,event_website:n.eventWebsite||void 0,additional_info:n.additionalInfo||void 0,ticket_price:n.ticketPrice?parseFloat(n.ticketPrice):void 0,event_type:n.eventType||void 0};await lre(h),t({title:"Event Submitted Successfully!",description:"Thank you for submitting your event. We'll review it and contact you within 2-3 business days."}),a({title:"",description:"",location:"",eventDate:"",startTime:"",endTime:"",imageUrl:"",contactName:"",contactEmail:"",contactPhone:"",organizationName:"",eventWebsite:"",additionalInfo:"",ticketPrice:"",eventType:""})}catch(c){console.error("Error submitting event:",c),t({title:"Submission Failed",description:"There was an error submitting your event. Please try again.",variant:"destructive"})}finally{r(!1)}};return s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs("div",{className:"mb-8",children:[s.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Submit Public Event"}),s.jsx("p",{className:"text-lg text-gray-600",children:"Share your community event with the Valley Stream Chamber of Commerce. We'll review your submission and add it to our community calendar."})]}),s.jsxs("div",{className:"grid gap-8 lg:grid-cols-3",children:[s.jsx("div",{className:"lg:col-span-2",children:s.jsxs(De,{children:[s.jsx(ot,{children:s.jsx(ut,{children:"Event Details"})}),s.jsx(Be,{children:s.jsxs("form",{onSubmit:o,className:"space-y-6",children:[s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"title",className:"block mb-2",children:"Event Name *"}),s.jsx(Ne,{id:"title",name:"title",value:n.title,onChange:i,required:!0,placeholder:"Enter event name"})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"organizationName",className:"block mb-2",children:"Organization/Host"}),s.jsx(Ne,{id:"organizationName",name:"organizationName",value:n.organizationName,onChange:i,placeholder:"Organization or business name"})]})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"eventType",className:"block mb-2",children:"Event Type"}),s.jsxs(Wt,{value:n.eventType,onValueChange:l=>a(c=>({...c,eventType:l})),children:[s.jsx(Ht,{children:s.jsx(qt,{placeholder:"Select event type"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"conference",children:"Conference"}),s.jsx(Ae,{value:"workshop",children:"Workshop"}),s.jsx(Ae,{value:"seminar",children:"Seminar"}),s.jsx(Ae,{value:"networking",children:"Networking"}),s.jsx(Ae,{value:"fundraiser",children:"Fundraiser"}),s.jsx(Ae,{value:"social",children:"Social Event"}),s.jsx(Ae,{value:"educational",children:"Educational"}),s.jsx(Ae,{value:"community",children:"Community Event"}),s.jsx(Ae,{value:"business",children:"Business Event"}),s.jsx(Ae,{value:"other",children:"Other"})]})]})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"ticketPrice",className:"block mb-2",children:"Ticket Price"}),s.jsx(Ne,{id:"ticketPrice",name:"ticketPrice",type:"number",min:"0",step:"0.01",value:n.ticketPrice,onChange:i,placeholder:"0.00 (leave blank if free)"})]})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"eventDate",className:"block mb-2",children:"Event Date *"}),s.jsx(Ne,{id:"eventDate",name:"eventDate",type:"date",value:n.eventDate,onChange:i,required:!0})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"startTime",className:"block mb-2",children:"Start Time *"}),s.jsx(Ne,{id:"startTime",name:"startTime",type:"time",value:n.startTime,onChange:i,required:!0})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"endTime",className:"block mb-2",children:"End Time *"}),s.jsx(Ne,{id:"endTime",name:"endTime",type:"time",value:n.endTime,onChange:i,required:!0})]})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"location",className:"block mb-2",children:"Event Location *"}),s.jsx(Ne,{id:"location",name:"location",value:n.location,onChange:i,required:!0,placeholder:"Enter full address"})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"description",className:"block mb-2",children:"Event Description *"}),s.jsx(zt,{id:"description",name:"description",value:n.description,onChange:i,required:!0,placeholder:"Describe your event, including what attendees can expect...",rows:4})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"eventWebsite",className:"block mb-2",children:"Event Website"}),s.jsx(Ne,{id:"eventWebsite",name:"eventWebsite",type:"url",value:n.eventWebsite,onChange:i,placeholder:"https://..."})]}),s.jsx("div",{children:s.jsx(O0e,{value:n.imageUrl,onChange:l=>a(c=>({...c,imageUrl:l})),disabled:e,label:"Event Image (Optional)",placeholder:"https://example.com/event-image.jpg"})}),s.jsxs("div",{className:"border-t pt-6",children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Contact Information"}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"contactName",className:"block mb-2",children:"Contact Name *"}),s.jsx(Ne,{id:"contactName",name:"contactName",value:n.contactName,onChange:i,required:!0,placeholder:"Your name"})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"contactPhone",className:"block mb-2",children:"Contact Phone"}),s.jsx(Ne,{id:"contactPhone",name:"contactPhone",value:n.contactPhone,onChange:i,placeholder:"(555) 123-4567"})]})]}),s.jsxs("div",{className:"mt-4",children:[s.jsx(Z,{htmlFor:"contactEmail",className:"block mb-2",children:"Contact Email *"}
904),s.jsx(Ne,{id:"contactEmail",name:"contactEmail",type:"email",value:n.contactEmail,onChange:i,required:!0,placeholder:"[email protected]"})]})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"additionalInfo",className:"block mb-2",children:"Additional Information"}),s.jsx(zt,{id:"additionalInfo",name:"additionalInfo",value:n.additionalInfo,onChange:i,placeholder:"Any additional details, special requirements, accessibility information, etc.",rows:3})]}),s.jsx(Y,{type:"submit",disabled:e,className:"w-full",children:e?"Submitting...":"Submit Event"})]})})]})}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs(ut,{className:"flex items-center gap-2",children:[s.jsx(Br,{className:"h-5 w-5"}),"Event Guidelines"]})}),s.jsxs(Be,{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold mb-2",children:"Eligible Events"}),s.jsxs("ul",{className:"text-sm text-gray-600 space-y-1",children:[s.jsx("li",{children:"⢠Community fundraisers"}),s.jsx("li",{children:"⢠Business networking events"}),s.jsx("li",{children:"⢠Educational workshops"}),s.jsx("li",{children:"⢠Cultural celebrations"}),s.jsx("li",{children:"⢠Chamber member events"})]})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold mb-2",children:"Review Process"}),s.jsx("p",{className:"text-sm text-gray-600",children:"Events are reviewed within 2-3 business days. We'll contact you to confirm approval or request additional information."})]})]})]}),s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs(ut,{className:"flex items-center gap-2",children:[s.jsx(rn,{className:"h-5 w-5"}),"Submission Tips"]})}),s.jsxs(Be,{className:"space-y-3",children:[s.jsxs("div",{className:"text-sm text-gray-600",children:[s.jsx("p",{className:"font-semibold mb-1",children:"Provide Complete Information"}),s.jsx("p",{children:"Include all relevant details to help us promote your event effectively."})]}),s.jsxs("div",{className:"text-sm text-gray-600",children:[s.jsx("p",{className:"font-semibold mb-1",children:"Submit Early"}),s.jsx("p",{children:"Submit events at least 2 weeks in advance for better promotion."})]}),s.jsxs("div",{className:"text-sm text-gray-600",children:[s.jsx("p",{className:"font-semibold mb-1",children:"Include Contact Info"}),s.jsx("p",{children:"Ensure we can reach you for questions or updates."})]})]})]}),s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs(ut,{className:"flex items-center gap-2",children:[s.jsx(_n,{className:"h-5 w-5"}),"Need Help?"]})}),s.jsxs(Be,{children:[s.jsx("p",{className:"text-sm text-gray-600 mb-3",children:"Questions about submitting an event? Contact our Events Coordinator:"}),s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ma,{className:"h-4 w-4"}),s.jsx("span",{children:"Events Coordinator"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(wi,{className:"h-4 w-4"}),s.jsx("span",{children:"(555) 123-4567"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(fs,{className:"h-4 w-4"}),s.jsx("span",{children:"[email protected]"})]})]})]})]})]})]})]})})},U0e=({open:t,onOpenChange:e,onBusinessCreated:r})=>{const{user:n}=ts();return s.jsx(Tt,{open:t,onOpenChange:e,children:s.jsxs(Dt,{className:"sm:max-w-[600px] max-h-[90vh] overflow-y-auto",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Add New Business"}),s.jsx(rr,{children:"Enter your business details below. Once submitted, it will be reviewed by our team."})]}),s.jsx(qw,{onSuccess:a=>{e(!1),r&&a&&r(a)},userId:(n==null?void 0:n.id)||"",onCancel:()=>e(!1)})]})})},H0e=({open:t,onOpenChange:e,onBusinessUpdated:r,business:n})=>{const{user:a}=ts();return n?s.jsx(Tt,{open:t,onOpenChange:e,children:s.jsxs(Dt,{className:"sm:max-w-[600px] max-h-[90vh] overflow-y-auto",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Edit Business"}),s.jsx(rr,{children:"Update your business details below. Changes may require approval."})]}),s.jsx(qw,{onSuccess:()=>{e(!1),r&&r()},userId:n.ownerId||(a==null?void 0:a.id)||"",onCancel:()=>e(!1),submitLabel:"Update Business",businessData:n,isEditing:!0})]})}):null},$0e=({open:t,onOpenChange:e,businessId:r,businessName:n,onSubscriptionActive:a})=>{const[i,o]=x.useState(null),[l,c]=x.useState(!1),[u,d]=x.useState(!0),[h,f]=x.use
904State(null),[m,g]=x.useState(!1),{toast:y}=St();x.useEffect(()=>{t&&r&&(w(),b())},[t,r]);const b=async()=>{try{const{data:{user:E}}=await Q.auth.getUser();let C=!1;if(E){const{data:T}=await Q.from("business_profiles").select("id").eq("owner_id",E.id).eq("business_subscription_status","active").neq("id",r);C=((T==null?void 0:T.length)??0)>0}if(g(C),C){const T=await Ro.getAdditionalBusinessPricing();f(T)}else{const T=await Ro.getBusinessPricing();f(T)}}catch(E){console.error("Error loading pricing info:",E),f(Ro.calculateProratedPricing(125))}},w=async()=>{try{d(!0);const E=await Bi.getIndividualBusinessSubscription(r);o(E),(E==null?void 0:E.status)==="active"&&(a==null||a(),e(!1))}catch(E){console.error("Error checking subscription status:",E),o(null)}finally{d(!1)}},j=async()=>{if((i==null?void 0:i.status)==="active"){y({title:"Already Subscribed",description:"This business already has an active subscription.",variant:"destructive"});return}try{c(!0);const E=await Bi.createBusinessSubscriptionSession(r);window.location.href=E.url}catch(E){console.error("Error subscribing to individual business:",E),y({title:"Subscription Failed",description:E.message||"Failed to start checkout process. Please try again.",variant:"destructive"})}finally{c(!1)}},N=async()=>{try{const E=await Bi.createCustomerPortalSession(window.location.origin+"/dashboard/businesses");window.location.href=E}catch(E){console.error("Error opening customer portal:",E),y({title:"Error",description:"Failed to open subscription management portal. Please try again.",variant:"destructive"})}},S=()=>{if(!i)return s.jsxs(ke,{variant:"outline",children:[s.jsx(Ts,{className:"w-3 h-3 mr-1"}),"No Subscription"]});switch(i.status){case"active":return s.jsxs(ke,{variant:"default",className:"bg-green-500",children:[s.jsx(Or,{className:"w-3 h-3 mr-1"}),"Active"]});case"canceled":return s.jsxs(ke,{variant:"destructive",children:[s.jsx(Ts,{className:"w-3 h-3 mr-1"}),"Canceled"]});case"past_due":return s.jsxs(ke,{variant:"destructive",children:[s.jsx(Ts,{className:"w-3 h-3 mr-1"}),"Past Due"]});default:return s.jsxs(ke,{variant:"outline",children:[s.jsx(Ts,{className:"w-3 h-3 mr-1"}),i.status]})}};return u?s.jsx(Tt,{open:t,onOpenChange:e,children:s.jsx(Dt,{className:"max-w-md",children:s.jsxs("div",{className:"flex items-center justify-center py-8",children:[s.jsx(Mt,{className:"h-6 w-6 animate-spin mr-2"}),"Loading subscription information..."]})})}):s.jsx(Tt,{open:t,onOpenChange:e,children:s.jsxs(Dt,{className:"max-w-md max-h-[90vh] overflow-y-auto",children:[s.jsx(It,{children:s.jsxs(Ot,{className:"flex items-center gap-2",children:[s.jsx(up,{className:"h-5 w-5 text-blue-500"}),"Activate Business Subscription"]})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-lg font-semibold mb-2",children:n}),s.jsxs("div",{className:"flex items-center justify-center gap-2 mb-3",children:[s.jsx("span",{className:"text-sm text-gray-600",children:"Status:"}),S()]})]}),s.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-3",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(Ts,{className:"h-4 w-4 text-amber-600 mt-0.5 flex-shrink-0"}),s.jsxs("div",{className:"text-sm",children:[s.jsx("div",{className:"font-medium text-amber-800 mb-1",children:"Subscription Required for Approval"}),s.jsxs("div",{className:"text-amber-700 space-y-1",children:[s.jsx("p",{children:"⢠Inactive businesses remain in draft state"}),s.jsx("p",{children:"⢠Only businesses with active subscriptions are sent for admin review"}),s.jsx("p",{children:"⢠Activate your subscription to begin the approval process"})]})]})]})}),m&&s.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-lg p-3 text-center",children:[s.jsx("p",{className:"text-sm font-semibold text-green-800",children:"ð Multi-Business Discount Applied!"}),s.jsx("p",{className:"text-xs text-green-700 mt-1",children:"You're getting a special discounted rate for this additional business listing."})]}),h&&s.jsxs("div",{className:"border rounded-lg p-4 bg-blue-50",children:[s.jsxs("div",{className:"text-center",children:[s.jsxs("div",{className:"text-2xl font-bold text-blue-900 mb-1",children:["$",h.isFullYear?h.fullYearPrice:h.proratedPrice]}),s.jsx("div",{className:"text-sm text-blue-700 mb-3",children:h.isFullYear?"Annual subscription":`Prorated for ${h.daysRemaining} days remaining`}),!h.isFullYear&&s.jsxs("div",{className:"text-xs text-blue-600 mb-3",children:["Full year: $",h.fullYearPrice," ⢠Prorated: $",h.proratedPrice," ⢠Save: $",Math.round((h.fullYearPrice-h.proratedPrice)*100)/100]})]}),(i==null?void 0:i.status)!=="active"?s.jsx(Y,{onClick:j,disabled:l,className:"w-full bg-blue-600 hover:bg-blue-700",size:"lg",children:l?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"h-4 w-4 animate-spin mr-2"}),"Processing..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Ii,{className:"h-4 w-4 mr-2"}),"Activate for $",h.isFullYear?h.fullYearPrice:h.proratedPrice]})}):s.jsxs(Y,{onClick:N,variant:"outline",size:"lg",className:"w-full",children:[s.jsx(Ii,{className:"h-4 w-4 mr-2"}),"Manage Subscription"]})]})]})]})})};var gS=["Enter"," "],W0e=["ArrowDown","PageUp","Home"],WO=["ArrowUp","PageDown","End"],q0e=[...W0e,...WO],G0e={ltr:[...gS,"ArrowRight"],rtl:[...gS,"ArrowLeft"]},V0e={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Q0="Menu",[f0,K0e,J0e]=op(Q0),[gp,qO]=li(Q0,[J0e,Sx,Tx]),ej=Sx(),GO=Tx(),[Y0e,xp]=gp(Q0),[Z0e,eb]=gp(Q0),VO=t=>{const{__scopeMenu:e,open:r=!1,children:n,dir:a,onOpenChange:i,modal:o=!0}=t,l=ej(e),[c,u]=x.useState(null),d=x.useRef(!1),h=Zs(i),f=hm(a);return x.useEffect(()=>{const m=()=>{d.current=!0,document.addEventListener("pointerdown",g,{capture:!0,once:!0}),document.addEventListener("pointermove",g,{capture:!0,once:!0})},g=()=>d.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),document.removeEventListener("pointermove",g,{capture:!0})}},[]),s.jsx(AC,{...l,children:s.jsx(Y0e,{scope:e,open:r,onOpenChange:h,content:c,onContentChange:u,children:s.jsx(Z0e,{scope:e,onClose:x.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:f,modal:o,children:n})})})};VO.displayName=Q0;var X0e="MenuAnchor",Zk=x.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,a=ej(r);return s.jsx(DC,{...a,...n,ref:e})});Zk.displayName=X0e;var Xk="MenuPortal",[Q0e,KO]=gp(Xk,{forceMount:void 0}),JO=t=>{const{__scopeMenu:e,forceMount:r,children:n,container:a}=t,i=xp(Xk,e);return s.jsx(Q0e,{scope:e,forceMount:r,children:s.jsx(fa,{present:r||i.open,children:s.jsx(B0,{asChild:!0,container:a,children:n})})})};JO.displayName=Xk;var ql="MenuContent",[ebe,Qk]=gp(ql),YO=x.forwardRef((t,e)=>{const r=KO(ql,t.__scopeMenu),{forceMount:n=r.forceMount,...a}=t,i=xp(ql,t.__scopeMenu),o=eb(ql,t.__scopeMenu);return s.jsx(f0.Provider,{scope:t.__scopeMenu,children:s.jsx(fa,{present:n||i.open,children:s.jsx(f0.Slot,{scope:t.__scopeMenu,children:o.modal?s.jsx(tbe,{...a,ref:e}):s.jsx(rbe,{...a,ref:e})})})})}),tbe=x.forwardRef((t,e)=>{const r=xp(ql,t.__scopeMenu),n=x.useRef(null),a=Cr(e,n);return x.useEffect(()=>{const i=n.current;if(i)return YC(i)}
vendor: 14,530 bytes, line 904
904,[]),s.jsx(e_,{...t,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:gt(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),rbe=x.forwardRef((t,e)=>{const r=xp(ql,t.__scopeMenu);return s.jsx(e_,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),sbe=Vg("MenuContent.ScrollLock"),e_=x.forwardRef((t,e)=>{const{__scopeMenu:r,loop:n=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:f,onDismiss:m,disableOutsideScroll:g,...y}=t,b=xp(ql,r),w=eb(ql,r),j=ej(r),N=GO(r),S=K0e(r),[E,C]=x.useState(null),T=x.useRef(null),D=Cr(e,T,b.onContentChange),A=x.useRef(0),R=x.useRef(""),M=x.useRef(0),P=x.useRef(null),U=x.useRef("right"),I=x.useRef(0),O=g?_w:x.Fragment,V=g?{as:sbe,allowPinchZoom:!0}:void 0,G=$=>{var ee,he;const W=R.current+$,oe=S().filter(ve=>!ve.disabled),K=document.activeElement,H=(ee=oe.find(ve=>ve.ref.current===K))==null?void 0:ee.textValue,X=oe.map(ve=>ve.textValue),me=pbe(X,W,H),ie=(he=oe.find(ve=>ve.textValue===me))==null?void 0:he.ref.current;(function ve(Ce){R.current=Ce,window.clearTimeout(A.current),Ce!==""&&(A.current=window.setTimeout(()=>ve(""),1e3))})(W),ie&&setTimeout(()=>ie.focus())};x.useEffect(()=>()=>window.clearTimeout(A.current),[]),JC();const B=x.useCallback($=>{var oe,K;return U.current===((oe=P.current)==null?void 0:oe.side)&&xbe($,(K=P.current)==null?void 0:K.area)},[]);return s.jsx(ebe,{scope:r,searchRef:R,onItemEnter:x.useCallback($=>{B($)&&$.preventDefault()},[B]),onItemLeave:x.useCallback($=>{var W;B($)||((W=T.current)==null||W.focus(),C(null))},[B]),onTriggerLeave:x.useCallback($=>{B($)&&$.preventDefault()},[B]),pointerGraceTimerRef:M,onPointerGraceIntentChange:x.useCallback($=>{P.current=$},[]),children:s.jsx(O,{...V,children:s.jsx(Cw,{asChild:!0,trapped:a,onMountAutoFocus:gt(i,$=>{var W;$.preventDefault(),(W=T.current)==null||W.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:s.jsx(lp,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:f,onDismiss:m,children:s.jsx(sk,{asChild:!0,...N,dir:w.dir,orientation:"vertical",loop:n,currentTabStopId:E,onCurrentTabStopIdChange:C,onEntryFocus:gt(c,$=>{w.isUsingKeyboardRef.current||$.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx(TC,{role:"menu","aria-orientation":"vertical","data-state":h8(b.open),"data-radix-menu-content":"",dir:w.dir,...j,...y,ref:D,style:{outline:"none",...y.style},onKeyDown:gt(y.onKeyDown,$=>{const oe=$.target.closest("[data-radix-menu-content]")===$.currentTarget,K=$.ctrlKey||$.altKey||$.metaKey,H=$.key.length===1;oe&&($.key==="Tab"&&$.preventDefault(),!K&&H&&G($.key));const X=T.current;if($.target!==X||!q0e.includes($.key))return;$.preventDefault();const ie=S().filter(ee=>!ee.disabled).map(ee=>ee.ref.current);WO.includes($.key)&&ie.reverse(),mbe(ie)}),onBlur:gt(t.onBlur,$=>{$.currentTarget.contains($.target)||(window.clearTimeout(A.current),R.current="")}),onPointerMove:gt(t.onPointerMove,p0($=>{const W=$.target,oe=I.current!==$.clientX;if($.currentTarget.contains(W)&&oe){const K=$.clientX>I.current?"right":"left";U.current=K,I.current=$.clientX}}))})})})})})})});YO.displayName=ql;var nbe="MenuGroup",t_=x.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return s.jsx(Zt.div,{role:"group",...n,ref:e})});t_.displayName=nbe;var abe="MenuLabel",ZO=x.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return s.jsx(Zt.div,{...n,ref:e})});ZO.displayName=abe;var I1="MenuItem",i3="menu.itemSelect",tj=x.forwardRef((t,e)=>{const{disabled:r=!1,onSelect:n,...a}=t,i=x.useRef(null),o=eb(I1,t.__scopeMenu),l=Qk(I1,t.__scopeMenu),c=Cr(e,i),u=x.useRef(!1),d=()=>{const h=i.current;if(!r&&h){const f=new CustomEvent(i3,{bubbles:!0,cancelable:!0});h.addEventListener(i3,m=>n==null?void 0:n(m),{once:!0}),Ky(h,f),f.defaultPrevented?u.current=!1:o.onClose()}};return s.jsx(XO,{...a,ref:c,disabled:r,onClick:gt(t.onClick,d),onPointerDown:h=>{var f;(f=t.onPointerDown)==null||f.call(t,h),u.current=!0},onPointerUp:gt(t.onPointerUp,h=>{var f;u.current||(f=h.currentTarget)==null||f.click()}),onKeyDown:gt(t.onKeyDown,h=>{const f=l.searchRef.current!=="";r||f&&h.key===" "||gS.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});tj.displayName=I1;var XO=x.forwardRef((t,e)=>{const{__scopeMenu:r,disabled:n=!1,textValue:a,...i}=t,o=Qk(I1,r),l=GO(r),c=x.useRef(null),u=Cr(e,c),[d,h]=x.useState(!1),[f,m]=x.useState("");return x.useEffect(()=>{const g=c.current;g&&m((g.textContent??"").trim())},[i.children]),s.jsx(f0.ItemSlot,{scope:r,disabled:n,textValue:a??f,children:s.jsx(nk,{asChild:!0,...l,focusable:!n,children:s.jsx(Zt.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":n||void 0,"data-disabled":n?"":void 0,...i,ref:u,onPointerMove:gt(t.onPointerMove,p0(g=>{n?o.onItemLeave(g):(o.onItemEnter(g),g.defaultPrevented||g.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:gt(t.onPointerLeave,p0(g=>o.onItemLeave(g))),onFocus:gt(t.onFocus,()=>h(!0)),onBlur:gt(t.onBlur,()=>h(!1))})})})}),ibe="MenuCheckboxItem",QO=x.forwardRef((t,e)=>{const{checked:r=!1,onCheckedChange:n,...a}=t;return s.jsx(n8,{scope:t.__scopeMenu,checked:r,children:s.jsx(tj,{role:"menuitemcheckbox","aria-checked":O1(r)?"mixed":r,...a,ref:e,"data-state":s_(r),onSelect:gt(a.onSelect,()=>n==null?void 0:n(O1(r)?!0:!r),{checkForDefaultPrevented:!1})})})});QO.displayName=ibe;var e8="MenuRadioGroup",[obe,lbe]=gp(e8,{value:void 0,onValueChange:()=>{}}),t8=x.forwardRef((t,e)=>{const{value:r,onValueChange:n,...a}=t,i=Zs(n);return s.jsx(obe,{scope:t.__scopeMenu,value:r,onValueChange:i,children:s.jsx(t_,{...a,ref:e})})});t8.displayName=e8;var r8="MenuRadioItem",s8=x.forwardRef((t,e)=>{const{value:r,...n}=t,a=lbe(r8,t.__scopeMenu),i=r===a.value;return s.jsx(n8,{scope:t.__scopeMenu,checked:i,children:s.jsx(tj,{role:"menuitemradio","aria-checked":i,...n,ref:e,"data-state":s_(i),onSelect:gt(n.onSelect,()=>{var o;return(o=a.onValueChange)==null?void 0:o.call(a,r)},{checkForDefaultPrevented:!1})})})});s8.displayName=r8;var r_="MenuItemIndicator",[n8,cbe]=gp(r_,{checked:!1}),a8=x.forwardRef((t,e)=>{const{__scopeMenu:r,forceMount:n,...a}=t,i=cbe(r_,r);return s.jsx(fa,{present:n||O1(i.checked)||i.checked===!0,children:s.jsx(Zt.span,{...a,ref:e,"data-state":s_(i.checked)})})});a8.displayName=r_;var ube="MenuSeparator",i8=x.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t;return s.jsx(Zt.div,{role:"separator","aria-orientation":"horizontal",...n,ref:e})});i8.displayName=ube;var dbe="MenuArrow",o8=x.forwardRef((t,e)=>{const{__scopeMenu:r,...n}=t,a=ej(r);return s.jsx(MC,{...a,...n,ref:e})});o8.displayName=dbe;var hbe="MenuSub",[C3e,l8]=gp(hbe),Cy="MenuSubTrigger",c8=x.forwardRef((t,e)=>{const r=xp(Cy,t.__scopeMenu),n=eb(Cy,t.__scopeMenu),a=l8(Cy,t.__scopeMenu),i=Qk(Cy,t.__scopeMenu),o=x.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=i,u={__scopeMenu:t.__scopeMenu},d=x.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return x.useEffect(()=>d,[d]),x.useEffect(()=>{const h=l.current;return()=>{window.clearTimeout(h),c(null)}},[l,c]),s.jsx(Zk,{asChild:!0,...u,children:s.jsx(XO,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":h8(r.open),...t,ref:vx(e,a.onTriggerChange),onClick:h=>{var f;(f=t.onClick)==null||f.call(t,h),!(t.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:gt(t.onPointerMove,p0(h=>{i.onItemEnter(h),!h.defaultPrevented&&!t.disabled&&!r.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{r.onOpenChange(!0),d()},100))})),onPointerLeave:gt(t.onPointerLeave,p0(h=>{var m,g;d();const f=(m=r.content)==null?void 0:m.getBoundingClientRect();if(f){const y=(g=r.content)==null?void 0:g.dataset.side,b=y==="right",w=b?-5:5,j=f[b?"left":"right"],N=f[b?"right":"left"];i.onPointerGraceIntentChange({area:[{x:h.clientX+w,y:h.clientY},{x:j,y:f.top},{x:N,y:f.top},{x:N,y:f.bottom},{x:j,y:f.bottom}],side:y}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(h),h.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:gt(t.onKeyDown,h=>{var m;const f=i.searchRef.current!=="";t.disabled||f&&h.key===" "||G0e[n.dir].includes(h.key)&&(r.onOpenChange(!0),(m=r.content)==null||m.focus(),h.preventDefault())})})})});c8.displayName=Cy;var u8="MenuSubContent",d8=x.forwardRef((t,e)=>{const r=KO(ql,t.__scopeMenu),{forceMount:n=r.forceMount,...a}=t,i=xp(ql,t.__scopeMenu),o=eb(ql,t.__scopeMenu),l=l8(u8,t.__scopeMenu),c=x.useRef(null),u=Cr(e,c);return s.jsx(f0.Provider,{scope:t.__scopeMenu,children:s.jsx(fa,{present:n||i.open,children:s.jsx(f0.Slot,{scope:t.__scopeMenu,children:s.jsx(e_,{id:l.contentId,"aria-labelledby":l.triggerId,...a,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var h;o.isUsingKeyboardRef.current&&((h=c.current)==null||h.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:gt(t.onFocusOutside,d=>{d.target!==l.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:gt(t.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:gt(t.onKeyDown,d=>{var m;const h=d.currentTarget.contains(d.target),f=V0e[o.dir].includes(d.key);h&&f&&(i.onOpenChange(!1),(m=l.trigger)==null||m.focus(),d.preventDefault())})})})})})});d8.displayName=u8;function h8(t){return t?"open":"closed"}function O1(t){return t==="indeterminate"}function s_(t){return O1(t)?"indeterminate":t?"checked":"unchecked"}function mbe(t){const e=document.activeElement;for(const r of t)if(r===e||(r.focus(),document.activeElement!==e))return}function fbe(t,e){return t.map((r,n)=>t[(e+n)%t.length])}function pbe(t,e,r){const a=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=r?t.indexOf(r):-1;let o=fbe(t,Math.max(i,0));a.length===1&&(o=o.filter(u=>u!==r));const c=o.find(u=>u.toLowerCase().startsWith(a.toLowerCase()));return c!==r?c:void 0}function gbe(t,e){const{x:r,y:n}=t;let a=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const l=e[i],c=e[o],u=l.x,d=l.y,h=c.x,f=c.y;d>n!=f>n&&r<(h-u)*(n-d)/(f-d)+u&&(a=!a)}return a}function xbe(t,e){if(!e)return!1;const r={x:t.clientX,y:t.clientY};return gbe(r,e)}function p0(t){return e=>e.pointerType==="mouse"?t(e):void 0}var ybe=VO,bbe=Zk,vbe=JO,wbe=YO,jbe=t_,Nbe=ZO,Fbe=tj,Sbe=QO,Cbe=t8,kbe=s8,_be=a8,Ebe=i8,Abe=o8,Dbe=c8,Tbe=d8,rj="DropdownMenu",[Mbe]=li(rj,[qO]),mo=qO(),[Pbe,m8]=Mbe(rj),f8=t=>{const{__scopeDropdownMenu:e,children:r,dir:n,open:a,defaultOpen:i,onOpenChange:o,modal:l=!0}=t,c=mo(e),u=x.useRef(null),[d,h]=Lo({prop:a,defaultProp:i??!1,onChange:o,caller:rj});return s.jsx(Pbe,{scope:e,triggerId:hl(),triggerRef:u,contentId:hl(),open:d,onOpenChange:h,onOpenToggle:x.useCallback(()=>h(f=>!f),[h]),modal:l,children:s.jsx(ybe,{...c,open:d,onOpenChange:h,dir:n,modal:l,children:r})})};f8.displayName=rj;var p8="DropdownMenuTrigger",g8=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,disabled:n=!1,...a}=t,i=m8(p8,r),o=mo(r);return s.jsx(bbe,{asChild:!0,...o,children:s.jsx(Zt.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...a,ref:vx(e,i.triggerRef),onPointerDown:gt(t.onPointerDown,l=>{!n&&l.button===0&&l.ctrlKey===!1&&(i.onOpenToggle(),i.open||l.preventDefault())}),onKeyDown:gt(t.onKeyDown,l=>{n||(["Enter"," "].includes(l.key)&&i.onOpenToggle(),l.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});g8.displayName=p8;var Rbe="DropdownMenuPortal",x8=t=>{const{__scopeDropdownMenu:e,...r}=t,n=mo(e);return s.jsx(vbe,{...n,...r})};x8.displayName=Rbe;var y8="DropdownMenuContent",b8=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=m8(y8,r),i=mo(r),o=x.useRef(!1);return s.jsx(wbe,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...n,ref:e,onCloseAutoFocus:gt(t.onCloseAutoFocus,l=>{var c;o.current||(c=a.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:gt(t.onInteractOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!a.modal||d)&&(o.current=!0)}),style:{...t.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)"}})});b8.displayName=y8;var Bbe="DropdownMenuGroup",Lbe=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=mo(r);return s.jsx(jbe,{...a,...n,ref:e})});Lbe.displayName=Bbe;var Ibe="DropdownMenuLabel",v8=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=mo(r);return s.jsx(Nbe,{...a,...n,ref:e})});v8.displayName=Ibe;var Obe="DropdownMenuItem",w8=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=mo(r);return s.jsx(Fbe,{...a,...n,ref:e})});w8.displayName=Obe;var zbe="DropdownMenuCheckboxItem",j8=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=mo(r);return s.jsx(Sbe,{...a,...n,ref:e})});j8.displayName=zbe;var Ube="DropdownMenuRadioGroup",Hbe=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=mo(r);return s.jsx(Cbe,{...a,...n,ref:e})});Hbe.displayName=Ube;var $be="DropdownMenuRadioItem",N8=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=mo(r);return s.jsx(kbe,{...a,...n,ref:e})});N8.displayName=$be;var Wbe="DropdownMenuItemIndicator",F8=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=mo(r);return s.jsx(_be,{...a,...n,ref:e})});F8.displayName=Wbe;var qbe="DropdownMenuSeparator",S8=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=mo(r);return s.jsx(Ebe,{...a,...n,ref:e})});S8.displayName=qbe;var Gbe="DropdownMenuArrow",Vbe=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=mo(r);return s.jsx(Abe,{...a,...n,ref:e})});Vbe.displayName=Gbe;var Kbe="DropdownMenuSubTrigger",C8=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=mo(r);return s.jsx(Dbe,{...a,...n,ref:e})});
904C8.displayName=Kbe;var Jbe="DropdownMenuSubContent",k8=x.forwardRef((t,e)=>{const{__scopeDropdownMenu:r,...n}=t,a=mo(r);return s.jsx(Tbe,{...a,...n,ref:e,style:{...t.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)"}})});k8.displayName=Jbe;var Ybe=f8,Zbe=g8,Xbe=x8,_8=b8,E8=v8,A8=w8,D8=j8,T8=N8,M8=F8,P8=S8,R8=C8,B8=k8;const tb=Ybe,rb=Zbe,Qbe=x.forwardRef(({className:t,inset:e,children:r,...n},a)=>s.jsxs(R8,{ref:a,className:xt("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",e&&"pl-8",t),...n,children:[r,s.jsx(Ih,{className:"ml-auto h-4 w-4"})]}));Qbe.displayName=R8.displayName;const eve=x.forwardRef(({className:t,...e},r)=>s.jsx(B8,{ref:r,className:xt("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]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));eve.displayName=B8.displayName;const Ix=x.forwardRef(({className:t,sideOffset:e=4,...r},n)=>s.jsx(Xbe,{children:s.jsx(_8,{ref:n,sideOffset:e,className:xt("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",t),...r})}));Ix.displayName=_8.displayName;const Gn=x.forwardRef(({className:t,inset:e,...r},n)=>s.jsx(A8,{ref:n,className:xt("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...r}));Gn.displayName=A8.displayName;const tve=x.forwardRef(({className:t,children:e,checked:r,...n},a)=>s.jsxs(D8,{ref:a,className:xt("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:r,...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(M8,{children:s.jsx(un,{className:"h-4 w-4"})})}),e]}));tve.displayName=D8.displayName;const rve=x.forwardRef(({className:t,children:e,...r},n)=>s.jsxs(T8,{ref:n,className:xt("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(M8,{children:s.jsx(QM,{className:"h-2 w-2 fill-current"})})}),e]}));rve.displayName=T8.displayName;const L8=x.forwardRef(({className:t,inset:e,...r},n)=>s.jsx(E8,{ref:n,className:xt("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...r}));L8.displayName=E8.displayName;const pd=x.forwardRef(({className:t,...e},r)=>s.jsx(P8,{ref:r,className:xt("-mx-1 my-1 h-px bg-muted",t),...e}));pd.displayName=P8.displayName;const sve=t=>{const{user:e}=ts(),[r,n]=x.useState({all:0,approved:0,pending:0,rejected:0}),[a,i]=x.useState(!0);return x.useEffect(()=>{(async()=>
904{if(!e){n({all:0,approved:0,pending:0,rejected:0}),i(!1);return}try{i(!0);const[l,c,u]=await Promise.all([Ly({status:"approved",ownerId:e.id,limit:1}),Ly({status:"pending",ownerId:e.id,limit:1}),Ly({status:"rejected",ownerId:e.id,limit:1})]),d=l.count||0,h=c.count||0,f=u.count||0,m=d+h+f;n({all:m,approved:d,pending:h,rejected:f})}catch(l){console.error("Error fetching business counts:",l),n({all:0,approved:0,pending:0,rejected:0})}finally{i(!1)}})()},[e,t]),{counts:r,isLoading:a}},nve={all:"All",approved:"Approved",pending:"Pending",rejected:"Rejected"},ave=()=>{const[t,e]=x.useState("all"),[r,n]=x.useState(!1),[a,i]=x.useState(!1),[o,l]=x.useState(null),[c,u]=x.useState(0),[d,h]=x.useState(null),[f,m]=x.useState(!1),{toast:g}=St(),{counts:y,isLoading:b}=sve(c),w=()=>{n(!0)},j=D=>{l(D),i(!0)},N=()=>{u(D=>D+1)},S=D=>{console.log("Business created:",D),console.log("Is first business:",D.is_first_business),console.log("Business created - subscription required for activation"),g({title:"Business Created",description:"Your business has been created. A subscription is required to activate it and make it visible to customers."}),u(A=>A+1)},E=D=>{console.log("Activating business:",D.name),h(D),m(!0)},C=()=>{m(!1),h(null),u(D=>D+1),g({title:"Business Activated",description:"Your business subscription is now active!"})},T=D=>{if(b)return null;const A=y[D];if(A<=0)return null;const R=D==="approved"?"bg-green-100 text-green-700":D==="pending"?"bg-yellow-100 text-yellow-700":D==="rejected"?"bg-red-100 text-red-700":"";return s.jsx(ke,{variant:"secondary",className:xt("ml-1",R),children:A})};return s.jsx("div",{className:"py-4 sm:py-6 md:py-8",children:s.jsxs("div",{className:"container-wrapper px-3 sm:px-4",children:[s.jsx("h1",{className:"text-2xl sm:text-3xl font-bold mb-4 sm:mb-6",children:"My Businesses"}),s.jsxs(sn,{defaultValue:"all",value:t,onValueChange:e,children:[s.jsxs("div",{className:"hidden md:flex items-center justify-between gap-4 mb-6",children:[s.jsxs(Qs,{className:"flex flex-wrap sm:flex-nowrap overflow-x-auto p-1.5 h-auto min-h-10",children:[s.jsxs(Gt,{value:"all",className:"flex items-center gap-2 shrink-0",children:["All",T("all")]}),s.jsxs(Gt,{value:"approved",className:"flex items-center gap-2 shrink-0",children:["Approved",T("approved")]}),s.jsxs(Gt,{value:"pending",className:"flex items-center gap-2 shrink-0",children:["Pending",T("pending")]}),s.jsxs(Gt,{value:"rejected",className:"flex items-center gap-2 shrink-0",children:["Rejected",T("rejected")]})]}),s.jsx(Y,{className:"bg-chamber-blue shrink-0",onClick:w,children:"Add Business"})]}),s.jsxs("div",{className:"md:hidden space-y-3 mb-6",children:[s.jsxs(tb,{children:[s.jsx(rb,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"w-full justify-between h-11 px-4 font-medium bg-muted/50 hover:bg-muted",children:[s.jsxs("span",{className:"flex items-center gap-2",children:[nve[t]??"All",T(t)]}),s.jsx(fd,{className:"h-4 w-4 shrink-0 opacity-50"})]})}),s.jsxs(Ix,{align:"start",className:"w-[var(--radix-dropdown-menu-trigger-width)]",children:[s.jsxs(Gn,{onClick:()=>e("all"),className:"flex items-center justify-between",children:["All ",T("all")]}),s.jsxs(Gn,{onClick:()=>e("approved"),className:"flex items-center justify-between",children:["Approved ",T("approved")]}),s.jsxs(Gn,{onClick:()=>e("pending"),className:"flex items-center justify-between",children:["Pending ",T("pending")]}),s.jsxs(Gn,{onClick:()=>e("rejected"),className:"flex items-center justify-between",children:["Rejected ",T("rejected")]})]})]}),s.jsx(Y,{className:"w-full bg-chamber-blue",onClick:w,children:"Add Business"})]}),s.jsx(U0e,{open:r,onOpenChange:n,onBusinessCreated:S}),s.jsx(H0e,{open:a,onOpenChange:i,onBusinessUpdated:N,business:o}),d&&s.jsx($0e,{open:f,onOpenChange:m,businessId:d.id,businessName:d.name,onSubscriptionActive:C}),s.jsx(Rt,{value:"all",className:"mt-0",children:s.jsx(De,{className:"overflow-hidden",children:s.jsx(Be,{className:"p-4 pt-4 sm:p-6 sm:pt-6",children:s.jsx(Fy,{ownerOnly:!0,show
vendor: 4,371 bytes, lines 904-912
904Filters:!0,showSearch:!0,status:"all",showEditButton:!0,onEditBusiness:j,onActivateBusiness:E,showStatusBadges:!0})})})},`all-${c}`),s.jsx(Rt,{value:"approved",className:"mt-0",children:s.jsx(De,{className:"overflow-hidden",children:s.jsx(Be,{className:"p-4 pt-4 sm:p-6 sm:pt-6",children:s.jsx(Fy,{ownerOnly:!0,showFilters:!0,showSearch:!0,status:"approved",showEditButton:!0,onEditBusiness:j,onActivateBusiness:E,showStatusBadges:!0})})})},`approved-${c}`),s.jsx(Rt,{value:"pending",className:"mt-0",children:s.jsx(De,{className:"overflow-hidden",children:s.jsx(Be,{className:"p-4 pt-4 sm:p-6 sm:pt-6",children:s.jsx(Fy,{ownerOnly:!0,showFilters:!0,showSearch:!0,status:"pending",showEditButton:!0,onEditBusiness:j,onActivateBusiness:E,showStatusBadges:!0})})})},`pending-${c}`),s.jsx(Rt,{value:"rejected",className:"mt-0",children:s.jsx(De,{className:"overflow-hidden",children:s.jsx(Be,{className:"p-4 pt-4 sm:p-6 sm:pt-6",children:s.jsx(Fy,{ownerOnly:!0,showFilters:!0,showSearch:!0,status:"rejected",showEditButton:!0,onEditBusiness:j,onActivateBusiness:E,showStatusBadges:!0})})})},`rejected-${c}`)]})]})})};var I8={exports:{}},O8={};/** 905 * @license React 906 * use-sync-external-store-shim.production.js 907 * 908 * Copyright (c) Meta Platforms, Inc. and affiliates. 909 * 910 * This source code is licensed under the MIT license found in the 911 * LICENSE file in the root directory of this source tree. 912 */var cx=x;function ive(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var ove=typeof Object.is=="function"?Object.is:ive,lve=cx.useState,cve=cx.useEffect,uve=cx.useLayoutEffect,dve=cx.useDebugValue;function hve(t,e){var r=e(),n=lve({inst:{value:r,getSnapshot:e}}),a=n[0].inst,i=n[1];return uve(function(){a.value=r,a.getSnapshot=e,rN(a)&&i({inst:a})},[t,r,e]),cve(function(){return rN(a)&&i({inst:a}),t(function(){rN(a)&&i({inst:a})})},[t]),dve(r),r}function rN(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!ove(t,r)}catch{return!0}}function mve(t,e){return e()}var fve=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?mve:hve;O8.useSyncExternalStore=cx.useSyncExternalStore!==void 0?cx.useSyncExternalStore:fve;I8.exports=O8;var pve=I8.exports;function gve(){return pve.useSyncExternalStore(xve,()=>!0,()=>!1)}function xve(){return()=>{}}var n_="Avatar",[yve]=XL(n_),[bve,z8]=yve(n_),U8=x.forwardRef((t,e)=>{const{__scopeAvatar:r,...n}=t,[a,i]=x.useState("idle");return s.jsx(bve,{scope:r,imageLoadingStatus:a,onImageLoadingStatusChange:i,children:s.jsx(dm.span,{...n,ref:e})})});U8.displayName=n_;var H8="AvatarImage",$8=x.forwardRef((t,e)=>{const{__scopeAvatar:r,src:n,onLoadingStatusChange:a=()=>{},...i}=t,o=z8(H8,r),l=vve(n,i),c=Zs(u=>{a(u),o.onImageLoadingStatusChange(u)});return En(()=>{l!=="idle"&&c(l)},[l,c]),l==="loaded"?s.jsx(dm.img,{...i,ref:e,src:n}):null});$8.displayName=H8;var W8="AvatarFallback",q8=x.forwardRef((t,e)=>{const{__scopeAvatar:r,delayMs:n,...a}=t,i=z8(W8,r),[o,l]=x.useState(n===void 0);return x.useEffect(()=>{if(n!==void 0){const c=window.setTimeout(()=>l(!0),n);return()=>window.clearTimeout(c)}},[n]),o&&i.imageLoadingStatus!=="loaded"?s.jsx(dm.span,{...a,ref:e}):null});q8.displayName=W8;function o3(t,e){return t?e?(t.src!==e&&(t.src=e),t.complete&&t.naturalWidth>0?"loaded":"loading"):"error":"idle"}function vve(t,{referrerPolicy:e,crossOrigin:r}){const n=gve(),a=x.useRef(null),i=n?(a.current||(a.current=new window.Image),a.current):null,[o,l]=x.useState(()=>o3(i,t));return En(()=>{l(o3(i,t))},[i,t]),En(()=>{const c=h=>()=>{l(h)};if(!i)return;const u=c("loaded"),d=c("error");return i.addEventListener("load",u),i.addEventListener("error",d),e&&(i.referrerPolicy=e),typeof r=="string"&&(i.crossOrigin=r),()=>{i.removeEventListener("load",u),i.removeEventListener("error",d)}},[i,r,e]),o}var G8=U8,V8=$8,K8=q8;const om=x.forwardRef(({className:t,...e},r)=>s.jsx(G8,{ref:r,className:xt("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));om.displayName=G8.displayName;const ux=x.forwardRef(({className:t,...e},r)=>s.jsx(V8,{ref:r,className:xt("aspect-square h-full w-full object-cover",t),...e}));ux.displayName=V8.displayName;const ep=x.forwardRef(({className:t,...e},r)=>s.jsx(K8,{ref:r,className:xt("flex h-full w-full items-center justify-center rounded-full bg-muted",t),...e}));ep.displayName=K8.displayName;const wve=()=>{const{user:t}=ts(),{toast:e}
912=St(),[r,n]=x.useState(null),[a,i]=x.useState(!0),[o,l]=x.useState(!1),[c,u]=x.useState(!1),[d,h]=x.useState(null),[f,m]=x.useState(""),[g,y]=x.useState("");x.useEffect(()=>{(async()=>{if(!t){i(!1);return}try{const{data:E,error:C}=await Q.from("profiles").select("id, first_name, last_name, email, avatar_url, bio").eq("id",t.id).single();if(C)throw C;E&&(n({id:E.id,firstName:E.first_name,lastName:E.last_name,email:E.email,avatarUrl:E.avatar_url,bio:E.bio||""}),m(E.avatar_url||""))}catch(E){console.error("Error fetching user profile:",E),e({title:"Error",description:"Failed to fetch user profile",variant:"destructive"})}finally{i(!1)}})()},[t==null?void 0:t.id]);const b=(S,E)=>{r&&n({...r,[S]:E})},w=()=>r?`${r.firstName.charAt(0)}${r.lastName.charAt(0)}`.toUpperCase():"",j=S=>{var T;const E=(T=S.target.files)==null?void 0:T[0];if(!E)return;if(!["image/jpeg","image/png","image/gif","image/webp"].includes(E.type)){e({title:"Invalid file",description:"Please upload a valid image file (JPEG, PNG, GIF, or WEBP)",variant:"destructive"});return}if(E.size>5*1024*1024){e({title:"File too large",description:"Image file size must be less than 5MB",variant:"destructive"});return}h(E),y(URL.createObjectURL(E))},N=async S=>{if(S.preventDefault(),!r||!t)return;l(!0);let E=f;try{if(d){const T=d.name.split(".").pop(),D=`${r.id}/${Wn()}.${T}`,{error:A}=await Q.storage.from("profile-image").upload(D,d,{cacheControl:"3600",upsert:!1});if(A)throw A;const{data:R}=Q.storage.from("profile-image").getPublicUrl(D);E=R.publicUrl,m(E)}const{error:C}=await Q.from("profiles").update({first_name:r.firstName,last_name:r.lastName,avatar_url:E,bio:r.bio,updated_at:new Date().toISOString()}).eq("id",t.id);if(C)throw C;e({title:"Profile updated",description:"Your profile has been updated successfully"}),d&&(h(null),g&&(URL.revokeObjectURL(g),y("")))}catch(C){console.error("Error updating profile:",C),e({title:"Update failed",description:C.message||"Failed to update profile",variant:"destructive"})}finally{l(!1)}};return a?s.jsxs(De,{children:[s.jsxs(ot,{children:[s.jsx(ut,{children:"Personal Information"}),s.jsx(us,{children:"Loading your profile..."})]}),s.jsx(Be,{className:"flex justify-center py-8",children:s.jsx(Mt,{className:"h-8 w-8 animate-spin text-primary"})})]}):r?s.jsx("form",{onSubmit:N,children:s.jsxs(De,{children:[s.jsxs(ot,{children:[s.jsx(ut,{children:"Personal Information"}),s.jsx(us,{children:"Update your account details and preferences"})]}),s.jsxs(Be,{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-col items-center sm:items-start sm:flex-row gap-4 pb-4 border-b",children:[s.jsxs(om,{className:"h-24 w-24",children:[s.jsx(ux,{src:g||f,alt:`${r.firstName} ${r.lastName}`}),s.jsx(ep,{className:"text-lg bg-primary text-primary-foreground",children:w()})]}),s.jsxs("div",{className:"flex flex-col space-y-2",children:[s.jsx("h3",{className:"text-lg font-medium",children:"Profile Photo"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"This will be displayed on your profile"}),s.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[s.jsx(Z,{htmlFor:"avatarUrl",children:"Image URL"}),s.jsx(Ne,{id:"avatarUrl",type:"text",value:f,onChange:S=>m(S.target.value),placeholder:"https://example.com/your-image.jpg",className:"max-w-md"})]}),s.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Or upload a new image:"}),s.jsx("div",{className:"flex gap-2 mt-2",children:s.jsxs(Y,{type:"button",size:"sm",variant:"secondary",className:"flex items-center gap-1",onClick:()=>{var S;return(S=document.getElementById("avatar-upload"))==null?void 0:S.click()},children:[s.jsx(vn,{className:"h-4 w-4"}),s.jsx("span",{children:"Choose File"}),s.jsx("input",{id:"avatar-upload",type:"file",accept:"image/*",onChange:j,className:"hidden"})]})}),d&&s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Selected: ",d.name," (",Math.round(d.size/1024)," KB)"]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"firstName",children:"First Name"}),s.jsx(Ne,{id:"firstName",value:r.firstName,onChange:S=>
912b("firstName",S.target.value),required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"lastName",children:"Last Name"}),s.jsx(Ne,{id:"lastName",value:r.lastName,onChange:S=>b("lastName",S.target.value),required:!0})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"bio",children:"Bio"}),s.jsx(zt,{id:"bio",rows:4,placeholder:"Tell us about yourself...",value:r.bio||"",onChange:S=>b("bio",S.target.value),className:"resize-none"})]}),s.jsx("div",{className:"pt-4",children:s.jsx(Y,{type:"submit",disabled:o,className:"w-full sm:w-auto",children:o?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save Changes"})})]})]})}):s.jsxs(De,{children:[s.jsxs(ot,{children:[s.jsx(ut,{children:"Personal Information"}),s.jsx(us,{children:"Unable to load user information"})]}),s.jsx(Be,{children:s.jsx("p",{className:"text-gray-500",children:"Please refresh the page or sign in again."})})]})},jve=()=>{const{user:t}=ts(),[e,r]=x.useState(""),[n,a]=x.useState(""),[i,o]=x.useState(""),[l,c]=x.useState(!1),u=()=>n.length<6?(ct.error("New password must be at least 6 characters long"),!1):n!==i?(ct.error("New passwords do not match"),!1):!0,d=async h=>{if(h.preventDefault(),!!u()){c(!0);try{const{error:f}=await Q.auth.signInWithPassword({email:(t==null?void 0:t.email)||"",password:e});if(f){ct.error("Current password is incorrect"),c(!1);return}const{error:m}=await Q.auth.updateUser({password:n});m?ct.error(m.message):(ct.success("Password updated successfully!"),r(""),a(""),o(""))}catch(f){ct.error("An error occurred while updating your password"),console.error("Password update error:",f)}finally{c(!1)}}};return s.jsxs(De,{children:[s.jsxs(ot,{children:[s.jsx(ut,{children:"Password"}),s.jsx(us,{children:"Update your password"})]}),s.jsx(Be,{className:"space-y-4",children:s.jsxs("form",{onSubmit:d,className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-sm font-medium text-gray-700 block mb-1",children:"Current Password"}),s.jsx(Ne,{type:"password",value:e,onChange:h=>r(h.target.value),required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-sm font-medium text-gray-700 block mb-1",children:"New Password"}),s.jsx(Ne,{type:"password",value:n,onChange:h=>a(h.target.value),required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-sm font-medium text-gray-700 block mb-1",children:"Confirm New Password"}),s.jsx(Ne,{type:"password",value:i,onChange:h=>o(h.target.value),required:!0})]}),s.jsx("div",{className:"pt-4",children:s.jsx(Y,{type:"submit",disabled:l,children:l?"Updating...":"Update Password"})})]})})]})},Nve=()=>{var g;const{user:t}=ts(),{toast:e}=St(),[r,n]=x.useState(""),[a,i]=x.useState(!1),[o,l]=x.useState(!1),[c,u]=x.useState(""),d=y=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(y),h=r.toLowerCase()===((g=t==null?void 0:t.email)==null?void 0:g.toLowerCase()),f=async y=>{try{const{data:b,error:w}=await Q.auth.getSession();if(w||!b.session)throw new Error("User is not signed in");const{data:j,error:N}=await Q.auth.updateUser({email:y});if(N)throw N;if(t!=null&&t.id){const{error:S}=await Q.from("profiles").update({email:y,updated_at:new Date().toISOString()}).eq("id",t.id);S&&console.warn("Warning: Failed to update profile email immediately:",S)}return console.log("Email update initiated:",j),{success:!0,message:"Email update initiated. Please check your new email (and possibly old email) for verification codes.",data:j}}catch(b){return console.error("Error updating email:",b.message),{success:!1,message:b.message}}},m=async y=>{if(y.preventDefault(),!t){e({title:"Authentication Error",description:"You must be signed in to update your email",variant:"destructive"});return}if(!r.trim()){e({title:"Validation Error",description:"Please enter a new email address",variant:"destructive"});return}if(!d(r)){e({title:"Invalid Email",description:"Please enter a valid email address",variant:"destructive"});return}if(h){e({title:"Same Email",description:"The new email is the same as your current email",variant:"destructive"});return}i(!0);try{const b=await f(r);b.success?(e({title:"Email Update Initiated",description:b.message}),l(!0),u(r),n("")):e({title:"Update Failed",description:b.message,variant:"destructive"})}catch(b){console.error("Error updating email:",b),e({title:"Update Failed",description:"An unexpected error occurred while updating your email",variant:"destructive"})}finally{i(!1)}};return s.jsxs(De,{children:[s.jsxs(ot,{children:[s.jsxs(ut,{className:"flex items-center gap-2",children:[s.jsx(fs,{className:"h-5 w-5"}),"Email Settings"]}),s.jsx(us,{children:"Update your email address. You'll need to verify the new email before the change takes effect."})]}),s.jsxs(Be,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{children:"Current Email"}),s.jsx(Ne,{value:(t==null?void 0:t.email)||"",disabled:!0,className:"bg-muted"})]}),o&&s.jsxs(da,{children:[s.jsx(Ts,{className:"h-4 w-4"}),s.jsx(ha,{children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("p",{className:"font-medium",children:["Email update pending for: ",c]}),s.jsx("p",{className:"text-sm",children:"Please check your email inbox (both old and new email addresses) for verification codes. You may need to verify the change from both email addresses depen
912ding on your security settings."}),s.jsx(Y,{variant:"outline",size:"sm",onClick:()=>{l(!1),u("")},children:"Dismiss"})]})})]}),s.jsxs("form",{onSubmit:m,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"newEmail",children:"New Email Address"}),s.jsx(Ne,{id:"newEmail",type:"email",value:r,onChange:y=>n(y.target.value),placeholder:"Enter your new email address",disabled:a}),r&&!d(r)&&s.jsx("p",{className:"text-sm text-red-600",children:"Please enter a valid email address"}),r&&h&&s.jsx("p",{className:"text-sm text-yellow-600",children:"This email is the same as your current email"})]}),s.jsx("div",{className:"pt-2",children:s.jsx(Y,{type:"submit",disabled:a||!r||!d(r)||h,className:"w-full sm:w-auto",children:a?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"}),"Updating Email..."]}):"Update Email"})})]}),s.jsx("div",{className:"mt-6 p-4 bg-blue-50 rounded-lg border border-blue-200",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(Or,{className:"h-5 w-5 text-blue-600 mt-0.5 flex-shrink-0"}),s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsx("p",{className:"font-medium text-blue-900",children:"What happens next?"}),s.jsxs("ul",{className:"space-y-1 text-blue-800",children:[s.jsx("li",{children:"⢠You'll receive verification codes at both your current and new email addresses"}),s.jsx("li",{children:"⢠Enter the verification codes to complete the change"}),s.jsx("li",{children:"⢠Your email will not be updated until you verify from both addresses"}),s.jsx("li",{children:"⢠This security measure helps protect your account from unauthorized changes"})]})]})]})}),s.jsx("div",{className:"mt-4 p-3 bg-amber-50 rounded-lg border border-amber-200",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(Ts,{className:"h-4 w-4 text-amber-600 mt-0.5 flex-shrink-0"}),s.jsxs("p",{className:"text-sm text-amber-800",children:[s.jsx("span",{className:"font-medium",children:"Security Note:"})," Make sure you have access to both your current and new email addresses before initiating this change. If you lose access to your current email, you may need to contact support to complete the email change."]})]})})]})]})};class ky{static async getUserInvoices(){try{const{data:{user:e}}=await Q.auth.getUser();if(!e)throw new Error("User not authenticated");const{data:r,error:n}=await Q.functions.invoke("get-user-invoices",{body:{}});if(n)throw new Error(n.message||"Failed to fetch invoices");return r}catch(e){throw console.error("Error fetching user invoices:",e),e}}static openInvoicePDF(e){e&&window.open(e,"_blank")}static openHostedInvoice(e){e&&window.open(e,"_blank")}static formatAmount(e,r="usd"){return new Intl.NumberFormat("en-US",{style:"currency",currency:r.toUpperCase()}).format(e/100)}static getSubscriptionTypeDisplay(e){switch(e){case"membership":return"Membership Subscription";case"business":return"Individual Business Subscription";case"feature":return"Feature Business Subscription";default:return"Subscription"}}static getStatusBadgeVariant(e){switch(e){case"paid":return"default";case"open":return"secondary";case"void":case"uncollectible":return"destructive";default:return"outline"}}}const Fve=()=>{const[t,e]=x.useState([]),[r,n]=x.useState(!0),[a,i]=x.useState(null),[o,l]=x.useState(!1),[c,u]=x.useState(0),d=async()=>{try{n(!0),i(null);const f=await ky.getUserInvoices();e(f.invoices),l(f.has_more),u(f.total_count)}catch(f){console.error("Error fetching invoices:",f),i(f instanceof Error?f.message:"Failed to fetch invoices"),e([])}finally{n(!1)}},h=async()=>{await d()};return x.useEffect(()=>{d()},[]),{invoices:t,loading:r,error:a,refetch:h,hasMore:o,totalCount:c}},Sve=()=>{const{invoices:t,loading:e,error:r,refetch:n,totalCount:a}=Fve(),i=u=>{u.invoice_pdf&&ky.openInvoicePDF(u.invoice_pdf)},o=u=>{u.hosted_invoice_url&&ky.openHostedInvoice(u.hosted_invoice_url)},l=u=>{switch(u){case"membership":return s.jsx(Os,{className:"h-4 w-4"});case"business":return s.jsx(ka,{className:"h-4 w-4"});case"feature":return s.jsx(Ii,{className:"h-4 w-4"});default:return s.jsx(ti,{className:"h-4 w-4"})}},c=u=>{switch(u){case"paid":return"bg-green-100 text-green-800 border-green-200";case"open":return"bg-blue-100 text-blue-800 border-blue-200";case"void":case"uncollectible":return"bg-red-100 text-red-800 border-red-200";case"draft":return"bg-gray-100 text-gray-800 border-gray-200";default:return"bg-yellow-100 text-yellow-800 border-yellow-200"}};return e?s.jsxs(De,{className:"overflow-hidden",children:[s.jsx(ot,{className:"p-4 sm:p-6",children:s.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:s.jsxs("div",{children:[s.jsxs(ut,{className:"flex items-center gap-2 text-lg sm:text-xl",children:[s.jsx(ti,{className:"h-5 w-5 shrink-0"}),"Invoices"]}),s.jsx(us,{className:"text-sm",children:"View and download your invoices"})]})})}),s.jsx(Be,{className:"p-4 sm:p-6 pt-0",children:s.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-2 h-32 text-gray-500",children:[s.jsx(Pl,{className:"h-6 w-6 animate-spin text-gray-400 shrink-0"}),s.jsx("span",{className:"text-sm sm:text-base",children:"Loading invoices..."})]})})]}):r?s.jsxs(De,{className:"overflow-hidden",children:[s.jsx(ot,{className:"p-4 sm:p-6",children:s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[s.jsxs("div",{children:[s.jsxs(ut,{className:"flex items-center gap-2 text-lg sm:text-xl",children:[s.jsx(ti,{className:"h-5 w-5 shrink-0"}),"Invoices"]}),s.jsx(us,{className:"text-sm",children:"View and download your invoices"})]}),s.jsxs(Y,{onClick:n,variant:"outline",size:"sm",className:"w-full sm:w-auto
912shrink-0",children:[s.jsx(Pl,{className:"h-4 w-4 mr-2 shrink-0"}),"Retry"]})]})}),s.jsx(Be,{className:"p-4 sm:p-6 pt-0",children:s.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-2 h-32 text-red-600 text-sm sm:text-base",children:[s.jsx(Ts,{className:"h-6 w-6 shrink-0"}),s.jsx("span",{className:"text-center",children:r})]})})]}):s.jsxs(De,{className:"overflow-hidden",children:[s.jsx(ot,{className:"p-4 sm:p-6",children:s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs(ut,{className:"flex items-center gap-2 text-lg sm:text-xl",children:[s.jsx(ti,{className:"h-5 w-5 shrink-0"}),"Invoices"]}),s.jsxs(us,{className:"text-sm",children:["View and download your invoices (",a," total)"]})]}),s.jsxs(Y,{onClick:n,variant:"outline",size:"sm",className:"w-full sm:w-auto shrink-0",children:[s.jsx(Pl,{className:"h-4 w-4 mr-2 shrink-0"}),"Refresh"]})]})}),s.jsx(Be,{className:"p-4 sm:p-6 pt-0",children:t.length===0?s.jsxs("div",{className:"text-center py-6 sm:py-8 px-2",children:[s.jsx(ti,{className:"h-10 w-10 sm:h-12 sm:w-12 text-gray-400 mx-auto mb-3 sm:mb-4"}),s.jsx("h3",{className:"text-base sm:text-lg font-medium text-gray-900 mb-2",children:"No invoices found"}),s.jsx("p",{className:"text-sm sm:text-base text-gray-500 max-w-sm mx-auto",children:"You don't have any invoices yet. Invoices will appear here after you make a subscription."})]}):s.jsx("div",{className:"space-y-3 sm:space-y-4",children:t.map(u=>s.jsxs("div",{className:"border rounded-lg p-3 sm:p-4 hover:bg-gray-50 transition-colors",children:[s.jsxs("div",{className:"flex flex-col gap-4 sm:gap-0 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3 mb-2",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l(u.subscription_type),s.jsx("h4",{className:"font-medium text-gray-900 truncate",children:u.number||u.id})]}),s.jsx(ke,{variant:"outline",className:`shrink-0 ${c(u.status)}`,children:u.status.charAt(0).toUpperCase()+u.status.slice(1)})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 sm:gap-4 text-sm text-gray-600",children:[s.jsxs("div",{className:"min-w-0",children:[u.business_name&&s.jsxs("div",{className:"text-gray-600 truncate",title:u.business_name,children:["Business: ",u.business_name]}),u.description&&s.jsx("div",{className:"text-gray-600 break-words",children:u.description})]}),s.jsxs("div",{className:"shrink-0",children:[s.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[s.jsx(Br,{className:"h-3 w-3 shrink-0"}),s.jsx("span",{children:Cs(u.created,"MMM dd, yyyy")})]}),s.jsxs("div",{className:"text-gray-600 text-xs sm:text-sm",children:["Period: ",Cs(u.period_start,"MMM dd")," â ",Cs(u.period_end,"MMM dd, yyyy")]})]})]})]}),s.jsxs("div",{className:"flex flex-col gap-2 sm:items-end sm:ml-4 border-t border-gray-100 pt-3 sm:pt-0 sm:border-0",children:[s.jsx("div",{className:"text-base sm:text-lg font-semibold text-gray-900",children:ky.formatAmou
912nt(u.amount_paid||u.amount_due,u.currency)}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[u.hosted_invoice_url&&s.jsxs(Y,{onClick:()=>o(u),variant:"outline",size:"sm",className:"flex-1 sm:flex-initial min-h-9",children:[s.jsx(wx,{className:"h-3 w-3 mr-1 shrink-0"}),"View"]}),u.invoice_pdf&&s.jsxs(Y,{onClick:()=>i(u),variant:"outline",size:"sm",className:"flex-1 sm:flex-initial min-h-9",children:[s.jsx(e6,{className:"h-3 w-3 mr-1 shrink-0"}),"PDF"]})]})]})]}),u.line_items.length>0&&s.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-200",children:[s.jsx("div",{className:"text-xs text-gray-500 mb-2",children:"Line Items"}),s.jsx("div",{className:"space-y-1 overflow-x-auto",children:u.line_items.map(d=>s.jsxs("div",{className:"flex justify-between gap-2 text-sm min-w-0",children:[s.jsxs("span",{className:"text-gray-700 truncate",children:[d.description||"Subscription",d.quantity>1&&` (Ã${d.quantity})`]}),s.jsx("span",{className:"text-gray-900 shrink-0",children:ky.formatAmount(d.amount,d.currency)})]},d.id))})]})]},u.id))})})]})},Cve=()=>{const[t,e]=x.useState("profile");return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Profile Settings"}),s.jsx("p",{className:"text-gray-600",children:"Manage your account information and preferences"})]}),s.jsxs(sn,{value:t,onValueChange:e,className:"space-y-6",children:[s.jsxs(Qs,{className:"grid w-full grid-cols-4",children:[s.jsxs(Gt,{value:"profile",className:"flex items-center gap-2",children:[s.jsx(ma,{className:"h-4 w-4"}),s.jsx("span",{className:"hidden sm:inline",children:"Profile Information"}),s.jsx("span",{className:"sm:hidden",children:"Profile"})]}),s.jsxs(Gt,{value:"email",className:"flex items-center gap-2",children:[s.jsx(fs,{className:"h-4 w-4"}),s.jsx("span",{className:"hidden sm:inline",children:"Email Settings"}),s.jsx("span",{className:"sm:hidden",children:"Email"})]}),s.jsxs(Gt,{value:"password",className:"flex items-center gap-2",children:[s.jsx(Xy,{className:"h-4 w-4"}),s.jsx("span",{className:"hidden sm:inline",children:"Change Password"}),s.jsx("span",{className:"sm:hidden",children:"Password"})]}),s.jsxs(Gt,{value:"invoices",className:"flex items-center gap-2",children:[s.jsx(ti,{className:"h-4 w-4"}),s.jsx("span",{className:"hidden sm:inline",children:"Invoices"}),s.jsx("span",{className:"sm:hidden",children:"Invoices"})]})]}),s.jsx(Rt,{value:"profile",className:"space-y-6 data-[state=inactive]:hidden",children:s.jsx(wve,{})}),s.jsx(Rt,{value:"email",className:"space-y-6 data-[state=inactive]:hidden",children:s.jsx(Nve,{})}),s.jsx(Rt,{value:"password",className:"space-y-6 data-[state=inactive]:hidden",children:s.jsx(jve,{})}),s.jsx(Rt,{value:"invoices",className:"space-y-6 data-[state=inactive]:hidden",children:s.jsx(Sve,{})})]})]})},kve=[{id:"1",type:"notification",title:"Business Approved",sender:"System",date:"2025-04-09T10:30:00",content:'Your business "Acme Corporation" has been approved and is now visible in the directory.',read:!1},{id:"2",type:"direct",title:"Question about your services",sender:"Jane Smith",date:"2025-04-08T14:45:00",content:"Hello, I'm interested in your services but had a few questions. Would you have time for a quick call this week?",read:!0},{id:"3",type:"newsletter",title:"Chamber Monthly Update",sender:"Chamber Newsletter",date:"2025-04-07T09:15:00",content:"Check out this month's upcoming events, new member spotlights, and important community announcements.",read:!1},{id:"4",type:"notification",title:"Event Reminder",sender:"System",date:"2025-04-06T16:20:00",content:`Reminder: You're registered for "Networking Breakfast" on April 12th at 8:00 AM.`,read:!0},{id:"5",type:"direct",title:"Partnership Opportunity",sender:"John Doe",date:"2025-04-05T11:10:00",content:"I believe our businesses might benefit from a partnership. Let's discuss some potential collaboration ideas.",read:!1},{id:"6",type:"newsletter",title:"Local Business Spotlight",sender:"Chamber Marketing",date:"2025-04-04T13:25:00",content:"Your business could be featured in our next Local Business Spotlight! Click here to apply.",read:!0},{id:"7",type:"notification",title:"New Member Discount",sender:"System",date:"2025-04-03T15:40:00",content:"As a new member, you have access to exclusive discounts with our partner businesses. Check them out!",read:!1},{id:"8",type:"direct",title:"Chamber Event Speaker Request",sender:"Event Coordinator",date:"2025-04-02T10:20:00",content:"We'd love to have you speak at our upcoming small business workshop. Are you interested?",read:!0},{id:"9",type:"newsletter",title:"Community Impact Report",sender:"Chamber Newsletter",date:"2025-04-01T08:15:00",content:"See how our
912chamber members are making a difference in the community this quarter.",read:!1},{id:"10",type:"notification",title:"Account Security Update",sender:"System",date:"2025-03-30T14:05:00",content:"We've enhanced our security measures. Please review your account settings to ensure everything is up to date.",read:!0},{id:"11",type:"direct",title:"Business Collaboration Proposal",sender:"Sarah Johnson",date:"2025-03-29T11:35:00",content:"I have a proposal for a joint marketing campaign that could benefit both our businesses.",read:!1},{id:"12",type:"newsletter",title:"Upcoming Workshops",sender:"Chamber Education",date:"2025-03-28T09:50:00",content:"Register now for our series of business development workshops happening next month.",read:!0}],_ve=({activeTab:t,unreadCount:e})=>s.jsxs(Qs,{className:"w-full",children:[s.jsxs(Gt,{value:"all",className:"flex-1",children:["All",e.all>0&&s.jsx(ke,{variant:"secondary",className:"ml-2",children:e.all})]}),s.jsxs(Gt,{value:"notification",className:"flex-1",children:["Notifications",e.notification>0&&s.jsx(ke,{variant:"secondary",className:"ml-2",children:e.notification})]}),s.jsxs(Gt,{value:"direct",className:"flex-1",children:["Direct Messages",e.direct>0&&s.jsx(ke,{variant:"secondary",className:"ml-2",children:e.direct})]}),s.jsxs(Gt,{value:"newsletter",className:"flex-1",children:["Newsletters",e.newsletter>0&&s.jsx(ke,{variant:"secondary",className:"ml-2",children:e.newsletter})]})]}),Eve=({type:t})=>{switch(t){case"notification":return s.jsx(MV,{className:"h-4 w-4"});case"newsletter":return s.jsx(yC,{className:"h-4 w-4"});case"direct":return s.jsx(fs,{className:"h-4 w-4"});default:return s.jsx(fs,{className:"h-4 w-4"})}},J8=t=>new Date(t).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),Ave=({message:t,isSelected:e,onClick:r})=>s.jsx(De,{className:`cursor-pointer ${t.read?"":"border-primary"} ${e?"bg-muted":""}`,onClick:r,children:s.jsx(Be,{className:"p-4",children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(om,{className:"h-8 w-8 bg-primary/10 flex items-center justify-center",children:s.jsx(Eve,{type:t.type})}),s.jsxs("div",{children:[s.jsx("h4",{className:`text-sm font-semibold leading-none ${t.read?"":"text-primary"}`,children:t.title}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:t.sender})]})]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:J8(t.date)})]})})}),Dve=({currentPage:t,totalPages:e,onPageChange:r})=>{const n=()=>
912{if(e<=5)return Array.from({length:e},(l,c)=>s.jsx(Qr,{children:s.jsx(ca,{isActive:t===c+1,onClick:()=>r(c+1),children:c+1})},c+1));const a=[];a.push(s.jsx(Qr,{children:s.jsx(ca,{isActive:t===1,onClick:()=>r(1),children:"1"})},1));let i=Math.max(2,t-1),o=Math.min(e-1,t+1);i>2&&a.push(s.jsx(Qr,{children:s.jsx("span",{className:"flex h-9 w-9 items-center justify-center text-gray-400",children:"..."})},"start-ellipsis"));for(let l=i;l<=o;l++)a.push(s.jsx(Qr,{children:s.jsx(ca,{isActive:t===l,onClick:()=>r(l),children:l})},l));return o<e-1&&a.push(s.jsx(Qr,{children:s.jsx("span",{className:"flex h-9 w-9 items-center justify-center text-gray-400",children:"..."})},"end-ellipsis")),e>1&&a.push(s.jsx(Qr,{children:s.jsx(ca,{isActive:t===e,onClick:()=>r(e),children:e})},e)),a};return e<=1?null:s.jsx(Pd,{className:"mt-4",children:s.jsxs(Rd,{children:[s.jsx(Qr,{children:s.jsx(Bd,{onClick:()=>t>1&&r(t-1),className:t===1?"pointer-events-none opacity-50":""})}),n(),s.jsx(Qr,{children:s.jsx(Ld,{onClick:()=>t<e&&r(t+1),className:t===e?"pointer-events-none opacity-50":""})})]})})},Tve=({messages:t,currentMessages:e,selectedMessage:r,currentPage:n,messagesPerPage:a,onViewMessage:i,onPageChange:o})=>{const l=Math.ceil(t.length/a);return s.jsxs("div",{className:"space-y-2 overflow-y-auto max-h-[500px] pr-2",children:[e.length===0?s.jsx("div",{className:"text-center py-8",children:s.jsx("p",{className:"text-gray-500",children:"No messages found"})}):e.map(c=>s.jsx(Ave,{message:c,isSelected:(r==null?void 0:r.id)===c.id,onClick:()=>i(c)},c.id)),t.length>a&&s.jsx(Dve,{currentPage:n,totalPages:l,onPageChange:o})]})};var Mve="Separator",l3="horizontal",Pve=["horizontal","vertical"],Y8=x.forwardRef((t,e)=>{const{decorative:r,orientation:n=l3,...a}=t,i=Rve(n)?n:l3,l=r?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return s.jsx(dm.div,{"data-orientation":i,...l,...a,ref:e})});Y8.displayName=Mve;function Rve(t){return Pve.includes(t)}var Z8=Y8;const yp=x.forwardRef(({className:t,orientation:e="horizontal",decorative:r=!0,...n},a)=>s.jsx(Z8,{ref:a,decorative:r,orientation:e,className:xt("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...n}));yp.displayName=Z8.displayName;const Bve=({message:t,onDelete:e})=>t?s.jsxs(De,{children:[s.jsx(ot,{className:"pb-2",children:s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsxs("div",{children:[s.jsx(ut,{children:t.title}),s.jsxs(us,{className:"mt-1",children:["From: ",t.sender," · ",J8(t.date)]})]}),s.jsx(Y,{variant:"outline",size:"icon",onClick:()=>e(t.id),children:s.jsx(vr,{className:"h-4 w-4"})})]})}),s.jsx(yp,{}),s.jsx(Be,{className:"pt-4",children:s.jsx("p",{className:"text-sm",children:t.content})})]}):s.jsxs("div",{className:"flex flex-col items-center justify-center h-full p-8 text-center",children:[s.jsx(fs,{className:"h-12 w-12 text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium",children:"Select a message"}),s.jsx("p",{className:"text-muted-foreground mt-1",children:"Click on a message to view its contents"})]}),Lve=()=>{const[t,e]=x.useState("all"),[r,n]=x.useState(kve),[a,i]=x.useState(null),[o,l]=x.useState(1),c=5,u=r.filter(j=>t==="all"?!0:j.type===t),d={all:r.filter(j=>!j.read).length,notification:r.filter(j=>j.type==="notification"&&!j.read).length,direct:r.filter(j=>j.type==="direct"&&!j.read).length,newsletter:r.filter(j=>j.type==="newsletter"&&!j.read).length},h=o*c,f=h-c,m=u.slice(f,h),g=j=>{n(r.map(N=>N.id===j?{...N,read:!0}:N))},y=j=>{n(r.filter(N=>N.id!==j)),(a==null?void 0:a.id)===j&&i(null)},b=j=>{i(j),g(j.id)},w=j=>{l(j),i(null)};return s.jsx("div",{className:"space-y-6",children:s.jsxs(De,{children:[s.jsxs(ot,{children:[s.jsx(ut,{className:"text-2xl",children:"Inbox"}),s.jsx(us,{children:"View notifications, newsletters, and direct messages"})]}),s.jsx(Be,{children:s.jsxs(sn,{defaultValue:"all",value:t,onValueChange:e,className:"w-full",children:[s.jsx(_ve,{activeTab:t,unreadCount:d}),s.jsxs("div",{className:"mt-6 grid grid-cols-1 md:grid-cols-3 gap-6",children:[s.jsx("div",{className:"md:col-span-1",children:s.jsx(Tve,{messages:u,currentMessages:m,selectedMessage:a,currentPage:o,messagesPerPage:c,onViewMessage:b,onPageChange:w})}),s.jsx("div",{className:"md:col-span-2",children:s.jsx(Bve,{message:a,onDelete:y})})]})]})})]})})},a_=t=>t.toLowerCase().replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").trim(),Pc=async t=>{try{let e=Q.from("blog_posts").select(` 913 id, 914 title, 915 slug, 916 content, 917 excerpt, 918 featured_image, 919 author_id, 920 status, 921 publish_date, 922 created_at, 923 updated_at, 924 admin_notes, 925 reviewed_by, 926 reviewed_at, 927 post_category_mapping( 928 category_id, 929 post_categories(name) 930 ) 931 `).order("created_at",{ascending:!1});t&&(e=e.eq("status",t));const{data:r,error:n}=await e;if(n)throw console.error("Error fetching blog posts:",n),n;const a=[...new Set((r||[]).map(c=>c.author_id))],{data:i}=await Q.from("profiles").select("id, first_name, last_name, avatar_url").in("id",a),o=new Map;
931return(i||[]).forEach(c=>{o.set(c.id,{name:`${c.first_name} ${c.last_name}`,avatar_url:c.avatar_url})}),(r||[]).map(c=>{var u,d,h;return{id:c.id,title:c.title,slug:c.slug,content:c.content,excerpt:c.excerpt,featured_image:c.featured_image,author_id:c.author_id,status:c.status,publish_date:c.publish_date,created_at:c.created_at,updated_at:c.updated_at,categories:((u=c.post_category_mapping)==null?void 0:u.map(f=>{var m;return(m=f.post_categories)==null?void 0:m.name}).filter(Boolean))||[],author_name:((d=o.get(c.author_id))==null?void 0:d.name)||"Unknown Author",author_avatar:((h=o.get(c.author_id))==null?void 0:h.avatar_url)||null}})}catch(e){throw console.error("Error in fetchAllBlogPosts:",e),e}},sb=async t=>{var e;try{const{data:r,error:n}=await Q.from("blog_posts").select(` 932 id, 933 title, 934 slug, 935 content, 936 excerpt, 937 featured_image, 938 author_id, 939 status, 940 publish_date, 941 created_at, 942 updated_at, 943 post_category_mapping( 944 category_id, 945 post_categories(name) 946 ) 947 `).eq("id",t).single();if(n)throw console.error("Error fetching blog post:",n),n;if(!r)return null;const{data:a}=await Q.from("profiles").select("first_name, last_name, avatar_url").eq("id",r.author_id).single();return{id:r.id,title:r.title,slug:r.slug,content:r.content,excerpt:r.excerpt,featured_image:r.featured_image,author_id:r.author_id,status:r.status,publish_date:r.publish_date,created_at:r.created_at,updated_at:r.updated_at,categories:((e=r.post_category_mapping)==null?void 0:e.map(o=>{var l;return(l=o.post_categories)==null?void 0:l.name}).filter(Boolean))||[],author_name:a?`${a.first_name} ${a.last_name}`:"Unknown Author",author_avatar:(a==null?void 0:a.avatar_url)||null}}catch(r){throw console.error("Error in fetchBlogPostById:",r),r}},X8=async t=>{try{const{data:{user:e}}=await Q.auth.getUser();if(!e)throw new Error("User not authenticated");const r=a_(t.title),n=t.status==="published"?new Date().toISOString():null,{data:a,error:i}=await Q.from("blog_posts").insert({title:t.title,slug:r,content:t.content,excerpt:t.excerpt||"",featured_image:t.featured_image||"",author_id:e.id,status:t.status,publish_date:n}).select().single();if(i)throw console.error("Error creating blog post:",i),i;if(t.category_ids&&t.category_ids.length>0){const l=t.category_ids.map(u=>({post_id:a.id,category_id:u})),{error:c}=await Q.from("post_category_mapping").insert(l);c&&console.error("Error creating category mappings:",c)}const o=await sb(a.id);if(!o)throw new Error("Failed to fetch created post");return o}catch(e){throw console.error("Error in createBlogPost:",e),e}},Ive=async t=>{try{const{data:{user:e}}=await Q.auth.getUser();if(!e)throw new Error("User not authenticated");const r={};t.title&&(r.title=t.title,r.slug=a_(t.title)),t.content!==void 0&&(r.content=t.content),t.excerpt!==void 0&&(r.excerpt=t.excerpt),t.featured_image!==void 0&&(r.featured_image=t.featured_image),t.status&&(r.status=t.status,t.status==="published"&&(r.publish_date=new Date().toISOString()));const{error:n}=await Q.from("blog_posts").update(r).eq("id",t.id).eq("author_id",e.id).select().single();if(n)throw console.error("Error updating blog post:",n),n;if(t.category_ids&&(await Q.from("post_category_mapping").delete().eq("post_id",t.id),t.category_ids.length>0)){const i=t.category_ids.map(l=>({post_id:t.id,category_id:l})),{error:o}=await Q.from("post_category_mapping").insert(i);o&&console.error("Error updating category mappings:",o)}const a=await sb(t.id);if(!a)throw new Error("Failed to fetch updated post");return a}catch(e){throw console.error("Error in updateBlogPost:",e),e}},Ove=async t=>{try{const{data:{user:e}}=await Q.auth.getUser();if(!e)throw new Error("User not authenticated");const r={};t.title&&(r.title=t.title,r.slug=a_(t.title)),t.content!==void 0&&(r.content=t.content),t.excerpt!==void 0&&(r.excerpt=t.excerpt),t.featured_image!==void 0&&(r.featured_image=t.featured_image),t.status&&(r.status=t.status,t.status==="published"&&(r.publish_date=new Date().toISOString()));const{data:n,error:a}=await Q.from("blog_posts").update(r).eq("id",t.id).select().single();if(a)throw console.error("Error updating blog post:",a),a;if(!n)throw new Error("No rows were updated. Post may not exist or you may
947not have permission to update it.");if(t.category_ids&&(await Q.from("post_category_mapping").delete().eq("post_id",t.id),t.category_ids.length>0)){const o=t.category_ids.map(c=>({post_id:t.id,category_id:c})),{error:l}=await Q.from("post_category_mapping").insert(o);l&&console.error("Error updating category mappings:",l)}const i=await sb(t.id);if(!i)throw new Error("Failed to fetch updated post");return i}catch(e){throw console.error("Error in updateBlogPostAdmin:",e),e}},zve=async t=>{try{const{data:{user:e}}=await Q.auth.getUser();if(!e)throw new Error("User not authenticated");const{error:r}=await Q.from("blog_posts").delete().eq("id",t).eq("author_id",e.id);if(r)throw console.error("Error deleting blog post:",r),r}catch(e){throw console.error("Error in deleteBlogPost:",e),e}},Uve=async t=>{try{const{data:{user:e}}=await Q.auth.getUser();if(!e)throw new Error("User not authenticated");const{error:r}=await Q.from("blog_posts").delete().eq("id",t);if(r)throw console.error("Error deleting blog post:",r),r}catch(e){throw console.error("Error in deleteBlogPostAdmin:",e),e}},sj=async()=>{try{const{data:t,error:e}=await Q.from("post_categories").select("*").order("name");if(e)throw console.error("Error fetching categories:",e),e;return t||[]}catch(t){throw console.error("Error in fetchCategories:",t),t}},nj=t=>({id:t.id,title:t.title,content:t.content,excerpt:t.excerpt,image:t.featured_image,author:t.author_name||"Unknown Author",authorTitle:"Chamber member",publishedAt:new Date(t.publish_date||t.created_at),categories:t.categories||[],featured:!1}),Oi=x.forwardRef(({className:t,...e},r)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:r,className:xt("w-full caption-bottom text-sm",t),...e})}));Oi.displayName="Table";const zi=x.forwardRef(({className:t,...e},r)=>s.jsx("thead",{ref:r,className:xt("[&_tr]:border-b",t),...e}));zi.displayName="TableHeader";const Ui=x.forwardRef(({className:t,...e},r)=>s.jsx("tbody",{ref:r,className:xt("[&_tr:last-child]:border-0",t),...e}));Ui.displayName="TableBody";const Hve=x.forwardRef(({className:t,...e},r)=>s.jsx("tfoot",{ref:r,className:xt("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...e}));Hve.displayName="TableFooter";const As=x.forwardRef(({className:t,...e},r)=>s.jsx("tr",{ref:r,className:xt("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...e}));As.displayName="TableRow";const At=x.forwardRef(({className:t,...e},r)=>s.jsx("th",{ref:r,className:xt("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...e}));At.displayName="TableHead";const Ct=x.forwardRef(({className:t,...e},r)=>s.jsx("td",{ref:r,className:xt("p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...e}));Ct.displayName="TableCell";const $ve=x.forwardRef(({className:t,...e},r)=>s.jsx("caption",{ref:r,className:xt("mt-4 text-sm text-muted-foreground",t),...e}));$ve.displayName="TableCaption";const aj=({value:t,onChange:e,disabled:r=!1,label:n="Featured Image",placeholder:a="https://example.com/image.jpg"})=>{const{toast:i}=St(),o=x.useRef(null),[l,c]=x.useState(!1),[u,d]=x.useState(!1),h=async w=>{try{if(c(!0),!w.type.startsWith("image/"))throw new Error("Please select an image file");if(w.size>5*1024*1024)throw new Error("Image size must be less than 5MB");const j=w.name.split(".").pop(),S=`posts/${`${Date.now()}-${Math.random().toString(36).substring(2)}.${j}`}`,{data:E,error:C}=await Q.storage.from("posts-images").upload(S,w);if(C)throw C;const{data:{publicUrl:T}}=Q.storage.from("posts-images").getPublicUrl(E.path);e(T),i({title:"Success",description:"Image uploaded successfully"})}catch(j){console.error("Error uploading image:",j),i({title:"Upload Error",description:j.message||"Failed to upload image",variant:"destructive"})}finally{c(!1)}},f=w=>{var N;const j=(N=w.target.files)==null?void 0:N[0];j&&h(j)},m=w=>{w.preventDefault(),d(!1);const j=w.dataTransfer.files[0];j&&h(j)},g=w=>{w.preventDefault(),d(!0)},y=w=>{w.preventDefault(),d(!1)},b=()=>{e("")};return s.jsxs("div",{className:"space-y-4",children:[s.jsx(Z,{children:n}),s.jsxs(sn,{defaultValue:"url",className:"w-full",children:[s.jsxs(Qs,{className:"grid w-full grid-cols-2",children:[s.jsxs(Gt,{value:"url",className:"flex items-center gap-2",children:[s.jsx(dp,{className:"h-4 w-4"}),"URL"]}),s.jsxs(Gt,{value:"upload",className:"flex items-center gap-2",children:[s.jsx(vn,{className:"h-4 w-4"}),"Upload"]})]}),s.jsx(Rt,{value:"url",className:"space-y-3",children:s.jsx(Ne,{value:t,onChange:w=>e(w.target.value),placeholder:a,disabled:r,type:"url"})}),s.jsxs(Rt,{value:"upload",className:"space-y-3",children:[s.jsx("div",{className:`border-2 border-dashed rounded-lg p-6 text-center transition-colors ${u?"border-primary bg-primary/5":"border-muted-foreground
947/25 hover:border-muted-foreground/50"} ${r?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,onDrop:m,onDragOver:g,onDragLeave:y,onClick:()=>{var w;return!r&&!l&&((w=o.current)==null?void 0:w.click())},children:l?s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[s.jsx(Mt,{className:"h-8 w-8 animate-spin text-primary"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Uploading image..."})]}):s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[s.jsx(vn,{className:"h-8 w-8 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Click to upload or drag and drop"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"PNG, JPG, GIF up to 5MB"})]})]})}),s.jsx("input",{ref:o,type:"file",accept:"image/*",onChange:f,className:"hidden",disabled:r||l}),s.jsxs(Y,{type:"button",variant:"outline",onClick:()=>{var w;return(w=o.current)==null?void 0:w.click()},disabled:r||l,className:"w-full",children:[s.jsx(vn,{className:"h-4 w-4 mr-2"}),"Choose File"]})]})]}),t&&s.jsx("div",{className:"relative",children:s.jsx("div",{className:"border rounded-lg p-2 bg-muted/20",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"relative w-16 h-16 bg-muted rounded overflow-hidden flex-shrink-0",children:[s.jsx("img",{src:t,alt:"Preview",className:"w-full h-full object-cover",onError:w=>{w.currentTarget.style.display="none",w.currentTarget.nextElementSibling.style.display="flex"}}),s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted hidden",children:s.jsx(vi,{className:"h-6 w-6 text-muted-foreground"})})]}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:"Image Preview"}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t})]}),s.jsx(Y,{type:"button",variant:"ghost",size:"sm",onClick:b,disabled:r,className:"flex-shrink-0",children:s.jsx(Ir,{className:"h-4 w-4"})})]})})})]})},Wve=({isOpen:t,onClose:e,onSuccess:r})=>{const{toast:n}=St(),[a,i]=x.useState(""),[o,l]=x.useState(""),[c,u]=x.useState(""),[d,h]=x.useState(""),[f,m]=x.useState("draft"),[g,y]=x.useState(""),[b,w]=x.useState(!1);x.useEffect(()=>{t&&j()},[t]);const j=async()=>{try{const C=(await sj()).find(T=>T.slug==="blog");C&&y(C.id)}catch(E){console.error("Error loading categories:",E),n({title:"Error",description:"Failed to load categories",variant:"destructive"})}},N=async E=>{if(E.preventDefault(),!a.trim()){n({title:"Error",description:"Please enter a title",variant:"destructive"});return}if(!o.trim()){n({title:"Error",description:"Please enter content",variant:"destructive"});return}if(!g){n({title:"Error",description:"Blog category not found",variant:"destructive"});return}w(!0);try{await X8({title:a.trim(),content:o.trim(),excerpt:c.trim()||o.trim().substring(0,200)+(o.length>200?"...":""),featured_image:d.trim(),status:f,category_ids:[g]}),n({title:"Success!",description:"Blog post created successfully"}),i(""),l(""),u(""),h(""),m("draft"),r(),e()}catch(C){console.error("Error creating post:",C),n({title:"Error",description:"Failed to create blog post. Please try again.",variant:"destructive"})}finally{w(!1)}},S=()=>{b||(i(""),l(""),u(""),h(""),m("draft"),e())};return s.jsx(Tt,{open:t,onOpenChange:S,children:s.jsx(Dt,{className:"sm:max-w-[700px] max-h-[90vh] overflow-y-auto",children:s.jsxs("form",{onSubmit:N,children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Create New Blog Post"}),s.jsx(rr,{children:"Share your insights and stories with the community through a new blog post."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"title",className:"text-right",children:"Title *"}),s.jsx(Ne,{id:"title",value:a,onChange:E=>i(E.target.value),className:"col-span-3",placeholder:"Enter blog post title",required:!0})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"excerpt",className:"text-right pt-2",children:"Excerpt"}),s.jsx(zt,{id:"excerpt",value:c,onChange:E=>u(E.target.value),className:"col-span-3",placeholder:"Brief description of your blog post (optional - will auto-generate if empty)",rows:3})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"content",className:"text-right pt-2",children:"Content *"}),s.jsx(zt,{id:"content",value:o,onChange:E=>l(E.target.value),className:"col-span-3",placeholder:"Write your blog post content here... (Supports Markdown)",rows:10,required:!0})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx("div",{className:"text-right pt-2",children:s.jsx(Z,{children:"Featured Image"})}),s.jsx("div",{className:"col-span-3",children:s.jsx(aj,{value:d,onChange:h,disabled:b,label:"",placeholder:"https://example.com/image.jpg (optional)"})})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"status",className:"text-right",children:"Status"}),s.jsxs(Wt,{value:f,onValueChange:E=>m(E),children:[s.jsx(Ht,{className:"w-full col-span-3",children:s.jsx(qt,{placeholder:"Select a status"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"draft",children:"Save as Draft"}),s.jsx(Ae,{value:"pending",children:"Submit for Approval"})]})]})]}),f==="pending"&&s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx("div",{className:"text-right pt-2"}),s.jsx("div",{className:"col-span-3",children:s.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-md p-3",children:s.jsxs("p",{className:"text-sm text-yellow-800",children:[s.jsx("strong",{children:"Note:"}
947)," Your blog post will be submitted for admin approval. Once approved, it will be published and visible to all users."]})})})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",type:"button",onClick:S,disabled:b,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:b,children:b?"Creating...":"Create Blog Post"})]})]})})})},qve=({isOpen:t,onClose:e,onSuccess:r,post:n})=>{const{toast:a}=St(),[i,o]=x.useState(""),[l,c]=x.useState(""),[u,d]=x.useState(""),[h,f]=x.useState(""),[m,g]=x.useState("draft"),[y,b]=x.useState(!1);x.useEffect(()=>{t&&n&&(o(n.title||""),c(n.content||""),d(n.excerpt||""),f(n.featured_image||""),g(n.status==="published"?"draft":n.status))},[t,n]);const w=async N=>{if(N.preventDefault(),!i.trim()){a({title:"Error",description:"Please enter a title",variant:"destructive"});return}if(!l.trim()){a({title:"Error",description:"Please enter content",variant:"destructive"});return}b(!0);try{await Ive({id:n.id,title:i.trim(),content:l.trim(),excerpt:u.trim()||l.trim().substring(0,200)+(l.length>200?"...":""),featured_image:h.trim(),status:m}),a({title:"Success!",description:"Blog post updated successfully"}),r(),e()}catch(S){console.error("Error updating post:",S),a({title:"Error",description:"Failed to update blog post. Please try again.",variant:"destructive"})}finally{b(!1)}},j=()=>{y||e()};return s.jsx(Tt,{open:t,onOpenChange:j,children:s.jsx(Dt,{className:"sm:max-w-[700px] max-h-[90vh] overflow-y-auto",children:s.jsxs("form",{onSubmit:w,children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Edit Blog Post"}),s.jsx(rr,{children:"Update your blog post content and settings."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"title",className:"text-right",children:"Title *"}),s.jsx(Ne,{id:"title",value:i,onChange:N=>o(N.target.value),className:"col-span-3",placeholder:"Enter blog post title",required:!0})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"excerpt",className:"text-right pt-2",children:"Excerpt"}),s.jsx(zt,{id:"excerpt",value:u,onChange:N=>d(N.target.value),className:"col-span-3",placeholder:"Brief description of your blog post (optional - will auto-generate if empty)",rows:3})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"content",className:"text-right pt-2",children:"Content *"}),s.jsx(zt,{id:"content",value:l,onChange:N=>c(N.target.value),className:"col-span-3",placeholder:"Write your blog post content here... (Supports Markdown)",rows:10,required:!0})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx("div",{className:"text-right pt-2",children:s.jsx(Z,{children:"Featured Image"})}),s.jsx("div",{className:"col-span-3",children:s.jsx(aj,{value:h,onChange:f,disabled:y,label:"",placeholder:"https://example.com/image.jpg (optional)"})})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"status",className:"text-right",children:"Status"}),s.jsxs(Wt,{value:m,onValueChange:N=>g(N),children:[s.jsx(Ht,{className:"w-full col-span-3",children:s.jsx(qt,{placeholder:"Select a status"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"draft",children:"Save as Draft"}),s.jsx(Ae,{value:"pending",children:"Submit for Approval"})]})]})]}),m==="pending"&&s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx("div",{className:"text-right pt-2"}),s.jsx("div",{className:"col-span-3",children:s.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-md p-3",children:s.jsxs("p",{className:"text-sm text-yellow-800",children:[s.jsx("strong",{children:"Note:"})," Your blog post will be submitted for admin approval. Once approved, it will be published and visible to all users."]})})})]}),(n==null?void 0:n.status)==="published"&&s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx("div",{className:"text-right pt-2"}),s.jsx("div",{className:"col-span-3",children:s.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-md p-3",children:s.jsxs("p",{className:"text-sm text-blue-800",children:[s.jsx("strong",{children:"Info:"})," This post is currently published. Editing will change it to draft status and require admin a
947pproval again to republish."]})})})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",type:"button",onClick:j,disabled:y,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:y,children:y?"Updating...":"Update Blog Post"})]})]})})})},Gve=()=>{const{toast:t}=St(),{user:e}=ts(),[r,n]=x.useState([]),[a,i]=x.useState(!0),[o,l]=x.useState(!1),[c,u]=x.useState(null),[d,h]=x.useState(!1),[f,m]=x.useState(!1),[g,y]=x.useState(null);x.useEffect(()=>{b()},[]);const b=async()=>{try{i(!0);const T=(await Pc()).filter(D=>D.author_id===(e==null?void 0:e.id));n(T)}catch(C){console.error("Error loading posts:",C),t({title:"Error",description:"Failed to load blog posts",variant:"destructive"})}finally{i(!1)}},w=async()=>{if(c)try{await zve(c),t({title:"Success",description:"Blog post deleted successfully"}),b()}catch(C){console.error("Error deleting post:",C),t({title:"Error",description:"Failed to delete blog post",variant:"destructive"})}finally{l(!1),u(null)}},j=C=>{u(C),l(!0)},N=C=>{y(C),m(!0)},S=()=>{b(),h(!1)},E=()=>{b(),m(!1),y(null)};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-bold",children:"My Posts"}),s.jsx("p",{className:"text-muted-foreground",children:"Create and manage your articles and content"})]}),s.jsxs(Y,{className:"flex items-center gap-2",onClick:()=>h(!0),children:[s.jsx(vs,{className:"h-4 w-4"}),"Create New Blog Post"]})]}),r.filter(C=>C.status==="pending").length>0&&s.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"flex-shrink-0",children:s.jsx("div",{className:"w-2 h-2 bg-yellow-400 rounded-full mt-2"})}),s.jsxs("div",{children:[s.jsxs("h3",{className:"font-medium text-yellow-800",children:[r.filter(C=>C.status==="pending").length," Post(s) Pending Approval"]}),s.jsx("p",{className:"text-sm text-yellow-700 mt-1",children:"Your posts are waiting for admin approval. Once approved, they will be published and visible to all users."})]})]})}),s.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:"flex-shrink-0",children:s.jsx("div",{className:"w-2 h-2 bg-blue-400 rounded-full mt-2"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-medium text-blue-800",children:"About Post Categories"}),s.jsx("p",{className:"text-sm text-blue-700 mt-1",children:'Your posts may appear in different sections of the website based on their category. Admins can change categories to feature your content in "Latest News" or other sections. You can always edit your posts here regardless of their current category.'})]})]})}),s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs(ut,{children:["My Posts (",r.length,")"]})}),s.jsx(Be,{children:a?s.jsxs("div",{className:"flex justify-center items-center py-8",children:[s.jsx(Mt,{className:"h-8 w-8 animate-spin"}),s.jsx("span",{className:"ml-2",children:"Loading posts..."})]}):r.length===0?s.jsxs("div",{className:"text-center py-8",children:[s.jsx("p",{className:"text-muted-foreground mb-4",children:"You haven't created any posts yet."}),s.jsxs(Y,{onClick:()=>h(!0),children:[s.jsx(vs,{className:"h-4 w-4 mr-2"}),"Create Your First Post"]})]}):s.jsxs(Oi,{children:[s.jsx(zi,{children:s.jsxs(As,{children:[s.jsx(At,{children:"Title"}),s.jsx(At,{children:"Category"}),s.jsx(At,{children:"Status"}),s.jsx(At,{children:"Created"}),s.jsx(At,{children:"Updated"}),s.jsx(At,{className:"text-right",children:"Actions"})]})}),s.jsx(Ui,{children:r.map(C=>s.jsxs(As,{children:[s.jsx(Ct,{className:"font-medium",children:C.title}),s.jsx(Ct,{children:s.jsx("div",{className:"flex flex-wrap gap-1",children:C.categories&&C.categories.length>0?C.categories.map((T,D)=>s.jsx(ke,{variant:"outline",className:"text-xs",children:T},D)):s.jsx(ke,{variant:"outline",className:"text-xs",children:"Uncategorized"})})}),s.jsx(Ct,{children:s.jsx(ke,{variant:C.status==="published"?"default":C.status==="pending"?"secondary":"outline",children:C.status==="published"?"Published":C.status==="pending"?"Pending Approval":"Draft"})}),s.jsx(Ct,{children:Cs(new Date(C.created_at),"MMM d, yyyy")}),s.jsx(Ct,{children:Cs(new Date(C.updated_at),"MMM d, yyyy")}),s.jsx(Ct,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-2",children:[C.status==="published"&&s.jsx(Y,{variant:"outline",size:"sm",onClick:()=>window.open(`/news/blog/${C.id}`,"_blank"),title:"View published post",children:s.jsx(Xs,{className:"h-4 w-4"})}),C.status==="pending"&&s.jsx(Y,{variant:"outline",size:"sm",disabled:!0,title:"Post is pending admin a
947pproval",children:s.jsx(Xs,{className:"h-4 w-4"})}),s.jsx(Y,{variant:"outline",size:"sm",onClick:()=>N(C),title:"Edit post",children:s.jsx(zs,{className:"h-4 w-4"})}),s.jsx(Y,{variant:"outline",size:"sm",onClick:()=>j(C.id),title:"Delete post",children:s.jsx(vr,{className:"h-4 w-4"})})]})})]},C.id))})]})})]}),s.jsx(Wve,{isOpen:d,onClose:()=>h(!1),onSuccess:S}),g&&s.jsx(qve,{isOpen:f,onClose:()=>{m(!1),y(null)},onSuccess:E,post:g}),s.jsx(ai,{open:o,onOpenChange:l,children:s.jsxs(Oa,{children:[s.jsxs(za,{children:[s.jsx(Ha,{children:"Are you sure?"}),s.jsx($a,{children:"This action cannot be undone. This will permanently delete the blog post."})]}),s.jsxs(Ua,{children:[s.jsx(qa,{children:"Cancel"}),s.jsx(Wa,{onClick:w,children:"Delete"})]})]})})]})},Vve=()=>{const[t,e]=x.useState([]),[r,n]=x.useState(!0),[a,i]=x.useState(null),[o,l]=x.useState(!1),[c,u]=x.useState(!1),[d,h]=x.useState(!1),[f,m]=x.useState({title:"",description:"",location:"",eventDate:"",startTime:"",endTime:"",imageUrl:"",contactName:"",contactEmail:"",contactPhone:"",organizationName:"",eventWebsite:"",additionalInfo:"",ticketPrice:"",eventType:""}),g=async()=>{try{n(!0);const T=await ure();e(T)}catch(T){console.error("Error fetching user events:",T),ct.error("Failed to load your events")}finally{n(!1)}};x.useEffect(()=>{g()},[]);const y=T=>{switch(T){case"pending":return s.jsx(ke,{variant:"outline",className:"text-yellow-600 border-yellow-600",children:"Pending Review"});case"approved":return s.jsx(ke,{variant:"outline",className:"text-green-600 border-green-600",children:"Approved"});case"rejected":return s.jsx(ke,{variant:"outline",className:"text-red-600 border-red-600",children:"Rejected"});default:return s.jsx(ke,{variant:"outline",children:"Unknown"})}},b=T=>T.approval_status==="pending"||T.approval_status==="rejected",w=T=>T.approval_status==="pending"||T.approval_status==="rejected",j=T=>{i(T);const A=new Date().toISOString().split("T")[0];m({title:T.title,description:T.description,location:T.location,eventDate:A,startTime:"09:00",endTime:"17:00",imageUrl:T.imageUrl||"",contactName:T.contact_name||"",contactEmail:T.contact_email||"",contactPhone:T.contact_phone||"",organizationName:T.organization_name||"",eventWebsite:T.event_website||"",additionalInfo:T.additional_info||"",ticketPrice:T.ticket_price?T.ticket_price.toString():"",eventType:T.event_type||""}),l(!0)},N=T=>{i(T),u(!0)},S=async T=>{if(!w(T)){ct.error("Cannot delete approved events. Please contact support.");return}if(confirm(`Are you sure you want to delete "${T.title}"?`))try{h(!0),await hre(T.id),ct.success("Event deleted successfully"),g()}catch(D){console.error("Error deleting event:",D),ct.error("Failed to delete event")}finally{h(!1)}},E=(T,D)=>{m(A=>({...A,[T]:D}))},C=async T=>{if(T.preventDefault(),!!a)try{const D=new Date(`${f.eventDate}T${f.startTime}`),A=new Date(`${f.eventDate}T${f.endTime}`),R={id:a.id,title:f.title,description:f.description,location:f.location,start_date:D.toISOString(),end_date:A.toISOString(),image_url:f.imageUrl||void 0,contact_name:f.contactName,contact_email:f.contactEmail,contact_phone:f.contactPhone||void 0,organization_name:f.organizationName||void 0,event_website:f.eventWebsite||void 0,additional_info:f.additionalInfo||void 0,ticket_price:f.ticketPrice?parseFloat(f.ticketPrice):void 0,event_type:f.eventType||void 0};await dre(R),ct.success("Event updated successfully"),l(!1),i(null),g()}catch(D){console.error("Error updating event:",D);const A=D instanceof Error?D.message:"Failed to update event";ct.error(A)}};return r?s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"flex justify-between items-center",children:s.jsx("h2",{className:"text-2xl font-bold",children:"My Events"})}),s.jsxs("div",{className:"text-center py-8",children:[s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600 mx-auto"}),s.jsx("p",{className:"mt-2 text-gray-600",children:"Loading your events..."})]})]}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-2xl font-bold",children:"My Events"}),s.jsx("p",{className:"text-gray-600",children:"Manage your submitted events"})]}),s.jsxs(Y,{onClick:()=>window.location.href="/events/submit",className:"flex items-center gap-2",children:[s.jsx(vs,{className:"h-4 w-4"}),"Submit New Event"]})]}),t.length===0?s.jsx(De,{children:s.jsxs(Be,{className:"text-center py-12",children:[s.jsx(Br,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"No Events Yet"}),s.jsx("p",{className:"text-gray-600 mb-6",children:"You haven't submitted any events yet."}),s.jsx(Y,{onClick:()=>window.location.href="/events/submit",children:"Submit Your First Event"})]})}):s.jsx("div",{className:"grid gap-6",children:t.map(T=>s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(ut,{className:"text-xl",children:T.title}),s.jsxs("div",{className:"flex items-center gap-4 text-sm text-gray-600",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Br,{className:"h-4 w-4"}),s.jsx("span",{children:T.date})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(rn,{className:"h-4 w-4"}),s.jsx("span",{children:T.time})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(_n,{className:"h-4 w-4"}),s.jsx("span",{children:T.location})]}),T.event_type&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(ji,{className:"h-4 w-4"}),s.jsx("span",{className:"capitalize",children:T.event_type})]}),T.ticket_price!==void 0&&T.ticket_price!==null&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(yu,{className:"h-4 w-4"}),s.jsx("span",{children:T.ticket_price===0?"Free":`$${T.ticket_price.toFixed(2)}`})]})]})]}),s.jsx("div",{className:"flex items-center gap-2",children:y(T.approval_status)})]})}),s.jsxs(Be,{children:[s.jsx("p",{className:"text-gray-700 mb-4 line-clamp-2",children:T.description}),T.approval_status==="rejected"&&T.admin_notes&&s.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4 mb-4",children:[s.jsx("h4",{className:"font-semibold text-red-800 mb
947-2",children:"Rejection Reason:"}),s.jsx("p",{className:"text-red-700",children:T.admin_notes})]}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>N(T),children:[s.jsx(Xs,{className:"h-4 w-4 mr-1"}),"View"]}),b(T)&&s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>j(T),children:[s.jsx(zs,{className:"h-4 w-4 mr-1"}),"Edit"]}),w(T)&&s.jsxs(Y,{variant:"destructive",size:"sm",onClick:()=>S(T),disabled:d,children:[s.jsx(vr,{className:"h-4 w-4 mr-1"}),"Delete"]})]})]})]},T.id))}),s.jsx(Tt,{open:c,onOpenChange:u,children:s.jsxs(Dt,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[s.jsx(It,{children:s.jsx(Ot,{children:"Event Details"})}),a&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-xl font-semibold mb-2",children:a.title}),s.jsx("div",{className:"flex items-center gap-2 mb-4",children:y(a.approval_status)})]}),s.jsxs("div",{className:"grid gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Br,{className:"h-5 w-5 text-gray-500"}),s.jsx("span",{children:a.date})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(rn,{className:"h-5 w-5 text-gray-500"}),s.jsx("span",{children:a.time})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(_n,{className:"h-5 w-5 text-gray-500"}),s.jsx("span",{children:a.location})]}),a.event_type&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ji,{className:"h-5 w-5 text-gray-500"}),s.jsx("span",{className:"capitalize",children:a.event_type})]}),a.ticket_price!==void 0&&a.ticket_price!==null&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(yu,{className:"h-5 w-5 text-gray-500"}),s.jsx("span",{children:a.ticket_price===0?"Free":`$${a.ticket_price.toFixed(2)}`})]})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold mb-2",children:"Description"}),s.jsx("p",{className:"text-gray-700 whitespace-pre-wrap",children:a.description})]}),a.contact_name&&s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold mb-2",children:"Contact Information"}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ma,{className:"h-4 w-4 text-gray-500"}),s.jsx("span",{children:a.contact_name})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(fs,{className:"h-4 w-4 text-gray-500"}),s.jsx("span",{children:a.contact_email})]}),a.contact_phone&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(wi,{className:"h-4 w-4 text-gray-500"}),s.jsx("span",{children:a.contact_phone})]})]})]}),a.organization_name&&s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold mb-2",children:"Organization"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ka,{className:"h-4 w-4 text-gray-500"}),s.jsx("span",{children:a.organization_name})]})]}),a.event_website&&s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold mb-2",children:"Website"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Bc,{className:"h-4 w-4 text-gray-500"}),s.jsx("a",{href:a.event_website,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline",children:a.event_website})]})]}),a.additional_info&&s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold mb-2",children:"Additional Information"}),s.jsx("p",{className:"text-gray-700 whitespace-pre-wrap",children:a.additional_info})]}),a.approval_status==="rejected"&&a.admin_notes&&s.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:[s.jsx("h4",{className:"font-semibold text-red-800 mb-2",children:"Rejection Reason:"}),s.jsx("p",{className:"text-red-700",children:a.admin_notes})]})]})]})}),s.jsx(Tt,{open:o,onOpenChange:l,children:s.jsxs(Dt,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Edit Event"}),s.jsx(rr,{children:"Update your event details. After editing, your event will be reviewed again."})]}),s.jsxs("form",{onSubmit:C,className:"space-y-6",children:[s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"edit-title",children:"Event Name *"}),s.jsx(Ne,{id:"edit-title",value:f.title,onChange:T=>E("title",T.target.value),required:!0})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"edit-organization",children:"Organization/Host"}),s.jsx(Ne,{id:"edit-organization",value:f.organizationName,onChange:T=>E("organizationName",T.target.value)})]})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"edit-event-type",children:"Event Type"}),s.jsxs(Wt,{value:f.eventType,onValueChange:T=>E("eventType",T),children:[s.jsx(Ht,{children:s.jsx(qt,{placeholder:"Select event type"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"conference",children:"Conference"}),s.jsx(Ae,{value:"workshop",children:"Workshop"}),s.jsx(Ae,{value:"seminar",children:"Seminar"}),s.jsx(Ae,{value:"networking",children:"Networking"}),s.jsx(Ae,{value:"fundraiser",children:"Fundraiser"}),s.jsx(Ae,{value:"social",children:"Social Event"}),s.jsx(Ae,{value:"educational",children:"Educational"}),s.jsx(Ae,{value:"community",children:"Community Event"}),s.jsx(Ae,{value:"business",children:"Business Event"}),s.jsx(Ae,{value:"other",children:"Other"})]})]})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"edit-ticket-price",children:"Ticket Price"}),s.jsx(Ne,{id:"edit-ticket-price",type:"number",min:"0",step:"0.01",value:f.ticketPrice,onChange:T=>E("ticketPrice",T.target.value),placeholder:"0.00 (leave blank if free)"})]})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"edit-description",children:"Event Description *"}),s.jsx(zt,{id:"edit-description",value:f.description,onChange:T=>E("description",T.target.value),rows:4,required:!0})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"edit-date",children:"Event Date *"}),s.jsx(Ne,{id:"edit-date",type:"date",value:f.eventDate,onChange:T=>E("eventDate",T.target.value),required:!0})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"edit-start-time",children:"Start Time *"}),s.jsx(Ne,{id:"edit-start-time",type:"time",value:f.startTime,onChange:T=>E("startTime",T.target.value),required:!0})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"edit-end-time",children:"End Time *"}),s.jsx(Ne,{id:"edit-end-time",type:"time",value:f.endTime,onChange:T=>E("endTime",T.target.value),required:!0})]})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"edit-location",children:"Location *"}),s.jsx(Ne,{id:"edit-location",value:f.location,onChange:T=>E("location",T.target.value),required:!0})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"edit-image",children:"Event Image URL"}),s.jsx(Ne,{id:"edit-image",type:"url",value:f.imageUrl,onChange:T=>E("imageUrl",T.target.value)})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"edit-website",children:"Event Website"}),s.jsx(Ne,{id:"edit-website",type:"url",value:f.eventWebsite,onChange:T=>E("eventWebsite",T.target.value)})]}),s.jsxs("div",{className:"border-t pt-6",children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Contact Information"}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"edit-contact-name",children:"Contact Name *"}),s.jsx(Ne,{id:"edit-contact-name",value:f.contactName,onChange:T=>E("contactName",T.target.value),required:!0})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"edit-contact-phone",children:"Contact Phone"}),s.jsx(Ne,{id:"edit-contact-phone",value:f.contactPhone,onChange:T=>E("contactPhone",T.target.value)})]})]}),s.jsxs("div",{className:"mt-4",children:[s.jsx(Z,{htmlFor:"edit-contact-email",children:"Contact Email *"}),s.jsx(Ne,{id:"edit-contact-email",type:"email",value:f.contactEmail,onChange:T=>E("contactEmail",T.target.value),required:!0})]})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"edit-additional",children:"Additional Information"}),s.jsx(zt,{id:"edit-additional",value:f.additionalInfo,onChange:T=>E("additionalInfo",T.target.value),rows:3})]}),s.jsxs("div",{className:"flex justify-end gap-4",children:[s.jsx(Y,{type:"button",variant:"outline",onClick:()=>l(!1),children:"Cancel"}),s.jsx(Y,{type:"submit",children:"Update Event"})]})]})]})})]})},Kve=()=>{var P,U,I,O,V,G;const[t,e]=x.useState([]),[r,n]=x.useState(""),[a,i]=x.useState(!0),[o,l]=x.useState(!1),[c,u]=x.useState(null),[d,h]=x.useState(null),[f,m]=x.useState(!1),[g,y]=x.useState(null),[b,w]=x.useState(null),{toast:j}=St();x.useEffect(()=>{S(),E(),N()},[]);const N=async()=>{try{const B=await Ro.getFeaturedBusinessPricing();w(B)}catch(B){console.error("Error loading pricing info:",B),w(Ro.calculateProratedPricing(200))}},S=async()=>{try{i(!0);const B=await Bi.getUserBusinesses();e(B),B.length===0&&h("You need to have at least one approved business to purchase a feature tag subscription.")}catch(B){console.error("Error loading businesses:",B),h("Failed to load your businesses. Please try again.")}finally{i(!1)}},E=()=>{const B=new URLSearchParams(window.location.search),$=B.get("success"),W=B.get("business_id"),oe=B.get("canceled");$==="true"&&W?(j({title:"Subscription Successful!",description:"Your business feature tag subscription has been activated successfully.",variant:"default"}),S(),window.history.replaceState({},document.title,window.location.pathname)):oe==="true"&&(j({title:"Subscription Canceled",description:"Your subscription was canceled. You can try again anytime.",variant:"destructive"}),window.history.replaceState({},document.title,window.location.pathname))},C=async()=>
947{if(!r){j({title:"No Business Selected",description:"Please select a business to feature.",variant:"destructive"});return}const B=t.find($=>$.id===r);if(B!=null&&B.subscriptionActive){j({title:"Already Subscribed",description:"This business already has an active feature tag subscription.",variant:"destructive"});return}try{l(!0),await Bi.subscribeToFeatureTag(r)}catch($){console.error("Error subscribing to feature tag:",$),j({title:"Subscription Failed",description:$.message||"Failed to start checkout process. Please try again.",variant:"destructive"})}finally{l(!1)}},T=B=>{y(B),m(!0)},D=async()=>{if(g)try{u(g.id),m(!1),await Bi.cancelFeatureSubscription(g.id),j({title:"Subscription Canceled",description:"Your subscription will be canceled at the end of the current billing period.",variant:"default"}),await S()}catch(B){console.error("Error canceling subscription:",B),j({title:"Cancellation Failed",description:B.message||"Failed to cancel subscription. Please try again.",variant:"destructive"})}finally{u(null),y(null)}},A=()=>{m(!1),y(null)},R=B=>B.subscriptionActive&&B.feature_cancel_at_period_end?s.jsxs(ke,{variant:"outline",className:"border-orange-500 text-orange-600",children:[s.jsx(Br,{className:"w-3 h-3 mr-1"}),"Canceling at Period End"]}):B.subscriptionActive&&!B.feature_cancel_at_period_end?s.jsxs(ke,{variant:"default",className:"bg-green-500 hover:bg-green-600",children:[s.jsx(ri,{className:"w-3 h-3 mr-1"}),"Active Subscription"]}):B.featured&&B.subscriptionExpired?s.jsxs(ke,{variant:"destructive",children:[s.jsx(Ts,{className:"w-3 h-3 mr-1"}),"Subscription Expired"]}):B.feature_subscription_status==="canceled"&&!B.subscriptionActive?s.jsxs(ke,{variant:"outline",className:"border-gray-500 text-gray-600",children:[s.jsx(Ir,{className:"w-3 h-3 mr-1"}),"Subscription Canceled"]}):s.jsxs(ke,{variant:"outline",children:[s.jsx(up,{className:"w-3 h-3 mr-1"}),"Not Featured"]}),M=B=>B?new Date(B).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):"N/A";return a?s.jsx(De,{children:s.jsxs(Be,{className:"flex items-center justify-center py-8",children:[s.jsx(Mt,{className:"h-6 w-6 animate-spin mr-2"}),"Loading your businesses..."]})}):d?s.jsx(De,{children:s.jsx(Be,{className:"py-6",children:s.jsxs(da,{children:[s.jsx(Ts,{className:"h-4 w-4"}),s.jsx(ha,{children:d})]})})}):s.jsxs(De,{children:[s.jsxs(ot,{children:[s.jsxs(ut,{className:"flex items-center gap-2",children:[s.jsx(ri,{className:"h-5 w-5 text-yellow-500"}),"Feature Tag Subscription"]}),s.jsx(us,{children:"Subscribe to feature your business with a yearly subscription. Featured businesses appear at the top of search results and get a special highlight."})]}),s.jsxs(Be,{className:"space-y-6",children:[t.length>0?s.jsxs(s.Fragment,{children:[t.some(B=>B.subscriptionActive||B.feature_subscription_status==="canceled"&&!B.subscriptionActive)&&s.jsxs("div",{className:"space-y-4",children:[s.jsx("h4",{className:"font-medium text-sm text-gray-700",children:"Your Subscriptions"}),t.filter(B=>B.subscriptionActive||B.feature_subscription_status==="canceled"&&!B.subscriptionActive).map(B=>{const $=B.feature_cancel_at_period_end||B.feature_subscription_status==="canceled"&&!B.subscriptionActive,W=B.subscriptionActive&&!B.feature_cancel_at_period_end,oe=$?"bg-orange-50 border-orange-200":W?"bg-green-50 border-green-200":"bg-gray-50 border-gray-200";return s.jsx("div",{className:`p-4 border rounded-lg ${oe}`,children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h5",{className:"font-medium",children:B.business_name}),s.jsx("p",{className:"text-sm text-gray-600",children:B.feature_cancel_at_period_end?`Subscription ends: ${M(B.feature_expires_at)}`:B.feature_subscription_status==="canceled"&&!B.subscriptionActive?`Subscription ended: ${M(B.feature_canceled_at||B.feature_expires_at)}`:`Next billing: ${M(B.feature_expires_at)}`}),B.feature_cancel_at_period_end&&s.jsx("p",{className:"text-xs text-orange-600 mt-1",children:"Your subscription will not renew and will end on the date above."}),B.feature_subscription_status==="canceled"&&!B.subscriptionActive&&s.jsx("p",{className:"text-xs text-gray-600 mt-1",children:"This subscription has been canceled and is no longer active."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[R(B),B.subscriptionActive&&!B.feature_cancel_at_period_end&&s.jsx(Y,{variant:"outline",size:"sm",onClick:()=>T(B),disabled:c===B.id,children:c===B.id?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"h-3 w-3 animate-spin mr-1"}),"Canceling..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Ir,{className:"h-3 w-3 mr-1"}),"Cancel"]})})]})]})},B.id)})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h4",{className:"font-medium text-sm text-gray-700",children:"Start New Subscription"}),s.jsxs("div",{children:[s.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Select Business to Feature"}),s.jsxs(Wt,{value:r,onValueChange:n,children:[s.jsx(Ht,{children:s.jsx(qt,{placeholder:"Choose a business to feature"})}),s.jsx($t,{children:t.filter(B=>!B.subscriptionActive&&!B.feature_cancel_at_period_end).map(B=>s.jsx(Ae,{value:B.id,children:s.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsx("span",{children:B.business_name}),B.subscriptionExpired&&s.jsx(Ts,{className:"h-4 w-4 text-orange-500 ml-2"})]})},B.id))})]})]}),r&&s.jsx("div",{className:"p-4 bg-gray-50 rounded-lg",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium",children:(P=t.find(B=>B.id===r))==null?void 0:P.business_name}),s.jsx("p",{className:"text-sm text-gray-600",children:"Selected business"})]}),R(t.find(B=>B.id===r))]})})]}),s.jsxs("div",{className:"border-t pt-4",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium",children:"Feature Tag Subscription"}),s.jsx("p",{className:"text-sm text-gray-600",children:b!=null&&b.isFullYear?"Annual advertising subscription":`Prorated for ${(b==null?void 0:b.daysRemaining)||0} days remaining`})]}),s.jsxs("div",{className:"text-right",children:[s.jsxs("div",{className:"text-2xl font-bold",children:["$",b!=null&&b.isFullYear?b.fullYearPrice||200:(b==null?void 0:b.proratedPrice)||200]}),s.jsx("div",{className:"text-sm text-gray-600",children:b!=null&&b.isFullYear?"per year":`until Dec 31, ${new Date().getFullYear()}`}),b&&!b.isFullYear&&s.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:["Renews at $",b.fullYearPrice,"/year on Jan 1st"]})]})]}),b&&!b.isFullYear&&s.jsxs("div",{className:"p-3 bg-blue-50 rounded-lg mb-4",children:[s.jsx("h4",{className:"font-medium text-blue-800 text-sm",children:"Prorated Pricing"}),s.jsx("p",{className:"text-xs text-blue-700 mt-1",children:"Our advertising pricing is prorated based on the calendar year. You'll only pay for the remaining days of the current year."}),s.jsxs("div",{className:"text-xs text-blue-600 mt-2",children:["Full year: $",b.fullYearPrice," ⢠Prorated: $",b.proratedPrice," ⢠Save: $",Math.round((b.fullYearPrice-b.proratedPrice)*100)/100]})]}),s.jsx(Y,{onClick:C,disabled:!r||o||((U=t.find(B=>B.id===r))==null?void 0:U.subscriptionActive)||((I=t.find(B=>B.id===r))==null?void 0:I.feature_cancel_at_period_end),className:"w-full bg-chamber-blue hover:bg-chamber-blue-dark",size:"lg",children:o?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"h-4 w-4 animate-spin mr-2"}),"Processing..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Ii,{className:"h-4 w-4 mr-2"}),"Subscribe for $",b!=null&&b.isFullYear?b.fullYearPrice||200:(b==null?void 0:b.proratedPrice)||200]})}),r&&(((O=t.find(B=>B.id===r))==null?void 0:O.subscriptionActive)||((V=t.find(B=>B.id===r))==null?void 0:V.feature_cancel_at_period_end))&&s.jsxs(da,{className:"mt-4",children:[s.jsx(Or,{className:"h-4 w-4"}),s.jsx(ha,{children:(G=t.find(B=>B.id===r))!=null&&G.feature_cancel_at_period_end?"This business has a subscription that is set to cancel at the end of the current period.":"This business already has an active feature tag subscription."})]})]})]}):s.jsxs(da,{children:[s.jsx(Ts,{className:"h-4 w-4"}),s.jsx(ha,{children:"You need to have at least one approved business to purchase a feature tag subscription. Please add and get approval for a business first."})]}),s.jsxs("div",{className:"text-xs text-gray-500 space-y-1",children:[s.jsx("p",{children:"⢠Featured businesses appear at the top of search results"}),s.jsx("p",{children:'⢠Get a special "Featured" badge on your business listing'}),s.jsx("p",{children:"⢠Increased visibility to potential customers"}),s.jsx("p",{children:"⢠Yearly subscription with automatic renew
947al"}),s.jsx("p",{children:"⢠Cancel anytime (subscription remains active until period end)"})]})]}),s.jsx(Tt,{open:f,onOpenChange:A,children:s.jsxs(Dt,{children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Cancel Advertisement Subscription"}),s.jsxs(rr,{className:"space-y-2",children:[s.jsxs("p",{children:["Are you sure you want to cancel the advertisement subscription for"," ",s.jsx("strong",{children:g==null?void 0:g.business_name}),"?"]}),s.jsxs("p",{className:"text-sm text-gray-600",children:["Your subscription will remain active until"," ",(g==null?void 0:g.feature_expires_at)&&M(g.feature_expires_at),", and you won't be charged for future billing periods."]}),s.jsx("p",{className:"text-sm text-amber-600",children:"â ï¸ This action cannot be undone. You'll need to create a new subscription to resume advertising."})]})]}),s.jsxs(Sr,{className:"gap-2",children:[s.jsx(Y,{variant:"outline",onClick:A,disabled:c===(g==null?void 0:g.id),children:"Keep Subscription"}),s.jsx(Y,{variant:"destructive",onClick:D,disabled:c===(g==null?void 0:g.id),children:c===(g==null?void 0:g.id)?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"h-4 w-4 animate-spin mr-2"}),"Canceling..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Ir,{className:"h-4 w-4 mr-2"}),"Cancel Subscription"]})})]})]})})]})},Q8=({reloadMembershipStatus:t})=>{const[e,r]=x.useState(null),[n,a]=x.useState(!0),[i,o]=x.useState(!1),[l,c]=x.useState(!1),[u,d]=x.useState(!1),[h,f]=x.useState("subscription"),[m,g]=x.useState(null),[y,b]=x.useState(null),{toast:w}=St();x.useEffect(()=>{N(),S(),j()},[]);const j=async()=>{try{const A=await Ro.getMembershipPricing();b(A)}catch(A){console.error("Error loading pricing info:",A),b(Ro.calculateProratedPricing(65))}},N=async()=>{try{a(!0);const A=await Bi.getUserSubscription();r(A)}catch(A){console.error("Error loading subscription:",A),g("Failed to load your subscription information. Please try again.")}finally{a(!1)}},S=async()=>{const A=new URLSearchParams(window.location.search),R=A.get("success"),M=A.get("
947canceled");R==="true"?(w({title:"Subscription Successful!",description:"Your membership subscription has been activated successfully.",variant:"default"}),await N(),t&&await t(),window.history.replaceState({},document.title,window.location.pathname)):M==="true"&&(w({title:"Subscription Canceled",description:"Your subscription was canceled. You can try again anytime.",variant:"destructive"}),window.history.replaceState({},document.title,window.location.pathname))},E=async()=>{if((e==null?void 0:e.status)==="active"){w({title:"Already Subscribed",description:"You already have an active membership subscription.",variant:"destructive"});return}try{o(!0),await Bi.subscribeMembership()}catch(A){console.error("Error subscribing to membership:",A),w({title:"Subscription Failed",description:A.message||"Failed to start checkout process. Please try again.",variant:"destructive"})}finally{o(!1)}},C=async()=>{if(!(e!=null&&e.id)){w({title:"Error",description:"No active subscription found to cancel.",variant:"destructive"});return}try{c(!0),await Bi.cancelSubscription(e.id),w({title:"Subscription Canceled",description:"Your membership subscription will be canceled at the end of the current billing period.",variant:"default"}),await N(),t&&await t()}catch(A){console.error("Error canceling subscription:",A),w({title:"Cancellation Failed",description:A.message||"Failed to cancel subscription. Please try again.",variant:"destructive"})}finally{c(!1),d(!1)}},T=A=>A?new Date(A).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):"N/A",D=(A,R)=>{if(A==="active"&&R)return s.jsxs(ke,{variant:"outline",className:"border-orange-500 text-orange-600",children:[s.jsx(Br,{className:"w-3 h-3 mr-1"}),"Canceling at Period End"]});switch(A){case"active":return s.jsxs(ke,{variant:"default",className:"bg-green-500 hover:bg-green-600",children:[s.jsx(Or,{className:"w-3 h-3 mr-1"}),"Active"]});case"canceled":return s.jsxs(ke,{variant:"outline",className:"border-red-500 text-red-600",children:[s.jsx(Ir,{className:"w-3 h-3 mr-1"}),"Canceled"]});case"past_due":return s.jsxs(ke,{variant:"destructive",children:[s.jsx(Ts,{className:"w-3 h-3 mr-1"}),"Payment Failed"]});default:return s.jsxs(ke,{variant:"outline",children:[s.jsx(Ir,{className:"w-3 h-3 mr-1"}),"Inactive"]})}};return n?s.jsx(De,{children:s.jsxs(Be,{className:"flex items-center justify-center py-8",children:[s.jsx(Mt,{className:"h-6 w-6 animate-spin mr-2"}),"Loading your subscription details..."]})}):s.jsxs(De,{children:[s.jsxs(ot,{children:[s.jsxs(ut,{className:"flex items-center gap-2",children:[s.jsx(ri,{className:"h-5 w-5 text-yellow-500"}),"Membership Subscription"]}),s.jsx(us,{children:"Subscribe to our membership plan for exclusive benefits including prorated pricing based on the calendar year."})]}),s.jsxs(Be,{className:"space-y-6",children:[s.jsxs(sn,{value:h,onValueChange:f,children:[s.jsxs(Qs,{className:"mb-4",children:[s.jsx(Gt,{value:"subscription",children:"Current Subscription"}),s.jsx(Gt,{value:"benefits",children:"Membership Benefits"})]}),s.jsxs(Rt,{value:"subscription",className:"space-y-6",children:[s.jsxs("div",{className:"p-4 bg-gray-50 border rounded-lg",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"font-medium text-lg",children:"Membership Status"}),s.jsx("p",{className:"text-sm text-gray-600",children:(e==null?void 0:e.status)==="active"?"Your membership is active":"You currently don't have an active membership"})]}),D(e==null?void 0:e.status,e==null?void 0:e.cancel_at_period_end)]}),(e==null?void 0:e.status)==="active"&&s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 mt-4 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"font-medium",children:"Current Period Ends:"}),s.jsx("div",{children:T(e.current_period_end)})]}),e.canceled_at&&s.jsxs("div",{children:[s.jsx("span",{className:"font-medium",children:"Canceled On:"}),s.jsx("div",{children:T(e.canceled_at)})]})]})]}),s.jsxs("div",{className:"border-t pt-4",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium",children:"Annual Membership"}),s.jsx("p",{className:"text-sm text-gray-600",children:(e==null?void 0:e.status)==="active"?"Your subscription renews on January 1st":y!=null&&y.isFullYear?"Full year membership (365 days)":`Prorated for ${(y==null?void 0:y.daysRemaining)||0} days remaining in ${new Date().getFullYear()}`})]}),s.jsxs("div",{className:"text-right",children:[s.jsxs("div",{className:"text-2xl font-bold",children:["$",(e==null?void 0:e.status)==="active"?((y==null?void 0:y.fullYearPrice)||65).toFixed(2):((y==null?void 0:y.proratedPrice)||65).toFixed(2)]}),s.jsx("div",{className:"text-sm text-gray-600",children:(e==null?void 0:e.status)==="active"||y!=null&&y.isFullYear?"per year":`until Dec 31, ${new Date().getFullYear()}`}),(e==null?void 0:e.status)!=="active"&&y&&!y.isFullYear&&s.jsxs("div",{className:"text-xs text-gray-500 mt-1",children:["Renews at $",y.fullYearPrice,"/year on Jan 1st"]})]})]}),(e==null?void 0:e.status)!=="active"?s.jsx(Y,{onClick:E,disabled:i,className:"w-full bg-chamber-blue hover:bg-chamber-blue-dark",size:"lg",children:i?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"h-4 w-4 animate-spin mr-2"}),"Processing..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Ii,{className:"h-4 w-4 mr-2"}),"Subscribe Now"]})}):e!=null&&e.cancel_at_period_end?s.jsxs("div",{className:"w-full p-4 bg-orange-50 border border-orange-200 rounded-lg text-center",children:[s.jsx("p",{className:"text-orange-800 font-medium",children:"Subscription Canceled"}),s.jsxs("p",{className:"text-orange-600 text-sm mt-1",children:["Your subscription will end on ",T(e.current_period_end)]})]}):s.jsx(Y,{onClick:()=>d(!0),variant:"outline",size:"lg",className:"w-full border-red-200 text-red-600 hover:bg-red-50 hover:border-red-300",disabled:l,children:l?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"h-4 w-4 animate-spin mr-2"}),"Canceling..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Ir,{className:"h-4 w-4 mr-2"}),"Cancel Subscription"]})}),m&&s.jsxs(da,{className:"mt-4",children:[s.jsx(Ts,{className:"h-4 w-4"}),s.jsx(ha,{children:m})]})]})]}),s.jsxs(Rt,{value:"benefits",className:"space-y-4",children:[s.jsx("h3",{className:"font-medium text-lg",children:"Membership Benefits"}),s.jsxs("ul",{className:"space-y-2",children:[s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx(Or,{className:"h-5 w-5 text-green-500 shrink-0 mt-0.5"}),s.jsx("span",{children:"Access to exclusive networking events"})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx(Or,{className:"h-5 w-5 text-green-500 shrink-0 mt-0.5"}),s.jsx("span",{children:"Member-only discounts at local businesses"})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx(Or,{className:"h-5 w-5 text-green-500 shrink-0 mt-0.5"}),s.jsx("span",{children:"Monthly newsletter with local business updates"})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx(Or,{className:"h-5 w-5 text-green-500 shrink-0 mt-0.5"}),s.jsx("span",{children:"Professional development resources"})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx(Or,{className:"h-5 w-5 text-green-500 shrink-0 mt-0.5"}),s.jsx("span",{children:"Advocacy for local business initiatives"})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx(Or,{className:"h-5 w-5 text-green-500 shrink-0 mt-0.5"}),s.jsx("span",{children:"Invitation to annual business gala"})]})]}),y&&s.jsxs("div",{className:"p-4 bg-blue-50 rounded-lg mt-4",children:[s.jsx("h4",{className:"font-medium text-blue-800",children:"Prorated Pricing"}),s.jsxs("p",{className:"text-sm text-blue-700 mt-1",children:["Our membership pricing is prorated based on the calendar year. If you join mid-year, you'll only pay for the remaining days of the current year (minimum $7). On January 1st, all memberships renew at the full annual rate of $",y.fullYearPrice,"."]}),s.jsxs("div",{className:"mt-2 text-xs text-blue-600",children:["Current pricing: $",y.proratedPrice.toFixed(2)," for ",y.daysRemaining," days remaining in ",new Date().getFullYear()]})]})]})]}),s.jsx(ai,{open:u,onOpenChange:d,children:s.jsxs(Oa,{children:[s.jsxs(za,{children:[s.jsx(Ha,{children:"Cancel Membership Subscription?"}),s.jsxs($a,{children:["Are you sure you want to cancel your membership subscription? Your subscription will remain active until the end of the current billing period, and you'll lose access to all membership benefits after that.",s.jsx("br",{}),s.jsx("br",{}),"This action cannot be undone, but you can resubscribe at any time."]})]}),s.jsxs(Ua,{children:[s.jsx(qa,{disabled:l,children:"Keep Subscription"}),s.jsx(Wa,{onClick:C,disabled:l,className:"bg-red-600 text-white hover:bg-red-700",children:l?"Canceling...":"Yes, Cancel Subscription"})]})]})})]})]})},Jve=()=>{const[t,e]=x.useState([]),[r,n]=x.useState(!0),a=ks();x.useEffect(()=>{i()},[]);const i=async()=>{n(!0);try{const u=await d0.getUserRequests();u.success&&u.data?e(u.data):ct.error(u.error||"Failed to fetch requests")}catch(u){console.error("Error fetching requests:",u),ct.error("Failed to fetch requests")}finally{n(!1)}},o=u=>{const d={pending:{color:"bg-yellow-100 text-yellow-800",label:"Pending"},in_progress:{color:"bg-blue-100 text-blue-800",label:"In Progress"},approved:{color:"bg-green-100 text-green-800",label:"Approved"},completed:{color:"bg-purple-100 text-purple-800",label:"Completed"},cancelled:{color:"bg-red-100 text-red-800",label:"Cancelled"},archived:{color:"bg-gray-100 text-gray-800",label:"Archived"}},h=d[u]||d.pending;return s.jsx(ke,{className:`${h.color} border-0`,children:h.label})},l=u=>{try{return Cs(new Date(u),"MMM dd, yyyy")}catch{return u}},c=u=>{try{const[d,h]=u.split(":"),f=new Date;return f.setHours(parseInt(d),parseInt(h)),Cs(f,"h:mm a")}catch{return u}};return r?s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs(ut,{className:"flex items-center gap-2",children:[s.jsx(zl,{className:"h-5 w-5 text-chamber-blue"}),"Ribbon Cutting Requests"]})}),s.jsx(Be,{children:s.jsxs("div",{className:"flex items-center justify-center py-8",children:[s.jsx(Mt,{className:"h-6 w-6 animate-spin text-chamber-blue mr-2"}),s.jsx("span",{className:"text-gray-600",children:"Loading requests..."})]})})]}):s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs(ut,{className:"flex items-center gap-2",children:[s.jsx(zl,{className:"h-5 w-5 text-chamber-blue"}),"Ribbon Cutting Requests"]}),s.jsxs(Y,{onClick:()=>a("/businesses/ribbon-cutting"),className:"bg-chamber-blue hover:bg-chamber-blue-dark",size:"sm",children:[s.jsx(vs,{className:"h-4 w-4 mr-1"}),"New Request"]})]})}),s.jsx(Be,{children:t.length===0?s.jsxs("div",{className:"text-center py-8",children:[s.jsx(zl,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),s.jsx("p",{className:"text-gray-500 mb-4",children:"No ribbon cutting requests yet"}),s.jsxs(Y,{onClick:()=>a("/businesses/ribbon-cutting"),className:"bg-chamber-blue hover:bg-chamber-blue-dark",children:[s.jsx(vs,{className:"h-4 w-4 mr-1"}),"Submit Your First Request"]})]}):s.jsx("div",{className:"space-y-4",children:t.map(u=>s.jsxs("div",{className:"border rounded-lg p-4",children:[s.jsxs("div",{className:"flex justify-between items-start mb-3",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-lg",children:u.business_name}),s.jsxs("p",{className:"text-sm text-gray-600",children:["Contact: ",u.contact_person]})]}),o(u.status)]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 text-sm mb-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(fs,{className:"h-4 w-4 text-gray-400"}),s.jsx("span",{children:u.email})]}),u.phone&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(wi,{className:"h-4 w-4 text-gray-400"}),s.jsx("span",{children:u.phone})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(_n,{className:"h-4 w-4 text-gray-400"}),s.jsx("span",{className:"truncate",children:u.business_address})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Br,{className:"h-4 w-4 text-gray-400"}),s.jsxs("span",{children:["Submitted ",l(u.created_at)]})]})]}),u.preferred_date&&s.jsxs("div",{className:"bg-gray-50 rounded-lg p-3 mb-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[s.jsx(Br,{className:"h-4 w-4 text-chamber-blue"}),s.jsx("span",{className:"font-medium",children:"Preferred:"}),s.jsx("span",{children:l(u.preferred_date)}),u.preferred_time&&s.jsxs("span",{children:["at ",c(u.preferred_time)]})]}),u.alternative_date&&s.jsxs("div",{className:"flex items-center gap-2 text-sm mt-1",children:[s.jsx(Br,{className:"h-4 w-4 text-gray-400"}),s.jsx("span",{className:"font-medium",children:"Alternative:"}),s.jsx("span",{children:l(u.alternative_date)}),u.alternative_time&&s.jsxs("span",{children:["at ",c(u.alternative_time)]})]})]}),u.expected_attendees&&s.jsxs("div",{className:"flex items-center gap-2 text-sm mb-3",children:[s.jsx(Os,{className:"h-4 w-4 text-gray-400"}),s.jsxs("span",{children:["Expected attendees: ",u.expected_attendees]})]}),u.event_description&&s.jsxs("div",{className:"mb-3",children:[s.jsx("p",{className:"text-sm font-medium mb-1",children:"Event Description:"}),s.jsx("p",{className:"text-sm text-gray-600 whitespace-pre-wrap",children:u.event_description})]}),u.admin_notes&&s.jsxs("div",{className:"bg-blue-50 rounded-lg p-3",children:[s.jsx("p",{className:"text-sm font-medium mb-1",children:"Admin Notes:"}),s.jsx("p",{className:"text-sm text-gray-700 whitespace-pre-wrap",children:u.admin_notes})]})]},u.id))})})]})},pi={async getJobs(){const{data:t,error:e}=await Q.from("jobs").select(` 948 *, 949 business_profiles!jobs_business_id_fkey ( 950 logo_url, 951 business_name 952 ) 953 `).eq("status","active").eq("approval_status","approved").order("created_at",{ascending:!1});if(e)throw console.error("Error fetching jobs:",e),e;return(t||[]).map(n=>{var a,i;return{...n,business_logo:((a=n.business_profiles)==null?void 0:a.logo_url)||n.business_logo,business_name:((i=n.business_profiles)==null?void 0:i.business_name)||n.business_name}})},async getAllJobs(){const{data:t,error:e}=await Q.from("jobs").select(` 954 *, 955 business_profiles!jobs_business_id_fkey ( 956 logo_url, 957 business_name 958 ) 959 `).order("created_at",{ascending:!1});if(e)throw console.error("Error fetching all jobs:",e),e;return(t||[]).map(n=>{var a,i;return{...n,business_logo:((a=n.business_profiles)==null?void 0:a.logo_url)||n.business_logo,business_name:((i=n.business_profiles)==null?void 0:i.business_name)||n.business_name}})},async getJobsByApprovalStatus(t){const{data:e,error:r}=await Q.from("jobs").select(` 960 *, 961 business_profiles!jobs_business_id_fkey ( 962 logo_url, 963 business_name 964 ) 965 `).eq("approval_status",t).order("created_at",{ascending:!1});if(r)throw console.error("Error fetching jobs by approval status:",r),r;return(e||[]).map(a=>{var i,o;return{...a,business_logo:((i=a.business_profiles)==null?void 0:i.logo_url)||a.business_logo,business_name:((o=a.business_profiles)==null?void 0:o.business_name)||a.business_name}})},async getJob(t){var n,a;const{data:e,error:r}=await Q.from("jobs").select(` 966 *, 967 business_profiles!jobs_business_id_fkey ( 968 logo_url, 969 business_name 970 ) 971 `).eq("id",t).single();if(r)throw console.error("Error fetching job:",r),r;return e?{...e,business_logo:((n=e.business_profiles)==null?void 0:n.logo_url)||e.business_logo,business_name:((a=e.business_profiles)==null?void 0:a.business_name)||e.business_name}:null},async createJob(t){const{data:{user:e},error:r}=await Q.auth.getUser();if(r||!e)throw new Error("User not authenticated");const{data:n,error:a}=await Q.from("jobs").insert([{...t,status:t.status||"active",approval_status:t.approval_status||"pending",created_by:e.id}]).select().single();if(a)throw console.error("Error creating job:",a),a;return n},async updateJob(t){const{id:e,...r}=t,{data:n,error:a}=await Q.from("jobs").update(r).eq("id",e).select().single();if(a)throw console.error("Error updating job:",a),a;return n},a
971sync updateJobAsBusinessOwner(t){const{id:e,...r}=t,{data:n,error:a}=await Q.from("jobs").update({...r,approval_status:"pending",admin_notes:null,reviewed_by:null,reviewed_at:null,updated_at:new Date().toISOString()}).eq("id",e).select().single();if(a)throw console.error("Error updating job as business owner:",a),a;return n},async approveJob(t){const{data:e,error:r}=await Q.from("jobs").update({approval_status:t.approval_status,admin_notes:t.admin_notes,reviewed_by:t.reviewed_by,reviewed_at:new Date().toISOString(),updated_at:new Date().toISOString()}).eq("id",t.id).select().single();if(r)throw console.error("Error approving job:",r),r;return e},async deleteJob(t){const{error:e}=await Q.from("jobs").delete().eq("id",t);if(e)throw console.error("Error deleting job:",e),e},async getFeaturedJobs(){const{data:t,error:e}=await Q.from("jobs").select(` 972 *, 973 business_profiles!jobs_business_id_fkey ( 974 logo_url, 975 business_name 976 ) 977 `).eq("featured",!0).eq("status","active").eq("approval_status","approved").order("created_at",{ascending:!1});if(e)throw console.error("Error fetching featured jobs:",e),e;return(t||[]).map(n=>{var a,i;return{...n,business_logo:((a=n.business_profiles)==null?void 0:a.logo_url)||n.business_logo,business_name:((i=n.business_profiles)==null?void 0:i.business_name)||n.business_name}})},async searchJobs(t){const{data:e,error:r}=await Q.from("jobs").select(` 978 *, 979 business_profiles!jobs_business_id_fkey ( 980 logo_url, 981 business_name 982 ) 983 `).eq("status","active").eq("approval_status","approved").or(`title.ilike.%${t}%,description.ilike.%${t}%,location.ilike.%${t}%`).order("created_at",{ascending:!1});if(r)throw console.error("Error searching jobs:",r),r;return(e||[]).map(a=>{var i,o;return{...a,business_logo:((i=a.business_profiles)==null?void 0:i.logo_url)||a.business_logo,business_name:((o=a.business_profiles)==null?void 0:o.business_name)||a.business_name}})},async getJobsByType(t){const{data:e,error:r}=await Q.from("jobs").select(` 984 *, 985 business_profiles!jobs_business_id_fkey ( 986 logo_url, 987 business_name 988 ) 989 `).eq("job_type",t).eq("status","active").eq("approval_status","approved").order("created_at",{ascending:!1});if(r)throw console.error("Error fetching jobs by type:",r),r;return(e||[]).map(a=>{var i,o;return{...a,business_logo:((i=a.business_profiles)==null?void 0:i.logo_url)||a.business_logo,business_name:((o=a.business_profiles)==null?void 0:o.business_name)||a.business_name}})},async getJobsByBusinessOwner(t){const{data:e,error:r}=await Q.from("jobs").select(` 990 *, 991 business_profiles!jobs_business_id_fkey ( 992 logo_url, 993 business_name 994 ) 995 `).eq("created_by",t).order("created_at",{ascending:!1});if(r)throw console.error("Error fetching jobs by business owner:",r),r;return(e||[]).map(a=>{var i,o;return{...a,business_logo:((i=a.business_profiles)==null?void 0:i.logo_url)||a.business_logo,business_name:((o=a.business_profiles)==null?void 0:o.business_name)||a.business_name}})}},Yve=({isOpen:t,onClose:e,onSuccess:r})=>{const{user:n}=ts(),[a,i]=x.useState({title:"",description:"",location:"",job_type:"",salary_range:"",business_name:"",business_logo:"",categories:[],featured:!1,featured_image:"",status:"active",expires_at:"",requirements:"",application_url:"",contact_email:""}),[o,l]=x.useState(!1),[c,u]=x.useState([]),[d,h]=x.useState(null),[f,m]=x.useState(!0),{toast:g}=St();x.useEffect(()=>{const j=async()=>{if(n!=null&&n.id)try{m(!0);const S=(await Zf.listBusinesses({ownerId:n.id})).businesses;u(S),S.length>0&&(h(S[0]),i(E=>({...E,business_name:S[0].name,business_logo:S[0].logo_url||"",contact_email:S[0].email||""})))}catch(N){console.error("Error loading businesses:",N),g({title:"Error",description:"Failed to load your businesses",variant:"destructive"})}finally{m(!1)}};t&&(n!=null&&n.id)&&j()},[t,n==null?void 0:n.id]);const y=j=>{h(j),i(N=>({...N,business_name:j.name,business_logo:j.logo_url||"",contact_email:j.email||""}))},b=async j=>{if(j.preventDefault(),!a.title.trim()||!a.description.trim()||!a.location.trim()||!a.job_type||!a.business_name.trim()){g({title:"Error",description:"Please fill in all required fields",variant:"destructive"});return}if(c.length===0){g({title:"Error",description:"You need to have an approved business profile to submit jobs",variant:"destructive"});return}try{l(!0);const N=E=>E?new Date(E).toISOString():void 0,S={title:a.title.trim(),description:a.description.trim(),location:a.location.trim(),job_type:a.job_type,salary_range:a.salary_range.trim()||void 0,business_id:d==null?void 0:d.id,business_name:a.business_name.trim(),business_logo:a.business_logo.trim()||void 0,categories:a.categories,featured:a.featured,featured_image:a.featured_image.trim()||void 0,status:a.status,expires_at:N(a.expires_at),requirements:a.requirements.trim()||void 0,application_url:a.application_url.trim()||void 0,contact_email:a.contact_email.trim()||void 0,approval_status:"pending"};await pi.createJob(S),g({title:"Success",description:"Job submitted successfully! It will be reviewed by our team before being published."}),r()}
995catch(N){console.error("Error creating job:",N),g({title:"Error",description:"Failed to submit job",variant:"destructive"})}finally{l(!1)}},w=()=>{o||(i({title:"",description:"",location:"",job_type:"",salary_range:"",business_name:"",business_logo:"",categories:[],featured:!1,featured_image:"",status:"active",expires_at:"",requirements:"",application_url:"",contact_email:""}),h(null),e())};return s.jsx(Tt,{open:t,onOpenChange:w,children:s.jsx(Dt,{className:"sm:max-w-[800px] max-h-[90vh] overflow-y-auto",children:s.jsxs("form",{onSubmit:b,children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Submit Job Listing"}),s.jsx(rr,{children:"Submit a job listing for your business. All submissions require admin approval before being published."})]}),s.jsx("div",{className:"mb-4"}),s.jsxs(da,{className:"mb-2",children:[s.jsx(s6,{className:"h-4 w-4"}),s.jsx(ha,{children:"Your job listing will be reviewed by our team and published within 24-48 hours."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[c.length>0&&s.jsxs("div",{className:"space-y-4",children:[s.jsx(Z,{children:"Select Business"}),s.jsx("div",{className:"grid gap-2",children:c.map(j=>s.jsx(De,{className:`cursor-pointer transition-colors ${(d==null?void 0:d.id)===j.id?"border-chamber-blue bg-blue-50":"hover:border-gray-300"}`,onClick:()=>y(j),children:s.jsx(Be,{className:"p-4",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium",children:j.name}),s.jsx("p",{className:"text-sm text-gray-600",children:j.short_description})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ke,{variant:j.status==="approved"?"default":"secondary",children:j.status}),(d==null?void 0:d.id)===j.id&&s.jsx(Or,{className:"h-4 w-4 text-green-600"})]})]})})},j.id))})]}),f?s.jsxs("div",{className:"text-center py-4",children:[s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-chamber-blue mx-auto mb-4"}),s.jsx("p",{children:"Loading your businesses..."})]}):c.length===0?s.jsx(da,{children:s.jsx(ha,{children:"You need to have an approved business profile to submit jobs. Please create and get approval for your business profile first."})}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"title",className:"text-right",children:"Job Title *"}),s.jsx(Ne,{id:"title",value:a.title,onChange:j=>i(N=>({...N,title:j.target.value})),className:"col-span-3",placeholder:"e.g., Software Engineer",required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"location",className:"text-right",children:"Location *"}),s.jsx(Ne,{id:"location",value:a.location,onChange:j=>i(N=>({...N,location:j.target.value})),className:"col-span-3",placeholder:"e.g., New York, NY",required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"job_type",className:"text-right",children:"Job Type *"}),s.jsxs(Wt,{value:a.job_type,onValueChange:j=>i(N=>({...N,job_type:j})),children:[s.jsx(Ht,{className:"col-span-3",children:s.jsx(qt,{placeholder:"Select job type"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"full-time",children:"Full-time"}),s.jsx(Ae,{value:"part-time",children:"Part-time"}),s.jsx(Ae,{value:"contract",children:"Contract"}),s.jsx(Ae,{value:"temporary",children:"Temporary"}),s.jsx(Ae,{value:"internship",children:"Internship"})]})]})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"salary_range",className:"text-right",children:"Salary Range"}),s.jsx(Ne,{id:"salary_range",value:a.salary_range,onChange:j=>i(N=>({...N,salary_range:j.target.value})),className:"col-span-3",placeholder:"e.g., $50,000 - $70,000",disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"description",className:"text-right pt-2",children:"Description *"}),s.jsx(zt,{id:"description",value:a.description,onChange:j=>i(N=>({...N,description:j.target.value})),className:"col-span-3",placeholder:"Detailed job description...",rows:4,required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"requirements",className:"text-right pt-2",children:"Requirements"}),s.jsx(zt,{id:"requirements",value:a.requirements,onChange:j=>i(N=>({...N,requirements:j.target.value})),className:"col-span-3",placeholder:"Job requirements and qualifications...",rows:3,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"application_url",className:"text-right",children:"Application URL"}),s.jsx(Ne,{id:"application_url",type:"url",value:a.application_url,onChange:j=>i(N=>({...N,application_url:j.target.value})),className:"col-span-3",placeholder:"https://example.com/apply",disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"contact_email",className:"text-right",children:"Contact Email"}),s.jsx(Ne,{id:"contact_email",type:"email",value:a.contact_email,onChange:j=>i(N=>({...N,contact_email:j.target.value})),className:"col-span-3",placeholder:"[email protected]",disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"expires_at",className:"text-right",children:"Expires At"}),s.jsx(Ne,{id:"expires_at",type:"datetime-local",value:a.expires_at,onChange:j=>i(N=>({...N,expires_at:j.target.value})),className:"col-span-3",disabled:o})]})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",type:"button",onClick:w,disabled:o,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:o||c.length===0,children:o?"Submitting...":"Submit Job"})]})]})})})},Zve=({isOpen:t,job:e,onClose:r,onSuccess:n})=>{const[a,i]=x.useState({title:"",description:"",location:"",job_type:"",salary_range:"",business_name:"",business_logo:"",requirements:"",application_url:"",contact_email:"",expires_at:""}),[o,l]=x.useState(!1),{toast:c}=St();x.useEffect(()=>{if(e){const h=f=>f?new Date(f).toISOString().slice(0,16):"";
995i({title:e.title,description:e.description,location:e.location,job_type:e.job_type,salary_range:e.salary_range||"",business_name:e.business_name,business_logo:e.business_logo||"",requirements:e.requirements||"",application_url:e.application_url||"",contact_email:e.contact_email||"",expires_at:h(e.expires_at)})}},[e]);const u=async h=>{if(h.preventDefault(),!a.title.trim()||!a.description.trim()||!a.location.trim()||!a.job_type||!a.business_name.trim()){c({title:"Error",description:"Please fill in all required fields",variant:"destructive"});return}try{l(!0);const f=g=>g?new Date(g).toISOString():void 0,m={id:e.id,title:a.title.trim(),description:a.description.trim(),location:a.location.trim(),job_type:a.job_type,salary_range:a.salary_range.trim()||void 0,business_name:a.business_name.trim(),business_logo:a.business_logo.trim()||void 0,requirements:a.requirements.trim()||void 0,application_url:a.application_url.trim()||void 0,contact_email:a.contact_email.trim()||void 0,expires_at:f(a.expires_at)};await pi.updateJobAsBusinessOwner(m),c({title:"Success",description:"Job updated successfully and sent for review"}),n()}catch(f){console.error("Error updating job:",f),c({title:"Error",description:"Failed to update job",variant:"destructive"})}finally{l(!1)}},d=()=>{o||r()};return s.jsx(Tt,{open:t,onOpenChange:d,children:s.jsx(Dt,{className:"sm:max-w-[700px] max-h-[90vh] overflow-y-auto",children:s.jsxs("form",{onSubmit:u,children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Edit Job Listing"}),s.jsx(rr,{children:"Update your job listing. After editing, it will be sent for review and approval."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"title",className:"text-right",children:"Job Title *"}),s.jsx(Ne,{id:"title",value:a.title,onChange:h=>i(f=>({...f,title:h.target.value})),className:"col-span-3",placeholder:"e.g., Software Engineer",required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"business_name",className:"text-right",children:"Company Name *"}),s.jsx(Ne,{id:"business_name",value:a.business_name,onChange:h=>i(f=>({...f,business_name:h.target.value})),className:"col-span-3",placeholder:"e.g., Tech Corp",required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"location",className:"text-right",children:"Location *"}),s.jsx(Ne,{id:"location",value:a.location,onChange:h=>i(f=>({...f,location:h.target.value})),className:"col-span-3",placeholder:"e.g., New York, NY",required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"job_type",className:"text-right",children:"Job Type *"}),s.jsxs(Wt,{value:a.job_type,onValueChange:h=>i(f=>({...f,job_type:h})),children:[s.jsx(Ht,{className:"col-span-3",children:s.jsx(qt,{})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"full-time",children:"Full-time"}),s.jsx(Ae,{value:"part-time",children:"Part-time"}),s.jsx(Ae,{value:"contract",children:"Contract"}),s.jsx(Ae,{value:"temporary",children:"Temporary"}),s.jsx(Ae,{value:"internship",children:"Internship"})]})]})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"salary_range",className:"text-right",children:"Salary Range"}),s.jsx(Ne,{id:"salary_range",value:a.salary_range,onChange:h=>i(f=>({...f,salary_range:h.target.value})),className:"col-span-3",placeholder:"e.g., $50,000 - $70,000",disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"description",className:"text-right pt-2",children:"Description *"}),s.jsx(zt,{id:"description",value:a.description,onChange:h=>i(f=>({...f,description:h.target.value})),className:"col-span-3",placeholder:"Detailed job description...",rows:4,required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"requirements",className:"text-right pt-2",children:"Requirements"}),s.jsx(zt,{id:"requirements",value:a.requirements,onChange:h=>i(f=>({...f,requirements:h.target.value})),className:"col-span-3",placeholder:"Job requirements and qualifications...",rows:3,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"application_url",className:"text-right",children:"Application URL"}),s.jsx(Ne,{id:"application_url",type:"url",value:a.application_url,onChange:h=>i(f=>({...f,application_url:h.target.value})),className:"col-span-3",placeholder:"https://example.com/apply",disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"contact_email",className:"text-right",children:"Contact Email"}),s.jsx(Ne,{id:"contact_email",type:"email",value:a.contact_email,onChange:h=>i(f=>({...f,contact_email:h.target.value})),className:"col-span-3",placeholder:"[email protected]",disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"business_logo",className:"text-right",children:"Company Logo URL"}),s.jsx(Ne,{id:"business_logo",type:"url",value:a.business_logo,onChange:h=>i(f=>({...f,business_logo:h.target.value})),className:"col-span-3",placeholder:"https://example.com/logo.png",disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"expires_at",className:"text-right",children:"Expires At"}),s.jsx(Ne,{id:"expires_at",type:"datetime-local",value:a.expires_at,onChange:h=>i(f=>({...f,expires_at:h.target.value})),className:"col-span-3",disabled:o})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",type:"button",onClick:d,disabled:o,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:o,children:o?"Updating...":"Update Job"})]})]})})})},Xve=({isOpen:t,job:e,onClose:r,onSuccess:n})=>{const[a,i]=x.useState(!1),{toast:o}=St(),l=async()=>
995{if(e)try{i(!0),await pi.deleteJob(e.id),o({title:"Success",description:"Job deleted successfully"}),n()}catch(u){console.error("Error deleting job:",u),o({title:"Error",description:"Failed to delete job",variant:"destructive"})}finally{i(!1)}},c=()=>{a||r()};return e?s.jsx(Tt,{open:t,onOpenChange:c,children:s.jsxs(Dt,{className:"sm:max-w-[500px]",children:[s.jsxs(It,{children:[s.jsxs(Ot,{className:"flex items-center gap-2",children:[s.jsx(vr,{className:"h-5 w-5 text-red-500"}),"Delete Job"]}),s.jsx(rr,{children:"Are you sure you want to delete this job? This action cannot be undone."})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs(da,{children:[s.jsx(yd,{className:"h-4 w-4"}),s.jsxs(ha,{children:['This will permanently delete the job "',e.title,'" from ',e.business_name,"."]})]}),s.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[s.jsx("h4",{className:"font-semibold text-gray-900 mb-2",children:"Job Details"}),s.jsxs("div",{className:"space-y-1 text-sm text-gray-600",children:[s.jsxs("p",{children:[s.jsx("strong",{children:"Title:"})," ",e.title]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Company:"})," ",e.business_name]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Location:"})," ",e.location]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Type:"})," ",e.job_type]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Status:"})," ",e.approval_status]})]})]})]}),s.jsxs(Sr,{className:"flex gap-2",children:[s.jsx(Y,{variant:"outline",onClick:c,disabled:a,children:"Cancel"}),s.jsxs(Y,{variant:"destructive",onClick:l,disabled:a,className:"flex items-center gap-2",children:[s.jsx(vr,{className:"h-4 w-4"}),a?"Deleting...":"Delete Job"]})]})]})}):null}
995,Qve=({isOpen:t,onClose:e,job:r,onUpdateStatus:n})=>{const[a,i]=x.useState(""),[o,l]=x.useState(""),[c,u]=x.useState(!1),d=async()=>{if(!(!r||!a)){u(!0);try{await n(r.id,a,o.trim()||void 0),e(),i(""),l("")}catch(m){console.error("Error updating job status:",m)}finally{u(!1)}}},h=()=>{e(),i(""),l("")},f=m=>{switch(m){case"active":return s.jsx(ke,{className:"bg-green-100 text-green-800",children:"Active"});case"inactive":return s.jsx(ke,{className:"bg-gray-100 text-gray-800",children:"Inactive"});case"expired":return s.jsx(ke,{className:"bg-red-100 text-red-800",children:"Expired"});default:return s.jsx(ke,{className:"bg-gray-100 text-gray-800",children:m})}};return s.jsx(Tt,{open:t,onOpenChange:h,children:s.jsxs(Dt,{children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Update Job Status"}),s.jsxs(rr,{children:['Change the status of your job listing "',r==null?void 0:r.title,'"']})]}),s.jsxs("div",{className:"space-y-4",children:[r&&s.jsxs("div",{className:"p-4 bg-gray-50 rounded",children:[s.jsx("h4",{className:"font-medium",children:r.title}),s.jsx("p",{className:"text-sm text-gray-600",children:r.business_name}),s.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[s.jsx("span",{className:"text-sm text-gray-600",children:"Current status:"}),f(r.status)]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"status",children:"New Status"}),s.jsxs(Wt,{value:a,onValueChange:i,children:[s.jsx(Ht,{children:s.jsx(qt,{placeholder:"Select new status"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"active",children:"Active"}),s.jsx(Ae,{value:"expired",children:"Expired"})]})]}),s.jsx("p",{className:"text-xs text-gray-500",children:"Note: Only approved jobs can be activated. Expired jobs will not be visible to job seekers."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"notes",children:"Notes (Optional)"}),s.jsx(zt,{id:"notes",value:o,onChange:m=>l(m.target.value),placeholder:"Add any notes about this status change...",rows:3})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",onClick:h,disabled:c,children:"Cancel"}),s.jsx(Y,{onClick:d,disabled:c||!a,children:c?"Updating...":"Update Status"})]})]})})},e1e=()=>{const{user:t}=ts(),[e,r]=x.useState([]),[n,a]=x.useState([]),[i,o]=x.useState(!0),[l,c]=x.useState(!1),[u,d]=x.useState(null),[h,f]=x.useState(!1),[m,g]=x.useState(!1),[y,b]=x.useState(!1),{toast:w}=St();x.useEffect(()=>{(async()=>{if(t!=null&&t.id)try{o(!0);const G=(await Zf.listBusinesses({ownerId:t.id})).businesses.filter(B=>B.status==="approved");if(a(G),G.length>0){const B=await pi.getJobsByBusinessOwner(t.id);r(B)}}catch(V){console.error("Error loading data:",V),w({title:"Error",description:"Failed to load your data",variant:"destructive"})}finally{o(!1)}})()},[t==null?void 0:t.id]);const j=()=>{c(!1),(async()=>{if(t!=null&&t.id)try{const G=(await Zf.listBusinesses({ownerId:t.id})).businesses.filter(B=>B.status==="approved");if(a(G),G.length>0){const B=await pi.getJobsByBusinessOwner(t.id);r(B)}}catch(V){console.error("Error refreshing data:",V)}})()},N=O=>{d(O),f(!0)},S=()=>{f(!1),d(null),(async()=>{if(!(!(t!=null&&t.id)||n.length===0))try{const V=await pi.getJobsByBusinessOwner(t.id);r(V)}catch(V){console.error("Error refreshing jobs:",V)}})()},E=O=>{d(O),g(!0)},C=()=>{g(!1),d(null),(async()=>{if(!(!(t!=null&&t.id)||n.length===0))try{const V=await pi.getJobsByBusinessOwner(t.id);r(V)}catch(V){console.error("Error refreshing jobs:",V)}})()},T=O=>{d(O),b(!0)},D=async(O,V,G)=>{try{await pi.updateJob({id:O,status:V}),w({title:"Success",description:"Job status updated successfully"}),(async()=>{if(!(!(t!=null&&t.id)||n.length===0))try{const $=await pi.getJobsByBusinessOwner(t.id);r($)}catch($){console.error("Error refreshing jobs:",$)}})()}catch(B){throw console.error("Error updating job status:",B),w({title:"Error",description:"Failed to update job status",variant:"destructive"}),B}},A=O=>{switch(O){case"approved":return s.jsx(ke,{className:"bg-green-100 text-green-800",children:"Approved"});case"pending":return s.jsx(ke,{className:"bg-yellow-100 text-yellow-800",children:"Pending Review"});case"rejected":return s.jsx(ke,{className:"bg-red-100 text-red-800",children:"Rejected"});default:return s.jsx(ke,{className:"bg-gray-100 text-gray-800",children:"Unknown"})}},R=O=>{switch(O){case"full-time":return s.jsx(ke,{className:"bg-blue-100 text-blue-800",children:"Full-time"});case"part-time":return s.jsx(ke,{className:"bg-purple-100 text-purple-800",children:"Part-time"});case"contract":return s.jsx(ke,{className:"bg-orange-100 text-orange-800",children:"Contract"});case"temporary":return s.jsx(ke,{className:"bg-yellow-100 text-yellow-800",children:"Temporary"});case"internship":return s.jsx(ke,{className:"bg-green-100 text-green-800",children:"Internship"});default:return s.jsx(ke,{className:"bg-gray-100 text-gray-800",children:O})}},M=O=>{switch(O){case"active":return s.jsx(ke,{className:"bg-green-100 text-green-800",children:"Active"});case"inactive":return s.jsx(ke,{className:"bg-gray-100 text-gray-800",children:"Inactive"});case"expired":return s.jsx(ke,{className:"bg-red-100 text-red-800",children:"Expired"});default:return s.jsx(ke,{className:"bg-gray-100 text-gray-800",children:O})}},P=e.filter(O=>O.approval_status==="pending"),U=e.filter(O=>O.approval_status==="approved"),I=e.filter(O=>O.approval_status==="rejected");return i?s.jsx("div",{className:"flex items-center justify-center p-8",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-chamber-blue mx-auto mb-4"}),s.jsx("p",{children:"Loading your jobs..."})]})}):!i&&n.length===0?s.jsx("div",{className:"container mx-auto px-4 py-8",children:s.jsx(da,{children:s.jsx(ha,{children:"You need to have an approved business profile to manage jobs. Please create and get approval for your business profile first."})})}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Job Management"}),s.jsx("p",{className:"text-gray-600",children:"Submit and manage your job listings"})]}),s.jsxs(Y,{onClick:()=>c(!0),children:[s.jsx(vs,{className:"h-4 w-4 mr-2"}),"Submit Job"]})]}),s.jsxs(sn,{defaultValue:"all",className:"w-full",children:[s.jsxs(Qs,{className:"grid w-full grid-cols-4",children:[s.jsxs(Gt,{value:"all",className:"flex items-center gap-2",children:[s.jsx(Ll,{className:"h-4 w-4"}),"All (",e.length,")"]}),s.jsxs(Gt,{value:"pending",className:"flex items-center gap-2",children:[s.jsx(rn,{className:"h-4 w-4"}),"Pending (",P.length,")"]}),s.jsxs(Gt,{value:"approved",className:"flex items-center gap-2",children:[s.jsx(un,{className:"h-4 w-4"}),"Approved (",U.length,")"]}),s.jsxs(Gt,{value:"rejected",className:"flex items-center gap-2",children:[s.jsx(Ir,{className:"h-4 w-4"}),"Rejected (",I.length,")"]})]}),s.jsxs(Rt,{value:"all",className:"space-y-4",children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:e.map(O=>s.jsx(De,{className:`${O.approval_status!=="approved"?"opacity-75":""}`,children:s.jsx(Be,{className:"p-6",children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900 truncate",children:O.title}),s.jsx("p",{className:"text-sm font-medium text-chamber-blue mb-2",children:O.business_name})]}),A(O.approval_status)]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-sm text-gray-600 line-clamp-2",children:O.description}),s.jsxs("div",{className:"flex items-center space-x-2 text-sm text-gray-500",children:[s.jsx(Ll,{className:"h-4 w-4"}),s.jsx("span",{children:O.location})]})]}),s.jsx("div",{className:"flex flex-wrap gap-2",children:R(O.job_type)}),O.salary_range&&s.jsxs("p",{className:"text-sm text-gray-600",children:["Salary: ",O.salary_range]}),O.admin_notes&&O.approval_status==="rejected"&&s.jsx("div",{className:"bg-red-50 p-3 rounded border border-red-200",children:s.jsxs("p",{className:"text-sm text-red-800",children:[s.jsx("strong",{children:"Rejection Reason:"})," ",O.admin_notes]})}),s.jsxs("div",{className:"flex items-center justify-between pt-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-gray-500",children:"Status:"}),M(O.status)]}),s.jsxs("span",{className:"text-xs text-gray-500",children:["Submitted: ",new Date(O.created_at).toLocaleDateString()]})]}),s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2 border-t",children:[O.approval_status==="approved"&&s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>T(O),className:"h-8 px-2",children:[s.jsx(jd,{className:"h-3 w-3 mr-1"}),"Status"]}),s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>N(O),className:"h-8 px-2",children:[s.jsx(zs,{className:"h-3 w-3 mr-1"}),"Edit"]}),s.jsxs(Y,{variant:"destructive",size:"sm",onClick:()=>E(O),className:"h-8 px-2",children:[s.jsx(vr,{className:"h-3 w-3 mr-1"}),"Delete"]})]})]})})},O.id))}),e.length===0&&s.jsxs("div",{className:"text-center py-12",children:[s.jsx(Ll,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No jobs submitted"}),s.jsx("p",{className:"text-gray-600 mb-4",children:"Start by submitting your first job listing."}),s.jsxs(Y,{onClick:()=>c(!0),children:[s.jsx(vs,{className:"h-4 w-4 mr-2"}),"Submit Job"]})]})]}),s.jsxs(Rt,{value:"pending",className:"space-y-4",children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:P.map(O=>s.jsx(De,{className:"border-yellow-200 bg-yellow-50",children:s.jsx(Be,{className:"p-6",children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900 truncate",children:O.title}),s.jsx("p",{className:"text-sm font-medium text-chamber-blue mb-2",children:O.business_name})]}),A(O.approval_status)]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-sm text-gray-600 line-clamp-2",children:O.description}),s.jsxs("div",{className:"flex items-center space-x-2 text-sm text-gray-500",children:[s.jsx(Ll,{className:"h-4 w-4"}),s.jsx("span",{children:O.location})]})]}),s.jsx("div",{className:"flex flex-wrap gap-2",children:R(O.job_type)}),O.salary_range&&s.jsxs("p",{className:"text-sm text-gray-600",children:["Salary: ",O.salary_range]}),s.jsxs("div",{className:"flex items-center justify-between pt-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-gray-500",children:"Status:"}),M(O.status)]}),s.jsxs("span",{className:"text-xs text-gray-500",children:["Submitted: ",new Date(O.created_at).toLocaleDateString()]})]}),s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2 border-t",children:[s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>N(O),className:"h-8 px-2",children:[s.jsx(zs,{className:"h-3 w-3 mr-1"}),"Edit"]}),s.jsxs(Y,{variant:"destructive",size:"sm",onClick:()=>E(O),className:"h-8 px-2",children:[s.jsx(vr,{className:"h-3 w-3 mr-1"}),"Delete"]})]})]})})},O.id))}),P.length===0&&s.jsxs("div",{className:"text-center py-12",children:[s.jsx(rn,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No pending jobs"}),s.jsx("p",{className:"text-gray-600",children:"All your job submissions have been reviewed."})]})]}),s.jsxs(Rt,{value:"approved",className:"space-y-4",children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:U.map(O=>s.jsx(De,{className:"border-green-200 bg-green-50",children:s.jsx(Be,{className:"p-6",children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900 truncate",children:O.title}),s.jsx("p",{className:"text-sm font-medium text-chamber-blue mb-2",children:O.business_name})]}),A(O.approval_status)]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-sm text-gray-600 line-clamp-2",children:O.description}),s.jsxs("div",{className:"flex items-center space-x-2 text-sm text-gray-500",children:[s.jsx(Ll,{className:"h-4 w-4"}),s.jsx("span",{children:O.location})]})]}),s.jsx("div",{className:"flex flex-wrap gap-2",children:R(O.job_type)}),O.salary_range&&s.jsxs("p",{className:"text-sm text-gray-600",children:["Salary: ",O.salary_range]}),s.jsxs("div",{className:"flex items-center justify-between pt-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-gray-500",children:"Status:"}),M(O.status)]}),s.jsxs("span",{className:"text-xs text-gray-500",children:["Approved: ",O.reviewed_at?new Date(O.reviewed_at).toLocaleDateString():"N/A"]})]}),s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2 border-t",children:[s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>T(O),className:"h-8 px-2",children:[s.jsx(jd,{className:"h-3 w-3 mr-1"}),"Status"]}),s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>N(O),className:"h-8 px-2",children:[s.jsx(zs,{className:"h-3 w-3 mr-1"}),"Edit"]}),s.jsxs(Y,{variant:"destructive",size:"sm",onClick:()=>E(O),className:"h-8 px-2",children:[s.jsx(vr,{className:"h-3 w-3 mr-1"}),"Delete"]})]})]})})},O.id))}),U.length===0&&s.jsxs("div",{className:"text-center py-12",children:[s.jsx(un,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No approved jobs"}),s.jsx("p",{className:"text-gray-600",children:"No jobs have been approved yet."})]})]}),s.jsxs(Rt,{value:"rejected",className:"space-y-4",children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:I.map(O=>s.jsx(De,{className:"border-red-200 bg-red-50",children:s.jsx(Be,{className:"p-6",children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900 truncate",children:O.title}),s.jsx("p",{className:"text-sm font-medium text-chamber-blue mb-2",children:O.business_name})]}),A(O.approval_status)]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-sm text-gray-600 line-clamp-2",children:O.description}),s.jsxs("div",{className:"flex items-center space-x-2 text-sm text-gray-500",children:[s.jsx(Ll,{className:"h-4 w-4"}),s.jsx("span",{children:O.location})]})]}),O.admin_notes&&s.jsx("div",{className:"bg-red-100 p-3 rounded",children:s.jsxs("p",{className:"text-sm text-red-800",children:[s.jsx("strong",{children:"Rejection Reason:"})," ",O.admin_notes]})}),s.jsx("div",{className:"flex flex-wrap gap-2",children:R(O.job_type)}),s.jsxs("div",{className:"flex items-center justify-between pt-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-gray-500",children:"Status:"}),M(O.status)]}),s.jsxs("span",{className:"text-xs text-gray-500",children:["Rejected: ",O.reviewed_at?new Date(O.reviewed_at).toLocaleDateString():"N/A"]})]}),s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2 border-t",children:[s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>N(O),className:"h-8 px-2",children:[s.jsx(zs,{className:"h-3 w-3 mr-1"}),"Edit"]}),s.jsxs(Y,{variant:"destructive",size:"sm",onClick:()=>E(O),className:"h-8 px-2",children:[s.jsx(vr,{className:"h-3 w-3 mr-1"}),"Delete"]})]})]})})},O.id))}),I.length===0&&s.jsxs("div",{className:"text-center py-12",children:[s.jsx(Ir,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No rejected jobs"}),s.jsx("p",{className:"text-gray-600",children:"No jobs have been rejected."})]})]})]}),s.jsx(Yve,{isOpen:l,onClose:()=>c(!1),onSuccess:j}),u&&s.jsx(Zve,{isOpen:h,job:u,onClose:()=>{f(!1),d(null)},onSuccess:S}),s.jsx(Xve,{isOpen:m,job:u,onClo
995se:()=>{g(!1),d(null)},onSuccess:C}),s.jsx(Qve,{isOpen:y,onClose:()=>{b(!1),d(null)},job:u,onUpdateStatus:D})]})},t1e=({value:t,onChange:e,disabled:r=!1,label:n="Deal Image",placeholder:a="https://example.com/deal-image.jpg",error:i})=>{const{toast:o}=St(),l=x.useRef(null),[c,u]=x.useState(!1),[d,h]=x.useState(!1),f=async j=>{var N;try{if(u(!0),!j.type.startsWith("image/"))throw new Error("Please select an image file");if(j.size>5*1024*1024)throw new Error("Image size must be less than 5MB");const S=((N=j.name.split(".").pop())==null?void 0:N.toLowerCase())||"jpg",C=`deals/${`deal-${Date.now()}-${Math.random().toString(36).substring(2)}.${S}`}`,{data:T,error:D}=await Q.storage.from("deal-images").upload(C,j,{cacheControl:"3600",upsert:!1});if(D)throw console.error("Supabase upload error:",D),new Error(D.message||"Failed to upload image");const{data:{publicUrl:A}}=Q.storage.from("deal-images").getPublicUrl(T.path);e(A),o({title:"Success",description:"Deal image uploaded successfully"})}catch(S){console.error("Error uploading deal image:",S),o({title:"Upload Error",description:S.message||"Failed to upload deal image",variant:"destructive"})}finally{u(!1)}},m=j=>{var S;const N=(S=j.target.files)==null?void 0:S[0];N&&f(N)},g=j=>{j.preventDefault(),h(!1);const N=j.dataTransfer.files[0];N&&f(N)},y=j=>{j.preventDefault(),h(!0)},b=j=>{j.preventDefault(),h(!1)},w=j=>{e(j)};return s.jsxs("div",{className:"space-y-4",children:[s.jsx(Z,{className:i?"text-red-600":"",children:n}),s.jsxs(sn,{defaultValue:"upload",className:"w-full",children:[s.jsxs(Qs,{className:"grid w-full grid-cols-2",children:[s.jsxs(Gt,{value:"upload",className:"flex items-center gap-2",children:[s.jsx(vn,{className:"h-4 w-4"}),"Upload Image"]}),s.jsxs(Gt,{value:"url",className:"flex items-center gap-2",children:[s.jsx(dp,{className:"h-4 w-4"}),"Image URL"]})]}),s.jsxs(Rt,{value:"upload",className:"space-y-3",children:[s.jsx("div",{className:`border-2 border-dashed rounded-lg p-6 text-center transition-colors ${d?"border-chamber-blue bg-blue-50":i?"border-red-300 bg-red-50":"border-gray-300 hover:border-gray-400"} ${r?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,onDrop:g,onDragOver:y,onDragLeave:b,onClick:()=>{var j;return!r&&!c&&((j=l.current)==null?void 0:j.click())},children:c?s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[s.jsx(Mt,{className:"h-8 w-8 animate-spin text-chamber-blue"}),s.jsx("p",{className:"text-sm text-gray-600",children:"Uploading deal image..."})]}):t?s.jsxs("div",{className:"flex flex-col items-center gap-3",children:[s.jsxs("div",{className:"relative w-32 h-24 bg-gray-100 rounded overflow-hidden",children:[s.jsx("img",{src:t,alt:"Deal preview",className:"w-full h-full object-cover",onError:j=>{j.currentTarget.style.display="none",j.currentTarget.nextElementSibling.style.display="flex"}}),s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-100 hidden",children:s.jsx(vi,{className:"h-8 w-8 text-gray-400"})})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-sm font-medium text-gray-900",children:"Deal Image Preview"}),s.jsx("p",{className:"text-xs text-gray-500",children:"Click to change image"})]})]}):s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[s.jsx(vn,{className:"h-8 w-8 text-gray-400"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Click to upload or drag and drop"}),s.jsx("p",{className:"text-xs text-gray-500",children:"PNG, JPG, GIF up to 5MB"}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Recommended: 800x400px for best results"})]})]})}),s.jsx("input",{ref:l,type:"file",accept:"image/*",onChange:m,className:"hidden",disabled:r||c}),s.jsxs(Y,{type:"button",variant:"outline",onClick:()=>{var j;return(j=l.current)==null?void 0:j.click()},disabled:r||c,className:"w-full",children:[s.jsx(vn,{className:"h-4 w-4 mr-2"}),"Choose Deal Image"]})]}),s.jsxs(Rt,{value:"url",className:"space-y-3",children:[s.jsx(Ne,{value:t,onChange:j=>w(j.target.value),placeholder:a,disabled:r,type:"url",className:i?"border-red-500":""}),s.jsx("p",{className:"text-xs text-gray-500",children:"Enter a direct URL to an image for your deal"})]})]}),i&&s.jsx("p",{className:"text-sm text-red-600",children:i})]})},r1e=Dk({title:sa().min(1,"Title is required").max(100,"Title must be less than 100 characters"),description:sa().min(1,"Description is required").max(500,"Description must be less than 500 characters"),deal_type:Dhe(["percentage","fixed","bogo","free","other"]),deal_value:sa().min(1,"Deal value is required").max(50,"Deal value must be less than 50 characters"),redemption_code:sa().max(20,"Redemption code must be less than 20 characters").optional(),terms_and_conditions:sa().max(1e3,"Terms must be less than 1000 characters").optional(),image_url:sa().url("Must be a valid URL").optional().or(Ahe("")),valid_from:sa().min(1,"Start date is required"),valid_until:sa().min(1,"End date is required")}).refine(t=>{const e=new Date(t.valid_from);return new Date(t.valid_until)>e},{message:"End date must be after start date",path:["valid_until"]}),s1e=[{value:"percentage",label:"Percentage Off (e.g., 20% off)"},{value:"fixed",label:"Fixed Amount Off (e.g., $10 off)"},{value:"bogo",label:"Buy One Get One (e.g., BOGO)"},{value:"free",label:"Free Item/Service"},{value:"other",label:"Other Deal Type"}],i_=({initialData:t,businesses:e=[],selectedBusiness:r,onBusinessSelect:n,onSubmit:a,onCancel:i,isLoading:o=!1,submitLabel:l="Create Deal",renderBeforeSubmit:c})=>{var E;const[u,d]=x.useState(null),h=C=>{if(!C)return"";try{console.log("Formatting timestamp:",C);const T=new Date(C).toISOString().split("T")[0];return console.log("Formatted date:",T),T}catch(T){return console.error("Error formatting date:",T),""}},{register:f,handleSubmit:m,formState:{errors:g},setValue:y,watch:b,reset:w}
995=K0({resolver:Ek(r1e),defaultValues:{title:(t==null?void 0:t.title)||"",description:(t==null?void 0:t.description)||"",deal_type:(t==null?void 0:t.deal_type)||"percentage",deal_value:(t==null?void 0:t.deal_value)||"",redemption_code:(t==null?void 0:t.redemption_code)||"",terms_and_conditions:(t==null?void 0:t.terms_and_conditions)||"",image_url:(t==null?void 0:t.image_url)||"",valid_from:h(t==null?void 0:t.valid_from)||new Date().toISOString().split("T")[0],valid_until:h(t==null?void 0:t.valid_until)||new Date(Date.now()+30*24*60*60*1e3).toISOString().split("T")[0]}}),j=b("deal_type");x.useEffect(()=>{t&&(console.log("Resetting form with initialData:",t),console.log("Valid from:",t.valid_from),console.log("Valid until:",t.valid_until),w({title:t.title||"",description:t.description||"",deal_type:t.deal_type||"percentage",deal_value:t.deal_value||"",redemption_code:t.redemption_code||"",terms_and_conditions:t.terms_and_conditions||"",image_url:t.image_url||"",valid_from:h(t.valid_from)||new Date().toISOString().split("T")[0],valid_until:h(t.valid_until)||new Date(Date.now()+30*24*60*60*1e3).toISOString().split("T")[0]}))},[t,w]);const N=async C=>{try{d(null),await a(C)}catch(T){console.error("Error submitting deal form:",T),d(T instanceof Error?T.message:"Failed to save deal. Please try again.")}},S=C=>{switch(C){case"percentage":return"20%";case"fixed":return"$10 off";case"bogo":return"Buy 1 Get 1 Free";case"free":return"Free Coffee";default:return"Special Offer"}};return s.jsxs("form",{onSubmit:m(N),className:"space-y-6",children:[u&&s.jsxs(da,{variant:"destructive",children:[s.jsx(Ts,{className:"h-4 w-4"}),s.jsx(ha,{children:u})]}),e.length>0&&n&&s.jsxs("div",{className:"space-y-4",children:[s.jsx(Z,{children:"Select Business"}),s.jsx("div",{className:"grid gap-2",children:e.map(C=>s.jsx(De,{className:`cursor-pointer transition-colors ${(r==null?void 0:r.id)===C.id?"border-chamber-blue bg-blue-50":"hover:border-gray-300"}`,onClick:()=>n(C),children:s.jsx(Be,{className:"p-4",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium",children:C.name}),s.jsx("p",{className:"text-sm text-gray-600",children:C.short_description})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ke,{variant:C.status==="approved"?"default":"secondary",children:C.status}),(r==null?void 0:r.id)===C.id&&s.jsx(Or,{className:"h-4 w-4 text-green-600"})]})]})})},C.id))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"title",children:"Deal Title *"}),s.jsx(Ne,{id:"title",...f("title"),placeholder:"e.g., 20% Off All Services",className:g.title?"border-red-500":""}),g.title&&s.jsx("p",{className:"text-sm text-red-600",children:g.title.message})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"description",children:"Description *"}),s.jsx(zt,{id:"description",...f("description"),placeholder:"Describe your deal in detail...",rows:3,className:g.description?"border-red-500":""}),g.description&&s.jsx("p",{className:"text-sm text-red-600",children:g.description.message})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"deal_type",children:"Deal Type *"}),s.jsxs(Wt,{value:j,onValueChange:C=>y("deal_type",C),children:[s.jsx(Ht,{className:g.deal_type?"border-red-500":"",children:s.jsx(qt,{placeholder:"Select deal type"})}),s.jsx($t,{children:s1e.map(C=>s.jsx(Ae,{value:C.value,children:C.label},C.value))})]}),g.deal_type&&s.jsx("p",{className:"text-sm text-red-600",children:g.deal_type.message})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"deal_value",children:"Deal Value *"}),s.jsx(Ne,{id:"deal_value",...f("deal_value"),placeholder:S(j),className:g.deal_value?"border-red-500":""}),g.deal_value&&s.jsx("p",{className:"text-sm text-red-600",children:g.deal_value.message})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"redemption_code",children:"Redemption Code (Optional)"}),s.jsx(Ne,{id:"redemption_code",...f("redemption_code"),placeholder:"e.g., SAVE20",className:g.redemption_code?"border-red-500":""}),g.redemption_code&&s.jsx("p",{className:"text-sm text-red-600",children:g.redemption_code.message}),s.jsx("p",{className:"text-xs text-gray-500",children:"Optional code
995customers can use to redeem the deal"})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"valid_from",children:"Valid From *"}),s.jsx(Ne,{id:"valid_from",type:"date",...f("valid_from"),className:g.valid_from?"border-red-500":""}),g.valid_from&&s.jsx("p",{className:"text-sm text-red-600",children:g.valid_from.message})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"valid_until",children:"Valid Until *"}),s.jsx(Ne,{id:"valid_until",type:"date",...f("valid_until"),className:g.valid_until?"border-red-500":""}),g.valid_until&&s.jsx("p",{className:"text-sm text-red-600",children:g.valid_until.message})]})]}),s.jsx(t1e,{value:b("image_url")||"",onChange:C=>y("image_url",C),disabled:o,label:"Deal Image (Optional)",placeholder:"https://example.com/deal-image.jpg",error:(E=g.image_url)==null?void 0:E.message}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"terms_and_conditions",children:"Terms & Conditions (Optional)"}),s.jsx(zt,{id:"terms_and_conditions",...f("terms_and_conditions"),placeholder:"Any restrictions or conditions for this deal...",rows:3,className:g.terms_and_conditions?"border-red-500":""}),g.terms_and_conditions&&s.jsx("p",{className:"text-sm text-red-600",children:g.terms_and_conditions.message})]}),c==null?void 0:c(),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 pt-4",children:[s.jsx(Y,{type:"submit",disabled:o,className:"bg-chamber-blue hover:bg-chamber-blue-dark flex-1",children:o?s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Saving..."]}):s.jsxs("div",{className:"flex items-center",children:[s.jsx(hp,{size:16,className:"mr-2"}),l]})}),s.jsxs(Y,{type:"button",variant:"outline",onClick:i,disabled:o,className:"flex-1",children:[s.jsx(Ir,{size:16,className:"mr-2"}),"Cancel"]})]})]})},n1e=({isOpen:t,onClose:e,onDealCreated:r,businesses:n})=>{J0();const[a,i]=x.useState(!1),[o,l]=x.useState(null);Oe.useEffect(()=>{t&&n.length>0&&!o&&l(n[0])},[t,n,o]);const{toast:c}=St(),u=async h=>{if(!(o!=null&&o.id)){c({title:"Error",description:"Please select a business for this deal.",variant:"destructive"});return}i(!0);try{await yi.createDeal(o.id,h),c({title:"Success",description:"Deal created successfully! It will be reviewed by an admin before going live."}),r(),e()}catch(f){console.error("Error creating deal:",f),c({title:"Error",description:f instanceof Error?f.message:"Failed to create deal. Please try again.",variant:"destructive"})}finally{i(!1)}},d=()=>{e()};return n.length===0?s.jsx(Tt,{open:t,onOpenChange:e,children:s.jsx(Dt,{className:"sm:max-w-[600px]",children:s.jsxs(It,{children:[s.jsx(Ot,{children:"Business Profile Required"}),s.jsx(rr,{children:"You need to have an approved business profile to create deals. Please create and get approval for your business profile first."})]})})}):s.jsx(Tt,{open:t,onOpenChange:e,children:s.jsxs(Dt,{className:"sm:max-w-[700px] max-h-[90vh] overflow-y-auto",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Create New Deal"}),s.jsx(rr,{children:"Create an exclusive deal for chamber members. Your deal will be reviewed before going live."})]}),s.jsx(i_,{businesses:n,selectedBusiness:o,onBusinessSelect:l,onSubmit:u,onCancel:d,isLoading:a,submitLabel:"Create Deal"})]})})},a1e=({isOpen:t,onClose:e,onDealUpdated:r,deal:n})=>{const{user:a}=J0(),[i,o]=x.useState(!1),[l,c]=x.useState([]),[u,d]=x.useState(null),[h,f]=x.useState(!0),{toast:m}=St();x.useEffect(()=>{const b=async()=>{if(!(!(a!=null&&a.id)||!t))try{f(!0);const j=(await Zf.listBusinesses({ownerId:a.id})).businesses.filter(N=>N.status==="approved");if(c(j),n){const N=j.find(S=>S.id===n.business_id);N&&d(N)}}catch(w){console.error("Error loading businesses:",w),m({title:"Error",description:"Failed to load business data. Please try again.",variant:"destructive"})}finally{f(!1)}};t&&(a!=null&&a.id)&&b()},[t,a==null?void 0:a.id,n]);const g=async b=>{if(!(n!=null&&n.id)||!(u!=null&&u.id)){m({title:"Error",description:"Missing required data. Please try again.",variant:"destructive"});return}o(!0);try{await yi.updateDeal(n.id,b),m({title:"Success",description:"Deal updated successfully! It will be reviewed by an admin before going live."}),r(),e()}catch(w){console.error("Error updating deal:",w),m({title:"Error",description:w instanceof Error?w.message:"Failed to update deal. Please try again.",variant:"destructive"})}finally{o(!1)}},y=()=>{e()};return n?s.jsx(Tt,{open:t,onOpenChange:e,children:s.jsxs(Dt,{className:"sm:max-w-[800px] max-h-[90vh] overflow-y-auto",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Edit Deal"}),s.jsx(rr,{children:"Update your deal details. After editing, your deal will be reviewed by an admin before going live."})]}),s.jsx(i_,{initialData:n,businesses:l,selectedBusiness:u,onBusinessSelect:d,onSubmit:g,onCancel:y,isLoading:i,submitLabel:"Update Deal"})]})}):null}
995,i1e=({isOpen:t,onClose:e,deal:r})=>{var l;if(!r)return null;const n=c=>new Date(c).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),a=c=>c.approval_status==="pending"?s.jsx(Ts,{className:"h-4 w-4 text-yellow-600"}):c.approval_status==="approved"&&c.is_active?s.jsx(Or,{className:"h-4 w-4 text-green-600"}):c.approval_status==="rejected"?s.jsx(Hl,{className:"h-4 w-4 text-red-600"}):s.jsx(rn,{className:"h-4 w-4 text-gray-600"}),i=c=>c.approval_status==="pending"?"Pending Review":c.approval_status==="approved"&&c.is_active?"Active":c.approval_status==="approved"&&!c.is_active?"Approved (Inactive)":c.approval_status==="rejected"?"Rejected":"Unknown",o=c=>c.approval_status==="pending"?"bg-yellow-100 text-yellow-800 border-yellow-200":c.approval_status==="approved"&&c.is_active?"bg-green-100 text-green-800 border-green-200":c.approval_status==="rejected"?"bg-red-100 text-red-800 border-red-200":"bg-gray-100 text-gray-800 border-gray-200";return s.jsx(Tt,{open:t,onOpenChange:e,children:s.jsxs(Dt,{className:"sm:max-w-[600px] max-h-[90vh] overflow-y-auto",children:[s.jsxs(It,{children:[s.jsxs(Ot,{className:"flex items-center gap-2",children:[s.jsx(ji,{className:"h-5 w-5"}),"Deal Details"]}),s.jsx(rr,{children:"View the complete details of this deal"})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:r.title}),s.jsxs("div",{className:"flex items-center gap-2",children:[a(r),s.jsx(ke,{className:`${o(r)} border`,children:i(r)})]})]}),s.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(ka,{className:"h-4 w-4 text-gray-600"}),s.jsx("span",{className:"font-medium text-gray-900",children:"Business"})]}),s.jsx("p",{className:"text-gray-700",children:((l=r.business)==null?void 0:l.business_name)||"Unknown Business"})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ji,{className:"h-4 w-4 text-gray-600"}),s.jsx("span",{className:"font-medium text-gray-900",children:"Deal Type"})]}),s.jsx(ke,{variant:"outline",className:"capitalize",children:r.deal_type})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ti,{className:"h-4 w-4 text-gray-600"}),s.jsx("span",{className:"font-medium text-gray-900",children:"Deal Value"})]}),s.jsx("p",{className:"text-lg font-semibold text-chamber-blue",children:r.deal_value})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("h4",{className:"font-medium text-gray-900",children:"Description"}),s.jsx("p",{className:"text-gray-700 leading-relaxed",children:r.description})]}),r.redemption_code&&s.jsxs("div",{className:"bg-blue-50 border border-blue-200 p-4 rounded-lg",children:[s.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Redemption Code"}),s.jsx("div",{className:"font-mono text-lg font-bold text-blue-800 bg-white p-2 rounded border",children:r.redemption_code})]}),r.terms_and_conditions&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("h4",{className:"font-medium text-gray-900",children:"Terms & Conditions"}),s.jsx("p",{className:"text-sm text-gray-600 bg-gray-50 p-3 rounded border",children:r.terms_and_conditions})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Br,{className:"h-4 w-4 text-gray-600"}),s.jsx("span",{className:"font-medium text-gray-900",children:"Valid From"})]}),s.jsx("p",{className:"text-gray-700",children:n(r.valid_from)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Br,{className:"h-4 w-4 text-gray-600"}),s.jsx("span",{className:"font-medium text-gray-900",children:"Valid Until"})]}),s.jsx("p",{className:"text-gray-700",children:n(r.valid_until)})]})]}),r.admin_notes&&s.jsx("div",{className:"border-t pt-4",children:s.jsxs("div",{className:"bg-yellow-50 border border-yellow-200 p-4 rounded-lg",children:[s.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Admin Notes"}),s.jsx("p",{className:"text-sm text-gray-700",children:r.admin_notes})]})}),s.jsx("div",{className:"border-t pt-4 space-y-2",children:s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 text-sm text-gray-500",children:[s.jsxs("div",{children:[s.jsx("span",{className:"font-medium",children:"Created:"})," ",n(r.created_at)]}),s.jsxs("div",{children:[s.jsx("span",{className:"font-medium",children:"Last Updated:"})," ",n(r.updated_at)]}),r.reviewed_at&&s.jsxs("div",{children:[s.jsx("span",{className:"font-medium",children:"Reviewed:"})," ",n(r.reviewed_at)]})]})})]})]})})},o1e=()=>{const{user:t}
995=J0(),[e,r]=x.useState([]),[n,a]=x.useState([]),[i,o]=x.useState(!0),[l,c]=x.useState(null),[u,d]=x.useState(null),[h,f]=x.useState(!1),[m,g]=x.useState(!1),[y,b]=x.useState(!1),[w,j]=x.useState(null),[N,S]=x.useState(null),[E,C]=x.useState(null);x.useEffect(()=>{(async()=>{if(t!=null&&t.id)try{o(!0),c(null);const V=(await Zf.listBusinesses({ownerId:t.id})).businesses.filter(G=>G.status==="approved");if(a(V),V.length>0){const G=[];for(const B of V){const $=await yi.getBusinessDeals(B.id);G.push(...$)}G.sort((B,$)=>new Date($.created_at).getTime()-new Date(B.created_at).getTime()),r(G)}}catch(O){console.error("Error fetching data:",O),c("Failed to load deals. Please try again.")}finally{o(!1)}})()},[t==null?void 0:t.id]);const T=async I=>{try{d(I),await yi.deleteDeal(I),r(e.filter(O=>O.id!==I))}catch(O){console.error("Error deleting deal:",O),c("Failed to delete deal. Please try again.")}finally{d(null)}},D=async()=>{if(t!=null&&t.id&&n.length>0)try{const I=[];for(const O of n){const V=await yi.getBusinessDeals(O.id);I.push(...V)}I.sort((O,V)=>new Date(V.created_at).getTime()-new Date(O.created_at).getTime()),r(I)}catch(I){console.error("Error refreshing deals:",I),c("Failed to refresh deals. Please reload the page.")}},A=I=>{j(I),g(!0)},R=I=>{S(I),b(!0)},M=async()=>{if(t!=null&&t.id&&n.length>0)try{const I=[];for(const O of n){const V=await yi.getBusinessDeals(O.id);I.push(...V)}I.sort((O,V)=>new Date(V.created_at).getTime()-new Date(O.created_at).getTime()),r(I),C("Deal updated successfully! It will be reviewed by an admin before going live."),setTimeout(()=>{C(null)},5e3)}catch(I){console.error("Error refreshing deals:",I),c("Failed to refresh deals. Please reload the page.")}},P=I=>{if(I.approval_status==="pending")return s.jsxs(ke,{variant:"secondary",className:"bg-yellow-100 text-yellow-800",children:[s.jsx(rn,{size:12,className:"mr-1"}),"Pending"]});if(I.approval_status==="approved"){if(!I.is_active)return s.jsx(ke,{variant:"secondary",className:"bg-gray-100 text-gray-800",children:"Inactive"});const O=new Date;return new Date(I.valid_until)<O?s.jsx(ke,{variant:"secondary",className:"bg-red-100 text-red-800",children:"Expired"}):s.jsxs(ke,{variant:"default",className:"bg-green-100 text-green-800",children:[s.jsx(Or,{size:12,className:"mr-1"}),"Active"]})}else if(I.approval_status==="rejected")return s.jsxs(ke,{variant:"destructive",children:[s.jsx(Hl,{size:12,className:"mr-1"}),"Rejected"]});return null},U=I=>new Date(I).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return!i&&n.length===0?s.jsx("div",{className:"container mx-auto px-4 py-8",children:s.jsx(da,{children:s.jsx(ha,{children:"You need to have an approved business profile to manage deals. Please create and get approval for your business profile first."})})}):i?s.jsx("div",{className:"container mx-auto px-4 py-8",children:s.jsx("div",{className:"flex justify-center items-center py-12",children:s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-chamber-blue"})})}):s.jsxs("div",{className:"container mx-auto px-4 py-8",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center mb-8",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Manage Your Deals"}),s.jsx("p",{className:"text-gray-600",children:"Create and manage exclusive deals for chamber members"})]}),s.jsxs(Y,{onClick:()=>f(!0),className:"bg-chamber-blue hover:bg-chamber-blue-dark mt-4 sm:mt-0",children:[s.jsx(vs,{size:16,className:"mr-2"}),"Create New Deal"]})]}),l&&s.jsx(da,{variant:"destructive",className:"mb-6",children:s.jsx(ha,{children:l})}),E&&s.jsxs("div",{className:"mb-6 flex items-center justify-between p-4 bg-green-50 border border-green-200 rounded-lg",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx(Or,{className:"h-4 w-4 text-green-600 mr-2"}),s.jsx("span",{className:"text-green-800",children:E})]}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>C(null),className:"text-green-600 hover:text-green-800",children:"Ã"})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6 mb-8",children:[s.jsx(De,{children:s.jsx(Be,{className:"p-6",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"p-2 bg-blue-100 rounded-lg",children:s.jsx(Xs,{className:"h-6 w-6 text-blue-600"})}),s.jsxs("div",{className:"ml-4",children:[s.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Total Deals"}),s.jsx("p",{className:"text-2xl font-bold text-gray-900",children:e.length})]})]})})}),s.jsx(De,{children:s.jsx(Be,{className:"p-6",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"p-2 bg-green-100 rounded-lg",children:s.jsx(Or,{className:"h-6 w-6 text-green-600"})}),s.jsxs("div",{className:"ml-4",children:[s.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Active"}),s.jsx("p",{className:"text-2xl font-bold text-gray-900",children:e.filter(I=>I.approval_status==="approved"&&I.is_active&&new Date(I.valid_until)>new Date).length})]})]})})}),s.jsx(De,{children:s.jsx(Be,{className:"p-6",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"p-2 bg-yellow-100 rounded-lg",children:s.jsx(rn,{className:"h-6 w-6 text-yellow-600"})}),s.jsxs("div",{className:"ml-4",children:[s.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Pending"}),s.jsx("p",{className:"text-2xl font-bold text-gray-900",children:e.filter(I=>I.approval_status==="pending").length})]})]})})}),s.jsx(De,{children:s.jsx(Be,{className:"p-6",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:"p-2 bg-red-100 rounded-lg",children:s.jsx(Hl,{className:"h-6 w-6 text-red-600"})}),s.jsxs("div",{className:"ml-4",children:[s.jsx("p",{className:"text-sm font-medium text-gray-600",children:"Rejected"}),s.jsx("p",{className:"text-2xl font-bold text-gray-900",children:e.filter(I=>I.approval_status==="rejected").length})]})]})})})]}),s.jsxs(De,{children:[s.jsx(ot,{children:s.jsx(ut,{children:"Your Deals"})}),s.jsx(Be,{children:e.length===0?s.jsxs("div",{className:"text-center py-12",children:[s.jsx("div",{className:"mx-auto w-24 h-24 bg-gray-100 rounded-full flex items-center justify-center mb-4",children:s.jsx(vs,{className:"h-12 w-12 text-gray-400"})}),s.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"No deals yet"}),s.jsx("p",{className:"text-gray-600 mb-6",children:"Create your first exclusive deal for chamber members"}),s.jsxs(Y,{onClick:()=>f(!0),className:"bg-chamber-blue hover:bg-chamber-blue-dark",children:[s.jsx(vs,{size:16,className:"mr-2"}),"Create Your First Deal"]})]}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Oi,{children:[s.jsx(zi,{children:s.jsxs(As,{children:[s.jsx(At,{children:"Deal"}),s.jsx(At,{children:"Business"}),s.jsx(At,{children:"Type"}),s.jsx(At,{children:"Status"}),s.jsx(At,{children:"Valid Until"}),s.jsx(At,{children:"Created"}),s.jsx(At,{className:"text-right",children:"Actions"})]})}),s.jsx(Ui,{children:e.map(I=>{var O;return s.jsxs(As,{children:[s.jsx(Ct,{children:s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-gray-900",children:I.title}),s.jsx("div",{className:"text-sm text-gray-500 line-clamp-1",children:I.description})]})}),s.jsx(Ct,{children:s.jsx("div",{className:"text-sm",children:s.jsx("div",{className:"font-medium text-gray-900",children:(O=I.business)==null?void 0:O.business_name})})}),s.jsx(Ct,{children:s.jsx(ke,{variant:"outline",className:"capitalize",children:I.deal_type})}),s.jsx(Ct,{children:P(I)}),s.jsx(Ct,{children:U(I.valid_until)}),s.jsx(Ct,{children:U(I.created_at)}),s.jsx(Ct,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end space-x-2",children:[s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>R(I),children:s.jsx(Xs,{size:16})}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>A(I),children:s.jsx(zs,{size:16})}),s.jsxs(ai,{children:[s.jsx(rk,{asChild:!0,children:s.jsx(Y,{variant:"ghost",size:"sm",className:"text-red-600 hover:text-red-700",disabled:u===I.id,children:s.jsx(vr,{size:16})})}),s.jsxs(Oa,{children:[s.jsxs(za,{children:[s.jsx(Ha,{children:"Delete Deal"}),s.jsxs($a,{children:['Are you sure you want to delete "',I.title,'"? This action cannot be undone.']})]}),s.jsxs(Ua,{children:[s.jsx(qa,{children:"Cancel"}),s.jsx(Wa,{onClick:()=>T(I.id),className:"bg-red-600 hover:bg-red-700",children:"Delete"})]})]})]})]})})]},I.id)})})]})})})]}),s.jsx(n1e,{isOpen:h,onClose:()=>f(!1),onDealCreated:D,businesses:n}),s.jsx(a1e,{isOpen:m,onClose:()=>{g(!1),j(null)},onDealUpdated:M,deal:w}),s.jsx(i1e,{isOpen:y,onClose:()=>{b(!1),S(null)},deal:N})]})},l1e=({activeTab:t,showAdminTab:e,showMembershipTab:r,onTabChange:n})=>{const{userType:a,userTypeLoading:i}=ts(),o=a==="residential",c=[{value:"businesses",label:"My Businesses",
995icon:up,show:!o},{value:"jobs",label:"Jobs",icon:Ll,show:!o},{value:"deals",label:"Deals",icon:Io,show:!o},{value:"advertising",label:"Advertising",icon:qV,show:!o},{value:"membership",label:"Membership",icon:Ii,show:r},{value:"ribbon-cutting",label:"Ribbon Cutting",icon:zl,show:!o},{value:"events",label:"Events",icon:Br,show:!0},{value:"blog",label:"Blog",icon:ti,show:!0},{value:"profile",label:"Profile",icon:Yy,show:!0},{value:"admin",label:"Admin",icon:JV,show:e}].filter(d=>d.show),u=c.find(d=>d.value===t)??c[0];return i?s.jsx("div",{className:"flex h-12 w-full items-center justify-start rounded-lg bg-muted p-1 text-muted-foreground",children:s.jsxs("div",{className:"animate-pulse flex gap-2 w-full",children:[s.jsx("div",{className:"h-8 w-20 bg-muted-foreground/20 rounded flex-shrink-0"}),s.jsx("div",{className:"h-8 w-24 bg-muted-foreground/20 rounded flex-shrink-0"}),s.jsx("div",{className:"h-8 w-16 bg-muted-foreground/20 rounded flex-shrink-0"})]})}):s.jsxs(s.Fragment,{children:[s.jsx(Qs,{className:xt("hidden md:inline-flex w-full max-w-full h-11 p-1.5","overflow-x-auto overflow-y-hidden flex-nowrap","gap-0.5"),children:c.map(d=>{const h=d.icon;return s.jsxs(Gt,{value:d.value,onClick:()=>n(d.value),className:xt("flex items-center gap-1.5 shrink-0","px-3 py-2 text-sm","data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm"),"data-state":t===d.value?"active":void 0,children:[s.jsx(h,{className:"h-4 w-4 shrink-0"}),s.jsx("span",{className:"whitespace-nowrap",children:d.label})]},d.value)})}),s.jsx("div",{className:"md:hidden w-full",children:s.jsxs(tb,{children:[s.jsx(rb,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:xt("w-full justify-between h-11 px-4 text-left font-medium","bg-muted/50 hover:bg-muted"),children:[s.jsx("span",{className:"flex items-center gap-2 truncate",children:u&&s.jsxs(s.Fragment,{children:[s.jsx(u.icon,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),s.jsx("span",{className:"truncate",children:u.label})]})}),s.jsx(fd,{className:"h-4 w-4 shrink-0 opacity-50"})]})}),s.jsx(Ix,{align:"start",className:"w-[var(--radix-dropdown-menu-trigger-width)] max-w-[min(100vw-2rem,320px)]",children:c.map(d=>{const h=d.icon,f=t===d.value;return s.jsxs(Gn,{onClick:()=>n(d.value),className:xt("flex items-center gap-2 cursor-pointer",f&&"bg-accent font-medium"),children:[s.jsx(h,{className:"h-4 w-4 shrink-0"}),s.jsx("span",{children:d.label})]},d.value)})})]})})]})},c1e=()=>{const t=ks(),e=Wi(),[r]=Td(),n=e.pathname,{userType:a,userTypeLoading:i}=ts(),o=()=>{const d=r.get("tab");return d&&["inbox","businesses","jobs","deals","advertising","ribbon-cutting","membership","profile","blog","events","admin"].includes(d)?d==="membership"&&a==="business"?"businesses":a==="residential"&&["businesses","advertising","jobs","deals"].includes(d)?"profile":d:n.includes("/admin")?"admin":n==="/dashboard/inbox"?"inbox":n==="/dashboard/businesses"?a==="residential"?(t("/dashboard/profile"),"profile"):"businesses":n==="/dashboard/advertising"?a==="residential"?(t("/dashboard/profile"),"profile"):"advertising":n==="/dashboard/jobs"?a==="residential"?(t("/dashboard/profile"),"profile"):"jobs":n==="/dashboard/deals"?a==="residential"?(t("/dashboard/profile"),"profile"):"deals":n==="/dashboard/membership"?a==="business"?(t("/dashboard/businesses"),"businesses"):"membership":n==="/dashboard/profile"?"profile":n==="/dashboard/blog"?"blog":n==="/dashboard/events"?"events":a==="residential"?"membership":"businesses"},[l,c]=x.useState(o());return x.useEffect(()=>{i||c(o())},[n,a,i]),{activeTab:l,handleTabChange:d=>{if(!(d==="membership"&&a==="business")&&!(a==="residential"&&(d==="businesses"||d==="advertising"||d==="jobs"||d==="deals")))switch(c(d),d){case"inbox":t("/dashboard/inbox");break;case"businesses":t("/dashboard/businesses");break;case"advertising":t("/dashboard/advertising");break;case"jobs":t("/dashboard/jobs");break;case"deals":t("/dashboard/deals");break;case"membership":t("/dashboard/membership");break;case"profile":t("/dashboard/profile");break;case"blog":t("/dashboard/blog");break;case"events":t("/dashboard/events");break;case"admin":t("/dashboard/admin/dashboard");break;default:t(a==="residential"?"/dashboard/membership":"/dashboard/businesses")}}}},Sc=()=>{var f;const{activeTab:t,handleTabChange:e}=c1e(),{isAdmin:r,isLoading:n}=bP(),{userType:a,userTypeLoading:i,user:o,userName:l,avatarUrl:c}=ts(),u=a!=="business",d=a==="residential";if(n||i)return s.jsx("div",{className:"flex items-center justify-center min-h-screen",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"}),s.jsx("p",{className:"text-muted-foreground",children:"Loading dashboard..."})]})});const h=()=>l?l.split(" ").map(m=>m[0]).join("").toUpperCase():o!=null&&o.email?o.email[0].toUpperCase():"";return s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs("div",{className:"mb-8",children:[s.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Dashboard"}),s.jsx("p",{className:"text-gray-600",children:"Welcome back!"}),s.jsxs("div",{className:"mt-3 flex md:hidden items-center gap-3",children:[s.jsxs(om,{className:"h-9 w-9",children:[s.jsx(ux,{src:c||void 0,alt:l||(o==null?void 0:o.email)||"User"}),s.jsx(ep,{children:h()||s.jsx(ma,{size:16})})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-medium text-gray-900 truncate",children:l||((f=o==null?void 0:o.email)==null?void 0:f.split("@")[0])}),s.jsx("p",{className:"text-xs text-gray-500 truncate",children:o==null?void 0:o.email})]})]})]}),s.jsxs(sn,{value:t,onValueChange:e,className:"space-y-6",children:[s.jsx(l1e,{activeTab:t,showAdminTab:r,showMembershipTab:u,onTabChange:e}),s.jsx(Rt,{value:"inbox",className:"space-y-6",children:s.jsx(Lve,{})}),!d&&s.jsx(Rt,{value:"businesses",className:"space-y-6",children:s.jsx(ave,{})}),!d&&s.jsx(Rt,{value:"jobs",className:"space-y-6",children:s.jsx(e1e,{})}),!d&&s.jsx(Rt,{value:"deals",className:"space-y-6",children:s.jsx(o1e,{})}),s.jsx(Rt,{value:"profile",className:"space-y-6",children:t==="profile"?s.jsx(Cve,{}):null}),s.jsx(Rt,{value:"events",className:"space-y-6",children:s.jsx(Vve,{})}),s.jsx(Rt,{value:"blog",className:"space-y-6",children:s.jsx(Gve,{})}),!d&&s.jsx(Rt,{value:"advertising",className:"space-y-6",children:s.jsx(Kve,{})}),!d&&s.jsx(Rt,{value:"ribbon-cutting",className:"space-y-6",children:s.jsx(Jve,{})}),u&&s.jsx(Rt,{value:"membership",className:"space-y-6",children:s.jsx(Q8,{})}),s.jsx(Rt,{value:"admin",className:"space-y-0 px-0",children:s.jsx(mP,{})})]})]})})},u1e=()=>{const{userType:t,isLoading:e,userTypeLoading:r,membershipStatus:n,residentialApprovalStatus:a}=ts(),i=a==="approved",o=n==="active";return e||r?s.jsx("div",{className:"flex items-center justify-center min-h-screen",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"}),s.jsx("p",{className:"text-muted-foreground",children:"Loading..."})]})}):t==="residential"?i||o?s.jsx(Tf,{to:"/dashboard/inbox",replace:!0}):s.jsx(Tf,{to:"/dashboard/membership",replace:!0}):s.jsx(Tf,{to:"/dashboard/businesses",replace:!0})},d1e=()=>{const t=Wi();return x.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]),s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),s.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),s.jsx(rt,{to:"/",className:"text-blue-500 hover:text-blue-700 underline",children:"Return to Home"})]})})};var bp="NavigationMenu",[o_,e9,h1e]=op(bp),[xS,m1e,f1e]=op(bp),[l_]=li(bp,[h1e,f1e]),[p1e,Zl]=l_(bp),[g1e,x1e]=l_(bp),t9=x.forwardRef((t,e)=>{const{__scopeNavigationMenu:r,value:n,onValueChange:a,defaultValue:i,delayDuration:o=200,skipDelayDuration:l=300,orientation:c="horizontal",dir:u,...d}
vendor: 6,765 bytes, line 995
995=t,[h,f]=x.useState(null),m=Cr(e,A=>f(A)),g=hm(u),y=x.useRef(0),b=x.useRef(0),w=x.useRef(0),[j,N]=x.useState(!0),[S,E]=Lo({prop:n,onChange:A=>{const R=A!=="",M=l>0;R?(window.clearTimeout(w.current),M&&N(!1)):(window.clearTimeout(w.current),w.current=window.setTimeout(()=>N(!0),l)),a==null||a(A)},defaultProp:i??"",caller:bp}),C=x.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>E(""),150)},[E]),T=x.useCallback(A=>{window.clearTimeout(b.current),E(A)},[E]),D=x.useCallback(A=>{S===A?window.clearTimeout(b.current):y.current=window.setTimeout(()=>{window.clearTimeout(b.current),E(A)},o)},[S,E,o]);return x.useEffect(()=>()=>{window.clearTimeout(y.current),window.clearTimeout(b.current),window.clearTimeout(w.current)},[]),s.jsx(r9,{scope:r,isRootMenu:!0,value:S,dir:g,orientation:c,rootNavigationMenu:h,onTriggerEnter:A=>{window.clearTimeout(y.current),j?D(A):T(A)},onTriggerLeave:()=>{window.clearTimeout(y.current),C()},onContentEnter:()=>window.clearTimeout(b.current),onContentLeave:C,onItemSelect:A=>{E(R=>R===A?"":A)},onItemDismiss:()=>E(""),children:s.jsx(Zt.nav,{"aria-label":"Main","data-orientation":c,dir:g,...d,ref:m})})});t9.displayName=bp;var yS="NavigationMenuSub",y1e=x.forwardRef((t,e)=>{const{__scopeNavigationMenu:r,value:n,onValueChange:a,defaultValue:i,orientation:o="horizontal",...l}=t,c=Zl(yS,r),[u,d]=Lo({prop:n,onChange:a,defaultProp:i??"",caller:yS});return s.jsx(r9,{scope:r,isRootMenu:!1,value:u,dir:c.dir,orientation:o,rootNavigationMenu:c.rootNavigationMenu,onTriggerEnter:h=>d(h),onItemSelect:h=>d(h),onItemDismiss:()=>d(""),children:s.jsx(Zt.div,{"data-orientation":o,...l,ref:e})})});y1e.displayName=yS;var r9=t=>{const{scope:e,isRootMenu:r,rootNavigationMenu:n,dir:a,orientation:i,children:o,value:l,onItemSelect:c,onItemDismiss:u,onTriggerEnter:d,onTriggerLeave:h,onContentEnter:f,onContentLeave:m}=t,[g,y]=x.useState(null),[b,w]=x.useState(new Map),[j,N]=x.useState(null);return s.jsx(p1e,{scope:e,isRootMenu:r,rootNavigationMenu:n,value:l,previousValue:Mx(l),baseId:hl(),dir:a,orientation:i,viewport:g,onViewportChange:y,indicatorTrack:j,onIndicatorTrackChange:N,onTriggerEnter:Zs(d),onTriggerLeave:Zs(h),onContentEnter:Zs(f),onContentLeave:Zs(m),onItemSelect:Zs(c),onItemDismiss:Zs(u),onViewportContentChange:x.useCallback((S,E)=>{w(C=>(C.set(S,E),new Map(C)))},[]),onViewportContentRemove:x.useCallback(S=>{w(E=>E.has(S)?(E.delete(S),new Map(E)):E)},[]),children:s.jsx(o_.Provider,{scope:e,children:s.jsx(g1e,{scope:e,items:b,children:o})})})},s9="NavigationMenuList",n9=x.forwardRef((t,e)=>{const{__scopeNavigationMenu:r,...n}=t,a=Zl(s9,r),i=s.jsx(Zt.ul,{"data-orientation":a.orientation,...n,ref:e});return s.jsx(Zt.div,{style:{position:"relative"},ref:a.onIndicatorTrackChange,children:s.jsx(o_.Slot,{scope:r,children:a.isRootMenu?s.jsx(f9,{asChild:!0,children:i}):i})})});n9.displayName=s9;var a9="NavigationMenuItem",[b1e,i9]=l_(a9),o9=x.forwardRef((t,e)=>{const{__scopeNavigationMenu:r,value:n,...a}=t,i=hl(),o=n||i||"LEGACY_REACT_AUTO_VALUE",l=x.useRef(null),c=x.useRef(null),u=x.useRef(null),d=x.useRef(()=>{}),h=x.useRef(!1),f=x.useCallback((g="start")=>{if(l.current){d.current();const y=vS(l.current);y.length&&d_(g==="start"?y:y.reverse())}},[]),m=x.useCallback(()=>{if(l.current){const g=vS(l.current);g.length&&(d.current=C1e(g))}},[]);return s.jsx(b1e,{scope:r,value:o,triggerRef:c,contentRef:l,focusProxyRef:u,wasEscapeCloseRef:h,onEntryKeyDown:f,onFocusProxyEnter:f,onRootContentClose:m,onContentFocusOutside:m,children:s.jsx(Zt.li,{...a,ref:e})})});o9.displayName=a9;var bS="NavigationMenuTrigger",l9=x.forwardRef((t,e)=>{const{__scopeNavigationMenu:r,disabled:n,...a}=t,i=Zl(bS,t.__scopeNavigationMenu),o=i9(bS,t.__scopeNavigationMenu),l=x.useRef(null),c=Cr(l,o.triggerRef,e),u=g9(i.baseId,o.value),d=x9(i.baseId,o.value),h=x.useRef(!1),f=x.useRef(!1),m=o.value===i.value;return s.jsxs(s.Fragment,{children:[s.jsx(o_.ItemSlot,{scope:r,value:o.value,children:s.jsx(p9,{asChild:!0,children:s.jsx(Zt.button,{id:u,disabled:n,"data-disabled":n?"":void 0,"data-state":h_(m),"aria-expanded":m,"aria-controls":d,...a,ref:c,onPointerEnter:gt(t.onPointerEnter,()=>{f.current=!1,o.wasEscapeCloseRef.current=!1}),onPointerMove:gt(t.onPointerMove,z1(()=>{n||f.current||o.wasEscapeCloseRef.current||h.current||(i.onTriggerEnter(o.value),h.current=!0)})),onPointerLeave:gt(t.onPointerLeave,z1(()=>{n||(i.onTriggerLeave(),h.current=!1)})),onClick:gt(t.onClick,()=>{i.onItemSelect(o.value),f.current=m}),onKeyDown:gt(t.onKeyDown,g=>{const b={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];m&&g.key===b&&(o.onEntryKeyDown(),g.preventDefault())})})})}),m&&s.jsxs(s.Fragment,{children:[s.jsx(AM,{"aria-hidden":!0,tabIndex:0,ref:o.focusProxyRef,onFocus:g=>{const y=o.contentRef.current,b=g.relatedTarget,w=b===l.current,j=y==null?void 0:y.contains(b);(w||!j)&&o.onFocusProxyEnter(w?"start":"end")}}),i.viewport&&s.jsx("span",{"aria-owns":d})]})]})});l9.displayName=bS;var v1e="NavigationMenuLink",c3="navigationMenu.linkSelect",c9=x.forwardRef((t,e)=>{const{__scopeNavigationMenu:r,active:n,onSelect:a,...i}=t;return s.jsx(p9,{asChild:!0,children:s.jsx(Zt.a,{"data-active":n?"":void 0,"aria-current":n?"page":void 0,...i,ref:e,onClick:gt(t.onClick,o=>{const l=o.target,c=new CustomEvent(c3,{bubbles:!0,cancelable:!0});if(l.addEventListener(c3,u=>a==null?void 0:a(u),{once:!0}),Ky(l,c),!c.defaultPrevented&&!o.metaKey){const u=new CustomEvent(Yv,{bubbles:!0,cancelable:!0});Ky(l,u)}},{checkForDefaultPrevented:!1})})})});c9.displayName=v1e;var c_="NavigationMenuIndicator",u9=x.forwardRef((t,e)=>{const{forceMount:r,...n}=t,a=Zl(c_,t.__scopeNavigationMenu),i=!!a.value;return a.indicatorTrack?cw.createPortal(s.jsx(fa,{present:r||i,children:s.jsx(w1e,{...n,ref:e})}),a.indicatorTrack):null});u9.displayName=c_;var w1e=x.forwardRef((t,e)=>{const{__scopeNavigationMenu:r,...n}=t,a=Zl(c_,r),i=e9(r),[o,l]=x.useState(null),[c,u]=x.useState(null),d=a.orientation==="horizontal",h=!!a.value;x.useEffect(()=>{var y;const g=(y=i().find(b=>b.value===a.value))==null?void 0:y.ref.current;g&&l(g)},[i,a.value]);const f=()=>{o&&u({size:d?o.offsetWidth:o.offsetHeight,offset:d?o.offsetLeft:o.offsetTop})};return wS(o,f),wS(a.indicatorTrack,f),c?s.jsx(Zt.div,{"aria-hidden":!0,"data-state":h?"visible":"hidden","data-orientation":a.orientation,...n,ref:e,style:{position:"absolute",...d?{left:0,width:c.size+"px",transform:`translateX(${c.offset}px)`}:{top:0,height:c.size+"px",transform:`translateY(${c.offset}px)`},...n.style}}):null}),dx="NavigationMenuContent",d9=x.forwardRef((t,e)=>{const{forceMount:r,...n}=t,a=Zl(dx,t.__scopeNavigationMenu),i=i9(dx,t.__scopeNavigationMenu),o=Cr(i.contentRef,e),l=i.value===a.value,c={value:i.value,triggerRef:i.triggerRef,focu
995sProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...n};return a.viewport?s.jsx(j1e,{forceMount:r,...c,ref:o}):s.jsx(fa,{present:r||l,children:s.jsx(h9,{"data-state":h_(l),...c,ref:o,onPointerEnter:gt(t.onPointerEnter,a.onContentEnter),onPointerLeave:gt(t.onPointerLeave,z1(a.onContentLeave)),style:{pointerEvents:!l&&a.isRootMenu?"none":void 0,...c.style}})})});d9.displayName=dx;var j1e=x.forwardRef((t,e)=>{const r=Zl(dx,t.__scopeNavigationMenu),{onViewportContentChange:n,onViewportContentRemove:a}=r;return En(()=>{n(t.value,{ref:e,...t})},[t,e,n]),En(()=>()=>a(t.value),[t.value,a]),null}),Yv="navigationMenu.rootContentDismiss",h9=x.forwardRef((t,e)=>{const{__scopeNavigationMenu:r,value:n,triggerRef:a,focusProxyRef:i,wasEscapeCloseRef:o,onRootContentClose:l,onContentFocusOutside:c,...u}=t,d=Zl(dx,r),h=x.useRef(null),f=Cr(h,e),m=g9(d.baseId,n),g=x9(d.baseId,n),y=e9(r),b=x.useRef(null),{onItemDismiss:w}=d;x.useEffect(()=>{const N=h.current;if(d.isRootMenu&&N){const S=()=>{var E;w(),l(),N.contains(document.activeElement)&&((E=a.current)==null||E.focus())};return N.addEventListener(Yv,S),()=>N.removeEventListener(Yv,S)}},[d.isRootMenu,t.value,a,w,l]);const j=x.useMemo(()=>{const S=y().map(R=>R.value);d.dir==="rtl"&&S.reverse();const E=S.indexOf(d.value),C=S.indexOf(d.previousValue),T=n===d.value,D=C===S.indexOf(n);if(!T&&!D)return b.current;const A=(()=>{if(E!==C){if(T&&C!==-1)return E>C?"from-end":"from-start";if(D&&E!==-1)return E>C?"to-start":"to-end"}return null})();return b.current=A,A},[d.previousValue,d.value,d.dir,y,n]);return s.jsx(f9,{asChild:!0,children:s.jsx(lp,{id:g,"aria-labelledby":m,"data-motion":j,"data-orientation":d.orientation,...u,ref:f,disableOutsidePointerEvents:!1,onDismiss:()=>{var S;const N=new Event(Yv,{bubbles:!0,cancelable:!0});(S=h.current)==null||S.dispatchEvent(N)},onFocusOutside:gt(t.onFocusOutside,N=>{var E;c();const S=N.target;(E=d.rootNavigationMenu)!=null&&E.contains(S)&&N.preventDefault()}),onPointerDownOutside:gt(t.onPointerDownOutside,N=>{var T;const S=N.target,E=y().some(D=>{var A;return(A=D.ref.current)==null?void 0:A.contains(S)}),C=d.isRootMenu&&((T=d.viewport)==null?void 0:T.contains(S));(E||C||!d.isRootMenu)&&N.preventDefault()}),onKeyDown:gt(t.onKeyDown,N=>{var C;const S=N.altKey||N.ctrlKey||N.metaKey;if(N.key==="Tab"&&!S){const T=vS(N.currentTarget),D=document.activeElement,A=T.findIndex(P=>P===D),M=N.shiftKey?T.slice(0,A).reverse():T.slice(A+1,T.length);d_(M)?N.preventDefault():(C=i.current)==null||C.focus()}}),onEscapeKeyDown:gt(t.onEscapeKeyDown,N=>{o.current=!0})})})}),u_="NavigationMenuViewport",m9=x.forwardRef((t,e)=>{const{forceMount:r,...n}=t,i=!!Zl(u_,t.__scopeNavigationMenu).value;return s.jsx(fa,{present:r||i,children:s.jsx(N1e,{...n,ref:e})})});m9.displayName=u_;var N1e=x.forwardRef((t,e)=>{const{__scopeNavigationMenu:r,children:n,...a}=t,i=Zl(u_,r),o=Cr(e,i.onViewportChange),l=x1e(dx,t.__scopeNavigationMenu),[c,u]=x.useState(null),[d,h]=x.useState(null),f=c?(c==null?void 0:c.width)+"px":void 0,m=c?(c==null?void 0:c.height)+"px":void 0,g=!!i.value,y=g?i.value:i.previousValue;return wS(d,()=>{d&&u({width:d.offsetWidth,height:d.offsetHeight})}),s.jsx(Zt.div,{"data-state":h_(g),"data-orientation":i.orientation,...a,ref:o,style:{pointerEvents:!g&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":f,"--radix-navigation-menu-viewport-height":m,...a.style},onPointerEnter:gt(t.onPointerEnter,i.onContentEnter),onPointerLeave:gt(t.onPointerLeave,z1(i.onContentLeave)),children:Array.from(l.items).map(([w,{ref:j,forceMount:N,...S}])=>{const E=y===w;return s.jsx(fa,{present:N||E,children:s.jsx(h9,{...S,ref:vx(j,C=>{E&&C&&h(C)})})},w)})})}),F1e="FocusGroup",f9=x.forwardRef((t,e)=>{const{__scopeNavigationMenu:r,...n}=t,a=Zl(F1e,r);return s.jsx(xS.Provider,{scope:r,children:s.jsx(xS.Slot,{scope:r,children:s.jsx(Zt.div,{dir:a.dir,...n,ref:e})})})}),u3=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],S1e="FocusGroupItem",p9=x.forwardRef((t,e)=>{const{__scopeNavigationMenu:r,...n}=t,a=m1e(r),i=Zl(S1e,r);return s.jsx(xS.ItemSlot,{scope:r,children:s.jsx(Zt.button,{...n,ref:e,onKeyDown:gt(t.onKeyDown,o=>{if(["Home","End",...u3].includes(o.key)){let c=a().map(h=>h.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(o.key)&&c.reverse(),u3.includes(o.key)){const h=c.indexOf(o.currentTarget);c=c.slice(h+1)}setTimeout(()=>d_(c)),o.preventDefault()}})})})});function vS(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function d_(t){const e=document.activeElement;return t.some(r=>r===e?!0:(r.focus(),document.activeElement!==e))}
995function C1e(t){return t.forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}),()=>{t.forEach(e=>{const r=e.dataset.tabindex;e.setAttribute("tabindex",r)})}}function wS(t,e){const r=Zs(e);En(()=>{let n=0;if(t){const a=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return a.observe(t),()=>{window.cancelAnimationFrame(n),a.unobserve(t)}}},[t,r])}function h_(t){return t?"open":"closed"}function g9(t,e){return`${t}-trigger-${e}`}function x9(t,e){return`${t}-content-${e}`}function z1(t){return e=>e.pointerType==="mouse"?t(e):void 0}var y9=t9,b9=n9,k1e=o9,v9=l9,_1e=c9,w9=u9,j9=d9,N9=m9;const F9=x.forwardRef(({className:t,children:e,...r},n)=>s.jsxs(y9,{ref:n,className:xt("relative z-10 flex max-w-max flex-1 items-center justify-center",t),...r,children:[e,s.jsx(k9,{})]}));F9.displayName=y9.displayName;const S9=x.forwardRef(({className:t,...e},r)=>s.jsx(b9,{ref:r,className:xt("group flex flex-1 list-none items-center justify-center space-x-1",t),...e}));S9.displayName=b9.displayName;const nb=k1e,C9=cp("group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),ab=x.forwardRef(({className:t,children:e,...r},n)=>s.jsxs(v9,{ref:n,className:xt(C9(),"group",t),...r,children:[e," ",s.jsx(fd,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));ab.displayName=v9.displayName;const ib=x.forwardRef(({className:t,...e},r)=>s.jsx(j9,{ref:r,className:xt("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto ",t),...e}));ib.displayName=j9.displayName;const Ra=_1e,k9=x.forwardRef(({className:t,...e},r)=>s.jsx("div",{className:xt("absolute left-0 top-full flex justify-center"),children:s.jsx(N9,{className:xt("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",t),ref:r,...e})}));k9.displayName=N9.displayName;const E1e=x.forwardRef(({className:t,...e},r)=>s.jsx(w9,{ref:r,className:xt("top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",t),...e,children:s.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));E1e.displayName=w9.displayName;const A1e=()=>s.jsxs(nb,{children:[s.jsx(ab,{children:"About"}),s.jsx(ib,{children:s.jsxs("div",{className:"w-[800px] flex p-4",children:[s.jsxs("div",{className:"w-1/3",children:[s.jsx("div",{className:"font-medium mb-2 text-sm",children:"Our Chamber"}),s.jsxs("ul",{className:"space-y-2",children:[s.jsx("li",{children:s.jsx(Ra,{asChild:!0,children:s.jsx(rt,{to:"/about",className:"text-sm text-muted-foreground hover:text-foreground block",children:"About Us"})})}),s.jsx("li",{children:s.jsx(Ra,{asChild:!0,children:s.jsx(rt,{to:"/about/committees",className:"text-sm text-muted-foreground hover:text-foreground block",children:"Committees"})})}),s.jsx("li",{children:s.jsx(Ra,{asChild:!0,children:s.jsx(rt,{to:"/scholarships",className:"text-sm text-muted-foreground hover:text-foreground block",children:"Scholarships"})})}),s.jsx("li",{children:s.jsx(Ra,{asChild:!0,children:s.jsx(rt,{to:"/newsletter",className:"text-sm text-muted-foreground hover:text-foreground block",children:"Newsletter"})})})]})]}),s.jsxs("div",{className:"w-1/3",children:[s.jsx("div",{className:"font-medium mb-2 text-sm",children:"Members"}),s.jsxs("ul",{className:"space-y-2",children:[s.jsx("li",{children:s.jsx(Ra,{asChild:!0,children:s.jsx(rt,{to:"/about/board",className:"text-sm text-muted-foreground hover:text-foreground block",children:"Board Of Directors"})})}),s.jsx("li",{children:s.jsx(Ra,{asChild:!0,children:s.jsx(rt,{to:"/businesses/insider-deals",className:"text-sm text-muted-foreground hover:text-foreground block",children:"Insider Deals"})})}),s.jsx("li",{children:s.jsx(Ra,{asChild:!0,children:s.jsx(rt,{to:"/membership/benefits",className:"text-sm text-muted-foreground hover:text-foreground block",children:"Member Benefits"})})}),s.jsx("li",{children:s.jsx(Ra,{asChild:!0,children:s.jsx(rt,{to:"/residential",className:"text-sm text-muted-foreground hover:text-foreground block",children:"Residents Directory"})})})]})]}),s.jsxs("div",{className:"w-1/3",children:[s.jsx("div",{className:"font-medium mb-2 text-sm",children:"Links"}),s.jsxs("ul",{className:"space-y-2",children:[s.jsx("li",{children:s.jsx("a",{href:"https://www.vsvny.org/",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-muted-foreground hover:text-foreground block",children:"Village Of Valley Stream"})}),s.jsx("li",{children:s.jsx("a",{href:"https://www.nassaucountychamber.org/",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-muted-foreground hover:text-foreground block",children:"Nassau County Chamber Of Commerce"})}),s.jsx("li",{children:s.jsx("a",{href:"https://www.suffolkcountychamber.com/",target:"_blank",rel:"noopener noreferrer",className:"text-sm text-muted-foreground hover:text-foreground block",children:"Suffolk County Chamber Of Commerce"})})]})]})]})})]}),D1e=()=>{const{isAuthenticated:t}=ts(),{isResidential:e}=KC(),r=ks(),n=a=>
995{if(a.preventDefault(),document.querySelector("[data-radix-navigation-menu-viewport]")){const o=document.body,l=new MouseEvent("click",{bubbles:!0,cancelable:!0});setTimeout(()=>{o.dispatchEvent(l)},100)}t?r("/dashboard/advertising"):r("/auth/login",{state:{from:{pathname:"/dashboard/advertising"}}})};return s.jsxs(nb,{children:[s.jsx(ab,{children:"Businesses"}),s.jsx(ib,{children:s.jsxs("ul",{className:"grid gap-3 p-4 w-[400px] md:w-[500px] lg:w-[600px]",children:[s.jsx("li",{className:"row-span-3",children:s.jsx(Ra,{asChild:!0,children:s.jsxs(rt,{className:"flex h-full w-full select-none flex-col justify-end rounded-md bg-gradient-to-b from-chamber-blue/50 to-chamber-blue p-6 no-underline outline-none focus:shadow-md",to:"/businesses",children:[s.jsx("div",{className:"mt-4 mb-2 text-lg font-medium text-white",children:"Business Directory"}),s.jsx("p",{className:"text-sm leading-tight text-white/90",children:"Explore our comprehensive directory of local businesses and chamber members."})]})})}),s.jsx("li",{children:s.jsx(Ra,{asChild:!0,children:s.jsxs("button",{onClick:n,className:"w-full text-left block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",children:[s.jsx("div",{className:"text-sm font-medium leading-none",children:"Advertise"}),s.jsx("p",{className:"line-clamp-2 text-sm leading-snug text-muted-foreground",children:"Promote your business to our chamber members and the community."})]})})}),!e&&s.jsx("li",{children:s.jsx(Ra,{asChild:!0,children:s.jsxs(rt,{to:"/businesses/ribbon-cutting",className:"block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",children:[s.jsx("div",{className:"text-sm font-medium leading-none",children:"Ribbon Cutting Request"}),s.jsx("p",{className:"line-clamp-2 text-sm leading-snug text-muted-foreground",children:"Schedule a ribbon cutting ceremony for your new business."})]})})}),!e&&s.jsx("li",{children:s.jsx(Ra,{asChild:!0,children:s.jsxs(rt,{to:"/news/tutorials",className:"block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",children:[s.jsx("div",{className:"text-sm font-medium leading-none",children:"Tutorials"}),s.jsx("p",{className:"line-clamp-2 text-sm leading-snug text-muted-foreground",children:"Step-by-step guides and tutorials to help you get started."})]})})})]})})]})},T1e=()=>s.jsxs(nb,{children:[s.jsx(ab,{children:"Events"}),s.jsx(ib,{children:s.jsxs("ul",{className:"grid gap-3 p-4 md:w-[400px] lg:w-[500px]",children:[s.jsx("li",{className:"row-span-3",children:s.jsx(Ra,{asChild:!0,children:s.jsxs(rt,{className:"flex h-full w-full select-none flex-col justify-end rounded-md bg-gradient-to-b from-chamber-blue/50 to-chamber-blue p-6 no-underline outline-none focus:shadow-md",to:"/events",children:[s.jsx("div",{className:"mt-4 mb-2 text-lg font-medium text-white",children:"All Upcoming Events"}),s.jsx("p",{className:"text-sm leading-tight text-white/90",children:"Browse all upcoming networking events, workshops, and community gatherings."})]})})}),s.jsx("li",{children:s.jsx(Ra,{asChild:!0,children:s.jsxs(rt,{to:"/events/submit",className:"block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",children:[s.jsx("div",{className:"text-sm font-medium leading-none",children:"Submit Public Event"}),s.jsx("p",{className:"line-clamp-2 text-sm leading-snug text-muted-foreground",children:"Submit your event to be featured in our community calendar."})]})})}),s.jsx("li",{children:s.jsx(Ra,{asChild:!0,children:s.jsxs(rt,{to:"/events?tab=past",className:"block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",children:[s.jsx("div",{className:"text-sm font-medium leading-none",children:"Past Events"}),s.jsx("p",{className:"line-clamp-2 text-sm leading-snug text-muted-foreground",children:"View photos and highlights from our previous events."})]})})})]})})]}),M1e=()=>s.jsxs(nb,{children:[s.jsx(ab,{children:"News"}),s.jsx(ib,{children:s.jsxs("ul",{className:"grid gap-3 p-4 md:w-[400px] lg:w-[500px]",children:[s.jsx("li",{children:s.jsx(Ra,{asChild:!0,children:s.jsxs(rt,{to:"/news/whats-new",className:"block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",children:[s.jsx("div",{className:"text-sm font-medium leading-none",children:"What's New"}),s.jsx("p",{className:"line-clamp-2 text-sm leading-snug text-muted-foreground",children:"Latest updates and announcements from the chamber."})]})})}),s.jsx("li",{children:s.jsx(Ra,{asChild:!0,children:s.jsxs(rt,{to:"/news/blog",className:"block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",children:[s.jsx("div",{className:"text-sm font-medium leading-none",children:"Blog"}),s.jsx("p",{className:"line-clamp-2 text-sm leading-snug text-muted-foreground",children:"Articles, insights, and stories from our community."})]})})}),s.jsx("li",{children:s.jsx(Ra,{asChild:!0,children:s.jsxs(rt,{to:"/news/jobs",className:"block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground",children:[s.jsx("div",{className:"text-sm font-medium leading-none",children:"Job Listings"}),s.jsx("p",{className:"line-clamp-2 text-sm leading-snug text-muted-foreground",children:"Browse available positions from chamber member businesses."})]})})})]})})]}),P1e=()=>s.jsx(nb,{children:s.jsx(Ra,{asChild:!0,className:C9(),children:s.jsx(rt,{to:"/contact",children:"Contact"})})}),R1e=()=>s.jsx(F9,{className:"hidden md:block",children:s.jsxs(S9,{children:[s.jsx(A1e,{}),s.jsx(D1e,{}),s.jsx(T1e,{}),s.jsx(M1e,{}),s.jsx(P1e,{})]})}),B1e=()=>{var N,S;const[t,e]=x.useState(!1),[r,n]=x.useState(null),a=ks(),{toast:i}=St(),{user:o,isAuthenticated:l,signOut:c,userName:u,avatarUrl:d}=ts(),{isResidential:h}=KC(),{siteSettings:f}=mp(),m=()=>{e(!1),n(null)},g=E=>{n(C=>C===E?null:E)},y=()=>{m(),l?a("/dashboard/advertising"):a("/auth/login",{state:{from:{pathname:"/dashboard/advertising"}}})},b=()=>{e(!t)},w=async()=>{await c(),i({title:"Logged out",description:"You have been successfully logged out."}),a("/")},j=()=>u?u.split(" ").map(C=>C[0]).join("").toUpperCase():o!=null&&o.email?o.email[0].toUpperCase():"";return s.jsxs("nav",{className:"bg-white shadow-sm",children:[s.jsx("div",{className:"container-wrapper",children:s.jsxs("div",{className:"flex items-center justify-between h-16",children:[s.jsx("div",{className:"flex-shrink-0",children:s.jsxs(rt,{to:"/",className:"flex items-center",children:[s.jsx("span",{className:"hidden md:block font-bold text-lg sm:text-xl md:text-2xl lg:text-3xl text-chamber-blue max-w-[230px] sm:max-w-none truncate sm:truncate-none",children:(f==null?void 0:f.site_title)||"Valley Stream Chamber"}),s.jsxs("div",{className:"md:hidden flex flex-col",children:[s.jsx("span",{className:"font-bold text-lg text-chamber-blue",children:(f==null?void 0:f.city_name)||"Valley Stream"}),s.jsx("span",{className:"font-bold text-sm text-chamber-blue",children:"Chamber Of Commerce"})]})]})}),s.jsx(R1e,{}),s.jsx("div",{className:"hidden md:flex items-center space-x-3",children:l?s.jsxs(tb,{children:[s.jsx(rb,{asChild:!0,children:s.jsxs(Y,{variant:"outline",className:"flex items-center gap-2 px-2",children:[s.jsxs(om,{className:"h-7 w-7",children:[s.jsx(ux,{src:d||void 0,alt:u||(o==null?void 0:o.email)||"User"}),s.jsx(ep,{children:j()||s.jsx(ma,{size:16})})]}),s.jsx("span",{className:"ml-2",children:u||((N=o==null?void 0:o.email)==null?void 0:N.split("@")[0])})]})}
995),s.jsxs(Ix,{align:"end",children:[s.jsx(L8,{children:"My Account"}),s.jsx(pd,{}),s.jsx(Gn,{asChild:!0,children:s.jsx(rt,{to:"/dashboard",className:"w-full",children:"Dashboard"})}),s.jsx(Gn,{asChild:!0,children:s.jsx(rt,{to:"/dashboard/profile",className:"w-full",children:"Profile"})}),s.jsx(pd,{}),s.jsxs(Gn,{onClick:w,className:"text-red-500 flex items-center gap-2",children:[s.jsx(xC,{size:16}),"Sign out"]})]})]}):s.jsxs(s.Fragment,{children:[s.jsx(rt,{to:"/auth/login",children:s.jsx(Y,{variant:"outline",children:"Log In"})}),s.jsx(rt,{to:"/auth/signup",children:s.jsx(Y,{className:"bg-chamber-blue hover:bg-chamber-blue-dark",children:"Sign Up"})})]})}),s.jsx("div",{className:"flex md:hidden",children:s.jsx("button",{onClick:b,className:"inline-flex items-center justify-center p-2 rounded-md text-gray-700 hover:text-chamber-blue focus:outline-none",children:t?s.jsx(Ir,{size:24}):s.jsx(n6,{size:24})})})]})}),t&&s.jsxs("div",{className:"md:hidden bg-white border-t max-h-[calc(100vh-4rem)] overflow-y-auto",children:[s.jsxs("div",{className:"px-2 pt-2 pb-3 space-y-0 sm:px-3",children:[l&&s.jsx("div",{className:"px-3 py-3 mb-1 rounded-md bg-gray-50 border border-gray-100",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs(om,{className:"h-9 w-9",children:[s.jsx(ux,{src:d||void 0,alt:u||(o==null?void 0:o.email)||"User"}),s.jsx(ep,{children:j()||s.jsx(ma,{size:16})})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-medium text-gray-900 truncate",children:u||((S=o==null?void 0:o.email)==null?void 0:S.split("@")[0])}),s.jsx("p",{className:"text-xs text-gray-500 truncate",children:o==null?void 0:o.email})]})]})}),s.jsxs("div",{className:"border-b border-gray-100",children:[s.jsxs("button",{type:"button",onClick:()=>g("about"),className:"flex w-full items-center justify-between px-3 py-3 rounded-md text-base font-medium text-gray-700 hover:text-chamber-blue hover:bg-gray-50",children:[s.jsx("span",{children:"About"}),r==="about"?s.jsx(fd,{className:"h-5 w-5 shrink-0"}):s.jsx(Ih,{className:"h-5 w-5 shrink-0"})]}),r==="about"&&s.jsxs("div",{className:"pb-2 pl-3 pr-2 space-y-0.5",children:[s.jsx(rt,{to:"/about",className:"block py-2 pl-2 rounded-md text-sm font-medium text-gray-600 hover:text-chamber-blue hover:bg-gray-50",onClick:m,children:"About Us"}),s.jsx(rt,{to:"/about/committees",className:"block py-2 pl-2 rounded-md text-sm font-medium text-gray-600 hover:text-chamber-blue hover:bg-gray-50",onClick:m,children:"Committees"}),s.jsx(rt,{to:"/scholarships",className:"block py-2 pl-2 rounded-md text-sm font-medium text-gray-600 hover:text-chamber-blue hover:bg-gray-50",onClick:m,children:"Scholarships"}),s.jsx(rt,{to:"/newsletter",className:"block py-2 pl-2 rounded-md text-sm font-medium text-gray-600 hover:text-chamber-blue hover:bg-gray-50",onClick:m,children:"Newsletter"}),s.jsx(rt,{to:"/about/board",className:"block py-2 pl-2 rounded-md text-sm font-medium text-gray-600 hover:text-chamber-blue hover:bg-gray-50",onClick:m,children:"Board Of Directors"}),s.jsx(rt,{to:"/businesses/insider-deals",className:"block py-2 pl-2 rounded-md text-sm font-medium text-gray-600 hover:text-chamber-blue hover:bg-gray-50",onClick:m,children:"Insider Deals"}),s.jsx(rt,{to:"/membership/benefits",className:"block py-2 pl-2 rounded-md text-sm font-medium text-gray-600 hover:text-chamber-blue hover:bg-gray-50",onClick:m,children:"Member Benefits"}),s.jsx(rt,{to:"/residential",className:"block py-2 pl-2 rounded-md text-sm font-medium text-gray-600 hover:text-chamber-blue hover:bg-gray-50",onClick:m,children:"Residents Directory"}),s.jsx("a",{href:"https://www.vsvny.org/",target:"_blank",rel:"noopener noreferrer",className:"block py-2 pl-2 rounded-md text-sm font-medium text-gray-600 hover:text-chamber-blue hover:bg-gray-50",onClick:m,children:"Village Of Valley Stream"}),s.jsx("a",{href:"https://www.nassaucountychamber.org/",target:"_blank",rel:"noopener noreferrer",className:"block py-2 pl-2 rounded-md text-sm font-medium text-gray-600 hover:text-chamber-blue hover:bg-gray-50",onClick:m,children:"Nassau County Chamber Of Commerce"}),s.jsx("a",{href:"https://www.suffolkcountychamber.com/",target:"_blank",rel:"noopener noreferrer",className:"block py-2 pl-2 rounded-md text-sm font-medium text-gray-600 hover:text-chamber-blue hover:bg-gray-50",onClick:m,children:"Suffolk County Chamber Of Commerce"})]})]}),s.jsxs("div",{className:"border-b border-gray-100",children:[s.jsxs("button",{type:"button",onClick:()=>g("businesses"),className:"flex w-full items-center justify-between px-3 py-3 rounded-md text-base font-medium text-gray-700 hover:text-chamber-blue hover:bg-gray-50",children:[s.jsx("span",{children:"Businesses"}),r==="businesses"?s.jsx(fd,{className:"h-5 w-5 shrink-0"}):s.jsx(Ih,{className:"h-5 w-5 shrink-0"})]}
995),r==="businesses"&&s.jsxs("div",{className:"pb-2 pl-3 pr-2 space-y-0.5",children:[s.jsx(rt,{to:"/businesses",className:"block py-2 pl-2 rounded-md text-sm font-medium text-gray-600 hover:text-chamber-blue hover:bg-gray-50",onClick:m,children:"Business Directory"}),s.jsx("button",{type:"button",onClick:y,className:"block w-full text-left py-2 pl-2 rounded-md text-sm font-medium text-gray-600 hover:text-chamber-blue hover:bg-gray-50",children:"Advertise"}),!h&&s.jsxs(s.Fragment,{children:[s.jsx(rt,{to:"/businesses/ribbon-cutting",className:"block py-2 pl-2 rounded-md text-sm font-medium text-gray-600 hover:text-chamber-blue hover:bg-gray-50",onClick:m,children:"Ribbon Cutting Request"}),s.jsx(rt,{to:"/news/tutorials",className:"block py-2 pl-2 rounded-md text-sm font-medium text-gray-600 hover:text-chamber-blue hover:bg-gray-50",onClick:m,children:"Tutorials"})]})]})]}),s.jsxs("div",{className:"border-b border-gray-100",children:[s.jsxs("button",{type:"button",onClick:()=>g("events"),className:"flex w-full items-center justify-between px-3 py-3 rounded-md text-base font-medium text-gray-700 hover:text-chamber-blue hover:bg-gray-50",children:[s.jsx("span",{children:"Events"}),r==="events"?s.jsx(fd,{className:"h-5 w-5 shrink-0"}):s.jsx(Ih,{className:"h-5 w-5 shrink-0"})]}),r==="events"&&s.jsxs("div",{className:"pb-2 pl-3 pr-2 space-y-0.5",children:[s.jsx(rt,{to:"/events",className:"block py-2 pl-2 rounded-md text-sm font-medium text-gray-600 hover:text-chamber-blue hover:bg-gray-50",onClick:m,children:"All Upcoming Events"}),s.jsx(rt,{to:"/events/submit",className:"block py-2 pl-2 rounded-md text-sm font-medium text-gray-600 hover:text-chamber-blue hover:bg-gray-50",onClick:m,children:"Submit Public Event"}),s.jsx(rt,{to:"/events?tab=past",className:"block py-2 pl-2 rounded-md text-sm font-medium text-gray-600 hover:text-chamber-blue hover:bg-gray-50",onClick:m,children:"Past Events"})]})]}),s.jsxs("div",{className:"border-b border-gray-100",children:[s.jsxs("button",{type:"button",onClick:()=>g("news"),className:"flex w-full items-center justify-between px-3 py-3 rounded-md text-base font-medium text-gray-700 hover:text-chamber-blue hover:bg-gray-50",children:[s.jsx("span",{children:"News"}),r==="news"?s.jsx(fd,{className:"h-5 w-5 shrink-0"}):s.jsx(Ih,{className:"h-5 w-5 shrink-0"})]}),r==="news"&&s.jsxs("div",{className:"pb-2 pl-3 pr-2 space-y-0.5",children:[s.jsx(rt,{to:"/news/whats-new",className:"block py-2 pl-2 rounded-md text-sm font-medium text-gray-600 hover:text-chamber-blue hover:bg-gray-50",onClick:m,children:"What's New"}),s.jsx(rt,{to:"/news/blog",className:"block py-2 pl-2 rounded-md text-sm font-medium text-gray-600 hover:text-chamber-blue hover:bg-gray-50",onClick:m,children:"Blog"}),s.jsx(rt,{to:"/news/jobs",className:"block py-2 pl-2 rounded-md text-sm font-medium text-gray-600 hover:text-chamber-blue hover:bg-gray-50",onClick:m,children:"Job Listings"})]})]}),s.jsx("div",{className:"border-b border-gray-100",children:s.jsx(rt,{to:"/contact",className:"block px-3 py-3 rounded-md text-base font-medium text-gray-700 hover:text-chamber-blue hover:bg-gray-50",onClick:m,children:"Contact"})})]}),s.jsx("div",{className:"pt-4 pb-3 border-t border-gray-200",children:s.jsx("div",{className:"px-4 py-2 space-y-2",children:l?s.jsxs(s.Fragment,{children:[s.jsx(rt,{to:"/dashboard",className:"block w-full text-center px-4 py-2 border border-transparent rounded-md shadow-sm text-base font-medium text-white bg-chamber-blue hover:bg-chamber-blue-dark",onClick:m,children:"Dashboard"}),s.jsx("button",{onClick:()=>{w(),m()},className:"block w-full text-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-base font-medium text-red-600 bg-white hover:bg-gray-50",children:"Sign Out"})]}):s.jsxs(s.Fragment,{children:[s.jsx(rt,{to:"/auth/login",className:"block w-full text-center px-4 py-2 border border-transparent rounded-md shadow-sm text-base font-medium text-white bg-chamber-blue hover:bg-chamber-blue-dark",onClick:m,children:"Log In"}),s.jsx(rt,{to:"/auth/signup",className:"block w-full text-center px-4 py-2 border border-gray-300 rounded-md shadow-sm text-base font-medium text-gray-700 bg-white hover:bg-gray-50",onClick:m,children:"Sign Up"})]})})})]})]})},L1e=()=>{const{siteSettings:t,isLoading:e}=mp();return e||!(t!=null&&t.maintenance_mode)?null:s.jsx("div",{className:"bg-yellow-500 text-black py-2 px-4 relative z-50",children:s.jsx("div",{className:"container-wrapper",children:s.jsxs("div",{className:"flex items-center justify-center space-x-2 text-sm font-medium",children:[s.jsx(yd,{size:16,className:"flex-shrink-0"}),s.jsx("span",{className:"text-center",children:"ð§ Website is currently in maintenance mode - Some features may be temporarily unavailable"})]})})})},I1e=()=>{const{user:t}
995=ts(),[e,r]=x.useState(null),[n,a]=x.useState(!0),[i,o]=x.useState(!0);if(x.useEffect(()=>{(async()=>{if(!t){o(!1);return}try{const h=new Date().getFullYear(),f=new Date,{data:m,error:g}=await Q.from("business_profiles").select("id, business_name, outside_payment_expiration_year, status").eq("owner_id",t.id).eq("is_outside_payment",!0).not("outside_payment_expiration_year","is",null);if(g){console.error("Error checking outside payment status:",g),o(!1);return}const y=m==null?void 0:m.filter(b=>{if(!b.outside_payment_expiration_year)return!1;const w=b.outside_payment_expiration_year,j=new Date(w+1,0,1),N=new Date(w+1,1,1);return f>=j&&f<N});y&&y.length>0&&r(y[0])}catch(h){console.error("Unexpected error checking outside payment status:",h)}finally{o(!1)}})()},[t]),i||!e||!n)return null;new Date().getFullYear();const l=e.outside_payment_expiration_year,c=new Date(l+1,1,1),u=Math.ceil((c.getTime()-new Date().getTime())/(1e3*60*60*24));return s.jsx("div",{className:"bg-orange-500 text-white py-3 px-4 relative z-50",children:s.jsx("div",{className:"container-wrapper",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(yd,{size:20,className:"flex-shrink-0"}),s.jsxs("div",{className:"text-sm",children:[s.jsx("p",{className:"font-medium",children:"â ï¸ Outside Payment Status Expiring"}),s.jsxs("p",{className:"text-orange-100",children:['Your business "',s.jsx("strong",{children:e.business_name}),'" has an expired outside payment status (expired: ',l,"). It will be automatically deactivated in ",s.jsxs("strong",{children:[u," days"]})," if not renewed."]})]})]}),s.jsx("button",{onClick:()=>a(!1),className:"text-white hover:text-orange-200 transition-colors p-1","aria-label":"Dismiss warning",children:s.jsx(Ir,{size:18})})]})})})},O1e=({size:t=20,className:e=""})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,fill:"currentColor",className:`bi bi-tiktok ${e}`,viewBox:"0 0 16 16",children:s.jsx("path",{d:"M9 0h1.98c.144.715.54 1.617 1.235 2.512C12.895 3.389 13.797 4 15 4v2c-1.753 0-3.07-.814-4-1.829V11a5 5 0 1 1-5-5v2a3 3 0 1 0 3 3z"})}),z1e=()=>{var a;const t=new Date().getFullYear(),{siteSettings:e,socialSettings:r,isLoading:n}=mp();return s.jsx("footer",{className:"bg-gray-900 text-white",children:s.jsxs("div",{className:"container-wrapper py-12",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-8",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"About Us"}),s.jsxs("p",{className:"text-gray-300 text-sm mb-4",children:[(e==null?void 0:e.site_title)||"Valley Stream Chamber of Commerce"," connects businesses with customers and provides resources to help local businesses grow and thrive."]}),s.jsxs("div",{className:"flex space-x-4",children:[(r==null?void 0:r.facebook_url)&&s.jsx("a",{href:r.facebook_url,target:"_blank",rel:"noopener noreferrer",className:"text-gray-300 hover:text-white",children:s.jsx(fw,{size:20})}),(r==null?void 0:r.twitter_url)&&s.jsx("a",{href:r.twitter_url,target:"_blank",rel:"noopener noreferrer",className:"text-gray-300 hover:text-white",children:s.jsx(gw,{size:20})}),(r==null?void 0:r.instagram_url)&&s.jsx("a",{href:r.instagram_url,target:"_blank",rel:"noopener noreferrer",className:"text-gray-300 hover:text-white",children:s.jsx(fC,{size:20})}),(r==null?void 0:r.linkedin_url)&&s.jsx("a",{href:r.linkedin_url,target:"_blank",rel:"noopener noreferrer",className:"text-gray-300 hover:text-white",children:s.jsx(pC,{size:20})}),(r==null?void 0:r.youtube_url)&&s.jsx("a",{href:r.youtube_url,target:"_blank",rel:"noopener noreferrer",className:"text-gray-300 hover:text-white",children:s.jsx(rK,{size:20})}),(r==null?void 0:r.tiktok_url)&&s.jsx("a",{href:r.tiktok_url,target:"_blank",rel:"noopener noreferrer",className:"text-gray-300 hover:text-white",children:s.jsx(O1e,{size:20})})]})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Quick Links"}),s.jsxs("ul",{className:"space-y-2 text-sm",children:[s.jsx("li",{children:s.jsx(rt,{to:"/",className:"text-gray-300 hover:text-white transition-colors",children:"Home"})}),s.jsx("li",{children:s.jsx(rt,{to:"/businesses",className:"text-gray-300 hover:text-white transition-colors",children:"Business Directory"})}),s.jsx("li",{children:s.jsx(rt,{to:"/about",className:"text-gray-300 hover:text-white transition-colors",children:"About Us"})}),s.jsx("li",{children:s.jsx(rt,{to:"/contact",className:"text-gray-300 hover:text-white transition-colors",children:"Contact"})})]})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Member Resources"}),s.jsxs("ul",{className:"space-y-2 text-sm",children:[s.jsx("li",{children:s.jsx(rt,{to:"/auth/login",className:"text-gray-300 hover:text-white transition-colors",children:"Member Login"})}),s.jsx("li",{children:s.jsx(rt,{to:"/auth/signup",className:"text-gray-300 hover:text-white transition-colors",children:"Join the Chamber"})}),s.jsx("li",{children:s.jsx(rt,{to:"/dashboard",className:"text-gray-300 hover:text-white transition-colors",children:"Member Dashboard"})}),s.jsx("li",{children:s.jsx(rt,{to:"/events",className:"text-gray-300 hover:text-white transition-colors",children:"Events Calendar"})})]})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Contact Us"}),s.jsxs("address",{className:"text-gray-300 text-sm not-italic",children:[s.jsx("p",{children:(e==null?void 0:e.address_line1)||"123 Main Street"}),(e==null?void 0:e.address_line2)&&s.jsx("p",{children:e.address_line2}),s.jsxs("p",{children:[(e==null?void 0:e.city)||"Anytown",", ",(e==null?void 0:e.state)||"USA"," ",(e==null?void 0:e.zip_code)||"12345"]}),s.jsx("p",{className:"mt-2",children:s.jsx("a",{href:`tel:${((a=e==null?void 0:e.contact_phone)==null?void 0:a.replace(/\D/g,""))||"+15551234567"}`,className:"hover:text-white transition-colors",children:(e==null?void 0:e.contact_phone)||"(555) 123-4567"})}),s.jsx("p",{children:s.jsxs("a",{href:`mailto:${(e==null?void 0:e.contact_email)||"info@Valley Stream.chamber"}`,className:"hover:text-white transition-colors flex items-center mt-2",children:[s.jsx(fs,{size:16,className:"mr-2"})," ",(e==null?void 0:e.contact_email)||"info@Valley Stream.chamber"]})})]})]})]}),s.jsxs("div",{className:"border-t border-gray-800 mt-8 pt-6 flex flex-col md:flex-row justify-between items-center",children:[s.jsxs("p",{className:"text-sm text-gray-400",children:["© ",t," ",(e==null?void 0:e.site_title)||"Valley Stream Chamber of Commerce",". All rights reserved."]}),s.jsxs("div",{className:"mt-4 md:mt-0 flex space-x-4 text-xs text-gray-400",children:[s.jsx(rt,{to:"/privacy",className:"hover:text-white transition-colors",children:"Privacy Policy"}),s.jsx(rt,{to:"/terms",className:"hover:text-white transition-colors",children:"Terms of Use"})]})]})]})})},U1e=()=>{const{pathname:t}=Wi();return x.useEffect(()=>{window.scrollTo(0,0)},[t]),null},H1e=()=>{const t=Wi();return x.useEffect(()=>{const e=t.pathname+t.search;setTimeout(()=>{qC(e,document.title)},100)},[t]),null},ij=({post:t,urlPrefix:e,sectionTitle:r})=>{const[n,a]=x.useState(!1),i=c=>Dw(c,{addSuffix:!0}),o=()=>{a(!0)},l=!t.image||!t.image.trim()||n;return s.jsxs("section",{className:"mb-12",children:[s.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-6",children:r}),s.jsx(De,{className:"overflow-hidden hover:shadow-lg transition-shadow",children:s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2",children:[s.jsxs("div",{className:"relative h-64 md:h-auto",children:[l?s.jsx("div",{className:"w-full h-full bg-gray-100 flex items-center justify-center",children:s.jsx("img",{src:"/placeholder.svg",alt:"No image available",className:"w-20 h-20 opacity-50"})}):s.jsx("img",{src:t.image,alt:t.title,className:"w-full h-full object-cover",onError:o}),s.jsx("div",{className:"absolute top-4 left-4",children:s.jsx("span",{className:"bg-chamber-blue text-white px-4 py-1 rounded-full text-sm font-medium",children:"Featured"})})]}),s.jsxs("div",{className:"p-6 flex flex-col justify-between",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center text-sm text-gray-500 mb-3",children:[s.jsx(Br,{size:16,className:"mr-2"}),s.jsx("span",{children:i(t.publishedAt)})]}),s.jsx("h3",{className:"text-2xl font-bold mb-3",children:t.title}),s.jsx("p",{className:"text-gray-600 mb-4",children:t.excerpt}),s.jsx("div",{className:"flex flex-wrap gap-2 mb-4",children:t.categories.map((c,u)=>s.jsxs("span",{className:"inline-flex items-center text-xs bg-gray-100 px-2 py-1 rounded",children:[s.jsx(ji,{size:12,className:"mr-1"})," ",c]},u))})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:t.author}),s.jsx("p",{className:"text-sm text-gray-500",children:t.authorTitle})]}),s.jsx(rt,{to:`${e}/${t.id}`,children:s.jsxs(Y,{className:"bg-chamber-blue hover:bg-chamber-blue-dark",children:["Read More ",s.jsx(ul,{size:16,className:"ml-1"})]})})]})]})]})})]})},$1e=({post:t,urlPrefix:e})=>{const[r,n]=x.useState(!1),a=()=>{n(!0)},i=!t.image||!t.image.trim()||r;return s.jsx(rt,{to:`${e}/${t.id}`,children:s.jsxs(De,{className:"overflow-hidden hover:shadow-md transition-shadow h-full flex flex-col",children:[s.jsx("div",{className:"relative h-48",children:i?s.jsx("div",{className:"w-full h-full bg-gray-100 flex items-center justify-center",children:s.jsx("img",{src:"/placeholder.svg",alt:"No image available",className:"w-16 h-16 opacity-50"})}):s.jsx("img",{src:t.image,alt:t.title,className:"w-full h-full object-cover",onError:a})}),s.jsxs(Be,{className:"p-5 flex-grow flex flex-col",children:[s.jsxs("div",{className:"flex items-center text-sm text-gray-500 mb-2",children:[s.jsx(Br,{size:14,className:"mr-1"}),s.jsx("span",{children:Dw(t.publishedAt,{addSuffix:!0})})]}),s.jsx("h3",{className:"font-semibold text-lg mb-2 line-clamp-2",children:t.title}),s.jsx("p",{className:"text-gray-600 line-clamp-3 mb-3",children:t.excerpt}),t.categories&&t.categories.length>0&&s.jsx("div",{className:"flex gap-2 mt-auto flex-wrap",children:t.categories.map((o,l)=>s.jsx(ke,{variant:"outline",className:"bg-gray-100 text-gray-700",children:o},l))}),s.jsxs("div",{className:"mt-4 text-sm text-gray-600",children:["By ",t.author]})]})]})})},oj=({posts:t,urlPrefix:e,sectionTitle:r})=>s.jsxs("section",{children:[s.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-6",children:r}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:t.map(n=>s.jsx($1e,{post:n,urlPrefix:e},n.id))})]}),ob=({currentPage:t,totalPages:e,onPageChange:r})=>s.jsx("div",{className:"mt-12",children:s.jsx(Pd,{children:s.jsxs(Rd,{children:[s.jsx(Qr,{children:s.jsx(Bd,{onClick:()=>t>1&&r(t-1),className:t===1?"pointer-events-none opacity-50":"cursor-pointer"})}),Array.from({length:e},(n,a)=>s.jsx(Qr,{children:s.jsx(ca,{isActive:t===a+1,onClick:()=>r(a+1),className:"cursor-pointer",children:a+1})},a)),s.jsx(Qr,{children:s.jsx(Ld,{onClick:()=>t<e&&r(t+1),className:t===e?"pointer-events-none opacity-50":"cursor-pointer"})})]})})}),W1e=()=>{const[t,e]=x.useState([]),[r,n]=x.useState(!0),[a,i]=x.useState(null),{toast:o}=St(),[l,c]=x.useState(1),u=6;x.useEffect(()=>{d()},[]);const d=async()=>{n(!0),i(null);try{const S=(await Pc("published")).filter(E=>{var C;return(C=E.categories)==null?void 0:C.includes("Blog")}).map(nj);e(S),S.length===0&&i("No published blog posts found")}catch(j){console.error("Error loading blog posts:",j),i("Failed to load blog posts"),o({title:"Error",description:"Failed to load blog posts",variant:"destructive"})}finally{n(!1)}},h=t.find(j=>j.featured)||(t.length>0?t[0]:null),f=h?t.filter(j=>j.id!==h.id).sort((j,N)=>N.publishedAt.getTime()-j.publishedAt.getTime()):[],m=Math.ceil(f.length/u),g=l*u,y=g-u,b=f.slice(y,g),w=j=>{c(j),window.scrollTo(0,0)};return s.jsx("div",{className:"bg-gray-50 min-h-screen",children:s.jsxs("div",{className:"container-wrapper py-12",children:[s.jsxs("header",{className:"mb-6 text-center",children:[s.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Chamber Blog"}),s.jsx("p",{className:"text-xl text-gray-600 max-w-2xl mx-auto",children:"Insights, tips, and stories from our local business community and chamber leadership"})]}),r?s.jsxs("div",{className:"flex justify-center items-center py-12",children:[s.jsx(Mt,{className:"h-12 w-12 animate-spin text-chamber-blue"}),s.jsx("span",{className:"ml-2 text-xl",children:"Loading blog posts..."})]}):a&&t.length===0?s.jsx("div",{className:"text-center py-12",children:s.jsx("p",{className:"text-lg text-gray-600 mb-6",children:"No blog posts found. Import some mock data to get started!"})}):s.jsxs(s.Fragment,{children:[h&&s.jsx(ij,{post:h,urlPrefix:"/news/blog",sectionTitle:"Featured Article"}),b.length>0&&s.jsx(oj,{posts:b,urlPrefix:"/news/blog",sectionTitle:"Latest Articles"}),m>1&&s.jsx(ob,{currentPage:l,totalPages:m,onPageChange:w})]})]})})},d3=()=>{const{id:t}=Dd(),{toast:e}
995=St(),[r,n]=x.useState(null),[a,i]=x.useState(!0),[o,l]=x.useState(null);x.useEffect(()=>{(async()=>{if(!t){l("No post ID provided"),i(!1);return}i(!0);try{const d=await sb(t);d?n(d):l("Post not found")}catch(d){console.error("Error fetching blog post:",d),l("Failed to load blog post"),e({title:"Error",description:"Failed to load blog post",variant:"destructive"})}finally{i(!1)}})()},[t,e]);const c=u=>{const h=u.split(/\s+/).length;return`${Math.ceil(h/200)} min read`};return a?s.jsxs("div",{className:"container-wrapper py-12 text-center",children:[s.jsx(Mt,{className:"h-12 w-12 animate-spin mx-auto mb-4"}),s.jsx("p",{children:"Loading blog post..."})]}):!r||o?s.jsxs("div",{className:"container-wrapper py-12 text-center",children:[s.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Blog post not found"}),s.jsx("p",{className:"mb-6",children:o||"The blog post you're looking for doesn't exist."}),s.jsx(rt,{to:"/news/blog",children:s.jsx(Y,{children:"Return to Blog"})})]}):s.jsxs("div",{className:"bg-white min-h-screen",children:[r.featured_image&&s.jsxs("div",{className:"relative h-[400px]",children:[s.jsx("img",{src:r.featured_image,alt:r.title,className:"w-full h-full object-cover"}),s.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-40"})]}),s.jsx("div",{className:"container-wrapper py-12",children:s.jsxs("div",{className:"max-w-4xl mx-auto",children:[s.jsx("div",{className:"mb-6",children:s.jsxs(rt,{to:"/news/blog",className:"text-chamber-blue hover:text-chamber-blue-dark flex items-center",children:[s.jsx(pn,{size:16,className:"mr-1"})," Back to all articles"]})}),s.jsxs("header",{className:"mb-8",children:[s.jsx("div",{className:"flex flex-wrap gap-3 mb-4",children:r.categories&&r.categories.map((u,d)=>s.jsxs("span",{className:"inline-flex items-center text-sm bg-gray-100 px-3 py-1 rounded-full",children:[s.jsx(ji,{size:14,className:"mr-1"})," ",u]},d))}),s.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:r.title}),s.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[s.jsxs("div",{className:"flex items-center",children:[r.author_avatar?s.jsx("img",{src:r.author_avatar,alt:r.author_name||"Author",className:"w-10 h-10 rounded-full mr-3 object-cover"}):s.jsx("div",{className:"w-10 h-10 rounded-full mr-3 bg-gray-300 flex items-center justify-center",children:s.jsx(ma,{size:20,className:"text-gray-600"})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:r.author_name||"Unknown Author"}),s.jsx("p",{className:"text-sm text-gray-500",children:"Chamber member"})]})]}),s.jsxs("div",{className:"flex items-center text-sm text-gray-500",children:[s.jsxs("span",{className:"mr-4",children:[s.jsx(Br,{size:16,className:"inline-block mr-1"}),Cs(new Date(r.publish_date||r.created_at),"MMMM d, yyyy")]}),s.jsx("span",{children:c(r.content)})]})]})]}),s.jsx("div",{className:"prose prose-lg max-w-none mb-12",children:s.jsx(Xw,{remarkPlugins:[Qw],components:{h1:({node:u,...d})=>s.jsx("h1",{className:"text-3xl font-bold mb-6 mt-8",...d}),h2:({node:u,...d})=>s.jsx("h2",{className:"text-2xl font-bold mb-4 mt-6",...d}),h3:({node:u,...d})=>s.jsx("h3",{className:"text-xl font-bold mb-3 mt-5",...d}),h4:({node:u,...d})=>s.jsx("h4",{className:"text-lg font-bold mb-2 mt-4",...d}),h5:({node:u,...d})=>s.jsx("h5",{className:"text-base font-bold mb-2 mt-3",...d}),h6:({node:u,...d})=>s.jsx("h6",{className:"text-sm font-bold mb-2 mt-3",...d}),p:({node:u,...d})=>s.jsx("p",{className:"mb-4 leading-relaxed",...d}),ul:({node:u,...d})=>s.jsx("ul",{className:"list-disc list-inside mb-4 space-y-2",...d}),ol:({node:u,...d})=>s.jsx("ol",{className:"list-decimal list-inside mb-4 space-y-2",...d}),li:({node:u,...d})=>s.jsx("li",{className:"leading-relaxed",...d}),blockquote:({node:u,...d})=>s.jsx("blockquote",{className:"border-l-4 border-chamber-blue pl-4 py-2 mb-4 italic bg-gray-50 rounded-r",...d}),code:({inline:u,...d})=>u?s.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded text-sm font-mono",...d}):s.jsx("code",{className:"block bg-gray-100 p-4 rounded text-sm font-mono overflow-x-auto mb-4",...d}),pre:({node:u,...d})=>s.jsx("pre",{className:"bg-gray-900 text-gray-100 p-4 rounded overflow-x-auto mb-4",...d}),a:({node:u,...d})=>s.jsx("a",{className:"text-chamber-blue hover:text-chamber-blue-dark underline",...d}),table:({node:u,...d})=>s.jsx("div",{className:"overflow-x-auto mb-4",children:s.jsx("table",{className:"min-w-full border border-gray-300",...d})}),th:({node:u,...d})=>s.jsx("th",{className:"border border-gray-300 px-4 py-2 bg-gray-100 font-bold text-left",...d}),td:({node:u,...d})=>s.jsx("td",{className:"border border-gray-300 px-4 py-2",...d}),hr:({node:u,...d})=>s.jsx("hr",{className:"my-8 border-gray-300",...d}),img:({node:u,...d})=>s.jsx("img",{className:"max-w-full h-auto rounded-lg shadow-md mb-4",...d})},children:r.content})}),s.jsxs("div",{className:"border-t border-gray-200 pt-8 mt-8",children:[s.jsx("h2",{className:"text-xl font-bold mb-4",children:"About the Author"}),s.jsxs("div",{className:"flex items-start",children:[r.author_avatar?s.jsx("img",{src:r.author_avatar,alt:r.author_name||"Author",className:"w-16 h-16 rounded-full mr-4 object-cover"}):s.jsx("div",{className:"w-16 h-16 rounded-full mr-4 bg-gray-300 flex items-center justify-center",children:s.jsx(ma,{size:24,className:"text-gray-600"})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-lg",children:r.author_name||"Unknown Author"}),s.jsx("p",{className:"text-sm text-gray-500 mb-2",children:"Chamber member"}),s.jsx("p",{children:"This post was created by a member of our Chamber of Commerce team to keep our community informed and engaged."})]})]})]})]})})]})},q1e=()=>{const[t,e]=x.useState([]),[r,n]=x.useState(!0),[a,i]=x.useState(null),{toast:o}=St(),[l,c]=x.useState(1),u=6;x.useEffect(()=>{d()},[]);const d=async()=>{n(!0),i(null);try{const S=(await Pc("published")).filter(E=>{var C;return(C=E.categories)==null?void 0:C.includes("What's New")}).map(nj);e(S),S.length===0&&i("No published What's New posts found")}catch(j){console.error("Error loading What's New posts:",j),i("Failed to load What's New posts"),o({title:"Error",description:"Failed to load What's New posts",variant:"destructive"})}finally{n(!1)}},h=t.find(j=>j.featured)||(t.length>0?t[0]:null),f=h?t.filter(j=>j.id!==h.id).sort((j,N)=>N.publishedAt.getTime()-j.publishedAt.getTime()):[],m=Math.ceil(f.length/u),g=l*u,y=g-u,b=f.slice(y,g),w=j=>{c(j),window.scrollTo(0,0)};return s.jsx("div",{className:"bg-gray-50 min-h-screen",children:s.jsxs("div",{className:"container-wrapper py-12",children:[s.jsxs("header",{className:"mb-6 text-center",children:[s.jsxs("div",{className:"flex items-center justify-center mb-4",children:[s.jsx(yC,{className:"h-8 w-8 text-chamber-blue mr-3"}),s.jsx("h1",{className:"text-4xl font-bold text-gray-900",children:"What's New"})]}),s.jsx("p",{className:"text-xl text-gray-600 max-w-2xl mx-auto",children:"Stay updated with the latest announcements, initiatives, and developments from our Chamber"})]}),r?s.jsxs("div",{className:"flex justify-center items-center py-12",children:[s.jsx(Mt,{className:"h-12 w-12 animate-spin text-chamber-blue"}),s.jsx("span",{className:"ml-2 text-xl",children:"Loading What's New posts..."})]}):a&&t.length===0?s.jsx("div",{className:"text-center py-12",children:s.jsx("p",{className:"text-lg text-gray-600 mb-6",children:a})}):s.jsxs(s.Fragment,{children:[h&&s.jsx(ij,{post:h,urlPrefix:"/news",sectionTitle:"Featured Announcement"}),b.length>0&&s.jsx(oj,{posts:b,urlPrefix:"/news",sectionTitle:"Latest Updates"}),m>1&&s.jsx(ob,{currentPage:l,totalPages:m,onPageChange:w})]})]})})},G1e=()=>{const[t,e]=x.useState([]),[r,n]=x.useState(!0),[a,i]=x.useState(null),{toast:o}=St(),[l,c]=x.useState(1),u=6;x.useEffect(()=>{d()},[]);const d=async()=>{n(!0),i(null);try{const S=(await Pc("published")).filter(E=>{var C;return(C=E.categories)==null?void 0:C.includes("Latest News")}).map(nj);e(S),S.length===0&&i("No published Latest News posts found")}catch(j){console.error("Error loading Latest News posts:",j),i("Failed to load Latest News posts"),o({title:"Error",description:"Failed to load Latest News posts",variant:"destructive"})}finally{n(!1)}},h=t.find(j=>j.featured)||(t.length>0?t[0]:null),f=h?t.filter(j=>j.id!==h.id).sort((j,N)=>N.publishedAt.getTime()-j.publishedAt.getTime()):[],m=Math.ceil(f.length/u),g=l*u,y=g-u,b=f.slice(y,g),w=j=>{c(j),window.scrollTo({top:0,behavior:"smooth"})};return s.jsx("div",{className:"bg-gray-50 min-h-screen",children:s.jsxs("div",{className:"container-wrapper py-12",children:[s.jsxs("header",{className:"mb-6 text-center",children:[s.jsxs("div",{className:"flex items-center justify-center mb-4",children:[s.jsx(yC,{className:"h-8 w-8 text-chamber-blue mr-3"}),s.jsx("h1",{className:"text-4xl font-bold text-gray-900",children:"Latest News"})]}),s.jsx("p",{className:"text-xl text-gray-600 max-w-2xl mx-auto",children:"Stay informed with the latest news, updates, and stories from our Chamber community"})]}),r?s.jsxs("div",{className:"flex justify-center items-center py-12",children:[s.jsx(Mt,{className:"h-12 w-12 animate-spin text-chamber-blue"}),s.jsx("span",{className:"ml-2 text-xl",children:"Loading Latest News posts..."})]}):a&&t.length===0?s.jsx("div",{className:"text-center py-12",children:s.jsx("p",{className:"text-lg text-gray-600 mb-6",children:a})}):s.jsxs(s.Fragment,{children:[h&&s.jsx(ij,{post:h,urlPrefix:"/news",sectionTitle:"Featured Story"}),b.length>0&&s.jsx(oj,{posts:b,urlPrefix:"/news",sectionTitle:"Latest Stories"}),m>1&&s.jsx(ob,{currentPage:l,totalPages:m,onPageChange:w})]})]})})},V1e=()=>{const{id:t}=Dd(),{toast:e}
995=St(),[r,n]=x.useState(null),[a,i]=x.useState(!0),[o,l]=x.useState(null);x.useEffect(()=>{(async()=>{if(!t){l("No post ID provided"),i(!1);return}i(!0);try{const f=await sb(t);f?n(f):l("Post not found")}catch(f){console.error("Error fetching news post:",f),l("Failed to load news post"),e({title:"Error",description:"Failed to load news post",variant:"destructive"})}finally{i(!1)}})()},[t,e]);const c=h=>{const m=h.split(/\s+/).length;return`${Math.ceil(m/200)} min read`};if(a)return s.jsxs("div",{className:"container-wrapper py-12 text-center",children:[s.jsx(Mt,{className:"h-12 w-12 animate-spin mx-auto mb-4"}),s.jsx("p",{children:"Loading news post..."})]});if(!r||o)return s.jsxs("div",{className:"container-wrapper py-12 text-center",children:[s.jsx("h1",{className:"text-2xl font-bold mb-4",children:"News post not found"}),s.jsx("p",{className:"mb-6",children:o||"The news post you're looking for doesn't exist."}),s.jsx(rt,{to:"/news/whats-new",children:s.jsx(Y,{children:"Return to News"})})]});const u=(r.author_name||"U").charAt(0),d=window.location.href;return s.jsxs("div",{className:"bg-white min-h-screen",children:[r.featured_image&&s.jsxs("div",{className:"relative h-[400px]",children:[s.jsx("img",{src:r.featured_image,alt:r.title,className:"w-full h-full object-cover"}),s.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-40"})]}),s.jsx("div",{className:"container-wrapper py-12",children:s.jsxs("div",{className:"max-w-4xl mx-auto",children:[s.jsx("div",{className:"mb-6",children:s.jsxs(rt,{to:"/news/whats-new",className:"text-chamber-blue hover:text-chamber-blue-dark flex items-center",children:[s.jsx(pn,{size:16,className:"mr-1"})," Back to all news"]})}),s.jsxs("header",{className:"mb-8",children:[s.jsx("div",{className:"flex flex-wrap gap-3 mb-4",children:r.categories&&r.categories.map((h,f)=>s.jsxs("span",{className:"inline-flex items-center text-sm bg-gray-100 px-3 py-1 rounded-full",children:[s.jsx(ji,{size:14,className:"mr-1"})," ",h]},f))}),s.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:r.title}),s.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[s.jsxs("div",{className:"flex items-center",children:[r.author_avatar?s.jsx("img",{src:r.author_avatar,alt:r.author_name||"Author",className:"w-10 h-10 rounded-full mr-3 object-cover"}):s.jsx("div",{className:"w-10 h-10 rounded-full mr-3 bg-gray-300 flex items-center justify-center",children:s.jsx(ma,{size:20,className:"text-gray-600"})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:r.author_name||"Unknown Author"}),s.jsx("p",{className:"text-sm text-gray-500",children:"Chamber member"})]})]}),s.jsxs("div",{className:"flex items-center text-sm text-gray-500",children:[s.jsxs("span",{className:"mr-4",children:[s.jsx(Br,{size:16,className:"inline-block mr-1"}),Cs(new Date(r.publish_date||r.created_at),"MMMM d, yyyy")]}),s.jsx("span",{children:c(r.content)})]})]})]}),s.jsx("div",{className:"prose prose-lg max-w-none mb-8",children:s.jsx(Xw,{remarkPlugins:[Qw],components:{h1:({node:h,...f})=>s.jsx("h1",{className:"text-3xl font-bold mb-6 mt-8",...f}),h2:({node:h,...f})=>s.jsx("h2",{className:"text-2xl font-bold mb-4 mt-6",...f}),h3:({node:h,...f})=>s.jsx("h3",{className:"text-xl font-bold mb-3 mt-5",...f}),h4:({node:h,...f})=>s.jsx("h4",{className:"text-lg font-bold mb-2 mt-4",...f}),h5:({node:h,...f})=>s.jsx("h5",{className:"text-base font-bold mb-2 mt-3",...f}),h6:({node:h,...f})=>s.jsx("h6",{className:"text-sm font-bold mb-2 mt-3",...f}),p:({node:h,...f})=>s.jsx("p",{className:"mb-4 leading-relaxed",...f}),ul:({node:h,...f})=>s.jsx("ul",{className:"list-disc list-inside mb-4 space-y-2",...f}),ol:({node:h,...f})=>s.jsx("ol",{className:"list-decimal list-inside mb-4 space-y-2",...f}),li:({node:h,...f})=>s.jsx("li",{className:"leading-relaxed",...f}),blockquote:({node:h,...f})=>s.jsx("blockquote",{className:"border-l-4 border-chamber-blue pl-4 py-2 mb-4 italic bg-gray-50 rounded-r",...f}),code:({node:h,inline:f,...m})=>f?s.jsx("code",{className:"bg-gray-100 px-2 py-1 rounded text-sm font-mono",...m}):s.jsx("code",{className:"block bg-gray-100 p-4 rounded text-sm font-mono overflow-x-auto mb-4",...m}),pre:({node:h,...f})=>s.jsx("pre",{className:"bg-gray-900 text-gray-100 p-4 rounded overflow-x-auto mb-4",...f}),a:({node:h,...f})=>s.jsx("a",{className:"text-chamber-blue hover:text-chamber-blue-dark underline",...f}),table:({node:h,...f})=>s.jsx("div",{className:"overflow-x-auto mb-4",children:s.jsx("table",{className:"min-w-full border border-gray-300",...f})}),th:({node:h,...f})=>s.jsx("th",{className:"border border-gray-300 px-4 py-2 bg-gray-100 font-bold text-left",...f}),td:({node:h,...f})=>s.jsx("td",{className:"border border-gray-300 px-4 py-2",...f}),hr:({node:h,...f})=>s.jsx("hr",{className:"my-8 border-gray-300",...f}),img:({node:h,...f})=>s.jsx("img",{className:"max-w-full h-auto rounded-lg shadow-md mb-4",...f})},children:r.content})}),s.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg mb-12",children:[s.jsxs("h3",{className:"text-lg font-semibold mb-3 flex items-center",children:[s.jsx(bC,{size:18,className:"mr-2"})," Share this article"]}),s.jsxs("div",{className:"flex space-x-2",children:[s.jsxs(nv,{children:[s.jsx(av,{asChild:!0,children:s.jsx(Y,{variant:"outline",size:"icon",onClick:()=>window.open(`https://www.facebook.com/sharer/sharer.php?u=${d}`,"_blank"),"aria-label":"Share on Facebook",children:s.jsx(fw,{size:18})})}),s.jsx(wy,{children:"Share on Facebook"})]}),s.jsxs(nv,{children:[s.jsx(av,{asChild:!0,children:s.jsx(Y,{variant:"outline",size:"icon",onClick:()=>window.open(`https://twitter.com/intent/tweet?url=${d}&text=${encodeURIComponent(r.title)}`,"_blank"),"aria-label":"Share on Twitter",children:s.jsx(gw,{size:18})})}),s.jsx(wy,{children:"Share on Twitter"})]}),s.jsxs(nv,{children:[s.jsx(av,{asChild:!0,children:s.jsx(Y,{variant:"outline",size:"icon",onClick:()=>window.open(`https://www.linkedin.com/sharing/share-offsite/?url=${d}`,"_blank"),"aria-label":"Share on LinkedIn",children:s.jsx(pC,{size:18})})}),s.jsx(wy,{children:"Share on LinkedIn"})]}),s.jsxs(nv,{children:[s.jsx(av,{asChild:!0,children:s.jsx(Y,{variant:"outline",size:"icon",onClick:()=>window.open(`mailto:?subject=${encodeURIComponent(r.title)}&body=${encodeURIComponent(`Check out this article: ${d}`)}`,"_blank"),"aria-label":"Share via Email",children:s.jsx(fs,{size:18})})}),s.jsx(wy,{children:"Share via Email"})]})]})]}),s.jsxs("div",{className:"border-t border-gray-200 pt-8 mb-12",children:[s.jsx("h2",{className:"text-xl font-bold mb-4",children:"About the Author"}),s.jsxs("div",{className:"flex items-start gap-4",children:[r.author_avatar?s.jsx("img",{src:r.author_avatar,alt:r.author_name||"Author",className:"h-16 w-16 rounded-full object-cover"}):s.jsx(om,{className:"h-16 w-16 bg-chamber-blue text-white",children:s.jsx(ep,{children:u})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-lg",children:r.author_name||"Unknown Author"}),s.jsx("p",{className:"text-sm text-gray-500 mb-2",children:"Chamber member"}),s.jsx("p",{className:"text-gray-700",children:"This post was created by a member of our Chamber of Commerce team to keep our community informed and engaged with the latest news and updates."})]})]})]})]})})]})},K1e=({job:t})=>{const e=(m,g=180)=>m.length<=g?m:m.substring(0,g)+"...",r="business_id"in t||"business_name"in t,n=t.title,a=r?t.business_name:t.company,i=t.location,o=r?t.job_type:t.jobType,l=r?t.salary_range:t.salary,c=t.description,u=t.featured,d=r?new Date(t.created_at):t.postedAt,h=r?t.featured_image||t.business_logo:t.imageUrl,f=r?t.categories||[]:t.categories;return s.jsx(De,{className:`p-4 mb-4 ${u?"border-chamber-gold border-2":""}`,children:s.jsxs("div",{className:"flex flex-col md:flex-row gap-4",children:[s.jsx("div",{className:"w-full md:w-1/4 flex-shrink-0",children:s.jsxs("div",{className:"relative",children:[u&&s.jsx("div",{className:"absolute top-0 right-0 bg-chamber-gold text-white px-2 py-1 text-xs font-semibold rounded-bl z-10",children:"Featured"}),s.jsx("div",{className:"w-full h-[150px] bg-gray-100 rounded-md overflow-hidden",children:h?s.jsx("img",{src:h,alt:`${a} logo`,className:"w-full h-full object-cover"}):s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(ka,{size:48,className:"text-gray-400"})})})]})}),s.jsxs("div",{className:"flex-grow",children:[s.jsxs("div",{className:"flex flex-col md:flex-row justify-between",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:n}),s.jsx("p",{className:"text-gray-700 font-medium",children:a})]}),l&&s.jsx("div",{className:"mt-2 md:mt-0",children:s.jsx("p",{className:"text-chamber-blue font-semibold",children:l})})]}),s.jsxs("div",{className:"flex flex-wrap gap-2 mt-2",children:[s.jsxs("div",{className:"flex items-center text-gray-600 text-sm mr-4",children:[s.jsx(_n,{size:16,className:"mr-1"}),i]}),s.jsxs("div",{className:"flex items-center text-gray-600 text-sm mr-4",children:[s.jsx(rn,{size:16,className:"mr-1"}),o]}),s.jsxs("div",{className:"flex items-center text-gray-600 text-sm",children:[s.jsx(o1,{size:16,className:"mr-1"}),Dw(d,{addSuffix:!0})]})]}),s.jsx("p",{className:"text-gray-600 my-3",children:e(c)}),s.jsx("div",{className:"mt-3 flex flex-wrap gap-2 mb-3",children:f.map((m,g)=>s.jsx(ke,{variant:"outline",className:"bg-chamber-blue-light text-chamber-blue-dark",children:m},g))}),s.jsx("div",{className:"mt-2",children:s.jsx(rt,{to:`/news/jobs/${t.id}`,children:s.jsx(Y,{variant:"outline",children:"View Details"})})})]})]})})},J1e=({searchTerm:t,setSearchTerm:e,selectedJobType:r,setSelectedJobType:n,sortBy:a,setSortBy:i,showMobileFilters:o,setShowMobileFilters:l,showFilters:c,showSearch:u})=>s.jsxs("div",{className:"bg-white shadow-sm rounded-lg p-4",children:[s.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center gap-4",children:[u&&s.jsxs("div",{className:"relative w-full md:w-1/2",children:[s.jsx(Ne,{type:"text",placeholder:"Search jobs by title, company, or keywords...",className:"pl-10",value:t,onChange:d=>e(d.target.value)}),s.jsx("div",{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400",children:s.jsx(Yg,{size:18})})]}),c&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"hidden md:flex items-center space-x-4 flex-grow",children:[s.jsxs(Wt,{value:r,onValueChange:n,children:[s.jsx(Ht,{className:"w-[180px]",children:s.jsx(qt,{placeholder:"Job Type"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"all",children:"All Job Types"}),$5.map(d=>s.jsx(Ae,{value:d,children:d},d))]})]}),s.jsxs(Wt,{value:a,onValueChange:i,children:[s.jsx(Ht,{className:"w-[180px]",children:s.jsx(qt,{placeholder:"Sort By"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"date",children:"Date (Newest)"}),s.jsx(Ae,{value:"company",children:"Company Name"}),s.jsx(Ae,{value:"featured",children:"Featured First"})]})]})]}),s.jsx("div",{className:"md:hidden w-full",children:s.jsxs(Y,{onClick:()=>l(!o),variant:"outline",className:"w-full flex items-center justify-center",children:[s.jsx(Yg,{size:16,className:"mr-2"}),o?"Hide Filters":"Show Filters"]})})]})]}),c&&o&&s.jsxs("div",{className:"md:hidden mt-4 space-y-4",children:[s.jsxs(Wt,{value:r,onValueChange:n,children:[s.jsx(Ht,{className:"w-full",children:s.jsx(qt,{placeholder:"Job Type"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"all",children:"All Job Types"}),$5.map(d=>s.jsx(Ae,{value:d,children:d},d))]})]}),s.jsxs(Wt,{value:a,onValueChange:i,children:[s.jsx(Ht,{className:"w-full",children:s.jsx(qt,{placeholder:"Sort By"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"date",children:"Date (Newest)"}),s.jsx(Ae,{value:"company",children:"Company Name"}),s.jsx(Ae,{value:"featured",children:"Featured First"})]})]})]})]}),Y1e=()=>s.jsxs("div",{className:"bg-gray-50 rounded-lg p-8 text-center",children:[s.jsx("div",{className:"flex justify-center mb-4",children:s.jsx(KV,{size:48,className:"text-gray-400"})}
995),s.jsx("h3",{className:"text-lg font-semibold text-gray-800 mb-2",children:"No jobs found"}),s.jsx("p",{className:"text-gray-600",children:"Try adjusting your search or filter criteria to find job listings."})]}),Z1e=({jobs:t=[],databaseJobs:e=[],limit:r,featuredOnly:n=!1})=>{const[a,i]=x.useState(""),[o,l]=x.useState("all"),[c,u]=x.useState("date"),[d,h]=x.useState(!1),[f,m]=x.useState(1),g=6,y=x.useMemo(()=>e.map(D=>({id:D.id,title:D.title,company:D.business_name,location:D.location,description:D.description,salary:D.salary_range,jobType:D.job_type,postedAt:new Date(D.created_at),featured:D.featured||!1,imageUrl:D.business_logo,categories:[D.job_type]})),[e]),b=x.useMemo(()=>[...y,...t],[y,t]),w=x.useMemo(()=>b.filter(D=>!(n&&!D.featured||a&&!D.title.toLowerCase().includes(a.toLowerCase())&&!D.company.toLowerCase().includes(a.toLowerCase())&&!D.description.toLowerCase().includes(a.toLowerCase())||o&&o!=="all"&&D.jobType!==o)).sort((D,A)=>c==="date"?A.postedAt.getTime()-D.postedAt.getTime():c==="company"?D.company.localeCompare(A.company):c==="featured"?(A.featured?1:0)-(D.featured?1:0):0),[b,a,o,c,n]),j=w.length,N=Math.ceil(j/g),S=f*g,E=S-g,C=w.slice(E,S),T=r?C.slice(0,r):C;return{searchTerm:a,setSearchTerm:i,selectedJobType:o,setSelectedJobType:l,s
995ortBy:c,setSortBy:u,showMobileFilters:d,setShowMobileFilters:h,currentPage:f,setCurrentPage:m,displayedJobs:T,totalPages:N}},X1e=({jobs:t=[],databaseJobs:e=[],showFilters:r=!0,showSearch:n=!0,limit:a,featuredOnly:i=!1})=>{const o=t.length>0||e.length>0,{searchTerm:l,setSearchTerm:c,selectedJobType:u,setSelectedJobType:d,sortBy:h,setSortBy:f,showMobileFilters:m,setShowMobileFilters:g,currentPage:y,setCurrentPage:b,displayedJobs:w,totalPages:j}=Z1e({jobs:t,databaseJobs:e,limit:a,featuredOnly:i}),N=S=>{b(S),window.scrollTo(0,0)};return s.jsxs("div",{className:"space-y-8",children:[(n||r)&&o&&s.jsx(J1e,{searchTerm:l,setSearchTerm:c,selectedJobType:u,setSelectedJobType:d,sortBy:h,setSortBy:f,showMobileFilters:m,setShowMobileFilters:g,showFilters:r,showSearch:n}),w.length>0?s.jsxs("div",{className:"space-y-4",children:[w.map(S=>s.jsx(K1e,{job:S},S.id)),!a&&j>1&&s.jsx(ob,{currentPage:y,totalPages:j,onPageChange:N})]}):s.jsx(Y1e,{})]})},Q1e=()=>{const[t,e]=x.useState([]),[r,n]=x.useState(!0),[a,i]=x.useState(null),o=async()=>{try{n(!0),i(null);const l=await pi.getJobs();e(l)}catch(l){console.error("Error loading jobs:",l),i("Failed to load jobs")}finally{n(!1)}};return x.useEffect(()=>{o()},[]),{jobs:t,loading:r,error:a,refetch:o}},ewe=()=>s.jsxs("div",{className:"text-center py-16 bg-gray-50 rounded-lg border border-gray-200",children:[s.jsx("div",{className:"flex justify-center mb-4",children:s.jsx(zV,{size:48,className:"text-gray-400"})}),s.jsx("h3",{className:"text-xl font-semibold text-gray-700 mb-2",children:"No Job Listings Found"}),s.jsx("p",{className:"text-gray-600 mb-6",children:"There are currently no job listings in the database."}),s.jsx("p",{className:"text-sm text-gray-500",children:"Job listings will appear here once they've been added to the database."})]}),twe=()=>{const{jobs:t,loading:e,error:r,refetch:n}=Q1e();St();const a=t.map(i=>({id:i.id,title:i.title,business_id:i.business_id||"",description:i.description,location:i.location,job_type:i.job_type,salary_range:i.salary_range,is_remote:i.location.toLowerCase().includes("remote"),created_at:i.created_at,expire_date:i.expires_at||"",status:i.status,requirements:i.requirements,application_url:i.application_url,contact_email:i.contact_email,featured_image:i.featured_image,categories:i.categories||[],featured:i.featured,business_name:i.business_name,business_logo:i.business_logo}));return s.jsx("div",{className:"bg-gray-50 min-h-screen",children:s.jsxs("div",{className:"container-wrapper py-12",children:[s.jsxs("header",{className:"mb-12 text-center",children:[s.jsx("div",{className:"inline-flex items-center justify-center p-3 bg-chamber-blue-light text-chamber-blue-dark rounded-full mb-4",children:s.jsx(Ll,{size:24})}),s.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Job Listings"}),s.jsx("p",{className:"text-xl text-gray-600 max-w-2xl mx-auto",children:"Find your next career opportunity with our local businesses"})]}),s.jsx("div",{className:"mt-6",children:e?s.jsx("div",{className:"flex justify-center py-12",children:s.jsx("div",{className:"animate-pulse text-center",children:s.jsx("p",{className:"text-gray-500",children:"Loading job listings..."})})}):r?s.jsxs("div",{className:"text-center py-12",children:[s.jsx("p",{className:"text-red-600 mb-4",children:r}),s.jsx("button",{onClick:n,className:"text-chamber-blue hover:underline",children:"Try again"})]}):a.length>0?s.jsx(X1e,{jobs:[],databaseJobs:a,showFilters:!0,showSearch:!0}):s.jsx(ewe,{})})]})})},rwe=()=>{const{id:t}=Dd(),{toast:e}=St(),[r,n]=x.useState(null),[a,i]=x.useState(!0),[o,l]=x.useState(null);if(x.useEffect(()=>{(async()=>{if(!t){l("No job ID provided"),i(!1);return}i(!0);try{const d=await pi.getJob(t);d?n(d):l("Job not found")}catch(d){console.error("Error fetching job:",d),l("Failed to load job"),e({title:"Error",description:"Failed to load job details",variant:"destructive"})}finally{i(!1)}})()},[t,e]),a)return s.jsxs("div",{className:"container-wrapper py-12 text-center",children:[s.jsx(Mt,{className:"h-12 w-12 animate-spin mx-auto mb-4"}),s.jsx("p",{children:"Loading job details..."})]});if(!r||o)return s.jsx("div",{className:"container-wrapper py-12",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Job Not Found"}),s.jsx("p",{className:"mb-6",children:o||"The job you're looking for doesn't exist or has been removed."}),s.jsx(rt,{to:"/news/jobs",children:s.jsxs(Y,{children:[s.jsx(pn,{className:"mr-2 h-4 w-4"})," Back to Job Listings"]})})]})});const c=u=>u.split("-").map(d=>d.charAt(0).toUpperCase()+d.slice(1)).join(" ");return s.jsx("div",{className:"bg-gray-50 min-h-screen",children:s.jsxs("div",{className:"container-wrapper py-12",children:[s.jsx("div",{className:"mb-6",children:s.jsxs(rt,{to:"/news/jobs",className:"text-chamber-blue hover:underline flex items-center",children:[s.jsx(pn,{className:"mr-2 h-4 w-4"})," Back to Job Listings"]})}),s.jsx("div",{className:"bg-white rounded-lg shadow-sm p-6 mb-8",children:s.jsxs("div",{className:"flex flex-col md:flex-row items-start gap-6",children:[s.jsx("div",{className:"w-full md:w-1/4 lg:w-1/6",children:s.jsx("div",{className:"w-full aspect-square bg-gray-100 rounded-md overflow-hidden",children:r.business_logo?s.jsx("img",{src:r.business_logo,alt:`${r.business_name} logo`,className:"w-full h-full object-cover"}):s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(ka,{size:48,className:"text-gray-400"})})})}),s.jsxs("div",{className:"flex-grow",children:[s.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:r.title}),s.jsx("p",{className:"text-xl text-gray-700 mt-1 mb-3",children:r.business_name}),s.jsxs("div",{className:"flex flex-wrap gap-y-2 gap-x-4 mb-4",children:[s.jsxs("div",{className:"flex items-center text-gray-600",children:[s.jsx(_n,{size:18,className:"mr-1"}),r.location]}),s.jsxs("div",{className:"flex items-center text-gray-600",children:[s.jsx(rn,{size:18,className:"mr-1"}),c(r.job_type)]}),s.jsxs("div",{className:"flex items-center text-gray-600",children:[s.jsx(o1,{size:18,className:"mr-1"}),"Posted ",Cs(new Date(r.created_at),"PPP")]})]}),r.salary_range&&s.jsx("div",{className:"mb-4",children:s.jsx("span",{className:"text-lg font-semibold text-chamber-blue",children:r.salary_range})}),s.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:r.categories&&r.categories.map((u,d)=>s.jsx(ke,{variant:"outline",className:"bg-chamber-blue-light text-chamber-blue-dark",children:u},d))}),s.jsxs("div",{className:"flex flex-wrap gap-3 mt-6",children:[r.application_url&&s.jsx(Y,{asChild:!0,children:s.jsxs("a",{href:r.application_url,target:"_blank",rel:"noopener noreferrer",children:[s.jsx(wx,{className:"mr-2 h-4 w-4"}),"Apply Now"]})}),r.contact_email&&s.jsx(Y,{variant:"outline",asChild:!0,children:s.jsxs("a",{href:`mailto:${r.contact_email}?subject=Application for ${r.title}`,children:[s.jsx(fs,{className:"mr-2 h-4 w-4"}),"Contact"]})})]})]})]})}),s.jsxs("div",{className:"bg-white rounded-lg shadow-sm p-6 mb-8",children:[s.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Job Description"}),s.jsx("div",{className:"prose max-w-none",children:s.jsx("p",{className:"text-gray-700 mb-6 whitespace-pre-wrap",children:r.description})})]}),r.requirements&&s.jsxs("div",{className:"bg-white rounded-lg shadow-sm p-6 mb-8",children:[s.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Requirements"}),s.jsx("div",{className:"prose max-w-none",children:s.jsx("p",{className:"text-gray-700 whitespace-pre-wrap",children:r.requirements})})]}),s.jsx("div",{className:"bg-white rounded-lg shadow-sm p-6",children:s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("span",{className:"text-sm text-gray-600",children:"Status:"}),s.jsx(ke,{variant:r.status==="active"?"default":"secondary",className:r.status==="active"?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800",children:r.status==="active"?"Active":r.status==="inactive"?"Inactive":"Expired"})]}),r.expires_at&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[s.jsx(o1,{size:16}),s.jsxs("span",{children:["Expires: ",Cs(new Date(r.expires_at),"PPP")]})]})]})})]})})},swe=()=>{const[t,e]=x.useState([]),[r,n]=x.useState(!0),[a,i]=x.useState(null),{toast:o}=St(),[l,c]=x.useState(1),u=6;x.useEffect(()=>{d()},[]);const d=async()=>{n(!0),i(null);try{const S=(await Pc("published")).filter(E=>{var C;return(C=E.categories)==null?void 0:C.includes("Tutorial")}).map(nj);e(S),S.length===0&&i("No published tutorial posts found")}catch(j){console.error("Error loading tutorial posts:",j),i("Failed to load tutorial posts"),o({title:"Error",description:"Failed to load tutorial posts",variant:"destructive"})}finally{n(!1)}},h=t.find(j=>j.featured)||(t.length>0?t[0]:null),f=h?t.filter(j=>j.id!==h.id).sort((j,N)=>N.publishedAt.getTime()-j.publishedAt.getTime()):[],m=Math.ceil(f.length/u),g=l*u,y=g-u,b=f.slice(y,g),w=j=>{c(j),window.scrollTo(0,0)};return s.jsx("div",{className:"bg-gray-50 min-h-screen",children:s.jsxs("div",{className:"container-wrapper py-12",children:[s.jsxs("header",{className:"mb-6 text-center",children:[s.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Tutorials"}),s.jsx("p",{className:"text-xl text-gray-600 max-w-2xl mx-auto",children:"Step-by-step guides and tutorials to help you make the most of our platform and services"})]}),r?s.jsxs("div",{className:"flex justify-center items-center py-12",children:[s.jsx(Mt,{className:"h-12 w-12 animate-spin text-chamber-blue"}),s.jsx("span",{className:"ml-2 text-xl",children:"Loading tutorials..."})]}):a&&t.length===0?s.jsx("div",{className:"text-center py-12",children:s.jsx("p",{className:"text-lg text-gray-600 mb-6",children:"No tutorial posts found. Create some tutorials to get started!"})}):s.jsxs(s.Fragment,{children:[h&&s.jsx(ij,{post:h,urlPrefix:"/news/tutorials",sectionTitle:"Featured Tutorial"}),b.length>0&&s.jsx(oj,{posts:b,urlPrefix:"/news/tutorials",sectionTitle:"Latest Tutorials"}),m>1&&s.jsx(ob,{currentPage:l,totalPages:m,onPageChange:w})]})]})})},nwe=Dk({email:sa().email("Please enter a valid email address"),name:sa().optional()}),awe=({className:t=""})=>
995{const[e,r]=x.useState(!1),[n,a]=x.useState(!1),{toast:i}=St(),{register:o,handleSubmit:l,formState:{errors:c},reset:u}=K0({resolver:Ek(nwe)}),d=async h=>{r(!0);try{const{data:f,error:m}=await Q.from("newsletter_subscribers").select("id, status").eq("email",h.email.toLowerCase()).single();if(m&&m.code!=="PGRST116")throw m;if(f){if(f.status==="active"){i({title:"Already Subscribed",description:"You're already subscribed to our newsletter!",variant:"default"}),a(!0);return}else if(f.status==="unsubscribed"){const{error:b}=await Q.from("newsletter_subscribers").update({status:"active",name:h.name||null,unsubscribed_at:null}).eq("id",f.id);if(b)throw b;i({title:"Welcome Back!",description:"You've been resubscribed to our newsletter."}),a(!0),u();return}}const{error:g}=await Q.from("newsletter_subscribers").insert({email:h.email.toLowerCase(),name:h.name||null,status:"active",source:"website"});if(g)throw g;const{error:y}=await Q.functions.invoke("send-welcome-email",{body:{email:h.email,name:h.name||"Subscriber"}});y&&console.warn("Failed to send welcome email:",y),i({title:"Successfully Subscribed!",description:"Welcome to our newsletter! Check your email for a confirmation."}),a(!0),u()}catch(f){console.error("Newsletter subscription error:",f),i({title:"Subscription Failed",description:f.message||"There was an error subscribing to the newsletter. Please try again.",variant:"destructive"})}finally{r(!1)}};return n?s.jsx(De,{className:t,children:s.jsx(Be,{className:"pt-6",children:s.jsxs("div",{className:"text-center space-y-4",children:[s.jsx(Or,{className:"h-16 w-16 text-green-500 mx-auto"}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Successfully Subscribed!"}),s.jsx("p",{className:"text-gray-600 mt-2",children:"Thank you for subscribing to our newsletter. You'll receive the latest chamber news, member updates, and community events."})]}),s.jsx(Y,{variant:"outline",onClick:()=>a(!1),className:"mt-4",children:"Subscribe Another Email"})]})})}):s.jsxs(De,{className:t,children:[s.jsx(ot,{children:s.jsxs(ut,{className:"flex items-center gap-2",children:[s.jsx(fs,{className:"h-5 w-5"}),"Subscribe to Our Newsletter"]})}),s.jsxs(Be,{children:[s.jsx("p",{className:"text-gray-600 mb-6",children:"Get the latest chamber news, member updates, and community events delivered to your inbox monthly."}),s.jsxs("form",{onSubmit:l(d),className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"email",children:"Email Address *"}),s.jsx(Ne,{id:"email",type:"email",placeholder:"[email protected]",...o("email"),className:c.email?"border-red-500":""}),c.email&&s.jsx("p",{className:"text-sm text-red-500",children:c.email.message})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"name",children:"Name (Optional)"}),s.jsx(Ne,{id:"name",type:"text",placeholder:"Your name",...o("name")})]}),s.jsx(Y,{type:"submit",className:"w-full",disabled:e,children:e?s.jsxs(s.Fragment,{children:[s.jsx(fs,{className:"mr-2 h-4 w-4 animate-spin"}),"Subscribing..."]}):s.jsxs(s.Fragment,{children:[s.jsx(fs,{className:"mr-2 h-4 w-4"}),"Subscribe to Newsletter"]})}),s.jsx("p",{className:"text-xs text-gray-500 text-center",children:"By subscribing, you agree to receive our newsletter. You can unsubscribe at any time."})]})]})]})},iwe=()=>s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs("div",{className:"mb-8",children:[s.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Chamber Newsletter"}),s.jsx("p",{className:"text-lg text-gray-600",children:"Stay connected with the latest news, events, and updates from the Valley Stream Chamber of Commerce."})]}),s.jsxs("div",{className:"grid gap-8",children:[s.jsx(awe,{}),s.jsxs(De,{children:[s.jsx(ot,{children:s.jsx(ut,{children:"What's in Our Newsletter?"})}),s.jsx(Be,{children:s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Member Spotlights"}),s.jsx("p",{className:"text-gray-600",children:"Featured stories about chamber members, their businesses, and achievements."})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Upcoming Events"}),s.jsx("p",{className:"text-gray-600",children:"Calendar of networking events, workshops, and community gatherings."})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Business Updates"}),s.jsx("p",{className:"text-gray-600",children:"Latest news about local businesses, ribbon cuttings, and expansions."})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-lg mb-2",children:"Community News"}),s.jsx("p",{className:"text-gray-600",children:"Important updates about Valley Stream and surrounding communities."})]})]})})]})]})]})}),owe=({winner:t})=>s.jsxs(De,{className:"p-6 hover:shadow-xl transition-all duration-300 h-full flex flex-col group hover:-translate-y-1",children:[s.jsx("div",{className:"flex-shrink-0 mb-6",children:s.jsx("div",{className:"w-32 h-32 mx-auto rounded-full overflow-hidden bg-gray-100 ring-4 ring-transparent group-hover:ring-chamber-gold/20 transition-all duration-300",children:t.image_url?s.jsx("img",{src:t.image_url,alt:t.name,className:"w-full h-full object-cover group-hover:scale-110 transition-transform duration-300"}):s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsx(Zy,{size:48,className:"text-gray-400 group-hover:text-chamber-blue transition-colors duration-300"})})})}),s.jsxs("div",{className:"flex-grow flex flex-col",children:[s.jsxs("div",{className:"text-center mb-4",children:[s.jsx("h3",{className:"text-xl font-bold text-gray-900 mb-1",children:t.name}),s.jsx("p",{className:"text-chamber-blue font-semibold mb-3",children:t.school}),s.jsxs("div",{className:"flex flex-wrap justify-center gap-2 mb-4",children:[s.jsxs(ke,{variant:"outline",className:"bg-purple-100 text-purple-700 border-purple-200",children:[s.jsx(Jy,{
995className:"w-3 h-3 mr-1"}),t.scholarship_name]}),s.jsx(ke,{variant:"outline",className:"bg-green-50 text-green-700",children:t.amount}),s.jsxs(ke,{variant:"outline",className:"bg-blue-50 text-blue-700",children:["Class of ",t.graduation_year]})]})]}),s.jsx("p",{className:"text-gray-600 mb-4 leading-relaxed text-center",children:t.bio}),s.jsxs("div",{className:"mb-4",children:[s.jsxs("h4",{className:"font-semibold text-gray-800 mb-2 flex items-center justify-center",children:[s.jsx(Jy,{className:"w-4 h-4 mr-2 text-chamber-gold"}),"Key Achievements"]}),s.jsx("div",{className:"flex flex-wrap gap-2 justify-center",children:t.achievements.map((e,r)=>s.jsx(ke,{variant:"secondary",className:"text-xs",children:e},r))})]}),t.future_goals&&s.jsxs("div",{className:"mt-auto",children:[s.jsxs("h4",{className:"font-semibold text-gray-800 mb-2 flex items-center justify-center",children:[s.jsx(ZV,{className:"w-4 h-4 mr-2 text-chamber-blue"}),"Future Goals"]}),s.jsx("p",{className:"text-gray-600 text-sm text-center",children:t.future_goals})]})]})]}),U1=({size:t="md",className:e,text:r})=>{const n={sm:"w-4 h-4",md:"w-6 h-6",lg:"w-8 h-8"};return s.jsxs("div",{className:xt("flex flex-col items-center justify-center",e),children:[s.jsx(Mt,{className:xt("animate-spin text-chamber-blue",n[t])}),r&&s.jsx("p",{className:"mt-2 text-sm text-gray-600",children:r})]})},g0={async getActiveScholarships(){const{data:t,error:e}=await Q.from("scholarships").select("*").eq("is_active",!0).order("name");if(e)throw e;return t||[]},async getAllScholarships(){const{data:t,error:e}=await Q.from("scholarships").select("*").order("created_at",{ascending:!1});if(e)throw e;return t||[]},async getScholarshipById(t){const{data:e,error:r}=await Q.from("scholarships").select("*").eq("id",t).single();if(r)throw r;return e},async createScholarship(t){const{data:e,error:r}=await Q.from("scholarships").insert([t]).select().single();if(r)throw r;return e},async updateScholarship(t,e){const{data:r,error:n}=await Q.from("scholarships").update({...e,updated_at:new Date().toISOString()}).eq("id",t).select().single();if(n)throw n;return r},async deleteScholarship(t){const{error:e}=await Q.from("scholarships").delete().eq("id",t);if(e)throw e},async getScholarshipsWithInvalidDates(){const{data:t,error:e}=await Q.from("scholarships").select("*").not("application_deadline","is",null);if(e)throw e;return(t||[]).filter(r=>{if(!r.application_deadline)return!1;try{return new Date(r.application_deadline),!1}catch{return!0}})}
995,async fixInvalidDates(){const t=await this.getScholarshipsWithInvalidDates(),e=[],r=[];for(const n of t)try{let a=null;if(n.application_deadline){const i=n.application_deadline.toLowerCase();i.includes("jan")||i.includes("january")?a=i.includes("1")||i.includes("01")?"2026-01-01":"2025-01-01":i.includes("feb")||i.includes("february")?a=i.includes("1")||i.includes("01")?"2026-02-01":"2025-02-01":i.includes("mar")||i.includes("march")?a=i.includes("15")?"2025-03-15":"2025-03-01":i.includes("apr")||i.includes("april")?a=i.includes("1")||i.includes("01")?"2026-04-01":"2025-04-01":i.includes("may")?a=i.includes("1")||i.includes("01")?"2026-05-01":"2025-05-01":i.includes("jun")||i.includes("june")?a=i.includes("1")||i.includes("01")?"2026-06-01":"2025-06-01":i.includes("jul")||i.includes("july")?a=i.includes("1")||i.includes("01")?"2026-07-01":"2025-07-01":i.includes("aug")||i.includes("august")?a=i.includes("14")?"2025-08-14":"2025-08-01":i.includes("sep")||i.includes("september")?a=i.includes("1")||i.includes("01")?"2026-09-01":"2025-09-01":i.includes("oct")||i.includes("october")?a=i.includes("1")||i.includes("01")?"2026-10-01":"2025-10-01":i.includes("nov")||i.includes("november")?a=i.includes("1")||i.includes("01")?"2026-11-01":"2025-11-01":i.includes("dec")||i.includes("december")?a=i.includes("1")||i.includes("01")?"2026-12-01":"2025-12-01":a="2026-01-01"}a&&(await this.updateScholarship(n.id,{application_deadline:a}),e.push(n.name))}catch(a){r.push(`${n.name}: ${a instanceof Error?a.message:"Unknown error"}`)}return{fixed:e.length,errors:r}}},x0={async getAllWinners(){const{data:t,error:e}=await Q.from("scholarship_winners").select("*").order("graduation_year",{ascending:!1});if(e)throw e;return t||[]},async getFeaturedWinners(){const{data:t,error:e}=await Q.from("scholarship_winners").select("*").eq("is_featured",!0).order("graduation_year",{ascending:!1});if(e)throw e;return t||[]},async getWinnerById(t){const{data:e,error:r}=await Q.from("scholarship_winners").select("*").eq("id",t).single();if(r)throw r;return e},async createWinner(t){const{data:e,error:r}=await Q.from("scholarship_winners").insert([t]).select().single();if(r)throw r;return e},async updateWinner(t,e){const{data:r,error:n}=await Q.from("scholarship_winners").update({...e,updated_at:new Date().toISOString()}).eq("id",t).select().single();if(n)throw n;return r},async deleteWinner(t){const{error:e}=await Q.from("scholarship_winners").delete().eq("id",t);if(e)throw e}},y0={async getActiveCounselors(){const{data:t,error:e}=await Q.from("guidance_counselors").select("*").eq("is_active",!0).order("school");if(e)throw e;return t||[]},async getAllCounselors(){const{data:t,error:e}=await Q.from("guidance_counselors").select("*").order("created_at",{ascending:!1});if(e)throw e;return t||[]},async getCounselorById(t){const{data:e,error:r}=await Q.from("guidance_counselors").select("*").eq("id",t).single();if(r)throw r;return e},async createCounselor(t){const{data:e,error:r}=await Q.from("guidance_counselors").insert([t]).select().single();if(r)throw r;return e},async updateCounselor(t,e){const{data:r,error:n}=await Q.from("guidance_counselors").update({...e,updated_at:new Date().toISOString()}).eq("id",t).select().single();if(n)throw n;return r},async deleteCounselor(t){const{error:e}=await Q.from("guidance_counselors").delete().eq("id",t);if(e)throw e}},lwe=()=>{const[t,e]=x.useState(0),[r,n]=x.useState(!1),[a,i]=x.useState([]),[o,l]=x.useState(!0),c=3,u=()=>a.length===0?[]:[...a].sort(()=>Math.random()-.5).slice(0,c),[d,h]=x.useState([]);x.useEffect(()=>{(async()=>{try{const g=await x0.getAllWinners();i(g),h(g.slice(0,c))}catch(g){console.error("Error loading scholarship winners:",g)}finally{l(!1)}})()},[]);const f=()=>{a.length!==0&&(n(!0),setTimeout(()=>
995{h(u()),e(m=>(m+1)%Math.ceil(a.length/c)),n(!1)},300))};return x.useEffect(()=>{if(a.length===0)return;const m=setInterval(f,5e3);return()=>clearInterval(m)},[a]),s.jsxs("section",{className:"mb-16",children:[s.jsxs("div",{className:"text-center mb-10",children:[s.jsx("div",{className:"flex justify-center mb-4",children:s.jsx(Jy,{className:"w-8 h-8 text-chamber-gold"})}),s.jsx("h2",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Our Scholarship Winners"}),s.jsx("p",{className:"text-lg text-gray-600 max-w-2xl mx-auto",children:"Meet the exceptional students who have received Chamber scholarships and learn about their achievements and future goals."})]}),o?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(U1,{size:"lg",text:"Loading scholarship winners..."})}):a.length===0?s.jsx("div",{className:"text-center py-8",children:s.jsx("p",{className:"text-gray-600",children:"No scholarship winners to display yet."})}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"relative overflow-hidden",children:s.jsx("div",{className:`grid md:grid-cols-2 lg:grid-cols-3 gap-8 transition-all duration-500 ease-in-out ${r?"opacity-0 transform translate-y-4":"opacity-100 transform translate-y-0"}`,children:d.map((m,g)=>s.jsx("div",{className:"transform transition-all duration-300 ease-out hover:scale-105",style:{transitionDelay:`${g*100}ms`},children:s.jsx(owe,{winner:m})},`${m.id}-${t}`))})}),s.jsx("div",{className:"flex justify-center mt-8 space-x-2",children:Array.from({length:Math.ceil(a.length/c)}).map((m,g)=>s.jsx("button",{className:`w-3 h-3 rounded-full transition-all duration-300 ${t===g?"bg-chamber-blue scale-125":"bg-gray-300 hover:bg-gray-400 hover:scale-110"}`,onClick:()=>{t!==g&&(e(g),n(!0),setTimeout(()=>
995{h(u()),n(!1)},300))},"aria-label":`Go to slide ${g+1}`},g))})]})]})},cwe=({criteria:t})=>s.jsxs(De,{className:"p-6 h-full",children:[s.jsxs("div",{className:"mb-4",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("h3",{className:"text-xl font-bold text-gray-900",children:t.name}),t.is_active&&s.jsx(ke,{className:"bg-green-100 text-green-800",children:"Active"})]}),s.jsxs("div",{className:"flex items-center gap-4 text-sm text-gray-600 mb-3",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx(yu,{className:"w-4 h-4 mr-1 text-chamber-gold"}),t.amount]}),s.jsxs("div",{className:"flex items-center",children:[s.jsx(Br,{className:"w-4 h-4 mr-1 text-chamber-blue"}),"Due: ",t.application_deadline]})]}),s.jsx("p",{className:"text-gray-600 leading-relaxed",children:t.description})]}),s.jsxs("div",{className:"mb-6",children:[s.jsxs("h4",{className:"font-semibold text-gray-800 mb-3 flex items-center",children:[s.jsx(Or,{className:"w-4 h-4 mr-2 text-green-600"}),"Eligibility Requirements"]}),s.jsx("ul",{className:"space-y-2",children:t.eligibility_requirements.map((e,r)=>s.jsxs("li",{className:"flex items-start text-sm text-gray-600",children:[s.jsx("div",{className:"w-2 h-2 bg-chamber-blue rounded-full mt-2 mr-3 flex-shrink-0"}),e]},r))})]}),s.jsxs("div",{children:[s.jsxs("h4",{className:"font-semibold text-gray-800 mb-3 flex items-center",children:[s.jsx(ti,{className:"w-4 h-4 mr-2 text-chamber-gold"}),"Selection Criteria"]}),s.jsx("ul",{className:"space-y-2",children:t.selection_criteria.map((e,r)=>s.jsxs("li",{className:"flex items-start text-sm text-gray-600",children:[s.jsx("div",{className:"w-2 h-2 bg-chamber-gold rounded-full mt-2 mr-3 flex-shrink-0"}),e]},r))})]})]}),uwe=({counselor:t})=>{const e=()=>{window.location.href=`mailto:${t.email}?subject=Scholarship Application Inquiry`},r=()=>{window.location.href=`tel:${t.phone}`};return s.jsxs(De,{className:"p-6 hover:shadow-lg transition-shadow",children:[s.jsxs("div",{className:"text-center mb-4",children:[s.jsx("h3",{className:"text-lg font-bold text-gray-900 mb-1",children:t.name}),s.jsxs("div",{className:"flex items-center justify-center text-chamber-blue mb-2",children:[s.jsx(GV,{className:"w-4 h-4 mr-2"}),s.jsx("span",{className:"font-medium",children:t.school})]})]}),s.jsxs("div",{className:"space-y-3 mb-6",children:[s.jsxs("div",{className:"flex items-center text-gray-600",children:[s.jsx(fs,{className:"w-4 h-4 mr-3 text-chamber-blue flex-shrink-0"}),s.jsx("span",{className:"text-sm break-all",children:t.email})]}),t.phone&&s.jsxs("div",{className:"flex items-center text-gray-600",children:[s.jsx(wi,{className:"w-4 h-4 mr-3 text-chamber-blue flex-shrink-0"}),s.jsx("span",{className:"text-sm",children:t.phone})]}),t.office_hours&&s.jsxs("div",{className:"flex items-start text-gray-600",children:[s.jsx(rn,{className:"w-4 h-4 mr-3 text-chamber-blue flex-shrink-0 mt-0.5"}),s.jsx("span",{className:"text-sm",children:t.office_hours})]})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[s.jsxs(Y,{onClick:e,className:"flex-1 bg-chamber-blue hover:bg-chamber-blue-dark",size:"sm",children:[s.jsx(fs,{className:"w-4 h-4 mr-2"}),"Email"]}),t.phone&&s.jsxs(Y,{onClick:r,variant:"outline",className:"flex-1",size:"sm",children:[s.jsx(wi,{className:"w-4 h-4 mr-2"}),"Call"]})]})]})},dwe=()=>{const{siteSettings:t}=mp(),e=()=>{const r=(t==null?void 0:t.paypal_button_url)||"https://www.paypal.com/donate";window.open(r,"_blank")};return s.jsxs(De,{className:"p-8 bg-gradient-to-br from-chamber-blue-light to-white border-chamber-blue",children:[s.jsxs("div",{className:"text-center mb-6",children:[s.jsx("div",{className:"flex justify-center mb-4",children:s.jsx("div",{className:"bg-chamber-gold p-3 rounded-full",children:s.jsx(iF,{className:"w-8 h-8 text-white"})})}),s.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Support Our Scholarship Fund"}),s.jsx("p",{className:"text-gray-600 max-w-2xl mx-auto",children:"Your generous donation helps us provide educational opportunities to deserving students in our community. Every contribution, no matter the size, makes a difference in a student's future."})]}),s.jsxs("div",{className:"grid md:grid-cols-3 gap-6 mb-8",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"bg-chamber-blue p-3 rounded-full w-fit mx-auto mb-3",children:s.jsx(Zy,{className:"w-6 h-6 text-white"})}
995),s.jsx("h3",{className:"font-semibold text-gray-800 mb-2",children:"Student Impact"}),s.jsx("p",{className:"text-sm text-gray-600",children:"Help students achieve their educational dreams and build a brighter future"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"bg-chamber-gold p-3 rounded-full w-fit mx-auto mb-3",children:s.jsx(Os,{className:"w-6 h-6 text-white"})}),s.jsx("h3",{className:"font-semibold text-gray-800 mb-2",children:"Community Growth"}),s.jsx("p",{className:"text-sm text-gray-600",children:"Invest in our local community by supporting the next generation of leaders"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"bg-green-600 p-3 rounded-full w-fit mx-auto mb-3",children:s.jsx(yu,{className:"w-6 h-6 text-white"})}),s.jsx("h3",{className:"font-semibold text-gray-800 mb-2",children:"Tax Deductible"}),s.jsx("p",{className:"text-sm text-gray-600",children:"Your donation is tax-deductible and goes directly to student scholarships"})]})]}),s.jsxs("div",{className:"text-center",children:[s.jsxs(Y,{onClick:e,size:"lg",className:"bg-[#0070ba] hover:bg-[#005ea6] text-white px-8 py-3 text-lg font-semibold",children:[s.jsx(iF,{className:"w-5 h-5 mr-2"}),(t==null?void 0:t.paypal_button_text)||"Donate via PayPal"]}),s.jsx("p",{className:"text-xs text-gray-500 mt-3",children:"Secure donation processing through PayPal"})]})]})},hwe=()=>{const[t,e]=x.useState([]),[r,n]=x.useState([]),[a,i]=x.useState(!0);return x.useEffect(()=>{(async()=>{try{const[l,c]=await Promise.all([g0.getActiveScholarships(),y0.getActiveCounselors()]);e(l),n(c)}catch(l){console.error("Error loading scholarship data:",l)}finally{i(!1)}})()},[]),s.jsxs("div",{className:"bg-gray-50 min-h-screen",children:[s.jsx("header",{className:"bg-gradient-to-r from-chamber-blue to-chamber-blue-dark text-white py-16",children:s.jsxs("div",{className:"container mx-auto px-4 text-center",children:[s.jsx("div",{className:"flex justify-center mb-6",children:s.jsx("div",{className:"bg-chamber-gold p-4 rounded-full",children:s.jsx(Zy,{size:48,className:"text-white"})})}),s.jsx("h1",{className:"text-4xl md:text-5xl font-bold mb-4",children:"Chamber Scholarships"}),s.jsx("p",{className:"text-xl text-blue-100 max-w-3xl mx-auto leading-relaxed",children:"Supporting the educational dreams of our local students through scholarships, mentorship, and community investment in the next generation of leaders."})]})}),s.jsxs("div",{className:"container mx-auto px-4 py-12",children:[s.jsx(lwe,{}),s.jsxs("section",{className:"mb-16",children:[s.jsxs("div",{className:"text-center mb-10",children:[s.jsx("div",{className:"flex justify-center mb-4",children:s.jsx(Zy,{className:"w-8 h-8 text-chamber-blue"})}),s.jsx("h2",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Scholarship Opportunities"}),s.jsx("p",{className:"text-lg text-gray-600 max-w-2xl mx-auto",children:"Explore our available scholarships and their requirements. Each scholarship is designed to recognize different types of excellence and achievement."})]}),a?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(U1,{size:"lg",text:"Loading scholarships..."})}):s.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:t.map(o=>s.jsx(cwe,{criteria:o},o.id))})]}),s.jsxs("section",{className:"mb-16",children:[s.jsxs("div",{className:"text-center mb-10",children:[s.jsx("div",{className:"flex justify-center mb-4",children:s.jsx(Os,{className:"w-8 h-8 text-chamber-blue"})}),s.jsx("h2",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Contact Your Guidance Counselor"}),s.jsx("p",{className:"text-lg text-gray-600 max-w-2xl mx-auto",children:"Ready to apply? Reach out to your school's guidance counselor for application materials and personalized assistance with the scholarship process."})]}),a?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(U1,{size:"lg",text:"Loading counselors..."})}):s.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-4 gap-6",children:r.map(o=>s.jsx(uwe,{counselor:o},o.id))})]}),s.jsx("section",{className:"mb-16",children:s.jsx(dwe,{})})]})]})};class _y{static async submitContact(e){try{const{data:r,error:n}=await Q.from("contacts").insert([e]).select().single();if(n)throw new Error(n.message);return r}catch(r){throw console.error("Error submitting contact:",r),r}}static async getAllContacts(){try{const{data:e,error:r}=await Q.from("contacts").select("*").order("created_at",{ascending:!1});if(r)throw new Error(r.message);return e||[]}catch(e){throw console.error("Error fetching contacts:",e),e}}static async getContactsByStatus(e){try{const{data:r,error:n}=await Q.from("contacts").select("*").eq("status",e).order("created_at",{ascending:!1});if(n)throw new Error(n.message);return r||[]}catch(r){throw console.error("Error fetching contacts by status:",r),r}}static async updateContact(e,r){try{const{data:{user:n}}=await Q.auth.getUser(),a={...r,updated_at:new Date().toISOString()};r.status&&n&&(a.reviewed_by=n.id,a.reviewed_at=new Date().toISOString());const{data:i,error:o}=await Q.from("contacts").update(a).eq("id",e).select().single();if(o)throw new Error(o.message);return i}catch(n){throw console.error("Error updating contact:",n),n}}static async getContactById(e){try{const{data:r,error:n}=await Q.from("contacts").select("*").eq("id",e).single();if(n){if(n.code==="PGRST116")return null;throw new Error(n.message)}return r}catch(r){throw console.error("Error fetching contact by ID:",r),r}}static async deleteContact(e){try{const{error:r}=await Q.from("contacts").delete().eq("id",e);if(r)throw new Error(r.message)}catch(r){throw console.error("Error deleting contact:",r),r}}static async getContactStats(){try{const{data:e,error:r}=await Q.from("contacts").select("status");if(r)throw new Error(r.message);return{total:(e==null?void 0:e.length)||0,inReview:(e==null?void 0:e.filter(a=>a.status==="in-review").length)||0,notApplicable:(e==null?void 0:e.filter(a=>a.status==="not-applicable").length)||0,settled:(e==null?void 0:e.filter(a=>a.status==="settled").length)||0}}catch(e){throw console.error("Error fetching contact stats:",e),e}}}const jS=[{value:"general",label:"General Inquiry"},{value:"membership",label:"Membership Question"},{value:"business",label:"Business Related"},{value:"events",label:"Events & Programs"},{value:"technical",label:"Technical Support"}
995,{value:"partnership",label:"Partnership Opportunity"}],sN=[{value:"in-review",label:"In Review"},{value:"not-applicable",label:"Not Applicable"},{value:"settled",label:"Settled"}],mwe=()=>{var d,h,f;const{toast:t}=St(),{siteSettings:e}=mp(),[r,n]=x.useState({name:"",email:"",contact_type:"general",subject:"",message:""}),[a,i]=x.useState(!1),o=m=>{if(!m)return null;const g=["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],y={monday:"Monday",tuesday:"Tuesday",wednesday:"Wednesday",thursday:"Thursday",friday:"Friday",saturday:"Saturday",sunday:"Sunday"},b=j=>{if(!j||j==="closed")return"Closed";if(j==="24/7")return"24 Hours";if(!j.includes(":"))return j;const[N,S]=j.split(":"),E=parseInt(N),C=E>=12?"PM":"AM";return`${E===0?12:E>12?E-12:E}:${S} ${C}`},w=j=>typeof j=="string"?j==="Closed"?"Closed":j:!j||j.open==="closed"?"Closed":j.open==="24/7"?"24 Hours":!j.open||!j.close?"Closed":`${b(j.open)} - ${b(j.close)}`;return g.map(j=>({day:y[j],hours:w(m[j])}))},l=m=>{const{name:g,value:y}=m.target;n(b=>({...b,[g]:y}))},c=m=>{n(g=>({...g,contact_type:m}))},u=async m=>{m.preventDefault(),i(!0);try{await _y.submitContact(r),t({title:"Message sent!",description:"We'll get back to you as soon as possible."}),n({name:"",email:"",contact_type:"general",subject:"",message:""})}catch(g){console.error("Error submitting contact:",g),t({title:"Error",description:"Failed to send message. Please try again.",variant:"destructive"})}finally{i(!1)}};return s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs("div",{className:"text-center mb-10",children:[s.jsx("h1",{className:"text-3xl font-bold text-gray-900 mb-2",children:"Contact Us"}),s.jsx("p",{className:"text-gray-600 max-w-2xl mx-auto",children:"Have questions or want to get in touch with the Valley Stream Chamber of Commerce? We'd love to hear from you. Fill out the form below or use our contact information."})]}),s.jsxs("div",{className:"grid md:grid-cols-3 gap-8",children:[s.jsxs(De,{className:"md:col-span-2",children:[s.jsxs(ot,{children:[s.jsx(ut,{children:"Send us a message"}),s.jsx(us,{children:"Fill out this form and we'll get back to you as soon as possible."})]}),s.jsx(Be,{children:s.jsxs("form",{onSubmit:u,className:"space-y-4",children:[s.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"name",children:"Your Name"}),s.jsx(Ne,{id:"name",name:"name",placeholder:"John Doe",value:r.name,onChange:l,required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"email",children:"Email Address"}),s.jsx(Ne,{id:"email",name:"email",type:"email",placeholder:"[email protected]",value:r.email,onChange:l,required:!0})]})]}),s.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"contact_type",children:"Contact Type"}),s.jsxs(Wt,{value:r.contact_type,onValueChange:c,children:[s.jsx(Ht,{children:s.jsx(qt,{placeholder:"Select contact type"})}),s.jsx($t,{children:jS.map(m=>s.jsx(Ae,{value:m.value,children:m.label},m.value))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"subject",children:"Subject"}),s.jsx(Ne,{id:"subject",name:"subject",placeholder:"How can we help you?",value:r.subject,onChange:l,required:!0})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"message",children:"Message"}),s.jsx(zt,{id:"message",name:"message",placeholder:"Please provide details about your inquiry...",rows:5,value:r.message,onChange:l,required:!0})]}),s.jsx(Y,{type:"submit",className:"w-full md:w-auto bg-chamber-blue hover:bg-chamber-blue-dark",disabled:a,children:a?"Sending...":"Send Message"})]})})]}),s.jsxs(De,{children:[s.jsxs(ot,{children:[s.jsx(ut,{children:"Contact Information"}),s.jsx(us,{children:"Here are the ways you can reach us."})]}),s.jsxs(Be,{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-start space-x-3",children:[s.jsx(fs,{className:"h-5 w-5 text-chamber-blue mt-0.5"}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-medium",children:"Email"}),s.jsx("a",{href:`mailto:${(e==null?void 0:e.contact_email)||"info@Valley Stream.chamber"}`,className:"text-sm text-gray-600 hover:text-chamber-blue",children:(e==null?void 0:e.contact_email)||"info@Valley Stream.chamber"})]})]}),s.jsxs("div",{className:"flex items-start space-x-3",children:[s.jsx(wi,{className:"h-5 w-5 text-chamber-blue mt-0.5"}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-medium",children:"Phone"}),s.jsx("a",{href:`tel:${((d=e==null?void 0:e.contact_phone)==null?void 0:d.replace(/\D/g,""))||"+15551234567"}`,className:"text-sm text-gray-600 hover:text-chamber-blue",children:(e==null?void 0:e.contact_phone)||"(555) 123-4567"})]})]}),s.jsxs("div",{className:"flex items-start space-x-3",children:[s.jsx(_n,{className:"h-5 w-5 text-chamber-blue mt-0.5"}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-medium",children:"Address"}),s.jsxs("address",{className:"text-sm text-gray-600 not-italic",children:[(e==null?void 0:e.address_line1)||"123 Main Street",s.jsx("br",{}),(e==null?void 0:e.address_line2)&&s.jsxs(s.Fragment,{children:[e.address_line2,s.jsx("br",{})]}),(e==null?void 0:e.city)||"Anytown",", ",(e==null?void 0:e.state)||"USA"," ",(e==null?void 0:e.zip_code)||"12345"]})]})]}),s.jsxs("div",{className:"flex items-start space-x-3",children:[s.jsx(rn,{className:"h-5 w-5 text-chamber-blue mt-0.5"}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-medium",children:"Business Hours"}),s.jsx("div",{className:"text-sm text-gray-600",children:e!=null&&e.business_hours_json?(h=o(e.business_hours_json))==null?void 0:h.map(({day:m,hours:g})=>s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"font-medium mr-4",children:m}),s.jsx("span",{children:g})]},m)):e!=null&&e.business_hours&&typeof e.business_hours=="object"?(f=o(e.business_hours))==null?void 0:f.map(({day:m,hours:g})=>s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"font-medium mr-4",children:m}),s.jsx("span",{children:g})]},m)):s.jsxs(s.Fragment,{children:["Monday - Friday: 9:00 AM - 5:00 PM",s.jsx("br",{}),"Saturday - Sunday: Closed"]})})]})]})]})]})]})]})})},fwe=()=>{const[t]=Td(),e=t.get("email");return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8",children:s.jsxs(De,{className:"w-full max-w-md
995shadow-lg",children:[s.jsxs(ot,{className:"text-center",children:[s.jsx("div",{className:"mx-auto w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:s.jsx(fs,{className:"w-6 h-6 text-blue-600"})}),s.jsx(ut,{children:"Email Verification Required"}),s.jsx(us,{children:"Please check your email and click the verification link to activate your account."})]}),s.jsxs(Be,{className:"text-center space-y-4",children:[e&&s.jsxs("div",{className:"bg-gray-50 p-3 rounded-lg border",children:[s.jsx("p",{className:"text-sm text-gray-600 mb-1",children:"Verification email sent to:"}),s.jsx("p",{className:"font-medium text-gray-900 break-all",children:e})]}),s.jsx("p",{className:"text-gray-700",children:"If you don't see the email, check your spam or junk folder."}),s.jsx(rt,{to:"/auth/login",className:"text-chamber-blue hover:underline",children:"Back to Login"})]})]})})},pwe=()=>{const[t,e]=x.useState(""),[r,n]=x.useState(!1),[a,i]=x.useState(!1),o=ks(),{toast:l}=St(),[c]=Td(),u=c.get("email"),d=m=>{const g=m.target.value.replace(/\D/g,"").slice(0,6);e(g)},h=async m=>{if(m.preventDefault(),!u){l({title:"Error",description:"Email address not found. Please try signing up again.",variant:"destructive"});return}if(t.length!==6){l({title:"Invalid Code",description:"Please enter a valid 6-digit code.",variant:"destructive"});return}n(!0);try{const{data:g,error:y}=await Q.auth.verifyOtp({email:u,token:t,type:"signup"});if(y)throw y;g.session&&(l({title:"Email Verified!",description:"Your account has been successfully verified. Welcome!"}),o("/dashboard"))}catch(g){console.error("OTP verification error:",g),l({title:"Verification Failed",description:g.message||"Invalid or expired code. Please try again.",variant:"destructive"})}finally{n(!1)}},f=async()=>{if(!u){l({title:"Error",description:"Email address not found. Please try signing up again.",variant:"destructive"});return}i(!0);try{const{error:m}=await Q.auth.resend({type:"signup",email:u});if(m)throw m;l({title:"Code Resent",description:"A new verification code has been sent to your email."}),e("")}catch(m){console.error("Resend OTP error:",m),l({title:"Resend Failed",description:m.message||"Failed to resend verification code. Please try again.",variant:"destructive"})}finally{i(!1)}};return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8",children:s.jsxs(De,{className:"w-full max-w-md
995shadow-lg",children:[s.jsxs(ot,{className:"text-center",children:[s.jsx("div",{className:"mx-auto w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:s.jsx(fs,{className:"w-6 h-6 text-blue-600"})}),s.jsx(ut,{children:"Verify Your Email"}),s.jsx(us,{children:"Enter the 6-digit code sent to your email address"})]}),s.jsxs(Be,{className:"space-y-4",children:[u&&s.jsxs("div",{className:"bg-gray-50 p-3 rounded-lg border",children:[s.jsx("p",{className:"text-sm text-gray-600 mb-1",children:"Code sent to:"}),s.jsx("p",{className:"font-medium text-gray-900 break-all",children:u})]}),s.jsxs("form",{onSubmit:h,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"otp",children:"Verification Code"}),s.jsx(Ne,{id:"otp",type:"text",value:t,onChange:d,placeholder:"000000",className:"text-center text-2xl font-mono tracking-widest",maxLength:6,disabled:r,autoComplete:"one-time-code"}),s.jsx("p",{className:"text-xs text-gray-500 text-center",children:"Enter the 6-digit code from your email"})]}),s.jsx(Y,{type:"submit",className:"w-full bg-chamber-blue hover:bg-chamber-blue-dark",disabled:r||t.length!==6,children:r?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"}),"Verifying..."]}):"Verify Email"})]}),s.jsxs("div",{className:"text-center space-y-2",children:[s.jsx("p",{className:"text-sm text-gray-600",children:"Didn't receive the code?"}),s.jsx(Y,{variant:"outline",onClick:f,disabled:a,className:"w-full",children:a?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"}),"Resending..."]}):"Resend Code"})]}),s.jsx("div",{className:"text-center",children:s.jsxs(Y,{variant:"ghost",onClick:()=>o("/auth/login"),className:"text-chamber-blue hover:underline",children:[s.jsx(pn,{className:"mr-2 h-4 w-4"}),"Back to Login"]})}),s.jsx("div",{className:"bg-amber-50 p-3 rounded-lg border border-amber-200",children:s.jsxs("p",{className:"text-xs text-amber-800",children:[s.jsx("strong",{children:"Note:"})," The verification code expires in 60 seconds. If you don't see the email, check your spam or junk folder."]})})]})]})})},gwe=()=>s.jsx("div",{className:"min-h-screen flex flex-col",children:s.jsx("div",{className:"flex-1 flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"w-full max-w-md
995space-y-8",children:[s.jsx("div",{className:"text-center",children:s.jsx(rt,{to:"/",className:"inline-block",children:s.jsx("span",{className:"font-bold text-2xl text-chamber-blue",children:"Valley Stream Chamber"})})}),s.jsx(pwe,{})]})})}),xwe=()=>{const[t,e]=x.useState(""),[r,n]=x.useState(!1),[a,i]=x.useState(!1),o=ks(),{toast:l}=St(),[c]=Td(),u=c.get("email"),d=c.get("type")||"email_change",h=b=>{const w=b.target.value.replace(/\D/g,"").slice(0,6);e(w)},f=async b=>{if(b.preventDefault(),!u){l({title:"Error",description:"Email address not found. Please try the process again.",variant:"destructive"});return}if(t.length!==6){l({title:"Invalid Code",description:"Please enter a valid 6-digit code.",variant:"destructive"});return}n(!0);try{const{data:w,error:j}=await Q.auth.verifyOtp({email:u,token:t,type:d});if(j)throw j;w.session&&(l({title:"Email Verified!",description:"Your email has been successfully updated."}),o("/dashboard/profile"))}catch(w){console.error("OTP verification error:",w),l({title:"Verification Failed",description:w.message||"Invalid or expired code. Please try again.",variant:"destructive"})}finally{n(!1)}},m=async()=>{if(!u){l({title:"Error",description:"Email address not found. Please try the process again.",variant:"destructive"});return}i(!0);try{const{error:b}=await Q.auth.resend({type:d,email:u});if(b)throw b;l({title:"Code Resent",description:"A new verification code has been sent to your email."}),e("")}catch(b){console.error("Resend OTP error:",b),l({title:"Resend Failed",description:b.message||"Failed to resend verification code. Please try again.",variant:"destructive"})}finally{i(!1)}},g=()=>{switch(d){case"email_change":return"Verify Email Change";case"recovery":return"Verify Password Reset";default:return"Verify Your Email"}},y=()=>{switch(d){case"email_change":return"Enter the 6-digit code sent to confirm your email change";case"recovery":return"Enter the 6-digit code sent for password recovery";default:return"Enter the 6-digit code sent to your email address"}};return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8",children:s.jsxs(De,{className:"w-full max-w-md
995shadow-lg",children:[s.jsxs(ot,{className:"text-center",children:[s.jsx("div",{className:"mx-auto w-12 h-12 bg-blue-100 rounded-full flex items-center justify-center mb-4",children:s.jsx(fs,{className:"w-6 h-6 text-blue-600"})}),s.jsx(ut,{children:g()}),s.jsx(us,{children:y()})]}),s.jsxs(Be,{className:"space-y-4",children:[u&&s.jsxs("div",{className:"bg-gray-50 p-3 rounded-lg border",children:[s.jsx("p",{className:"text-sm text-gray-600 mb-1",children:"Code sent to:"}),s.jsx("p",{className:"font-medium text-gray-900 break-all",children:u})]}),s.jsxs("form",{onSubmit:f,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"otp",children:"Verification Code"}),s.jsx(Ne,{id:"otp",type:"text",value:t,onChange:h,placeholder:"000000",className:"text-center text-2xl font-mono tracking-widest",maxLength:6,disabled:r,autoComplete:"one-time-code"}),s.jsx("p",{className:"text-xs text-gray-500 text-center",children:"Enter the 6-digit code from your email"})]}),s.jsx(Y,{type:"submit",className:"w-full bg-chamber-blue hover:bg-chamber-blue-dark",disabled:r||t.length!==6,children:r?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"}),"Verifying..."]}):"Verify Code"})]}),s.jsxs("div",{className:"text-center space-y-2",children:[s.jsx("p",{className:"text-sm text-gray-600",children:"Didn't receive the code?"}),s.jsx(Y,{variant:"outline",onClick:m,disabled:a,className:"w-full",children:a?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"}),"Resending..."]}):"Resend Code"})]}),s.jsx("div",{className:"text-center",children:s.jsxs(Y,{variant:"ghost",onClick:()=>o("/dashboard/profile"),className:"text-chamber-blue hover:underline",children:[s.jsx(pn,{className:"mr-2 h-4 w-4"}),"Back to Profile"]})}),s.jsx("div",{className:"bg-amber-50 p-3 rounded-lg border border-amber-200",children:s.jsxs("p",{className:"text-xs text-amber-800",children:[s.jsx("strong",{children:"Note:"})," The verification code expires in 60 seconds. If you don't see the email, check your spam or junk folder."]})})]})]})})},ywe=()=>s.jsx("div",{className:"min-h-screen flex flex-col",children:s.jsx("div",{className:"flex-1 flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8",children:s.jsxs("div",{className:"w-full max-w-md
995space-y-8",children:[s.jsx("div",{className:"text-center",children:s.jsx(rt,{to:"/",className:"inline-block",children:s.jsx("span",{className:"font-bold text-2xl text-chamber-blue",children:"Valley Stream Chamber"})})}),s.jsx(xwe,{})]})})}),bwe=()=>{const[t,e]=x.useState([]),[r,n]=x.useState(!0),[a,i]=x.useState(null);return x.useEffect(()=>{(async()=>{try{n(!0);const{data:l,error:c}=await Q.from("residential_profiles").select("*, profiles!inner(*)").eq("status","approved");if(c)throw c;e((l??[]).map(d=>d.profiles))}catch(l){console.error("Error fetching residential users:",l),i("Failed to fetch residential users")}finally{n(!1)}})()},[]),{users:t,loading:r,error:a}},vwe=({user:t})=>{const e=()=>{var n,a;return!t.first_name&&!t.last_name?"U":`${((n=t.first_name)==null?void 0:n.charAt(0))||""}${((a=t.last_name)==null?void 0:a.charAt(0))||""}`.toUpperCase()},r=()=>!t.first_name&&!t.last_name?"Unnamed User":`${t.first_name||""} ${t.last_name||""}`.trim();return s.jsxs(De,{className:"h-full flex flex-col overflow-hidden hover:shadow-xl transition-all duration-300 hover:-translate-y-1 border border-gray-200 rounded-xl",children:[s.jsx("div",{className:"bg-gradient-to-r from-blue-50 to-indigo-50 p-4 pb-8 relative",children:s.jsxs(om,{className:"w-40 h-40 mx-auto mb-4 border-4 border-white shadow-lg",children:[s.jsx(ux,{src:t.avatar_url||"",alt:r(),className:"object-cover"}),s.jsx(ep,{className:"text-xl bg-gradient-to-r from-blue-500 to-indigo-600 text-white",children:e()})]})}),s.jsxs(Be,{className:"p-4 pt-8 -mt-6 bg-white rounded-t-2xl flex-grow flex flex-col",children:[s.jsxs("div",{className:"text-center mb-4",children:[s.jsx("h3",{className:"text-xl font-bold text-gray-900 mb-1 truncate",children:r()}),s.jsx("div",{className:"inline-flex items-center justify-center px-3 py-1 rounded-full text-xs font-medium bg-blue-100 text-blue-700 mb-3",children:"Residential Member"})]}),s.jsx("div",{className:"space-y-3 flex-grow",children:t.bio&&s.jsx("div",{className:"pt-2",children:s.jsxs("p",{className:"text-gray-600 text-sm line-clamp-3 italic",children:['"',t.bio,'"']})})})]})]})},wwe=()=>{const{users:t,loading:e,error:r}=bwe();return e?s.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:s.jsxs("div",{className:"text-center",children:[s.jsx(Mt,{className:"h-8 w-8 animate-spin text-primary mx-auto mb-4"}),s.jsx("p",{className:"text-muted-foreground",children:"Loading residential members..."})]})}):r?s.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"text-red-500 mb-4",children:"Error loading residential members"}),s.jsx("p",{className:"text-muted-foreground",children:r})]})}):s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs("div",{className:"mb-8",children:[s.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Residential Members"}),s.jsx("p",{className:"text-gray-600 mt-2",children:"Connect with other residential members in our community"})]}),t.length===0?s.jsxs("div",{className:"bg-gray-50 rounded-lg p-8 text-center",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-800 mb-2",children:"No residential members found"}),s.jsx("p",{className:"text-gray-600",children:"There are currently no residential members in our community."})]}):s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:t.map(n=>s.jsx(vwe,{user:n},n.id))})]})})},jwe=()=>s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs("div",{className:"mb-8 text-center",children:[s.jsx("h1",{className:"text-3xl font-bold text-gray-900",children:"Residential Members Directory"}),s.jsx("p",{className:"text-gray-600 mt-2",children:"Connect with other residential members in our community"})]}),s.jsx(wwe,{})]})});class Nwe{async getActiveContent(){const{data:e,error:r}=await Q.from("about_us").select("*").eq("is_active",!0).single();return r?(console.error("Error fetching active about us content:",r),null):e}async getAllContent(){const{data:e,error:r}=await Q.from("about_us").select("*").order("created_at",{ascending:!1});return r?(console.error("Error fetching all about us content:",r),[]):e||[]}async updateContent(e,r){try{const{error:n}=await Q.from("about_us").update(r).eq("id",e);return n?(console.error("Error updating about us content:",n),{success:!1,error:n.message}):{success:!0}}catch(n){return console.error("Error updating about us content:",n),{success:!1,error:"Failed to update content"}}}async createContent(e){try{const{data:r,error:n}=await Q.from("about_us").insert([{...e,is_active:e.is_active??!1}]).select().single();return n?(console.error("Error creating about us content:",n),{success:!1,error:n.message}):{success:!0,data:r}}catch(r){return console.error("Error creating about us content:",r),{success:!1,error:"Failed to create content"}}}async setActiveContent(e){try{const{error:r}=await Q.from("about_us").update({is_active:!1}).neq("id","00000000-0000-0000-0000-000000000000");if(r)return console.error("Error deactivating content:",r),{success:!1,error:r.message};const{error:n}=await Q.from("about_us").update({is_active:!0}).eq("id",e);return n?(console.error("Error activating content:",n),{success:!1,error:n.message}):{success:!0}}catch(r){return console.error("Error setting active content:",r),{success:!1,error:"Failed to set active content"}}}async deleteContent(e){try{const{error:r}=await Q.from("about_us").delete().eq("id",e);return r?(console.error("Error deleting about us content:",r),{success:!1,error:r.message}):{success:!0}}catch(r){return console.error("Error deleting about us content:",r),{success:!1,error:"Failed to delete content"}}}}const dg=new Nwe,Fwe=()=>{const[t,e]=x.useState(null),[r,n]=x.useState(!0);return x.useEffect(()=>{(async()=>{try{const i=await dg.getActiveContent();e(i)}catch(i){console.error("Error fetching about us content:",i)}finally{n(!1)}})()},[]),r?s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:s.jsx(Mt,{className:"h-8 w-8 animate-spin"})}):t?s.jsxs("div",{className:"bg-gray-50 min-h-screen",children:[s.jsx("header",{className:"bg-gradient-to-r from-chamber-blue to-chamber-blue-dark text-white py-16",children:s.jsxs("div",{className:"container mx-auto px-4 text-center",children:[s.jsx("div",{className:"flex justify-center mb-6",children:s.jsx("div",{className:"bg-chamber-gold p-4 rounded-full",children:s.jsx(ka,{size:48,className:"text-white"})})}),s.jsx("h1",{className:"text-4xl md:text-5xl font-bold mb-4",children:t.title}),s.jsx("p",{className:"text-xl text-blue-100 max-w-3xl mx-auto leading-relaxed",children:"Connecting businesses, building community, and fostering economic growth through collaboration, advocacy, and support for our local business ecosystem."})]})}),s.jsx("div",{className:"container mx-auto px-4 py-12",children:s.jsx("div",{className:"max-w-4xl mx-auto",children:s.jsx("div",{className:"prose prose-lg max-w-none text-gray-700 leading-relaxed",children:s.jsx("div",{className:"text-lg",dangerouslySetInnerHTML:{__html:t.content}})})})}),s.jsx("section",{className:"py-16 bg-white",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs("div",{className:"text-center mb-10",children:[s.jsx("h2",{className:"text-3xl font-bold text-gray-900 mb-4",children:"Benefits of membership"}),s.jsx("p",{className:"text-xl text-gray-700 italic max-w-3xl mx-auto",children:"âJoining the Chamber isnât just about growing your business; itâs about becoming part of a community that supports and empowers success.â"})]}),s.jsx("div",{className:"max-w-3xl mx-auto mb-12",children:s.jsxs("div",{className:"flex items-center justify-center",children:[s.jsx("img",{src:"/person.webp",alt:"Sasan Shavanson - Valley Stream Chamber Of Commerce President",className:"w-16 h-16 rounded-full object-cover mr-4"}),s.jsxs("div",{className:"text-center sm:text-left",children:[s.jsx("h3",{className:"text-lg font-extrabold text-gray-900",children:"Sasan Shavanson"}),s.jsxs("p",{className:"text-sm text-gray-600 font-medium",children:["Valley Stream Chamber Of Commerce President",s.jsx("br",{}),s.jsx("br",{}),"One in a Million, Inc."]})]})]})}),s.jsxs("div",{className:"grid md:grid-cols-2 gap-8",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-bold text-gray-900 mb-1",children:"Expand Your Network"}),s.jsx("p",{className:"text-gray-700",children:"Build meaningful connections with local businesses and community leaders through exclusive events and opportunities."})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-bold text-gray-900 mb-1",children:"Grow Your Business"}),s.jsx("p",{className:"text-gray-700",children:"Access resources, tools, and workshops tailored to help your business thrive in a competitive market."})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-bold text-gray-900 mb-1",children:"Advocacy and Representation"}),s.jsx("p",{className:"text-gray-700",children:"Have your voice heard and influence decisions on issues that affect your business locally and at the state level."})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-bold text-gray-900 mb-1",children:"Promotion and Visibility"}),s.jsx("p",{className:"text-gray-700",children:"Showcase your business through Chamber directories, newsletters, and event sponsorships."})]})]})]})})]}):s.jsx("div",{className:"min-h-screen flex items-center justify-center",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-4",children:"About Us"}),s.jsx("p",{className:"text-gray-600",children:"Content is currently being updated. Please check back soon."})]})})},kh={async getBoardMembers(){const{data:t,error:e}=await Q.from("board_members").select("*").eq("is_active",!0).order("display_order",{ascending:!0});if(e)throw console.error("Error fetching board members:",e),e;return t||[]},async getAllBoardMembers(){const{data:t,error:e}=await Q.from("board_members").select("*").order("display_order",{ascending:!0});if(e)throw console.error("Error fetching all board members:",e),e;return t||[]},async getBoardMember(t){const{data:e,error:r}=await Q.from("board_members").select("*").eq("id",t).single();if(r)throw console.error("Error fetching board member:",r),r;return e},async createBoardMember(t){var n;const{data:e,error:r}=await Q.from("board_members").insert([{...t,created_by:(n=(await Q.auth.getUser()).data.user)==null?void 0:n.id}]).select().single();if(r)throw console.error("Error creating board member:",r),r;return e},async updateBoardMember(t){const{id:e,...r}=t,{data:n,error:a}=await Q.from("board_members").update(r).eq("id",e).select().single();if(a)throw console.error("Error updating board member:",a),a;return n},async deleteBoardMember(t){const{data:{user:e},error:r}=await Q.auth.getUser();if(r||!e)throw new Error("You must be logged in to delete board members");const{data:n}=await Q.from("profiles").select("user_type").eq("id",e.id).single(),{error:a}=await Q.from("board_members").update({is_active:!1}).eq("id",t);if(a&&a.code==="42501"&&(n==null?void 0:n.user_type)==="admin"){const{error:i}=await UX.from("board_members").update({is_active:!1}).eq("id",t);if(i)throw console.error("Error deleting board member:",i),i}else if(a)throw console.error("Error deleting board member:",a),a},async reorderBoardMembers(t){const e=t.map((r,n)=>({id:r,display_order:n+1}));for(const r of e){const{error:n}=await Q.from("board_members").update({display_order:r.display_order}).eq("id",r.id);if(n)throw console.error("Error reordering board members:",n),n}}},Swe=()=>{const[t,e]=x.useState([]),[r,n]=x.useState(!0),[a,i]=x.useState(null),o=async()=>{try{n(!0),i(null);const l=await kh.getBoardMembers();e(l)}catch(l){console.error("Error loading board members:",l),i("Failed to load board members")}finally{n(!1)}};return x.useEffect(()=>{o()},[]),{boardMembers:t,loading:r,error:a,refetch:o}};class Cwe{async getActiveDescription(){const{data:e,error:r}=await Q.from("board_description").select("*").eq("is_active",!0).single();return r?(console.error("Error fetching active board description:",r),null):e}async getAllDescriptions(){const{data:e,error:r}=await Q.from("board_description").select("*").order("created_at",{ascending:!1});return r?(console.error("Error fetching all board descriptions:",r),[]):e||[]}async updateDescription(e,r){try{const{error:n}=await Q.from("board_description").update(r).eq("id",e);return n?(console.error("Error updating board description:",n),{success:!1,error:n.message}):{success:!0}}catch(n){return console.error("Error updating board description:",n),{success:!1,error:"Failed to update description"}}}async createDescription(e){try{const{data:r,error:n}=await Q.from("board_description").insert([{...e,is_active:e.is_active??!1}]).select().single();return n?(console.error("Error creating board description:",n),{success:!1,error:n.message}):{success:!0,data:r}}catch(r){return console.error("Error creating board description:",r),{success:!1,error:"Failed to create description"}}}async setActiveDescription(e){try{const{error:r}=await Q.from("board_description").update({is_active:!1}).neq("id","00000000-0000-0000-0000-000000000000");if(r)return console.error("Error deactivating descriptions:",r),{success:!1,error:r.message};const{error:n}=await Q.from("board_description").update({is_active:!0}).eq("id",e);return n?(console.error("Error activating description:",n),{success:!1,error:n.message}):{success:!0}}catch(r){return console.error("Error setting active description:",r),{success:!1,error:"Failed to set active description"}}}async deleteDescription(e){try{const{error:r}=await Q.from("board_description").delete().eq("id",e);return r?(console.error("Error deleting board description:",r),{success:!1,error:r.message}):{success:!0}}catch(r){return console.error("Error deleting board description:",r),{success:!1,error:"Failed to delete description"}}}}const hg=new Cwe,kwe=()=>{const{boardMembers:t,loading:e,error:r,refetch:n}=Swe(),[a,i]=x.useState(null),[o,l]=x.useState(!0);x.useEffect(()=>{c()},[]);const c=async()=>{try{l(!0);const u=await hg.getActiveDescription();i(u)}catch(u){console.error("Error fetching board description:",u)}finally{l(!1)}};return e?s.jsx("div",{className:"py-12",children:s.jsx("div",{className:"container-wrapper",children:s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-chamber-blue mx-auto mb-4"}),s.jsx("p",{children:"Loading board members..."})]})})})}):r?s.jsx("div",{className:"py-12",children:s.jsx("div",{className:"container-wrapper",children:s.jsxs("div",{className:"text-center py-12",children:[s.jsx("p",{className:"text-red-600 mb-4",children:r}),s.jsx("button",{onClick:n,className:"text-chamber-blue hover:underline",children:"Try again"})]})})}):s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs("div",{className:"mb-12 text-center",children:[s.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Board of Directors"}),s.jsx("p",{className:"max-w-2xl mx-auto text-gray-600 text-lg",children:"Meet the dedicated professionals who provide leadership and strategic guid
995ance to our Chamber of Commerce."})]}),t.length>0?s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8 mb-12",children:t.map(u=>s.jsxs(De,{className:"overflow-hidden",children:[s.jsx("div",{className:"aspect-square bg-gray-100 flex items-center justify-center overflow-hidden",children:u.image_url?s.jsx("img",{src:u.image_url,alt:u.name,className:"w-full h-full object-contain"}):s.jsx(Yy,{className:"h-24 w-24 text-gray-400"})}),s.jsxs(Be,{className:"p-6",children:[s.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:u.name}),s.jsx("p",{className:"text-sm font-medium text-chamber-blue mb-3",children:u.title}),s.jsx("p",{className:"text-gray-600",children:u.bio})]})]},u.id))}):s.jsxs("div",{className:"text-center py-12",children:[s.jsx(Yy,{className:"h-16 w-16 text-gray-400 mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No board members found"}),s.jsx("p",{className:"text-gray-600",children:"Board member information will be displayed here when available."})]}),s.jsx("div",{className:"bg-gray-50 p-8 rounded-lg",children:o?s.jsxs("div",{className:"flex items-center justify-center py-8",children:[s.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-chamber-blue mr-2"}),s.jsx("span",{children:"Loading board information..."})]}):a?s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:a.title}),s.jsx("div",{className:"text-gray-700 whitespace-pre-line",children:a.content.split(` 996 997`).map((u,d)=>s.jsx("p",{className:"mb-4",children:u.includes("Contact page")?s.jsxs(s.Fragment,{children:[u.split("Contact page")[0],s.jsx(rt,{to:"/contact",className:"text-chamber-blue hover:underline",children:"Contact page"}),u.split("Contact page")[1]]}):u},d))})]}):s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"About Our Board"}),s.jsx("p",{className:"text-gray-700 mb-4",children:"Our Board of Directors is comprised of local business leaders and community stakeholders who volunteer their time and expertise to guide the Chamber's mission and strategic initiatives."}),s.jsx("p",{className:"text-gray-700 mb-4",children:"Board members serve three-year terms and meet monthly to discuss Chamber operations, events, policy advocacy, and business support initiatives. They represent various industries and business sizes to ensure diverse perspectives in Chamber leadership."}),s.jsxs("p",{className:"text-gray-700",children:["If you're interested in learning more about board service or nominating someone for a future position, please contact our Executive Director through our ",s.jsx(rt,{to:"/contact",className:"text-chamber-blue hover:underline",children:"Contact page"}),"."]})]})})]})})},Za={async getAll(){const{data:t,error:e}=await Q.from("committees").select("*").eq("is_active",!0).order("name");if(e)throw e;return t||[]},async getAllForAdmin(){const{data:t,error:e}=await Q.from("committees").select("*").order("name");if(e)throw e;return t||[]},async getById(t){const{data:e,error:r}=await Q.from("committees").select("*").eq("id",t).single();if(r)throw r;return e},async create(t){const{data:{user:e}}=await Q.auth.getUser(),{data:r,error:n}=await Q.from("committees").insert({...t,created_by:e==null?void 0:e.id}).select().single();if(n)throw n;return r},async update(t,e){const{data:r,error:n}=await Q.from("committees").update({...e,updated_at:new Date().toISOString()}).eq("id",t).select().single();if(n)throw n;return r},async delete(t){const{error:e}=await Q.from("committees").delete().eq("id",t);if(e)throw e},async getApplications(){const{data:t,error:e}=await Q.from("committee_applications").select(` 998 *, 999 committee:committees(name) 1000 `).order("created_at",{ascending:!1});if(e)throw e;return t||[]},async getApplicationsByCommittee(t){const{data:e,error:r}=await Q.from("committee_applications").select("*").eq("committee_id",t).order("created_at",{ascending:!1});if(r)throw r;return e||[]},async createApplication(t){const{data:{user:e}}=await Q.auth.getUser(),{data:r,error:n}=await Q.from("committee_applications").insert({...t,user_id:e==null?void 0:e.id}).select().single();if(n)throw n;return r},async approveApplication(t,e){var d;const{data:{user:r}}=await Q.auth.getUser(),{data:n,error:a}=await Q.from("committee_applications").select("*").eq("id",t).single();if(a)throw a;const{error:i}=await Q.from("committee_applications").update({status:"approved",admin_notes:e,reviewed_by:r==null?void 0:r.id,reviewed_at:new Date().toISOString(),updated_at:new Date().toISOString()}).eq("id",t);if(i)throw i;const{data:o,error:l}=await Q.from("committee_members").select("display_order").eq("committee_id",n.committee_id).eq("is_active",!0).order("display_order",{ascending:!1,nullsFirst:!1}).limit(1);if(l)throw l;const c=(((d=o==null?void 0:o[0])==null?void 0:d.display_order)??0)+1,{error:u}=await Q.from("committee_members").insert({committee_id:n.committee_id,user_id:n.user_id,member_name:n.applicant_name,member_email:n.applicant_email,role:"member",display_order:c});if(u)throw u},async rejectApplication(t,e){const{data:{user:r}}=await Q.auth.getUser(),{error:n}=await Q.from("committee_applications").update({status:"rejected",admin_notes:e,reviewed_by:r==null?void 0:r.id,reviewed_at:new Date().toISOString(),updated_at:new Date().toISOString()}).eq("id",t);if(n)throw n},async deleteApplication(t){const{error:e}=await Q.from("committee_applications").delete().eq("id",t);if(e)throw e},async getCommitteeMembers(t){const{data:e,error:r}=await Q.from("committee_members").select("*").eq("committee_id",t).eq("is_active",!0).order("display_order",{ascending:!0,nullsFirst:!1}).order("joined_at",{ascending:!0});if(r)throw r;return e||[]},async removeMember(t){const{error:e}=await Q.from("committee_members").update({is_active:!1}).eq("id",t);if(e)throw e},async updateMemberRole(t,e){const{error:r}=await Q.from("committee_members").update({role:e,updated_at:new Date().toISOString()}).eq("id",t);if(r)throw r},async deleteMember(t){const{error:e}=await Q.from("committee_members").delete().eq("id",t);if(e)throw e},async addMember(t,e,r="member"){var m;const{data:n,error:a}=await Q.from("profiles").select("first_name, last_name, email").eq("id",e).single();if(a||!n)throw new Error("User profile not found. Only registered residents or business owners can be added.");
1000const i=[n.first_name,n.last_name].filter(Boolean).join(" ")||n.email,o=n.email||"",{data:l}=await Q.from("committee_members").select("id").eq("committee_id",t).eq("user_id",e).eq("is_active",!0).maybeSingle();if(l)throw new Error("This person is already a member of the committee.");const{data:c,error:u}=await Q.from("committee_members").select("display_order").eq("committee_id",t).eq("is_active",!0).order("display_order",{ascending:!1,nullsFirst:!1}).limit(1);if(u)throw u;const d=(((m=c==null?void 0:c[0])==null?void 0:m.display_order)??0)+1,{data:h,error:f}=await Q.from("committee_members").insert({committee_id:t,user_id:e,member_name:i,member_email:o,role:r,display_order:d,is_active:!0}).select().single();if(f)throw f;return h},async reorderCommitteeMembers(t){const e=t.map((r,n)=>({id:r,display_order:n+1}));for(const r of e){const{error:n}=await Q.from("committee_members").update({display_order:r.display_order,updated_at:new Date().toISOString()}).eq("id",r.id);if(n)throw n}}},_we=({onSuccess:t})=>{const{user:e}=ts(),{toast:r}=St(),[n,a]=x.useState([]),[i,o]=x.useState(!1),[l,c]=x.useState(!1),[u,d]=x.useState({committee_id:"",applicant_name:"",applicant_email:"",phone:"",experience:"",motivation:"",availability:""});x.useEffect(()=>{h(),e&&f()},[e]);const h=async()=>{try{const y=await Za.getAll();a(y)}catch(y){console.error("Error loading committees:",y)}},f=async()=>{if(e!=null&&e.id)try{const{data:y,error:b}=await Q.from("profiles").select("first_name, last_name, email").eq("id",e.id).single();if(b)throw b;y&&d(w=>({...w,applicant_name:`${y.first_name||""} ${y.last_name||""}`.trim(),applicant_email:y.email||""}))}catch(y){console.error("Error loading user profile:",y)}},m=async y=>{if(y.preventDefault(),!e){r({title:"Authentication Required",description:"Please log in to apply for a committee position.",variant:"destructive"});return}o(!0);try{await Za.createApplication(u),c(!0),r({title:"Application Submitted!",description:"Thank you for your interest. We'll review your application and get back to you soon."}),t==null||t()}catch(b){console.error("Error submitting application:",b),r({title:"Submission Failed",description:"Error submitting application. Please try again.",variant:"destructive"})}finally{o(!1)}},g=(y,b)=>{d(w=>({...w,[y]:b}))};return l?s.jsx(De,{className:"max-w-2xl mx-auto",children:s.jsx(Be,{className:"p-8 text-center",children:s.jsxs("div",{className:"mb-4",children:[s.jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx("svg",{className:"w-8 h-8 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),s.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:"Application Submitted!"}),s.jsx("p",{className:"text-gray-600",children:"Thank you for your interest in joining our committee. We'll review your application and get back to you soon."})]})})}):e?s.jsxs(De,{className:"max-w-2xl mx-auto",children:[s.jsxs(ot,{children:[s.jsx(ut,{children:"Apply to Join a Committee"}),s.jsx("p",{className:"text-gray-600",children:"Fill out this form to apply for a committee position. All applications are reviewed by our admin team."})]}),s.jsx(Be,{children:s.jsxs("form",{onSubmit:m,className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"committee_id",children:"Select Committee *"}),s.jsxs(Wt,{value:u.committee_id,onValueChange:y=>g("committee_id",y),required:!0,children:[s.jsx(Ht,{children:s.jsx(qt,{placeholder:"Choose a committee"})}),s.jsx($t,{children:n.map(y=>s.jsx(Ae,{value:y.id,children:y.name},y.id))})]})]}),s.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"applicant_name",children:"Full Name *"}),s.jsx(Ne,{id:"applicant_name",value:u.applicant_name,onChange:y=>g("applicant_name",y.target.value),placeholder:"John Doe",required:!0})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"applicant_email",children:"Email Address *"}),s.jsx(Ne,{id:"applicant_email",type:"email",value:u.applicant_email,onChange:y=>g("applicant_email",y.target.value),placeholder:"[email protected]",required:!0})]})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"phone",children:"Phone Number"}),s.jsx(Ne,{id:"phone",type:"tel",value:u.phone,onChange:y=>g("phone",y.target.value),placeholder:"(555) 123-4567"})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"motivation",children:"Why do you want to join this committee? *"}),s.jsx(zt,{id:"motivation",value:u.motivation,onChange:y=>g("motivation",y.target.value),rows:4,placeholder:"Tell us about your interest in this committee and what you hope to contribute...",required:!0})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"experience",children:"Relevant Experience"}),s.jsx(zt,{id:"experience",value:u.experience,onChange:y=>g("experience",y.target.value),rows:3,placeholder:"Describe any relevant experience, skills, or background that would be valuable to the committee..."})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"availability",children:"Availability"}),s.jsx(zt,{id:"availability",value:u.availability,onChange:y=>g("availability",y.target.value),rows:2,placeholder:"Let us know about your availability for meetings and committee activities..."})]}),s.jsx("div",{className:"flex justify-end",children:s.jsx(Y,{type:"submit",disabled:i,children:i?"Submitting...":"Submit Application"})})]})})]}):s.jsx(De,{className:"max-w-2xl mx-auto",children:s.jsxs(Be,{className:"p-8 text-center",children:[s.jsx("h2",{className:"text-xl font-bold mb-4",children:"Login Required"}),s.jsx("p",{className:"text-gray-600 mb-4",children:"Please log in to apply for a committee position."}),s.jsx(Y,{onClick:()=>window.location.href="/auth/login",children:"Log In"})]})})},Ewe=()=>{const[t,e]=x.useState([]),[r,n]=x.useState({}),[a,i]=x.useState(!0),[o,l]=x.useState(!1);x.useEffect(()=>{c()},[]);const c=async()=>{try{i(!0);const u=await Za.getAll();e(u);const d={};for(const h of u){const f=await Za.getCommitteeMembers(h.id);d[h.id]=f}n(d)}catch(u){console.error("Error loading committees:",u)}finally{i(!1)}};return o?s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsx("div",{className:"mb-8",children:s.jsx(Y,{variant:"outline",onClick:()=>l(!1),className:"mb-4",children:"â Back to Committees"})}),s.jsx(_we,{onSuccess:()=>{l(!1)}})]})}):s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs("div",{className:"mb-12 text-center",children:[s.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Chamber Committees"}),s.jsx("p",{className:"max-w-2xl mx-auto text-gray-600 text-lg",children:"Our committees are where the work of the Chamber happens. These dedicated volunteers contribute their expertise to advance our mission and support local businesses."})]}),s.jsx("div",{className:"bg-chamber-blue-light p-6 rounded-lg mb-12",children:s.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between",children:[s.jsxs("div",{className:"mb-4 md:mb-0",children:[s.jsx("h3",{className:"text-xl font-bold text-chamber-blue-dark",children:"Get Involved!"}),s.jsx("p",{className:"text-gray-700",children:"Committee participation is a great way to network with peers and make a difference in our business community."})]}),s.jsx(Y,{className:"bg-chamber-blue",onClick:()=>l(!0),children:"Apply to Join a Committee"})]})}),a?s.jsxs("div",{className:"space-y-8",children:[s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Mt,{className:"h-6 w-6 animate-spin text-chamber-blue"}),s.jsx("span",{className:"text-lg text-gray-600",children:"Loading committees..."})]})}),Array.from({length:3}).map((u,d)=>s.jsx(De,{children:s.jsx(Be,{className:"p-6",children:s.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[s.jsxs("div",{className:"md:w-2/3",children:[s.jsx(cs,{className:"h-8 w-3/4 mb-2"}),s.jsx(cs,{className:"h-4 w-full mb-2"}),s.jsx(cs,{className:"h-4 w-5/6 mb-4"}),s.jsxs("div",{className:"space-y-2 mb-4",children:[s.jsx(cs,{className:"h-4 w-1/2"}),s.jsx(cs,{className:"h-4 w-2/3"}),s.jsx(cs,{className:"h-4 w-1/3"})]})]}),s.jsx("div",{className:"md:w-1/3",children:s.jsxs("div",{className:"bg-gray-50 p-4 rounded-md",children:[s.jsx(cs,{className:"h-5 w-3/4 mb-3"}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(cs,{className:"h-4 w-full"}),s.jsx(cs,{className:"h-4 w-5/6"}),s.jsx(cs,{className:"h-4 w-4/5"})]})]})})]})})},d))]}):s.jsx("div",{className:"space-y-8",children:t.map(u=>{const d=r[u.id]||[];return s.jsx(De,{children:s.jsx(Be,{className:"p-6",children:s.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[s.jsxs("div",{className:"md:w-2/3",children:[s.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:u.name}),s.jsx("p",{className:"text-gray-600 mb-4",children:u.description}),s.jsxs("div",{className:"space-y-2 mb-4",children:[u.chair_name&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Os,{className:"h-4 w-4 text-gray-500"}),s.jsx("span",{className:"font-medium",children:"Chair:"}),s.jsx("span",{children:u.chair_name})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Br,{className:"h-4 w-4 text-gray-500"}),s.jsx("span",{className:"font-medium",children:"Meeting Schedule:"}),s.jsx("span",{children:u.meeting_schedule})]}),u.chair_email&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(fs,{className:"h-4 w-4 text-gray-500"}),s.jsx("span",{children:u.chair_email})]})]})]}),s.jsx("div",{className:"md:w-1/3",children:s.jsxs("div",{className:"bg-gray-50 p-4 rounded-md",children:[s.jsxs("div",{className:"flex items-center mb-3",children:[s.jsx(Os,{className:"h-5 w-5 text-chamber-blue mr-2"}),s.jsx("h3",{className:"font-medium",children:"Committee Members"})]}),d.length>0?s.jsx("ul",{className:"space-y-1",children:d.map(h=>s.jsxs("li",{className:"text-gray-600 text-sm flex items-center justify-between",children:[s.jsx("span",{children:h.member_name}),h.role!=="member"&&s.jsx("span",{className:"text-xs bg-chamber-blue text-white px-2 py-1 rounded",children:h.role.replace("_"," ")})]}
1000,h.id))}):s.jsx("p",{className:"text-gray-500 text-sm",children:"No members yet"})]})})]})})},u.id)})}),s.jsxs("div",{className:"mt-12 bg-gray-50 p-8 rounded-lg",children:[s.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"About Our Committees"}),s.jsx("p",{className:"text-gray-700 mb-4",children:"Committees are formed by the Board of Directors to address specific areas of focus for the Chamber. Committee members are volunteers who contribute their time, expertise and passion to help further the Chamber's mission."}),s.jsx("p",{className:"text-gray-700 mb-4",children:"Most committees meet monthly, and members serve one-year terms with the opportunity to continue their service. Chamber members in good standing are eligible to apply for committee positions."}),s.jsxs("p",{className:"text-gray-700",children:["For more information about joining a committee, please contact us at ",s.jsx("a",{href:"mailto:[email protected]",className:"text-chamber-blue hover:underline",children:"[email protected]"})," or through our ",s.jsx(rt,{to:"/contact",className:"text-chamber-blue hover:underline",children:"Contact page"}),"."]})]})]})})},Awe=[{id:1,name:"Richard B. Thompson",years:"1945-2018",contribution:"Founding member and first Chamber President who established our annual business awards.",imageUrl:"https://images.unsplash.com/photo-1566753323558-f4e0952af115?ixlib=rb-4.0.3&auto=format&fit=crop&w=256&q=80"},{id:2,name:"Eleanor Martinez",years:"1952-2020",contribution:"Led the Chamber's expansion efforts and pioneered our small business mentorship program.",imageUrl:"https://images.unsplash.com/photo-1531746020798-e6953c6e8e04?ixlib=rb-4.0.3&auto=format&fit=crop&w=256&q=80"},{id:3,name:"William J. Parker",years:"1938-2016",contribution:"Served 25 years on the board and established the Chamber's scholarship foundation.",imageUrl:"https://images.unsplash.com/photo-1552058544-f2b08422138a?ixlib=rb-4.0.3&auto=format&fit=crop&w=256&q=80"},{id:4,name:"Margaret Wilson",years:"1960-2022",contribution:"Chamber Executive Director who modernized o
1000perations and expanded membership by 300%.",imageUrl:"https://images.unsplash.com/photo-1544005313-94ddf0286df2?ixlib=rb-4.0.3&auto=format&fit=crop&w=256&q=80"}],Dwe=()=>s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs("div",{className:"mb-12 text-center",children:[s.jsx("div",{className:"inline-flex items-center justify-center p-3 bg-gray-100 text-gray-700 rounded-full mb-4",children:s.jsx(iF,{className:"h-6 w-6"})}),s.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"In Memoriam"}),s.jsx("p",{className:"max-w-2xl mx-auto text-gray-600 text-lg",children:"Honoring the memory of those who made extraordinary contributions to our Chamber and business community."})]}),s.jsxs("div",{className:"bg-gray-50 p-8 rounded-lg mb-12 text-center",children:[s.jsx("p",{className:"text-xl italic text-gray-700",children:'"The legacy of heroes is the memory of a great name and the inheritance of a great example."'}),s.jsx("p",{className:"mt-4 text-gray-500",children:"â Benjamin Disraeli"})]}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 mb-12",children:Awe.map(t=>s.jsx(De,{className:"overflow-hidden",children:s.jsxs("div",{className:"flex flex-col md:flex-row",children:[t.imageUrl&&s.jsx("div",{className:"md:w-1/3",children:s.jsx("img",{src:t.imageUrl,alt:t.name,className:"w-full h-full object-cover aspect-square"})}),s.jsxs(Be,{className:`p-6 ${t.imageUrl?"md:w-2/3":"w-full"}`,children:[s.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:t.name}),s.jsx("p",{className:"text-sm text-gray-500 mb-3",children:t.years}),s.jsx(yp,{className:"my-3"}),s.jsx("p",{className:"text-gray-700",children:t.contribution})]})]})},t.id))}),s.jsxs("div",{className:"bg-chamber-blue-light p-8 rounded-lg mb-12",children:[s.jsx("h2",{className:"text-2xl font-bold text-chamber-blue-dark mb-4",children:"Chamber Memorial Fund"}),s.jsx("p",{className:"text-gray-700 mb-4",children:"The Chamber Memorial Fund was established to honor the memory of chamber members who have passed away. Contributions to this fund support the Chamber's educational initiatives and scholarship programs."}),s.jsx("p",{className:"text-gray-700 mb-6",children:"If you would like to make a donation in memory of someone, please contact our office or visit our donation page."}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[s.jsx("a",{href:"/contact",className:"inline-flex justify-center items-center px-6 py-3 rounded-md bg-chamber-blue text-white font-medium hover:bg-chamber-blue-dark transition-colors",children:"Contact Us"}),s.jsx("a",{href:"#",className:"inline-flex justify-center items-center px-6 py-3 rounded-md border border-chamber-blue text-chamber-blue font-medium hover:bg-gray-50 transition-colors",children:"Make a Donation"})]})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Submit a Memorial"}),s.jsx("p",{className:"text-gray-700 mb-6 max-w-2xl mx-auto",children:"If you would like to submit information about a former Chamber member or community leader to be considered for our memorial page, please contact our office."}),s.jsx("a",{href:"/contact",className:"inline-flex justify-center items-center px-6 py-3 rounded-md bg-gray-200 text-gray-700 font-medium hover:bg-gray-300 transition-colors",children:"Submit Information"})]})]})});class Twe{async getAllCategories(e=!1){let r=Q.from("membership_benefits").select("*").order("display_order",{ascending:!0});e||(r=r.eq("is_active",!0));const{data:n,error:a}=await r;return a?(console.error("Error fetching membership benefits categories:",a),[]):n||[]}async getCategoryById(e){const{data:r,error:n}=await Q.from("membership_benefits").select("*").eq("id",e).single();return n?(console.error("Error fetching membership benefits category:",n),null):r}async updateCategory(e,r){var n;try{const{error:a}=await Q.from("membership_benefits").update({...r,updated_at:new Date().toISOString(),updated_by:(n=(await Q.auth.getUser()).data.user)==null?void 0:n.id}).eq("id",e);return a?(console.error("Error updating membership benefits category:",a),{success:!1,error:a.message}):{success:!0}}catch(a){return console.error("Error updating membership benefits category:",a),{success:!1,error:"Failed to update category"}}}async createCategory(e){var r,n;try{const{data:a,error:i}=await Q.from("membership_benefits").insert([{...e,is_active:e.is_active??!0,created_by:(r=(await Q.auth.getUser()).data.user)==null?void 0:r.id,updated_by:(n=(await Q.auth.getUser()).data.user)==null?void 0:n.id}]).select().single();return i?(console.error("Error creating membership benefits category:",i),{success:!1,error:i.message}):{success:!0,data:a}}catch(a){return console.error("Error creating membership benefits category:",a),{success:!1,error:"Failed to create category"}}}async deleteCategory(e){try{const{error:r}=await Q.from("membership_benefits").delete().eq("id",e);return r?(console.error("Error deleting membership benefits category:",r),{success:!1,error:r.message}):{success:!0}}catch(r){return console.error("Error deleting membership benefits category:",r),{success:!1,error:"Failed to delete category"}}}async updateDisplayOrder(e){try{const r=e.map(a=>Q.from("membership_benefits").update({display_order:a.display_order,updated_at:new Date().toISOString(),updated_by:Q.auth.getUser().then(({data:i})=>{var o;return(o=i.user)==null?void 0:o.id})}).eq("id",a.id)),n=await Promise.all(r);for(const a of n)if(a.error)return console.error("Error updating display order:",a.error),{success:!1,error:a.error.message};return{success:!0}}catch(r){return console.error("Error updating display orders:",r),{success:!1,error:"Failed to update display orders"}}}async toggleCategoryStatus(e){var r;try{const{data:n,error:a}=await Q.from("membership_benefits").select("is_active").eq("id",e).single();if(a)return console.error("Error fetching category status:",a),{success:!1,error:a.message};const i=!n.is_active,{error:o}=await Q.from("membership_benefits").update({is_active:i,updated_at:new Date().toISOString(),updated_by:(r=(await Q.auth.getUser()).data.user)==null?void 0:r.id}).eq("id",e);return o?(console.error("Error toggling category status:",o),{success:!1,error:o.message}):{success:!0}}catch(n){return console.error("Error toggling category status:",n),{success:!1,error:"Failed to toggle category status"}}}}const mg=new Twe;class Mwe{async getAllTestimonials(e=!1){let r=Q.from("membership_testimonials").select("*").order("display_order",{ascending:!0});e||(r=r.eq("is_active",!0));const{data:n,error:a}=await r;return a?(console.error("Error fetching testimonials:",a),[]):n||[]}async getTestimonialById(e){const{data:r,error:n}=await Q.from("membership_testimonials").select("*").eq("id",e).single();return n?(console.error("Error fetching testimonial:",n),null):r}async updateTestimonial(e,r){var n;try{const{error:a}=await Q.from("membership_testimonials").update({...r,updated_at:new Date().toISOString(),updated_by:(n=(await Q.auth.getUser()).data.user)==null?void 0:n.id}).eq("id",e);return a?(console.error("Error updating testimonial:",a),{success:!1,error:a.message}):{success:!0}}catch(a){return console.error("Error updating testimonial:",a),{success:!1,error:"Failed to update testimonial"}}}async createTestimonial(e){var r,n;try{const{data:a,error:i}=await Q.from("membership_testimonials").insert([{...e,is_active:e.is_active??!0,created_by:(r=(await Q.auth.getUser()).data.user)==null?void 0:r.id,updated_by:(n=(await Q.auth.getUser()).data.user)==null?void 0:n.id}]).select().single();return i?(console.error("Error creating testimonial:",i),{success:!1,error:i.message}):{success:!0,data:a}}catch(a){return console.error("Error creating testimonial:",a),{success:!1,error:"Failed to create testimonial"}}}async deleteTestimonial(e){try{const{error:r}=await Q.from("membership_testimonials").delete().eq("id",e);return r?(console.error("Error deleting testimonial:",r),{success:!1,error:r.message}):{success:!0}}catch(r){return console.error("Error deleting testimonial:",r),{success:!1,error:"Failed to delete testimonial"}}}async toggleTestimonialStatus(e){var r;try{const{data:n,error:a}=await Q.from("membership_testimonials").select("is_active").eq("id",e).single();if(a)return console.error("Error fetching testimonial status:",a),{success:!1,error:a.message};const i=!n.is_active,{error:o}=await Q.from("membership_testimonials").update({is_active:i,updated_at:new Date().toISOString(),updated_by:(r=(await Q.auth.getUser()).data.user)==null?void 0:r.id}).eq("id",e);return o?(console.error("Error toggling testimonial status:",o),{success:!1,error:o.message}):{success:!0}}catch(n){return console.error("Error toggling testimonial status:",n),{success:!1,error:"Failed to toggle testimonial status"}}}}const fg=new Mwe;class Pwe{async getAllFAQs(e=!1){let r=Q.from("membership_faqs").select("*").order("display_order",{ascending:!0});e||(r=r.eq("is_active",!0));const{data:n,error:a}=await r;return a?(console.error("Error fetching FAQs:",a),[]):n||[]}async getFAQById(e){const{data:r,error:n}=await Q.from("membership_faqs").select("*").eq("id",e).single();return n?(console.error("Error fetching FAQ:",n),null):r}async updateFAQ(e,r){var n;try{const{error:a}=await Q.from("membership_faqs").update({...r,updated_at:new Date().toISOString(),updated_by:(n=(await Q.auth.getUser()).data.user)==null?void 0:n.id}).eq("id",e);return a?(console.error("Error updating FAQ:",a),{success:!1,error:a.message}):{success:!0}}catch(a){return console.error("Error updating FAQ:",a),{success:!1,error:"Failed to update FAQ"}}}async createFAQ(e){var r,n;try{const{data:a,error:i}=await Q.from("membership_faqs").insert([{...e,is_active:e.is_active??!0,created_by:(r=(await Q.auth.getUser()).data.user)==null?void 0:r.id,updated_by:(n=(await Q.auth.getUser()).data.user)==null?void 0:n.id}]).select().single();return i?(console.error("Error creating FAQ:",i),{success:!1,error:i.message}):{success:!0,data:a}}catch(a){return console.error("Error creating FAQ:",a),{success:!1,error:"Failed to create FAQ"}}}async deleteFAQ(e){try{const{error:r}=await Q.from("membership_faqs").delete().eq("id",e);return r?(console.error("Error deleting FAQ:",r),{success:!1,error:r.message}):{success:!0}}catch(r){return console.error("Error deleting FAQ:",r),{success:!1,error:"Failed to delete FAQ"}}}async toggleFAQStatus(e){var r;try{const{data:n,error:a}=await Q.from("membership_faqs").select("is_active").eq("id",e).single();if(a)return console.error("Error fetching FAQ status:",a),{success:!1,error:a.message};const i=!n.is_active,{error:o}=await Q.from("membership_faqs").update({is_active:i,updated_at:new Date().toISOString(),updated_by:(r=(await Q.auth.getUser()).data.user)==null?void 0:r.id}).eq("id",e);return o?(console.error("Error toggling FAQ status:",o),{success:!1,error:o.message}):{success:!0}}catch(n){return console.error("Error toggling FAQ status:",n),{success:!1,error:"Failed to toggle FAQ status"}}}}const pg=new Pwe,h3=[{id:"1",category_name:"Business Development",category_icon:"Building",display_order:1,benefits:["Free listing in online business directory","Referrals from Chamber staff","Promotional opportunities at Chamber events","Ribbon cutting ceremonies for new businesses","Member-to-member discount program participation"],is_active:!0,created_by:"",updated_by:"",created_at:"",updated_at:""},{id:"2",category_name:"Networking & Events",category_icon:"Users",display_order:2,benefits:["Access to exclusive networking events","Member-only tickets to Chamber functions","Opportunities to host Chamber events","Annual awards ceremony recognition","Committee participation opportunities"],is_active:!0,created_by:"",updated_by:"",created_at:"",updated_at:""},{id:"3",category_name:"Marketing & Promotion",category_icon:"Globe",display_order:3,benefits:["Social media promotion of your business","Feature articles in Chamber newsletter","Sponsorship opportunities","Insider deals for public and members only","Press release distribution assistance"],is_active:!0,created_by:"",updated_by:"",created_at:"",updated_at:""},{id:"4",category_name:"Resources & Support",category_icon:"Badge",display_order:4,benefits:["Access to business mentorship programs","E
1000ducational workshops and seminars","Small business development resources","Legislative advocacy at local and state levels","Workforce development programs"],is_active:!0,created_by:"",updated_by:"",created_at:"",updated_at:""}],m3=[{id:"1",quote:"Joining the Chamber was one of the best business decisions I've made. The networking opportunities alone have brought us multiple new clients.",author_name:"Sarah Williams",author_business:"Williams Design Studio",display_order:1,is_active:!0,created_by:"",updated_by:"",created_at:"",updated_at:""},{id:"2",quote:"The Chamber's advocacy efforts have really made a difference for small businesses like mine. They give us a voice in important policy decisions.",author_name:"Michael Johnson",author_business:"Johnson's Hardware",display_order:2,is_active:!0,created_by:"",updated_by:"",created_at:"",updated_at:""},{id:"3",quote:"The educational resources and workshops have helped me stay current with business trends and best practices. It's like having a business consultant on call.",author_name:"Lisa Chen",author_business:"Cornerstone Financial",display_order:3,is_active:!0,created_by:"",updated_by:"",created_at:"",updated_at:""}],f3=[{id:"1",question:"How do I join the Chamber?",answer:"You can join by completing our online application, calling our office, or visiting in person. Our membership team will guide you through the process.",display_order:1,is_active:!0,created_by:"",updated_by:"",created_at:"",updated_at:""},{id:"2",question:"When are membership dues collected?",answer:"Membership dues are collected annually. You can choose to pay in full or set up quarterly installments.",display_order:2,is_active:!0,created_by:"",updated_by:"",created_at:"",updated_at:""},{id:"3",question:"Can multiple employees from my company participate in Chamber events?",answer:"Yes! Your membership covers your entire organization. Different representatives can attend different events based on their interests and expertise.",display_order:3,is_active:!0,created_by:"",updated_by:"",created_at:"",updated_at:""}],Rwe=()=>{const[t,e]=x.useState([]),[r,n]=x.useState([]),[a,i]=x.useState([]),[o,l]=x.useState(!0);x.useEffect(()=>{(async()=>{try{l(!0);const[d,h,f]=await Promise.all([mg.getAllCategories(!1),fg.getAllTestimonials(!1),pg.getAllFAQs(!1)]);e(d.length>0?d:h3),n(h.length>0?h:m3),i(f.length>0?f:f3)}catch(d){console.error("Error fetching membership data:",d),e(h3),n(m3),i(f3)}finally{l(!1)}})()},[]);const c=u=>({Building:ka,Users:Os,Globe:Bc,Badge:TV,Check:un,ArrowRight:ul})[u]||ka;return s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs("div",{className:"mb-12 text-center",children:[s.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Membership Benefits"}),s.jsx("p",{className:"max-w-2xl mx-auto text-gray-600 text-lg",children:"Join our Chamber to access a wide range of benefits designed to help your business grow, connect, and thrive in our community."})]}),s.jsx("div",{className:"bg-chamber-blue text-white p-8 rounded-lg mb-12",children:s.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-center",children:[s.jsxs("div",{className:"mb-6 md:mb-0",children:[s.jsx("h2",{className:"text-2xl font-bold mb-2",children:"Ready to Join?"}),s.jsx("p",{className:"text-chamber-blue-light",children:"Become a member today and start enjoying these benefits immediately."})]}),s.jsxs("a",{href:"/auth/signup",className:"inline-flex items-center px-6 py-3 rounded-md bg-white text-chamber-blue font-medium hover:bg-gray-100 transition-colors",children:["Join Now ",s.jsx(ul,{className:"ml-2 h-4 w-4"})]})]})}),o?s.jsx("div",{className:"flex justify-center items-center py-12",children:s.jsx(Mt,{className:"h-8 w-8 animate-spin text-chamber-blue"})}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8 mb-12",children:t.sort((u,d)=>u.display_order-d.display_order).map(u=>{const d=c(u.category_icon);return s.jsx(De,{children:s.jsxs(Be,{className:"p-6",children:[s.jsxs("div",{className:"flex items-center mb-4",children:[s.jsx("div",{className:"p-2 rounded-full bg-chamber-blue-light text-chamber-blue mr-3",children:s.jsx(d,{className:"h-6 w-6"})}),s.jsx("h3",{className:"text-xl font-bold",children:u.category_name})]}),s.jsx("ul",{className:"space-y-2",children:u.benefits.map((h,f)=>s.jsxs("li",{className:"flex items-start",children:[s.jsx(un,{className:"h-5 w-5 text-green-600 mr-2 flex-shrink-0 mt-0.5"}),s.jsx("span",{children:h})]},f))})]})},u.id)})}),s.jsxs("div",{className:"mb-12",children:[s.jsx("h2",{className:"text-2xl font-bold text-center mb-8",children:"What Our Members Say"}),r.length>0?s.jsx("div",{className:`grid grid-cols-1 ${r.length>=3?"md:grid-cols-3":"md:grid-cols-2"} gap-6`,children:r.sort((u,d)=>u.display_order-d.display_order).map(u=>s.jsxs("div",{className:"bg-gray-50 p-6 rounded-lg",children:[s.jsxs("p",{className:"italic text-gray-700 mb-4",children:['"',u.quote,'"']}),s.jsxs("p",{className:"font-medium",children:["â ",u.author_name,", ",u.author_business]})]},u.id))}):s.jsx("div",{className:"text-center text-gray-500",children:s.jsx("p",{children:"No testimonials available at this time."})})]}),s.jsxs("div",{className:"mb-12",children:[s.jsx("h2",{className:"text-2xl font-bold text-center mb-8",children:"Frequently Asked Questions"}),a.length>0?s.jsx("div",{className:"space-y-6",children:a.sort((u,d)=>u.display_order-d.display_order).map(u=>s.jsxs("div",{children:[s.jsx("h3",{className:"font-bold text-lg mb-2",children:u.question}),s.jsx("p",{className:"text-gray-700",children:u.answer})]},u.id))}):s.jsx("div",{className:"text-center text-gray-500",children:s.jsx("p",{children:"No frequently asked questions available at this time."})})]}),s.jsxs("div",{className:"text-center",children:[s.jsxs(rt,{to:"/auth/signup",className:"inline-flex items-center px-8 py-3 rounded-md bg-chamber-blue text-white font-medium text-lg hover:bg-chamber-blue-dark transition-colors",children:["Join the Chamber Today ",s.jsx(ul,{className:"ml-2 h-5 w-5"})]}),s.jsxs("p",{className:"mt-4 text-gray-600",children:["Questions about membership? ",s.jsx(rt,{to:"/contact",className:"text-chamber-blue hover:underline",children:"Contact us"})," or call (555) 123-4567."]})]})]})})},Bwe=()=>{const t=[{icon:Io,title:"Chamber Credits",description:"Earn $50 in Chamber credits for each new member you refer that joins. Use credits for event tickets, sponsorships, and more."},{icon:Jy,title:"Recognition",description:"Top referrers are recognized at our Annual Awards Gala and featured in our newsletter and social media."},{icon:Os,title:"Network Growth",description:"Strengthen the Chamber community while expanding your own business network with valuable connections."}],e=["Talk to business owners about the benefits of Chamber membership","Submit their information through our referral form or send them a personalized link","Our membership team will reach out and guide them through the process","When they join, you'll receive credit and recognition for the referral"];return s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container-wrapper",children:[s.jsxs("div",{className:"mb-12 text-center",children:[s.jsx("h1",{className:"text-4xl font-bold text-gray-900 mb-4",children:"Member Referral Program"}),s.jsx("p",{className:"max-w-2xl mx-auto text-gray-600 text-lg",children:"Help grow our Chamber community and earn rewards when you refer new members to join."})]}),s.jsxs("div",{className:"bg-chamber-blue text-white p-8 rounded-lg mb-12",children:[s.jsx("h2",{className:"text-2xl font-bold mb-4",children:"About the Program"}),s.jsx("p",{className:"mb-6",children:"Our Member Referral Program is designed to reward our members for helping us grow our community. When you refer a business that joins the Chamber, you'll earn valuable Chamber credits and recognition."}),s.jsx("p",{className:"font-medium",children:'"Members Referring Members" is the most effective way to build a strong and vibrant business community!'})]}),s.jsxs("div",{className:"mb-12",children:[s.jsx("h2",{className:"text-2xl font-bold text-center mb-8",children:"Why Refer New Members?"}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:t.map((r,n)=>s.jsx(De,{className:"text-center",children:s.jsxs(Be,{className:"p-6",children:[s.jsx("div",{className:"mb-4 flex justify-center",children:s.jsx("div",{className:"p-3 rounded-full bg-chamber-blue-light text-chamber-blue",children:s.jsx(r.icon,{className:"h-8 w-8"})})}),s.jsx("h3",{className:"text-xl font-bold mb-2",children:r.title}),s.jsx("p",{className:"text-gray-600",children:r.description})]})}
1000,n))})]}),s.jsxs("div",{className:"mb-12",children:[s.jsx("h2",{className:"text-2xl font-bold text-center mb-8",children:"How It Works"}),s.jsx("div",{className:"bg-gray-50 p-6 rounded-lg",children:s.jsx("ol",{className:"space-y-6",children:e.map((r,n)=>s.jsxs("li",{className:"flex items-start",children:[s.jsx("div",{className:"flex-shrink-0 h-8 w-8 rounded-full bg-chamber-blue text-white flex items-center justify-center font-bold mr-4",children:n+1}),s.jsx("div",{className:"pt-1",children:r})]},n))})})]}),s.jsxs("div",{className:"mb-12",children:[s.jsx("h2",{className:"text-2xl font-bold text-center mb-8",children:"Success Stories"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsx("div",{className:"bg-white p-6 rounded-lg shadow-sm border",children:s.jsxs("div",{className:"flex items-start mb-4",children:[s.jsx(Or,{className:"h-5 w-5 text-green-600 mr-2 flex-shrink-0 mt-1"}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-bold",children:"Susan Thompson - Downtown Cafe"}),s.jsx("p",{className:"text-gray-600",children:'"I referred three new members last year and used my chamber credits to sponsor our booth at the annual business expo. It was a win-win!"'})]})]})}),s.jsx("div",{className:"bg-white p-6 rounded-lg shadow-sm border",children:s.jsxs("div",{className:"flex items-start mb-4",children:[s.jsx(Or,{className:"h-5 w-5 text-green-600 mr-2 flex-shrink-0 mt-1"}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-bold",children:"Mark Davis - Davis Insurance"}),s.jsx("p",{className:"text-gray-600",children:'"The referral program helped me strengthen my business relationships. I connected five businesses with the Chamber last year and was recognized as a top referrer."'})]})]})})]})]}),s.jsxs("div",{className:"mb-12",children:[s.jsx("h2",{className:"text-2xl font-bold text-center mb-8",children:"Top Referrers This Year"}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"min-w-full bg-white border",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-gray-100",children:[s.jsx("th",{className:"py-3 px-4 text-left border",children:"Member"}),s.jsx("th",{className:"py-3 px-4 text-left border",children:"Business"}),s.jsx("th",{className:"py-3 px-4 text-center border",children:"Referrals"}),s.jsx("th",{className:"py-3 px-4 text-center border",children:"Credits Earned"})]})}),s.jsxs("tbody",{children:[s.jsxs("tr",{children:[s.jsx("td",{className:"py-3 px-4 border font-medium",children:"James Wilson"}),s.jsx("td",{className:"py-3 px-4 border",children:"Wilson's Marketing Agency"}),s.jsx("td",{className:"py-3 px-4 border text-center",children:"7"}),s.jsx("td",{className:"py-3 px-4 border text-center",children:"$350"})]}),s.jsxs("tr",{className:"bg-gray-50",children:[s.jsx("td",{className:"py-3 px-4 border font-medium",children:"Maria Rodriguez"}),s.jsx("td",{className:"py-3 px-4 border",children:"Cornerstone Accounting"}),s.jsx("td",{className:"py-3 px-4 border text-center",children:"5"}),s.jsx("td",{className:"py-3 px-4 border text-center",children:"$250"})]}),s.jsxs("tr",{children:[s.jsx("td",{className:"py-3 px-4 border font-medium",children:"Robert Johnson"}),s.jsx("td",{className:"py-3 px-4 border",children:"Johnson Law Group"}),s.jsx("td",{className:"py-3 px-4 border text-center",children:"4"}),s.jsx("td",{className:"py-3 px-4 border text-center",children:"$200"})]})]})]})})]}),s.jsx("div",{className:"bg-chamber-blue-light p-8 rounded-lg mb-8",children:s.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between",children:[s.jsxs("div",{className:"mb-6 md:mb-0 md:mr-6",children:[s.jsx("h3",{className:"text-xl font-bold text-chamber-blue-dark mb-2",children:"Ready to Refer?"}),s.jsx("p",{className:"text-gray-700",children:"Help grow our business community while earning rewards. Submit your referrals today!"})]}),s.jsx(Y,{className:"bg-chamber-blue",children:"Submit a Referral"})]})}),s.jsxs("div",{className:"mb-12",children:[s.jsx("h2",{className:"text-2xl font-bold text-center mb-8",children:"Frequently Asked Questions"}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"font-bold text-lg mb-2",children:"Is there a limit to how many businesses I can refer?"}),s.jsx("p",{className:"text-gray-700",children:"No! You can refer as many businesses as you'd like, and you'll earn credits for each one that joins."})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-bold text-lg mb-2",children:"How do the Chamber credits work?"}),s.jsx("p",{className:"text-gray-700",children:"Chamber credits can be used like cash for Chamber events, sponsorships, advertising, and more. Credits are added to your account once the referred business joins and pays their dues."})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-bold text-lg mb-2",children:"How soon after I refer someone will they be contacted?"}),s.jsx("p",{className:"text-gray-700",children:"Our membership team typically reaches out within 2 business days of receiving a referral."})]})]})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-gray-700 mb-4",children:"For more information about our Member Referral Program, contact:"}),s.jsxs("p",{className:"font-medium",children:["Jane Smith, Membership Director",s.jsx("br",{}),s.jsx("a",{href:"mailto:[email protected]",className:"text-chamber-blue hover:underline",children:"[email protected]"}),s.jsx("br",{}),"(555) 123-4567"]})]})]})})},Lwe=ek,Iwe=tk,_9=x.forwardRef(({className:t,...e},r)=>s.jsx(z0,{className:xt("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",t),...e,ref:r}));_9.displayName=z0.displayName;const Owe=cp("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),E9=x.forwardRef(({side:t="right",className:e,children:r,...n},a)=>s.jsxs(Iwe,{children:[s.jsx(_9,{}),s.jsxs(U0,{ref:a,className:xt(Owe({side:t}),e),...n,children:[r,s.jsxs(W0,{className:"absolute right-4 top-4 roun
1000ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[s.jsx(Ir,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));E9.displayName=U0.displayName;const zwe=x.forwardRef(({className:t,...e},r)=>s.jsx(H0,{ref:r,className:xt("text-lg font-semibold text-foreground",t),...e}));zwe.displayName=H0.displayName;const Uwe=x.forwardRef(({className:t,...e},r)=>s.jsx($0,{ref:r,className:xt("text-sm text-muted-foreground",t),...e}));Uwe.displayName=$0.displayName;const na={getBusinesses:async t=>{console.log("ð Fetching businesses with params:",t);const{status:e="all",page:r=1,limit:n=8,sortField:a="business_name",sortDirection:i="asc",searchQuery:o=""}=t||{};try{let l=Q.from("business_profiles_with_owners").select("*",{count:"exact"});e!=="all"&&(l=l.eq("status",e)),o&&(l=l.or(`business_name.ilike.%${o}%,address_line1.ilike.%${o}%`));const c=a==="lastModified"?"updated_at":a==="owner"?"owner_first_name":a==="name"?"business_name":a==="paymentStatus"?"business_subscription_status":a;l=l.order(c,{ascending:i==="asc"});const u=(r-1)*n;l=l.range(u,u+n-1);const{data:d,error:h,count:f}=await l;if(h)throw console.error("â Error fetching businesses:",h),h;console.log(`â
Successfully fetched ${d==null?void 0:d.length} businesses`);const m=(d||[]).map(w=>w==null?void 0:w.id).filter(Boolean);let g=new Map,y=new Map;if(m.length>0){const{data:w}=await Q.from("business_profiles").select("id, featured, feature_subscription_status").in("id",m);for(const j of w||[]){const N=j;g.set(N.id,N.featured??!1),y.set(N.id,N.feature_subscription_status??null)}}return{businesses:(d||[]).map(w=>{const j=w,N=[j.address_line1];return j.address_line2&&N.push(j.address_line2),N.push(`${j.city}, ${j.state} ${j.zip_code}`),{id:j.id,name:j.business_name,address:N.join(", "),owner:{id:j.owner_id,name:`${j.owner_first_name||""} ${j.owner_last_name||""}`.trim()||"Unknown",email:j.owner_email||"No email provided"},status:j.status,lastModified:j.updated_at,isFirstBusiness:j.is_first_business||!1,businessSubscriptionStatus:j.business_subscription_status||"inactive",isOutsidePayment:j.is_outside_payment||!1,outsidePaymentNote:j.outside_payment_note||void 0,outsidePaymentExpirationYear:j.outside_payment_expiration_year||void 0,outsidePaymentCreatedAt:j.outside_payment_created_at||void 0,outsidePaymentUpdatedAt:j.outside_payment_updated_at||void 0,featured:g.get(j.id)??!1,feature_subscription_status:y.get(j.id)??null}}),total:f||0}}catch(l){throw console.error("â Unexpected error in getBusinesses:",l),l}},updateBusinessStatus:async(t,e)=>{console.log("ð Updating business status:",{id:t,status:e});try{const{data:r,error:n}=await Q.from("business_profiles").update({status:e,updated_at:new Date().toISOString()}).eq("id",t).select().single();if(n)throw console.error("â Error updating business status:",n),n;console.log("â
Update response:",r);const{data:a,error:i}=await Q.from("business_profiles_with_owners").select("*").eq("id",t).single();if(i)throw console.error("â Error fetching updated business:",i),i;if(!a)throw new Error(`Business with ID ${t} not found`);console.log("â
Successfully updated business status. New data:",a);const o=a,l=[o.address_line1];return o.address_line2&&l.push(o.address_line2),l.push(`${o.city}, ${o.state} ${o.zip_code}`),{id:o.id,name:o.business_name,address:l.join(", "),owner:{id:o.owner_id,name:`${o.owner_first_name||""} ${o.owner_last_name||""}`.trim()||"Unknown",email:o.owner_email||"No email provided"},status:o.status,lastModified:o.updated_at,isFirstBusiness:o.is_first_business||!1,businessSubscriptionStatus:o.business_subscription_status||"inactive",isOutsidePayment:o.is_outside_payment||!1,outsidePaymentNote:o.outside_payment_note||void 0,outsidePaymentExpirationYear:o.outside_payment_expiration_year||void 0,outsidePaymentCreatedAt:o.outside_payment_created_at||void 0,outsidePaymentUpdatedAt:o.outside_payment_updated_at||void 0}}catch(r){throw console.error("â Unexpected error in updateBusinessStatus:",r),r}},updateOutsidePayment:async(t,e)=>{console.log("ð Updating outside payment settings:",{id:t,outsidePaymentData:e});try{const r=new Date().toISOString(),n={is_outside_payment:e.isOutsidePayment,outside_payment_note:e.outsidePaymentNote||null,outside_payment_expiration_year:e.outsidePaymentExpirationYear||null,outside_payment_updated_at:r,updated_at:r};if(e.businessSubscriptionStatus&&(n.business_subscription_status=e.businessSubscriptionStatus),e.isOutsidePayment){const{data:d}=await Q.from("business_profiles").select("is_outside_payment, outside_payment_created_at").eq("id",t).single();(!(d!=null&&d.is_outside_payment)||!(d!=null&&d.outside_payment_created_at))&&(n.outside_payment_created_at=r)}else n.outside_payment_created_at=null,n.outside_payment_note=null,n.outside_payment_expiration_year=null;const{data:a,error:i}=await Q.from("business_profiles").update(n).eq("id",t).select().single();if(i)throw console.error("â Error updating outside payment settings:",i),i;const{data:o,error:l}=await Q.from("business_profiles_with_owners").select("*").eq("id",t).single();if(l)throw console.error("â Error fetching updated business:",l),l;if(!o)throw new Error(`Business with ID ${t} not found`);const c=o,u=[c.address_line1];return c.address_line2&&u.push(c.address_line2),u.push(`${c.city}, ${c.state} ${c.zip_code}`),{id:c.id,name:c.business_name,address:u.join(", "),owner:{id:c.owner_id,name:`${c.owner_first_name||""} ${c.owner_last_name||""}`.trim()||"Unknown",email:c.owner_email||"No email provided"},status:c.status,lastModified:c.updated_at,isFirstBusiness:c.is_first_business||!1,businessSubscriptionStatus:c.business_subscription_status||"inactive",isOutsidePayment:c.is_outside_payment||!1,outsidePaymentNote:c.outside_payment_note||void 0,outsidePaymentExpirationYear:c.outside_payment_expiration_year||void 0,outsidePaymentCreatedAt:c.outside_payment_created_at||void 0,outsidePaymentUpdatedAt:c.outside_payment_updated_at||void 0}}catch(r){throw console.error("â Unexpected error in updateOutsidePayment:",r),r}},deleteBusiness:async t=>{console.log("ðï¸ Deleting business and all related data:",{id:t});try{const{data:e,error:r}=await Q.rpc("delete_business_and_related_data",{p_business_id:t});if(r)throw console.error("â Error deleting business:",r),r;if(!e)throw new Error(`Failed to delete business with ID ${t}`);console.log("â
Successfully deleted business and all related data")}catch(e){throw console.error("â Unexpected error in deleteBusiness:",e),e}},getFeatured:async t=>{const{data:e,error:r}=await Q.from("business_profiles").select("featured").eq("id",t).single();if(r)throw console.error("â Error fetching featured status:",r),r;return(e==null?void 0:e.featured)??!1},getFeatureSubscriptionStatus:async t=>{const{data:e,error:r}=await Q.from("business_profiles").select("feature_subscription_status").eq("id",t).single();if(r)throw console.error("â Error fetching feature subscription status:",r),r;return(e==null?void 0:e.feature_subscription_status)??"inactive"},updateFeatured:async(t,e)=>{const{error:r}=await Q.from("business_profiles").update({featured:e,updated_at:new Date().toISOString()}).eq("id",t);if(r)throw console.error("â Error updating featured status:",r),r},updateFeatureSubscriptionStatus:async(t,e)=>{const r={feature_subscription_status:e,updated_at:new Date().toISOString()};e==="inactive"&&(r.featured=!1);const{error:n}=await Q.from("business_profiles").update(r).eq("id",t);if(n)throw console.error("â Error updating feature subscription status:",n),n},getStats:async()=>{try{const{data:t,error:e}=await Q.from("profiles").select("user_type");if(e)throw e;const r=(t==null?void 0:t.filter(d=>
1000d.user_type==="business").length)||0,n=(t==null?void 0:t.filter(d=>d.user_type==="residential").length)||0,{data:a,error:i}=await Q.from("business_profiles").select("id").eq("status","pending");if(i)throw i;const o=(a==null?void 0:a.length)||0,{data:l,error:c}=await Q.from("residential_profiles").select("id").eq("status","pending");if(c)throw c;const u=(l==null?void 0:l.length)||0;return{totalMembers:r+n,businessOwners:r,residents:n,pendingBusinesses:o,pendingResidents:u}}catch(t){throw console.error("â Error fetching stats:",t),t}}};function p3(t){const e=t.profiles;return{id:t.id,first_name:(e==null?void 0:e.first_name)??"",last_name:(e==null?void 0:e.last_name)??"",email:(e==null?void 0:e.email)??"",status:t.status,membership_status:(e==null?void 0:e.membership_status)??null,created_at:t.created_at??"",admin_notes:t.admin_notes,reviewed_by:t.reviewed_by,reviewed_at:t.reviewed_at}}const Pf={async getResidents(t){const{status:e="all",limit:r=10,offset:n,page:a=1,sortField:i="created_at",sortDirection:o="desc",searchQuery:l=""}=t??{},c=n??(a-1)*r,u=o==="asc";let d=[];if(l.trim()){const b=`%${l.trim()}%`,{data:w}=await Q.from("profiles").select("id").eq("user_type","residential").or(`first_name.ilike.${b},last_name.ilike.${b},email.ilike.${b}`);d=(w==null?void 0:w.map(j=>j.id))??[]}else{const{data:b}=await Q.from("profiles").select("id").eq("user_type","residential");d=(b==null?void 0:b.map(w=>w.id))??[]}if(d.length===0)return{residents:[],total:0};let h=Q.from("residential_profiles").select("id, status, created_at, admin_notes, reviewed_by, reviewed_at, profiles!inner(id, first_name, last_name, email, membership_status, created_at)",{count:"exact"}).in("id",d);e!=="all"&&(h=h.eq("status",e)),h=h.order("created_at",{ascending:u}).range(c,c+r-1);const{data:f,error:m,count:g}=await h;if(m)throw m;return{residents:(f??[]).map(b=>p3(b)),total:g??0}},async getResidentById(t){const{data:e,error:r}=await Q.from("residential_profiles").select("id, status, created_at, admin_notes, reviewed_by, reviewed_at, profiles!inner(id, first_name, last_name, email, membership_status, created_at)").eq("id",t).single();return r||!e?null:p3(e)},async updateStatus(t,e,r,n){const{data:a,error:i}=await Q.from("residential_profiles").update({status:e,admin_notes:n??null,reviewed_by:r,reviewed_at:new Date().toISOString(),updated_at:new Date().toISOString()}).eq("id",t).select().single();if(i)throw i;return a?await this.getResidentById(t):null},async getStats(){const{data:t,error:e}=await Q.from("residential_profiles").select("id").eq("status","pending");if(e)throw e;const{data:r,error:n}=await Q.from("residential_profiles").select("id").eq("status","approved");if(n)throw n;return{pendingResidents:(t==null?void 0:t.length)??0,approvedResidents:(r==null?void 0:r.length)??0}}},Hwe=()=>{const[t,e]=x.useState({ribbonCutting:0,businessApprovals:0,residentApprovals:0,blogPosts:0,contacts:0,deals:0,committees:0,events:0,total:0}),[r,n]=x.useState(!0),a=x.useCallback(async()=>{var i;try{n(!0);let o=0,l=0,c=0,u=0,d=0,h=0,f=0,m=0;try{const y=await d0.getAllRequests("pending");o=y.success&&((i=y.data)==null?void 0:i.length)||0}catch(y){console.error("Error fetching ribbon cutting requests:",y)}try{l=(await na.getStats()).pendingBusinesses||0}catch(y){console.error("Error fetching business approvals:",y)}try{c=(await Pf.getStats()).pendingResidents||0}catch(y){console.error("Error fetching resident approvals:",y)}try{const y=await Pc("pending");u=(y==null?void 0:y.length)||0}catch(y){console.error("Error fetching blog posts:",y)}try{const{data:y}=await Q.from("contacts").select("id").eq("status","in_review");d=(y==null?void 0:y.length)||0}catch(y){console.error("Error fetching contacts:",y)}try{const y=await yi.getPendingDeals();h=(y==null?void 0:y.length)||0}catch(y){console.error("Error fetching pending deals:",y)}try{f=(await Za.getApplications()).filter(b=>b.status==="pending").length}catch(y){console.error("Error fetching committee applications:",y)}try{const y=await cre();m=(y==null?void 0:y.length)||0}catch(y){console.error("Error fetching pending events:",y)}const g=o+l+c+u+d+h+f+m;
1000e({ribbonCutting:o,businessApprovals:l,residentApprovals:c,blogPosts:u,contacts:d,deals:h,committees:f,events:m,total:g})}catch(o){console.error("Error fetching pending requests:",o),e({ribbonCutting:0,businessApprovals:0,residentApprovals:0,blogPosts:0,contacts:0,deals:0,committees:0,events:0,total:0})}finally{n(!1)}},[]);return x.useEffect(()=>{a()},[a]),{pendingRequests:t,isLoading:r,refresh:a}},g3=({onLinkClick:t,className:e})=>{const r=Wi(),{pendingRequests:n}=Hwe(),a=[{title:"Dashboard",icon:$V,href:"/dashboard/admin/dashboard"},{title:"Members",icon:Os,href:"/dashboard/admin/members"},{title:"Businesses",icon:Ll,href:"/dashboard/admin/businesses"},{title:"Residents",icon:Os,href:"/dashboard/admin/residents"},{title:"Events",icon:Br,href:"/dashboard/admin/events"},{title:"Categories",icon:WV,href:"/dashboard/admin/categories"},{title:"Ribbon Cutting",icon:zl,href:"/dashboard/admin/ribbon-cutting"},{title:"Scholarships",icon:Zy,href:"/dashboard/admin/scholarships"},{title:"Blog",icon:ti,href:"/dashboard/admin/blog"},{title:"Newsletter",icon:fs,href:"/dashboard/admin/newsletter"},{title:"Terms & Conditions",icon:VV,href:"/dashboard/admin/terms"},{title:"About Us",icon:s6,href:"/dashboard/admin/about-us"},{title:"Membership Benefits",icon:ri,href:"/dashboard/admin/membership-benefits"},{title:"Hero Section",icon:vi,href:"/dashboard/admin/hero-section"},{title:"Board Members",icon:o6,href:"/dashboard/admin/board"},{title:"Committees",icon:vC,href:"/dashboard/admin/committees"},{title:"Jobs",icon:up,href:"/dashboard/admin/jobs"},{title:"Deals",icon:Io,href:"/dashboard/admin/deals"},{title:"Referrals",icon:Os,href:"/dashboard/admin/referrals"},{title:"Contacts",icon:pw,href:"/dashboard/admin/contacts"},{title:"Price Management",icon:Ii,href:"/dashboard/admin/price-management"},{title:"Tools",icon:tK,href:"/dashboard/admin/tools"},{title:"Settings",icon:jd,href:"/dashboard/admin/settings"}],i=o=>{switch(o){case"Dashboard":return n.total>0?n.total:0;case"Ribbon Cutting":return n.ribbonCutting;case"Businesses":return n.businessApprovals;case"Residents":return n.residentApprovals;case"Events":return n.events;case"Blog":return n.blogPosts;case"Contacts":return n.contacts;case"Deals":return n.deals;case"Committees":return n.committees;default:return 0}};return s.jsx("div",{className:xt(!e&&"w-64 flex-shrink-0 border-r border-gray-200 min-h-[calc(100vh-11rem)] p-4",e),children:s.jsx("nav",{children:s.jsx("ul",{className:"space-y-1 sm:space-y-2",children:a.map(o=>{const l=r.pathname===o.href,c=i(o.title),u=c>0;return s.jsx("li",{children:s.jsxs(rt,{to:o.href,onClick:t,className:xt("flex items-center justify-between p-2.5 sm:p-2 text-sm sm:text-base font-medium rounded-lg transition-colors duration-200 w-full",l?"bg-chamber-blue text-white":"text-gray-700 hover:bg-gray-100"),children:[s.jsxs("div",{className:"flex items-center min-w-0 flex-1",children:[s.jsx(o.icon,{className:"w-5 h-5 mr-3 flex-shrink-0"}),s.jsx("span",{className:"truncate",children:o.title})]}),u&&s.jsx(ke,{variant:"destructive",className:"ml-2 bg-red-500 text-white text-xs px-2 py-1 min-w-[20px] h-5 flex items-center justify-center animate-pulse flex-shrink-0",children:c})]})},o.href)})})})})},$we=()=>{const[t,e]=x.useState(!1);return s.jsxs("div",{className:"flex min-h-screen flex-col md:flex-row",children:[s.jsx("aside",{className:"hidden md:block",children:s.jsx(g3,{})}),s.jsxs("div",{className:"sticky top-0 z-40 flex items-center gap-3 border-b border-gray-200 bg-white px-4 py-3 md:hidden",children:[s.jsx(Y,{variant:"outline",size:"icon","aria-label":"Open admin menu",onClick:()=>e(!0),className:"shrink-0",children:s.jsx(n6,{className:"h-5 w-5"})}),s.jsx("h1",{className:"text-lg font-semibold text-gray-900 truncate",children:"Admin"})]}),s.jsx(Lwe,{open:t,onOpenChange:e,children:s.jsxs(E9,{side:"left",className:"w-[280px] max-w-[85vw] p-0 flex flex-col",children:[s.jsx("div",{className:"p-4 border-b border-gray-200",children:s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Admin Menu"})}),s.jsx("div",{className:"flex-1 overflow-y-auto",children:s.jsx(g3,{onLinkClick:()=>e(!1),className:"w-full min-h-0 border-0 p-4"})})]})}),s.jsx("main",{className:xt("flex-1 min-w-0 overflow-x-hidden","p-4 sm:p-5 md:p-6"),children:s.jsx(mP,{})})]})};async function m_(t){try{const{error:e}=await Q.from("business_profiles").update({status:"rejected",admin_notes:t.adminNotes,reviewed_by:t.reviewedBy,reviewed_at:new Date().toISOString(),updated_at:new Date().toISOString()}).eq("id",t.id);return e?(console.error("Error rejecting business profile:",e),{success:!1,error:e.message}):{success:!0}}catch(e){return console.error("Error rejecting business profile:",e),{success:!1,error:"Failed to reject business profile"}}}async function Wwe(t){try{const{error:e}=await Q.from("blog_posts").update({status:"rejected",admin_notes:t.adminNotes,reviewed_by:t.reviewedBy,reviewed_at:new Date().toISOString(),updated_at:new Date().toISOString()}).eq("id",t.id);return e?(console.error("Error rejecting blog post:",e),{success:!1,error:e.message}):{success:!0}}catch(e){return console.error("Error rejecting blog post:",e),{success:!1,error:"Failed to reject blog post"}}}async function f_(t){try{const{error:e}=await Q.from("business_profiles").update({status:"approved",admin_notes:t.adminNotes||null,reviewed_by:t.reviewedBy,reviewed_at:new Date().toISOString(),updated_at:new Date().toISOString()}).eq("id",t.id);return e?(console.error("Error approving business profile:",e),{success:!1,error:e.message}):{success:!0}}catch(e){return console.error("Error approving business profile:",e),{success:!1,error:"Failed to approve business profile"}}}async function qwe(t){try{const{error:e}=await Q.from("blog_posts").update({status:"published",admin_notes:t.adminNotes||null,reviewed_by:t.reviewedBy,reviewed_at:new Date().toISOString(),updated_at:new Date().toISOString(),publish_date:new Date().toISOString()}).eq("id",t.id);return e?(console.error("Error approving blog post:",e),{success:!1,error:e.message}):{success:!0}}catch(e){return console.error("Error approving blog post:",e),{success:!1,error:"Failed to approve blog post"}}}async function A9(t){try{const{error:e}=await Q.from("residential_profiles").update({status:"approved",admin_notes:t.adminNotes||null,reviewed_by:t.reviewedBy,reviewed_at:new Date().toISOString(),updated_at:new Date().toISOString()}).eq("id",t.id);return e?(console.error("Error approving resident profile:",e),{success:!1,error:e.message}):{success:!0}}catch(e){return console.error("Error approving resident profile:",e),{success:!1,error:"Failed to approve resident profile"}}}async function D9(t){try{const{error:e}=await Q.from("residential_profiles").update({status:"rejected",admin_notes:t.adminNotes,reviewed_by:t.reviewedBy,reviewed_at:new Date().toISOString(),updated_at:new Date().toISOString()}).eq("id",t.id);return e?(console.error("Error rejecting resident profile:",e),{success:!1,error:e.message}):{success:!0}}catch(e){return console.error("Error rejecting resident profile:",e),{success:!1,error:"Failed to reject resident profile"}}}function hx({isOpen:t,onClose:e,onConfirm:r,title:n,description:a,itemName:i,isLoading:o=!1}){const[l,c]=x.useState(""),[u,d]=x.useState(""),h=async()=>
1000{if(!l.trim()){d("Please provide a reason for rejection");return}try{await r(l),c(""),d(""),e()}catch{d("Failed to reject item. Please try again.")}},f=()=>{c(""),d(""),e()};return s.jsx(Tt,{open:t,onOpenChange:f,children:s.jsxs(Dt,{className:"sm:max-w-[425px]",children:[s.jsxs(It,{children:[s.jsx(Ot,{className:"text-red-600",children:n}),s.jsxs(rr,{children:[a,s.jsxs("span",{className:"font-medium text-gray-900",children:[' "',i,'"']})]})]}),s.jsx("div",{className:"grid gap-4 py-4",children:s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"rejection-notes",className:"text-sm font-medium",children:"Reason for Rejection *"}),s.jsx(zt,{id:"rejection-notes",placeholder:"Please provide a clear reason for rejecting this item. This will help the user understand what needs to be improved.",value:l,onChange:m=>{c(m.target.value),u&&d("")},className:"min-h-[100px]",disabled:o}),u&&s.jsx("p",{className:"text-sm text-red-600",children:u})]})}),s.jsxs(Sr,{children:[s.jsx(Y,{type:"button",variant:"outline",onClick:f,disabled:o,children:"Cancel"}),s.jsx(Y,{type:"button",variant:"destructive",onClick:h,disabled:o||!l.trim(),children:o?"Rejecting...":"Reject Item"})]})]})})}const Gwe=()=>{const{user:t}=ts(),[e,r]=x.useState(!1),[n,a]=x.useState(null),[i,o]=x.useState(!1),[l,c]=x.useState(!1),[u,d]=x.useState({totalMembers:0,businessOwners:0,residents:0,pendingBusinesses:0,pendingResidents:0,totalReferrals:0,activeReferrals:0}),[h,f]=x.useState([]),[m,g]=x.useState([]),[y,b]=x.useState(!0),[w,j]=x.useState(!1),[N,S]=x.useState(null),[E,C]=x.useState(!1);x.useEffect(()=>{(async()=>{try{b(!0);const G=await na.getStats(),{data:B}=await Q.from("referrals").select("*"),$=(B==null?void 0:B.length)||0,W=(B==null?void 0:B.filter(H=>H.status==="active").length)||0;d({...G,totalReferrals:$,activeReferrals:W});const{businesses:oe}=await na.getBusinesses({status:"pending",limit:5});f(oe);const{residents:K}=await Pf.getResidents({status:"pending",limit:100});g(K)}catch(G){console.error("Error fetching dashboard data:",G),ct.error("Failed to load dashboard data")}finally{b(!1)}})()},[]);const T=V=>{a(V),r(!0)},D=V=>{a(V),o(!0)},A=async()=>{if(!(!n||!(t!=null&&t.id))){c(!0);try{const V=await f_({id:n.id,reviewedBy:t.id});if(V.success){ct.success(`${n.name} has been approved!`);const{businesses:G}=await na.getBusinesses({status:"pending",limit:5});f(G);const B=await na.getStats();d($=>({...$,...B}))}else ct.error(V.error||"Failed to approve business")}catch{ct.error("Failed to approve business")}finally{c(!1),r(!1),a(null)}}},R=async V=>{if(!(!n||!(t!=null&&t.id))){c(!0);try{const G=await m_({id:n.id,adminNotes:V,reviewedBy:t.id});if(G.success){ct.success(`${n.name} has been rejected`);const{businesses:B}=await na.getBusinesses({status:"pending",limit:5});f(B);const $=await na.getStats();d(W=>({...W,...$}))}else ct.error(G.error||"Failed to reject business")}catch{ct.error("Failed to reject business")}finally{c(!1),o(!1),a(null)}}},M=V=>{S(V),j(!0)},P=V=>{S(V),C(!0)},U=async()=>{if(!(!N||!(t!=null&&t.id))){c(!0);try{const V=await A9({id:N.id,reviewedBy:t.id});if(V.success){const G=`${N.first_name} ${N.last_name}`.trim()||N.email;ct.success(`${G} has been approved and will appear in the directory.`);const B=await na.getStats();d(W=>({...W,...B}));const{residents:$}=await Pf.getResidents({status:"pending",limit:100});g($)}else ct.error(V.error||"Failed to approve resident")}catch{ct.error("Failed to approve resident")}finally{c(!1),j(!1),S(null)}}},I=async V=>{if(!(!N||!(t!=null&&t.id))){c(!0);try{const G=await D9({id:N.id,adminNotes:V,reviewedBy:t.id});if(G.success){const B=`${N.first_name} ${N.last_name}`.trim()||N.email;ct.success(`${B} has been rejected.`);const $=await na.getStats();d(oe=>({...oe,...$}));const{residents:W}=await Pf.getResidents({status:"pending",limit:100});g(W)}else ct.error(G.error||"Failed to reject resident")}catch{ct.error("Failed to reject resident")}finally{c(!1),C(!1),S(null)}}},O=V=>V.businessSubscriptionStatus==="active"||V.businessSubscriptionStatus==="trialing"?s.jsxs(ke,{variant:"default",className:"bg-green-500 text-white",children:[s.jsx(Or,{className:"w-3 h-3 mr-1"}),"Paid"]}):s.jsxs(ke,{variant:"outline",className:"bg-red-50 text-red-700 border-red-200",children:[s.jsx(Hl,{className:"w-3 h-3 mr-1"}),"Unpaid"]});
1000return s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsx("h1",{className:"text-xl sm:text-2xl font-bold",children:"Admin Dashboard"}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 gap-3 sm:gap-4",children:[s.jsxs(De,{children:[s.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(ut,{className:"text-sm font-medium",children:"Total Members"}),s.jsx(Os,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(Be,{children:[s.jsx("div",{className:"text-2xl font-bold",children:u.totalMembers}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Total registered users"})]})]}),s.jsxs(De,{children:[s.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(ut,{className:"text-sm font-medium",children:"Business Owners"}),s.jsx(Ll,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(Be,{children:[s.jsx("div",{className:"text-2xl font-bold",children:u.businessOwners}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.jsxs("span",{className:"text-amber-500",children:["+",u.pendingBusinesses]})," pending approvals"]})]})]}),s.jsxs(De,{children:[s.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(ut,{className:"text-sm font-medium",children:"Residents"}),s.jsx(Os,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(Be,{children:[s.jsx("div",{className:"text-2xl font-bold",children:u.residents}),s.jsx("p",{className:"text-xs text-muted-foreground",children:u.pendingResidents>0?s.jsxs("span",{className:"text-amber-500",children:[u.pendingResidents," pending approvals"]}):"Active community members"})]})]}),s.jsxs(De,{children:[s.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(ut,{className:"text-sm font-medium",children:"Pending Approvals"}),s.jsx(IV,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(Be,{children:[s.jsx("div",{className:"text-2xl font-bold",children:u.pendingBusinesses}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Businesses awaiting review"})]})]}),s.jsxs(De,{children:[s.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(ut,{className:"text-sm font-medium",children:"Total Referrals"}),s.jsx(Os,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(Be,{children:[s.jsx("div",{className:"text-2xl font-bold",children:u.totalReferrals}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"All time referrals"})]})]}),s.jsxs(De,{children:[s.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(ut,{className:"text-sm font-medium",children:"Active Referrals"}),s.jsx(Os,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(Be,{children:[s.jsx("div",{className:"text-2xl font-bold",children:u.activeReferrals}),s.jsx("p",{className:"text-xs text-muted-foreground",children:s.jsx(rt,{to:"/dashboard/admin/referrals",className:"text-blue-600 hover:underline",children:"View all referrals"})})]})]})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"space-y-3 sm:space-y-4",children:[s.jsx("h2",{className:"text-lg sm:text-xl font-semibold",children:"Pending Business Approvals"}),s.jsxs("div",{className:"border rounded-lg overflow-hidden bg-white",children:[s.jsxs("div",{className:"hidden sm:grid grid-cols-[1fr_auto_auto] gap-4 p-3 border-b font-medium text-sm text-muted-foreground",children:[s.jsx("div",{children:"Business"}),s.jsx("div",{children:"Payment Status"}),s.jsx("div",{children:"Actions"})]}),y?s.jsx("div",{className:"p-4 text-sm text-center text-muted-foreground",children:"Loading..."}):h.length===0?s.jsx("div",{className:"p-4 text-sm text-center text-muted-foreground",children:"No pending approvals"}):h.map(V=>s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-[1fr_auto_auto] gap-3 sm:gap-4 p-3 border-b items-stretch sm:items-center",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx(rt,{to:`/dashboard/admin/businesses/${V.id}`,className:"font-medium text-sm text-blue-600 hover:text-blue-800 hover:underline break-words",children:V.name}),s.jsxs("div",{className:"text-xs text-muted-foreground break-words",children:["Owner: ",V.owner.name," ⢠Address: ",V.address]})]}),s.jsx("div",{className:"flex items-center sm:justify-center",children:O(V)}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs(Y,{size:"sm",onClick:()=>T(V),className:"bg-green-600 hover:bg-green-700",disabled:l,children:[s.jsx(un,{className:"w-4 h-4 mr-1"}),"Approve"]}),s.jsxs(Y,{size:"sm",variant:"destructive",onClick:()=>D(V),disabled:l,children:[s.jsx(Ir,{className:"w-4 h-4 mr-1"}),"Reject"]})]})]},V.id))]}),s.jsx(Y,{variant:"outline",size:"sm",asChild:!0,className:"w-full",children:s.jsx(rt,{to:"/dashboard/admin/businesses",children:"View all businesses"})})]}
1000),s.jsxs("div",{className:"space-y-3 sm:space-y-4 mt-6 sm:mt-8",children:[s.jsx("h2",{className:"text-lg sm:text-xl font-semibold",children:"Pending Resident Approvals"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Residents are only shown on the public directory after approval. Review and approve or reject each signup."}),s.jsxs("div",{className:"border rounded-lg overflow-hidden bg-white",children:[s.jsxs("div",{className:"hidden sm:grid grid-cols-[1fr_auto] gap-4 p-3 border-b font-medium text-sm text-muted-foreground",children:[s.jsx("div",{children:"Resident"}),s.jsx("div",{children:"Actions"})]}),y?s.jsx("div",{className:"p-4 text-sm text-center text-muted-foreground",children:"Loading..."}):m.length===0?s.jsx("div",{className:"p-4 text-sm text-center text-muted-foreground",children:"No pending resident approvals"}):m.map(V=>{const G=`${V.first_name} ${V.last_name}`.trim()||V.email;return s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-[1fr_auto] gap-3 sm:gap-4 p-3 border-b items-stretch sm:items-center",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-medium text-sm break-words",children:G}),s.jsx("div",{className:"text-xs text-muted-foreground break-all",children:V.email})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs(Y,{size:"sm",onClick:()=>M(V),className:"bg-green-600 hover:bg-green-700",disabled:l,children:[s.jsx(un,{className:"w-4 h-4 mr-1"}),"Approve"]}),s.jsxs(Y,{size:"sm",variant:"destructive",onClick:()=>P(V),disabled:l,children:[s.jsx(Ir,{className:"w-4 h-4 mr-1"}),"Reject"]})]})]},V.id)})]}),s.jsx(Y,{variant:"outline",size:"sm",asChild:!0,className:"w-full",children:s.jsx(rt,{to:"/dashboard/admin/residents",children:"View all residents"})})]})]}),s.jsx(Tt,{open:e,onOpenChange:r,children:s.jsxs(Dt,{children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Approve Business"}),s.jsxs(rr,{children:["Are you sure you want to approve ",n==null?void 0:n.name,"? This will make the business visible in the public directory."]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",onClick:()=>r(!1),disabled:l,children:"Cancel"}),s.jsx(Y,{onClick:A,className:"bg-green-600 hover:bg-green-700",disabled:l,children:l?"Approving...":"Approve Business"})]})]})}),s.jsx(hx,{isOpen:i,onClose:()=>o(!1),onConfirm:R,title:"Reject Business",description:"You are about to reject",itemName:(n==null?void 0:n.name)||"",isLoading:l}),s.jsx(Tt,{open:w,onOpenChange:j,children:s.jsxs(Dt,{children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Approve Resident"}),s.jsx(rr,{children:N&&s.jsxs(s.Fragment,{children:["Approve ",`${N.first_name} ${N.last_name}`.trim()||N.email,"? They will appear in the public Residential Members directory."]})})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",onClick:()=>j(!1),disabled:l,children:"Cancel"}),s.jsx(Y,{onClick:U,className:"bg-green-600 hover:bg-green-700",disabled:l,children:l?"Approving...":"Approve Resident"})]})]})}),s.jsx(hx,{isOpen:E,onClose:()=>{C(!1),S(null)},onConfirm:I,title:"Reject Resident",description:"You are about to reject this resident. They will not appear in the directory.",itemName:N?`${N.first_name} ${N.last_name}`.trim()||N.email:"",isLoading:l})]})},Rf={checkUserSubscriptions:async t=>{try{const{data:e,error:r}=await Q.from("profiles").select("membership_subscription_id, membership_status").eq("id",t).single();if(r)throw console.error("Error fetching user profile:",r),new Error(`Failed to fetch user profile: ${r.message}`);const{data:n,error:a}=await Q.from("business_profiles").select(` 1001 business_name, 1002 feature_subscription_id, 1003 feature_subscription_status, 1004 business_subscription_id, 1005 business_subscription_status 1006 `).eq("owner_id",t);if(a)throw console.error("Error fetching business profiles:",a),new Error(`Failed to fetch business profiles: ${a.message}`);const i=[];return e.membership_subscription_id&&e.membership_subscription_id.trim()!==""&&e.membership_status&&["active","trialing","past_due"].includes(e.membership_status)&&i.push({type:"membership",subscriptionId:e.membership_subscription_id,status:e.membership_status}
1006),n==null||n.forEach(o=>{o.feature_subscription_id&&o.feature_subscription_id.trim()!==""&&o.feature_subscription_status&&["active","trialing","past_due"].includes(o.feature_subscription_status)&&i.push({type:"feature",subscriptionId:o.feature_subscription_id,status:o.feature_subscription_status,businessName:o.business_name}),o.business_subscription_id&&o.business_subscription_id.trim()!==""&&o.business_subscription_status&&["active","trialing","past_due"].includes(o.business_subscription_status)&&i.push({type:"business",subscriptionId:o.business_subscription_id,status:o.business_subscription_status,businessName:o.business_name})}),{hasActiveSubscriptions:i.length>0,subscriptions:i}}catch(e){throw console.error("Error checking user subscriptions:",e),e}},deleteUser:async t=>{try{console.log(`Starting deletion process for user: ${t}`);const{error:e}=await Q.rpc("delete_user_completely",{user_id_param:t});if(e)throw console.error("Error in database deletion function:",e),new Error(`Failed to delete user data: ${e.message}`);console.log("â Deleted all user data from database (including auth user)"),console.log(`ð Successfully deleted user ${t} and all related data`)}catch(e){throw console.error("â Error in deleteUser:",e),e}},getMembers:async t=>{const e=(t==null?void 0:t.page)||1,r=(t==null?void 0:t.limit)||8,n=(t==null?void 0:t.role)||"all";t!=null&&t.status,t!=null&&t.visibility;const a=(t==null?void 0:t.searchQuery)||"",i=(e-1)*r;let o=Q.from("profiles").select(` 1007 id, 1008 first_name, 1009 last_name, 1010 email, 1011 user_type, 1012 created_at 1013 `,{count:"exact"});a&&(o=o.or(`first_name.ilike.%${a}%,last_name.ilike.%${a}%,email.ilike.%${a}%`)),n!=="all"&&(n==="business_owner"?o=o.eq("user_type","business"):n==="resident"?o=o.eq("user_type","residential"):(n==="admin"||n==="super_admin")&&(o=o.eq("user_type","admin")));const{data:l,error:c,count:u}=await o.range(i,i+r-1).order("created_at",{ascending:!1});if(c)throw console.error("Error fetching members:",c),new Error(`Failed to fetch members: ${c.message}`);return{members:l.map(h=>({id:h.id,firstName:h.first_name,lastName:h.last_name,email:h.email,role:x3(h.user_type),status:"active",visibility:"visible",joinedAt:h.created_at})),total:u||0}},updateMember:async(t,e)=>{e.visibility;const{data:r,error:n}=await Q.from("profiles").select("id, first_name, last_name, email, user_type, created_at").eq("id",t).single();if(n)throw console.error("Error updating member:",n),new Error(`Failed to update member: ${n.message}`);return{id:r.id,firstName:r.first_name,lastName:r.last_name,email:r.email,role:x3(r.user_type),status:e.status||"active",visibility:e.visibility||"visible",joinedAt:r.created_at}},updateMemberProfile:async(t,e)=>{try{console.log("Updating member profile:",t,e);const{error:r}=await Q.from("profiles").update({first_name:e.first_name,last_name:e.last_name,email:e.email,user_type:e.user_type,bio:e.bio,avatar_url:e.avatar_url,updated_at:new Date().toISOString()}).eq("id",t);if(r)throw console.error("Error updating profile:",r),new Error(`Failed to update profile: ${r.message}`);console.log("â Successfully updated member profile")}catch(r){throw console.error("â Error in updateMemberProfile:",r),r}}};function x3(t){switch(t){case"business":return"business_owner";case"residential":return"resident";case"admin":return"admin";default:return"resident"}}var H1={exports:{}};/** 1014 * @license 1015 * Lodash <https://lodash.com/> 1016 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> 1017 * Released under MIT license <https://lodash.com/license> 1018 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 1019 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 1020 */H1.exports;(function(t,e){(function(){var r,n="4.17.23",a=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",l="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",u=500,d="__lodash_placeholder__",h=1,f=2,m=4,g=1,y=2,b=1,w=2,j=4,N=8,S=16,E=32,C=64,T=128,D=256,A=512,R=30,M="...",P=800,U=16,I=1,O=2,V=3,G=1/0,B=9007199254740991,$=17976931348623157e292,W=NaN,oe=4294967295,K=oe-1,H=oe>>>1,X=[["ary",T],["bind",b],["bindKey",w],["curry",N],["curryRight",S],["flip",A],["partial",E],["partialRight",C],["rearg",D]],me="[object Arguments]",ie="[object Array]",ee="[object AsyncFunction]",he="[object Boolean]",ve="[object Date]",Ce="[object DOMException]",re="[object Error]",we="[object Function]",Ee="[object GeneratorFunction]",Me="[object Map]",ae="[object Number]",ze="[object Null]",mt="[object Object]",tt="[object Promise]",Xe="[object Proxy]",Ft="[object RegExp]",ce="[object Set]",fe="[object String]",ge="[object Symbol]",Ge="[object Undef
1020ined]",Je="[object WeakMap]",be="[object WeakSet]",Pe="[object ArrayBuffer]",qe="[object DataView]",Qe="[object Float32Array]",We="[object Float64Array]",dt="[object Int8Array]",Bt="[object Int16Array]",Lt="[object Int32Array]",Vt="[object Uint8Array]",cr="[object Uint8ClampedArray]",wr="[object Uint16Array]",Xt="[object Uint32Array]",pt=/\b__p \+= '';/g,ir=/\b(__p \+=) '' \+/g,jr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,rs=/&(?:amp|lt|gt|quot|#39);/g,zr=/[&<>"']/g,xr=RegExp(rs.source),Ds=RegExp(zr.source),Er=/<%-([\s\S]+?)%>/g,Ur=/<%([\s\S]+?)%>/g,ws=/<%=([\s\S]+?)%>/g,wn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,hr=/^\w*$/,ga=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Jn=/[\\^$.*+?()[\]{}|]/g,dn=RegExp(Jn.source),gn=/^\s+/,jn=/\s/,xa=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,_a=/\{\n\/\* \[wrapped with (.+)\] \*/,Au=/,? & /,Gc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Uo=/[()=,{}\[\]\/\s]/,xl=/\\(\\)?/g,Ho=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,po=/\w*$/,go=/^[-+]0x[0-9a-f]+$/i,Du=/^0b[01]+$/i,yl=/^\[object .+?Constructor\]$/,Tu=/^0o[0-7]+$/i,Od=/^(?:0|[1-9]\d*)$/,zd=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u01
vendor: 4,134 bytes, line 1020
10207f]/g,Ql=/($^)/,Ux=/['\n\r\u2028\u2029\\]/g,Vc="\\ud800-\\udfff",Np="\\u0300-\\u036f",Fp="\\ufe20-\\ufe2f",xo="\\u20d0-\\u20ff",Ud=Np+Fp+xo,bm="\\u2700-\\u27bf",Hd="a-z\\xdf-\\xf6\\xf8-\\xff",Sp="\\xac\\xb1\\xd7\\xf7",Cp="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",kp="\\u2000-\\u206f",bl=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Mu="A-Z\\xc0-\\xd6\\xd8-\\xde",_p="\\ufe0e\\ufe0f",An=Sp+Cp+kp+bl,$d="['â]",vl="["+Vc+"]",Pu="["+An+"]",Ru="["+Ud+"]",Vi="\\d+",Yn="["+bm+"]",wl="["+Hd+"]",vm="[^"+Vc+An+Vi+bm+Hd+Mu+"]",wm="\\ud83c[\\udffb-\\udfff]",Hx="(?:"+Ru+"|"+wm+")",$o="[^"+Vc+"]",Wd="(?:\\ud83c[\\udde6-\\uddff]){2}",qd="[\\ud800-\\udbff][\\udc00-\\udfff]",Wo="["+Mu+"]",Kc="\\u200d",Ep="(?:"+wl+"|"+vm+")",$x="(?:"+Wo+"|"+vm+")",Ap="(?:"+$d+"(?:d|ll|m|re|s|t|ve))?",Gd="(?:"+$d+"(?:D|LL|M|RE|S|T|VE))?",jm=Hx+"?",yo="["+_p+"]?",Wx="(?:"+Kc+"(?:"+[$o,Wd,qd].join("|")+")"+yo+jm+")*",Bu="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Nm="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Dp=yo+jm+Wx,Hr="(?:"+[Yn,Wd,qd].join("|")+")"+Dp,qx="(?:"+[$o+Ru+"?",Ru,Wd,qd,vl].join("|")+")",Gx=RegExp($d,"g"),Vx=RegExp(Ru,"g"),qo=RegExp(wm+"(?="+wm+")|"+qx+Dp,"g"),ec=RegExp([Wo+"?"+wl+"+"+Ap+"(?="+[Pu,Wo,"$"].join("|")+")",$x+"+"+Gd+"(?="+[Pu,Wo+Ep,"$"].join("|")+")",Wo+"?"+Ep+"+"+Ap,Wo+"+"+Gd,Nm,Bu,Vi,Hr].join("|"),"g"),Kx=RegExp("["+Kc+Vc+Ud+_p+"]"),Jx=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Vd=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Fm=-1,Ps={};Ps[Qe]=Ps[We]=Ps[dt]=Ps[Bt]=Ps[Lt]=Ps[Vt]=Ps[cr]=Ps[wr]=Ps[Xt]=!0,Ps[me]=Ps[ie]=Ps[Pe]=Ps[he]=Ps[qe]=Ps[ve]=Ps[re]=Ps[we]=Ps[Me]=Ps[ae]=Ps[mt]=Ps[Ft]=Ps[ce]=Ps[fe]=Ps[Je]=!1;var Hs={};Hs[me]=Hs[ie]=Hs[Pe]=Hs[qe]=Hs[he]=Hs[ve]=Hs[Qe]=Hs[We]=Hs[dt]=Hs[Bt]=Hs[Lt]=Hs[Me]=Hs[ae]=Hs[mt]=Hs[Ft]=Hs[ce]=Hs[fe]=Hs[ge]=Hs[Vt]=Hs[cr]=Hs[wr]=Hs[Xt]=!0,Hs[re]=Hs[we]=Hs[Je]=!1;var tc={Ã:"A",Ã:"A",Ã:"A",Ã:"A",Ã:"A",Ã
:"A",à :"a",á:"a",â:"a",ã:"a",ä:"a",Ã¥:"a",Ã:"C",ç:"c",Ã:"D",ð:"d",Ã:"E",Ã:"E",Ã:"E",Ã:"E",è:"e",é:"e",ê:"e",ë:"e",Ã:"I",Ã:"I",Ã:"I",Ã:"I",ì:"i",Ã:"i",î:"i",ï:"i",Ã:"N",ñ:"n",Ã:"O",Ã:"O",Ã:"O",Ã:"O",Ã:"O",Ã:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ã:"U",Ã:"U",Ã:"U",Ã:"U",ù:"u",ú:"u",û:"u",ü:"u",Ã:"Y",ý:"y",ÿ:"y",Ã:"Ae",æ:"ae",Ã:"Th",þ:"th",Ã:"ss",Ä:"A",Ä:"A",Ä:"A",Ä:"a",Ä:"a",Ä
:"a",Ä:"C",Ä:"C",Ä:"C",Ä:"C",Ä:"c",Ä:"c",Ä:"c",Ä:"c",Ä:"D",Ä:"D",Ä:"d",Ä:"d",Ä:"E",Ä:"E",Ä:"E",Ä:"E",Ä:"E",Ä:"e",Ä:"e",Ä:"e",Ä:"e",Ä:"e",Ä:"G",Ä:"G",Ä :"G",Ä¢:"G",Ä:"g",Ä:"g",Ä¡:"g",Ä£:"g",Ĥ:"H",Ħ:"H",Ä¥:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Ä®:"I",İ:"I",Ä©:"i",Ä«:"i",Ä:"i",į:"i",ı:"i",Ä´:"J",ĵ:"j",Ķ:"K",Ä·:"k",ĸ:"k",Ĺ:"L",Ä»:"L",Ľ:"L",Ä¿:"L",Å:"L",ĺ:"l",ļ:"l",ľ:"l",Å:"l",Å:"l",Å:"N",Å
:"N",Å:"N",Å:"N",Å:"n",Å:"n",Å:"n",Å:"n",Å:"O",Å:"O",Å:"O",Å:"o",Å:"o",Å:"o",Å:"R",Å:"R",Å:"R",Å:"r",Å:"r",Å:"r",Å:"S",Å:"S",Å:"S",Å :"S",Å:"s",Å:"s",Å:"s",Å¡:"s",Å¢:"T",Ť:"T",Ŧ:"T",Å£:"t",Å¥:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Å®:"U",Ű:"U",Ų:"U",Å©:"u",Å«:"u",Å:"u",ů:"u",ű:"u",ų:"u",Å´:"W",ŵ:"w",Ŷ:"Y",Å·:"y",Ÿ:"Y",Ź:"Z",Å»:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Å:"Oe",Å:"oe",Å:"'n",Å¿:"s"},Yx={"&":"&","<":"<",">":">",'"':""","'":"'"},Sm={"&":"&","<":"<",">":">",""":'"',"'":"'"},Cm={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Tp=parseFloat,rc=parseInt,Kd=typeof io=="object"&&io&&io.Object===Object&&io,Jd=typeof self=="object"&&self&&self.Object===Object&&self,Dn=Kd||Jd||Function("return this")(),sc=e&&!e.nodeType&&e,Go=sc&&!0&&t&&!t.nodeType&&t,km=Go&&Go.exports===sc,Yd=km&&Kd.process,In=function(){try{var Ue=Go&&Go.require&&Go.require("util").t
vendor: 9,114 bytes, line 1020
1020ypes;return Ue||Yd&&Yd.binding&&Yd.binding("util")}catch{}}(),jl=In&&In.isArrayBuffer,_m=In&&In.isDate,Jc=In&&In.isMap,Em=In&&In.isRegExp,L=In&&In.isSet,se=In&&In.isTypedArray;function je(Ue,st,et){switch(et.length){case 0:return Ue.call(st);case 1:return Ue.call(st,et[0]);case 2:return Ue.call(st,et[0],et[1]);case 3:return Ue.call(st,et[0],et[1],et[2])}return Ue.apply(st,et)}function Re(Ue,st,et,Ut){for(var Jt=-1,Nr=Ue==null?0:Ue.length;++Jt<Nr;){var ss=Ue[Jt];st(Ut,ss,et(ss),Ue)}return Ut}function $e(Ue,st){for(var et=-1,Ut=Ue==null?0:Ue.length;++et<Ut&&st(Ue[et],et,Ue)!==!1;);return Ue}function it(Ue,st){for(var et=Ue==null?0:Ue.length;et--&&st(Ue[et],et,Ue)!==!1;);return Ue}function yt(Ue,st){for(var et=-1,Ut=Ue==null?0:Ue.length;++et<Ut;)if(!st(Ue[et],et,Ue))return!1;return!0}function tr(Ue,st){for(var et=-1,Ut=Ue==null?0:Ue.length,Jt=0,Nr=[];++et<Ut;){var ss=Ue[et];st(ss,et,Ue)&&(Nr[Jt++]=ss)}return Nr}function mr(Ue,st){var et=Ue==null?0:Ue.length;return!!et&&Si(Ue,st,0)>-1}function Mr(Ue,st,et){for(var Ut=-1,Jt=Ue==null?0:Ue.length;++Ut<Jt;)if(et(st,Ue[Ut]))return!0;return!1}function ur(Ue,st){for(var et=-1,Ut=Ue==null?0:Ue.length,Jt=Array(Ut);++et<Ut;)Jt[et]=st(Ue[et],et,Ue);return Jt}function es(Ue,st){for(var et=-1,Ut=st.length,Jt=Ue.length;++et<Ut;)Ue[Jt+et]=st[et];return Ue}function nn(Ue,st,et,Ut){var Jt=-1,Nr=Ue==null?0:Ue.length;for(Ut&&Nr&&(et=Ue[++Jt]);++Jt<Nr;)et=st(et,Ue[Jt],Jt,Ue);return et}function On(Ue,st,et,Ut){var Jt=Ue==null?0:Ue.length;for(Ut&&Jt&&(et=Ue[--Jt]);Jt--;)et=st(et,Ue[Jt],Jt,Ue);return et}function $s(Ue,st){for(var et=-1,Ut=Ue==null?0:Ue.length;++et<Ut;)if(st(Ue[et],et,Ue))return!0;return!1}var Zn=ac("length");function zn(Ue){return Ue.split("")}function Ea(Ue){return Ue.match(Gc)||[]}function Nl(Ue,st,et){var Ut;return et(Ue,function(Jt,Nr,ss){if(st(Jt,Nr,ss))return Ut=Nr,!1}),Ut}function Fi(Ue,st,et,Ut){for(var Jt=Ue.length,Nr=et+(Ut?1:-1);Ut?Nr--:++Nr<Jt;)if(st(Ue[Nr],Nr,Ue))return Nr;return-1}function Si(Ue,st,et){return st===st?Mp(Ue,st,et):Fi(Ue,Lu,et)}function Am(Ue,st,et,Ut){for(var Jt=et-1,Nr=Ue.length;++Jt<Nr;)if(Ut(Ue[Jt],st))return Jt;return-1}function Lu(Ue){return Ue!==Ue}function nc(Ue,st){var et=Ue==null?0:Ue.length;return et?lc(Ue,st)/et:W}function ac(Ue){return function(st){return st==null?r:st[Ue]}}function ic(Ue){return function(st){return Ue==null?r:Ue[st]}}function oc(Ue,st,et,Ut,Jt){return Jt(Ue,function(Nr,ss,$r){et=Ut?(Ut=!1,Nr):st(et,Nr,ss,$r)}),et}function Aa(Ue,st){var et=Ue.length;for(Ue.sort(st);et--;)Ue[et]=Ue[et].value;return Ue}function lc(Ue,st){for(var et,Ut=-1,Jt=Ue.length;++Ut<Jt;){var Nr=st(Ue[Ut]);Nr!==r&&(et=et===r?Nr:et+Nr)}return et}function cc(Ue,st){for(var et=-1,Ut=Array(Ue);++et<Ue;)Ut[et]=st(et);return Ut}function Dm(Ue,st){return ur(st,function(et){return[et,Ue[et]]})}function Zd(Ue){return Ue&&Ue.slice(0,Xd(Ue)+1).replace(gn,"")}function Vs(Ue){return function(st){return Ue(st)}}function Vo(Ue,st){return ur(st,function(et){return Ue[et]})}function Fl(Ue,st){return Ue.has(st)}function Tm(Ue,st){for(var et=-1,Ut=Ue.length;++et<Ut&&Si(st,Ue[et],0)>-1;);return et}function Ki(Ue,st){for(var et=Ue.length;et--&&Si(st,Ue[et],0)>-1;);return et}function Iu(Ue,st){for(var et=Ue.length,Ut=0;et--;)Ue[et]===st&&++Ut;return Ut}var Mm=ic(tc),Pm=ic(Yx);function Yc(Ue){return"\\"+Cm[Ue]}function Ou(Ue,st){return Ue==null?r:Ue[st]}function ya(Ue){return Kx.test(Ue)}function Ji(Ue){return Jx.test(Ue)}function Zc(Ue){for(var st,et=[];!(st=Ue.next()).done;)et.push(st.value);return et}function Ko(Ue){var st=-1,et=Array(Ue.size);return Ue.forEach(function(Ut,Jt){et[++st]=[Jt,Ut]}),et}function uc(Ue,st){return function(et){return Ue(st(et))}}function bo(Ue,st){for(var et=-1,Ut=Ue.length,Jt=0,Nr=[];++et<Ut;){var ss=Ue[et];(ss===st||ss===d)&&(Ue[et]=d,Nr[Jt++]=et)}return Nr}function dc(Ue){var st=-1,et=Array(Ue.size);return Ue.forEach(function(Ut){et[++st]=Ut}),et}function Tn(Ue){var st=-1,et=Array(Ue.size);return Ue.forEach(function(Ut){et[++st]=[Ut,Ut]}),et}function Mp(Ue,st,et){for(var Ut=et-1,Jt=Ue.length;++Ut<Jt;)if(Ue[Ut]===st)return Ut;return-1}function Sl(Ue,st,et){for(var Ut=et+1;Ut--;)if(Ue[Ut]===st)return Ut;return Ut}function ci(Ue){return ya(Ue)?Bm(Ue):Zn(Ue)}function ui(Ue){return ya(Ue)?Xc(Ue):zn(Ue)}function Xd(Ue){for(var st=Ue.length;st--&&jn.test(Ue.charAt(st)););return st}var Rm=ic(Sm);function Bm(Ue){for(var st=qo.lastIndex=0;qo.test(Ue);)++st;return st}function Xc(Ue){return Ue.match(qo)||[]}function Qc(Ue){return Ue.match(ec)||[]}var eu=function Ue(st){st=st==null?Dn:vo.defaults(Dn.Object(),st,vo.pick(Dn,Vd));var et=st.Array,Ut=st.Date,Jt=st.Error,Nr=st.Function,ss=st.Math,$r=st.Object,Jo=st.RegExp,Lm=st.String,Da=st.TypeError,zu=et.prototype,hb=Nr.prototype,Uu=$r.prototype,Im=st["__core-js_shared__"],Om=hb.toString,Rs=Uu.hasOwnProperty,mb=0,Qd=function(){var p=/[^.]+$/.exec(Im&&Im.keys&&Im.keys.IE_PROTO||"");return p?"Symbol(src)_1."+p:""}(),zm=Uu.toString,fb=Om.call($r),pb=Dn._,gb=Jo("^"+Om.call(Rs).replace(Jn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Um=km?st.Buffer:r,hc=st.Symbol,Hm=st.Uint8Array,Zx=Um?Um.allocUnsafe:r,eh=uc($r.getPrototypeOf,$r),$m=$r.create,Ci=Uu.propertyIsEnumerable,di=zu.splice,Wm=hc?hc.isConcatSpreadable:r,tu=hc?hc.iterator:r,ru=hc?hc.toStringTag:r,Hu=function(){try{var p=sf($r,"defineProperty");return p({},"",{}),p}catch{}}(),Pp=st.clearTimeout!==Dn.clearTimeout&&st.clearTimeout,Xx=Ut&&Ut.now!==Dn.Date.now&&Ut.now,xb=st.setTimeout!==Dn.setTimeout&&st.setTimeout,th=ss.ceil,rh=ss.floor,sh=$r.getOwnPropertySymbols,Qx=Um?Um.isBuffer:r,yb=st.isFinite,Fj=zu.join,bb=uc($r.keys,$r),Xn=ss.max,Ga=ss.min,Sj=Ut.now,Cj=st.parseInt,vb=ss.random,ey=zu.reverse,qm=sf(st,"DataView"),mc=sf(st,"Map"),ty=sf(st,"Promise"),nh=sf(st,"Set"),ah=sf(st,"WeakMap"),Gm=sf($r,"create"),Rp=ah&&new ah,ih={},kj=nf(qm),su=nf(mc),Yo=nf(ty),fc=nf(nh),_j=nf(ah),Vm=hc?hc.prototype:r,wo=Vm?Vm.valueOf:r,Yi=Vm?Vm.toString:r;function de(p){if(Hn(p)&&!Xr(p)&&!(p instanceof ps)){if(p instanceof Zi)return p;if(Rs.call(p,"__wrapped__"))return v4(p)}return new Zi(p)}var oh=function(){function p(){}return function(v){if(!Rn(v))return{};if($m)return $m(v);p.prototype=v;var k=new p;return p.prototype=r,k}}();function Km(){}function Zi(p,v){this.__wrapped__=p,this.__actions__=[],this.__chain__=!!v,this.__index__=0,this.__values__=r}de.templateSettings={escape:Er,evaluate:Ur,interpolate:ws,variable:"",imports:{_:de}},de.prototype=Km.prototype,de.prototype.constructor=de,Zi.prototype=oh(Km.prototype),Zi.prototype.constructor=Zi;function ps(p){this.__wrapped__=p,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=oe,this.__views__=[]}function wb(){var p=new ps(this.__wrapped__);return p.__actions__=So(this.__actions__),p.__dir__=this.__dir__,p.__filtered__=this.__filtered__,p.__iteratees__=So(this.__iteratees__),p.__takeCount__=this.__takeCount__,p.__views__=So(this.__views__),p}function Ej(){if(this.__filtered__){var p=new ps(this);p.__dir__=-1,p.__filtered__=!0}else p=this.clone(),p.__dir__*=-1;return p}function Bp(){var p=this.__wrapped__.value(),v=this.__dir__,k=Xr(p),q=v<0,te=k?p.length:0,xe=XU(0,te,this.__views__),_e=xe.start,Le=xe.end,Ve=Le-_e,ht=q?Le:_e-1,ft=this.__iteratees__,wt=ft.length,Yt=0,yr=Ga(Ve,this.__takeCount__);if(!k||!q&&te==Ve&&yr==Ve)return kl(p,this.__actions__);var Pr=[];e:for(;Ve--&&Yt<yr;){ht+=v;for(var ds=-1,Rr=p[ht];++ds<wt;){var Fs=ft[ds],_s=Fs.iteratee,el=Fs.type,ro=_s(Rr);if(el==O)Rr=ro;else if(!ro){if(el==I)continue e;break e}}Pr[Yt++]=Rr}return Pr}ps.prototype=oh(Km.prototype),ps.prototype.constructor=ps;function Cl(p){var v=-1,k=p==null?0:p.length;for(this.clear();++v<k;){var q=p[v];this.set(q[0],q[1])}}function Jm(){this.__data__=Gm?Gm(null):{},this.size=0}function ry(p){var v=this.has(p)&&delete this.__data__[p];return this.size-=v?1:0,v}function Aj(p){var v=this.__data__;if(Gm){var k=v[p];return k===c?r:k}return Rs.call(v,p)?v[p]:r}function jb(p){var v=this.__data__;return Gm?v[p]!==r:Rs.call(v,p)}function Dj(p,v){var k=this.__data__;return this.size+=this.has(p)?0:1,k[p]=Gm&&v===r?c:v,this}Cl.prototype.clear=Jm,Cl.prototype.delete=ry,Cl.prototype.get=Aj,Cl.prototype.has=jb,Cl.prototype.set=Dj;function pc(p){var v=-1,k=p==null?0:p.length;for(this.clear();++v<k;){var q=p[v];this.set(q[0],q[1])}}function Tj(){this.__data__=[],this.size=0}function Mj(p){var v=this.__data__,k=at(v,p);if(k<0)return!1;var q=v.length-1;return k==q?v.pop():di.call(v,k,1),--this.size,!0}function Pj(p){var v=this.__data__,k=at(v,p);return k<0?r:v[k][1]}function Rj(p){return at(this.__data__,p)>-1}function Nb(p,v){var k=this.__data__,q=at(k,p);return q<0?(++this.size,k.push([p,v])):k[q][1]=v,this}pc.prototype.clear=Tj,pc.prototype.delete=Mj,pc.prototype.get=Pj,pc.prototype.has=Rj,pc.prototype.set=Nb;function jo(p){var v=-1,k=p==null?0:p.length;for(this.clear();++v<k;){var q=p[v];this.set(q[0],q[1])}}function Bj(){this.size=0,this.__data__={hash:new Cl,map:new(mc||pc),string:new Cl}}function Lj(p){var v=Hb(this,p).delete(p);return this.size-=v?1:0,v}function Fb(p){return Hb(this,p).get(p)}
vendor: 6,759 bytes, line 1020
1020function F(p){return Hb(this,p).has(p)}function _(p,v){var k=Hb(this,p),q=k.size;return k.set(p,v),this.size+=k.size==q?0:1,this}jo.prototype.clear=Bj,jo.prototype.delete=Lj,jo.prototype.get=Fb,jo.prototype.has=F,jo.prototype.set=_;function z(p){var v=-1,k=p==null?0:p.length;for(this.__data__=new jo;++v<k;)this.add(p[v])}function J(p){return this.__data__.set(p,c),this}function ne(p){return this.__data__.has(p)}z.prototype.add=z.prototype.push=J,z.prototype.has=ne;function le(p){var v=this.__data__=new pc(p);this.size=v.size}function ue(){this.__data__=new pc,this.size=0}function pe(p){var v=this.__data__,k=v.delete(p);return this.size=v.size,k}function ye(p){return this.__data__.get(p)}function Se(p){return this.__data__.has(p)}function Ie(p,v){var k=this.__data__;if(k instanceof pc){var q=k.__data__;if(!mc||q.length<a-1)return q.push([p,v]),this.size=++k.size,this;k=this.__data__=new jo(q)}return k.set(p,v),this.size=k.size,this}le.prototype.clear=ue,le.prototype.delete=pe,le.prototype.get=ye,le.prototype.has=Se,le.prototype.set=Ie;function Ze(p,v){var k=Xr(p),q=!k&&af(p),te=!k&&!q&&ch(p),xe=!k&&!q&&!te&&Vp(p),_e=k||q||te||xe,Le=_e?cc(p.length,Lm):[],Ve=Le.length;for(var ht in p)(v||Rs.call(p,ht))&&!(_e&&(ht=="length"||te&&(ht=="offset"||ht=="parent")||xe&&(ht=="buffer"||ht=="byteLength"||ht=="byteOffset")||Yu(ht,Ve)))&&Le.push(ht);return Le}function Fe(p){var v=p.length;return v?p[ef(0,v-1)]:r}function He(p,v){return $b(So(p),Lr(v,0,p.length))}function Ke(p){return $b(So(p))}function nt(p,v,k){(k!==r&&!wc(p[v],k)||k===r&&!(v in p))&&lr(p,v,k)}function Ye(p,v,k){var q=p[v];(!(Rs.call(p,v)&&wc(q,k))||k===r&&!(v in p))&&lr(p,v,k)}function at(p,v){for(var k=p.length;k--;)if(wc(p[k][0],v))return k;return-1}function lt(p,v,k,q){return _t(p,function(te,xe,_e){v(q,te,k(te),_e)}),q}function jt(p,v){return p&&au(v,Ka(v),p)}function bt(p,v){return p&&au(v,ko(v),p)}function lr(p,v,k){v=="__proto__"&&Hu?Hu(p,v,{configurable:!0,enumerable:!0,value:k,writable:!0}):p[v]=k}function or(p,v){for(var k=-1,q=v.length,te=et(q),xe=p==null;++k<q;)te[k]=xe?r:n2(p,v[k]);return te}function Lr(p,v,k){return p===p&&(k!==r&&(p=p<=k?p:k),v!==r&&(p=p>=v?p:v)),p}function Qt(p,v,k,q,te,xe){var _e,Le=v&h,Ve=v&f,ht=v&m;if(k&&(_e=te?k(p,q,te,xe):k(p)),_e!==r)return _e;if(!Rn(p))return p;var ft=Xr(p);if(ft){if(_e=eH(p),!Le)return So(p,_e)}else{var wt=Ei(p),Yt=wt==we||wt==Ee;if(ch(p))return G_(p,Le);if(wt==mt||wt==me||Yt&&!te){if(_e=Ve||Yt?{}:d4(p),!Le)return Ve?$U(p,bt(_e,p)):HU(p,jt(_e,p))}else{if(!Hs[wt])return te?p:{};_e=tH(p,wt,Le)}}xe||(xe=new le);var yr=xe.get(p);if(yr)return yr;xe.set(p,_e),z4(p)?p.forEach(function(Rr){_e.add(Qt(Rr,v,k,Rr,p,xe))}):I4(p)&&p.forEach(function(Rr,Fs){_e.set(Fs,Qt(Rr,v,k,Fs,p,xe))});var Pr=ht?Ve?Wj:$j:Ve?ko:Ka,ds=ft?r:Pr(p);return $e(ds||p,function(Rr,Fs){ds&&(Fs=Rr,Rr=p[Fs]),Ye(_e,Fs,Qt(Rr,v,k,Fs,p,xe))}),_e}function js(p){var v=Ka(p);return function(k){return Un(k,p,v)}}function Un(p,v,k){var q=k.length;if(p==null)return!q;for(p=$r(p);q--;){var te=k[q],xe=v[te],_e=p[te];if(_e===r&&!(te in p)||!xe(_e))return!1}return!0}function Kr(p,v,k){if(typeof p!="function")throw new Da(o);return oy(function(){p.apply(r,k)},v)}function dr(p,v,k,q){var te=-1,xe=mr,_e=!0,Le=p.length,Ve=[],ht=v.length;if(!Le)return Ve;k&&(v=ur(v,Vs(k))),q?(xe=Mr,_e=!1):v.length>=a&&(xe=Fl,_e=!1,v=new z(v));e:for(;++te<Le;){var ft=p[te],wt=k==null?ft:k(ft);if(ft=q||ft!==0?ft:0,_e&&wt===wt){for(var Yt=ht;Yt--;)if(v[Yt]===wt)continue e;Ve.push(ft)}else xe(v,wt,q)||Ve.push(ft)}return Ve}var _t=Z_(mn),Nn=Z_(Mn,!0);function qr(p,v){var k=!0;return _t(p,function(q,te,xe){return k=!!v(q,te,xe),k}),k}function gs(p,v,k){for(var q=-1,te=p.length;++q<te;){var xe=p[q],_e=v(xe);if(_e!=null&&(Le===r?_e===_e&&!Qo(_e):k(_e,Le)))var Le=_e,Ve=xe}return Ve}function an(p,v,k,q){var te=p.length;for(k=as(k),k<0&&(k=-k>te?0:te+k),q=q===r||q>te?te:as(q),q<0&&(q+=te),q=k>q?0:H4(q);k<q;)p[k++]=v;return p}function ba(p,v){var k=[];return _t(p,function(q,te,xe){v(q,te,xe)&&k.push(q)}),k}function Bs(p,v,k,q,te){var xe=-1,_e=p.length;for(k||(k=sH),te||(te=[]);++xe<_e;){var Le=p[xe];v>0&&k(Le)?v>1?Bs(Le,v-1,k,q,te):es(te,Le):q||(te[te.length]=Le)}return te}var hn=X_(),Ta=X_(!0);function mn(p,v){return p&&hn(p,v,Ka)}function Mn(p,v){return p&&Ta(p,v,Ka)}function ys(p,v){return tr(v,function(k){return Zu(p[k])})}function Ns(p,v){v=vc(v,p);for(var k=0,q=v.length;p!=null&&k<q;)p=p[iu(v[k++])];return k&&k==q?p:r}function xn(p,v,k){var q=v(p);return Xr(p)?q:es(q,k(p))}function Gr(p){return p==null?p===r?Ge:ze:ru&&ru in $r(p)?ZU(p):uH(p)}function Qn(p,v){return p>v}function Zo(p,v){return p!=null&&Rs.call(p,v)}function Pn(p,v){return p!=null&&v in $r(p)}function ki(p,v,k){return p>=Ga(v,k)&&p<Xn(v,k)}function Us(p,v,k){for(var q=k?Mr:mr,te=p[0].length,xe=p.length,_e=xe,Le=et(xe),Ve=1/0,ht=[];_e--;){var ft=p[_e];_e&&v&&(ft=ur(ft,Vs(v))),Ve=Ga(ft.length,Ve),Le[_e]=!k&&(v||te>=120&&ft.length>=120)?new z(_e&&ft):r}ft=p[0];var wt=-1,Yt=Le[0];e:for(;++wt<te&&ht.length<Ve;){var yr=ft[wt],Pr=v?v(yr):yr;if(yr=k||yr!==0?yr:0,!(Yt?Fl(Yt,Pr):q(ht,Pr,k))){for(_e=xe;--_e;){var ds=Le[_e];if(!(ds?Fl(ds,Pr):q(p[_e],Pr,k)))continue e}Yt&&Yt.push(Pr),ht.push(yr)}}return ht}function ea(p,v,k,q){return mn(p,function(te,xe,_e){v(q,k(te),xe,_e)}),q}function Ma(p,v,k){v=vc(v,p),p=p4(p,v);var q=p==null?p:p[iu(Al(v))];return q==null?r:je(q,p,k)}function Va(p){return Hn(p)&&Gr(p)==me}function Xi(p){return Hn(p)&&Gr(p)==Pe}function Qi(p){return Hn(p)&&Gr(p)==ve}function va(p,v,k,q,te){return p===v?!0:p==null||v==null||!Hn(p)&&!Hn(v)?p!==p&&v!==v:eo(p,v,k,q,va,te)}function eo(p,v,k,q,te,xe){var _e=Xr(p),Le=Xr(v),Ve=_e?ie:Ei(p),ht=Le?ie:Ei(v);Ve=Ve==me?mt:Ve,ht=ht==me?mt:ht;var ft=Ve==mt,wt=ht==mt,Yt=Ve==ht;if(Yt&&ch(p)){if(!ch(v))return!1;_e=!0,ft=!1}if(Yt&&!ft)return xe||(xe=new le),_e||Vp(p)?l4(p,v,k,q,te,xe):JU(p,v,Ve,k,q,te,xe);if(!(k&g)){var yr=ft&&Rs.call(p,"__wrapped__"),Pr=wt&&Rs.call(v,"__wrapped__");if(yr||Pr){var ds=yr?p.value():p,Rr=Pr?v.value():v;return xe||(xe=new le),te(ds,Rr,k,q,xe)}}return Yt?(xe||(xe=new le),YU(p,v,k,q,te,xe)):!1}function en(p){return Hn(p)&&Ei(p)==Me}function hi(p,v,k,q){var te=k.length,xe=te,_e=!q;if(p==null)return!xe;for(p=$r(p);te--;){var Le=k[te];if(_e&&Le[2]?Le[1]!==p[Le[0]]:!(Le[0]in p))return!1}for(;++te<xe;){Le=k[te];var Ve=Le[0],ht=p[Ve],ft=Le[1];if(_e&&Le[2]){if(ht===r&&!(Ve in p))return!1}else{var wt=new le;if(q)var Yt=q(ht,ft,Ve,p,v,wt);if(!(Yt===r?va(ft,ht,g|y,q,wt):Yt))return!1}}return!0}function No(p){if(!Rn(p)||aH(p))return!1;var v=Zu(p)?gb:yl;return v.test(nf(p))}function $u(p){return Hn(p)&&Gr(p)==Ft}function gc(p){return Hn(p)&&Ei(p)==ce}function Pa(p){return Hn(p)&&Jb(p.length)&&!!Ps[Gr(p)]}function Ym(p){return typeof p=="function"?p:p==null?_o:typeof p=="object"?Xr(p)?Ip(
vendor: 4,587 bytes, line 1020
1020p[0],p[1]):Cb(p):Q4(p)}function Zm(p){if(!iy(p))return bb(p);var v=[];for(var k in $r(p))Rs.call(p,k)&&k!="constructor"&&v.push(k);return v}function Lp(p){if(!Rn(p))return cH(p);var v=iy(p),k=[];for(var q in p)q=="constructor"&&(v||!Rs.call(p,q))||k.push(q);return k}function Wu(p,v){return p<v}function Sb(p,v){var k=-1,q=Co(p)?et(p.length):[];return _t(p,function(te,xe,_e){q[++k]=v(te,xe,_e)}),q}function Cb(p){var v=Gj(p);return v.length==1&&v[0][2]?m4(v[0][0],v[0][1]):function(k){return k===p||hi(k,p,v)}}function Ip(p,v){return Kj(p)&&h4(v)?m4(iu(p),v):function(k){var q=n2(k,p);return q===r&&q===v?a2(k,p):va(v,q,g|y)}}function Xo(p,v,k,q,te){p!==v&&hn(v,function(xe,_e){if(te||(te=new le),Rn(xe))Ij(p,v,_e,k,Xo,q,te);else{var Le=q?q(Yj(p,_e),xe,_e+"",p,v,te):r;Le===r&&(Le=xe),nt(p,_e,Le)}},ko)}function Ij(p,v,k,q,te,xe,_e){var Le=Yj(p,k),Ve=Yj(v,k),ht=_e.get(Ve);if(ht){nt(p,k,ht);return}var ft=xe?xe(Le,Ve,k+"",p,v,_e):r,wt=ft===r;if(wt){var Yt=Xr(Ve),yr=!Yt&&ch(Ve),Pr=!Yt&&!yr&&Vp(Ve);ft=Ve,Yt||yr||Pr?Xr(Le)?ft=Le:ta(Le)?ft=So(Le):yr?(wt=!1,ft=G_(Ve,!0)):Pr?(wt=!1,ft=V_(Ve,!0)):ft=[]:ly(Ve)||af(Ve)?(ft=Le,af(Le)?ft=$4(Le):(!Rn(Le)||Zu(Le))&&(ft=d4(Ve))):wt=!1}wt&&(_e.set(Ve,ft),te(ft,Ve,q,xe,_e),_e.delete(Ve)),nt(p,k,ft)}function kb(p,v){var k=p.length;if(k)return v+=v<0?k:0,Yu(v,k)?p[v]:r}function _b(p,v,k){v.length?v=ur(v,function(xe){return Xr(xe)?function(_e){return Ns(_e,xe.length===1?xe[0]:xe)}:xe}):v=[_o];var q=-1;v=ur(v,Vs(Dr()));var te=Sb(p,function(xe,_e,Le){var Ve=ur(v,function(ht){return ht(xe)});return{criteria:Ve,index:++q,value:xe}});return Aa(te,function(xe,_e){return UU(xe,_e,k)})}function Eb(p,v){return Xm(p,v,function(k,q){return a2(p,q)})}function Xm(p,v,k){for(var q=-1,te=v.length,xe={};++q<te;){var _e=v[q],Le=Ns(p,_e);k(Le,_e)&&qu(xe,vc(_e,p),Le)}return xe}function Ab(p){return function(v){return Ns(v,p)}}function Op(p,v,k,q){var te=q?Am:Si,xe=-1,_e=v.length,Le=p;for(p===v&&(v=So(v)),k&&(Le=ur(p,Vs(k)));++xe<_e;)for(var Ve=0,ht=v[xe],ft=k?k(ht):ht;(Ve=te(Le,ft,Ve,q))>-1;)Le!==p&&di.call(Le,Ve,1),di.call(p,Ve,1);return p}function Qm(p,v){for(var k=p?v.length:0,q=k-1;k--;){var te=v[k];if(k==q||te!==xe){var xe=te;Yu(te)?di.call(p,te,1):Gu(p,te)}}return p}function ef(p,v){return p+rh(vb()*(v-p+1))}function tf(p,v,k,q){for(var te=-1,xe=Xn(th((v-p)/(k||1)),0),_e=et(xe);xe--;)_e[q?xe:++te]=p,p+=k;return _e}function zp(p,v){var k="";if(!p||v<1||v>B)return k;do v%2&&(k+=p),v=rh(v/2),v&&(p+=p);while(v);return k}function ns(p,v){return Zj(f4(p,v,_o),p+"")}function Up(p){return Fe(Kp(p))}function Db(p,v){var k=Kp(p);return $b(k,Lr(v,0,k.length))}function qu(p,v,k,q){if(!Rn(p))return p;v=vc(v,p);for(var te=-1,xe=v.length,_e=xe-1,Le=p;Le!=null&&++te<xe;){var Ve=iu(v[te]),ht=k;if(Ve==="__proto__"||Ve==="constructor"||Ve==="prototype")return p;if(te!=_e){var ft=Le[Ve];ht=q?q(ft,Ve,Le):r,ht===r&&(ht=Rn(ft)?ft:Yu(v[te+1])?[]:{})}Ye(Le,Ve,ht),Le=Le[Ve]}return p}var xc=Rp?function(p,v){return Rp.set(p,v),p}:_o,Tb=Hu?function(p,v){return Hu(p,"toString",{configurable:!0,enumerable:!1,value:o2(v),writable:!0})}:_o;function Mb(p){return $b(Kp(p))}function Fo(p,v,k){var q=-1,te=p.length;v<0&&(v=-v>te?0:te+v),k=k>te?te:k,k<0&&(k+=te),te=v>k?0:k-v>>>0,v>>>=0;for(var xe=et(te);++q<te;)xe[q]=p[q+v];return xe}function Pb(p,v){var k;return _t(p,function(q,te,xe){return k=v(q,te,xe),!k}),!!k}function yc(p,v,k){var q=0,te=p==null?q:p.length;if(typeof v=="number"&&v===v&&te<=H){for(;q<te;){var xe=q+te>>>1,_e=p[xe];_e!==null&&!Qo(_e)&&(k?_e<=v:_e<v)?q=xe+1:te=xe}return te}return sy(p,v,_o,k)}function sy(p,v,k,q){var te=0,xe=p==null?0:p.length;if(xe===0)return 0;v=k(v);for(var _e=v!==v,Le=v===null,Ve=Qo(v),ht=v===r;te<xe;){var ft=rh((te+xe)/2),wt=k(p[ft]),Yt=wt!==r,yr=wt===null,Pr=wt===wt,ds=Qo(wt);if(_e)var Rr=q||Pr;else ht?Rr=Pr&&(q||Yt):Le?Rr=Pr&&Yt&&(q||!yr):Ve?Rr=Pr&&Yt&&!yr&&(q||!ds):yr||ds?Rr=!1:Rr=q?wt<=v:wt<v;Rr?te=ft+1:xe=ft}return Ga(xe,K)}function ny(p,v){for(var k=-1,q=p.length,te=0,xe=[];++k<q;){var _e=p[k],Le=v?v(_e):_e;if(!k||!wc(Le,Ve)){var Ve=Le;xe[te++]=_e===0?0:_e}}return xe}function Rb(p){return typeof p=="number"?p:Qo(p)?W:+p}function _i(p){if(typeof p=="string")return p;if(Xr(p))return ur(p,_i)+"";if(Qo(p))return Yi?Yi.call(p):"";var v=p+"";return v=="0"&&1/p==-G?"-0":v}function nu(p,v,k){var q=-1,te=mr,xe=p.length,_e=!0,Le=[],Ve=Le;if(k)_e=!1,te=Mr;else if(xe>=a){var ht=v?null:VU(p);if(ht)return dc(ht);_e=!1,te=Fl,Ve=new z}else Ve=v?[]:Le;e:for(;++q<xe;){var ft=p[q],wt=v?v(ft):ft;if(ft=k||ft!==0?ft:0,_e&&wt===wt){for(var Yt=Ve.length;Yt--;)if(Ve[Yt]===wt)continue e;v&&Ve.push(wt),Le.push(ft)}
vendor: 4,610 bytes, line 1020
1020else te(Ve,wt,k)||(Ve!==Le&&Ve.push(wt),Le.push(ft))}return Le}function Gu(p,v){v=vc(v,p);var k=-1,q=v.length;if(!q)return!0;for(var te=p==null||typeof p!="object"&&typeof p!="function";++k<q;){var xe=v[k];if(typeof xe=="string"){if(xe==="__proto__"&&!Rs.call(p,"__proto__"))return!1;if(xe==="constructor"&&k+1<q&&typeof v[k+1]=="string"&&v[k+1]==="prototype"){if(te&&k===0)continue;return!1}}}var _e=p4(p,v);return _e==null||delete _e[iu(Al(v))]}function Hp(p,v,k,q){return qu(p,v,k(Ns(p,v)),q)}function Vu(p,v,k,q){for(var te=p.length,xe=q?te:-1;(q?xe--:++xe<te)&&v(p[xe],xe,p););return k?Fo(p,q?0:xe,q?xe+1:te):Fo(p,q?xe+1:0,q?te:xe)}function kl(p,v){var k=p;return k instanceof ps&&(k=k.value()),nn(v,function(q,te){return te.func.apply(te.thisArg,es([q],te.args))},k)}function _l(p,v,k){var q=p.length;if(q<2)return q?nu(p[0]):[];for(var te=-1,xe=et(q);++te<q;)for(var _e=p[te],Le=-1;++Le<q;)Le!=te&&(xe[te]=dr(xe[te]||_e,p[Le],v,k));return nu(Bs(xe,1),v,k)}function bc(p,v,k){for(var q=-1,te=p.length,xe=v.length,_e={};++q<te;){var Le=q<xe?v[q]:r;k(_e,p[q],Le)}return _e}function lh(p){return ta(p)?p:[]}function rf(p){return typeof p=="function"?p:_o}function vc(p,v){return Xr(p)?p:Kj(p,v)?[p]:b4(Ws(p))}var Oj=ns;function El(p,v,k){var q=p.length;return k=k===r?q:k,!v&&k>=q?p:Fo(p,v,k)}var $p=Pp||function(p){return Dn.clearTimeout(p)};function G_(p,v){if(v)return p.slice();var k=p.length,q=Zx?Zx(k):new p.constructor(k);return p.copy(q),q}function zj(p){var v=new p.constructor(p.byteLength);return new Hm(v).set(new Hm(p)),v}function IU(p,v){var k=v?zj(p.buffer):p.buffer;return new p.constructor(k,p.byteOffset,p.byteLength)}function OU(p){var v=new p.constructor(p.source,po.exec(p));return v.lastIndex=p.lastIndex,v}function zU(p){return wo?$r(wo.call(p)):{}}function V_(p,v){var k=v?zj(p.buffer):p.buffer;return new p.constructor(k,p.byteOffset,p.length)}function K_(p,v){if(p!==v){var k=p!==r,q=p===null,te=p===p,xe=Qo(p),_e=v!==r,Le=v===null,Ve=v===v,ht=Qo(v);if(!Le&&!ht&&!xe&&p>v||xe&&_e&&Ve&&!Le&&!ht||q&&_e&&Ve||!k&&Ve||!te)return 1;if(!q&&!xe&&!ht&&p<v||ht&&k&&te&&!q&&!xe||Le&&k&&te||!_e&&te||!Ve)return-1}return 0}function UU(p,v,k){for(var q=-1,te=p.criteria,xe=v.criteria,_e=te.length,Le=k.length;++q<_e;){var Ve=K_(te[q],xe[q]);if(Ve){if(q>=Le)return Ve;var ht=k[q];return Ve*(ht=="desc"?-1:1)}}return p.index-v.index}function J_(p,v,k,q){for(var te=-1,xe=p.length,_e=k.length,Le=-1,Ve=v.length,ht=Xn(xe-_e,0),ft=et(Ve+ht),wt=!q;++Le<Ve;)ft[Le]=v[Le];for(;++te<_e;)(wt||te<xe)&&(ft[k[te]]=p[te]);for(;ht--;)ft[Le++]=p[te++];return ft}function Y_(p,v,k,q){for(var te=-1,xe=p.length,_e=-1,Le=k.length,Ve=-1,ht=v.length,ft=Xn(xe-Le,0),wt=et(ft+ht),Yt=!q;++te<ft;)wt[te]=p[te];for(var yr=te;++Ve<ht;)wt[yr+Ve]=v[Ve];for(;++_e<Le;)(Yt||te<xe)&&(wt[yr+k[_e]]=p[te++]);return wt}function So(p,v){var k=-1,q=p.length;for(v||(v=et(q));++k<q;)v[k]=p[k];return v}function au(p,v,k,q){var te=!k;k||(k={});for(var xe=-1,_e=v.length;++xe<_e;){var Le=v[xe],Ve=q?q(k[Le],p[Le],Le,k,p):r;Ve===r&&(Ve=p[Le]),te?lr(k,Le,Ve):Ye(k,Le,Ve)}return k}function HU(p,v){return au(p,Vj(p),v)}function $U(p,v){return au(p,c4(p),v)}function Bb(p,v){return function(k,q){var te=Xr(k)?Re:lt,xe=v?v():{};return te(k,p,Dr(q,2),xe)}}function Wp(p){return ns(function(v,k){var q=-1,te=k.length,xe=te>1?k[te-1]:r,_e=te>2?k[2]:r;for(xe=p.length>3&&typeof xe=="function"?(te--,xe):r,_e&&to(k[0],k[1],_e)&&(xe=te<3?r:xe,te=1),v=$r(v);++q<te;){var Le=k[q];Le&&p(v,Le,q,xe)}return v})}function Z_(p,v){return function(k,q){if(k==null)return k;if(!Co(k))return p(k,q);for(var te=k.length,xe=v?te:-1,_e=$r(k);(v?xe--:++xe<te)&&q(_e[xe],xe,_e)!==!1;);return k}}function X_(p){return function(v,k,q){for(var te=-1,xe=$r(v),_e=q(v),Le=_e.length;Le--;){var Ve=_e[p?Le:++te];if(k(xe[Ve],Ve,xe)===!1)break}return v}}function WU(p,v,k){var q=v&b,te=ay(p);function xe(){var _e=this&&this!==Dn&&this instanceof xe?te:p;return _e.apply(q?k:this,arguments)}return xe}function Q_(p){return function(v){v=Ws(v);var k=ya(v)?ui(v):r,q=k?k[0]:v.charAt(0),te=k?El(k,1).join(""):v.slice(1);return q[p]()+te}}function qp(p){return function(v){return nn(Z4(Y4(v).replace(Gx,"")),p,"")}}function ay(p){return function(){var v=arguments;switch(v.length){case 0:return new p;case 1:return new p(v[0]);case 2:return new p(v[0],v[1]);case 3:return new p(v[0],v[1],v[2]);case 4:return new p(v[0],v[1],v[2],v[3]);case 5:return new p(v[0],v[1],v[2],v[3],v[4]);case 6:return new p(v[0],v[1],v[2],v[3],v[4],v[5]);case 7:return new p(v[0],v[1],v[2],v[3],v[4],v[5],v[6])}var k=oh(p.prototype),q=p.apply(k,v);return Rn(q)?q:k}}function qU(p,v,k){var q=ay(p);
vendor: 2,170 bytes, line 1020
1020function te(){for(var xe=arguments.length,_e=et(xe),Le=xe,Ve=Gp(te);Le--;)_e[Le]=arguments[Le];var ht=xe<3&&_e[0]!==Ve&&_e[xe-1]!==Ve?[]:bo(_e,Ve);if(xe-=ht.length,xe<k)return n4(p,v,Lb,te.placeholder,r,_e,ht,r,r,k-xe);var ft=this&&this!==Dn&&this instanceof te?q:p;return je(ft,this,_e)}return te}function e4(p){return function(v,k,q){var te=$r(v);if(!Co(v)){var xe=Dr(k,3);v=Ka(v),k=function(Le){return xe(te[Le],Le,te)}}var _e=p(v,k,q);return _e>-1?te[xe?v[_e]:_e]:r}}function t4(p){return Ju(function(v){var k=v.length,q=k,te=Zi.prototype.thru;for(p&&v.reverse();q--;){var xe=v[q];if(typeof xe!="function")throw new Da(o);if(te&&!_e&&Ub(xe)=="wrapper")var _e=new Zi([],!0)}for(q=_e?q:k;++q<k;){xe=v[q];var Le=Ub(xe),Ve=Le=="wrapper"?qj(xe):r;Ve&&Jj(Ve[0])&&Ve[1]==(T|N|E|D)&&!Ve[4].length&&Ve[9]==1?_e=_e[Ub(Ve[0])].apply(_e,Ve[3]):_e=xe.length==1&&Jj(xe)?_e[Le]():_e.thru(xe)}return function(){var ht=arguments,ft=ht[0];if(_e&&ht.length==1&&Xr(ft))return _e.plant(ft).value();for(var wt=0,Yt=k?v[wt].apply(this,ht):ft;++wt<k;)Yt=v[wt].call(this,Yt);return Yt}})}function Lb(p,v,k,q,te,xe,_e,Le,Ve,ht){var ft=v&T,wt=v&b,Yt=v&w,yr=v&(N|S),Pr=v&A,ds=Yt?r:ay(p);function Rr(){for(var Fs=arguments.length,_s=et(Fs),el=Fs;el--;)_s[el]=arguments[el];if(yr)var ro=Gp(Rr),tl=Iu(_s,ro);if(q&&(_s=J_(_s,q,te,yr)),xe&&(_s=Y_(_s,xe,_e,yr)),Fs-=tl,yr&&Fs<ht){var ra=bo(_s,ro);return n4(p,v,Lb,Rr.placeholder,k,_s,ra,Le,Ve,ht-Fs)}var jc=wt?k:this,Qu=Yt?jc[p]:p;return Fs=_s.length,Le?_s=dH(_s,Le):Pr&&Fs>1&&_s.reverse(),ft&&Ve<Fs&&(_s.length=Ve),this&&this!==Dn&&this instanceof Rr&&(Qu=ds||ay(Qu)),Qu.apply(jc,_s)}return Rr}function r4(p,v){return function(k,q){return ea(k,p,v(q),{})}}function Ib(p,v){return function(k,q){var te;if(k===r&&q===r)return v;if(k!==r&&(te=k),q!==r){if(te===r)return q;typeof k=="string"||typeof q=="string"?(k=_i(k),q=_i(q)):(k=Rb(k),q=Rb(q)),te=p(k,q)}return te}}function Uj(p){return Ju(function(v){return v=ur(v,Vs(Dr())),ns(function(k){var q=this;return p(v,function(te){return je(te,q,k)})})})}function Ob(p,v){v=v===r?" ":_i(v);var k=v.length;if(k<2)return k?zp(v,p):v;var q=zp(v,th(p/ci(v)));return ya(v)?El(ui(q),0,p).join(""):q.slice(0,p)}
vendor: 3,441 bytes, line 1020
1020function GU(p,v,k,q){var te=v&b,xe=ay(p);function _e(){for(var Le=-1,Ve=arguments.length,ht=-1,ft=q.length,wt=et(ft+Ve),Yt=this&&this!==Dn&&this instanceof _e?xe:p;++ht<ft;)wt[ht]=q[ht];for(;Ve--;)wt[ht++]=arguments[++Le];return je(Yt,te?k:this,wt)}return _e}function s4(p){return function(v,k,q){return q&&typeof q!="number"&&to(v,k,q)&&(k=q=r),v=Xu(v),k===r?(k=v,v=0):k=Xu(k),q=q===r?v<k?1:-1:Xu(q),tf(v,k,q,p)}}function zb(p){return function(v,k){return typeof v=="string"&&typeof k=="string"||(v=Dl(v),k=Dl(k)),p(v,k)}}function n4(p,v,k,q,te,xe,_e,Le,Ve,ht){var ft=v&N,wt=ft?_e:r,Yt=ft?r:_e,yr=ft?xe:r,Pr=ft?r:xe;v|=ft?E:C,v&=~(ft?C:E),v&j||(v&=-4);var ds=[p,v,te,yr,wt,Pr,Yt,Le,Ve,ht],Rr=k.apply(r,ds);return Jj(p)&&g4(Rr,ds),Rr.placeholder=q,x4(Rr,p,v)}function Hj(p){var v=ss[p];return function(k,q){if(k=Dl(k),q=q==null?0:Ga(as(q),292),q&&yb(k)){var te=(Ws(k)+"e").split("e"),xe=v(te[0]+"e"+(+te[1]+q));return te=(Ws(xe)+"e").split("e"),+(te[0]+"e"+(+te[1]-q))}return v(k)}}var VU=nh&&1/dc(new nh([,-0]))[1]==G?function(p){return new nh(p)}:u2;function a4(p){return function(v){var k=Ei(v);return k==Me?Ko(v):k==ce?Tn(v):Dm(v,p(v))}}function Ku(p,v,k,q,te,xe,_e,Le){var Ve=v&w;if(!Ve&&typeof p!="function")throw new Da(o);var ht=q?q.length:0;if(ht||(v&=-97,q=te=r),_e=_e===r?_e:Xn(as(_e),0),Le=Le===r?Le:as(Le),ht-=te?te.length:0,v&C){var ft=q,wt=te;q=te=r}var Yt=Ve?r:qj(p),yr=[p,v,k,q,te,ft,wt,xe,_e,Le];if(Yt&&lH(yr,Yt),p=yr[0],v=yr[1],k=yr[2],q=yr[3],te=yr[4],Le=yr[9]=yr[9]===r?Ve?0:p.length:Xn(yr[9]-ht,0),!Le&&v&(N|S)&&(v&=-25),!v||v==b)var Pr=WU(p,v,k);else v==N||v==S?Pr=qU(p,v,Le):(v==E||v==(b|E))&&!te.length?Pr=GU(p,v,k,q):Pr=Lb.apply(r,yr);var ds=Yt?xc:g4;return x4(ds(Pr,yr),p,v)}function i4(p,v,k,q){return p===r||wc(p,Uu[k])&&!Rs.call(q,k)?v:p}function o4(p,v,k,q,te,xe){return Rn(p)&&Rn(v)&&(xe.set(v,p),Xo(p,v,r,o4,xe),xe.delete(v)),p}function KU(p){return ly(p)?r:p}function l4(p,v,k,q,te,xe){var _e=k&g,Le=p.length,Ve=v.length;if(Le!=Ve&&!(_e&&Ve>Le))return!1;var ht=xe.get(p),ft=xe.get(v);if(ht&&ft)return ht==v&&ft==p;var wt=-1,Yt=!0,yr=k&y?new z:r;for(xe.set(p,v),xe.set(v,p);++wt<Le;){var Pr=p[wt],ds=v[wt];if(q)var Rr=_e?q(ds,Pr,wt,v,p,xe):q(Pr,ds,wt,p,v,xe);if(Rr!==r){if(Rr)continue;Yt=!1;break}if(yr){if(!$s(v,function(Fs,_s){if(!Fl(yr,_s)&&(Pr===Fs||te(Pr,Fs,k,q,xe)))return yr.push(_s)})){Yt=!1;break}}else if(!(Pr===ds||te(Pr,ds,k,q,xe))){Yt=!1;break}}return xe.delete(p),xe.delete(v),Yt}function JU(p,v,k,q,te,xe,_e){switch(k){case qe:if(p.byteLength!=v.byteLength||p.byteOffset!=v.byteOffset)return!1;p=p.buffer,v=v.buffer;case Pe:return!(p.byteLength!=v.byteLength||!xe(new Hm(p),new Hm(v)));case he:case ve:case ae:return wc(+p,+v);case re:return p.name==v.name&&p.message==v.message;case Ft:case fe:return p==v+"";case Me:var Le=Ko;case ce:var Ve=q&g;if(Le||(Le=dc),p.size!=v.size&&!Ve)return!1;var ht=_e.get(p);if(ht)return ht==v;q|=y,_e.set(p,v);var ft=l4(Le(p),Le(v),q,te,xe,_e);return _e.delete(p),ft;case ge:if(wo)return wo.call(p)==wo.call(v)}return!1}function YU(p,v,k,q,te,xe){var _e=k&g,Le=$j(p),Ve=Le.length,ht=$j(v),ft=ht.length;if(Ve!=ft&&!_e)return!1;for(var wt=Ve;wt--;){var Yt=Le[wt];if(!(_e?Yt in v:Rs.call(v,Yt)))return!1}var yr=xe.get(p),Pr=xe.get(v);if(yr&&Pr)return yr==v&&Pr==p;var ds=!0;xe.set(p,v),xe.set(v,p);for(var Rr=_e;++wt<Ve;){Yt=Le[wt];var Fs=p[Yt],_s=v[Yt];if(q)var el=_e?q(_s,Fs,Yt,v,p,xe):q(Fs,_s,Yt,p,v,xe);if(!(el===r?Fs===_s||te(Fs,_s,k,q,xe):el)){ds=!1;break}
vendor: 8,482 bytes, lines 1020-1022
1020Rr||(Rr=Yt=="constructor")}if(ds&&!Rr){var ro=p.constructor,tl=v.constructor;ro!=tl&&"constructor"in p&&"constructor"in v&&!(typeof ro=="function"&&ro instanceof ro&&typeof tl=="function"&&tl instanceof tl)&&(ds=!1)}return xe.delete(p),xe.delete(v),ds}function Ju(p){return Zj(f4(p,r,N4),p+"")}function $j(p){return xn(p,Ka,Vj)}function Wj(p){return xn(p,ko,c4)}var qj=Rp?function(p){return Rp.get(p)}:u2;function Ub(p){for(var v=p.name+"",k=ih[v],q=Rs.call(ih,v)?k.length:0;q--;){var te=k[q],xe=te.func;if(xe==null||xe==p)return te.name}return v}function Gp(p){var v=Rs.call(de,"placeholder")?de:p;return v.placeholder}function Dr(){var p=de.iteratee||l2;return p=p===l2?Ym:p,arguments.length?p(arguments[0],arguments[1]):p}function Hb(p,v){var k=p.__data__;return nH(v)?k[typeof v=="string"?"string":"hash"]:k.map}function Gj(p){for(var v=Ka(p),k=v.length;k--;){var q=v[k],te=p[q];v[k]=[q,te,h4(te)]}return v}function sf(p,v){var k=Ou(p,v);return No(k)?k:r}function ZU(p){var v=Rs.call(p,ru),k=p[ru];try{p[ru]=r;var q=!0}catch{}var te=zm.call(p);return q&&(v?p[ru]=k:delete p[ru]),te}var Vj=sh?function(p){return p==null?[]:(p=$r(p),tr(sh(p),function(v){return Ci.call(p,v)}))}:d2,c4=sh?function(p){for(var v=[];p;)es(v,Vj(p)),p=eh(p);return v}:d2,Ei=Gr;(qm&&Ei(new qm(new ArrayBuffer(1)))!=qe||mc&&Ei(new mc)!=Me||ty&&Ei(ty.resolve())!=tt||nh&&Ei(new nh)!=ce||ah&&Ei(new ah)!=Je)&&(Ei=function(p){var v=Gr(p),k=v==mt?p.constructor:r,q=k?nf(k):"";if(q)switch(q){case kj:return qe;case su:return Me;case Yo:return tt;case fc:return ce;case _j:return Je}return v});function XU(p,v,k){for(var q=-1,te=k.length;++q<te;){var xe=k[q],_e=xe.size;switch(xe.type){case"drop":p+=_e;break;case"dropRight":v-=_e;break;case"take":v=Ga(v,p+_e);break;case"takeRight":p=Xn(p,v-_e);break}}return{start:p,end:v}}function QU(p){var v=p.match(_a);return v?v[1].split(Au):[]}function u4(p,v,k){v=vc(v,p);for(var q=-1,te=v.length,xe=!1;++q<te;){var _e=iu(v[q]);if(!(xe=p!=null&&k(p,_e)))break;p=p[_e]}return xe||++q!=te?xe:(te=p==null?0:p.length,!!te&&Jb(te)&&Yu(_e,te)&&(Xr(p)||af(p)))}function eH(p){var v=p.length,k=new p.constructor(v);return v&&typeof p[0]=="string"&&Rs.call(p,"index")&&(k.index=p.index,k.input=p.input),k}function d4(p){return typeof p.constructor=="function"&&!iy(p)?oh(eh(p)):{}}function tH(p,v,k){var q=p.constructor;switch(v){case Pe:return zj(p);case he:case ve:return new q(+p);case qe:return IU(p,k);case Qe:case We:case dt:case Bt:case Lt:case Vt:case cr:case wr:case Xt:return V_(p,k);case Me:return new q;case ae:case fe:return new q(p);case Ft:return OU(p);case ce:return new q;case ge:return zU(p)}}function rH(p,v){var k=v.length;if(!k)return p;var q=k-1;return v[q]=(k>1?"& ":"")+v[q],v=v.join(k>2?", ":" "),p.replace(xa,`{ 1021/* [wrapped with `+v+`] */ 1022`)}function sH(p){return Xr(p)||af(p)||!!(Wm&&p&&p[Wm])}function Yu(p,v){var k=typeof p;return v=v??B,!!v&&(k=="number"||k!="symbol"&&Od.test(p))&&p>-1&&p%1==0&&p<v}function to(p,v,k){if(!Rn(k))return!1;var q=typeof v;return(q=="number"?Co(k)&&Yu(v,k.length):q=="string"&&v in k)?wc(k[v],p):!1}function Kj(p,v){if(Xr(p))return!1;var k=typeof p;return k=="number"||k=="symbol"||k=="boolean"||p==null||Qo(p)?!0:hr.test(p)||!wn.test(p)||v!=null&&p in $r(v)}function nH(p){var v=typeof p;return v=="string"||v=="number"||v=="symbol"||v=="boolean"?p!=="__proto__":p===null}function Jj(p){var v=Ub(p),k=de[v];if(typeof k!="function"||!(v in ps.prototype))return!1;if(p===k)return!0;var q=qj(k);return!!q&&p===q[0]}function aH(p){return!!Qd&&Qd in p}var iH=Im?Zu:h2;function iy(p){var v=p&&p.constructor,k=typeof v=="function"&&v.prototype||Uu;return p===k}function h4(p){return p===p&&!Rn(p)}function m4(p,v){return function(k){return k==null?!1:k[p]===v&&(v!==r||p in $r(k))}}function oH(p){var v=Vb(p,function(q){return k.size===u&&k.clear(),q}),k=v.cache;return v}function lH(p,v){var k=p[1],q=v[1],te=k|q,xe=te<(b|w|T),_e=q==T&&k==N||q==T&&k==D&&p[7].length<=v[8]||q==(T|D)&&v[7].length<=v[8]&&k==N;if(!(xe||_e))return p;q&b&&(p[2]=v[2],te|=k&b?0:j);var Le=v[3];if(Le){var Ve=p[3];p[3]=Ve?J_(Ve,Le,v[4]):Le,p[4]=Ve?bo(p[3],d):v[4]}return Le=v[5],Le&&(Ve=p[5],p[5]=Ve?Y_(Ve,Le,v[6]):Le,p[6]=Ve?bo(p[5],d):v[6]),Le=v[7],Le&&(p[7]=Le),q&T&&(p[8]=p[8]==null?v[8]:Ga(p[8],v[8])),p[9]==null&&(p[9]=v[9]),p[0]=v[0],p[1]=te,p}function cH(p){var v=[];if(p!=null)for(var k in $r(p))v.push(k);return v}function uH(p){return zm.call(p)}function f4(p,v,k){return v=Xn(v===r?p.length-1:v,0),function(){for(var q=arguments,te=-1,xe=Xn(q.length-v,0),_e=et(xe);++te<xe;)_e[te]=q[v+te];te=-1;for(var Le=et(v+1);++te<v;)Le[te]=q[te];return Le[v]=k(_e),je(p,this,Le)}}function p4(p,v){return v.length<2?p:Ns(p,Fo(v,0,-1))}function dH(p,v){for(var k=p.length,q=Ga(v.length,k),te=So(p);q--;){var xe=v[q];p[q]=Yu(xe,k)?te[xe]:r}return p}function Yj(p,v){if(!(v==="constructor"&&typeof p[v]=="function")&&v!="__proto__")return p[v]}var g4=y4(xc),oy=xb||function(p,v){return Dn.setTimeout(p,v)},Zj=y4(Tb);function x4(p,v,k){var q=v+"";return Zj(p,rH(q,hH(QU(q),k)))}function y4(p){var v=0,k=0;return function(){var q=Sj(),te=U-(q-k);if(k=q,te>0){if(++v>=P)return arguments[0]}else v=0;return p.apply(r,arguments)}}function $b(p,v){var k=-1,q=p.length,te=q-1;for(v=v===r?q:v;++k<v;){var xe=ef(k,te),_e=p[xe];p[xe]=p[k],p[k]=_e}return p.length=v,p}var b4=oH(function(p){var v=[];return p.charCodeAt(0)===46&&v.push(""),p.replace(ga,function(k,q,te,xe){v.push(te?xe.replace(xl,"$1"):q||k)}),v});function iu(p){if(typeof p=="string"||Qo(p))return p;var v=p+"";return v=="0"&&1/p==-G?"-0":v}function nf(p){if(p!=null){try{return Om.call(p)}catch{}try{return p+""}catch{}}return""}function hH(p,v){return $e(X,function(k){var q="_."+k[0];v&k[1]&&!mr(p,q)&&p.push(q)}),p.sort()}function v4(p){if(p instanceof ps)return p.clone();var v=new Zi(p.__wrapped__,p.__chain__);return v.__actions__=So(p.__actions__),v.__index__=p.__index__,v.__values__=p.__values__,v}function mH(p,v,k){(k?to(p,v,k):v===r)?v=1:v=Xn(as(v),0);var q=p==null?0:p.length;if(!q||v<1)return[];for(var te=0,xe=0,_e=et(th(q/v));te<q;)_e[xe++]=Fo(p,te,te+=v);return _e}function fH(p){for(var v=-1,k=p==null?0:p.length,q=0,te=[];++v<k;){var xe=p[v];xe&&(te[q++]=xe)}return te}function pH(){var p=arguments.length;if(!p)return[];for(var v=et(p-1),k=arguments[0],q=p;q--;)v[q-1]=arguments[q];return es(Xr(k)?So(k):[k],Bs(v,1))}var gH=ns(function(p,v){return ta(p)?dr(p,Bs(v,1,ta,!0)):[]}),xH=ns(function(p,v){var k=Al(v);return ta(k)&&(k=r),ta(p)?dr(p,Bs(v,1,ta,!0),Dr(k,2)):[]}),yH=ns(function(p,v){var k=Al(v);return ta(k)&&(k=r),ta(p)?dr(p,Bs(v,1,ta,!0),r,k):[]});function bH(p,v,k){var q=p==null?0:p.length;return q?(v=k||v===r?1:as(v),Fo(p,v<0?0:v,q)):[]}function vH(p,v,k){var q=p==null?0:p.length;return q?(v=k||v===r?1:as(v),v=q-v,Fo(p,0,v<0?0:v)):[]}function wH(p,v){return p&&p.length?Vu(p,Dr(v,3),!0,!0):[]}function jH(p,v){return p&&p.length?Vu(p,Dr(v,3),!0):[]}function NH(p,v,k,q){var te=p==null?0:p.length;return te?(k&&typeof k!="number"&&to(p,v,k)&&(k=0,q=te),an(p,v,k,q)):[]}function w4(p,v,k){var q=p==null?0:p.length;if(!q)return-1;var te=k==null?0:as(k);return te<0&&(te=Xn(q+te,0)),Fi(p,Dr(v,3),te)}function j4(p,v,k){var q=p==null?0:p.length;if(!q)return-1;var te=q-1;return k!==r&&(te=as(k),te=k<0?Xn(q+te,0):Ga(te,q-1)),Fi(p,Dr(v,3),te,!0)}function N4(p){var v=p==null?0:p.length;return v?Bs(p,1):[]}function FH(p){var v=p==null?0:p.length;return v?Bs(p,G):[]}function SH(p,v){var k=p==null?0:p.length;return k?(v=v===r?1:as(v),Bs(p,v)):[]}function CH(p){for(var v=-1,k=p==null?0:p.length,q={};++v<k;){var te=p[v];q[te[0]]=te[1]}return q}function F4(p){return p&&p.length?p[0]:r}function kH(p,v,k){var q=p==null?0:p.length;if(!q)return-1;var te=k==null?0:as(k);return te<0&&(te=Xn(q+te,0)),Si(p,v,te)}function _H(p){var v=p==null?0:p.length;return v?Fo(p,0,-1):[]}var EH=ns(function(p){var v=ur(p,lh);return v.length&&v[0]===p[0]?Us(v):[]}),AH=ns(function(p){var v=Al(p),k=ur(p,lh);return v===Al(k)?v=r:k.pop(),k.length&&k[0]===p[0]?Us(k,Dr(v,2)):[]}),DH=ns(function(p){var v=Al(p),k=ur(p,lh);return v=typeof v=="function"?v:r,v&&k.pop(),k.length&&k[0]===p[0]?Us(k,r,v):[]});function TH(p,v){return p==null?"":Fj.call(p,v)}function Al(p){var v=p==null?0:p.length;return v?p[v-1]:r}function MH(p,v,k){var q=p==null?0:p.length;if(!q)return-1;var te=q;return k!==r&&(te=as(k),te=te<0?Xn(q+te,0):Ga(te,q-1)),v===v?Sl(p,v,te):Fi(p,Lu,te,!0)}function PH(p,v){return p&&p.length?kb(p,as(v)):r}var RH=ns(S4);function S4(p,v){return p&&p.length&&v&&v.length?Op(p,v):p}
vendor: 9,624 bytes, line 1022
1022function BH(p,v,k){return p&&p.length&&v&&v.length?Op(p,v,Dr(k,2)):p}function LH(p,v,k){return p&&p.length&&v&&v.length?Op(p,v,r,k):p}var IH=Ju(function(p,v){var k=p==null?0:p.length,q=or(p,v);return Qm(p,ur(v,function(te){return Yu(te,k)?+te:te}).sort(K_)),q});function OH(p,v){var k=[];if(!(p&&p.length))return k;var q=-1,te=[],xe=p.length;for(v=Dr(v,3);++q<xe;){var _e=p[q];v(_e,q,p)&&(k.push(_e),te.push(q))}return Qm(p,te),k}function Xj(p){return p==null?p:ey.call(p)}function zH(p,v,k){var q=p==null?0:p.length;return q?(k&&typeof k!="number"&&to(p,v,k)?(v=0,k=q):(v=v==null?0:as(v),k=k===r?q:as(k)),Fo(p,v,k)):[]}function UH(p,v){return yc(p,v)}function HH(p,v,k){return sy(p,v,Dr(k,2))}function $H(p,v){var k=p==null?0:p.length;if(k){var q=yc(p,v);if(q<k&&wc(p[q],v))return q}return-1}function WH(p,v){return yc(p,v,!0)}function qH(p,v,k){return sy(p,v,Dr(k,2),!0)}function GH(p,v){var k=p==null?0:p.length;if(k){var q=yc(p,v,!0)-1;if(wc(p[q],v))return q}return-1}function VH(p){return p&&p.length?ny(p):[]}function KH(p,v){return p&&p.length?ny(p,Dr(v,2)):[]}function JH(p){var v=p==null?0:p.length;return v?Fo(p,1,v):[]}function YH(p,v,k){return p&&p.length?(v=k||v===r?1:as(v),Fo(p,0,v<0?0:v)):[]}function ZH(p,v,k){var q=p==null?0:p.length;return q?(v=k||v===r?1:as(v),v=q-v,Fo(p,v<0?0:v,q)):[]}function XH(p,v){return p&&p.length?Vu(p,Dr(v,3),!1,!0):[]}function QH(p,v){return p&&p.length?Vu(p,Dr(v,3)):[]}var e$=ns(function(p){return nu(Bs(p,1,ta,!0))}),t$=ns(function(p){var v=Al(p);return ta(v)&&(v=r),nu(Bs(p,1,ta,!0),Dr(v,2))}),r$=ns(function(p){var v=Al(p);return v=typeof v=="function"?v:r,nu(Bs(p,1,ta,!0),r,v)});function s$(p){return p&&p.length?nu(p):[]}function n$(p,v){return p&&p.length?nu(p,Dr(v,2)):[]}function a$(p,v){return v=typeof v=="function"?v:r,p&&p.length?nu(p,r,v):[]}function Qj(p){if(!(p&&p.length))return[];var v=0;return p=tr(p,function(k){if(ta(k))return v=Xn(k.length,v),!0}),cc(v,function(k){return ur(p,ac(k))})}function C4(p,v){if(!(p&&p.length))return[];var k=Qj(p);return v==null?k:ur(k,function(q){return je(v,r,q)})}var i$=ns(function(p,v){return ta(p)?dr(p,v):[]}),o$=ns(function(p){return _l(tr(p,ta))}),l$=ns(function(p){var v=Al(p);return ta(v)&&(v=r),_l(tr(p,ta),Dr(v,2))}),c$=ns(function(p){var v=Al(p);return v=typeof v=="function"?v:r,_l(tr(p,ta),r,v)}),u$=ns(Qj);function d$(p,v){return bc(p||[],v||[],Ye)}function h$(p,v){return bc(p||[],v||[],qu)}var m$=ns(function(p){var v=p.length,k=v>1?p[v-1]:r;return k=typeof k=="function"?(p.pop(),k):r,C4(p,k)});function k4(p){var v=de(p);return v.__chain__=!0,v}function f$(p,v){return v(p),p}function Wb(p,v){return v(p)}var p$=Ju(function(p){var v=p.length,k=v?p[0]:0,q=this.__wrapped__,te=function(xe){return or(xe,p)};return v>1||this.__actions__.length||!(q instanceof ps)||!Yu(k)?this.thru(te):(q=q.slice(k,+k+(v?1:0)),q.__actions__.push({func:Wb,args:[te],thisArg:r}),new Zi(q,this.__chain__).thru(function(xe){return v&&!xe.length&&xe.push(r),xe}))});function g$(){return k4(this)}function x$(){return new Zi(this.value(),this.__chain__)}function y$(){this.__values__===r&&(this.__values__=U4(this.value()));var p=this.__index__>=this.__values__.length,v=p?r:this.__values__[this.__index__++];return{done:p,value:v}}function b$(){return this}function v$(p){for(var v,k=this;k instanceof Km;){var q=v4(k);q.__index__=0,q.__values__=r,v?te.__wrapped__=q:v=q;var te=q;k=k.__wrapped__}return te.__wrapped__=p,v}function w$(){var p=this.__wrapped__;if(p instanceof ps){var v=p;return this.__actions__.length&&(v=new ps(this)),v=v.reverse(),v.__actions__.push({func:Wb,args:[Xj],thisArg:r}),new Zi(v,this.__chain__)}return this.thru(Xj)}function j$(){return kl(this.__wrapped__,this.__actions__)}var N$=Bb(function(p,v,k){Rs.call(p,k)?++p[k]:lr(p,k,1)});function F$(p,v,k){var q=Xr(p)?yt:qr;return k&&to(p,v,k)&&(v=r),q(p,Dr(v,3))}function S$(p,v){var k=Xr(p)?tr:ba;return k(p,Dr(v,3))}var C$=e4(w4),k$=e4(j4);function _$(p,v){return Bs(qb(p,v),1)}function E$(p,v){return Bs(qb(p,v),G)}function A$(p,v,k){return k=k===r?1:as(k),Bs(qb(p,v),k)}function _4(p,v){var k=Xr(p)?$e:_t;return k(p,Dr(v,3))}function E4(p,v){var k=Xr(p)?it:Nn;return k(p,Dr(v,3))}var D$=Bb(function(p,v,k){Rs.call(p,k)?p[k].push(v):lr(p,k,[v])});function T$(p,v,k,q){p=Co(p)?p:Kp(p),k=k&&!q?as(k):0;var te=p.length;return k<0&&(k=Xn(te+k,0)),Yb(p)?k<=te&&p.indexOf(v,k)>-1:!!te&&Si(p,v,k)>-1}var M$=ns(function(p,v,k){var q=-1,te=typeof v=="function",xe=Co(p)?et(p.length):[];return _t(p,function(_e){xe[++q]=te?je(v,_e,k):Ma(_e,v,k)}),xe}),P$=Bb(function(p,v,k){lr(p,k,v)});function qb(p,v){var k=Xr(p)?ur:Sb;return k(p,Dr(v,3))}function R$(p,v,k,q){return p==null?[]:(Xr(v)||(v=v==null?[]:[v]),k=q?r:k,Xr(k)||(k=k==null?[]:[k]),_b(p,v,k))}var B$=Bb(function(p,v,k){p[k?0:1].push(v)},function(){return[[],[]]});function L$(p,v,k){var q=Xr(p)?nn:oc,te=arguments.length<3;return q(p,Dr(v,4),k,te,_t)}function I$(p,v,k){var q=Xr(p)?On:oc,te=arguments.length<3;return q(p,Dr(v,4),k,te,Nn)}function O$(p,v){var k=Xr(p)?tr:ba;return k(p,Kb(Dr(v,3)))}function z$(p){var v=Xr(p)?Fe:Up;return v(p)}function U$(p,v,k){(k?to(p,v,k):v===r)?v=1:v=as(v);var q=Xr(p)?He:Db;return q(p,v)}function H$(p){var v=Xr(p)?Ke:Mb;return v(p)}function $$(p){if(p==null)return 0;if(Co(p))return Yb(p)?ci(p):p.length;var v=Ei(p);return v==Me||v==ce?p.size:Zm(p).length}function W$(p,v,k){var q=Xr(p)?$s:Pb;return k&&to(p,v,k)&&(v=r),q(p,Dr(v,3))}var q$=ns(function(p,v){if(p==null)return[];var k=v.length;return k>1&&to(p,v[0],v[1])?v=[]:k>2&&to(v[0],v[1],v[2])&&(v=[v[0]]),_b(p,Bs(v,1),[])}),Gb=Xx||function(){return Dn.Date.now()};function G$(p,v){if(typeof v!="function")throw new Da(o);return p=as(p),function(){if(--p<1)return v.apply(this,arguments)}}function A4(p,v,k){return v=k?r:v,v=p&&v==null?p.length:v,Ku(p,T,r,r,r,r,v)}function D4(p,v){var k;if(typeof v!="function")throw new Da(o);return p=as(p),function(){return--p>0&&(k=v.apply(this,arguments)),p<=1&&(v=r),k}}var e2=ns(function(p,v,k){var q=b;if(k.length){var te=bo(k,Gp(e2));q|=E}return Ku(p,q,v,k,te)}),T4=ns(function(p,v,k){var q=b|w;if(k.length){var te=bo(k,Gp(T4));q|=E}return Ku(v,q,p,k,te)});function M4(p,v,k){v=k?r:v;var q=Ku(p,N,r,r,r,r,r,v);return q.placeholder=M4.placeholder,q}function P4(p,v,k){v=k?r:v;var q=Ku(p,S,r,r,r,r,r,v);return q.placeholder=P4.placeholder,q}function R4(p,v,k){var q,te,xe,_e,Le,Ve,ht=0,ft=!1,wt=!1,Yt=!0;if(typeof p!="function")throw new Da(o);v=Dl(v)||0,Rn(k)&&(ft=!!k.leading,wt="maxWait"in k,xe=wt?Xn(Dl(k.maxWait)||0,v):xe,Yt="trailing"in k?!!k.trailing:Yt);function yr(ra){var jc=q,Qu=te;return q=te=r,ht=ra,_e=p.apply(Qu,jc),_e}function Pr(ra){return ht=ra,Le=oy(Fs,v),ft?yr(ra):_e}function ds(ra){var jc=ra-Ve,Qu=ra-ht,eE=v-jc;return wt?Ga(eE,xe-Qu):eE}function Rr(ra){var jc=ra-Ve,Qu=ra-ht;return Ve===r||jc>=v||jc<0||wt&&Qu>=xe}function Fs(){var ra=Gb();if(Rr(ra))return _s(ra);Le=oy(Fs,ds(ra))}function _s(ra){return Le=r,Yt&&q?yr(ra):(q=te=r,_e)}function el(){Le!==r&&$p(Le),ht=0,q=Ve=te=Le=r}function ro(){return Le===r?_e:_s(Gb())}function tl(){var ra=Gb(),jc=Rr(ra);if(q=arguments,te=this,Ve=ra,jc){if(Le===r)return Pr(Ve);if(wt)return $p(Le),Le=oy(Fs,v),yr(Ve)}return Le===r&&(Le=oy(Fs,v)),_e}return tl.cancel=el,tl.flush=ro,tl}var V$=ns(function(p,v){return Kr(p,1,v)}),K$=ns(function(p,v,k){return Kr(p,Dl(v)||0,k)});function J$(p){return Ku(p,A)}function Vb(p,v){if(typeof p!="function"||v!=null&&typeof v!="function")throw new Da(o);var k=function(){var q=arguments,te=v?v.apply(this,q):q[0],xe=k.cache;if(xe.has(te))return xe.get(te);var _e=p.apply(this,q);return k.cache=xe.set(te,_e)||xe,_e};return k.cache=new(Vb.Cache||jo),k}Vb.Cache=jo;function Kb(p){if(typeof p!="function")throw new Da(o);return function(){var v=arguments;switch(v.length){case 0:return!p.call(this);case 1:return!p.call(this,v[0]);case 2:return!p.call(this,v[0],v[1]);case 3:return!p.call(this,v[0],v[1],v[2])}return!p.apply(this,v)}}function Y$(p){return D4(2,p)}var Z$=Oj(function(p,v){v=v.length==1&&Xr(v[0])?ur(v[0],Vs(Dr())):ur(Bs(v,1),Vs(Dr()));var k=v.length;return ns(function(q){for(var te=-1,xe=Ga(q.length,k);++te<xe;)q[te]=v[te].call(this,q[te]);return je(p,this,q)})}),t2=ns(function(p,v){var k=bo(v,Gp(t2));return Ku(p,E,r,v,k)}),B4=ns(function(p,v){var k=bo(v,Gp(B4));return Ku(p,C,r,v,k)}),X$=Ju(function(p,v){return Ku(p,D,r,r,r,v)});function Q$(p,v){if(typeof p!="function")throw new Da(o);return v=v===r?v:as(v),ns(p,v)}function eW(p,v){if(typeof p!="function")throw new Da(o);return v=v==null?0:Xn(as(v),0),ns(function(k){var q=k[v],te=El(k,0,v);return q&&es(te,q),je(p,this,te)})}function tW(p,v,k){var q=!0,te=!0;if(typeof p!="function")throw new Da(o);return Rn(k)&&(q="leading"in k?!!k.leading:q,te="trailing"in k?!!k.trailing:te),R4(p,v,{leading:q,maxWait:v,trailing:te})}function rW(p){return A4(p,1)}function sW(p,v){return t2(rf(v),p)}function nW(){if(!arguments.length)return[];var p=arguments[0];return Xr(p)?p:[p]}function aW(p){return Qt(p,m)}function iW(p,v){return v=typeof v=="function"?v:r,Qt(p,m,v)}function oW(p){return Qt(p,h|m)}function lW(p,v){return v=typeof v=="function"?v:r,Qt(p,h|m,v)}function cW(p,v){return v==null||Un(p,v,Ka(v))}function wc(p,v){return p===v||p!==p&&v!==v}var uW=zb(Qn),dW=zb(function(p,v){return p>=v}),af=Va(function(){return arguments}())?Va:function(p){return Hn(p)&&Rs.call(p,"callee")&&!Ci.call(p,"callee")},Xr=et.isArray,hW=jl?Vs(jl):Xi;function Co(p){return p!=null&&Jb(p.length)&&!Zu(p)}function ta(p){return Hn(p)&&Co(p)}function mW(p){return p===!0||p===!1||Hn(p)&&Gr(p)==he}var ch=Qx||h2,fW=_m?Vs(_m):Qi;function pW(p){return Hn(p)&&p.nodeType===1&&!ly(p)}function gW(p){if(p==null)return!0;
vendor: 7,237 bytes, line 1022
1022if(Co(p)&&(Xr(p)||typeof p=="string"||typeof p.splice=="function"||ch(p)||Vp(p)||af(p)))return!p.length;var v=Ei(p);if(v==Me||v==ce)return!p.size;if(iy(p))return!Zm(p).length;for(var k in p)if(Rs.call(p,k))return!1;return!0}function xW(p,v){return va(p,v)}function yW(p,v,k){k=typeof k=="function"?k:r;var q=k?k(p,v):r;return q===r?va(p,v,r,k):!!q}function r2(p){if(!Hn(p))return!1;var v=Gr(p);return v==re||v==Ce||typeof p.message=="string"&&typeof p.name=="string"&&!ly(p)}function bW(p){return typeof p=="number"&&yb(p)}function Zu(p){if(!Rn(p))return!1;var v=Gr(p);return v==we||v==Ee||v==ee||v==Xe}function L4(p){return typeof p=="number"&&p==as(p)}function Jb(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=B}function Rn(p){var v=typeof p;return p!=null&&(v=="object"||v=="function")}function Hn(p){return p!=null&&typeof p=="object"}var I4=Jc?Vs(Jc):en;function vW(p,v){return p===v||hi(p,v,Gj(v))}function wW(p,v,k){return k=typeof k=="function"?k:r,hi(p,v,Gj(v),k)}function jW(p){return O4(p)&&p!=+p}function NW(p){if(iH(p))throw new Jt(i);return No(p)}function FW(p){return p===null}function SW(p){return p==null}function O4(p){return typeof p=="number"||Hn(p)&&Gr(p)==ae}function ly(p){if(!Hn(p)||Gr(p)!=mt)return!1;var v=eh(p);if(v===null)return!0;var k=Rs.call(v,"constructor")&&v.constructor;return typeof k=="function"&&k instanceof k&&Om.call(k)==fb}var s2=Em?Vs(Em):$u;function CW(p){return L4(p)&&p>=-B&&p<=B}var z4=L?Vs(L):gc;function Yb(p){return typeof p=="string"||!Xr(p)&&Hn(p)&&Gr(p)==fe}function Qo(p){return typeof p=="symbol"||Hn(p)&&Gr(p)==ge}var Vp=se?Vs(se):Pa;function kW(p){return p===r}function _W(p){return Hn(p)&&Ei(p)==Je}function EW(p){return Hn(p)&&Gr(p)==be}var AW=zb(Wu),DW=zb(function(p,v){return p<=v});function U4(p){if(!p)return[];if(Co(p))return Yb(p)?ui(p):So(p);if(tu&&p[tu])return Zc(p[tu]());var v=Ei(p),k=v==Me?Ko:v==ce?dc:Kp;return k(p)}function Xu(p){if(!p)return p===0?p:0;if(p=Dl(p),p===G||p===-G){var v=p<0?-1:1;return v*$}return p===p?p:0}function as(p){var v=Xu(p),k=v%1;return v===v?k?v-k:v:0}function H4(p){return p?Lr(as(p),0,oe):0}function Dl(p){if(typeof p=="number")return p;if(Qo(p))return W;if(Rn(p)){var v=typeof p.valueOf=="function"?p.valueOf():p;p=Rn(v)?v+"":v}if(typeof p!="string")return p===0?p:+p;p=Zd(p);var k=Du.test(p);return k||Tu.test(p)?rc(p.slice(2),k?2:8):go.test(p)?W:+p}function $4(p){return au(p,ko(p))}function TW(p){return p?Lr(as(p),-B,B):p===0?p:0}function Ws(p){return p==null?"":_i(p)}var MW=Wp(function(p,v){if(iy(v)||Co(v)){au(v,Ka(v),p);return}for(var k in v)Rs.call(v,k)&&Ye(p,k,v[k])}),W4=Wp(function(p,v){au(v,ko(v),p)}),Zb=Wp(function(p,v,k,q){au(v,ko(v),p,q)}),PW=Wp(function(p,v,k,q){au(v,Ka(v),p,q)}),RW=Ju(or);function BW(p,v){var k=oh(p);return v==null?k:jt(k,v)}var LW=ns(function(p,v){p=$r(p);var k=-1,q=v.length,te=q>2?v[2]:r;for(te&&to(v[0],v[1],te)&&(q=1);++k<q;)for(var xe=v[k],_e=ko(xe),Le=-1,Ve=_e.length;++Le<Ve;){var ht=_e[Le],ft=p[ht];(ft===r||wc(ft,Uu[ht])&&!Rs.call(p,ht))&&(p[ht]=xe[ht])}return p}),IW=ns(function(p){return p.push(r,o4),je(q4,r,p)});function OW(p,v){return Nl(p,Dr(v,3),mn)}function zW(p,v){return Nl(p,Dr(v,3),Mn)}function UW(p,v){return p==null?p:hn(p,Dr(v,3),ko)}function HW(p,v){return p==null?p:Ta(p,Dr(v,3),ko)}function $W(p,v){return p&&mn(p,Dr(v,3))}function WW(p,v){return p&&Mn(p,Dr(v,3))}function qW(p){return p==null?[]:ys(p,Ka(p))}function GW(p){return p==null?[]:ys(p,ko(p))}function n2(p,v,k){var q=p==null?r:Ns(p,v);return q===r?k:q}function VW(p,v){return p!=null&&u4(p,v,Zo)}function a2(p,v){return p!=null&&u4(p,v,Pn)}var KW=r4(function(p,v,k){v!=null&&typeof v.toString!="function"&&(v=zm.call(v)),p[v]=k},o2(_o)),JW=r4(function(p,v,k){v!=null&&typeof v.toString!="function"&&(v=zm.call(v)),Rs.call(p,v)?p[v].push(k):p[v]=[k]},Dr),YW=ns(Ma);function Ka(p){return Co(p)?Ze(p):Zm(p)}function ko(p){return Co(p)?Ze(p,!0):Lp(p)}function ZW(p,v){var k={};return v=Dr(v,3),mn(p,function(q,te,xe){lr(k,v(q,te,xe),q)}),k}function XW(p,v){var k={};return v=Dr(v,3),mn(p,function(q,te,xe){lr(k,te,v(q,te,xe))}),k}var QW=Wp(function(p,v,k){Xo(p,v,k)}),q4=Wp(function(p,v,k,q){Xo(p,v,k,q)}),eq=Ju(function(p,v){var k={};if(p==null)return k;var q=!1;v=ur(v,function(xe){return xe=vc(xe,p),q||(q=xe.length>1),xe}),au(p,Wj(p),k),q&&(k=Qt(k,h|f|m,KU));for(var te=v.length;te--;)Gu(k,v[te]);return k});function tq(p,v){return G4(p,Kb(Dr(v)))}var rq=Ju(function(p,v){return p==null?{}:Eb(p,v)});function G4(p,v){if(p==null)return{};var k=ur(Wj(p),function(q){return[q]});return v=Dr(v),Xm(p,k,function(q,te){return v(q,te[0])})}function sq(p,v,k){v=vc(v,p);var q=-1,te=v.length;for(te||(te=1,p=r);++q<te;){var xe=p==null?r:p[iu(v[q])];xe===r&&(q=te,xe=k),p=Zu(xe)?xe.call(p):xe}return p}function nq(p,v,k){return p==null?p:qu(p,v,k)}function aq(p,v,k,q){return q=typeof q=="function"?q:r,p==null?p:qu(p,v,k,q)}var V4=a4(Ka),K4=a4(ko);function iq(p,v,k){var q=Xr(p),te=q||ch(p)||Vp(p);if(v=Dr(v,4),k==null){var xe=p&&p.constructor;te?k=q?new xe:[]:Rn(p)?k=Zu(xe)?oh(eh(p)):{}:k={}}return(te?$e:mn)(p,function(_e,Le,Ve){return v(k,_e,Le,Ve)}),k}function oq(p,v){return p==null?!0:Gu(p,v)}function lq(p,v,k){return p==null?p:Hp(p,v,rf(k))}function cq(p,v,k,q){return q=typeof q=="function"?q:r,p==null?p:Hp(p,v,rf(k),q)}function Kp(p){return p==null?[]:Vo(p,Ka(p))}function uq(p){return p==null?[]:Vo(p,ko(p))}function dq(p,v,k){return k===r&&(k=v,v=r),k!==r&&(k=Dl(k),k=k===k?k:0),v!==r&&(v=Dl(v),v=v===v?v:0),Lr(Dl(p),v,k)}function hq(p,v,k){return v=Xu(v),k===r?(k=v,v=0):k=Xu(k),p=Dl(p),ki(p,v,k)}function mq(p,v,k){if(k&&typeof k!="boolean"&&to(p,v,k)&&(v=k=r),k===r&&(typeof v=="boolean"?(k=v,v=r):typeof p=="boolean"&&(k=p,p=r)),p===r&&v===r?(p=0,v=1):(p=Xu(p),v===r?(v=p,p=0):v=Xu(v)),p>v){var q=p;p=v,v=q}if(k||p%1||v%1){var te=vb();return Ga(p+te*(v-p+Tp("1e-"+((te+"").length-1))),v)}return ef(p,v)}var fq=qp(function(p,v,k){return v=v.toLowerCase(),p+(k?J4(v):v)});function J4(p){return i2(Ws(p).toLowerCase())}function Y4(p){return p=Ws(p),p&&p.replace(zd,Mm).replace(Vx,"")}function pq(p,v,k){p=Ws(p),v=_i(v);var q=p.length;k=k===r?q:Lr(as(k),0,q);var te=k;return k-=v.length,k>=0&&p.slice(k,te)==v}function gq(p){return p=Ws(p),p&&Ds.test(p)?p.replace(zr,Pm):p}function xq(p){return p=Ws(p),p&&dn.test(p)?p.replace(Jn,"\\$&"):p}var yq=qp(function(p,v,k){return p+(k?"-":"")+v.toLowerCase()}),bq=qp(function(p,v,k){return p+(k?" ":"")+v.toLowerCase()}),vq=Q_("toLowerCase");function wq(p,v,k){p=Ws(p),v=as(v);var q=v?ci(p):0;if(!v||q>=v)return p;var te=(v-q)/2;return Ob(rh(te),k)+p+Ob(th(te),k)}function jq(p,v,k){p=Ws(p),v=as(v);var q=v?ci(p):0;return v&&q<v?p+Ob(v-q,k):p}function Nq(p,v,k){p=Ws(p),v=as(v);var q=v?ci(p):0;return v&&q<v?Ob(v-q,k)+p:p}function Fq(p,v,k){return k||v==null?v=0:v&&(v=+v),Cj(Ws(p).replace(gn,""),v||0)}function Sq(p,v,k){return(k?to(p,v,k):v===r)?v=1:v=as(v),zp(Ws(p),v)}function Cq(){var p=arguments,v=Ws(p[0]);return p.length<3?v:v.replace(p[1],p[2])}var kq=qp(function(p,v,k){return p+(k?"_":"")+v.toLowerCase()});function _q(p,v,k){return k&&typeof k!="number"&&to(p,v,k)&&(v=k=r),k=k===r?oe:k>>>0,k?(p=Ws(p),p&&(typeof v=="string"||v!=null&&!s2(v))&&(v=_i(v),!v&&ya(p))?El(ui(p),0,k):p.split(v,k)):[]}var Eq=qp(function(p,v,k){return p+(k?" ":"")+i2(v)}
vendor: 12,943 bytes, lines 1022-1039
1022);function Aq(p,v,k){return p=Ws(p),k=k==null?0:Lr(as(k),0,p.length),v=_i(v),p.slice(k,k+v.length)==v}function Dq(p,v,k){var q=de.templateSettings;k&&to(p,v,k)&&(v=r),p=Ws(p),v=Zb({},v,q,i4);var te=Zb({},v.imports,q.imports,i4),xe=Ka(te),_e=Vo(te,xe),Le,Ve,ht=0,ft=v.interpolate||Ql,wt="__p += '",Yt=Jo((v.escape||Ql).source+"|"+ft.source+"|"+(ft===ws?Ho:Ql).source+"|"+(v.evaluate||Ql).source+"|$","g"),yr="//# sourceURL="+(Rs.call(v,"sourceURL")?(v.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Fm+"]")+` 1023`;p.replace(Yt,function(Rr,Fs,_s,el,ro,tl){return _s||(_s=el),wt+=p.slice(ht,tl).replace(Ux,Yc),Fs&&(Le=!0,wt+=`' + 1024__e(`+Fs+`) + 1025'`),ro&&(Ve=!0,wt+=`'; 1026`+ro+`; 1027__p += '`),_s&&(wt+=`' + 1028((__t = (`+_s+`)) == null ? '' : __t) + 1029'`),ht=tl+Rr.length,Rr}),wt+=`'; 1030`;var Pr=Rs.call(v,"variable")&&v.variable;if(!Pr)wt=`with (obj) { 1031`+wt+` 1032} 1033`;else if(Uo.test(Pr))throw new Jt(l);wt=(Ve?wt.replace(pt,""):wt).replace(ir,"$1").replace(jr,"$1;"),wt="function("+(Pr||"obj")+`) { 1034`+(Pr?"":`obj || (obj = {}); 1035`)+"var __t, __p = ''"+(Le?", __e = _.escape":"")+(Ve?`, __j = Array.prototype.join; 1036function print() { __p += __j.call(arguments, '') } 1037`:`; 1038`)+wt+`return __p 1039}`;var ds=X4(function(){return Nr(xe,yr+"return "+wt).apply(r,_e)});if(ds.source=wt,r2(ds))throw ds;return ds}function Tq(p){return Ws(p).toLowerCase()}function Mq(p){return Ws(p).toUpperCase()}function Pq(p,v,k){if(p=Ws(p),p&&(k||v===r))return Zd(p);if(!p||!(v=_i(v)))return p;var q=ui(p),te=ui(v),xe=Tm(q,te),_e=Ki(q,te)+1;return El(q,xe,_e).join("")}function Rq(p,v,k){if(p=Ws(p),p&&(k||v===r))return p.slice(0,Xd(p)+1);if(!p||!(v=_i(v)))return p;var q=ui(p),te=Ki(q,ui(v))+1;return El(q,0,te).join("")}function Bq(p,v,k){if(p=Ws(p),p&&(k||v===r))return p.replace(gn,"");if(!p||!(v=_i(v)))return p;var q=ui(p),te=Tm(q,ui(v));return El(q,te).join("")}function Lq(p,v){var k=R,q=M;if(Rn(v)){var te="separator"in v?v.separator:te;k="length"in v?as(v.length):k,q="omission"in v?_i(v.omission):q}p=Ws(p);var xe=p.length;if(ya(p)){var _e=ui(p);xe=_e.length}if(k>=xe)return p;var Le=k-ci(q);if(Le<1)return q;var Ve=_e?El(_e,0,Le).join(""):p.slice(0,Le);if(te===r)return Ve+q;if(_e&&(Le+=Ve.length-Le),s2(te)){if(p.slice(Le).search(te)){var ht,ft=Ve;for(te.global||(te=Jo(te.source,Ws(po.exec(te))+"g")),te.lastIndex=0;ht=te.exec(ft);)var wt=ht.index;Ve=Ve.slice(0,wt===r?Le:wt)}}else if(p.indexOf(_i(te),Le)!=Le){var Yt=Ve.lastIndexOf(te);Yt>-1&&(Ve=Ve.slice(0,Yt))}return Ve+q}function Iq(p){return p=Ws(p),p&&xr.test(p)?p.replace(rs,Rm):p}var Oq=qp(function(p,v,k){return p+(k?" ":"")+v.toUpperCase()}),i2=Q_("toUpperCase");function Z4(p,v,k){return p=Ws(p),v=k?r:v,v===r?Ji(p)?Qc(p):Ea(p):p.match(v)||[]}var X4=ns(function(p,v){try{return je(p,r,v)}catch(k){return r2(k)?k:new Jt(k)}}),zq=Ju(function(p,v){return $e(v,function(k){k=iu(k),lr(p,k,e2(p[k],p))}),p});function Uq(p){var v=p==null?0:p.length,k=Dr();return p=v?ur(p,function(q){if(typeof q[1]!="function")throw new Da(o);return[k(q[0]),q[1]]}):[],ns(function(q){for(var te=-1;++te<v;){var xe=p[te];if(je(xe[0],this,q))return je(xe[1],this,q)}})}function Hq(p){return js(Qt(p,h))}function o2(p){return function(){return p}}function $q(p,v){return p==null||p!==p?v:p}var Wq=t4(),qq=t4(!0);function _o(p){return p}function l2(p){return Ym(typeof p=="function"?p:Qt(p,h))}function Gq(p){return Cb(Qt(p,h))}function Vq(p,v){return Ip(p,Qt(v,h))}var Kq=ns(function(p,v){return function(k){return Ma(k,p,v)}}),Jq=ns(function(p,v){return function(k){return Ma(p,k,v)}});function c2(p,v,k){var q=Ka(v),te=ys(v,q);k==null&&!(Rn(v)&&(te.length||!q.length))&&(k=v,v=p,p=this,te=ys(v,Ka(v)));var xe=!(Rn(k)&&"chain"in k)||!!k.chain,_e=Zu(p);return $e(te,function(Le){var Ve=v[Le];p[Le]=Ve,_e&&(p.prototype[Le]=function(){var ht=this.__chain__;if(xe||ht){var ft=p(this.__wrapped__),wt=ft.__actions__=So(this.__actions__);return wt.push({func:Ve,args:arguments,thisArg:p}),ft.__chain__=ht,ft}return Ve.apply(p,es([this.value()],arguments))})}),p}function Yq(){return Dn._===this&&(Dn._=pb),this}function u2(){}function Zq(p){return p=as(p),ns(function(v){return kb(v,p)})}var Xq=Uj(ur),Qq=Uj(yt),eG=Uj($s);function Q4(p){return Kj(p)?ac(iu(p)):Ab(p)}function tG(p){return function(v){return p==null?r:Ns(p,v)}}var rG=s4(),sG=s4(!0);function d2(){return[]}function h2(){return!1}function nG(){return{}}function aG(){return""}function iG(){return!0}function oG(p,v){if(p=as(p),p<1||p>B)return[];var k=oe,q=Ga(p,oe);v=Dr(v),p-=oe;for(var te=cc(q,v);++k<p;)v(k);return te}function lG(p){return Xr(p)?ur(p,iu):Qo(p)?[p]:So(b4(Ws(p)))}function cG(p){var v=++mb;return Ws(p)+v}var uG=Ib(function(p,v){return p+v},0),dG=Hj("ceil"),hG=Ib(function(p,v){return p/v},1),mG=Hj("floor");function fG(p){return p&&p.length?gs(p,_o,Qn):r}function pG(p,v){return p&&p.length?gs(p,Dr(v,2),Qn):r}function gG(p){return nc(p,_o)}function xG(p,v){return nc(p,Dr(v,2))}function yG(p){return p&&p.length?gs(p,_o,Wu):r}function bG(p,v){return p&&p.length?gs(p,Dr(v,2),Wu):r}var vG=Ib(function(p,v){return p*v},1),wG=Hj("round"),jG=Ib(function(p,v){return p-v},0);function NG(p){return p&&p.length?lc(p,_o):0}function FG(p,v){return p&&p.length?lc(p,Dr(v,2)):0}return de.after=G$,de.ary=A4,de.assign=MW,de.assignIn=W4,de.assignInWith=Zb,de.assignWith=PW,de.at=RW,de.before=D4,de.bind=e2,de.bindAll=zq,de.bindKey=T4,de.castArray=nW,de.chain=k4,de.chunk=mH,de.compact=fH,de.concat=pH,de.cond=Uq,de.conforms=Hq,de.constant=o2,de.countBy=N$,de.create=BW,de.curry=M4,de.curryRight=P4,de.debounce=R4,de.defaults=LW,de.defaultsDeep=IW,de.defer=V$,de.delay=K$,de.difference=gH,de.differenceBy=xH,de.differenceWith=yH,de.drop=bH,de.dropRight=vH,de.dropRightWhile=wH,de.dropWhile=jH,de.fill=NH,de.filter=S$,de.flatMap=_$,de.flatMapDeep=E$,de.flatMapDepth=A$,de.flatten=N4,de.flattenDeep=FH,de.flattenDepth=SH,de.flip=J$,de.flow=Wq,de.flowRight=qq,de.fromPairs=CH,de.functions=qW,de.functionsIn=GW,de.groupBy=D$,de.initial=_H,de.intersection=EH,de.intersectionBy=AH,de.intersectionWith=DH,de.invert=KW,de.invertBy=JW,de.invokeMap=M$,de.iteratee=l2,de.keyBy=P$,de.keys=Ka,de.keysIn=ko,de.map=qb,de.mapKeys=ZW,de.mapValues=XW,de.matches=Gq,de.matchesProperty=Vq,de.memoize=Vb,de.merge=QW,de.mergeWith=q4,de.method=Kq,de.methodOf=Jq,de.mixin=c2,de.negate=Kb,de.nthArg=Zq,de.omit=eq,de.omitBy=tq,de.once=Y$,de.orderBy=R$,de.over=Xq,de.overArgs=Z$,de.overEvery=Qq,de.overSome=eG,de.partial=t2,de.partialRight=B4,de.partition=B$,de.pick=rq,de.pickBy=G4,de.property=Q4,de.propertyOf=tG,de.pull=RH,de.pullAll=S4,de.pullAllBy=BH,de.pullAllWith=LH,de.pullAt=IH,de.range=rG,de.rangeRight=sG,de.rearg=X$,de.reject=O$,de.remove=OH,de.rest=Q$,de.reverse=Xj,de.sampleSize=U$,de.set=nq,de.setWith=aq,de.shuffle=H$,de.slice=zH,de.sortBy=q$,de.sortedUniq=VH,de.sortedUniqBy=KH,de.split=_q,de.spread=eW,de.tail=JH,de.take=YH,de.takeRight=ZH,de.takeRightWhile=XH,de.takeWhile=QH,de.tap=f$,de.throttle=tW,de.thru=Wb,de.toArray=U4,de.toPairs=V4,de.toPairsIn=K4,de.toPath=lG,de.toPlainObject=$4,de.transform=iq,de.unary=rW,de.union=e$,de.unionBy=t$,de.unionWith=r$,de.uniq=s$,de.uniqBy=n$,de.uniqWith=a$,de.unset=oq,de.unzip=Qj,de.unzipWith=C4,de.update=lq,de.updateWith=cq,de.values=Kp,de.valuesIn=uq,de.without=i$,de.words=Z4,de.wrap=sW,de.xor=o$,de.xorBy=l$,de.xorWith=c$,de.zip=u$,de.zipObject=d$,de.zipObjectDeep=h$,de.zipWith=m$,de.entries=V4,de.entriesIn=K4,de.extend=W4,de.extendWith=Zb,c2(de,de),de.add=uG,de.attempt=X4,de.camelCase=fq,de.capitalize=J4,de.ceil=dG,de.clamp=dq,de.clone=aW,de.cloneDeep=oW,de.cloneDeepWith=lW,de.cloneWith=iW,de.conformsTo=cW,de.deburr=Y4,de.defaultTo=$q,de.divide=hG,de.endsWith=pq,de.eq=wc,de.escape=gq,de.escapeRegExp=xq,de.every=F$,de.find=C$,de.findIndex=w4,de.findKey=OW,de.findLast=k$,de.findLastIndex=j4,de.findLastKey=zW,de.floor=mG,de.forEach=_4,de.forEachRight=E4,de.forIn=UW,de.forInRight=HW,de.forOwn=$W,de.forOwnRight=WW,de.get=n2,de.gt=uW,de.gte=dW,de.has=VW,de.hasIn=a2,de.head=F4,de.identity=_o,de.includes=T$,de.indexOf=kH,de.inRange=hq,de.invoke=YW,de.isArguments=af,de.isArray=Xr,de.isArrayBuffer=hW,de.isArrayLike=Co,de.isArrayLikeObject=ta,de.isBoolean=mW,de.isBuffer=ch,de.isDate=fW,de.isElement=pW,de.isEmpty=gW,de.isEqual=xW,de.isEqualWith=yW,de.isError=r2,de.isFinite=bW,de.isFunction=Zu,de.isInteger=L4,de.isLength=Jb,de.isMap=I4,de.isMatch=vW,de.isMatchWith=wW,de.isNaN=jW,de.isNative=NW,de.isNil=SW,de.isNull=FW,de.isNumber=O4,de.isObject=Rn,de.isObjectLike=Hn,de.isPlainObject=ly,de.isRegExp=s2,de.isSafeInteger=CW,de.isSet=z4,de.isString=Yb,de.isSymbol=Qo,de.isTypedArray=Vp,de.isUndefined=kW,de.isWeakMap=_W,de.isWeakSet=EW,de.join=TH,de.kebabCase=yq,de.last=Al,de.lastIndexOf=MH,de.lowerCase=bq,de.lowerFirst=vq,de.lt=AW,de.lte=DW,de.max=fG,de.maxBy=pG,de.mean=gG,de.meanBy=xG,de.min=yG,de.minBy=bG,de.stubArray=d2,de.stubFalse=h2,de.stubObject=nG,de.stubString=aG,de.stubTrue=iG,de.multiply=vG,de.nth=PH,de.noConflict=Yq,de.noop=u2,de.now=Gb,de.pad=wq,de.padEnd=jq,de.padStart=Nq,de.parseInt=Fq,de.random=mq,de.reduce=L$,de.reduceRight=I$,de.repeat=Sq,de.replace=Cq,de.result=sq,de.round=wG,de.runInContext=Ue,de.sample=z$,de.size=$$,de.snakeCase=kq,de.some=W$,de.sortedIndex=UH,de.sortedIndexBy=HH,de.sortedIndexOf=$H,de.sortedLastIndex=WH,de.sortedLastIndexBy=qH,de.sortedLastIndexOf=GH,de.startCase=Eq,de.startsWith=Aq,de.subtract=jG,de.sum=NG,de.sumBy=FG,de.template=Dq,de.times=oG,de.toFinite=Xu,de.toInteger=as,de.toLength=H4,de.toLower=Tq,de.toNumber=Dl,de.toSafeInteger=TW,de.toString=Ws,de.toUpper=Mq,de.trim=Pq,de.trimEnd=Rq,de.trimStart=Bq,de.truncate=Lq,de.unescape=Iq,de.uniqueId=cG,de.upperCase=Oq,de.upperFirst=i2,de.each=_4,de.eachRight=E4,de.first=F4,c2(de,function(){var p={};return mn(de,function(v,k){Rs.call(de.prototype,k)||(p[k]=v)}),p}(),{chain:!1}),de.VERSION=n,$e(["bind","bindKey","curry","curryRight","partial","partialRight"],function(p){de[p].placeholder=de}),$e(["drop","take"],function(p,v){ps.prototype[p]=function(k){k=k===r?1:Xn(as(k),0);var q=this.__filtered__&&!v?new ps(this):this.clone();return q.__filtered__?q.__takeCount__=Ga(k,q.__takeCount__):q.__views__.push({size:Ga(k,oe),type:p+(q.__dir__<0?"Right":"")}),q},ps.prototype[p+"Right"]=function(k){return this.reverse()[p](k).reverse()}}),$e(["filter","map","takeWhile"],function(p,v){var k=v+1,q=k==I||k==V;ps.prototype[p]=function(te){var xe=this.clone();return xe.__iteratees__.push({iteratee:Dr(te,3),type:k}),xe.__filtered__=xe.__filtered__||q,xe}}),$e(["head","last"],function(p,v){var k="take"+(v?"Right":"");ps.prototype[p]=function(){return this[k](1).value()[0]}}),$e(["initial","tail"],function(p,v){var k="drop"+(v?"":"Right");ps.prototype[p]=function(){return this.__filtered__?new ps(this):this[k](1)}}),ps.prototype.compact=function(){return this.filter(_o)},ps.prototype.find=function(p){return this.filter(p).head()},ps.prototype.findLast=function(p){return this.reverse().find(p)},ps.prototype.invokeMap=ns(function(p,v){return typeof p=="function"?new ps(this):this.map(function(k){return Ma(k,p,v)})}),ps.prototype.reject=function(p){return this.filter(Kb(Dr(p)))},ps.prototype.slice=function(p,v){p=as(p);var k=this;return k.__filtered__&&(p>0||v<0)?new ps(k):(p<0?k=k.takeRight(-p):p&&(k=k.drop(p)),v!==r&&(v=as(v),k=v<0?k.dropRight(-v):k.take(v-p)),k)},ps.prototype.takeRightWhile=function(p){return this.reverse().takeWhile(p).reverse()},ps.prototype.toArray=function(){return this.take(oe)},mn(ps.prototype,function(p,v){var k=/^(?:filter|find|map|reject)|While$/.test(v),q=/^(?:head|last)$/.test(v),te=de[q?"take"+(v=="last"?"Right":""):v],xe=q||/^find/.test(v);te&&(de.prototype[v]=function(){var _e=this.__wrapped__,Le=q?[1]:arguments,Ve=_e instanceof ps,ht=Le[0],ft=Ve||Xr(_e),wt=function(Fs){var _s=te.apply(de,es([Fs],Le));return q&&Yt?_s[0]:_s};ft&&k&&typeof ht=="function"&&ht.length!=1&&(Ve=ft=!1);var Yt=this.__chain__,yr=!!this.__actions__.length,Pr=xe&&!Yt,ds=Ve&&!yr;if(!xe&&ft){_e=ds?_e:new ps(this);var Rr=p.apply(_e,Le);return Rr.__actions__.push({func:Wb,args:[wt],thisArg:r}),new Zi(Rr,Yt)}return Pr&&ds?p.apply(this,Le):(Rr=this.thru(wt),Pr?q?Rr.value()[0]:Rr.value():Rr)})}),$e(["pop","push","shift","sort","splice","unshift"],function(p){var v=zu[p],k=/^(?:push|sort|unshift)$/.test(p)?"tap":"thru",q=/^(?:pop|shift)$/.test(p);de.prototype[p]=function(){var te=arguments;if(q&&!this.__chain__){var xe=this.value();return v.apply(Xr(xe)?xe:[],te)}return this[k](function(_e){return v.apply(Xr(_e)?_e:[],te)})}}),mn(ps.prototype,function(p,v){var k=de[v];if(k){var q=k.name+"";Rs.call(ih,q)||(ih[q]=[]),ih[q].push({name:v,func:k})}}),ih[Lb(r,w).name]=[{name:"wrapper",func:r}],ps.prototype.clone=wb,ps.prototype.reverse=Ej,ps.prototype.value=Bp,de.prototype.at=p$,de.prototype.chain=g$,de.prototype.commit=x$,de.prototype.next=y$,de.prototype.plant=v$,de.prototype.reverse=w$,de.prototype.toJSON=de.prototype.valueOf=de.prototype.value=j$,de.prototype.first=de.prototype.head,tu&&(de.prototype[tu]=b$),de},vo=eu();Go?((Go.exports=vo)._=vo,sc._=vo):Dn._=vo}).call(io)}
1039)(H1,H1.exports);var Vwe=H1.exports;const Kwe=({isOpen:t,member:e,onClose:r,onSuccess:n})=>{const[a,i]=x.useState({firstName:"",lastName:"",email:"",userType:"",bio:"",avatarUrl:""}),[o,l]=x.useState(!1),{toast:c}=St();x.useEffect(()=>{e&&i({firstName:e.firstName,lastName:e.lastName,email:e.email,userType:Jwe(e.role),bio:"",avatarUrl:""})},[e]);const u=async h=>{if(h.preventDefault(),!a.firstName.trim()||!a.lastName.trim()||!a.email.trim()){c({title:"Error",description:"Please fill in all required fields",variant:"destructive"});return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a.email)){c({title:"Error",description:"Please enter a valid email address",variant:"destructive"});return}try{l(!0),await Rf.updateMemberProfile(e.id,{first_name:a.firstName.trim(),last_name:a.lastName.trim(),email:a.email.trim(),user_type:a.userType,bio:a.bio.trim()||null,avatar_url:a.avatarUrl.trim()||null}),c({title:"Success",description:"Member updated successfully"}),n()}catch(m){console.error("Error updating member:",m),c({title:"Error",description:m instanceof Error?m.message:"Failed to update member",variant:"destructive"})}finally{l(!1)}},d=()=>{o||r()};return s.jsx(Tt,{open:t,onOpenChange:d,children:s.jsx(Dt,{className:"sm:max-w-[600px] max-h-[90vh] overflow-y-auto",children:s.jsxs("form",{onSubmit:u,children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Edit Member"}),s.jsx(rr,{children:"Update the member profile details below."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"firstName",className:"text-right",children:"First Name *"}),s.jsx(Ne,{id:"firstName",value:a.firstName,onChange:h=>i(f=>({...f,firstName:h.target.value})),className:"col-span-3",placeholder:"e.g., John",required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"lastName",className:"text-right",children:"Last Name *"}),s.jsx(Ne,{id:"lastName",value:a.lastName,onChange:h=>i(f=>({...f,lastName:h.target.value})),className:"col-span-3",placeholder:"e.g., Doe",required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"email",className:"text-right",children:"Email *"}),s.jsx(Ne,{id:"email",type:"email",value:a.email,onChange:h=>i(f=>({...f,email:h.target.value})),className:"col-span-3",placeholder:"e.g., [email protected]",required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"userType",className:"text-right",children:"User Type *"}),s.jsxs(Wt,{value:a.userType,onValueChange:h=>i(f=>({...f,userType:h})),disabled:o,children:[s.jsx(Ht,{className:"col-span-3",children:s.jsx(qt,{placeholder:"Select user type"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"residential",children:"Residential"}),s.jsx(Ae,{value:"business",children:"Business"}),s.jsx(Ae,{value:"admin",children:"Admin"})]})]})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"bio",className:"text-right pt-2",children:"Bio"}),s.jsx(zt,{id:"bio",value:a.bio,onChange:h=>i(f=>({...f,bio:h.target.value})),className:"col-span-3",placeholder:"Brief biography of the member...",rows:4,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"avatarUrl",className:"text-right",children:"Avatar URL"}),s.jsx(Ne,{id:"avatarUrl",type:"url",value:a.avatarUrl,onChange:h=>i(f=>({...f,avatarUrl:h.target.value})),className:"col-span-3",placeholder:"https://example.com/avatar.jpg",disabled:o})]}),a.avatarUrl&&s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{className:"text-right pt-2",children:"Avatar Preview"}),s.jsx("div",{className:"col-span-3",children:s.jsx("img",{src:a.avatarUrl,alt:"Avatar Preview",className:"w-16 h-16 object-cover rounded-full",onError:h=>{h.currentTarget.style.display="none"}})})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",type:"button",onClick:d,disabled:o,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:o,children:o?"Updating...":"Update Member"})]})]})})})};function Jwe(t){switch(t){case"business_owner":return"business";case"resident":return"residential";case"admin":case"super_admin":return"admin";default:return"residential"}}const Ywe=()=>{const[t,e]=x.useState("all"),[r,n]=x.useState(1),[a,i]=x.useState(8),[o,l]=x.useState(""),[c,u]=x.useState(""),[d,h]=x.useState(!1),[f,m]=x.useState(null),[g,y]=x.useState(null),[b,w]=x.useState(!1),[j,N]=x.useState(!1),[S,E]=x.useState(null),C=Su(),{data:T,isLoading:D}=kx({queryKey:["admin","members",t,c,r,a],queryFn:()=>Rf.getMembers({page:r,limit:a,role:t,searchQuery:c})}),A=(T==null?void 0:T.members)||[],R=(T==null?void 0:T.total)||0,M=Math.ceil(R/a),P=$l({mutationFn:X=>Rf.deleteUser(X),onSuccess:()=>{ct.success("User and all related data deleted successfully"),C.invalidateQueries({queryKey:["admin","members"]}),$()},onError:X=>{ct.error(`Failed to delete user: ${X.message}`),console.error("Delete user error:",X)}});x.useEffect(()=>{n(1)},[t,c,a]);const U=X=>
1039new Date(X).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"numeric",hour12:!0}),I=x.useCallback(Vwe.debounce(X=>{u(X)},350),[]),O=X=>{const me=X.target.value;l(me),I(me)},V=X=>{X.preventDefault()},G=async X=>{m({id:X.id,name:`${X.firstName} ${X.lastName}`}),w(!0);try{const me=await Rf.checkUserSubscriptions(X.id);y(me)}catch(me){console.error("Error checking subscriptions:",me),ct.error("Failed to check user subscriptions"),y({hasActiveSubscriptions:!1,subscriptions:[]})}finally{w(!1)}h(!0)},B=()=>{f&&P.mutate(f.id)},$=()=>{h(!1),m(null),y(null),w(!1)},W=X=>{E(X),N(!0)},oe=()=>{N(!1),E(null),C.invalidateQueries({queryKey:["admin","members"]}),ct.success("Member updated successfully")},K=()=>{N(!1),E(null)},H=()=>{if(M<=1)return null;const me=(()=>{const ee=[],he=[];ee.push(1);const ve=Math.max(2,r-2),Ce=Math.min(M-1,r+2);for(let we=ve;we<=Ce;we++)ee.push(we);M>1&&ee.push(M);const re=[...new Set(ee)].sort((we,Ee)=>we-Ee);for(let we=0;we<re.length;we++){const Ee=re[we],Me=re[we+1];he.push(Ee),Me&&Me-Ee>1&&he.push("...")}return he})();return s.jsxs("div",{className:"mt-6 space-y-4",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 sm:gap-4",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:"Items per page:"}),s.jsxs(Wt,{value:a.toString(),onValueChange:ie=>i(Number(ie)),children:[s.jsx(Ht,{className:"w-[80px] shrink-0",children:s.jsx(qt,{})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"8",children:"8"}),s.jsx(Ae,{value:"16",children:"16"}),s.jsx(Ae,{value:"24",children:"24"}),s.jsx(Ae,{value:"48",children:"48"})]})]})]}),s.jsxs("div",{className:"text-sm text-muted-foreground",children:["Showing ",(r-1)*a+1,"-",Math.min(r*a,R)," of ",R," members"]})]}),s.jsx("div",{className:"flex justify-center overflow-x-auto",children:s.jsx(Pd,{className:"flex-wrap justify-center gap-1",children:s.jsxs(Rd,{children:[s.jsx(Qr,{children:s.jsx(Bd,{onClick:()=>r>1&&n(r-1),className:r===1?"pointer-events-none opacity-50":"cursor-pointer"})}),me.map((ie,ee)=>s.jsx(Qr,{children:ie==="..."?s.jsx(nm,{}):s.jsx(ca,{onClick:()=>n(ie),isActive:r===ie,className:"cursor-pointer",children:ie})},ee)),s.jsx(Qr,{children:s.jsx(Ld,{onClick:()=>r<M&&n(r+1),className:r===M?"pointer-events-none opacity-50":"cursor-pointer"})})]})})})]})};return s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-xl sm:text-2xl font-bold",children:"Member Management"}),s.jsx("p",{className:"text-muted-foreground text-sm mt-0.5",children:"Search, filter, and manage member accounts"})]}),s.jsxs("div",{className:"flex flex-col md:flex-row md:items-center gap-3 sm:gap-4",children:[s.jsx("div",{className:"relative flex-grow w-full md:max-w-md min-w-0",children:s.jsx("form",{onSubmit:V,children:s.jsxs("div",{className:"relative",children:[s.jsx(Uc,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500"}),s.jsx(Ne,{placeholder:"Search members by name or email",className:"pl-9 pr-4",value:o,onChange:O})]})})}),s.jsx("div",{className:"flex flex-wrap gap-3 sm:gap-4",children:s.jsxs(Wt,{value:t,onValueChange:e,children:[s.jsx(Ht,{className:"w-full sm:w-[180px]",children:s.jsx(qt,{placeholder:"All Roles"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"all",children:"All Roles"}),s.jsx(Ae,{value:"business_owner",children:"Business Owner"}),s.jsx(Ae,{value:"resident",children:"Resident"}),s.jsx(Ae,{value:"admin",children:"Admin"})]})]})})]}),D?s.jsxs("div",{className:"py-8",children:[s.jsxs("div",{className:"flex flex-col items-center justify-center space-y-4",children:[s.jsx(Mt,{className:"h-10 w-10 animate-spin text-primary"}),s.jsx("p",{className:"text-gray-500",children:"Loading members..."})]}),s.jsx("div",{className:"space-y-2 mt-4",children:Array.from({length:5}).map((X,me)=>s.jsx(cs,{className:"h-16 w-full"},me))})]}):A.length===0?s.jsxs("div",{className:"py-8 text-center",children:[s.jsx("p",{className:"text-gray-500 mb-4",children:"No members found matching your criteria"}),s.jsx(Y,{variant:"outline",onClick:()=>{e("all"),l(""),u("")},children:"Clear filters"})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"md:hidden space-y-3",children:A.map(X=>s.jsx(De,{className:"overflow-hidden",children:s.jsx(Be,{className:"p-4",children:s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"font-medium text-blue-600 truncate",children:[X.firstName," ",X.lastName]}),s.jsx("div",{className:"text-sm text-gray-500 truncate mt-0.5",children:X.email})]}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-sm",children:[s.jsx("span",{className:"text-muted-foreground capitalize",children:X.role==="resident"?"resident":X.role.replace("_"," ")}),s.jsx("span",{className:"text-muted-foreground",children:U(X.joinedAt)})]}),s.jsxs("div",{className:"flex gap-2 pt-1 border-t",children:[s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>W(X),className:"flex-1 text-blue-600 border-blue-200 hover:bg-blue-50",children:[s.jsx(zs,{className:"h-4 w-4 mr-1.5"}),"Edit"]}),s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>G(X),className:"flex-1 text-red-600 border-red-200 hover:bg-red-50",disabled:P.isPending,children:[s.jsx(vr,{className:"h-4 w-4 mr-1.5"}),"Delete"]})]})]})})},X.id))}),s.jsx("div",{className:"hidden md:block overflow-x-auto -mx-1 px-1 rounded-lg border",children:s.jsxs(Oi,{className:"min-w-[600px]",children:[s.jsx(zi,{children:s.jsxs(As,{children:[s.jsx(At,{children:"NAME"}),s.jsx(At,{children:"ROLE"}),s.jsx(At,{children:"JOINED"}),s.jsx(At,{className:"text-right",children:"ACTIONS"})]})}),s.jsx(Ui,{children:A.map(X=>s.jsxs(As,{children:[s.jsx(Ct,{children:s.jsxs("div",{children:[s.jsxs("div",{className:"font-medium text-blue-600",children:[X.firstName," ",X.lastName]}),s.jsx("div",{className:"text-sm text-gray-500",children:X.email})]})}),s.jsx(Ct,{children:X.role==="resident"?"resident":X.role.replace("_"," ")}),s.jsx(Ct,{children:U(X.joinedAt)}),s.jsx(Ct,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>W(X),className:"text-blue-600 hover:text-blue-700 hover:bg-blue-50",title:"Edit Member",children:s.jsx(zs,{className:"h-4 w-4"})}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>G(X),className:"text-red-600 hover:text-red-700 hover:bg-red-50",disabled:P.isPending,title:"Delete Member",children:s.jsx(vr,{className:"h-4 w-4"})})]})})]},X.id))})]})}),H()]}),s.jsx(ai,{open:d,onOpenChange:$,children:s.jsxs(Oa,{className:"max-w-[min(100vw-2rem,32rem)] sm:max-w-2xl",children:[s.jsxs(za,{children:[s.jsx(Ha,{children:"Delete User"}),s.jsx($a,{asChild:!0,children:s.jsx("div",{children:b?s.jsxs("div",{className:"flex items-center gap-2 py-4",children:[s.jsx(Mt,{className:"h-4 w-4 animate-spin"}),s.jsx("span",{children:"Checking for active subscriptions..."})]}):s.jsxs(s.Fragment,{children:[s.jsxs("p",{children:["Are you sure you want to delete ",s.jsx("strong",{children:f==null?void 0:f.name}),"?"]}),(g==null?void 0:g.hasActiveSubscriptions)&&s.jsxs("div",{className:"mt-4 p-4 bg-yellow-50 border border-yellow-200 rounded-lg",children:[s.jsx("div",{className:"flex items-start gap-2",children:s.jsx("div",{className:"text-yellow-600 font-semibold text-sm",children:"â ï¸ Active Subscriptions Found"})}),s.jsx("p",{className:"text-sm text-yellow-800 mt-1",children:"This user has active Stripe subscriptions that should be cancelled first:"}),s.jsx("ul",{className:"mt-2 ml-4 list-disc text-sm text-yellow-800",children:g.subscriptions.map((X,me)=>s.jsxs("li",{children:[s.jsxs("strong",{children:[X.type==="membership"?"Membership":X.type==="business"?"Business":"Feature"," Subscription"]}),X.businessName&&` (${X.businessName})`,s.jsx("br",{}),s.jsxs("span",{className:"text-xs font-mono bg-yellow-100 px-1 rounded",children:["ID: ",X.subscriptionId]}),s.jsxs("span",{className:"ml-2 text-xs",children:["Status: ",X.status]})]},me))}),s.jsx("p",{className:"text-sm text-yellow-800 mt-2 font-medium",children:"Please cancel these subscriptions in Stripe before deleting the user, or proceed with caution."})]}),s.jsx("p",{className:"mt-4",children:"This action will permanently delete the user and all their related data including:"}),s.jsxs("ul",{className:"mt-2 ml-4 list-disc text-sm",children:[s.jsx("li",{children:"Business profiles and listings"}),s.jsx("li",{children:"Job postings"}),s.jsx("li",{children:"Blog posts"}),s.jsx("li",{children:"Insider deals"}),s.jsx("li",{children:"Event registrations"}),s.jsx("li",{children:"All other associated content"})]}),s.jsx("strong",{className:"text-red-600 block mt-2",children:"This action cannot be undone."})]})})})]}),s.jsxs(Ua,{children:[s.jsx(qa,{disabled:P.isPending||b,children:"Cancel"}),s.jsx(Wa,{onClick:B,disabled:P.isPending||b,className:`${g!=null&&g.hasActiveSubscriptions?"bg-yellow-600 hover:bg-yellow-700":"bg-red-600 hover:bg-red-700"}`,children:P.isPending?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"}),"Deleting..."]}):s.jsx(s.Fragment,{children:g!=null&&g.hasActiveSubscriptions?"Delete Anyway":"Delete User"})})]})]})}),S&&s.jsx(Kwe,{isOpen:j,member:S,onClose:K,onSuccess:oe})]})},Zwe=({businesses:t,isLoading:e,searchQuery:r,sortField:n,sortDirection:a,onSort:i,onOpenModal:o,onEditBusiness:l})=>{const c=f=>{switch(f){case"approved":return s.jsx(ke,{variant:"success",children:"Approved"});
1039case"pending":return s.jsx(ke,{variant:"warning",children:"Pending"});case"rejected":return s.jsx(ke,{variant:"destructive",children:"Rejected"});default:return s.jsx(ke,{children:f})}},u=f=>{if(f.isOutsidePayment){const m=new Date().getFullYear(),g=f.outsidePaymentExpirationYear;if(g&&m>g){const y=new Date(g+1,0,1),b=new Date(g+1,1,1),w=new Date;if(w>=b)return s.jsxs(ke,{variant:"outline",className:"bg-red-50 text-red-700 border-red-200",children:[s.jsx(Hl,{className:"w-3 h-3 mr-1"}),"Unpaid"]});if(w>=y&&(f.businessSubscriptionStatus==="active"||f.businessSubscriptionStatus==="trialing"))return s.jsxs(ke,{variant:"default",className:"bg-green-500 text-white",children:[s.jsx(Or,{className:"w-3 h-3 mr-1"}),"Paid (Renewal Due)"]})}return f.businessSubscriptionStatus==="active"||f.businessSubscriptionStatus==="trialing"?s.jsxs(ke,{variant:"default",className:"bg-green-500 text-white",children:[s.jsx(Or,{className:"w-3 h-3 mr-1"}),"Paid"]}):s.jsxs(ke,{variant:"outline",className:"bg-red-50 text-red-700 border-red-200",children:[s.jsx(Hl,{className:"w-3 h-3 mr-1"}),"Unpaid"]})}return f.businessSubscriptionStatus==="active"||f.businessSubscriptionStatus==="trialing"?s.jsxs(ke,{variant:"default",className:"bg-green-500 text-white",children:[s.jsx(Or,{className:"w-3 h-3 mr-1"}),"Paid"]}):s.jsxs(ke,{variant:"outline",className:"bg-red-50 text-red-700 border-red-200",children:[s.jsx(Hl,{className:"w-3 h-3 mr-1"}),"Unpaid"]})},d=f=>new Date(f).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),h=f=>n!==f?null:a==="asc"?s.jsx(dC,{className:"inline ml-1 h-4 w-4"}):s.jsx(uC,{className:"inline ml-1 h-4 w-4"});return e?s.jsx("div",{className:"py-8 text-center text-gray-500",children:"Loading businesses..."}):s.jsxs(Oi,{className:"min-w-[800px]",children:[s.jsx(zi,{children:s.jsxs(As,{children:[s.jsxs(At,{className:"cursor-pointer",onClick:()=>i("name"),children:["BUSINESS NAME ",h("name")]}),s.jsxs(At,{className:"cursor-pointer",onClick:()=>i("owner"),children:["OWNER ",h("owner")]}),s.jsxs(At,{className:"cursor-pointer",onClick:()=>i("status"),children:["STATUS ",h("status")]}),s.jsxs(At,{className:"cursor-pointer",onClick:()=>i("paymentStatus"),children:["PAYMENT STATUS ",h("paymentStatus")]}),s.jsx(At,{children:"FEATURED"}),s.jsxs(At,{className:"cursor-pointer",onClick:()=>i("lastModified"),children:["MODIFIED ",h("lastModified")]}),s.jsx(At,{children:"ACTIONS"})]})}),s.jsx(Ui,{children:t.length>0?t.map(f=>s.jsxs(As,{children:[s.jsx(Ct,{children:s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx(rt,{to:`/dashboard/admin/businesses/${f.id}`,className:"font-medium text-blue-600 hover:text-blue-800 hover:underline",children:f.name}),f.isOutsidePayment?s.jsx(ke,{variant:"outline",className:"bg-purple-50 text-purple-700 border-purple-200 text-xs",children:"Outside"}):(f.businessSubscriptionStatus==="active"||f.businessSubscriptionStatus==="trialing")&&s.jsx(ke,{variant:"outline",className:"bg-blue-50 text-blue-700 border-blue-200 text-xs",children:"Stripe"})]}),s.jsx("div",{className:"text-sm text-gray-500",children:f.address})]})}),s.jsx(Ct,{children:s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-blue-600",children:f.owner.name}),s.jsx("div",{className:"text-sm text-gray-500",children:f.owner.email})]})}),s.jsx(Ct,{children:c(f.status)}),s.jsx(Ct,{children:u(f)}),s.jsx(Ct,{children:f.featured?s.jsxs(ke,{variant:"default",className:"bg-amber-500 text-white",children:[s.jsx(ri,{className:"w-3 h-3 mr-1"}),"Yes"]}):s.jsx("span",{className:"text-muted-foreground text-sm",children:"No"})}),s.jsx(Ct,{children:d(f.lastModified)}),s.jsx(Ct,{children:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Y,{variant:"link",className:"text-blue-600",onClick:()=>o(f),children:"Manage"}),l&&s.jsxs(Y,{variant:"link",size:"sm",className:"text-green-600 hover:text-green-700",onClick:()=>l(f),children:[s.jsx(zs,{className:"w-4 h-4 mr-1"}),"Edit"]})]})})]},f.id)):s.jsx(As,{children:s.jsx(Ct,{colSpan:7,className:"h-24 text-center",children:r?s.jsxs(s.Fragment,{children:["No businesses matching ",s.jsxs("span",{className:"font-medium",children:['"',r,'"']})]}):s.jsx(s.Fragment,{children:"No businesses found."})})})})]})},Xwe=({searchQuery:t,onSearchChange:e,statusFilter:r,onStatusFilterChange:n})=>s.jsxs("div",{className:"flex flex-col md:flex-row md:justify-between md:items-center gap-3 sm:gap-4",children:[s.jsx("h1",{className:"text-xl sm:text-2xl font-bold",children:"Business Management"}),s.jsxs("div",{className:"flex flex-col md:flex-row gap-3 w-full md:w-auto",children:[s.jsxs("div",{className:"relative w-full md:w-64",children:[s.jsx(Uc,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400",size:18}),s.jsx(Ne,{type:"text",placeholder:"Search businesses...",className:"pl-10",value:t,onChange:a=>e(a.target.value)})]}),s.jsxs(Wt,{value:r,onValueChange:n,children:[s.jsx(Ht,{className:"w-full md:w-[180px]",children:s.jsx(qt,{placeholder:"All Statuses"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"all",children:"All Statuses"}),s.jsx(Ae,{value:"approved",children:"Approved"}),s.jsx(Ae,{value:"pending",children:"Pending"}),s.jsx(Ae,{value:"rejected",children:"Rejected"})]})]})]})]}),Qwe=({isOpen:t,onOpenChange:e,selectedBusiness:r,newStatus:n,onStatusChange:a,onUp
1039dateStatus:i,onOpenOutsidePayment:o,onOpenDeleteDialog:l,isPending:c,featured:u,onFeaturedChange:d,featurePaymentStatus:h,onFeaturePaymentStatusChange:f,isFeaturedLoading:m=!1,hasStatusOrFeaturedChange:g=!1})=>{const[y,b]=x.useState(""),[w,j]=x.useState("");if(!r)return null;const N=()=>{if(n==="rejected"&&!y.trim()){j("Please provide a reason for rejection");return}i(y.trim()||void 0,u,h)},S=()=>{b(""),j(""),e(!1)},E=T=>{switch(T){case"approved":return s.jsx(Or,{className:"h-5 w-5 text-green-600"});case"rejected":return s.jsx(Ts,{className:"h-5 w-5 text-red-600"});case"pending":return s.jsx(Kg,{className:"h-5 w-5 text-amber-600"})}},C=T=>{switch(T){case"approved":return"Approved";case"rejected":return"Rejected";case"pending":return"Pending"}};return s.jsx(Tt,{open:t,onOpenChange:e,children:s.jsxs(Dt,{className:"sm:max-w-[500px] max-h-[90vh] overflow-y-auto",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Manage Business Status"}),s.jsxs(rr,{children:["Update the approval status for ",s.jsx("span",{className:"font-bold",children:r.name}),"."]})]}),s.jsxs("div",{className:"grid gap-6 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("h3",{className:"text-sm font-medium",children:"Business Information"}),s.jsx("p",{className:"text-sm text-gray-500",children:"Review business details before changing status"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm border p-3 rounded-md",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Owner:"}),s.jsx("p",{children:r.owner.name})]}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Email:"}),s.jsx("p",{className:"text-blue-600 truncate max-w-[180px]",children:r.owner.email})]}),s.jsxs("div",{className:"col-span-2",children:[s.jsx("p",{className:"font-medium",children:"Address:"}),s.jsx("p",{children:r.address})]}),s.jsxs("div",{className:"col-span-2",children:[s.jsx("p",{className:"font-medium",children:"Current Status:"}),s.jsxs("div",{className:"flex items-center mt-1",children:[E(r.status),s.jsx("span",{className:"ml-1",children:C(r.status)})]})]}),s.jsxs("div",{className:"col-span-2",children:[s.jsx("p",{className:"font-medium",children:"Payment Method:"}),s.jsxs("div",{className:"flex items-center justify-between mt-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[r.isOutsidePayment?s.jsxs(ke,{variant:"default",className:"bg-purple-500 text-white",children:[s.jsx(Ii,{className:"w-3 h-3 mr-1"}),"Outside Payment"]}):s.jsx(ke,{variant:"outline",children:"Standard Subscription"}),r.isOutsidePayment&&r.outsidePaymentExpirationYear&&s.jsxs("span",{className:"text-sm text-gray-500",children:["Expires: ",r.outsidePaymentExpirationYear]})]}),s.jsxs(Y,{variant:"outline",size:"sm",onClick:o,className:"text-purple-600 border-purple-200 hover:bg-purple-50",children:[s.jsx(Ii,{className:"w-4 h-4 mr-1"}),"Manage Outside Payment"]})]})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{htmlFor:"status",className:"text-sm font-medium",children:"Update Status"}),s.jsxs(Wt,{value:n,onValueChange:T=>{a(T),j("")},children:[s.jsx(Ht,{id:"status",className:"w-full",children:s.jsx(qt,{placeholder:"Select status"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"approved",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx(Or,{className:"h-4 w-4 mr-2 text-green-600"}),"Approved"]})}),s.jsx(Ae,{value:"pending",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx(Kg,{className:"h-4 w-4 mr-2 text-amber-600"}),"Pending"]})}),s.jsx(Ae,{value:"rejected",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx(Ts,{className:"h-4 w-4 mr-2 text-red-600"}),"Rejected"]})})]})]}),s.jsx("p",{className:"text-sm text-gray-500 mt-1",children:n==="approved"?r.isOutsidePayment?"Business will be visible on the public directory (Outside Payment enabled).":"Business will be visible on the public directory if payment is active.":n==="rejected"?"Business will be hidden from the public directory.":"Business will remain hidden until approved."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"feature-payment-status",className:"text-sm font-medium",children:"Featured Payment Status"}),s.jsxs(Wt,{value:h,onValueChange:T=>f(T),disabled:m||c,children:[s.jsx(Ht,{id:"feature-payment-status",className:"w-full",children:s.jsx(qt,{placeholder:"Select"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"active",children:"Paid"}),s.jsx(Ae,{value:"inactive",children:"Unpaid"})]})]}),s.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Admin can manually set whether this business has paid feature access."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"featured",className:"text-sm font-medium",children:"Featured Business"}),s.jsxs(Wt,{value:u?"on":"off",onValueChange:T=>d(T==="on"),disabled:m||c||h!=="active",children:[s.jsx(Ht,{id:"featured",className:"w-full",children:s.jsx(qt,{placeholder:"Select"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"on",children:"On"}),s.jsx(Ae,{value:"off",children:"Off"})]})]}),s.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Turn featured on or off. This is enabled only when featured payment status is Paid."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Z,{htmlFor:"admin-notes",className:"text-sm font-medium",children:["Admin Notes ",n==="rejected"&&s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx(zt,{id:"admin-notes",placeholder:n==="rejected"?"Please provide a reason for rejection. This will help the business owner understand what needs to be improved.":"Optional notes about this status change (visible to business owner)",value:y,onChange:T=>{b(T.target.value),w&&j("")},className:"min-h-[80px]",disabled:c}),w&&s.jsx("p",{className:"text-sm text-red-600",children:w}),s.jsx("p",{className:"text-xs text-gray-500",children:n==="rejected"?"Required: Explain why this business was rejected":"Optional: Add any notes about this approval or status change"})]})]}),s.jsx(yp,{className:"my-4"}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("h3",{className:"text-sm font-medium text-red-600",children:"Danger Zone"}),s.jsx("p",{className:"text-sm text-gray-500",children:"Permanently delete this business and all related data"})]}
1039),s.jsxs(Y,{variant:"outline",size:"sm",onClick:l,disabled:c,className:"text-red-600 border-red-200 hover:bg-red-50 hover:text-red-700",children:[s.jsx(vr,{className:"w-4 h-4 mr-2"}),"Delete Business"]})]}),s.jsxs(Sr,{className:"mt-6",children:[s.jsx(Y,{variant:"outline",onClick:S,disabled:c,children:"Cancel"}),s.jsx(Y,{onClick:N,disabled:c||!g,variant:n==="rejected"?"destructive":"default",children:c?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"}),"Updating..."]}):`${n==="approved"?"Approve":n==="rejected"?"Reject":"Update"} Business`})]})]})})},eje=({isOpen:t,onOpenChange:e,selectedBusiness:r,onUpdateOutsidePayment:n,isPending:a})=>{const[i,o]=x.useState(!1),[l,c]=x.useState(""),[u,d]=x.useState(""),[h,f]=x.useState("inactive");if(Oe.useEffect(()=>{r&&t&&(o(r.isOutsidePayment||!1),c(r.outsidePaymentNote||""),d(r.outsidePaymentExpirationYear||""),f(r.businessSubscriptionStatus==="active"||r.businessSubscriptionStatus==="trialing"?"active":"inactive"))},[r,t]),Oe.useEffect(()=>{t||(o(!1),c(""),d(""),f("inactive"))},[t]),!r)return null;const m=()=>{const j={isOutsidePayment:i,outsidePaymentNote:l.trim()||void 0,outsidePaymentExpirationYear:u?Number(u):void 0,businessSubscriptionStatus:i?h:void 0};n(j)},g=new Date().getFullYear(),y=g,b=g+10,w=()=>{if(!r.isOutsidePayment)return null;const j=r.outsidePaymentExpirationYear;if(!j)return s.jsx(ke,{variant:"outline",className:"bg-gray-50",children:"No expiration set"});if(g>j){const N=new Date(j+1,0,1),S=new Date(j+1,1,1),E=new Date;if(E>=S)return s.jsx(ke,{variant:"destructive",children:"Expired & Auto-deactivated"});if(E>=N)return s.jsx(ke,{variant:"warning",children:"Expired - Warning Period"})}return s.jsxs(ke,{variant:"default",className:"bg-purple-500",children:["Active until ",j]})};return s.jsx(Tt,{open:t,onOpenChange:e,children:s.jsxs(Dt,{className:"sm:max-w-[600px] max-h-[90vh] overflow-y-auto",children:[s.jsxs(It,{children:[s.jsxs(Ot,{className:"flex items-center gap-2",children:[s.jsx(Ii,{className:"h-5 w-5"}),"Outside Payment Management"]}),s.jsxs(rr,{children:["Configure external payment settings for ",s.jsx("span",{className:"font-bold",children:r.name}),"."]})]}),s.jsxs("div",{className:"grid gap-6 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{className:"text-sm font-medium",children:"Current Status"}),s.jsx("div",{className:"flex items-center gap-2",children:r.isOutsidePayment?s.jsxs(s.Fragment,{children:[w(),r.outsidePaymentCreatedAt&&s.jsxs("span",{className:"text-sm text-gray-500",children:["Set on ",new Date(r.outsidePaymentCreatedAt).toLocaleDateString()]})]}):s.jsx(ke,{variant:"outline",children:"Standard Payment Required"})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Wl,{id:"outsidePayment",checked:i,onCheckedChange:j=>o(j)}),s.jsx(Z,{htmlFor:"outsidePayment",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Enable Outside Payment"})]}),s.jsx("p",{className:"text-sm text-gray-500",children:"When enabled, admin can activate this business regardless of subscription status."})]}),i&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Z,{htmlFor:"expirationYear",className:"flex items-center gap-2",children:[s.jsx(Br,{className:"h-4 w-4"}),"Expiration Year"]}),s.jsx(Ne,{id:"expirationYear",type:"number",min:y,max:b,value:u,onChange:j=>d(j.target.value?parseInt(j.target.value):""),placeholder:`e.g., ${g+1}`}),s.jsx("p",{className:"text-sm text-gray-500",children:"Business will be auto-deactivated one month after this year ends if not renewed."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Z,{htmlFor:"subscriptionStatus",className:"flex items-center gap-2",children:[s.jsx(Ii,{className:"h-4 w-4"}),"Subscription Status"]}),s.jsxs(Wt,{value:h,onValueChange:j=>
1039f(j),children:[s.jsx(Ht,{id:"subscriptionStatus",children:s.jsx(qt,{placeholder:"Select subscription status"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"active",children:"Active"}),s.jsx(Ae,{value:"inactive",children:"Inactive"})]})]}),s.jsx("p",{className:"text-sm text-gray-500",children:"Control the business subscription status independently of the outside payment setting."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Z,{htmlFor:"note",className:"flex items-center gap-2",children:[s.jsx(ti,{className:"h-4 w-4"}),"Internal Reference Note"]}),s.jsx(zt,{id:"note",value:l,onChange:j=>c(j.target.value),placeholder:"Add internal notes about this outside payment arrangement...",rows:3}),s.jsx("p",{className:"text-sm text-gray-500",children:"Internal notes for admin reference only. Not visible to the business owner."})]})]}),s.jsx("div",{className:"border-l-4 border-blue-500 bg-blue-50 p-4 rounded-r-md",children:s.jsxs("div",{className:"text-sm",children:[s.jsx("p",{className:"font-medium text-blue-900 mb-1",children:"Important:"}),s.jsxs("ul",{className:"text-blue-800 space-y-1 text-xs",children:[s.jsx("li",{children:"⢠Outside payment businesses can be activated without valid subscriptions"}),s.jsx("li",{children:"⢠One month after expiration year: Warning period begins"}),s.jsx("li",{children:"⢠Two months after expiration year: Business automatically deactivated"}),s.jsx("li",{children:"⢠Admin can renew or extend the expiration year anytime"})]})]})})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",onClick:()=>e(!1),disabled:a,children:"Cancel"}),s.jsx(Y,{onClick:m,disabled:a,children:a?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"}),"Updating..."]}):"Update Settings"})]})]})})},tje=({open:t,onOpenChange:e,onBusinessUpdated:r,business:n})=>n?s.jsx(Tt,{open:t,onOpenChange:e,children:s.jsxs(Dt,{className:"sm:max-w-[600px] max-h-[90vh] overflow-y-auto",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Edit Business (Admin)"}),s.jsx(rr,{children:"Edit business details as an administrator. Changes will be applied immediately."})]}),s.jsx(qw,{onSuccess:()=>{e(!1),r&&r()},userId:n.ownerId||"",onCancel:()=>e(!1),submitLabel:"Update Business",businessData:n,isEditing:!0})]})}):null,vv={getCategories:async()=>{const{data:t,error:e}=await Q.from("business_category").select("*").order("name");if(e)throw console.error("Error fetching categories:",e),e;return t.map(r=>({id:r.id,name:r.name,slug:r.slug,description:r.description||""}))},createCategory:async t=>{const{data:e,error:r}=await Q.from("business_category").insert([t]).select().single();if(r)throw console.error("Error creating category:",r),r;return{id:e.id,name:e.name,slug:e.slug,description:e.description||""}},updateCategory:async(t,e)=>{const{data:r,error:n}=await Q.from("business_category").update(e).eq("id",t).select().single();if(n)throw console.error(`Error updating category with ID ${t}:`,n),n;return{id:r.id,name:r.name,slug:r.slug,description:r.description||""}},deleteCategory:async t=>{const{error:e}=await Q.from("business_category").delete().eq("id",t);if(e)throw console.error(`Error deleting category with ID ${t}:`,e),e}};function Ys(t){"@babel/helpers - typeof";return Ys=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ys(t)}var zc=Uint8Array,dl=Uint16Array,p_=Int32Array,g_=new zc([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),x_=new zc([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),y3=new zc([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),T9=function(t,e){for(var r=new dl(31),n=0;n<31;++n)r[n]=e+=1<<t[n-1];for(var a=new p_(r[30]),n=1;n<30;++n)for(var i=r[n];i<r[n+1];++i)a[i]=i-r[n]<<5|n;return{b:r,r:a}},M9=T9(g_,2),rje=M9.b,NS=M9.r;rje[28]=258,NS[258]=28;var sje=T9(x_,0),b3=sje.r,FS=new dl(32768);for(var bn=0;bn<32768;++bn){var fh=(bn&43690)>>1|(bn&21845)<<1;fh=(fh&52428)>>2|(fh&13107)<<2,fh=(fh&61680)>>4|(fh&3855)<<4,FS[bn]=((fh&65280)>>8|(fh&255)<<8)>>1}var Uy=function(t,e,r){for(var n=t.length,a=0,i=new dl(e);a<n;++a)t[a]&&++i[t[a]-1];var o=new dl(e);for(a=1;a<e;++a)o[a]=o[a-1]+i[a-1]<<1;var l;if(r){l=new dl(1<<e);var c=15-e;for(a=0;a<n;++a)if(t[a])for(var u=a<<4|t[a],d=e-t[a],h=o[t[a]-1]++<<d,f=h|(1<<d)-1;h<=f;++h)l[FS[h]>>c]=u}else for(l=new dl(n),a=0;a<n;++a)t[a]&&(l[a]=FS[o[t[a]-1]++]>>15-t[a]);return l},tp=new zc(288);for(var bn=0;bn<144;++bn)tp[bn]=8;for(var bn=144;bn<256;++bn)tp[bn]=9;for(var bn=256;bn<280;++bn)tp[bn]=7;for(var bn=280;bn<288;++bn)tp[bn]=8;var $1=new zc(32);for(var bn=0;bn<32;++bn)$1[bn]=5;var nje=Uy(tp,9,0),aje=Uy($1,5,0),P9=function(t){return(t+7)/8|0},ije=function(t,e,r){return(r==null||r>t.length)&&(r=t.length),new zc(t.subarray(e,r))},sd=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>8},xy=function(t,e,r){r<<=e&7;var n=e/8|0;t[n]|=r,t[n+1]|=r>>8,t[n+2]|=r>>16},nN=function(t,e){for(var r=[],n=0;n<t.length;++n)t[n]&&r.push({s:n,f:t[n]});var a=r.length,i=r.slice();if(!a)return{t:B9,l:0};if(a==1){var o=new zc(r[0].s+1);return o[r[0].s]=1,{t:o,l:1}}r.sort(function(E,C){return E.f-C.f}),r.push({s:-1,f:25001});var l=r[0],c=r[1],u=0,d=1,h=2;for(r[0]={s:-1,f:l.f+c.f,l,r:c};d!=a-1;)l=r[r[u].f<r[h].f?u++:h++],c=r[u!=d&&r[u].f<r[h].f?u++:h++],r[d++]={s:-1,f:l.f+c.f,l,r:c};for(var f=i[0].s,n=1;n<a;++n)i[n].s>f&&(f=i[n].s);var m=new dl(f+1),g=SS(r[d-1],m,0);if(g>e){var n=0,y=0,b=g-e,w=1<<b;for(i.sort(function(C,T){return m[T.s]-m[C.s]||C.f-T.f});n<a;++n){var j=i[n].s;if(m[j]>e)y+=w-(1<<g-m[j]),m[j]=e;else break}for(y>>=b;y>0;){var N=i[n].s;m[N]<e?y-=1<<e-m[N]++-1:++n}for(;n>=0&&y;--n){var S=i[n].s;
vendor: 11,500 bytes, lines 1039-1040
1039m[S]==e&&(--m[S],++y)}g=e}return{t:new zc(m),l:g}},SS=function(t,e,r){return t.s==-1?Math.max(SS(t.l,e,r+1),SS(t.r,e,r+1)):e[t.s]=r},v3=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new dl(++e),n=0,a=t[0],i=1,o=function(c){r[n++]=c},l=1;l<=e;++l)if(t[l]==a&&l!=e)++i;else{if(!a&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(a),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(a);i=1,a=t[l]}return{c:r.subarray(0,n),n:e}},yy=function(t,e){for(var r=0,n=0;n<e.length;++n)r+=t[n]*e[n];return r},R9=function(t,e,r){var n=r.length,a=P9(e+2);t[a]=n&255,t[a+1]=n>>8,t[a+2]=t[a]^255,t[a+3]=t[a+1]^255;for(var i=0;i<n;++i)t[a+i+4]=r[i];return(a+4+n)*8},w3=function(t,e,r,n,a,i,o,l,c,u,d){sd(e,d++,r),++a[256];for(var h=nN(a,15),f=h.t,m=h.l,g=nN(i,15),y=g.t,b=g.l,w=v3(f),j=w.c,N=w.n,S=v3(y),E=S.c,C=S.n,T=new dl(19),D=0;D<j.length;++D)++T[j[D]&31];for(var D=0;D<E.length;++D)++T[E[D]&31];for(var A=nN(T,7),R=A.t,M=A.l,P=19;P>4&&!R[y3[P-1]];--P);var U=u+5<<3,I=yy(a,tp)+yy(i,$1)+o,O=yy(a,f)+yy(i,y)+o+14+3*P+yy(T,R)+2*T[16]+3*T[17]+7*T[18];if(c>=0&&U<=I&&U<=O)return R9(e,d,t.subarray(c,c+u));var V,G,B,$;if(sd(e,d,1+(O<I)),d+=2,O<I){V=Uy(f,m,0),G=f,B=Uy(y,b,0),$=y;var W=Uy(R,M,0);sd(e,d,N-257),sd(e,d+5,C-1),sd(e,d+10,P-4),d+=14;for(var D=0;D<P;++D)sd(e,d+3*D,R[y3[D]]);d+=3*P;for(var oe=[j,E],K=0;K<2;++K)for(var H=oe[K],D=0;D<H.length;++D){var X=H[D]&31;sd(e,d,W[X]),d+=R[X],X>15&&(sd(e,d,H[D]>>5&127),d+=H[D]>>12)}}else V=nje,G=tp,B=aje,$=$1;for(var D=0;D<l;++D){var me=n[D];if(me>255){var X=me>>18&31;xy(e,d,V[X+257]),d+=G[X+257],X>7&&(sd(e,d,me>>23&31),d+=g_[X]);var ie=me&31;xy(e,d,B[ie]),d+=$[ie],ie>3&&(xy(e,d,me>>5&8191),d+=x_[ie])}else xy(e,d,V[me]),d+=G[me]}return xy(e,d,V[256]),d+G[256]},oje=new p_([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),B9=new zc(0),lje=function(t,e,r,n,a,i){var o=i.z||t.length,l=new zc(n+o+5*(1+Math.ceil(o/7e3))+a),c=l.subarray(n,l.length-a),u=i.l,d=(i.r||0)&7;if(e){d&&(c[0]=i.r>>3);for(var h=oje[e-1],f=h>>13,m=h&8191,g=(1<<r)-1,y=i.p||new dl(32768),b=i.h||new dl(g+1),w=Math.ceil(r/3),j=2*w,N=function(Me){return(t[Me]^t[Me+1]<<w^t[Me+2]<<j)&g},S=new p_(25e3),E=new dl(288),C=new dl(32),T=0,D=0,A=i.i||0,R=0,M=i.w||0,P=0;A+2<o;++A){var U=N(A),I=A&32767,O=b[U];if(y[I]=O,b[U]=I,M<=A){var V=o-A;if((T>7e3||R>24576)&&(V>423||!u)){d=w3(t,c,0,S,E,C,D,R,P,A-P,d),R=T=D=0,P=A;for(var G=0;G<286;++G)E[G]=0;for(var G=0;G<30;++G)C[G]=0}var B=2,$=0,W=m,oe=I-O&32767;if(V>2&&U==N(A-oe))for(var K=Math.min(f,V)-1,H=Math.min(32767,A),X=Math.min(258,V);oe<=H&&--W&&I!=O;){if(t[A+B]==t[A+B-oe]){for(var me=0;me<X&&t[A+me]==t[A+me-oe];++me);if(me>B){if(B=me,$=oe,me>K)break;for(var ie=Math.min(oe,me-2),ee=0,G=0;G<ie;++G){var he=A-oe+G&32767,ve=y[he],Ce=he-ve&32767;Ce>ee&&(ee=Ce,O=he)}}}I=O,O=y[I],oe+=I-O&32767}if($){S[R++]=268435456|NS[B]<<18|b3[$];var re=NS[B]&31,we=b3[$]&31;D+=g_[re]+x_[we],++E[257+re],++C[we],M=A+B,++T}else S[R++]=t[A],++E[t[A]]}}for(A=Math.max(A,M);A<o;++A)S[R++]=t[A],++E[t[A]];d=w3(t,c,u,S,E,C,D,R,P,A-P,d),u||(i.r=d&7|c[d/8|0]<<3,d-=7,i.h=b,i.p=y,i.i=A,i.w=M)}else{for(var A=i.w||0;A<o+u;A+=65535){var Ee=A+65535;Ee>=o&&(c[d/8|0]=u,Ee=o),d=R9(c,d+1,t.subarray(A,Ee))}i.i=o}return ije(l,0,n+P9(d)+a)},L9=function(){var t=1,e=0;return{p:function(r){for(var n=t,a=e,i=r.length|0,o=0;o!=i;){for(var l=Math.min(o+2655,i);o<l;++o)a+=n+=r[o];n=(n&65535)+15*(n>>16),a=(a&65535)+15*(a>>16)}t=n,e=a},d:function(){return t%=65521,e%=65521,(t&255)<<24|(t&65280)<<8|(e&255)<<8|e>>8}}},cje=function(t,e,r,n,a){if(!a&&(a={l:1},e.dictionary)){var i=e.dictionary.subarray(-32768),o=new zc(i.length+t.length);o.set(i),o.set(t,i.length),t=o,a.w=i.length}return lje(t,e.level==null?6:e.level,e.mem==null?a.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,r,n,a)},I9=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8},uje=function(t,e){var r=e.level,n=r==0?0:r<6?1:r==9?3:2;if(t[0]=120,t[1]=n<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var a=L9();a.p(e.dictionary),I9(t,2,a.d())}};function CS(t,e){e||(e={});var r=L9();r.p(t);var n=cje(t,e,e.dictionary?6:2,4);return uje(n,e),I9(n,n.length-4,r.d()),n}var dje=typeof TextDecoder<"u"&&new TextDecoder,hje=0;try{dje.decode(B9,{stream:!0}),hje=1}catch{}function mje(t){if(Array.isArray(t))return t}function fje(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,a,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,e!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function j3(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function pje(t,e){if(t){if(typeof t=="string")return j3(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?j3(t,e):void 0}}function gje(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 1040In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function N3(t,e){return mje(t)||fje(t,e)||pje(t,e)||gje()}function F3(t,e="utf8"){return new TextDecoder(e).decode(t)}const xje=new TextEncoder;function yje(t){return xje.encode(t)}const bje=1024*8,vje=(()=>{const t=new Uint8Array(4),e=new Uint32Array(t.buffer);return!((e[0]=1)&t[0])})(),aN={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class y_{constructor(e=bje,r={}){sr(this,"buffer");sr(this,"byteLength");sr(this,"byteOffset");sr(this,"length");sr(this,"offset");sr(this,"lastWrittenByte");sr(this,"littleEndian");sr(this,"_data");sr(this,"_mark");sr(this,"_marks");let n=!1;typeof e=="number"?e=new ArrayBuffer(e):(n=!0,this.lastWrittenByte=e.byteLength);const a=r.offset?r.offset>>>0:0,i=e.byteLength-a;let o=a;(ArrayBuffer.isView(e)||e instanceof y_)&&(e.byteLength!==e.buffer.byteLength&&(o=e.byteOffset+a),e=e.buffer),n?this.lastWrittenByte=i:this.lastWrittenByte=0,this.buffer=e,this.length=i,this.byteLength=i,this.byteOffset=o,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,o,i),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const e=this._marks.pop();if(e===void 0)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){const n=(this.offset+e)*2,a=new Uint8Array(n);a.set(new Uint8Array(this.buffer)),this.buffer=a.buffer,this.length=n,this.byteLength=n,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,"uint8")}readArray(e,r){const n=aN[r].BYTES_PER_ELEMENT*e,a=this.byteOffset+this.offset,i=this.buffer.slice(a,a+n);if(this.littleEndian===vje&&r!=="uint8"&&r!=="int8"){const l=new Uint8Array(this.buffer.slice(a,a+n));l.reverse();const c=new aN[r](l.buffer);return this.offset+=n,c.reverse(),c}const o=new aN[r](i);return this.offset+=n,o}readInt16(){const e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){const e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){const e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){const e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){const e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){const e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){const e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){const e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let r="";for(let n=0;n<e;n++)r+=this.readChar();return r}readUtf8(e=1){return F3(this.readBytes(e))}decodeText(e=1,r="utf8"){return F3(this.readBytes(e),r)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(let r=0;r<e.length;r++)this._data.setUint8(this.offset++,e[r]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(e){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(e){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(e){return this.writeUint8(e.charCodeAt(0))}writeChars(e){for(let r=0;r<e.length;r++)this.writeUint8(e.charCodeAt(r));return this}writeUtf8(e){return this.writeBytes(yje(e))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function Ox(t){let e=t.length;for(;--e>=0;)t[e]=0}const wje=3,jje=258,O9=29,Nje=256,Fje=Nje+1+O9,z9=30,Sje=512,Cje=new Array((Fje+2)*2);Ox(Cje);const kje=new Array(z9*2);Ox(kje);const _je=new Array(Sje);Ox(_je);const Eje=new Array(jje-wje+1);Ox(Eje);const Aje=new Array(O9);Ox(Aje);const Dje=new Array(z9);Ox(Dje);const Tje=(t,e,r,n)=>{let a=t&65535|0,i=t>>>16&65535|0,o=0;for(;r!==0;){o=r>2e3?2e3:r,r-=o;do a=a+e[n++]|0,i=i+a|0;while(--o);a%=65521,i%=65521}
vendor: 20,067 bytes, line 1040
1040return a|i<<16|0};var kS=Tje;const Mje=()=>{let t,e=[];for(var r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e},Pje=new Uint32Array(Mje()),Rje=(t,e,r,n)=>{const a=Pje,i=n+r;t^=-1;for(let o=n;o<i;o++)t=t>>>8^a[(t^e[o])&255];return t^-1};var ou=Rje,_S={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},U9={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const Bje=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var Lje=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(const n in r)Bje(r,n)&&(t[n]=r[n])}}return t},Ije=t=>{let e=0;for(let n=0,a=t.length;n<a;n++)e+=t[n].length;const r=new Uint8Array(e);for(let n=0,a=0,i=t.length;n<i;n++){let o=t[n];r.set(o,a),a+=o.length}return r},H9={assign:Lje,flattenChunks:Ije};let $9=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{$9=!1}const b0=new Uint8Array(256);for(let t=0;t<256;t++)b0[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;b0[254]=b0[254]=1;var Oje=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,r,n,a,i,o=t.length,l=0;for(a=0;a<o;a++)r=t.charCodeAt(a),(r&64512)===55296&&a+1<o&&(n=t.charCodeAt(a+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),a++)),l+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Uint8Array(l),i=0,a=0;i<l;a++)r=t.charCodeAt(a),(r&64512)===55296&&a+1<o&&(n=t.charCodeAt(a+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),a++)),r<128?e[i++]=r:r<2048?(e[i++]=192|r>>>6,e[i++]=128|r&63):r<65536?(e[i++]=224|r>>>12,e[i++]=128|r>>>6&63,e[i++]=128|r&63):(e[i++]=240|r>>>18,e[i++]=128|r>>>12&63,e[i++]=128|r>>>6&63,e[i++]=128|r&63);return e};const zje=(t,e)=>{if(e<65534&&t.subarray&&$9)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let r="";for(let n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r};var Uje=(t,e)=>{const r=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let n,a;const i=new Array(r*2);for(a=0,n=0;n<r;){let o=t[n++];if(o<128){i[a++]=o;continue}let l=b0[o];if(l>4){i[a++]=65533,n+=l-1;continue}for(o&=l===2?31:l===3?15:7;l>1&&n<r;)o=o<<6|t[n++]&63,l--;if(l>1){i[a++]=65533;continue}o<65536?i[a++]=o:(o-=65536,i[a++]=55296|o>>10&1023,i[a++]=56320|o&1023)}return zje(i,a)},Hje=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let r=e-1;for(;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+b0[t[r]]>e?r:e},ES={string2buf:Oje,buf2string:Uje,utf8border:Hje};function $je(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var Wje=$je;const wv=16209,qje=16191;var Gje=function(e,r){let n,a,i,o,l,c,u,d,h,f,m,g,y,b,w,j,N,S,E,C,T,D,A,R;const M=e.state;n=e.next_in,A=e.input,a=n+(e.avail_in-5),i=e.next_out,R=e.output,o=i-(r-e.avail_out),l=i+(e.avail_out-257),c=M.dmax,u=M.wsize,d=M.whave,h=M.wnext,f=M.window,m=M.hold,g=M.bits,y=M.lencode,b=M.distcode,w=(1<<M.lenbits)-1,j=(1<<M.distbits)-1;e:do{g<15&&(m+=A[n++]<<g,g+=8,m+=A[n++]<<g,g+=8),N=y[m&w];t:for(;;){if(S=N>>>24,m>>>=S,g-=S,S=N>>>16&255,S===0)R[i++]=N&65535;else if(S&16){E=N&65535,S&=15,S&&(g<S&&(m+=A[n++]<<g,g+=8),E+=m&(1<<S)-1,m>>>=S,g-=S),g<15&&(m+=A[n++]<<g,g+=8,m+=A[n++]<<g,g+=8),N=b[m&j];r:for(;;){if(S=N>>>24,m>>>=S,g-=S,S=N>>>16&255,S&16){if(C=N&65535,S&=15,g<S&&(m+=A[n++]<<g,g+=8,g<S&&(m+=A[n++]<<g,g+=8)),C+=m&(1<<S)-1,C>c){e.msg="invalid distance too far back",M.mode=wv;break e}if(m>>>=S,g-=S,S=i-o,C>S){if(S=C-S,S>d&&M.sane){e.msg="invalid distance too far back",M.mode=wv;break e}if(T=0,D=f,h===0){if(T+=u-S,S<E){E-=S;do R[i++]=f[T++];while(--S);T=i-C,D=R}}else if(h<S){if(T+=u+h-S,S-=h,S<E){E-=S;do R[i++]=f[T++];while(--S);if(T=0,h<E){S=h,E-=S;do R[i++]=f[T++];while(--S);T=i-C,D=R}}}else if(T+=h-S,S<E){E-=S;do R[i++]=f[T++];while(--S);T=i-C,D=R}for(;E>2;)R[i++]=D[T++],R[i++]=D[T++],R[i++]=D[T++],E-=3;E&&(R[i++]=D[T++],E>1&&(R[i++]=D[T++]))}else{T=i-C;do R[i++]=R[T++],R[i++]=R[T++],R[i++]=R[T++],E-=3;while(E>2);E&&(R[i++]=R[T++],E>1&&(R[i++]=R[T++]))}}else if(S&64){e.msg="invalid distance code",M.mode=wv;break e}else{N=b[(N&65535)+(m&(1<<S)-1)];continue r}break}}else if(S&64)if(S&32){M.mode=qje;break e}else{e.msg="invalid literal/length code",M.mode=wv;break e}else{N=y[(N&65535)+(m&(1<<S)-1)];continue t}break}}while(n<a&&i<l);E=g>>3,n-=E,g-=E<<3,m&=(1<<g)-1,e.next_in=n,e.next_out=i,e.avail_in=n<a?5+(a-n):5-(n-a),e.avail_out=i<l?257+(l-i):257-(i-l),M.hold=m,M.bits=g};const sg=15,S3=852,C3=592,k3=0,iN=1,_3=2,Vje=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Kje=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Jje=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Yje=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Zje=(t,e,r,n,a,i,o,l)=>{const c=l.bits;let u=0,d=0,h=0,f=0,m=0,g=0,y=0,b=0,w=0,j=0,N,S,E,C,T,D=null,A;const R=new Uint16Array(sg+1),M=new Uint16Array(sg+1);let P=null,U,I,O;for(u=0;u<=sg;u++)R[u]=0;for(d=0;d<n;d++)R[e[r+d]]++;for(m=c,f=sg;f>=1&&R[f]===0;f--);if(m>f&&(m=f),f===0)return a[i++]=1<<24|64<<16|0,a[i++]=1<<24|64<<16|0,l.bits=1,0;for(h=1;h<f&&R[h]===0;h++);for(m<h&&(m=h),b=1,u=1;u<=sg;u++)if(b<<=1,b-=R[u],b<0)return-1;if(b>0&&(t===k3||f!==1))return-1;for(M[1]=0,u=1;u<sg;u++)M[u+1]=M[u]+R[u];for(d=0;d<n;d++)e[r+d]!==0&&(o[M[e[r+d]]++]=d);if(t===k3?(D=P=o,A=20):t===iN?(D=Vje,P=Kje,A=257):(D=Jje,P=Yje,A=0),j=0,d=0,u=h,T=i,g=m,y=0,E=-1,w=1<<m,C=w-1,t===iN&&w>S3||t===_3&&w>C3)return 1;for(;;){U=u-y,o[d]+1<A?(I=0,O=o[d]):o[d]>=A?(I=P[o[d]-A],O=D[o[d]-A]):(I=96,O=0),N=1<<u-y,S=1<<g,h=S;do S-=N,a[T+(j>>y)+S]=U<<24|I<<16|O|0;while(S!==0);for(N=1<<u-1;j&N;)N>>=1;if(N!==0?(j&=N-1,j+=N):j=0,d++,--R[u]===0){if(u===f)break;u=e[r+o[d]]}if(u>m&&(j&C)!==E){for(y===0&&(y=m),T+=h,g=u-y,b=1<<g;g+y<f&&(b-=R[g+y],!(b<=0));)g++,b<<=1;if(w+=1<<g,t===iN&&w>S3||t===_3&&w>C3)return 1;E=j&C,a[E]=m<<24|g<<16|T-i|0}}return j!==0&&(a[T+j]=u-y<<24|64<<16|0),l.bits=m,0};var Hy=Zje;const Xje=0,W9=1,q9=2,{Z_FINISH:E3,Z_BLOCK:Qje,Z_TREES:jv,Z_OK:rp,Z_STREAM_END:e2e,Z_NEED_DICT:t2e,Z_STREAM_ERROR:Kl,Z_DATA_ERROR:G9,Z_MEM_ERROR:V9,Z_BUF_ERROR:r2e,Z_DEFLATED:A3}=U9,lj=16180,D3=16181,T3=16182,M3=16183,P3=16184,R3=16185,B3=16186,L3=16187,I3=16188,O3=16189,W1=16190,nd=16191,oN=16192,z3=16193,lN=16194,U3=16195,H3=16196,$3=16197,W3=16198,Nv=16199,Fv=16200,q3=16201,G3=16202,V3=16203,K3=16204,J3=16205,cN=16206,Y3=16207,Z3=16208,Sn=16209,K9=16210,J9=16211,s2e=852,n2e=592,a2e=15,i2e=a2e,X3=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function o2e(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const vp=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<lj||e.mode>J9?1:0},Y9=t=>{if(vp(t))return Kl;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=lj,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(s2e),e.distcode=e.distdyn=new Int32Array(n2e),e.sane=1,e.back=-1,rp},Z9=t=>{if(vp(t))return Kl;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,Y9(t)},X9=(t,e)=>{let r;if(vp(t))return Kl;const n=t.state;return e<0?(r=0,e=-e):(r=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Kl:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,Z9(t))},Q9=(t,e)=>{if(!t)return Kl;const r=new o2e;t.state=r,r.strm=t,r.window=null,r.mode=lj;const n=X9(t,e);return n!==rp&&(t.state=null),n},l2e=t=>Q9(t,i2e);let Q3=!0,uN,dN;const c2e=t=>{if(Q3){uN=new Int32Array(512),dN=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Hy(W9,t.lens,0,288,uN,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Hy(q9,t.lens,0,32,dN,0,t.work,{bits:5}),Q3=!1}t.lencode=uN,t.lenbits=9,t.distcode=dN,t.distbits=5},e7=(t,e,r,n)=>{let a;const i=t.state;return i.window===null&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new Uint8Array(i.wsize)),n>=i.wsize?(i.window.set(e.subarray(r-i.wsize,r),0),i.wnext=0,i.whave=i.wsize):(a=i.wsize-i.wnext,a>n&&(a=n),i.window.set(e.subarray(r-n,r-n+a),i.wnext),n-=a,n?(i.window.set(e.subarray(r-n,r),0),i.wnext=n,i.whave=i.wsize):(i.wnext+=a,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=a))),0},u2e=(t,e)=>{let r,n,a,i,o,l,c,u,d,h,f,m,g,y,b=0,w,j,N,S,E,C,T,D;const A=new Uint8Array(4);let R,M;const P=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(vp(t)||!t.output||!t.input&&t.avail_in!==0)return Kl;r=t.state,r.mode===nd&&(r.mode=oN),o=t.next_out,a=t.output,c=t.avail_out,i=t.next_in,n=t.input,l=t.avail_in,u=r.hold,d=r.bits,h=l,f=c,D=rp;e:for(;;)switch(r.mode){case lj:if(r.wrap===0){r.mode=oN;break}for(;d<16;){if(l===0)break e;l--,u+=n[i++]<<d,d+=8}if(r.wrap&2&&u===35615){r.wbits===0&&(r.wbits=15),r.check=0,A[0]=u&255,A[1]=u>>>8&255,r.check=ou(r.check,A,2,0),u=0,d=0,r.mode=D3;break}if(r.head&&(r.head.done=!1),!(r.wrap&1)||(((u&255)<<8)+(u>>8))%31){t.msg="incorrect header check",r.mode=Sn;break}if((u&15)!==A3){t.msg="unknown compression method",r.mode=Sn;break}if(u>>>=4,d-=4,T=(u&15)+8,r.wbits===0&&(r.wbits=T),T>15||T>r.wbits){t.msg="invalid window size",r.mode=Sn;break}r.dmax=1<<r.wbits,r.flags=0,t.adler=r.check=1,r.mode=u&512?O3:nd,u=0,d=0;break;case D3:for(;d<16;){if(l===0)break e;l--,u+=n[i++]<<d,d+=8}if(r.flags=u,(r.flags&255)!==A3){t.msg="unknown compression method",r.mode=Sn;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=Sn;break}r.head&&(r.head.text=u>>8&1),r.flags&512&&r.wrap&4&&(A[0]=u&255,A[1]=u>>>8&255,r.check=ou(r.check,A,2,0)),u=0,d=0,r.mode=T3;case T3:for(;d<32;){if(l===0)break e;l--,u+=n[i++]<<d,d+=8}r.head&&(r.head.time=u),r.flags&512&&r.wrap&4&&(A[0]=u&255,A[1]=u>>>8&255,A[2]=u>>>16&255,A[3]=u>>>24&255,r.check=ou(r.check,A,4,0)),u=0,d=0,r.mode=M3;case M3:for(;d<16;){if(l===0)break e;l--,u+=n[i++]<<d,d+=8}r.head&&(r.head.xflags=u&255,r.head.os=u>>8),r.flags&512&&r.wrap&4&&(A[0]=u&255,A[1]=u>>>8&255,r.check=ou(r.check,A,2,0)),u=0,d=0,r.mode=P3;case P3:if(r.flags&1024){for(;d<16;){if(l===0)break e;l--,u+=n[i++]<<d,d+=8}r.length=u,r.head&&(r.head.extra_len=u),r.flags&512&&r.wrap&4&&(A[0]=u&255,A[1]=u>>>8&255,r.check=ou(r.check,A,2,0)),u=0,d=0}else r.head&&(r.head.extra=null);r.mode=R3;case R3:if(r.flags&1024&&(m=r.length,m>l&&(m=l),m&&(r.head&&(T=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(i,i+m),T)),r.flags&512&&r.wrap&4&&(r.check=ou(r.check,n,m,i)),l-=m,i+=m,r.length-=m),r.length))break e;r.length=0,r.mode=B3;case B3:if(r.flags&2048){if(l===0)break e;m=0;do T=n[i+m++],r.head&&T&&r.length<65536&&(r.head.name+=String.fromCharCode(T));while(T&&m<l);if(r.flags&512&&r.wrap&4&&(r.check=ou(r.check,n,m,i)),l-=m,i+=m,T)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=L3;case L3:if(r.flags&4096){if(l===0)break e;m=0;do T=n[i+m++],r.head&&T&&r.length<65536&&(r.head.comment+=String.fromCharCode(T));while(T&&m<l);if(r.flags&512&&r.wrap&4&&(r.check=ou(r.check,n,m,i)),l-=m,i+=m,T)break e}else r.head&&(r.head.comment=null);r.mode=I3;case I3:if(r.flags&512){for(;d<16;){if(l===0)break e;l--,u+=n[i++]<<d,d+=8}if(r.wrap&4&&u!==(r.check&65535)){t.msg="header crc mismatch",r.mode=Sn;break}u=0,d=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=nd;break;case O3:for(;d<32;){if(l===0)break e;l--,u+=n[i++]<<d,d+=8}t.adler=r.check=X3(u),u=0,d=0,r.mode=W1;case W1:if(r.havedict===0)return t.next_out=o,t.avail_out=c,t.next_in=i,t.avail_in=l,r.hold=u,r.bits=d,t2e;t.adler=r.check=1,r.mode=nd;case nd:if(e===Qje||e===jv)break e;case oN:if(r.last){u>>>=d&7,d-=d&7,r.mode=cN;break}for(;d<3;){if(l===0)break e;l--,u+=n[i++]<<d,d+=8}switch(r.last=u&1,u>>>=1,d-=1,u&3){case 0:r.mode=z3;break;case 1:if(c2e(r),r.mode=Nv,e===jv){u>>>=2,d-=2;break e}break;case 2:r.mode=H3;break;case 3:t.msg="invalid block type",r.mode=Sn}u>>>=2,d-=2;break;case z3:for(u>>>=d&7,d-=d&7;d<32;){if(l===0)break e;l--,u+=n[i++]<<d,d+=8}if((u&65535)!==(u>>>16^65535)){t.msg="invalid stored block lengths",r.mode=Sn;break}if(r.length=u&65535,u=0,d=0,r.mode=lN,e===jv)break e;case lN:r.mode=U3;case U3:if(m=r.length,m){if(m>l&&(m=l),m>c&&(m=c),m===0)break e;a.set(n.subarray(i,i+m),o),l-=m,i+=m,c-=m,o+=m,r.length-=m;break}r.mode=nd;break;case H3:for(;d<14;){if(l===0)break e;l--,u+=n[i++]<<d,d+=8}if(r.nlen=(u&31)+257,u>>>=5,d-=5,r.ndist=(u&31)+1,u>>>=5,d-=5,r.ncode=(u&15)+4,u>>>=4,d-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=Sn;break}r.have=0,r.mode=$3;case $3:for(;r.have<r.ncode;){for(;d<3;){if(l===0)break e;l--,u+=n[i++]<<d,d+=8}r.lens[P[r.have++]]=u&7,u>>>=3,d-=3}for(;r.have<19;)r.lens[P[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,R={bits:r.lenbits},D=Hy(Xje,r.lens,0,19,r.lencode,0,r.work,R),r.lenbits=R.bits,D){t.msg="invalid code lengths set",r.mode=Sn;break}r.have=0,r.mode=W3;case W3:for(;r.have<r.nlen+r.ndist;){for(;b=r.lencode[u&(1<<r.lenbits)-1],w=b>>>24,j=b>>>16&255,N=b&65535,!(w<=d);){if(l===0)break e;l--,u+=n[i++]<<d,d+=8}if(N<16)u>>>=w,d-=w,r.lens[r.have++]=N;else{if(N===16){for(M=w+2;d<M;){if(l===0)break e;l--,u+=n[i++]<<d,d+=8}if(u>>>=w,d-=w,r.have===0){t.msg="invalid bit length repeat",r.mode=Sn;break}T=r.lens[r.have-1],m=3+(u&3),u>>>=2,d-=2}else if(N===17){for(M=w+3;d<M;){if(l===0)break e;l--,u+=n[i++]<<d,d+=8}u>>>=w,d-=w,T=0,m=3+(u&7),u>>>=3,d-=3}else{for(M=w+7;d<M;){if(l===0)break e;l--,u+=n[i++]<<d,d+=8}u>>>=w,d-=w,T=0,m=11+(u&127),u>>>=7,d-=7}if(r.have+m>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=Sn;break}for(;m--;)r.lens[r.have++]=T}}if(r.mode===Sn)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=Sn;break}if(r.lenbits=9,R={bits:r.lenbits},D=Hy(W9,r.lens,0,r.nlen,r.lencode,0,r.work,R),r.lenbits=R.bits,D){t.msg="invalid literal/lengths set",r.mode=Sn;break}if(r.distbits=6,r.distcode=r.distdyn,R={bits:r.distbits},D=Hy(q9,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,R),r.distbits=R.bits,D){t.msg="invalid distances set",r.mode=Sn;break}if(r.mode=Nv,e===jv)break e;case Nv:r.mode=Fv;case Fv:if(l>=6&&c>=258){t.next_out=o,t.avail_out=c,t.next_in=i,t.avail_in=l,r.hold=u,r.bits=d,Gje(t,f),o=t.next_out,a=t.output,c=t.avail_out,i=t.next_in,n=t.input,l=t.avail_in,u=r.hold,d=r.bits,r.mode===nd&&(r.back=-1);break}for(r.back=0;b=r.lencode[u&(1<<r.lenbits)-1],w=b>>>24,j=b>>>16&255,N=b&65535,!(w<=d);){if(l===0)break e;l--,u+=n[i++]<<d,d+=8}if(j&&!(j&240)){for(S=w,E=j,C=N;b=r.lencode[C+((u&(1<<S+E)-1)>>S)],w=b>>>24,j=b>>>16&255,N=b&65535,!(S+w<=d);){if(l===0)break e;l--,u+=n[i++]<<d,d+=8}u>>>=S,d-=S,r.back+=S}if(u>>>=w,d-=w,r.back+=w,r.length=N,j===0){r.mode=J3;break}if(j&32){r.back=-1,r.mode=nd;break}if(j&64){t.msg="invalid literal/length code",r.mode=Sn;break}r.extra=j&15,r.mode=q3;case q3:if(r.extra){for(M=r.extra;d<M;){if(l===0)break e;l--,u+=n[i++]<<d,d+=8}r.length+=u&(1<<r.extra)-1,u>>>=r.extra,d-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=G3;case G3:for(;b=r.distcode[u&(1<<r.distbits)-1],w=b>>>24,j=b>>>16&255,N=b&65535,!(w<=d);){if(l===0)break e;l--,u+=n[i++]<<d,d+=8}if(!(j&240)){for(S=w,E=j,C=N;b=r.distcode[C+((u&(1<<S+E)-1)>>S)],w=b>>>24,j=b>>>16&255,N=b&65535,!(S+w<=d);){if(l===0)break e;l--,u+=n[i++]<<d,d+=8}u>>>=S,d-=S,r.back+=S}if(u>>>=w,d-=w,r.back+=w,j&64){t.msg="invalid distance code",r.mode=Sn;break}r.offset=N,r.extra=j&15,r.mode=V3;case V3:if(r.extra){for(M=r.extra;d<M;){if(l===0)break e;l--,u+=n[i++]<<d,d+=8}r.offset+=u&(1<<r.extra)-1,u>>>=r.extra,d-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=Sn;break}r.mode=K3;case K3:if(c===0)break e;if(m=f-c,r.offset>m){if(m=r.offset-m,m>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=Sn;break}m>r.wnext?(m-=r.wnext,g=r.wsize-m):g=r.wnext-m,m>r.length&&(m=r.length),y=r.window}else y=a,g=o-r.offset,m=r.length;m>c&&(m=c),c-=m,r.length-=m;do a[o++]=y[g++];while(--m);r.length===0&&(r.mode=Fv);break;case J3:if(c===0)break e;a[o++]=r.length,c--,r.mode=Fv;break;case cN:if(r.wrap){for(;d<32;){if(l===0)break e;l--,u|=n[i++]<<d,d+=8}if(f-=c,t.total_out+=f,r.total+=f,r.wrap&4&&f&&(t.adler=r.check=r.flags?ou(r.check,a,f,o-f):kS(r.check,a,f,o-f)),f=c,r.wrap&4&&(r.flags?u:X3(u))!==r.check){t.msg="incorrect data check",r.mode=Sn;break}u=0,d=0}r.mode=Y3;case Y3:if(r.wrap&&r.flags){for(;d<32;){if(l===0)break e;l--,u+=n[i++]<<d,d+=8}if(r.wrap&4&&u!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=Sn;break}u=0,d=0}r.mode=Z3;case Z3:D=e2e;break e;case Sn:D=G9;break e;case K9:return V9;case J9:default:return Kl}return t.next_out=o,t.avail_out=c,t.next_in=i,t.avail_in=l,r.hold=u,r.bits=d,(r.wsize||f!==t.avail_out&&r.mode<Sn&&(r.mode<cN||e!==E3))&&e7(t,t.output,t.next_out,f-t.avail_out),h-=t.avail_in,f-=t.avail_out,t.total_in+=h,t.total_out+=f,r.total+=f,r.wrap&4&&f&&(t.adler=r.check=r.flags?ou(r.check,a,f,t.next_out-f):kS(r.check,a,f,t.next_out-f)),t.data_type=r.bits+(r.last?64:0)+(r.mode===nd?128:0)+(r.mode===Nv||r.mode===lN?256:0),(h===0&&f===0||e===E3)&&D===rp&&(D=r2e),D},d2e=t=>{if(vp(t))return Kl;let e=t.state;return e.window&&(e.window=null),t.state=null,rp},h2e=(t,e)=>{if(vp(t))return Kl;const r=t.state;return r.wrap&2?(r.head=e,e.done=!1,rp):Kl},m2e=(t,e)=>{const r=e.length;let n,a,i;return vp(t)||(n=t.state,n.wrap!==0&&n.mode!==W1)?Kl:n.mode===W1&&(a=1,a=kS(a,e,r,0),a!==n.check)?G9:(i=e7(t,e,r,r),i?(n.mode=K9,V9):(n.havedict=1,rp))};var f2e=Z9,p2e=X9,g2e=Y9,x2e=l2e,y2e=Q9,b2e=u2e,v2e=d2e,w2e=h2e,j2e=m2e,N2e="pako inflate (from Nodeca project)",cd={inflateReset:f2e,inflateReset2:p2e,inflateResetKeep:g2e,inflateInit:x2e,inflateInit2:y2e,inflate:b2e,inflateEnd:v2e,inflateGetHeader:w2e,inflateSetDictionary:j2e,inflateInfo:N2e};function F2e(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var S2e=F2e;const t7=Object.prototype.toString,{Z_NO_FLUSH:C2e,Z_FINISH:k2e,Z_OK:v0,Z_STREAM_END:hN,Z_NEED_DICT:mN,Z_STREAM_ERROR:_2e,Z_DATA_ERROR:eD,Z_MEM_ERROR:E2e}=U9;function lb(t){this.options=H9.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Wje,this.strm.avail_out=0;let r=cd.inflateInit2(this.strm,e.windowBits);if(r!==v0)throw new Error(_S[r]);if(this.header=new S2e,cd.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=ES.string2buf(e.dictionary):t7.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=cd.inflateSetDictionary(this.strm,e.dictionary),r!==v0)))throw new Error(_S[r])}lb.prototype.push=function(t,e){const r=this.strm,n=this.options.chunkSize,a=this.options.dictionary;let i,o,l;if(this.ended)return!1;for(e===~~e?o=e:o=e===!0?k2e:C2e,t7.call(t)==="[object ArrayBuffer]"?r.input
vendor: 9,702 bytes, line 1040
1040=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;){for(r.avail_out===0&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),i=cd.inflate(r,o),i===mN&&a&&(i=cd.inflateSetDictionary(r,a),i===v0?i=cd.inflate(r,o):i===eD&&(i=mN));r.avail_in>0&&i===hN&&r.state.wrap>0&&t[r.next_in]!==0;)cd.inflateReset(r),i=cd.inflate(r,o);switch(i){case _2e:case eD:case mN:case E2e:return this.onEnd(i),this.ended=!0,!1}if(l=r.avail_out,r.next_out&&(r.avail_out===0||i===hN))if(this.options.to==="string"){let c=ES.utf8border(r.output,r.next_out),u=r.next_out-c,d=ES.buf2string(r.output,c);r.next_out=u,r.avail_out=n-u,u&&r.output.set(r.output.subarray(c,c+u),0),this.onData(d)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(!(i===v0&&l===0)){if(i===hN)return i=cd.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(r.avail_in===0)break}}return!0};lb.prototype.onData=function(t){this.chunks.push(t)};lb.prototype.onEnd=function(t){t===v0&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=H9.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function A2e(t,e){const r=new lb(e);if(r.push(t),r.err)throw r.msg||_S[r.err];return r.result}var D2e=lb,T2e=A2e,M2e={Inflate:D2e,inflate:T2e};const{Inflate:P2e,inflate:R2e}=M2e;var tD=P2e,B2e=R2e;const r7=[];for(let t=0;t<256;t++){let e=t;for(let r=0;r<8;r++)e&1?e=3988292384^e>>>1:e=e>>>1;r7[t]=e}const rD=4294967295;function L2e(t,e,r){let n=t;for(let a=0;a<r;a++)n=r7[(n^e[a])&255]^n>>>8;return n}function I2e(t,e){return(L2e(rD,t,e)^rD)>>>0}function sD(t,e,r){const n=t.readUint32(),a=I2e(new Uint8Array(t.buffer,t.byteOffset+t.offset-e-4,e),e);if(a!==n)throw new Error(`CRC mismatch for chunk ${r}. Expected ${n}, found ${a}`)}function s7(t,e,r){for(let n=0;n<r;n++)e[n]=t[n]}function n7(t,e,r,n){let a=0;for(;a<n;a++)e[a]=t[a];for(;a<r;a++)e[a]=t[a]+e[a-n]&255}function a7(t,e,r,n){let a=0;if(r.length===0)for(;a<n;a++)e[a]=t[a];else for(;a<n;a++)e[a]=t[a]+r[a]&255}function i7(t,e,r,n,a){let i=0;if(r.length===0){for(;i<a;i++)e[i]=t[i];for(;i<n;i++)e[i]=t[i]+(e[i-a]>>1)&255}else{for(;i<a;i++)e[i]=t[i]+(r[i]>>1)&255;for(;i<n;i++)e[i]=t[i]+(e[i-a]+r[i]>>1)&255}}function o7(t,e,r,n,a){let i=0;if(r.length===0){for(;i<a;i++)e[i]=t[i];for(;i<n;i++)e[i]=t[i]+e[i-a]&255}else{for(;i<a;i++)e[i]=t[i]+r[i]&255;for(;i<n;i++)e[i]=t[i]+O2e(e[i-a],r[i],r[i-a])&255}}function O2e(t,e,r){const n=t+e-r,a=Math.abs(n-t),i=Math.abs(n-e),o=Math.abs(n-r);return a<=i&&a<=o?t:i<=o?e:r}function z2e(t,e,r,n,a,i){switch(t){case 0:s7(e,r,a);break;case 1:n7(e,r,a,i);break;case 2:a7(e,r,n,a);break;case 3:i7(e,r,n,a,i);break;case 4:o7(e,r,n,a,i);break;default:throw new Error(`Unsupported filter: ${t}`)}}const U2e=new Uint16Array([255]),H2e=new Uint8Array(U2e.buffer),$2e=H2e[0]===255;function W2e(t){const{data:e,width:r,height:n,channels:a,depth:i}=t,o=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],l=Math.ceil(i/8)*a,c=new Uint8Array(n*r*l);let u=0;for(let d=0;d<7;d++){const h=o[d],f=Math.ceil((r-h.x)/h.xStep),m=Math.ceil((n-h.y)/h.yStep);if(f<=0||m<=0)continue;const g=f*l,y=new Uint8Array(g);for(let b=0;b<m;b++){const w=e[u++],j=e.subarray(u,u+g);u+=g;const N=new Uint8Array(g);z2e(w,j,N,y,g,l),y.set(N);for(let S=0;S<f;S++){const E=h.x+S*h.xStep,C=h.y+b*h.yStep;if(!(E>=r||C>=n))for(let T=0;T<l;T++)c[(C*r+E)*l+T]=N[S*l+T]}}}if(i===16){const d=new Uint16Array(c.buffer);if($2e)for(let h=0;h<d.length;h++)d[h]=q2e(d[h]);return d}else return c}function q2e(t){return(t&255)<<8|t>>8&255}const G2e=new Uint16Array([255]),V2e=new Uint8Array(G2e.buffer),K2e=V2e[0]===255,J2e=new Uint8Array(0);function nD(t){const{data:e,width:r,height:n,channels:a,depth:i}=t,o=Math.ceil(i/8)*a,l=Math.ceil(i/8*a*r),c=new Uint8Array(n*l);let u=J2e,d=0,h,f;for(let m=0;m<n;m++){switch(h=e.subarray(d+1,d+1+l),f=c.subarray(m*l,(m+1)*l),e[d]){case 0:s7(h,f,l);break;case 1:n7(h,f,l,o);break;case 2:a7(h,f,u,l);break;case 3:i7(h,f,u,l,o);break;case 4:o7(h,f,u,l,o);break;default:throw new Error(`Unsupported filter: ${e[d]}`)}u=f,d+=l+1}if(i===16){const m=new Uint16Array(c.buffer);if(K2e)for(let g=0;g<m.length;g++)m[g]=Y2e(m[g]);return m}else return c}function Y2e(t){return(t&255)<<8|t>>8&255}const Zv=Uint8Array.of(137,80,78,71,13,10,26,10);function aD(t){if(!Z2e(t.readBytes(Zv.length)))throw new Error("wrong PNG signature")}function Z2e(t){if(t.length<Zv.length)return!1;for(let e=0;e<Zv.length;e++)if(t[e]!==Zv[e])return!1;return!0}const X2e="tEXt",Q2e=0,l7=new TextDecoder("latin1");function eNe(t){if(rNe(t),t.length===0||t.length>79)throw new Error("keyword length must be between 1 and 79")}const tNe=/^[\u0000-\u00FF]*$/;function rNe(t){if(!tNe.test(t))throw new Error("invalid latin1 text")}function sNe(t,e,r){const n=c7(e);t[n]=nNe(e,r-n.length-1)}function c7(t){for(t.mark();t.readByte()!==Q2e;);const e=t.offset;t.reset();const r=l7.decode(t.readBytes(e-t.offset-1));return t.skip(1),eNe(r),r}function nNe(t,e){return l7.decode(t.readBytes(e))}const sl={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},fN={UNKNOWN:-1,DEFLATE:0},iD={UNKNOWN:-1,ADAPTIVE:0},pN={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},Sv={NONE:0,BACKGROUND:1,PREVIOUS:2},gN={SOURCE:0,OVER:1};class aNe extends y_{constructor(r,n={}){super(r);sr(this,"_checkCrc");sr(this,"_inflator");sr(this,"_png");sr(this,"_apng");sr(this,"_end");sr(this,"_hasPalette");sr(this,"_palette");sr(this,"_hasTransparency");sr(this,"_transparency");sr(this,"_compressionMethod");sr(this,"_filterMethod");sr(this,"_interlaceMethod");sr(this,"_colorType");sr(this,"_isAnimated");sr(this,"_numberOfFrames");sr(this,"_numberOfPlays");sr(this,"_frames");sr(this,"_writingDataChunks");const{checkCrc:a=!1}=n;this._checkCrc=a,this._inflator=new tD,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=fN.UNKNOWN,this._filterMethod=iD.UNKNOWN,this._interlaceMethod=pN.UNKNOWN,this._colorType=sl.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(aD(this);!this._end;){const r=this.readUint32(),n=this.readChars(4);this.decodeChunk(r,n)}return this.decodeImage(),this._png}decodeApng(){for(aD(this);!this._end;){const r=this.readUint32(),n=this.readChars(4);this.decodeApngChunk(r,n)}return this.decodeApngImage(),this._apng}decodeChunk(r,n){const a=this.offset;switch(n){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(r);break;case"IDAT":this.decodeIDAT(r);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(r);break;case"iCCP":this.decodeiCCP(r);break;case X2e:sNe(this._png.text,this,r);break;case"pHYs":this.decodepHYs();break;default:this.skip(r);break}if(this.offset-a!==r)throw new Error(`Length mismatch while decoding chunk ${n}`);this._checkCrc?sD(this,r+4,n):this.skip(4)}decodeApngChunk(r,n){const a=this.offset;switch(n!=="fdAT"&&n!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),n){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(r);break;default:this.decodeChunk(r,n),this.offset=a+r;break}if(this.offset-a!==r)throw new Error(`Length mismatch while decoding chunk ${n}`);this._checkCrc?sD(this,r+4,n):this.skip(4)}decodeIHDR(){const r=this._png;r.width=this.readUint32(),r.height=this.readUint32(),r.depth=iNe(this.readUint8());const n=this.readUint8();this._colorType=n;let a;switch(n){case sl.GREYSCALE:a=1;break;case sl.TRUECOLOUR:a=3;break;case sl.INDEXED_COLOUR:a=1;break;case sl.GREYSCALE_ALPHA:a=2;break;case sl.TRUECOLOUR_ALPHA:a=4;break;case sl.UNKNOWN:default:throw new Error(`Unknown color type: ${n}`)}if(this._png.channels=a,this._compressionMethod=this.readUint8(),this._compressionMethod!==fN.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const r={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(r)}decodePLTE(r){if(r%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${r}`);const n=r/3;this._hasPalette=!0;const a=[];this._palette=a;for(let i=0;i<n;i++)a.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(r){this._writingDataChunks=!0;const n=r,a=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,a,n)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(r)}decodeFDAT(r){this._writingDataChunks=!0;let n=r,a=this.offset+this.byteOffset;if(a+=4,n-=4,this._inflator.push(new Uint8Array(this.buffer,a,n)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(r)}decodetRNS(r){switch(this._colorType){case sl.GREYSCALE:case sl.TRUECOLOUR:{if(r%2!==0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${r}`);if(r/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alph
vendor: 5,528 bytes, line 1040
1040a values than there are pixels (${r/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(r/2);for(let n=0;n<r/2;n++)this._transparency[n]=this.readUint16();break}case sl.INDEXED_COLOUR:{if(r>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${r} vs ${this._palette.length})`);let n=0;for(;n<r;n++){const a=this.readByte();this._palette[n].push(a)}for(;n<this._palette.length;n++)this._palette[n].push(255);break}case sl.UNKNOWN:case sl.GREYSCALE_ALPHA:case sl.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(r){const n=c7(this),a=this.readUint8();if(a!==fN.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${a}`);const i=this.readBytes(r-n.length-2);this._png.iccEmbeddedProfile={name:n,profile:B2e(i)}}decodepHYs(){const r=this.readUint32(),n=this.readUint32(),a=this.readByte();this._png.resolution={x:r,y:n,unit:a}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let r=0;r<this._numberOfFrames;r++){const n={sequenceNumber:this._frames[r].sequenceNumber,delayNumber:this._frames[r].delayNumber,delayDenominator:this._frames[r].delayDenominator,data:this._apng.depth===8?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},a=this._frames.at(r);if(a){if(a.data=nD({data:a.data,width:a.width,height:a.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),r===0||a.xOffset===0&&a.yOffset===0&&a.width===this._png.width&&a.height===this._png.height)n.data=a.data;else{const i=this._apng.frames.at(r-1);this.disposeFrame(a,i,n),this.addFrameDataToCanvas(n,a)}this._apng.frames.push(n)}}return this._apng}disposeFrame(r,n,a){switch(r.disposeOp){case Sv.NONE:break;case Sv.BACKGROUND:for(let i=0;i<this._png.height;i++)for(let o=0;o<this._png.width;o++){const l=(i*r.width+o)*this._png.channels;for(let c=0;c<this._png.channels;c++)a.data[l+c]=0}break;case Sv.PREVIOUS:a.data.set(n.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(r,n){const a=1<<this._png.depth,i=(o,l)=>{const c=((o+n.yOffset)*this._png.width+n.xOffset+l)*this._png.channels,u=(o*n.width+l)*this._png.channels;return{index:c,frameIndex:u}};switch(n.blendOp){case gN.SOURCE:for(let o=0;o<n.height;o++)for(let l=0;l<n.width;l++){const{index:c,frameIndex:u}=i(o,l);for(let d=0;d<this._png.channels;d++)r.data[c+d]=n.data[u+d]}break;case gN.OVER:for(let o=0;o<n.height;o++)for(let l=0;l<n.width;l++){const{index:c,frameIndex:u}=i(o,l);for(let d=0;d<this._png.channels;d++){const h=n.data[u+this._png.channels-1]/a,f=d%(this._png.channels-1)===0?1:n.data[u+d],m=Math.floor(h*f+(1-h)*r.data[c+d]);r.data[c+d]+=m}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){var n;if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const r=this._isAnimated?((n=this._frames)==null?void 0:n.at(0)).data:this._inflator.result;if(this._filterMethod!==iD.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===pN.NO_INTERLACE)this._png.data=nD({data:r,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===pN.ADAM7)this._png.data=W2e({data:r,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const r=this._inflator.result,n=this._frames.at(-1);n?n.data=r:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:Sv.NONE,blendOp:gN.SOURCE,data:r}),this._inflator=new tD,this._writingDataChunks=!1}}function iNe(t){if(t!==1&&t!==2&&t!==4&&t!==8&&t!==16)throw new Error(`invalid bit depth: ${t}`);return t}var oD;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.METRE=1]="METRE"})(oD||(oD={}));function oNe(t,e){return new aNe(t,e).decode()}var Wr=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function xN(){Wr.console&&typeof Wr.console.log=="function"&&Wr.console.log.apply(Wr.console,arguments)}var on={log:xN,warn:function(t){Wr.console&&(typeof Wr.console.warn=="function"?Wr.console.warn.apply(Wr.console,arguments):xN.call(null,arguments))},error:function(t){Wr.console&&(typeof Wr.console.error=="function"?Wr.console.error.apply(Wr.console,arguments):xN(t))}};function yN(t,e,r){var n=new XMLHttpRequest;n.open("GET",t),n.responseType="blob",n.onload=function(){mf(n.response,e,r)},n.onerror=function(){on.error("could not download file")},n.send()}function lD(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch{}return e.status>=200&&e.status<=299}function Cv(t){try{t.dispatchEvent(new MouseEvent("click"))}catch{var e=document.createEvent("MouseEvents");
vendor: 3,407 bytes, lines 1040-1045
1040e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var mf=Wr.saveAs||((typeof window>"u"?"undefined":Ys(window))!=="object"||window!==Wr?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(t,e,r){var n=Wr.URL||Wr.webkitURL,a=document.createElement("a");e=e||t.name||"download",a.download=e,a.rel="noopener",typeof t=="string"?(a.href=t,a.origin!==location.origin?lD(a.href)?yN(t,e,r):Cv(a,a.target="_blank"):Cv(a)):(a.href=n.createObjectURL(t),setTimeout(function(){n.revokeObjectURL(a.href)},4e4),setTimeout(function(){Cv(a)},0))}:"msSaveOrOpenBlob"in navigator?function(t,e,r){if(e=e||t.name||"download",typeof t=="string")if(lD(t))yN(t,e,r);else{var n=document.createElement("a");n.href=t,n.target="_blank",setTimeout(function(){Cv(n)})}else navigator.msSaveOrOpenBlob(function(a,i){return i===void 0?i={autoBom:!1}:Ys(i)!=="object"&&(on.warn("Deprecated: Expected third argument to be a object"),i={autoBom:!i}),i.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}(t,r),e)}:function(t,e,r,n){if((n=n||open("","_blank"))&&(n.document.title=n.document.body.innerText="downloading..."),typeof t=="string")return yN(t,e,r);var a=t.type==="application/octet-stream",i=/constructor/i.test(Wr.HTMLElement)||Wr.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||a&&i)&&(typeof FileReader>"u"?"undefined":Ys(FileReader))==="object"){var l=new FileReader;l.onloadend=function(){var d=l.result;d=o?d:d.replace(/^data:[^;]*;/,"data:attachment/file;"),n?n.location.href=d:location=d,n=null},l.readAsDataURL(t)}else{var c=Wr.URL||Wr.webkitURL,u=c.createObjectURL(t);n?n.location=u:location.href=u,n=null,setTimeout(function(){c.revokeObjectURL(u)},4e4)}});/** 1041 * A class to parse color values 1042 * @author Stoyan Stefanov <[email protected]> 1043 * {@link http://www.phpied.com/rgb-color-parser-in-javascript/} 1044 * @license Use it if you like it 1045 */function u7(t){var e;t=t||"",this.ok=!1,t.charAt(0)=="#"&&(t=t.substr(1,6)),t={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee9
10450",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[t=(t=t.replace(/ /g,"")).toLowerCase()]||t;for(var r=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(l){return[parseInt(l[1]),parseInt(l[2]),parseInt(l[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(l){return[parseInt(l[1],16),parseInt(l[2],16),parseInt(l[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(l){return[parseInt(l[1]+l[1],16),parseInt(l[2]+l[2],16),parseInt(l[3]+l[3],16)]}}],n=0;n<r.length;n++){var a=r[n].re,i=r[n].process,o=a.exec(t);o&&(e=i(o),this.r=e[0],this.g=e[1],this.b=e[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var l=this.r.toString(16),c=this.g.toString(16),u=this.b.toString(16);return l.length==1&&(l="0"+l),c.length==1&&(c="0"+c),u.length==1&&(u="0"+u),"#"+l+c+u}}var Xv=Wr.atob.bind(Wr),cD=Wr.btoa.bind(Wr);/** 1046 * @license 1047 * Joseph Myers does not specify a particular license for his work. 1048 * 1049 * Author: Joseph Myers 1050 * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js 1051 * 1052 * Modified by: Owen Leong 1053 */function bN(t,e){var r=t[0],n=t[1],a=t[2],i=t[3];r=Ai(r,n,a,i,e[0],7,-680876936),i=Ai(i,r,n,a,e[1],12,-389564586),a=Ai(a,i,r,n,e[2],17,606105819),n=Ai(n,a,i,r,e[3],22,-1044525330),r=Ai(r,n,a,i,e[4],7,-176418897),i=Ai(i,r,n,a,e[5],12,1200080426),a=Ai(a,i,r,n,e[6],17,-1473231341),n=Ai(n,a,i,r,e[7],22,-45705983),r=Ai(r,n,a,i,e[8],7,1770035416),i=Ai(i,r,n,a,e[9],12,-1958414417),a=Ai(a,i,r,n,e[10],17,-42063),n=Ai(n,a,i,r,e[11],22,-1990404162),r=Ai(r,n,a,i,e[12],7,1804603682),i=Ai(i,r,n,a,e[13],12,-40341101),a=Ai(a,i,r,n,e[14],17,-1502002290),r=Di(r,n=Ai(n,a,i,r,e[15],22,1236535329),a,i,e[1],5,-165796510),i=Di(i,r,n,a,e[6],9,-1069501632),a=Di(a,i,r,n,e[11],14,643717713),n=Di(n,a,i,r,e[0],20,-373897302),r=Di(r,n,a,i,e[5],5,-701558691),i=Di(i,r,n,a,e[10],9,38016083),a=Di(a,i,r,n,e[15],14,-660478335),n=Di(n,a,i,r,e[4],20,-405537848),r=Di(r,n,a,i,e[9],5,568446438),i=Di(i,r,n,a,e[14],9,-1019803690),a=Di(a,i,r,n,e[3],14,-187363961),n=Di(n,a,i,r,e[8],20,1163531501),r=Di(r,n,a,i,e[13],5,-1444681467),i=Di(i,r,n,a,e[2],9,-51403784),a=Di(a,i,r,n,e[7],14,1735328473),r=Ti(r,n=Di(n,a,i,r,e[12],20,-1926607734),a,i,e[5],4,-378558),i=Ti(i,r,n,a,e[8],11,-2022574463),a=Ti(a,i,r,n,e[11],16,1839030562),n=Ti(n,a,i,r,e[14],23,-35309556),r=Ti(r,n,a,i,e[1],4,-1530992060),i=Ti(i,r,n,a,e[4],11,1272893353),a=Ti(a,i,r,n,e[7],16,-155497632),n=Ti(n,a,i,r,e[10],23,-1094730640),r=Ti(r,n,a,i,e[13],4,681279174),i=Ti(i,r,n,a,e[0],11,-358537222),a=Ti(a,i,r,n,e[3],16,-722521979),n=Ti(n,a,i,r,e[6],23,76029189),r=Ti(r,n,a,i,e[9],4,
vendor: 8,599 bytes, lines 1053-1070
1053-640364487),i=Ti(i,r,n,a,e[12],11,-421815835),a=Ti(a,i,r,n,e[15],16,530742520),r=Mi(r,n=Ti(n,a,i,r,e[2],23,-995338651),a,i,e[0],6,-198630844),i=Mi(i,r,n,a,e[7],10,1126891415),a=Mi(a,i,r,n,e[14],15,-1416354905),n=Mi(n,a,i,r,e[5],21,-57434055),r=Mi(r,n,a,i,e[12],6,1700485571),i=Mi(i,r,n,a,e[3],10,-1894986606),a=Mi(a,i,r,n,e[10],15,-1051523),n=Mi(n,a,i,r,e[1],21,-2054922799),r=Mi(r,n,a,i,e[8],6,1873313359),i=Mi(i,r,n,a,e[15],10,-30611744),a=Mi(a,i,r,n,e[6],15,-1560198380),n=Mi(n,a,i,r,e[13],21,1309151649),r=Mi(r,n,a,i,e[4],6,-145523070),i=Mi(i,r,n,a,e[11],10,-1120210379),a=Mi(a,i,r,n,e[2],15,718787259),n=Mi(n,a,i,r,e[9],21,-343485551),t[0]=Hh(r,t[0]),t[1]=Hh(n,t[1]),t[2]=Hh(a,t[2]),t[3]=Hh(i,t[3])}function cj(t,e,r,n,a,i){return e=Hh(Hh(e,t),Hh(n,i)),Hh(e<<a|e>>>32-a,r)}function Ai(t,e,r,n,a,i,o){return cj(e&r|~e&n,t,e,a,i,o)}function Di(t,e,r,n,a,i,o){return cj(e&n|r&~n,t,e,a,i,o)}function Ti(t,e,r,n,a,i,o){return cj(e^r^n,t,e,a,i,o)}function Mi(t,e,r,n,a,i,o){return cj(r^(e|~n),t,e,a,i,o)}function d7(t){var e,r=t.length,n=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=t.length;e+=64)bN(n,lNe(t.substring(e-64,e)));t=t.substring(e-64);var a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<t.length;e++)a[e>>2]|=t.charCodeAt(e)<<(e%4<<3);if(a[e>>2]|=128<<(e%4<<3),e>55)for(bN(n,a),e=0;e<16;e++)a[e]=0;return a[14]=8*r,bN(n,a),n}function lNe(t){var e,r=[];for(e=0;e<64;e+=4)r[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return r}var uD="0123456789abcdef".split("");function cNe(t){for(var e="",r=0;r<4;r++)e+=uD[t>>8*r+4&15]+uD[t>>8*r&15];return e}function uNe(t){return String.fromCharCode(255&t,(65280&t)>>8,(16711680&t)>>16,(4278190080&t)>>24)}function AS(t){return d7(t).map(uNe).join("")}var dNe=function(t){for(var e=0;e<t.length;e++)t[e]=cNe(t[e]);return t.join("")}(d7("hello"))!="5d41402abc4b2a76b9719d911017c592";function Hh(t,e){if(dNe){var r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}return t+e&4294967295}/** 1054 * @license 1055 * FPDF is released under a permissive license: there is no usage restriction. 1056 * You may embed it freely in your application (commercial or not), with or 1057 * without modifications. 1058 * 1059 * Reference: http://www.fpdf.org/en/script/script37.php 1060 */function DS(t,e){var r,n,a,i;if(t!==r){for(var o=(a=t,i=1+(256/t.length|0),new Array(i+1).join(a)),l=[],c=0;c<256;c++)l[c]=c;var u=0;for(c=0;c<256;c++){var d=l[c];u=(u+d+o.charCodeAt(c))%256,l[c]=l[u],l[u]=d}r=t,n=l}else l=n;var h=e.length,f=0,m=0,g="";for(c=0;c<h;c++)m=(m+(d=l[f=(f+1)%256]))%256,l[f]=l[m],l[m]=d,o=l[(l[f]+l[m])%256],g+=String.fromCharCode(e.charCodeAt(c)^o);return g}/** 1061 * @license 1062 * Licensed under the MIT License. 1063 * http://opensource.org/licenses/mit-license 1064 * Author: Owen Leong (@owenl131) 1065 * Date: 15 Oct 2020 1066 * References: 1067 * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt 1068 * https://github.com/foliojs/pdfkit/blob/master/lib/security.js 1069 * http://www.fpdf.org/en/script/script37.php 1070 */var dD={print:4,modify:8,copy:16,"annot-forms":32};function gg(t,e,r,n){this.v=1,this.r=2;var a=192;t.forEach(function(l){if(dD.perm!==void 0)throw new Error("Invalid permission: "+l);a+=dD[l]}),this.padding="(¿N^NuÂAd\0NVÿú�\b..\0¶Ãh>Â/\f©þdSiz";var i=(e+this.padding).substr(0,32),o=(r+this.padding).substr(0,32);this.O=this.processOwnerPassword(i,o),this.P=-(1+(255^a)),this.encryptionKey=AS(i+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(n)).substr(0,5),this.U=DS(this.encryptionKey,this.padding)}function xg(t){if(/[^\u0000-\u00ff]/.test(t))throw new Error("Invalid PDF Name Object: "+t+", Only accept ASCII characters.");for(var e="",r=t.length,n=0;n<r;n++){var a=t.charCodeAt(n);e+=a<33||a===35||a===37||a===40||a===41||a===47||a===60||a===62||a===91||a===93||a===123||a===125||a>126?"#"+("0"+a.toString(16)).slice(-2):t[n]}return e}function hD(t){if(Ys(t)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var e={};this.subscribe=function(r,n,a){if(a=a||!1,typeof r!="string"||typeof n!="function"||typeof a!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");e.hasOwnProperty(r)||(e[r]={});var i=Math.random().toString(35);return e[r][i]=[n,!!a],i},this.unsubscribe=function(r){for(var n in e)if(e[n][r])return delete e[n][r],Object.keys(e[n]).length===0&&delete e[n],!0;return!1},this.publish=function(r){if(e.hasOwnProperty(r)){var n=Array.prototype.slice.call(arguments,1),a=[];for(var i in e[r]){var o=e[r][i];try{o[0].apply(t,n)}catch(l){Wr.console&&on.error("jsPDF PubSub Error",l.message,l)}o[1]&&a.push(i)}a.length&&a.forEach(this.unsubscribe)}},this.getTopics=function(){return e}}function q1(t){if(!(this instanceof q1))return new q1(t);var e="opacity,stroke-opacity".split(",");for(var r in t)t.hasOwnProperty(r)&&e.indexOf(r)>=0&&(this[r]=t[r]);this.id="",this.objectNumber=-1}function h7(t,e){this.gState=t,this.matrix=e,this.id="",this.objectNumber=-1}function pf(t,e,r,n,a){if(!(this instanceof pf))return new pf(t,e,r,n,a);this.type=t==="axial"?2:3,this.coords=e,this.colors=r,h7.call(this,n,a)}function vg(t,e,r,n,a){if(!(this instanceof vg))return new vg(t,e,r,n,a);this.boundingBox=t,this.xStep=e,this.yStep=r,this.stream="",this.cloneIndex=0,h7.call(this,n,a)}function Fr(t){var e,r=typeof arguments[0]=="string"?arguments[0]:"p",n=arguments[1],a=arguments[2],i=arguments[3],o=[],l=1,c=16,u="S",d=null;Ys(t=t||{})==="object"&&(r=t.orientation,n=t.unit||n,a=t.format||a,i=t.compress||t.compressPdf||i,(d=t.encryption||null)!==null&&(d.userPassword=d.userPassword||"",d.ownerPassword=d.ownerPassword||"",d.userPermissions=d.userPermissions||[]),l=typeof t.userUnit=="number"?Math.abs(t.userUnit):1,t.precision!==void 0&&(e=t.precision),t.floatPrecision!==void 0&&(c=t.floatPrecision),u=t.defaultPathOperation||"S"),o=t.filters||(i===!0?["FlateEncode"]:o),n=n||"mm",r=(""+(r||"P")).toLowerCase();var h=t.putOnlyUsedFonts||!1,f={},m={internal:{},__private__:{}};m.__private__.PubSub=hD;var g="1.3",y=m.__private__.getPdfVersion=function(){return g};m.__private__.setPdfVersion=function(L){g=L};var b={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};m.__private__.getPageFormats=function(){return b};var w=m.__private__.getPageFormat=function(L){return b[L]};a=a||"a4";var j="compat",N="advanced",S=j;function E(){this.saveGraphicsState(),ae(new hr(We,0,0,-We,0,Jc()*We).toString()+" cm"),this.setFontSize(this.getFontSize()/We),u="n",S=N}function C(){this.restoreGraphicsState(),u="S",S=j}var T=m.__private__.combineFontStyleAndFontWeight=function(L,se){if(L=="bold"&&se=="normal"||L=="bold"&&se==400||L=="normal"&&se=="italic"||L=="bold"&&se=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return se&&(L=se==400||se==="normal"?L==="italic"?"italic":"normal":se!=700&&se!=="bold"||L!=="normal"?(se==700?"bold":se)+""+L:"bold"),L};m.advancedAPI=function(L){var se=S===j;return se&&E.call(this),typeof L!="function"||(L(this),se&&C.call(this)),this},m.compatAPI=function(L){var se=S===N;return se&&C.call(this),typeof L!="function"||(L(this),se&&E.call(this)),this},m.isAdvancedAPI=function(){return S===N};var D,A=function(L){if(S!==N)throw new Error(L+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},R=m.roundToPrecision=m.__private__.roundToPrecision=function(L,se){var je=e||se;if(isNaN(L)||isNaN(je))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return L.toFixed(je).replace(/0+$/,"")};D=m.hpf=m.__private__.hpf=typeof c=="number"?function(L){if(isNaN(L))throw new Error("Invalid argument passed to jsPDF.hpf");return R(L,c)}:c==="smart"?function(L){if(isNaN(L))throw new Error("Invalid argument passed to jsPDF.hpf");return R(L,L>-1&&L<1?16:5)}:function(L){if(isNaN(L))throw new Error("Invalid argument passed to
1070jsPDF.hpf");return R(L,16)};var M=m.f2=m.__private__.f2=function(L){if(isNaN(L))throw new Error("Invalid argument passed to jsPDF.f2");return R(L,2)},P=m.__private__.f3=function(L){if(isNaN(L))throw new Error("Invalid argument passed to jsPDF.f3");return R(L,3)},U=m.scale=m.__private__.scale=function(L){if(isNaN(L))throw new Error("Invalid argument passed to jsPDF.scale");return S===j?L*We:S===N?L:void 0},I=function(L){return U(function(se){return S===j?Jc()-se:S===N?se:void 0}(L))};m.__private__.setPrecision=m.setPrecision=function(L){typeof parseInt(L,10)=="number"&&(e=parseInt(L,10))};var O,V="00000000000000000000000000000000",G=m.__private__.getFileId=function(){return V},B=m.__private__.setFileId=function(L){return V=L!==void 0&&/^[a-fA-F0-9]{32}$/.test(L)?L.toUpperCase():V.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),d!==null&&(Yn=new gg(d.userPermissions,d.userPassword,d.ownerPassword,V)),V};m.setFileId=function(L){return B(L),this},m.getFileId=function(){return G()};var $=m.__private__.convertDateToPDFDate=function(L){var se=L.getTimezoneOffset(),je=se<0?"+":"-",Re=Math.floor(Math.abs(se/60)),$e=Math.abs(se%60),it=[je,X(Re),"'",X($e),"'"].join("");return["D:",L.getFullYear(),X(L.getMonth()+1),X(L.getDate()),X(L.getHours()),X(L.getMinutes()),X(L.getSeconds()),it].join("")},W=m.__private__.convertPDFDateToDate=function(L){var se=parseInt(L.substr(2,4),10),je=parseInt(L.substr(6,2),10)-1,Re=parseInt(L.substr(8,2),10),$e=parseInt(L.substr(10,2),10),it=parseInt(L.substr(12,2),10),yt=parseInt(L.substr(14,2),10);return new Date(se,je,Re,$e,it,yt,0)},oe=m.__private__.setCreationDate=function(L){var se;if(L===void 0&&(L=new Date),L instanceof Date)se=$(L);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(L))throw new Error("Invalid argument passed to jsPDF.setCreationDate");se=L}return O=se},K=m.__private__.getCreationDate=function(L){var se=O;return L==="jsDate"&&(se=W(O)),se};m.setCreationDate=function(L){return oe(L),this},m.getCreationDate=function(L){return K(L)};var H,X=m.__private__.padd2=function(L){return("0"+parseInt(L)).slice(-2)},me=m.__private__.padd2Hex=function(L){return("00"+(L=L.toString())).substr(L.length)},ie=0,ee=[],he=[],ve=0,Ce=[],re=[],we=!1,Ee=he;m.__private__.setCustomOutputDestination=function(L){we=!0,Ee=L};var Me=function(L){we||(Ee=L)};m.__private__.resetCustomOutputDestination=function(){we=!1,Ee=he};var ae=m.__private__.out=function(L){return L=L.toString(),ve+=L.length+1,Ee.push(L),Ee},ze=m.__private__.write=function(L){return ae(arguments.length===1?L.toString():Array.prototype.join.call(arguments," "))},mt=m.__private__.getArrayBuffer=function(L){for(var se=L.length,je=new ArrayBuffer(se),Re=new Uint8Array(je);se--;)Re[se]=L.charCodeAt(se);return je},tt=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];m.__private__.getStandardFonts=function(){return tt};var Xe=t.fontSize||16;m.__private__.setFontSize=m.setFontSize=function(L){return Xe=S===N?L/We:L,this};var Ft,ce=m.__private__.getFontSize=m.getFontSize=function(){return S===j?Xe:Xe*We},fe=t.R2L||!1;m.__private__.setR2L=m.setR2L=function(L){return fe=L,this},m.__private__.getR2L=m.getR2L=function(){return fe};var ge,Ge=m.__private__.setZoomMode=function(L){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(L))Ft=L;else if(isNaN(L)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(L)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+L+'" is not recognized.');Ft=L}else Ft=parseInt(L,10)};m.__private__.getZoomMode=function(){return Ft};var Je,be=m.__private__.setPageMode=function(L){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(L)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+L+'" is not recognized.');ge=L};m.__private__.getPageMode=function(){return ge};var Pe=m.__private__.setLayoutMode=function(L){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(L)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+L+'" is not recognized.');Je=L};m.__private__.getLayoutMode=function(){return Je},m.__private__.setDisplayMode=m.setDisplayMode=function(L,se,je){return Ge(L),Pe(se),be(je),this};var qe={title:"",subject:"",author:"",keywords:"",creator:""};m.__private__.getDocumentProperty=function(L){if(Object.keys(qe).indexOf(L)===-1)throw new Error("Invalid argument passed to
1070jsPDF.getDocumentProperty");return qe[L]},m.__private__.getDocumentProperties=function(){return qe},m.__private__.setDocumentProperties=m.setProperties=m.setDocumentProperties=function(L){for(var se in qe)qe.hasOwnProperty(se)&&L[se]&&(qe[se]=L[se]);return this},m.__private__.setDocumentProperty=function(L,se){if(Object.keys(qe).indexOf(L)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return qe[L]=se};var Qe,We,dt,Bt,Lt,Vt={},cr={},wr=[],Xt={},pt={},ir={},jr={},rs=null,zr=0,xr=[],Ds=new hD(m),Er=t.hotfixes||[],Ur={},ws={},wn=[],hr=function L(se,je,Re,$e,it,yt){if(!(this instanceof L))return new L(se,je,Re,$e,it,yt);isNaN(se)&&(se=1),isNaN(je)&&(je=0),isNaN(Re)&&(Re=0),isNaN($e)&&($e=1),isNaN(it)&&(it=0),isNaN(yt)&&(yt=0),this._matrix=[se,je,Re,$e,it,yt]};Object.defineProperty(hr.prototype,"sx",{get:function(){return this._matrix[0]},set:function(L){this._matrix[0]=L}}),Object.defineProperty(hr.prototype,"shy",{get:function(){return this._matrix[1]},set:function(L){this._matrix[1]=L}}),Object.defineProperty(hr.prototype,"shx",{get:function(){return this._matrix[2]},set:function(L){this._matrix[2]=L}}),Object.defineProperty(hr.prototype,"sy",{get:function(){return this._matrix[3]},set:function(L){this._matrix[3]=L}}),Object.defineProperty(hr.prototype,"tx",{get:function(){return this._matrix[4]},set:function(L){this._matrix[4]=L}}),Object.defineProperty(hr.prototype,"ty",{get:function(){return this._matrix[5]},set:function(L){this._matrix[5]=L}}),Object.defineProperty(hr.prototype,"a",{get:function(){return this._matrix[0]},set:function(L){this._matrix[0]=L}}),Object.defineProperty(hr.prototype,"b",{get:function(){return this._matrix[1]},set:function(L){this._matrix[1]=L}}),Object.defineProperty(hr.prototype,"c",{get:function(){return this._matrix[2]},set:function(L){this._matrix[2]=L}}),Object.defineProperty(hr.prototype,"d",{get:function(){return this._matrix[3]},set:function(L){this._matrix[3]=L}}),Object.defineProperty(hr.prototype,"e",{get:function(){return this._matrix[4]},set:function(L){this._matrix[4]=L}}),Object.defineProperty(hr.prototype,"f",{get:function(){return this._matrix[5]},set:function(L){this._matrix[5]=L}}),Object.defineProperty(hr.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(hr.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(hr.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(hr.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),hr.prototype.join=function(L){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(D).join(L)},hr.prototype.multiply=function(L){var se=L.sx*this.sx+L.shy*this.shx,je=L.sx*this.shy+L.shy*this.sy,Re=L.shx*this.sx+L.sy*this.shx,$e=L.shx*this.shy+L.sy*this.sy,it=L.tx*this.sx+L.ty*this.shx+this.tx,yt=L.tx*this.shy+L.ty*this.sy+this.ty;return new hr(se,je,Re,$e,it,yt)},hr.prototype.decompose=function(){var L=this.sx,se=this.shy,je=this.shx,Re=this.sy,$e=this.tx,it=this.ty,yt=Math.sqrt(L*L+se*se),tr=(L/=yt)*je+(se/=yt)*Re;je-=L*tr,Re-=se*tr;var mr=Math.sqrt(je*je+Re*Re);return tr/=mr,L*(Re/=mr)<se*(je/=mr)&&(L=-L,se=-se,tr=-tr,yt=-yt),{scale:new hr(yt,0,0,mr,0,0),translate:new hr(1,0,0,1,$e,it),rotate:new hr(L,se,-se,L,0,0),skew:new hr(1,0,tr,1,0,0)}},hr.prototype.toString=function(L){return this.join(" ")},hr.prototype.inversed=function(){var L=this.sx,se=this.shy,je=this.shx,Re=this.sy,$e=this.tx,it=this.ty,yt=1/(L*Re-se*je),tr=Re*yt,mr=-se*yt,Mr=-je*yt,ur=L*yt;return new hr(tr,mr,Mr,ur,-tr*$e-Mr*it,-mr*$e-ur*it)},hr.prototype.applyToPoint=function(L){var se=L.x*this.sx+L.y*this.shx+this.tx,je=L.x*this.shy+L.y*this.sy+this.ty;return new rc(se,je)},hr.prototype.applyToRectangle=function(L){var se=this.applyToPoint(L),je=this.applyToPoint(new rc(L.x+L.w,L.y+L.h));return new Kd(se.x,se.y,je.x-se.x,je.y-se.y)},hr.prototype.clone=function(){var L=this.sx,se=this.shy,je=this.shx,Re=this.sy,$e=this.tx,it=this.ty;return new hr(L,se,je,Re,$e,it)},m.Matrix=hr;var ga=m.matrixMult=function(L,se){return se.multiply(L)},Jn=new hr(1,0,0,1,0,0);m.unitMatrix=m.identityMatrix=Jn;var dn=function(L,se){if(!pt[L]){var je=(se instanceof pf?"Sh":"P")+(Object.keys(Xt).length+1).toString(10);se.id=je,pt[L]=je,Xt[je]=se,Ds.publish("addPattern",se)}};m.ShadingPattern=pf,m.TilingPattern=vg,m.addShadingPattern=function(L,se){return A("addShadingPattern()"),dn(L,se),this},m.beginTilingPattern=function(L){A("beginTilingPattern()"),Dn(L.boundingBox[0],L.boundingBox[1],L.boundingBox[2]-L.boundingBox[0],L.boundingBox[3]-L.boundingBox[1],L.matrix)},m.endTilingPattern=function(L,se){A("endTilingPattern()"),se.stream=re[H].join(`
1071`),dn(L,se),Ds.publish("endTilingPattern",se),wn.pop().restore()};var gn,jn=m.__private__.newObject=function(){var L=xa();return _a(L,!0),L},xa=m.__private__.newObjectDeferred=function(){return ie++,ee[ie]=function(){return ve},ie},_a=function(L,se){return se=typeof se=="boolean"&&se,ee[L]=ve,se&&ae(L+" 0 obj"),L},Au=m.__private__.newAdditionalObject=function(){var L={objId:xa(),content:""};return Ce.push(L),L},Gc=xa(),Uo=xa(),xl=m.__private__.decodeColorString=function(L){var se=L.split(" ");if(se.length!==2||se[1]!=="g"&&se[1]!=="G")se.length!==5||se[4]!=="k"&&se[4]!=="K"||(se=[(1-se[0])*(1-se[3]),(1-se[1])*(1-se[3]),(1-se[2])*(1-se[3]),"r"]);else{var je=parseFloat(se[0]);se=[je,je,je,"r"]}for(var Re="#",$e=0;$e<3;$e++)Re+=("0"+Math.floor(255*parseFloat(se[$e])).toString(16)).slice(-2);return Re},Ho=m.__private__.encodeColorString=function(L){var se;typeof L=="string"&&(L={ch1:L});var je=L.ch1,Re=L.ch2,$e=L.ch3,it=L.ch4,yt=L.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof je=="string"&&je.charAt(0)!=="#"){var tr=new u7(je);if(tr.ok)je=tr.toHex();else if(!/^\d*\.?\d*$/.test(je))throw new Error('Invalid color "'+je+'" passed to jsPDF.encodeColorString.')}if(typeof je=="string"&&/^#[0-9A-Fa-f]{3}$/.test(je)&&(je="#"+je[1]+je[1]+je[2]+je[2]+je[3]+je[3]),typeof je=="string"&&/^#[0-9A-Fa-f]{6}$/.test(je)){var mr=parseInt(je.substr(1),16);je=mr>>16&255,Re=mr>>8&255,$e=255&mr}if(Re===void 0||it===void 0&&je===Re&&Re===$e)se=typeof je=="string"?je+" "+yt[0]:L.precision===2?M(je/255)+" "+yt[0]:P(je/255)+" "+yt[0];else if(it===void 0||Ys(it)==="object"){if(it&&!isNaN(it.a)&&it.a===0)return["1.","1.","1.",yt[1]].join(" ");se=typeof je=="string"?[je,Re,$e,yt[1]].join(" "):L.precision===2?[M(je/255),M(Re/255),M($e/255),yt[1]].join(" "):[P(je/255),P(Re/255),P($e/255),yt[1]].join(" ")}else se=typeof je=="string"?[je,Re,$e,it,yt[2]].join(" "):L.precision===2?[M(je),M(Re),M($e),M(it),yt[2]].join(" "):[P(je),P(Re),P($e),P(it),yt[2]].join(" ");return se},po=m.__private__.getFilters=function(){return o},go=m.__private__.putStream=function(L){var se=(L=L||{}).data||"",je=L.filters||po(),Re=L.alreadyAppliedFilters||[],$e=L.addLength1||!1,it=se.length,yt=L.objectId,tr=function(Zn){return Zn};if(d!==null&&yt===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");d!==null&&(tr=Yn.encryptor(yt,0));var mr={};je===!0&&(je=["FlateEncode"]);var Mr=L.additionalKeyValues||[],ur=(mr=Fr.API.processDataByFilters!==void 0?Fr.API.processDataByFilters(se,je):{data:se,reverseChain:[]}).reverseChain+(Array.isArray(Re)?Re.join(" "):Re.toString());if(mr.data.length!==0&&(Mr.push({key:"Length",value:mr.data.length}),$e===!0&&Mr.push({key:"Length1",value:it})),ur.length!=0)if(ur.split("/").length-1==1)Mr.push({key:"Filter",value:ur});else{Mr.push({key:"Filter",value:"["+ur+"]"});for(var es=0;es<Mr.length;es+=1)if(Mr[es].key==="DecodeParms"){for(var nn=[],On=0;On<mr.reverseChain.split("/").length-1;On+=1)nn.push("null");nn.push(Mr[es].value),Mr[es].value="["+nn.join(" ")+"]"}}ae("<<");for(var $s=0;$s<Mr.length;$s++)ae("/"+Mr[$s].key+" "+Mr[$s].value);ae(">>"),mr.data.length!==0&&(ae("stream"),ae(tr(mr.data)),ae("endstream"))},Du=m.__private__.putPage=function(L){var se=L.number,je=L.data,Re=L.objId,$e=L.contentsObjId;_a(Re,!0),ae("<</Type /Page"),ae("/Parent "+L.rootDictionaryObjId+" 0 R"),ae("/Resources "+L.resourceDictionaryObjId+" 0 R"),ae("/MediaBox ["+parseFloat(D(L.mediaBox.bottomLeftX))+" "+parseFloat(D(L.mediaBox.bottomLeftY))+" "+D(L.mediaBox.topRightX)+" "+D(L.mediaBox.topRightY)+"]"),L.cropBox!==null&&ae("/CropBox ["+D(L.cropBox.bottomLeftX)+" "+D(L.cropBox.bottomLeftY)+" "+D(L.cropBox.topRightX)+" "+D(L.cropBox.topRightY)+"]"),L.bleedBox!==null&&ae("/BleedBox ["+D(L.bleedBox.bottomLeftX)+" "+D(L.bleedBox.bottomLeftY)+" "+D(L.bleedBox.topRightX)+" "+D(L.bleedBox.topRightY)+"]"),L.trimBox!==null&&ae("/TrimBox ["+D(L.trimBox.bottomLeftX)+" "+D(L.trimBox.bottomLeftY)+" "+D(L.trimBox.topRightX)+" "+D(L.trimBox.topRightY)+"]"),L.artBox!==null&&ae("/ArtBox ["+D(L.artBox.bottomLeftX)+" "+D(L.artBox.bottomLeftY)+" "+D(L.artBox.topRightX)+" "+D(L.artBox.topRightY)+"]"),typeof L.userUnit=="number"&&L.userUnit!==1&&ae("/UserUnit "+L.userUnit),Ds.publish("putPage",{objId:Re,pageContext:xr[se],pageNumber:se,page:je}),ae("/Contents "+$e+" 0 R"),ae(">>"),ae("endobj");var it=je.join(` 1072`);return S===N&&(it+=` 1073Q`),_a($e,!0),go({data:it,filters:po(),objectId:$e}),ae("endobj"),Re},yl=m.__private__.putPages=function(){var L,se,je=[];for(L=1;L<=zr;L++)xr[L].objId=xa(),xr[L].contentsObjId=xa();for(L=1;L<=zr;L++)je.push(Du({number:L,data:re[L],objId:xr[L].objId,contentsObjId:xr[L].contentsObjId,mediaBox:xr[L].mediaBox,cropBox:xr[L].cropBox,bleedBox:xr[L].bleedBox,trimBox:xr[L].trimBox,artBox:xr[L].artBox,userUnit:xr[L].userUnit,rootDictionaryObjId:Gc,resourceDictionaryObjId:Uo}));_a(Gc,!0),ae("<</Type /Pages");var Re="/Kids [";for(se=0;se<zr;se++)Re+=je[se]+" 0 R ";ae(Re+"]"),ae("/Count "+zr),ae(">>"),ae("endobj"),Ds.publish("postPutPages")},Tu=function(L){Ds.publish("putFont",{font:L,out:ae,newObject:jn,putStream:go}),L.isAlreadyPutted!==!0&&(L.objectNumber=jn(),ae("<<"),ae("/Type /Font"),ae("/BaseFont /"+xg(L.postScriptName)),ae("/Subtype /Type1"),typeof L.encoding=="string"&&ae("/Encoding /"+L.encoding),ae("/FirstChar 32"),ae("/LastChar 255"),ae(">>"),ae("endobj"))},Od=function(L){L.objectNumber=jn();var se=[];se.push({key:"Type",value:"/XObject"}),se.push({key:"Subtype",value:"/Form"}),se.push({key:"BBox",value:"["+[D(L.x),D(L.y),D(L.x+L.width),D(L.y+L.height)].join(" ")+"]"}),se.push({key:"Matrix",value:"["+L.matrix.toString()+"]"});var je=L.pages[1].join(` 1074`);go({data:je,additionalKeyValues:se,objectId:L.objectNumber}),ae("endobj")},zd=function(L,se){se||(se=21);var je=jn(),Re=function(yt,tr){var mr,Mr=[],ur=1/(tr-1);for(mr=0;mr<1;mr+=ur)Mr.push(mr);
vendor: 6,122 bytes, line 1074
1074if(Mr.push(1),yt[0].offset!=0){var es={offset:0,color:yt[0].color};yt.unshift(es)}if(yt[yt.length-1].offset!=1){var nn={offset:1,color:yt[yt.length-1].color};yt.push(nn)}for(var On="",$s=0,Zn=0;Zn<Mr.length;Zn++){for(mr=Mr[Zn];mr>yt[$s+1].offset;)$s++;var zn=yt[$s].offset,Ea=(mr-zn)/(yt[$s+1].offset-zn),Nl=yt[$s].color,Fi=yt[$s+1].color;On+=me(Math.round((1-Ea)*Nl[0]+Ea*Fi[0]).toString(16))+me(Math.round((1-Ea)*Nl[1]+Ea*Fi[1]).toString(16))+me(Math.round((1-Ea)*Nl[2]+Ea*Fi[2]).toString(16))}return On.trim()}(L.colors,se),$e=[];$e.push({key:"FunctionType",value:"0"}),$e.push({key:"Domain",value:"[0.0 1.0]"}),$e.push({key:"Size",value:"["+se+"]"}),$e.push({key:"BitsPerSample",value:"8"}),$e.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),$e.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),go({data:Re,additionalKeyValues:$e,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:je}),ae("endobj"),L.objectNumber=jn(),ae("<< /ShadingType "+L.type),ae("/ColorSpace /DeviceRGB");var it="/Coords ["+D(parseFloat(L.coords[0]))+" "+D(parseFloat(L.coords[1]))+" ";L.type===2?it+=D(parseFloat(L.coords[2]))+" "+D(parseFloat(L.coords[3])):it+=D(parseFloat(L.coords[2]))+" "+D(parseFloat(L.coords[3]))+" "+D(parseFloat(L.coords[4]))+" "+D(parseFloat(L.coords[5])),ae(it+="]"),L.matrix&&ae("/Matrix ["+L.matrix.toString()+"]"),ae("/Function "+je+" 0 R"),ae("/Extend [true true]"),ae(">>"),ae("endobj")},Ql=function(L,se){var je=xa(),Re=jn();se.push({resourcesOid:je,objectOid:Re}),L.objectNumber=Re;var $e=[];$e.push({key:"Type",value:"/Pattern"}),$e.push({key:"PatternType",value:"1"}),$e.push({key:"PaintType",value:"1"}),$e.push({key:"TilingType",value:"1"}),$e.push({key:"BBox",value:"["+L.boundingBox.map(D).join(" ")+"]"}),$e.push({key:"XStep",value:D(L.xStep)}),$e.push({key:"YStep",value:D(L.yStep)}),$e.push({key:"Resources",value:je+" 0 R"}),L.matrix&&$e.push({key:"Matrix",value:"["+L.matrix.toString()+"]"}),go({data:L.stream,additionalKeyValues:$e,objectId:L.objectNumber}),ae("endobj")},Ux=function(L){for(var se in L.objectNumber=jn(),ae("<<"),L)switch(se){case"opacity":ae("/ca "+M(L[se]));break;case"stroke-opacity":ae("/CA "+M(L[se]))}ae(">>"),ae("endobj")},Vc=function(L){_a(L.resourcesOid,!0),ae("<<"),ae("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var se in ae("/Font <<"),Vt)Vt.hasOwnProperty(se)&&(h===!1||h===!0&&f.hasOwnProperty(se))&&ae("/"+se+" "+Vt[se].objectNumber+" 0 R");ae(">>")}(),function(){if(Object.keys(Xt).length>0){for(var se in ae("/Shading <<"),Xt)Xt.hasOwnProperty(se)&&Xt[se]instanceof pf&&Xt[se].objectNumber>=0&&ae("/"+se+" "+Xt[se].objectNumber+" 0 R");Ds.publish("putShadingPatternDict"),ae(">>")}}(),function(se){if(Object.keys(Xt).length>0){for(var je in ae("/Pattern <<"),Xt)Xt.hasOwnProperty(je)&&Xt[je]instanceof m.TilingPattern&&Xt[je].objectNumber>=0&&Xt[je].objectNumber<se&&ae("/"+je+" "+Xt[je].objectNumber+" 0 R");Ds.publish("putTilingPatternDict"),ae(">>")}}(L.objectOid),function(){if(Object.keys(ir).length>0){var se;for(se in ae("/ExtGState <<"),ir)ir.hasOwnProperty(se)&&ir[se].objectNumber>=0&&ae("/"+se+" "+ir[se].objectNumber+" 0 R");Ds.publish("putGStateDict"),ae(">>")}}(),function(){for(var se in ae("/XObject <<"),Ur)Ur.hasOwnProperty(se)&&Ur[se].objectNumber>=0&&ae("/"+se+" "+Ur[se].objectNumber+" 0 R");Ds.publish("putXobjectDict"),ae(">>")}(),ae(">>"),ae("endobj")},Np=function(L){cr[L.fontName]=cr[L.fontName]||{},cr[L.fontName][L.fontStyle]=L.id},Fp=function(L,se,je,Re,$e){var it={id:"F"+(Object.keys(Vt).length+1).toString(10),postScriptName:L,fontName:se,fontStyle:je,encoding:Re,isStandardFont:$e||!1,metadata:{}};return Ds.publish("addFont",{font:it,instance:this}),Vt[it.id]=it,Np(it),it.id},xo=m.__private__.pdfEscape=m.pdfEscape=function(L,se){return function(je,Re){var $e,it,yt,tr,mr,Mr,ur,es,nn;if(yt=(Re=Re||{}).sourceEncoding||"Unicode",mr=Re.outputEncoding,(Re.autoencode||mr)&&Vt[Qe].metadata&&Vt[Qe].metadata[yt]&&Vt[Qe].metadata[yt].encoding&&(tr=Vt[Qe].metadata[yt].encoding,!mr&&Vt[Qe].encoding&&(mr=Vt[Qe].encoding),!mr&&tr.codePages&&(mr=tr.codePages[0]),typeof mr=="string"&&(mr=tr[mr]),mr)){for(ur=!1,Mr=[],$e=0,it=je.length;$e<it;$e++)(es=mr[je.charCodeAt($e)])?Mr.push(String.fromCharCode(es)):Mr.push(je[$e]),Mr[$e].charCodeAt(0)>>8&&(ur=!0);je=Mr.join("")}for($e=je.length;ur===void 0&&$e!==0;)je.charCodeAt($e-1)>>8&&(ur=!0),$e--;if(!ur)return je;for(Mr=Re.noBOM?[]:[254,255],$e=0,it=je.length;$e<it;$e++){if((nn=(es=je.charCodeAt($e))>>8)>>8)throw new Error("Character at position "+$e+" of string '"+je+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");Mr.push(nn),Mr.push(es-(nn<<8))}return String.fromCharCode.apply(void 0,Mr)}(L,se).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},Ud=m.__private__.beginPage=function(L){re[++zr]=[],xr[zr]={objId:0,contentsObjId:0,userUnit:Number(l),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(L[0]),topRightY:Number(L[1])}},Sp(zr),Me(re[H])},bm=function(L,se){var je,Re,$e;switch(r=se||r,typeof L=="string"&&(je=w(L.toLowerCase()),Array.isArray(je)&&(Re=je[0],$e=je[1])),Array.isArray(L)&&(Re=L[0]*We,$e=L[1]*We),isNaN(Re)&&(Re=a[0],$e=a[1]),(Re>14400||$e>14400)&&(on.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),Re=Math.min(14400,Re),$e=Math.min(14400,$e)),a=[Re,$e],r.substr(0,1)){case"l":$e>Re&&(a=[$e,Re]);break;case"p":Re>$e&&(a=[$e,Re])}Ud(a),Hr(Nm),ae(Vd),Sm!==0&&ae(Sm+" J"),Cm!==0&&ae(Cm+" j"),Ds.publish("addPage",{pageNumber:zr})},Hd=function(L){L>0&&L<=zr&&(re.splice(L,1),xr.splice(L,1),zr--,H>zr&&(H=zr),this.setPage(H))},Sp=function(L){L>0&&L<=zr&&(H=L)},Cp=m.__private__.getNumberOfPages=m.getNumberOfPages=function(){return re.length-1},kp=function(L,se,je){var Re,$e=void 0;return je=je||{},L=L!==void 0?L:Vt[Qe].fontName,se=se!==void 0?se:Vt[Qe].fontStyle,Re=L.toLowerCase(),cr[Re]!==void 0&&cr[Re][se]!==void 0?$e=cr[Re][se]:cr[L]!==void 0&&cr[L][se]!==void 0?$e=cr[L][se]:je.disableWarning===!1&&on.warn("Unable to look up font label for font '"+L+"', '"+se+"'. Refer to getFontList(
1074) for available fonts."),$e||je.noFallback||($e=cr.times[se])==null&&($e=cr.times.normal),$e},bl=m.__private__.putInfo=function(){var L=jn(),se=function(Re){return Re};for(var je in d!==null&&(se=Yn.encryptor(L,0)),ae("<<"),ae("/Producer ("+xo(se("jsPDF "+Fr.version))+")"),qe)qe.hasOwnProperty(je)&&qe[je]&&ae("/"+je.substr(0,1).toUpperCase()+je.substr(1)+" ("+xo(se(qe[je]))+")");ae("/CreationDate ("+xo(se(O))+")"),ae(">>"),ae("endobj")},Mu=m.__private__.putCatalog=function(L){var se=(L=L||{}).rootDictionaryObjId||Gc;switch(jn(),ae("<<"),ae("/Type /Catalog"),ae("/Pages "+se+" 0 R"),Ft||(Ft="fullwidth"),Ft){case"fullwidth":ae("/OpenAction [3 0 R /FitH null]");break;case"fullheight":ae("/OpenAction [3 0 R /FitV null]");break;case"fullpage":ae("/OpenAction [3 0 R /Fit]");break;case"original":ae("/OpenAction [3 0 R /XYZ null null 1]");break;default:var je=""+Ft;je.substr(je.length-1)==="%"&&(Ft=parseInt(Ft)/100),typeof Ft=="number"&&ae("/OpenAction [3 0 R /XYZ null null "+M(Ft)+"]")}switch(Je||(Je="continuous"),Je){case"continuous":ae("/PageLayout /OneColumn");break;case"single":ae("/PageLayout /SinglePage");break;case"two":case"twoleft":ae("/PageLayout /TwoColumnLeft");break;case"tworight":ae("/PageLayout /TwoColumnRight")}ge&&ae("/PageMode /"+ge),Ds.publish("putCatalog"),ae(">>"),ae("endobj")},_p=m.__private__.putTrailer=function(){ae("trailer"),ae("<<"),ae("/Size "+(ie+1)),ae("/Root "+ie+" 0 R"),ae("/Info "+(ie-1)+" 0 R"),d!==null&&ae("/Encrypt "+Yn.oid+" 0 R"),ae("/ID [ <"+V+"> <"+V+"> ]"),ae(">>")},An=m.__private__.putHeader=function(){ae("%PDF-"+g),ae("%ºÃˆ ")},$d=m.__private__.putXRef=function(){var L="0000000000";ae("xref"),ae("0 "+(ie+1)),ae("0000000000 65535 f ");for(var se=1;se<=ie;se++)typeof ee[se]=="function"?ae((L+ee[se]()).slice(-10)+" 00000 n "):ee[se]!==void 0?ae((L+ee[se]).slice(-10)+" 00000 n "):ae("0000000000 00000 n ")},vl=m.__private__.buildDocument=function(){var L;ie=0,ve=0,he=[],ee=[],Ce=[],Gc=xa(),Uo=xa(),Me(he),Ds.publish("buildDocument"),An(),yl(),function(){Ds.publish("putAdditionalObjects");for(var je=0;je<Ce.length;je++){var Re=Ce[je];_a(Re.objId,!0),ae(Re.content),ae("endobj")}Ds.publish("postPutAdditionalObjects")}(),L=[],function(){for(var je in Vt)Vt.hasOwnProperty(je)&&(h===!1||h===!0&&f.hasOwnProperty(je))&&Tu(Vt[je])}(),function(){var je;for(je in ir)ir.hasOwnProperty(je)&&Ux(ir[je])}(),function(){for(var je in Ur)Ur.hasOwnProperty(je)&&Od(Ur[je])}(),function(je){var Re;for(Re in Xt)Xt.hasOwnProperty(Re)&&(Xt[Re]instanceof pf?zd(Xt[Re]):Xt[Re]instanceof vg&&Ql(Xt[Re],je))}(L),Ds.publish("putResources"),L.forEach(Vc),Vc({resourcesOid:Uo,objectOid:Number.MAX_SAFE_INTEGER}),Ds.publish("postPutResources"),d!==null&&(Yn.oid=jn(),ae("<<"),ae("/Filter /Standard"),ae("/V "+Yn.v),ae("/R "+Yn.r),ae("/U <"+Yn.toHexString(Yn.U)+">"),ae("/O <"+Yn.toHexString(Yn.O)+">"),ae("/P "+Yn.P),ae(">>"),ae("endobj")),bl(),Mu();var se=ve;return $d(),_p(),ae("startxref"),ae(""+se),ae("%%EOF"),Me(re[H]),he.join(` 1075`)},Pu=m.__private__.getBlob=function(L){return new Blob([mt(L)],{type:"application/pdf"})},Ru=m.output=m.__private__.output=(gn=function(L,se){switch(typeof(se=se||{})=="string"?se={filename:se}:se.filename=se.filename||"generated.pdf",L){case void 0:return vl();case"save":m.save(se.filename);break;case"arraybuffer":return mt(vl());case"blob":return Pu(vl());case"bloburi":case"bloburl":if(Wr.URL!==void 0&&typeof Wr.URL.createObjectURL=="function")return Wr.URL&&Wr.URL.createObjectURL(Pu(vl()))||void 0;on.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var je="",Re=vl();try{je=cD(Re)}catch{je=cD(unescape(encodeURIComponent(Re)))}return"data:application/pdf;filename="+se.filename+";base64,"+je;case"pdfobjectnewwindow":if(Object.prototype.toString.call(Wr)==="[object Window]"){var $e="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",it=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';se.pdfObjectUrl&&($e=se.pdfObjectUrl,it="");var yt='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="'+$e+'"'+it+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(se)+");<\/script></body></html>",tr=Wr.open();return tr!==null&&tr.document.write(yt),tr}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(Wr)==="[object Window]"){var mr='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="'+(se.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+se.filename+'" width="500px" height="400px" /></body></html>',Mr=Wr.open();if(Mr!==null){Mr.document.write(mr);var ur=this;Mr.document.documentElement.querySelector("#pdfViewer").onload=function(){Mr.document.title=se.filename,Mr.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(ur.output("bloburl"))}}return Mr}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(Wr)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var es='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="'+this.output("datauristring",se)+'"></iframe></body></html>',nn=Wr.open();if(nn!==null&&(nn.document.write(es),nn.document.title=se.filename),nn||typeof safari>"u")return nn;break;case"datauri":case"dataurl":return Wr.document.location.href=this.output("datauristring",se);default:return null}},gn.foo=function(){try{return gn.apply(this,arguments)}catch(je){var L=je.stack||"";~L.indexOf(" at ")&&(L=L.split(" at ")[1]);var se="Error in function "+L.split(` 1076`)[0].split("<")[0]+": "+je.message;if(!Wr.console)throw new Error(se);Wr.console.error(se,je),Wr.alert&&alert(se)}},gn.foo.bar=gn,gn.foo),Vi=function(L){return Array.isArray(Er)===!0&&Er.indexOf(L)>-1};switch(n){case"pt":We=1;break;case"mm":We=72/25.4;break;case"cm":We=72/2.54;break;case"in":We=72;break;case"px":We=Vi("px_scaling")==1?.75:96/72;break;case"pc":case"em":We=12;break;case"ex":We=6;break;default:if(typeof n!="number")throw new Error("Invalid unit: "+n);We=n}var Yn=null;oe(),B();var wl=m.__private__.getPageInfo=m.getPageInfo=function(L){if(isNaN(L)||L%1!=0)throw new Error("Invalid argument passed to
1076jsPDF.getPageInfo");return{objId:xr[L].objId,pageNumber:L,pageContext:xr[L]}},vm=m.__private__.getPageInfoByObjId=function(L){if(isNaN(L)||L%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var se in xr)if(xr[se].objId===L)break;return wl(se)},wm=m.__private__.getCurrentPageInfo=m.getCurrentPageInfo=function(){return{objId:xr[H].objId,pageNumber:H,pageContext:xr[H]}};m.addPage=function(){return bm.apply(this,arguments),this},m.setPage=function(){return Sp.apply(this,arguments),Me.call(this,re[H]),this},m.insertPage=function(L){return this.addPage(),this.movePage(H,L),this},m.movePage=function(L,se){var je,Re;if(L>se){je=re[L],Re=xr[L];for(var $e=L;$e>se;$e--)re[$e]=re[$e-1],xr[$e]=xr[$e-1];re[se]=je,xr[se]=Re,this.setPage(se)}else if(L<se){je=re[L],Re=xr[L];for(var it=L;it<se;it++)re[it]=re[it+1],xr[it]=xr[it+1];re[se]=je,xr[se]=Re,this.setPage(se)}return this},m.deletePage=function(){return Hd.apply(this,arguments),this},m.__private__.text=m.text=function(L,se,je,Re,$e){var it,yt,tr,mr,Mr,ur,es,nn,On,$s=(Re=Re||{}).scope||this;if(typeof L=="number"&&typeof se=="number"&&(typeof je=="string"||Array.isArray(je))){var Zn=je;je=se,se=L,L=Zn}if(arguments[3]instanceof hr==0?(tr=arguments[4],mr=arguments[5],Ys(es=arguments[3])==="object"&&es!==null||(typeof tr=="string"&&(mr=tr,tr=null),typeof es=="string"&&(mr=es,es=null),typeof es=="number"&&(tr=es,es=null),Re={flags:es,angle:tr,align:mr})):(A("The transform parameter of text() with a Matrix value"),On=$e),isNaN(se)||isNaN(je)||L==null)throw new Error("Invalid arguments passed to jsPDF.text");if(L.length===0)return $s;var zn,Ea="",Nl=typeof Re.lineHeightFactor=="number"?Re.lineHeightFactor:Bu,Fi=$s.internal.scaleFactor;function Si(Jt){return Jt=Jt.split(" ").join(Array(Re.TabLen||9).join(" ")),xo(Jt,es)}function Am(Jt){for(var Nr,ss=Jt.concat(),$r=[],Jo=ss.length;Jo--;)typeof(Nr=ss.shift())=="string"?$r.push(Nr):Array.isArray(Jt)&&(Nr.length===1||Nr[1]===void 0&&Nr[2]===void 0)?$r.push(Nr[0]):$r.push([Nr[0],Nr[1],Nr[2]]);return $r}function Lu(Jt,Nr){var ss;if(typeof Jt=="string")ss=Nr(Jt)[0];else if(Array.isArray(Jt)){for(var $r,Jo,Lm=Jt.concat(),Da=[],zu=Lm.length;zu--;)typeof($r=Lm.shift())=="string"?Da.push(Nr($r)[0]):Array.isArray($r)&&typeof $r[0]=="string"&&(Jo=Nr($r[0],$r[1],$r[2]),Da.push([Jo[0],Jo[1],Jo[2]]));ss=Da}return ss}var nc=!1,ac=!0;if(typeof L=="string")nc=!0;else if(Array.isArray(L)){var ic=L.concat();yt=[];for(var oc,Aa=ic.length;Aa--;)(typeof(oc=ic.shift())!="string"||Array.isArray(oc)&&typeof oc[0]!="str
1076ing")&&(ac=!1);nc=ac}if(nc===!1)throw new Error('Type of text must be string or Array. "'+L+'" is not recognized.');typeof L=="string"&&(L=L.match(/[\r?\n]/)?L.split(/\r\n|\r|\n/g):[L]);var lc=Xe/$s.internal.scaleFactor,cc=lc*(Nl-1);switch(Re.baseline){case"bottom":je-=cc;break;case"top":je+=lc-cc;break;case"hanging":je+=lc-2*cc;break;case"middle":je+=lc/2-cc}if((ur=Re.maxWidth||0)>0&&(typeof L=="string"?L=$s.splitTextToSize(L,ur):Object.prototype.toString.call(L)==="[object Array]"&&(L=L.reduce(function(Jt,Nr){return Jt.concat($s.splitTextToSize(Nr,ur))},[]))),it={text:L,x:se,y:je,options:Re,mutex:{pdfEscape:xo,activeFontKey:Qe,fonts:Vt,activeFontSize:Xe}},Ds.publish("preProcessText",it),L=it.text,tr=(Re=it.options).angle,On instanceof hr==0&&tr&&typeof tr=="number"){tr*=Math.PI/180,Re.rotationDirection===0&&(tr=-tr),S===N&&(tr=-tr);var Dm=Math.cos(tr),Zd=Math.sin(tr);On=new hr(Dm,Zd,-Zd,Dm,0,0)}else tr&&tr instanceof hr&&(On=tr);S!==N||On||(On=Jn),(Mr=Re.charSpace||tc)!==void 0&&(Ea+=D(U(Mr))+` Tc 1077`,this.setCharSpace(this.getCharSpace()||0)),(nn=Re.horizontalScale)!==void 0&&(Ea+=D(100*nn)+` Tz 1078`),Re.lang;var Vs=-1,Vo=Re.renderingMode!==void 0?Re.renderingMode:Re.stroke,Fl=$s.internal.getCurrentPageInfo().pageContext;switch(Vo){case 0:case!1:case"fill":Vs=0;break;case 1:case!0:case"stroke":Vs=1;break;case 2:case"fillThenStroke":Vs=2;break;case 3:case"invisible":Vs=3;break;case 4:case"fillAndAddForClipping":Vs=4;break;case 5:case"strokeAndAddPathForClipping":Vs=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":Vs=6;break;case 7:case"addToPathForClipping":Vs=7}var Tm=Fl.usedRenderingMode!==void 0?Fl.usedRenderingMode:-1;Vs!==-1?Ea+=Vs+` Tr 1079`:Tm!==-1&&(Ea+=`0 Tr 1080`),Vs!==-1&&(Fl.usedRenderingMode=Vs),mr=Re.align||"left";var Ki,Iu=Xe*Nl,Mm=$s.internal.pageSize.getWidth(),Pm=Vt[Qe];Mr=Re.charSpace||tc,ur=Re.maxWidth||0,es=Object.assign({autoencode:!0,noBOM:!0},Re.flags);var Yc=[],Ou=function(Jt){return $s.getStringUnitWidth(Jt,{font:Pm,charSpace:Mr,fontSize:Xe,doKerning:!1})*Xe/Fi};if(Object.prototype.toString.call(L)==="[object Array]"){var ya;yt=Am(L),mr!=="left"&&(Ki=yt.map(Ou));var Ji,Zc=0;if(mr==="right"){se-=Ki[0],L=[],Aa=yt.length;for(var Ko=0;Ko<Aa;Ko++)Ko===0?(Ji=qo(se),ya=ec(je)):(Ji=U(Zc-Ki[Ko]),ya=-Iu),L.push([yt[Ko],Ji,ya]),Zc=Ki[Ko]}else if(mr==="center"){se-=Ki[0]/2,L=[],Aa=yt.length;for(var uc=0;uc<Aa;uc++)uc===0?(Ji=qo(se),ya=ec(je)):(Ji=U((Zc-Ki[uc])/2),ya=-Iu),L.push([yt[uc],Ji,ya]),Zc=Ki[uc]}else if(mr==="left"){L=[],Aa=yt.length;for(var bo=0;bo<Aa;bo++)L.push(yt[bo])}else if(mr==="justify"&&Pm.encoding==="Identity-H"){L=[],Aa=yt.length,ur=ur!==0?ur:Mm;for(var dc=0,Tn=0;Tn<Aa;Tn++)if(ya=Tn===0?ec(je):-Iu,Ji=Tn===0?qo(se):dc,Tn<Aa-1){var Mp=U((ur-Ki[Tn])/(yt[Tn].split(" ").length-1)),Sl=yt[Tn].split(" ");L.push([Sl[0]+" ",Ji,ya]),dc=0;for(var ci=1;ci<Sl.length;ci++){var ui=(Ou(Sl[ci-1]+" "+Sl[ci])-Ou(Sl[ci]))*Fi+Mp;ci==Sl.length-1?L.push([Sl[ci],ui,0]):L.push([Sl[ci]+" ",ui,0]),dc-=ui}}else L.push([yt[Tn],Ji,ya]);L.push(["",dc,0])}else{if(mr!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(L=[],Aa=yt.length,ur=ur!==0?ur:Mm,Tn=0;Tn<Aa;Tn++){ya=Tn===0?ec(je):-Iu,Ji=Tn===0?qo(se):0;var Xd=yt[Tn].split(" ").length-1,Rm=Xd>0?(ur-Ki[Tn])/Xd:0;Tn<Aa-1?Yc.push(D(U(Rm))):Yc.push(0),L.push([yt[Tn],Ji,ya])}}}(typeof Re.R2L=="boolean"?Re.R2L:fe)===!0&&(L=Lu(L,function(Jt,Nr,ss){return[Jt.split("").reverse().join(""),Nr,ss]})),it={text:L,x:se,y:je,options:Re,mutex:{pdfEscape:xo,activeFontKey:Qe,fonts:Vt,activeFontSize:Xe}},Ds.publish("postProcessText",it),L=it.text,zn=it.mutex.isHex||!1;var Bm=Vt[Qe].encoding;Bm!=="WinAnsiEncoding"&&Bm!=="StandardEncoding"||(L=Lu(L,function(Jt,Nr,ss){return[Si(Jt),Nr,ss]})),yt=Am(L),L=[];for(var Xc,Qc,eu,vo=Array.isArray(yt[0])?1:0,Ue="",st=function(Jt,Nr,ss){var $r="";return ss instanceof hr?(ss=typeof Re.angle=="number"?ga(ss,new hr(1,0,0,1,Jt,Nr)):ga(new hr(1,0,0,1,Jt,Nr),ss),S===N&&(ss=ga(new hr(1,0,0,-1,0,0),ss)),$r=ss.join(" ")+` Tm 1081`):$r=D(Jt)+" "+D(Nr)+` Td 1082`,$r},et=0;et<yt.length;et++){switch(Ue="",vo){case 1:eu=(zn?"<":"(")+yt[et][0]+(zn?">":")"),Xc=parseFloat(yt[et][1]),Qc=parseFloat(yt[et][2]);break;case 0:eu=(zn?"<":"(")+yt[et]+(zn?">":")"),Xc=qo(se),Qc=ec(je)}Yc!==void 0&&Yc[et]!==void 0&&(Ue=Yc[et]+` Tw 1083`),et===0?L.push(Ue+st(Xc,Qc,On)+eu):vo===0?L.push(Ue+eu):vo===1&&L.push(Ue+st(Xc,Qc,On)+eu)}L=vo===0?L.join(` Tj 1084T* `):L.join(` Tj 1085`),L+=` Tj 1086`;var Ut=`BT 1087/`;return Ut+=Qe+" "+Xe+` Tf 1088`,Ut+=D(Xe*Nl)+` TL 1089`,Ut+=Ps+` 1090`,Ut+=Ea,Ut+=L,ae(Ut+="ET"),f[Qe]=!0,$s};var Hx=m.__private__.clip=m.clip=function(L){return ae(L==="evenodd"?"W*":"W"),this};m.clipEvenOdd=function(){return Hx("evenodd")},m.__private__.discardPath=m.discardPath=function(){return ae("n"),this};var $o=m.__private__.isValidStyle=function(L){var se=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(L)!==-1&&(se=!0),se};m.__private__.setDefaultPathOperation=m.setDefaultPathOperation=function(L){return $o(L)&&(u=L),this};var Wd=m.__private__.getStyle=m.getStyle=function(L){var se=u;switch(L){case"D":case"S":se="S";break;case"F":se="f";break;case"FD":case"DF":se="B";break;case"f":case"f*":case"B":case"B*":se=L}return se},qd=m.close=function(){return ae("h"),this};m.stroke=function(){return ae("S"),this},m.fill=function(L){return Wo("f",L),this},m.fillEvenOdd=function(L){return Wo("f*",L),this},m.fillStroke=function(L){return Wo("B",L),this},m.fillStrokeEvenOdd=function(L){return Wo("B*",L),this};var Wo=function(L,se){Ys(se)==="object"?$x(se,L):ae(L)},Kc=function(L){L===null||S===N&&L===void 0||(L=Wd(L),ae(L))};function Ep(L,se,je,Re,$e){var it=new vg(se||this.boundingBox,je||this.xStep,Re||this.yStep,this.gState,$e||this.matrix
vendor: 4,592 bytes, line 1090
1090);it.stream=this.stream;var yt=L+"$$"+this.cloneIndex+++"$$";return dn(yt,it),it}var $x=function(L,se){var je=pt[L.key],Re=Xt[je];if(Re instanceof pf)ae("q"),ae(Ap(se)),Re.gState&&m.setGState(Re.gState),ae(L.matrix.toString()+" cm"),ae("/"+je+" sh"),ae("Q");else if(Re instanceof vg){var $e=new hr(1,0,0,-1,0,Jc());L.matrix&&($e=$e.multiply(L.matrix||Jn),je=Ep.call(Re,L.key,L.boundingBox,L.xStep,L.yStep,$e).id),ae("q"),ae("/Pattern cs"),ae("/"+je+" scn"),Re.gState&&m.setGState(Re.gState),ae(se),ae("Q")}},Ap=function(L){switch(L){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},Gd=m.moveTo=function(L,se){return ae(D(U(L))+" "+D(I(se))+" m"),this},jm=m.lineTo=function(L,se){return ae(D(U(L))+" "+D(I(se))+" l"),this},yo=m.curveTo=function(L,se,je,Re,$e,it){return ae([D(U(L)),D(I(se)),D(U(je)),D(I(Re)),D(U($e)),D(I(it)),"c"].join(" ")),this};m.__private__.line=m.line=function(L,se,je,Re,$e){if(isNaN(L)||isNaN(se)||isNaN(je)||isNaN(Re)||!$o($e))throw new Error("Invalid arguments passed to jsPDF.line");return S===j?this.lines([[je-L,Re-se]],L,se,[1,1],$e||"S"):this.lines([[je-L,Re-se]],L,se,[1,1]).stroke()},m.__private__.lines=m.lines=function(L,se,je,Re,$e,it){var yt,tr,mr,Mr,ur,es,nn,On,$s,Zn,zn,Ea;if(typeof L=="number"&&(Ea=je,je=se,se=L,L=Ea),Re=Re||[1,1],it=it||!1,isNaN(se)||isNaN(je)||!Array.isArray(L)||!Array.isArray(Re)||!$o($e)||typeof it!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(Gd(se,je),yt=Re[0],tr=Re[1],Mr=L.length,Zn=se,zn=je,mr=0;mr<Mr;mr++)(ur=L[mr]).length===2?(Zn=ur[0]*yt+Zn,zn=ur[1]*tr+zn,jm(Zn,zn)):(es=ur[0]*yt+Zn,nn=ur[1]*tr+zn,On=ur[2]*yt+Zn,$s=ur[3]*tr+zn,Zn=ur[4]*yt+Zn,zn=ur[5]*tr+zn,yo(es,nn,On,$s,Zn,zn));return it&&qd(),Kc($e),this},m.path=function(L){for(var se=0;se<L.length;se++){var je=L[se],Re=je.c;switch(je.op){case"m":Gd(Re[0],Re[1]);break;case"l":jm(Re[0],Re[1]);break;case"c":yo.apply(this,Re);break;case"h":qd()}}return this},m.__private__.rect=m.rect=function(L,se,je,Re,$e){if(isNaN(L)||isNaN(se)||isNaN(je)||isNaN(Re)||!$o($e))throw new Error("Invalid arguments passed to jsPDF.rect");return S===j&&(Re=-Re),ae([D(U(L)),D(I(se)),D(U(je)),D(U(Re)),"re"].join(" ")),Kc($e),this},m.__private__.triangle=m.triangle=function(L,se,je,Re,$e,it,yt){if(isNaN(L)||isNaN(se)||isNaN(je)||isNaN(Re)||isNaN($e)||isNaN(it)||!$o(yt))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[je-L,Re-se],[$e-je,it-Re],[L-$e,se-it]],L,se,[1,1],yt,!0),this},m.__private__.roundedRect=m.roundedRect=function(L,se,je,Re,$e,it,yt){if(isNaN(L)||isNaN(se)||isNaN(je)||isNaN(Re)||isNaN($e)||isNaN(it)||!$o(yt))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var tr=4/3*(Math.SQRT2-1);return $e=Math.min($e,.5*je),it=Math.min(it,.5*Re),this.lines([[je-2*$e,0],[$e*tr,0,$e,it-it*tr,$e,it],[0,Re-2*it],[0,it*tr,-$e*tr,it,-$e,it],[2*$e-je,0],[-$e*tr,0,-$e,-it*tr,-$e,-it],[0,2*it-Re],[0,-it*tr,$e*tr,-it,$e,-it]],L+$e,se,[1,1],yt,!0),this},m.__private__.ellipse=m.ellipse=function(L,se,je,Re,$e){if(isNaN(L)||isNaN(se)||isNaN(je)||isNaN(Re)||!$o($e))throw new Error("Invalid arguments passed to jsPDF.ellipse");var it=4/3*(Math.SQRT2-1)*je,yt=4/3*(Math.SQRT2-1)*Re;return Gd(L+je,se),yo(L+je,se-yt,L+it,se-Re,L,se-Re),yo(L-it,se-Re,L-je,se-yt,L-je,se),yo(L-je,se+yt,L-it,se+Re,L,se+Re),yo(L+it,se+Re,L+je,se+yt,L+je,se),Kc($e),this},m.__private__.circle=m.circle=function(L,se,je,Re){if(isNaN(L)||isNaN(se)||isNaN(je)||!$o(Re))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(L,se,je,je,Re)},m.setFont=function(L,se,je){return je&&(se=T(se,je)),Qe=kp(L,se,{disableWarning:!1}),this};var Wx=m.__private__.getFont=m.getFont=function(){return Vt[kp.apply(m,arguments)]};m.__private__.getFontList=m.getFontList=function(){var L,se,je={};for(L in cr)if(cr.hasOwnProperty(L))for(se in je[L]=[],cr[L])cr[L].hasOwnProperty(se)&&je[L].push(se);return je},m.addFont=function(L,se,je,Re,$e){var it=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&it.indexOf(arguments[3])!==-1?$e=arguments[3]:arguments[3]&&it.indexOf(arguments[3])==-1&&(je=T(je,Re)),Fp.call(this,L,se,je,$e=$e||"Identity-H")};var Bu,Nm=t.lineWidth||.200025,Dp=m.__private__.getLineWidth=m.getLineWidth=function(){return Nm},Hr=m.__private__.setLineWidth=m.setLineWidth=function(L){return Nm=L,ae(D(U(L))+" w"),this};m.__private__.setLineDash=Fr.API.setLineDash=Fr.API.setLineDashPattern=function(L,se){if(L=L||[],se=se||0,isNaN(se)||!Array.isArray(L))throw new Error("Invalid arguments passed to
1090jsPDF.setLineDash");return L=L.map(function(je){return D(U(je))}).join(" "),se=D(U(se)),ae("["+L+"] "+se+" d"),this};var qx=m.__private__.getLineHeight=m.getLineHeight=function(){return Xe*Bu};m.__private__.getLineHeight=m.getLineHeight=function(){return Xe*Bu};var Gx=m.__private__.setLineHeightFactor=m.setLineHeightFactor=function(L){return typeof(L=L||1.15)=="number"&&(Bu=L),this},Vx=m.__private__.getLineHeightFactor=m.getLineHeightFactor=function(){return Bu};Gx(t.lineHeight);var qo=m.__private__.getHorizontalCoordinate=function(L){return U(L)},ec=m.__private__.getVerticalCoordinate=function(L){return S===N?L:xr[H].mediaBox.topRightY-xr[H].mediaBox.bottomLeftY-U(L)},Kx=m.__private__.getHorizontalCoordinateString=m.getHorizontalCoordinateString=function(L){return D(qo(L))},Jx=m.__private__.getVerticalCoordinateString=m.getVerticalCoordinateString=function(L){return D(ec(L))},Vd=t.strokeColor||"0 G";m.__private__.getStrokeColor=m.getDrawColor=function(){return xl(Vd)},m.__private__.setStrokeColor=m.setDrawColor=function(L,se,je,Re){return Vd=Ho({ch1:L,ch2:se,ch3:je,ch4:Re,pdfColorType:"draw",precision:2}),ae(Vd),this};var Fm=t.fillColor||"0 g";m.__private__.getFillColor=m.getFillColor=function(){return xl(Fm)},m.__private__.setFillColor=m.setFillColor=function(L,se,je,Re){return Fm=Ho({ch1:L,ch2:se,ch3:je,ch4:Re,pdfColorType:"fill",precision:2}),ae(Fm),this};var Ps=t.textColor||"0 g",Hs=m.__private__.getTextColor=m.getTextColor=function(){return xl(Ps)};m.__private__.setTextColor=m.setTextColor=function(L,se,je,Re){return Ps=Ho({ch1:L,ch2:se,ch3:je,ch4:Re,pdfColorType:"text",precision:3}),this};var tc=t.charSpace,Yx=m.__private__.getCharSpace=m.getCharSpace=function(){return parseFloat(tc||0)};m.__private__.setCharSpace=m.setCharSpace=function(L){if(isNaN(L))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return tc=L,this};var Sm=0;m.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},m.__private__.setLineCap=m.setLineCap=function(L){var se=m.CapJoinStyles[L];if(se===void 0)throw new Error("Line cap style of '"+L+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Sm=se,ae(se+" J"),this};var Cm=0;m.__private__.setLineJoin=m.setLineJoin=function(L){var se=m.CapJoinStyles[L];if(se===void 0)throw new Error("Line join style of '"+L+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Cm=se,ae(se+" j"),this},m.__private__.setLineMiterLimit=m.__private__.setMiterLimit=m.setLineMiterLimit=m.setMiterLimit=function(L){if(L=L||0,isNaN(L))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return ae(D(U(L))+" M"),this},m.GState=q1,m.setGState=function(L){(L=typeof L=="string"?ir[jr[L]]:Tp(null,L)).equals(rs)||(ae("/"+L.id+" gs"),rs=L)};var Tp=function(L,se){if(!L||!jr[L]){var je=!1;for(var Re in ir)if(ir.hasOwnProperty(Re)&&ir[Re].equals(se)){je=!0;break}if(je)se=ir[Re];else{var $e="GS"+(Object.keys(ir).length+1).toString(10);ir[$e]=se,se.id=$e}return L&&(jr[L]=se.id),Ds.publish("addGState",se),se}};m.addGState=function(L,se){return Tp(L,se),this},m.saveGraphicsState=function(){return ae("q"),wr.push({key:Qe,size:Xe,color:Ps}),this},m.restoreGraphicsState=function(){ae("Q");var L=wr.pop();return Qe=L.key,Xe=L.size,Ps=L.color,rs=null,this},m.setCurrentTransformationMatrix=function(L){return ae(L.toString()+" cm"),this},m.comment=function(L){return ae("#"+L),this};var rc=function(L,se){var je=L||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return je},set:function(it){isNaN(it)||(je=parseFloat(it))}});var Re=se||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return Re},set:function(it){isNaN(it)||(Re=parseFloat(it))}});var $e="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return $e},set:function(it){$e=it.toString()}}),this},Kd=function(L,se,je,Re){rc.call(this,L,se),this.type="rect";var $e=je||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return $e},set:function(yt){isNaN(yt)||($e=parseFloat(yt))}});var it=Re||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return it},set:function(yt){isNaN(yt)||(it=parseFloat(yt))}}),this},Jd=function(){this.page=zr,this.currentPage=H,this.pages=re.slice(0),this.pagesContext=xr.slice(0),this.x=dt,this.y=Bt,this.matrix=Lt,this.width=Go(H),this.height=Yd(H),this.outputDestination=Ee,this.id="",this.objectNumber=-1};Jd.prototype.restore=function(){zr=this.page,H=this.currentPage,xr=this.pagesContext,re=this.pages,dt=this.x,Bt=this.y,Lt=this.matrix,km(H,this.width),In(H,this.height),Ee=this.outputDestination};var Dn=function(L,se,je,Re,$e){wn.push(new Jd),zr=H=0,re=[],dt=L,Bt=se,Lt=$e,Ud([je,Re])};for(var sc in m.beginFormObject=function(L,se,je,Re,$e){return Dn(L,se,je,Re,$e),this},m.endFormObject=function(L){return function(se){if(ws[se])wn.pop().restore(
vendor: 4,611 bytes, line 1090
1090);else{var je=new Jd,Re="Xo"+(Object.keys(Ur).length+1).toString(10);je.id=Re,ws[se]=Re,Ur[Re]=je,Ds.publish("addFormObject",je),wn.pop().restore()}}(L),this},m.doFormObject=function(L,se){var je=Ur[ws[L]];return ae("q"),ae(se.toString()+" cm"),ae("/"+je.id+" Do"),ae("Q"),this},m.getFormObject=function(L){var se=Ur[ws[L]];return{x:se.x,y:se.y,width:se.width,height:se.height,matrix:se.matrix}},m.save=function(L,se){return L=L||"generated.pdf",(se=se||{}).returnPromise=se.returnPromise||!1,se.returnPromise===!1?(mf(Pu(vl()),L),typeof mf.unload=="function"&&Wr.setTimeout&&setTimeout(mf.unload,911),this):new Promise(function(je,Re){try{var $e=mf(Pu(vl()),L);typeof mf.unload=="function"&&Wr.setTimeout&&setTimeout(mf.unload,911),je($e)}catch(it){Re(it.message)}})},Fr.API)Fr.API.hasOwnProperty(sc)&&(sc==="events"&&Fr.API.events.length?function(L,se){var je,Re,$e;for($e=se.length-1;$e!==-1;$e--)je=se[$e][0],Re=se[$e][1],L.subscribe.apply(L,[je].concat(typeof Re=="function"?[Re]:Re))}(Ds,Fr.API.events):m[sc]=Fr.API[sc]);function Go(L){return xr[L].mediaBox.topRightX-xr[L].mediaBox.bottomLeftX}function km(L,se){xr[L].mediaBox.topRightX=se+xr[L].mediaBox.bottomLeftX}function Yd(L){return xr[L].mediaBox.topRightY-xr[L].mediaBox.bottomLeftY}function In(L,se){xr[L].mediaBox.topRightY=se+xr[L].mediaBox.bottomLeftY}var jl=m.getPageWidth=function(L){return Go(L=L||H)/We},_m=m.setPageWidth=function(L,se){km(L,se*We)},Jc=m.getPageHeight=function(L){return Yd(L=L||H)/We},Em=m.setPageHeight=function(L,se){In(L,se*We)};return m.internal={pdfEscape:xo,getStyle:Wd,getFont:Wx,getFontSize:ce,getCharSpace:Yx,getTextColor:Hs,getLineHeight:qx,getLineHeightFactor:Vx,getLineWidth:Dp,write:ze,getHorizontalCoordinate:qo,getVerticalCoordinate:ec,getCoordinateString:Kx,getVerticalCoordinateString:Jx,collections:{},newObject:jn,newAdditionalObject:Au,newObjectDeferred:xa,newObjectDeferredBegin:_a,getFilters:po,putStream:go,events:Ds,scaleFactor:We,pageSize:{getWidth:function(){return jl(H)},setWidth:function(L){_m(H,L)},getHeight:function(){return Jc(H)},setHeight:function(L){Em(H,L)}},encryptionOptions:d,encryption:Yn,getEncryptor:function(L){return d!==null?Yn.encryptor(L,0):function(se){return se}},output:Ru,getNumberOfPages:Cp,get pages(){return re},out:ae,f2:M,f3:P,getPageInfo:wl,getPageInfoByObjId:vm,getCurrentPageInfo:wm,getPDFVersion:y,Point:rc,Rectangle:Kd,Matrix:hr,hasHotfix:Vi},Object.defineProperty(m.internal.pageSize,"width",{get:function(){return jl(H)},set:function(L){_m(H,L)},enumerable:!0,configurable:!0}),Object.defineProperty(m.internal.pageSize,"height",{get:function(){return Jc(H)},set:function(L){Em(H,L)},enumerable:!0,configurable:!0}),(function(L){for(var se=0,je=tt.length;se<je;se++){var Re=Fp.call(this,L[se][0],L[se][1],L[se][2],tt[se][3],!0);h===!1&&(f[Re]=!0);var $e=L[se][0].split("-");Np({id:Re,fontName:$e[0],fontStyle:$e[1]||""})}Ds.publish("addFonts",{fonts:Vt,dictionary:cr})}).call(m,tt),Qe="F1",bm(a,r),Ds.publish("initialized"),m}gg.prototype.lsbFirstWord=function(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)},gg.prototype.toHexString=function(t){return t.split("").map(function(e){return("0"+(255&e.charCodeAt(0)).toString(16)).slice(-2)}).join("")},gg.prototype.hexToBytes=function(t){for(var e=[],r=0;r<t.length;r+=2)e.push(String.fromCharCode(parseInt(t.substr(r,2),16)));return e.join("")},gg.prototype.processOwnerPassword=function(t,e){return DS(AS(e).substr(0,5),t)},gg.prototype.encryptor=function(t,e){var r=AS(this.encryptionKey+String.fromCharCode(255&t,t>>8&255,t>>16&255,255&e,e>>8&255)).substr(0,10);return function(n){return DS(r,n)}},q1.prototype.equals=function(t){var e,r="id,objectNumber,equals";if(!t||Ys(t)!==Ys(this))return!1;var n=0;for(e in this)if(!(r.indexOf(e)>=0)){if(this.hasOwnProperty(e)&&!t.hasOwnProperty(e)||this[e]!==t[e])return!1;n++}for(e in t)t.hasOwnProperty(e)&&r.indexOf(e)<0&&n--;return n===0},Fr.API={events:[]},Fr.version="3.0.4";var qn=Fr.API,b_=1,wp=function(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},ng=function(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},Jr=function(t){return t.toFixed(2)},ph=function(t){return t.toFixed(5)};qn.__acroform__={};var zo=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},mD=function(t){return t*b_},lu=function(t){var e=new f7,r=fr.internal.getHeight(t)||0,n=fr.internal.getWidth(t)||0;return e.BBox=[0,0,Number(Jr(n)),Number(Jr(r))],e},hNe=qn.__acroform__.setBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to
1090jsPDF.API.__acroform__.setBit");return t|1<<e},mNe=qn.__acroform__.clearBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return t&~(1<<e)},fNe=qn.__acroform__.getBit=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return t&1<<e?1:0},ia=qn.__acroform__.getBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return fNe(t,e-1)},oa=qn.__acroform__.setBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return hNe(t,e-1)},la=qn.__acroform__.clearBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return mNe(t,e-1)},pNe=qn.__acroform__.calculateCoordinates=function(t,e){var r=e.internal.getHorizontalCoordinate,n=e.internal.getVerticalCoordinate,a=t[0],i=t[1],o=t[2],l=t[3],c={};return c.lowerLeft_X=r(a)||0,c.lowerLeft_Y=n(i+l)||0,c.upperRight_X=r(a+o)||0,c.upperRight_Y=n(i)||0,[Number(Jr(c.lowerLeft_X)),Number(Jr(c.lowerLeft_Y)),Number(Jr(c.upperRight_X)),Number(Jr(c.upperRight_Y))]},gNe=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e=[],r=t._V||t.DV,n=TS(t,r),a=t.scope.internal.getFont(t.fontName,t.fontStyle).id;e.push("/Tx BMC"),e.push("q"),e.push("BT"),e.push(t.scope.__private__.encodeColorString(t.color)),e.push("/"+a+" "+Jr(n.fontSize)+" Tf"),e.push("1 0 0 1 0 0 Tm"),e.push(n.text),e.push("ET"),e.push("Q"),e.push("EMC");var i=lu(t);return i.scope=t.scope,i.stream=e.join(` 1091`),i}},TS=function(t,e){var r=t.fontSize===0?t.maxFontSize:t.fontSize,n={text:"",fontSize:""},a=(e=(e=e.substr(0,1)=="("?e.substr(1):e).substr(e.length-1)==")"?e.substr(0,e.length-1):e).split(" ");a=t.multiline?a.map(function(M){return M.split(` 1092`)}):a.map(function(M){return[M]});var i=r,o=fr.internal.getHeight(t)||0;o=o<0?-o:o;var l=fr.internal.getWidth(t)||0;l=l<0?-l:l;var c=function(M,P,U){if(M+1<a.length){var I=P+" "+a[M+1][0];return kv(I,t,U).width<=l-4}return!1};i++;e:for(;i>0;){e="",i--;var u,d,h=kv("3",t,i).height,f=t.multiline?o-i:(o-h)/2,m=f+=2,g=0,y=0,b=0;if(i<=0){e=`(...) Tj 1093`,e+="% Width of Text: "+kv(e,t,i=12).width+", FieldWidth:"+l+` 1094`;break}for(var w="",j=0,N=0;N<a.length;N++)if(a.hasOwnProperty(N)){var S=!1;if(a[N].length!==1&&b!==a[N].length-1){if((h+2)*(j+2)+2>o)continue e;w+=a[N][b],S=!0,y=N,N--}else{w=(w+=a[N][b]+" ").substr(w.length-1)==" "?w.substr(0,w.length-1):w;var E=parseInt(N),C=c(E,w,i),T=N>=a.length-1;if(C&&!T){w+=" ",b=0;continue}if(C||T){if(T)y=E;else if(t.multiline&&(h+2)*(j+2)+2>o)continue e}else{if(!t.multiline||(h+2)*(j+2)+2>o)continue e;y=E}}for(var D="",A=g;A<=y;A++){var R=a[A];if(t.multiline){if(A===y){D+=R[b]+" ",b=(b+1)%R.length;continue}if(A===g){D+=R[R.length-1]+" ";continue}}D+=R[0]+" "}switch(D=D.substr(D.length-1)==" "?D.substr(0,D.length-1):D,d=kv(D,t,i).width,t.textAlign){case"right":u=l-d-2;break;case"center":u=(l-d)/2;break;default:u=2}e+=Jr(u)+" "+Jr(m)+` Td 1095`,e+="("+wp(D)+`) Tj 1096`,e+=-Jr(u)+` 0 Td 1097`,m=-(i+2),d=0,g=S?y:y+1,j++,w=""}break}return n.text=e,n.fontSize=i,n},kv=function(t,e,r){var n=e.scope.internal.getFont(e.fontName,e.fontStyle),a=e.scope.getStringUnitWidth(t,{font:n,fontSize:parseFloat(r),charSpace:0})*parseFloat(r);return{height:e.scope.getStringUnitWidth("3",{font:n,fontSize:parseFloat(r),charSpace:0})*parseFloat(r)*1.5,width:a}},xNe={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},yNe=function(t,e){var r={type:"reference",object:t};e.internal.getPageInfo(t.page).pageContext.annotations.find(function(n){return n.type===r.type&&n.object===r.object})===void 0&&e.internal.getPageInfo(t.page).pageContext.annotations.push(r)},bNe=function(t,e){if(e.scope=t,t.internal!==void 0&&(t.internal.acroformPlugin===void 0||t.internal.acroformPlugin.isInitialized===!1)){if($c.FieldNum=0,t.internal.acroformPlugin=JSON.parse(JSON.stringify(xNe)),t.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");b_=t.internal.scaleFactor,t.internal.acroformPlugin.acroFormDictionaryRoot=new p7,t.internal.acroformPlugin.acroFormDictionaryRoot.scope=t,t.internal.acroformPlugin.acroFormDictionaryRoot._eventID=t.internal.events.subscribe("postPutResources",function(){(function(r){r.internal.events.unsubscribe(r.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete r.internal.acroformPlugin.acroFormDictionaryRoot._eventID,r.internal.acroformPlugin.printedOut=!0})(t)}),t.internal.events.subscribe("buildDocument",function(){(function(r){r.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var n=r.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var a in n)if(n.hasOwnProperty(a)){var i=n[a];
vendor: 24,074 bytes, lines 1097-1109
1097i.objId=void 0,i.hasAnnotation&&yNe(i,r)}})(t)}),t.internal.events.subscribe("putCatalog",function(){(function(r){if(r.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");r.internal.write("/AcroForm "+r.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(t)}),t.internal.events.subscribe("postPutPages",function(r){(function(n,a){var i=!n;for(var o in n||(a.internal.newObjectDeferredBegin(a.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),a.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),n=n||a.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(n.hasOwnProperty(o)){var l=n[o],c=[],u=l.Rect;if(l.Rect&&(l.Rect=pNe(l.Rect,a)),a.internal.newObjectDeferredBegin(l.objId,!0),l.DA=fr.createDefaultAppearanceStream(l),Ys(l)==="object"&&typeof l.getKeyValueListForStream=="function"&&(c=l.getKeyValueListForStream()),l.Rect=u,l.hasAppearanceStream&&!l.appearanceStreamContent){var d=gNe(l);c.push({key:"AP",value:"<</N "+d+">>"}),a.internal.acroformPlugin.xForms.push(d)}if(l.appearanceStreamContent){var h="";for(var f in l.appearanceStreamContent)if(l.appearanceStreamContent.hasOwnProperty(f)){var m=l.appearanceStreamContent[f];if(h+="/"+f+" ",h+="<<",Object.keys(m).length>=1||Array.isArray(m)){for(var o in m)if(m.hasOwnProperty(o)){var g=m[o];typeof g=="function"&&(g=g.call(a,l)),h+="/"+o+" "+g+" ",a.internal.acroformPlugin.xForms.indexOf(g)>=0||a.internal.acroformPlugin.xForms.push(g)}}else typeof(g=m)=="function"&&(g=g.call(a,l)),h+="/"+o+" "+g,a.internal.acroformPlugin.xForms.indexOf(g)>=0||a.internal.acroformPlugin.xForms.push(g);h+=">>"}c.push({key:"AP",value:`<< 1098`+h+">>"})}a.internal.putStream({additionalKeyValues:c,objectId:l.objId}),a.internal.out("endobj")}i&&function(y,b){for(var w in y)if(y.hasOwnProperty(w)){var j=w,N=y[w];b.internal.newObjectDeferredBegin(N.objId,!0),Ys(N)==="object"&&typeof N.putStream=="function"&&N.putStream(),delete y[j]}}(a.internal.acroformPlugin.xForms,a)})(r,t)}),t.internal.acroformPlugin.isInitialized=!0}},m7=qn.__acroform__.arrayToPdfArray=function(t,e,r){var n=function(o){return o};if(Array.isArray(t)){for(var a="[",i=0;i<t.length;i++)switch(i!==0&&(a+=" "),Ys(t[i])){case"boolean":case"number":case"object":a+=t[i].toString();break;case"string":t[i].substr(0,1)!=="/"?(e!==void 0&&r&&(n=r.internal.getEncryptor(e)),a+="("+wp(n(t[i].toString()))+")"):a+=t[i].toString()}return a+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},vN=function(t,e,r){var n=function(a){return a};return e!==void 0&&r&&(n=r.internal.getEncryptor(e)),(t=t||"").toString(),"("+wp(n(t))+")"},gu=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(this._objId===void 0){if(this.scope===void 0)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(t){this._objId=t}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};gu.prototype.toString=function(){return this.objId+" 0 R"},gu.prototype.putStream=function(){var t=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:t,objectId:this.objId}),this.scope.internal.out("endobj")},gu.prototype.getKeyValueListForStream=function(){var t=[],e=Object.getOwnPropertyNames(this).filter(function(i){return i!="content"&&i!="appearanceStreamContent"&&i!="scope"&&i!="objId"&&i.substring(0,1)!="_"});for(var r in e)if(Object.getOwnPropertyDescriptor(this,e[r]).configurable===!1){var n=e[r],a=this[n];a&&(Array.isArray(a)?t.push({key:n,value:m7(a,this.objId,this.scope)}):a instanceof gu?(a.scope=this.scope,t.push({key:n,value:a.objId+" 0 R"})):typeof a!="function"&&t.push({key:n,value:a}))}return t};var f7=function(){gu.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var t,e=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return e},set:function(r){e=r}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(r){t=r.trim()},get:function(){return t||null}})};zo(f7,gu);var p7=function(){gu.call(this);var t,e=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return e.length>0?e:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return e}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(t){var r=function(n){return n};return this.scope&&(r=this.scope.internal.getEncryptor(this.objId)),"("+wp(r(t))+")"}},set:function(r){t=r}})};zo(p7,gu);var $c=function t(){gu.call(this);var e=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return e},set:function(w){if(isNaN(w))throw new Error('Invalid value "'+w+'" for attribute F supplied.');e=w}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!ia(e,3)},set:function(w){w?this.F=oa(e,3):this.F=la(e,3)}});var r=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return r},set:function(w){if(isNaN(w))throw new Error('Invalid value "'+w+'" for attribute Ff supplied.');r=w}});var n=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(n.length!==0)return n},set:function(w){n=w!==void 0?w:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[0])?0:n[0]},set:function(w){n[0]=w}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[1])?0:n[1]},set:function(w){n[1]=w}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[2])?0:n[2]},set:function(w){n[2]=w}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[3])?0:n[3]},set:function(w){n[3]=w}});var a="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return a},set:function(w){switch(w){case"/Btn":case"/Tx":case"/Ch":case"/Sig":a=w;break;default:throw new Error('Invalid value "'+w+'" for attribute FT supplied.')}}});var i=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!i||i.length<1){if(this instanceof G1)return;i="FieldObject"+t.FieldNum++}var w=function(j){return j};return this.scope&&(w=this.scope.internal.getEncryptor(this.objId)),"("+wp(w(i))+")"},set:function(w){i=w.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return i},set:function(w){i=w}});var o="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return o},set:function(w){o=w}});var l="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return l},set:function(w){l=w}});var c=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return c},set:function(w){c=w}});var u=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return u===void 0?50/b_:u},set:function(w){u=w}});var d="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return d},set:function(w){d=w}});var h="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!h||this instanceof G1||this instanceof Bf))return vN(h,this.objId,this.scope)},set:function(w){w=w.toString(),h=w}});var f=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(f)return this instanceof Xa==0?vN(f,this.objId,this.scope):f},set:function(w){w=w.toString(),f=this instanceof Xa==0?w.substr(0,1)==="("?ng(w.substr(1,w.length-2)):ng(w):w}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof Xa==1?ng(f.substr(1,f.length-1)):f},set:function(w){w=w.toString(),f=this instanceof Xa==1?"/"+w:w}});var m=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(m)return m},set:function(w){this.V=w}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(m)return this instanceof Xa==0?vN(m,this.objId,this.scope):m},set:function(w){w=w.toString(),m=this instanceof Xa==0?w.substr(0,1)==="("?ng(w.substr(1,w.length-2)):ng(w):w}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof Xa==1?ng(m.substr(1,m.length-1)):m},set:function(w){w=w.toString(),m=this instanceof Xa==1?"/"+w:w}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var g,y=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return y},set:function(w){w=!!w,y=w}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(g)return g},set:function(w){g=w}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!ia(this.Ff,1)},set:function(w){w?this.Ff=oa(this.Ff,1):this.Ff=la(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!ia(this.Ff,2)},set:function(w){w?this.Ff=oa(this.Ff,2):this.Ff=la(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!ia(this.Ff,3)},set:function(w){w?this.Ff=oa(this.Ff,3):this.Ff=la(this.Ff,3)}});var b=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(b!==null)return b},set:function(w){if([0,1,2].indexOf(w)===-1)throw new Error('Invalid value "'+w+'" for attribute Q supplied.');b=w}}),Object.defineProperty(this,"textAlign",{get:function(){var w;switch(b){case 0:default:w="left";break;case 1:w="center";break;case 2:w="right"}return w},configurable:!0,enumerable:!0,set:function(w){switch(w){case"right":case 2:b=2;break;case"center":case 1:b=1;break;default:b=0}}})};zo($c,gu);var _g=function(){$c.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var t=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return t},set:function(r){t=r}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return t},set:function(r){t=r}});var e=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return m7(e,this.objId,this.scope)},set:function(r){var n,a;a=[],typeof(n=r)=="string"&&(a=function(i,o,l){l||(l=1);for(var c,u=[];c=o.exec(i);)u.push(c[l]);return u}(n,/\((.*?)\)/g)),e=a}}),this.getOptions=function(){return e},this.setOptions=function(r){e=r,this.sort&&e.sort()},this.addOption=function(r){r=(r=r||"").toString(),e.push(r),this.sort&&e.sort()},this.removeOption=function(r,n){for(n=n||!1,r=(r=r||"").toString();e.indexOf(r)!==-1&&(e.splice(e.indexOf(r),1),n!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!ia(this.Ff,18)},set:function(r){r?this.Ff=oa(this.Ff,18):this.Ff=la(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!ia(this.Ff,19)},set:function(r){this.combo===!0&&(r?this.Ff=oa(this.Ff,19):this.Ff=la(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!ia(this.Ff,20)},set:function(r){r?(this.Ff=oa(this.Ff,20),e.sort()):this.Ff=la(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!ia(this.Ff,22)},set:function(r){r?this.Ff=oa(this.Ff,22):this.Ff=la(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!ia(this.Ff,23)},set:function(r){r?this.Ff=oa(this.Ff,23):this.Ff=la(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!ia(this.Ff,27)},set:function(r){r?this.Ff=oa(this.Ff,27):this.Ff=la(this.Ff,27)}}),this.hasAppearanceStream=!1};zo(_g,$c);var Eg=function(){_g.call(this),this.fontName="helvetica",this.combo=!1};zo(Eg,_g);var Ag=function(){Eg.call(this),this.combo=!0};zo(Ag,Eg);var Qv=function(){Ag.call(this),this.edit=!0};zo(Qv,Ag);var Xa=function(){$c.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!ia(this.Ff,15)},set:function(r){r?this.Ff=oa(this.Ff,15):this.Ff=la(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!ia(this.Ff,16)},set:function(r){r?this.Ff=oa(this.Ff,16):this.Ff=la(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!ia(this.Ff,17)},set:function(r){r?this.Ff=oa(this.Ff,17):this.Ff=la(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!ia(this.Ff,26)},set:function(r){r?this.Ff=oa(this.Ff,26):this.Ff=la(this.Ff,26)}});var t,e={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var r=function(i){return i};if(this.scope&&(r=this.scope.internal.getEncryptor(this.objId)),Object.keys(e).length!==0){var n,a=[];for(n in a.push("<<"),e)a.push("/"+n+" ("+wp(r(e[n]))+")");return a.push(">>"),a.join(` 1099`)}},set:function(r){Ys(r)==="object"&&(e=r)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return e.CA||""},set:function(r){typeof r=="string"&&(e.CA=r)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(r){t=r}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(r){t="/"+r}})};zo(Xa,$c);var e1=function(){Xa.call(this),this.pushButton=!0};zo(e1,Xa);var Dg=function(){Xa.call(this),this.radio=!0,this.pushButton=!1;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e!==void 0?e:[]}})};zo(Dg,Xa);var G1=function(){var t,e;$c.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return t},set:function(a){t=a}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return e},set:function(a){e=a}});var r,n={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var a=function(l){return l};this.scope&&(a=this.scope.internal.getEncryptor(this.objId));var i,o=[];for(i in o.push("<<"),n)o.push("/"+i+" ("+wp(a(n[i]))+")");return o.push(">>"),o.join(` 1100`)},set:function(a){Ys(a)==="object"&&(n=a)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return n.CA||""},set:function(a){typeof a=="string"&&(n.CA=a)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return r},set:function(a){r=a}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return r.substr(1,r.length-1)},set:function(a){r="/"+a}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=fr.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};zo(G1,$c),Dg.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t)||!("getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var r=this.Kids[e];r.appearanceStreamContent=t.createAppearanceStream(r.optionName),r.caption=t.getCA()}},Dg.prototype.createOption=function(t){var e=new G1;return e.Parent=this,e.optionName=t,this.Kids.push(e),vNe.call(this.scope,e),e};var t1=function(){Xa.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=fr.CheckBox.createAppearanceStream()};zo(t1,Xa);var Bf=function(){$c.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!ia(this.Ff,13)},set:function(e){e?this.Ff=oa(this.Ff,13):this.Ff=la(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!ia(this.Ff,21)},set:function(e){e?this.Ff=oa(this.Ff,21):this.Ff=la(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!ia(this.Ff,23)},set:function(e){e?this.Ff=oa(this.Ff,23):this.Ff=la(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!ia(this.Ff,24)},set:function(e){e?this.Ff=oa(this.Ff,24):this.Ff=la(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!ia(this.Ff,25)},set:function(e){e?this.Ff=oa(this.Ff,25):this.Ff=la(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!ia(this.Ff,26)},set:function(e){e?this.Ff=oa(this.Ff,26):this.Ff=la(this.Ff,26)}});var t=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){Number.isInteger(e)&&(t=e)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};zo(Bf,$c);var r1=function(){Bf.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!ia(this.Ff,14)},set:function(t){t?this.Ff=oa(this.Ff,14):this.Ff=la(this.Ff,14)}}),this.password=!0};zo(r1,Bf);var fr={CheckBox:{createAppearanceStream:function(){return{N:{On:fr.CheckBox.YesNormal},D:{On:fr.CheckBox.YesPushDown,Off:fr.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=lu(t);e.scope=t.scope;var r=[],n=t.scope.internal.getFont(t.fontName,t.fontStyle).id,a=t.scope.__private__.encodeColorString(t.color),i=TS(t,t.caption);return r.push("0.749023 g"),r.push("0 0 "+Jr(fr.internal.getWidth(t))+" "+Jr(fr.internal.getHeight(t))+" re"),r.push("f"),r.push("BMC"),r.push("q"),r.push("0 0 1 rg"),r.push("/"+n+" "+Jr(i.fontSize)+" Tf "+a),r.push("BT"),r.push(i.text),r.push("ET"),r.push("Q"),r.push("EMC"),e.stream=r.join(` 1101`),e},YesNormal:function(t){var e=lu(t);e.scope=t.scope;var r=t.scope.internal.getFont(t.fontName,t.fontStyle).id,n=t.scope.__private__.encodeColorString(t.color),a=[],i=fr.internal.getHeight(t),o=fr.internal.getWidth(t),l=TS(t,t.caption);return a.push("1 g"),a.push("0 0 "+Jr(o)+" "+Jr(i)+" re"),a.push("f"),a.push("q"),a.push("0 0 1 rg"),a.push("0 0 "+Jr(o-1)+" "+Jr(i-1)+" re"),a.push("W"),a.push("n"),a.push("0 g"),a.push("BT"),a.push("/"+r+" "+Jr(l.fontSize)+" Tf "+n),a.push(l.text),a.push("ET"),a.push("Q"),e.stream=a.join(` 1102`),e},OffPushDown:function(t){var e=lu(t);e.scope=t.scope;var r=[];return r.push("0.749023 g"),r.push("0 0 "+Jr(fr.internal.getWidth(t))+" "+Jr(fr.internal.getHeight(t))+" re"),r.push("f"),e.stream=r.join(` 1103`),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:fr.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=fr.RadioButton.Circle.YesNormal,e.D[t]=fr.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=lu(t);e.scope=t.scope;var r=[],n=fr.internal.getWidth(t)<=fr.internal.getHeight(t)?fr.internal.getWidth(t)/4:fr.internal.getHeight(t)/4;n=Number((.9*n).toFixed(5));var a=fr.internal.Bezier_C,i=Number((n*a).toFixed(5));return r.push("q"),r.push("1 0 0 1 "+ph(fr.internal.getWidth(t)/2)+" "+ph(fr.internal.getHeight(t)/2)+" cm"),r.push(n+" 0 m"),r.push(n+" "+i+" "+i+" "+n+" 0 "+n+" c"),r.push("-"+i+" "+n+" -"+n+" "+i+" -"+n+" 0 c"),r.push("-"+n+" -"+i+" -"+i+" -"+n+" 0 -"+n+" c"),r.push(i+" -"+n+" "+n+" -"+i+" "+n+" 0 c"),r.push("f"),r.push("Q"),e.stream=r.join(` 1104`),e},YesPushDown:function(t){var e=lu(t);e.scope=t.scope;var r=[],n=fr.internal.getWidth(t)<=fr.internal.getHeight(t)?fr.internal.getWidth(t)/4:fr.internal.getHeight(t)/4;n=Number((.9*n).toFixed(5));var a=Number((2*n).toFixed(5)),i=Number((a*fr.internal.Bezier_C).toFixed(5)),o=Number((n*fr.internal.Bezier_C).toFixed(5));return r.push("0.749023 g"),r.push("q"),r.push("1 0 0 1 "+ph(fr.internal.getWidth(t)/2)+" "+ph(fr.internal.getHeight(t)/2)+" cm"),r.push(a+" 0 m"),r.push(a+" "+i+" "+i+" "+a+" 0 "+a+" c"),r.push("-"+i+" "+a+" -"+a+" "+i+" -"+a+" 0 c"),r.push("-"+a+" -"+i+" -"+i+" -"+a+" 0 -"+a+" c"),r.push(i+" -"+a+" "+a+" -"+i+" "+a+" 0 c"),r.push("f"),r.push("Q"),r.push("0 g"),r.push("q"),r.push("1 0 0 1 "+ph(fr.internal.getWidth(t)/2)+" "+ph(fr.internal.getHeight(t)/2)+" cm"),r.push(n+" 0 m"),r.push(n+" "+o+" "+o+" "+n+" 0 "+n+" c"),r.push("-"+o+" "+n+" -"+n+" "+o+" -"+n+" 0 c"),r.push("-"+n+" -"+o+" -"+o+" -"+n+" 0 -"+n+" c"),r.push(o+" -"+n+" "+n+" -"+o+" "+n+" 0 c"),r.push("f"),r.push("Q"),e.stream=r.join(` 1105`),e},OffPushDown:function(t){var e=lu(t);e.scope=t.scope;var r=[],n=fr.internal.getWidth(t)<=fr.internal.getHeight(t)?fr.internal.getWidth(t)/4:fr.internal.getHeight(t)/4;n=Number((.9*n).toFixed(5));var a=Number((2*n).toFixed(5)),i=Number((a*fr.internal.Bezier_C).toFixed(5));return r.push("0.749023 g"),r.push("q"),r.push("1 0 0 1 "+ph(fr.internal.getWidth(t)/2)+" "+ph(fr.internal.getHeight(t)/2)+" cm"),r.push(a+" 0 m"),r.push(a+" "+i+" "+i+" "+a+" 0 "+a+" c"),r.push("-"+i+" "+a+" -"+a+" "+i+" -"+a+" 0 c"),r.push("-"+a+" -"+i+" -"+i+" -"+a+" 0 -"+a+" c"),r.push(i+" -"+a+" "+a+" -"+i+" "+a+" 0 c"),r.push("f"),r.push("Q"),e.stream=r.join(` 1106`),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:fr.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=fr.RadioButton.Cross.YesNormal,e.D[t]=fr.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=lu(t);e.scope=t.scope;var r=[],n=fr.internal.calculateCross(t);return r.push("q"),r.push("1 1 "+Jr(fr.internal.getWidth(t)-2)+" "+Jr(fr.internal.getHeight(t)-2)+" re"),r.push("W"),r.push("n"),r.push(Jr(n.x1.x)+" "+Jr(n.x1.y)+" m"),r.push(Jr(n.x2.x)+" "+Jr(n.x2.y)+" l"),r.push(Jr(n.x4.x)+" "+Jr(n.x4.y)+" m"),r.push(Jr(n.x3.x)+" "+Jr(n.x3.y)+" l"),r.push("s"),r.push("Q"),e.stream=r.join(` 1107`),e},YesPushDown:function(t){var e=lu(t);e.scope=t.scope;var r=fr.internal.calculateCross(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+Jr(fr.internal.getWidth(t))+" "+Jr(fr.internal.getHeight(t))+" re"),n.push("f"),n.push("q"),n.push("1 1 "+Jr(fr.internal.getWidth(t)-2)+" "+Jr(fr.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(Jr(r.x1.x)+" "+Jr(r.x1.y)+" m"),n.push(Jr(r.x2.x)+" "+Jr(r.x2.y)+" l"),n.push(Jr(r.x4.x)+" "+Jr(r.x4.y)+" m"),n.push(Jr(r.x3.x)+" "+Jr(r.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join(` 1108`),e},OffPushDown:function(t){var e=lu(t);e.scope=t.scope;var r=[];return r.push("0.749023 g"),r.push("0 0 "+Jr(fr.internal.getWidth(t))+" "+Jr(fr.internal.getHeight(t))+" re"),r.push("f"),e.stream=r.join(` 1109`),e}}},createDefaultAppearanceStream:function(t){var e=t.scope.internal.getFont(t.fontName,t.fontStyle).id,r=t.scope.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+r}};fr.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=fr.internal.getWidth(t),r=fr.internal.getHeight(t),n=Math.min(e,r);return{x1:{x:(e-n)/2,y:(r-n)/2+n},x2:{x:(e-n)/2+n,y:(r-n)/2},x3:{x:(e-n)/2,y:(r-n)/2},x4:{x:(e-n)/2+n,y:(r-n)/2+n}}}},fr.internal.getWidth=function(t){var e=0;return Ys(t)==="object"&&(e=mD(t.Rect[2])),e},fr.internal.getHeight=function(t){var e=0;return Ys(t)==="object"&&(e=mD(t.Rect[3])),e};var vNe=qn.addField=function(t){if(bNe(this,t),!(t instanceof $c))throw new Error("Invalid argument passed to
1109jsPDF.addField.");var e;return(e=t).scope.internal.acroformPlugin.printedOut&&(e.scope.internal.acroformPlugin.printedOut=!1,e.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),e.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(e),t.page=t.scope.internal.getCurrentPageInfo().pageNumber,this};qn.AcroFormChoiceField=_g,qn.AcroFormListBox=Eg,qn.AcroFormComboBox=Ag,qn.AcroFormEditBox=Qv,qn.AcroFormButton=Xa,qn.AcroFormPushButton=e1,qn.AcroFormRadioButton=Dg,qn.AcroFormCheckBox=t1,qn.AcroFormTextField=Bf,qn.AcroFormPasswordField=r1,qn.AcroFormAppearance=fr,qn.AcroForm={ChoiceField:_g,ListBox:Eg,ComboBox:Ag,EditBox:Qv,Button:Xa,PushButton:e1,RadioButton:Dg,CheckBox:t1,TextField:Bf,PasswordField:r1,Appearance:fr},Fr.AcroForm={ChoiceField:_g,ListBox:Eg,ComboBox:Ag,EditBox:Qv,Button:Xa,PushButton:e1,RadioButton:Dg,CheckBox:t1,TextField:Bf,PasswordField:r1,Appearance:fr};Fr.AcroForm;function g7(t){return t.reduce(function(e,r,n){return e[r]=n,e},{})}(function(t){var e="addImage_";t.__addimage__={};var r="UNKNOWN",n={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},a=t.__addimage__.getImageFileTypeByImageData=function(M,P){var U,I,O,V,G,B=r;if((P=P||r)==="RGBA"||M.data!==void 0&&M.data instanceof Uint8ClampedArray&&"height"in M&&"width"in M)return"RGBA";if(C(M))for(G in n)for(O=n[G],U=0;U<O.length;U+=1){for(V=!0,I=0;I<O[U].length;I+=1)if(O[U][I]!==void 0&&O[U][I]!==M[I]){V=!1;break}if(V===!0){B=G;break}}else for(G in n)for(O=n[G],U=0;U<O.length;U+=1){for(V=!0,I=0;I<O[U].length;I+=1)if(O[U][I]!==void 0&&O[U][I]!==M.charCodeAt(I)){V=!1;break}if(V===!0){B=G;break}}return B===r&&P!==r&&(B=P),B},i=function M(P){for(var U=this.internal.write,I=this.internal.putStream,O=(0,this.internal.getFilters)();O.indexOf("FlateEncode")!==-1;)O.splice(O.indexOf("FlateEncode"),1);P.objectId=this.internal.newObject();var V=[];if(V.push({key:"Type",value:"/XObject"}),V.push({key:"Subtype",value:"/Image"}),V.push({key:"Width",value:P.width}),V.push({key:"Height",value:P.height}),P.colorSpace===w.INDEXED?V.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(P.palette.length/3-1)+" "+("sMask"in P&&P.sMask!==void 0?P.objectId+2:P.objectId+1)+" 0 R]"}):(V.push({key:"ColorSpace",value:"/"+P.colorSpace}),P.colorSpace===w.DEVICE_CMYK&&V.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),V.push({key:"BitsPerComponent",value:P.bitsPerComponent}),"decodeParameters"in P&&P.decodeParameters!==void 0&&V.push({key:"DecodeParms",value:"<<"+P.decodeParameters+">>"}),"transparency"in P&&Array.isArray(P.transparency)&&P.transparency.length>0){for(var G="",B=0,$=P.transparency.length;B<$;B++)G+=P.transparency[B]+" "+P.transparency[B]+" ";V.push({key:"Mask",value:"["+G+"]"})}P.sMask!==void 0&&V.push({key:"SMask",value:P.objectId+1+" 0 R"});var W=P.filter!==void 0?["/"+P.filter]:void 0;if(I({data:P.data,additionalKeyValues:V,alreadyAppliedFilters:W,objectId:P.objectId}),U("endobj"),"sMask"in P&&P.sMask!==void 0){var oe,K=(oe=P.sMaskBitsPerComponent)!==null&&oe!==void 0?oe:P.bitsPerComponent,H={width:P.width,height:P.height,colorSpace:"DeviceGray",bitsPerComponent:K,data:P.sMask};"filter"in P&&(H.decodeParameters="/Predictor ".concat(P.predictor," /Colors 1 /BitsPerComponent ").concat(K," /Columns ").concat(P.width),H.filter=P.filter),M.call(this,H)}if(P.colorSpace===w.INDEXED){var X=this.internal.newObject();I({data:D(new Uint8Array(P.palette)),objectId:X}
vendor: 4,928 bytes, line 1109
1109),U("endobj")}},o=function(){var M=this.internal.collections[e+"images"];for(var P in M)i.call(this,M[P])},l=function(){var M,P=this.internal.collections[e+"images"],U=this.internal.write;for(var I in P)U("/I"+(M=P[I]).index,M.objectId,"0","R")},c=function(){this.internal.collections[e+"images"]||(this.internal.collections[e+"images"]={},this.internal.events.subscribe("putResources",o),this.internal.events.subscribe("putXobjectDict",l))},u=function(){var M=this.internal.collections[e+"images"];return c.call(this),M},d=function(){return Object.keys(this.internal.collections[e+"images"]).length},h=function(M){return typeof t["process"+M.toUpperCase()]=="function"},f=function(M){return Ys(M)==="object"&&M.nodeType===1},m=function(M,P){if(M.nodeName==="IMG"&&M.hasAttribute("src")){var U=""+M.getAttribute("src");if(U.indexOf("data:image/")===0)return Xv(unescape(U).split("base64,").pop());var I=t.loadFile(U,!0);if(I!==void 0)return I}if(M.nodeName==="CANVAS"){if(M.width===0||M.height===0)throw new Error("Given canvas must have data. Canvas width: "+M.width+", height: "+M.height);var O;switch(P){case"PNG":O="image/png";break;case"WEBP":O="image/webp";break;default:O="image/jpeg"}return Xv(M.toDataURL(O,1).split("base64,").pop())}},g=function(M){var P=this.internal.collections[e+"images"];if(P){for(var U in P)if(M===P[U].alias)return P[U]}},y=function(M,P,U){return M||P||(M=-96,P=-96),M<0&&(M=-1*U.width*72/M/this.internal.scaleFactor),P<0&&(P=-1*U.height*72/P/this.internal.scaleFactor),M===0&&(M=P*U.width/U.height),P===0&&(P=M*U.height/U.width),[M,P]},b=function(M,P,U,I,O,V){var G=y.call(this,U,I,O),B=this.internal.getCoordinateString,$=this.internal.getVerticalCoordinateString,W=u.call(this);if(U=G[0],I=G[1],W[O.index]=O,V){V*=Math.PI/180;var oe=Math.cos(V),K=Math.sin(V),H=function(me){return me.toFixed(4)},X=[H(oe),H(K),H(-1*K),H(oe),0,0,"cm"]}this.internal.write("q"),V?(this.internal.write([1,"0","0",1,B(M),$(P+I),"cm"].join(" ")),this.internal.write(X.join(" ")),this.internal.write([B(U),"0","0",B(I),"0","0","cm"].join(" "))):this.internal.write([B(U),"0","0",B(I),B(M),$(P+I),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+O.index+" Do"),this.internal.write("Q")},w=t.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};t.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var j=t.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},N=t.__addimage__.sHashCode=function(M){var P,U,I=0;if(typeof M=="string")for(U=M.length,P=0;P<U;P++)I=(I<<5)-I+M.charCodeAt(P),I|=0;else if(C(M))for(U=M.byteLength/2,P=0;P<U;P++)I=(I<<5)-I+M[P],I|=0;return I},S=t.__addimage__.validateStringAsBase64=function(M){(M=M||"").toString().trim();var P=!0;return M.length===0&&(P=!1),M.length%4!=0&&(P=!1),/^[A-Za-z0-9+/]+$/.test(M.substr(0,M.length-2))===!1&&(P=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(M.substr(-2))===!1&&(P=!1),P},E=t.__addimage__.extractImageFromDataUrl=function(M){if(M==null||!(M=M.trim()).startsWith("data:"))return null;var P=M.indexOf(",");return P<0?null:M.substring(0,P).trim().endsWith("base64")?M.substring(P+1):null};t.__addimage__.isArrayBuffer=function(M){return M instanceof ArrayBuffer};var C=t.__addimage__.isArrayBufferView=function(M){return M instanceof Int8Array||M instanceof Uint8Array||M instanceof Uint8ClampedArray||M instanceof Int16Array||M instanceof Uint16Array||M instanceof Int32Array||M instanceof Uint32Array||M instanceof Float32Array||M instanceof Float64Array},T=t.__addimage__.binaryStringToUint8Array=function(M){for(var P=M.length,U=new Uint8Array(P),I=0;I<P;I++)U[I]=M.charCodeAt(I);return U},D=t.__addimage__.arrayBufferToBinaryString=function(M){for(var P="",U=C(M)?M:new Uint8Array(M),I=0;I<U.length;I+=8192)P+=String.fromCharCode.apply(null,U.subarray(I,I+8192));return P};t.addImage=function(){var M,P,U,I,O,V,G,B,$;if(typeof arguments[1]=="number"?(P=r,U=arguments[1],I=arguments[2],O=arguments[3],V=arguments[4],G=arguments[5],B=arguments[6],$=arguments[7]):(P=arguments[1],U=arguments[2],I=arguments[3],O=arguments[4],V=arguments[5],G=arguments[6],B=arguments[7],$=arguments[8]),Ys(M=arguments[0])==="object"&&!f(M)&&"imageData"in M){var W=M;M=W.imageData,P=W.format||P||r,U=W.x||U||0,I=W.y||I||0,O=W.w||W.width||O,V=W.h||W.height||V,G=W.alias||G,B=W.compression||B,$=W.rotation||W.angle||$}var oe=this.internal.getFilters();if(B===void 0&&oe.indexOf("FlateEncode")!==-1&&(B="SLOW"),isNaN(U)||isNaN(I))throw new Error("Invalid coordinates passed to
1109jsPDF.addImage");c.call(this);var K=A.call(this,M,P,G,B);return b.call(this,U,I,O,V,K,$),this};var A=function(M,P,U,I){var O,V,G;if(typeof M=="string"&&a(M)===r){M=unescape(M);var B=R(M,!1);(B!==""||(B=t.loadFile(M,!0))!==void 0)&&(M=B)}if(f(M)&&(M=m(M,P)),P=a(M,P),!h(P))throw new Error("addImage does not support files of type '"+P+"', please ensure that a plugin for '"+P+"' support is added.");if(((G=U)==null||G.length===0)&&(U=function($){return typeof $=="string"||C($)?N($):C($.data)?N($.data):null}(M)),(O=g.call(this,U))||(M instanceof Uint8Array||P==="RGBA"||(V=M,M=T(M)),O=this["process"+P.toUpperCase()](M,d.call(this),U,function($){return $&&typeof $=="string"&&($=$.toUpperCase()),$ in t.image_compression?$:j.NONE}(I),V)),!O)throw new Error("An unknown error occurred whilst processing the image.");return O},R=t.__addimage__.convertBase64ToBinaryString=function(M,P){P=typeof P!="boolean"||P;var U,I="";if(typeof M=="string"){var O;U=(O=E(M))!==null&&O!==void 0?O:M;try{I=Xv(U)}catch(V){if(P)throw S(U)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+V.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return I};t.getImageProperties=function(M){var P,U,I="";if(f(M)&&(M=m(M)),typeof M=="string"&&a(M)===r&&((I=R(M,!1))===""&&(I=t.loadFile(M)||""),M=I),U=a(M),!h(U))throw new Error("addImage does not support files of type '"+U+"', please ensure that a plugin for '"+U+"' support is added.");if(M instanceof Uint8Array||(M=T(M)),!(P=this["process"+U.toUpperCase()](M)))throw new Error("An unknown error occurred whilst processing the image");return P.fileType=U,P}})(Fr.API),function(t){var e=function(r){if(r!==void 0&&r!="")return!0};Fr.API.events.push(["addPage",function(r){this.internal.getPageInfo(r.pageNumber).pageContext.annotations=[]}]),t.events.push(["putPage",function(r){for(var n,a,i,o=this.internal.getCoordinateString,l=this.internal.getVerticalCoordinateString,c=this.internal.getPageInfoByObjId(r.objId),u=r.pageContext.annotations,d=!1,h=0;h<u.length&&!d;h++)switch((n=u[h]).type){case"link":(e(n.options.url)||e(n.options.pageNumber))&&(d=!0);break;case"reference":case"text":case"freetext":d=!0}if(d!=0){this.internal.write("/Annots [");for(var f=0;f<u.length;f++){n=u[f];var m=this.internal.pdfEscape,g=this.internal.getEncryptor(r.objId);switch(n.type){case"reference":this.internal.write(" "+n.object.objId+" 0 R ");break;case"text":var y=this.internal.newAdditionalObject(),b=this.internal.newAdditionalObject(),w=this.internal.getEncryptor(y.objId),j=n.title||"Note";i="<</Type /Annot /Subtype /Text "+(a="/Rect ["+o(n.bounds.x)+" "+l(n.bounds.y+n.bounds.h)+" "+o(n.bounds.x+n.bounds.w)+" "+l(n.bounds.y)+"] ")+"/Contents ("+m(w(n.contents))+")",i+=" /Popup "+b.objId+" 0 R",i+=" /P "+c.objId+" 0 R",i+=" /T ("+m(w(j))+") >>",y.content=i;var N=y.objId+" 0 R";i="<</Type /Annot /Subtype /Popup "+(a="/Rect ["+o(n.bounds.x+30)+" "+l(n.bounds.y+n.bounds.h)+" "+o(n.bounds.x+n.bounds.w+30)+" "+l(n.bounds.y)+"] ")+" /Parent "+N,n.open&&(i+=" /Open true"),i+=" >>",b.content=i,this.internal.write(y.objId,"0 R",b.objId,"0 R");break;case"freetext":a="/Rect ["+o(n.bounds.x)+" "+l(n.bounds.y)+" "+o(n.bounds.x+n.bounds.w)+" "+l(n.bounds.y+n.bounds.h)+"] ";var S=n.color||"#000000";i="<</Type /Annot /Subtype /FreeText "+a+"/Contents ("+m(g(n.contents))+")",i+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+S+")",i+=" /Border [0 0 0]",i+=" >>",this.internal.write(i);break;case"link":if(n.options.name){var E=this.annotations._nameMap[n.options.name];n.options.pageNumber=E.page,n.options.top=E.y}else n.options.top||(n.options.top=0);if(a="/Rect ["+n.finalBounds.x+" "+n.finalBounds.y+" "+n.finalBounds.w+" "+n.finalBounds.h+"] ",i="",n.options.url)i="<</Type /Annot /Subtype /Link "+a+"/Border [0 0 0] /A <</S /URI /URI ("+m(g(n.options.url))+") >>";else if(n.options.pageNumber)switch(i="<</Type /Annot /Subtype /Link "+a+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(n.options.pageNumber).objId+" 0 R",n.options.magFactor=n.options.magFactor||"XYZ",n.options.magFactor){case"Fit":i+=" /Fit]";break;case"FitH":i+=" /FitH "+n.options.top+"]";break;case"FitV":n.options.left=n.options.left||0,i+=" /FitV "+n.options.left+"]";break;default:var C=l(n.options.top);n.options.left=n.options.left||0,n.options.zoom===void 0&&(n.options.zoom=0),i+=" /XYZ "+n.options.left+" "+C+" "+n.options.zoom+"]"}i!=""&&(i+=" >>",this.internal.write(i))}}this.internal.write("]")}}]),t.createAnnotation=function(r){var n=this.internal.getCurrentPageInfo();
vendor: 22,273 bytes, lines 1109-1133
1109switch(r.type){case"link":this.link(r.bounds.x,r.bounds.y,r.bounds.w,r.bounds.h,r);break;case"text":case"freetext":n.pageContext.annotations.push(r)}},t.link=function(r,n,a,i,o){var l=this.internal.getCurrentPageInfo(),c=this.internal.getCoordinateString,u=this.internal.getVerticalCoordinateString;l.pageContext.annotations.push({finalBounds:{x:c(r),y:u(n),w:c(r+a),h:u(n+i)},options:o,type:"link"})},t.textWithLink=function(r,n,a,i){var o,l,c=this.getTextWidth(r),u=this.internal.getLineHeight()/this.internal.scaleFactor;if(i.maxWidth!==void 0){l=i.maxWidth;var d=this.splitTextToSize(r,l).length;o=Math.ceil(u*d)}else l=c,o=u;return this.text(r,n,a,i),a+=.2*u,i.align==="center"&&(n-=c/2),i.align==="right"&&(n-=c),this.link(n,a-u,l,o,i),c},t.getTextWidth=function(r){var n=this.internal.getFontSize();return this.getStringUnitWidth(r)*n/this.internal.scaleFactor}}(Fr.API),function(t){var e={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},r={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},n={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},a=[1570,1571,1573,1575];t.__arabicParser__={};var i=t.__arabicParser__.isInArabicSubstitutionA=function(y){return e[y.charCodeAt(0)]!==void 0},o=t.__arabicParser__.isArabicLetter=function(y){return typeof y=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(y)},l=t.__arabicParser__.isArabicEndLetter=function(y){return o(y)&&i(y)&&e[y.charCodeAt(0)].length<=2},c=t.__arabicParser__.isArabicAlfLetter=function(y){return o(y)&&a.indexOf(y.charCodeAt(0))>=0};t.__arabicParser__.arabicLetterHasIsolatedForm=function(y){return o(y)&&i(y)&&e[y.charCodeAt(0)].length>=1};var u=t.__arabicParser__.arabicLetterHasFinalForm=function(y){return o(y)&&i(y)&&e[y.charCodeAt(0)].length>=2};t.__arabicParser__.arabicLetterHasInitialForm=function(y){return o(y)&&i(y)&&e[y.charCodeAt(0)].length>=3};var d=t.__arabicParser__.arabicLetterHasMedialForm=function(y){return o(y)&&i(y)&&e[y.charCodeAt(0)].length==4},h=t.__arabicParser__.resolveLigatures=function(y){var b=0,w=r,j="",N=0;for(b=0;b<y.length;b+=1)w[y.charCodeAt(b)]!==void 0?(N++,typeof(w=w[y.charCodeAt(b)])=="number"&&(j+=String.fromCharCode(w),w=r,N=0),b===y.length-1&&(w=r,j+=y.charAt(b-(N-1)),b-=N-1,N=0)):(w=r,j+=y.charAt(b-N),b-=N,N=0);return j};t.__arabicParser__.isArabicDiacritic=function(y){return y!==void 0&&n[y.charCodeAt(0)]!==void 0};var f=t.__arabicParser__.getCorrectForm=function(y,b,w){return o(y)?i(y)===!1?-1:!u(y)||!o(b)&&!o(w)||!o(w)&&l(b)||l(y)&&!o(b)||l(y)&&c(b)||l(y)&&l(b)?0:d(y)&&o(b)&&!l(b)&&o(w)&&u(w)?3:l(y)||!o(w)?1:2:-1},m=function(y){var b=0,w=0,j=0,N="",S="",E="",C=(y=y||"").split("\\s+"),T=[];for(b=0;b<C.length;b+=1){for(T.push(""),w=0;w<C[b].length;w+=1)N=C[b][w],S=C[b][w-1],E=C[b][w+1],o(N)?(j=f(N,S,E),T[b]+=j!==-1?String.fromCharCode(e[N.charCodeAt(0)][j]):N):T[b]+=N;T[b]=h(T[b])}return T.join(" ")},g=t.__arabicParser__.processArabic=t.processArabic=function(){var y,b=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,w=[];if(Array.isArray(b)){var j=0;for(w=[],j=0;j<b.length;j+=1)Array.isArray(b[j])?w.push([m(b[j][0]),b[j][1],b[j][2]]):w.push([m(b[j])]);y=w}else y=m(b);return typeof arguments[0]=="string"?y:(arguments[0].text=y,arguments[0])};t.events.push(["preProcessText",g])}(Fr.API),Fr.API.autoPrint=function(t){var e;return(t=t||{}).variant=t.variant||"non-conform",t.variant==="javascript"?this.addJS("print({});"):(this.internal.events.subscribe("postPutResources",function(){e=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R")})),this},function(t){var e=function(){var r=void 0;Object.defineProperty(this,"pdf",{get:function(){return r},set:function(l){r=l}});var n=150;Object.defineProperty(this,"width",{get:function(){return n},set:function(l){n=isNaN(l)||Number.isInteger(l)===!1||l<0?150:l,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=n+1)}});var a=300;Object.defineProperty(this,"height",{get:function(){return a},set:function(l){a=isNaN(l)||Number.isInteger(l)===!1||l<0?300:l,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=a+1)}});var i=[];Object.defineProperty(this,"childNodes",{get:function(){return i},set:function(l){i=l}});var o={};Object.defineProperty(this,"style",{get:function(){return o},set:function(l){o=l}}),Object.defineProperty(this,"parentNode",{})};e.prototype.getContext=function(r,n){var a;if((r=r||"2d")!=="2d")return null;for(a in n)this.pdf.context2d.hasOwnProperty(a)&&(this.pdf.context2d[a]=n[a]);return this.pdf.context2d._canvas=this,this.pdf.context2d},e.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},t.events.push(["initialized",function(){this.canvas=new e,this.canvas.pdf=this}])}(Fr.API),function(t){var e={left:0,top:0,bottom:0,right:0},r=!1,n=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},e),this.internal.__cell__.margins.width=this.getPageWidth(),a.call(this))},a=function(){this.internal.__cell__.lastCell=new i,this.internal.__cell__.pages=1},i=function(){var c=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return c},set:function(y){c=y}});var u=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return u},set:function(y){u=y}});var d=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return d},set:function(y){d=y}});var h=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return h},set:function(y){h=y}});var f=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return f},set:function(y){f=y}});var m=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return m},set:function(y){m=y}});var g=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return g},set:function(y){g=y}}),this};i.prototype.clone=function(){return new i(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},i.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},t.setHeaderFunction=function(c){return n.call(this),this.internal.__cell__.headerFunction=typeof c=="function"?c:void 0,this},t.getTextDimensions=function(c,u){n.call(this);var d=(u=u||{}).fontSize||this.getFontSize(),h=u.font||this.getFont(),f=u.scaleFactor||this.internal.scaleFactor,m=0,g=0,y=0,b=this;if(!Array.isArray(c)&&typeof c!="string"){if(typeof c!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");c=String(c)}var w=u.maxWidth;w>0?typeof c=="string"?c=this.splitTextToSize(c,w):Object.prototype.toString.call(c)==="[object Array]"&&(c=c.reduce(function(N,S){return N.concat(b.splitTextToSize(S,w))},[])):c=Array.isArray(c)?c:[c];for(var j=0;j<c.length;j++)m<(y=this.getStringUnitWidth(c[j],{font:h})*d)&&(m=y);return m!==0&&(g=c.length),{w:m/=f,h:Math.max((g*d*this.getLineHeightFactor()-d*(this.getLineHeightFactor()-1))/f,0)}},t.cellAddPage=function(){n.call(this),this.addPage();var c=this.internal.__cell__.margins||e;return this.internal.__cell__.lastCell=new i(c.left,c.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var o=t.cell=function(){var c;c=arguments[0]instanceof i?arguments[0]:new i(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]),n.call(this);var u=this.internal.__cell__.lastCell,d=this.internal.__cell__.padding,h=this.internal.__cell__.margins||e,f=this.internal.__cell__.tableHeaderRow,m=this.internal.__cell__.printHeaders;return u.lineNumber!==void 0&&(u.lineNumber===c.lineNumber?(c.x=(u.x||0)+(u.width||0),c.y=u.y||0):u.y+u.height+c.height+h.bottom>this.getPageHeight()?(this.cellAddPage(),c.y=h.top,m&&f&&(this.printHeaderRow(c.lineNumber,!0),c.y+=f[0].height)):c.y=u.y+u.height||c.y),c.text[0]!==void 0&&(this.rect(c.x,c.y,c.width,c.height,r===!0?"FD":void 0),c.align==="right"?this.text(c.text,c.x+c.width-d,c.y+d,{align:"right",baseline:"top"}):c.align==="center"?this.text(c.text,c.x+c.width/2,c.y+d,{align:"center",baseline:"top",maxWidth:c.width-d-d}):this.text(c.text,c.x+d,c.y+d,{align:"left",baseline:"top",maxWidth:c.width-d-d})),this.internal.__cell__.lastCell=c,this};t.table=function(c,u,d,h,f){if(n.call(this),!d)throw new Error("No data for PDF table.");var m,g,y,b,w=[],j=[],N=[],S={},E={},C=[],T=[],D=(f=f||{}).autoSize||!1,A=f.printHeaders!==!1,R=f.css&&f.css["font-size"]!==void 0?16*f.css["font-size"]:f.fontSize||12,M=f.margins||Object.assign({width:this.getPageWidth()},e),P=typeof f.padding=="number"?f.padding:3,U=f.headerBackgroundColor||"#c8c8c8",I=f.headerTextColor||"#000";if(a.call(this),this.internal.__cell__.printHeaders=A,this.internal.__cell__.margins=M,this.internal.__cell__.table_font_size=R,this.internal.__cell__.padding=P,this.internal.__cell__.headerBackgroundColor=U,this.internal.__cell__.headerTextColor=I,this.setFontSize(R),h==null)j=w=Object.keys(d[0]),N=w.map(function(){return"left"});else if(Array.isArray(h)&&Ys(h[0])==="object")for(w=h.map(function(W){return W.name}),j=h.map(function(W){return W.prompt||W.name||""}),N=h.map(function(W){return W.align||"left"}),m=0;m<h.length;m+=1)E[h[m].name]=.7499990551181103*h[m].width;else Array.isArray(h)&&typeof h[0]=="string"&&(j=w=h,N=w.map(function(){return"left"}));if(D||Array.isArray(h)&&typeof h[0]=="string")for(m=0;m<w.length;m+=1){for(S[b=w[m]]=d.map(function(W){return W[b]}),this.setFont(void 0,"bold"),C.push(this.getTextDimensions(j[m],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),g=S[b],this.setFont(void 0,"normal"),y=0;y<g.length;y+=1)C.push(this.getTextDimensions(g[y],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);E[b]=Math.max.apply(null,C)+P+P,C=[]}if(A){var O={};for(m=0;m<w.length;m+=1)O[w[m]]={},O[w[m]].text=j[m],O[w[m]].align=N[m];var V=l.call(this,O,E);T=w.map(function(W){return new i(c,u,E[W],V,O[W].text,void 0,O[W].align)}),this.setTableHeaderRow(T),this.printHeaderRow(1,!1)}var G=h.reduce(function(W,oe){return W[oe.name]=oe.align,W},{});for(m=0;m<d.length;m+=1){"rowStart"in f&&f.rowStart instanceof Function&&f.rowStart({row:m,data:d[m]},this);var B=l.call(this,d[m],E);for(y=0;y<w.length;y+=1){var $=d[m][w[y]];"cellStart"in f&&f.cellStart instanceof Function&&f.cellStart({row:m,col:y,data:$},this),o.call(this,new i(c,u,E[w[y]],B,$,m+2,G[w[y]]))}}return this.internal.__cell__.table_x=c,this.internal.__cell__.table_y=u,this};var l=function(c,u){var d=this.internal.__cell__.padding,h=this.internal.__cell__.table_font_size,f=this.internal.scaleFactor;return Object.keys(c).map(function(m){var g=c[m];return this.splitTextToSize(g.hasOwnProperty("text")?g.text:g,u[m]-d-d)},this).map(function(m){return this.getLineHeightFactor()*m.length*h/f+d+d},this).reduce(function(m,g){return Math.max(m,g)},0)};t.setTableHeaderRow=function(c){n.call(this),this.internal.__cell__.tableHeaderRow=c},t.printHeaderRow=function(c,u){if(n.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var d;if(r=!0,typeof this.internal.__cell__.headerFunction=="function"){var h=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new i(h[0],h[1],h[2],h[3],void 0,-1)}this.setFont(void 0,"bold");for(var f=[],m=0;m<this.internal.__cell__.tableHeaderRow.length;m+=1){d=this.internal.__cell__.tableHeaderRow[m].clone(),u&&(d.y=this.internal.__cell__.margins.top||0,f.push(d)),d.lineNumber=c;var g=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),o.call(this,d),this.setTextColor(g)}f.length>0&&this.setTableHeaderRow(f),this.setFont(void 0,"normal"),r=!1}}(Fr.API);var x7={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},y7=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],MS=g7(y7),b7=[100,200,300,400,500,600,700,800,900],wNe=g7(b7);function wN(t){var e=t.family.replace(/"|'/g,"").toLowerCase(),r=function(i){return x7[i=i||"normal"]?i:"normal"}(t.style),n=function(i){return i?typeof i=="number"?i>=100&&i<=900&&i%100==0?i:400:/^\d00$/.test(i)?parseInt(i):i==="bold"?700:400:400}(t.weight),a=function(i){return typeof MS[i=i||"normal"]=="number"?i:"normal"}(t.stretch);return{family:e,style:r,weight:n,stretch:a,src:t.src||[],ref:t.ref||{name:e,style:[a,r,n].join(" ")}}}function fD(t,e,r,n){var a;for(a=r;a>=0&&a<e.length;a+=n)if(t[e[a]])return t[e[a]];for(a=r;a>=0&&a<e.length;a-=n)if(t[e[a]])return t[e[a]]}var jNe={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},pD={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function gD(t){return[t.stretch,t.style,t.weight,t.family].join(" ")}function xD(t){return t.trimLeft()}function NNe(t,e){for(var r=0;r<t.length;){if(t.charAt(r)===e)return[t.substring(0,r),t.substring(r+1)];r+=1}return null}function FNe(t){var e=t.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return e===null?null:[e[0],t.substring(e[0].length)]}var _v,yD,bD,ag,Ev,vD,wD,jD,jN=["times"];function ND(t,e,r,n,a){var i=4,o=SD;switch(a){case Fr.API.image_compression.FAST:i=1,o=FD;break;case Fr.API.image_compression.MEDIUM:i=6,o=CD;break;case Fr.API.image_compression.SLOW:i=9,o=kD}t=function(c,u,d,h){for(var f,m=c.length/u,g=new Uint8Array(c.length+m),y=[SNe,FD,SD,CD,kD],b=0;b<m;b+=1){var w=b*u,j=c.subarray(w,w+u);if(h)g.set(h(j,d,f),w+b);else{for(var N=y.length,S=[],E=0;E<N;E+=1)S[E]=y[E](j,d,f);var C=kNe(S.concat());g.set(S[C],w+b)}f=j}return g}(t,e,Math.ceil(r*n/8),o);var l=CS(t,{level:i});return Fr.API.__addimage__.arrayBufferToBinaryString(l)}function SNe(t){var e=Array.apply([],t);return e.unshift(0),e}function FD(t,e){var r=t.length,n=[];n[0]=1;for(var a=0;a<r;a+=1){var i=t[a-e]||0;n[a+1]=t[a]-i+256&255}return n}function SD(t,e,r){var n=t.length,a=[];a[0]=2;for(var i=0;i<n;i+=1){var o=r&&r[i]||0;a[i+1]=t[i]-o+256&255}return a}function CD(t,e,r){var n=t.length,a=[];a[0]=3;for(var i=0;i<n;i+=1){var o=t[i-e]||0,l=r&&r[i]||0;a[i+1]=t[i]+256-(o+l>>>1)&255}return a}function kD(t,e,r){var n=t.length,a=[];a[0]=4;for(var i=0;i<n;i+=1){var o=CNe(t[i-e]||0,r&&r[i]||0,r&&r[i-e]||0);a[i+1]=t[i]-o+256&255}return a}function CNe(t,e,r){if(t===e&&e===r)return t;var n=Math.abs(e-r),a=Math.abs(t-r),i=Math.abs(t+e-r-r);return n<=a&&n<=i?t:a<=i?e:r}function kNe(t){var e=t.map(function(r){return r.reduce(function(n,a){return n+Math.abs(a)},0)});return e.indexOf(Math.min.apply(null,e))}function NN(t,e,r){var n=e*r,a=Math.floor(n/8),i=16-(n-8*a+r),o=(1<<r)-1;return v7(t,a)>>i&o}function _D(t,e,r,n){var a=r*n,i=Math.floor(a/8),o=16-(a-8*i+n),l=(1<<n)-1,c=(e&l)<<o;(function(u,d,h){if(d+1<u.byteLength)u.setUint16(d,h,!1);else{var f=h>>8&255;u.setUint8(d,f)}})(t,i,v7(t,i)&~(l<<o)&65535|c)}function v7(t,e){return e+1<t.byteLength?t.getUint16(e,!1):t.getUint8(e)<<8}function _Ne(t){var e=0;if(t[e++]!==71||t[e++]!==73||t[e++]!==70||t[e++]!==56||(t[e++]+1&253)!=56||t[e++]!==97)throw new Error("Invalid GIF 87a/89a header.");var r=t[e++]|t[e++]<<8,n=t[e++]|t[e++]<<8,a=t[e++],i=a>>7,o=1<<1+(7&a);t[e++],t[e++];var l=null,c=null;i&&(l=e,c=o,e+=3*o);var u=!0,d=[],h=0,f=null,m=0,g=null;for(this.width=r,this.height=n;u&&e<t.length;)switch(t[e++]){case 33:switch(t[e++]){case 255:if(t[e]!==11||t[e+1]==78&&t[e+2]==69&&t[e+3]==84&&t[e+4]==83&&t[e+5]==67&&t[e+6]==65&&t[e+7]==80&&t[e+8]==69&&t[e+9]==50&&t[e+10]==46&&t[e+11]==48&&t[e+12]==3&&t[e+13]==1&&t[e+16]==0)e+=14,g=t[e++]|t[e++]<<8,e++;else for(e+=12;;){if(!((M=t[e++])>=0))throw Error("Invalid block size");if(M===0)break;e+=M}break;case 249:if(t[e++]!==4||t[e+4]!==0)throw new Error("Invalid graphics extension block.");var y=t[e++];h=t[e++]|t[e++]<<8,f=t[e++],1&y||(f=null),m=y>>2&7,e++;break;case 254:for(;;){if(!((M=t[e++])>=0))throw Error("Invalid block size");if(M===0)break;e+=M}break;default:throw new Error("Unknown graphic control label: 0x"+t[e-1].toString(16))}break;case 44:var b=t[e++]|t[e++]<<8,w=t[e++]|t[e++]<<8,j=t[e++]|t[e++]<<8,N=t[e++]|t[e++]<<8,S=t[e++],E=S>>6&1,C=1<<1+(7&S),T=l,D=c,A=!1;S>>7&&(A=!0,T=e,D=C,e+=3*C);var R=e;for(e++;;){var M;if(!((M=t[e++])>=0))throw Error("Invalid block size");if(M===0)break;e+=M}d.push({x:b,y:w,width:j,height:N,has_local_palette:A,palette_offset:T,palette_size:D,data_offset:R,data_length:e-R,transparent_index:f,interlaced:!!E,delay:h,disposal:m});break;case 59:u=!1;break;default:throw new Error("Unknown gif block: 0x"+t[e-1].toString(16))}this.numFrames=function(){return d.length},this.loopCount=function(){return g},this.frameInfo=function(P){if(P<0||P>=d.length)throw new Error("Frame index out of range.");return d[P]},this.decodeAndBlitFrameBGRA=function(P,U){var I=this.frameInfo(P),O=I.width*I.height,V=new Uint8Array(O);ED(t,I.data_offset,V,O);var G=I.palette_offset,B=I.transparent_index;B===null&&(B=256);var $=I.width,W=r-$,oe=$,K=4*(I.y*r+I.x),H=4*((I.y+I.height)*r+I.x),X=K,me=4*W;I.interlaced===!0&&(me+=4*r*7);for(var ie=8,ee=0,he=V.length;ee<he;++ee){var ve=V[ee];if(oe===0&&(oe=$,(X+=me)>=H&&(me=4*W+4*r*(ie-1),X=K+($+W)*(ie<<1),ie>>=1)),ve===B)X+=4;else{var Ce=t[G+3*ve],re=t[G+3*ve+1],we=t[G+3*ve+2];U[X++]=we,U[X++]=re,U[X++]=Ce,U[X++]=255}--oe}},this.decodeAndBlitFrameRGBA=function(P,U){var I=this.frameInfo(P),O=I.width*I.height,V=new Uint8Array(O);ED(t,I.data_offset,V,O);var G=I.palette_offset,B=I.transparent_index;B===null&&(B=256);var $=I.width,W=r-$,oe=$,K=4*(I.y*r+I.x),H=4*((I.y+I.height)*r+I.x),X=K,me=4*W;I.interlaced===!0&&(me+=4*r*7);for(var ie=8,ee=0,he=V.length;ee<he;++ee){var ve=V[ee];if(oe===0&&(oe=$,(X+=me)>=H&&(me=4*W+4*r*(ie-1),X=K+($+W)*(ie<<1),ie>>=1)),ve===B)X+=4;else{var Ce=t[G+3*ve],re=t[G+3*ve+1],we=t[G+3*ve+2];U[X++]=Ce,U[X++]=re,U[X++]=we,U[X++]=255}--oe}}}function ED(t,e,r,n){for(var a=t[e++],i=1<<a,o=i+1,l=o+1,c=a+1,u=(1<<c)-1,d=0,h=0,f=0,m=t[e++],g=new Int32Array(4096),y=null;;){for(;d<16&&m!==0;)h|=t[e++]<<d,d+=8,m===1?m=t[e++]:--m;if(d<c)break;var b=h&u;if(h>>=c,d-=c,b!==i){if(b===o)break;for(var w=b<l?b:y,j=0,N=w;N>i;)N=g[N]>>8,++j;var S=N;if(f+j+(w!==b?1:0)>n)return void on.log("Warning, gif stream longer than expected.");r[f++]=S;var E=f+=j;for(w!==b&&(r[f++]=S),N=w;j--;)N=g[N],r[--E]=255&N,N>>=8;y!==null&&l<4096&&(g[l++]=y<<8|S,l>=u+1&&c<12&&(++c,u=u<<1|1)),y=b}else l=o+1,u=(1<<(c=a+1))-1,y=null}return f!==n&&on.log("Warning, gif stream shorter than expected."),r}/** 1110 * @license 1111 Copyright (c) 2008, Adobe Systems Incorporated 1112 All rights reserved. 1113 1114 Redistribution and use in source and binary forms, with or without 1115 modification, are permitted provided that the following conditions are 1116 met: 1117 1118 * Redistributions of source code must retain the above copyright notice, 1119 this list of conditions and the following disclaimer. 1120 1121 * Redistributions in binary form must reproduce the above copyright 1122 notice, this list of conditions and the following disclaimer in the 1123 documentation and/or other materials provided with the distribution. 1124 1125 * Neither the name of Adobe Systems Incorporated nor the names of its 1126 contributors may be used to endorse or promote products derived from 1127 this software without specific prior written permission. 1128 1129 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 1130 IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 1131 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 1132 PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 1133 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
vendor: 5,845 bytes, lines 1134-1140
1134 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 1135 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 1136 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 1137 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 1138 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 1139 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1140*/function FN(t){var e,r,n,a,i,o=Math.floor,l=new Array(64),c=new Array(64),u=new Array(64),d=new Array(64),h=new Array(65535),f=new Array(65535),m=new Array(64),g=new Array(64),y=[],b=0,w=7,j=new Array(64),N=new Array(64),S=new Array(64),E=new Array(256),C=new Array(2048),T=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],D=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],A=[0,1,2,3,4,5,6,7,8,9,10,11],R=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],M=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],P=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],U=[0,1,2,3,4,5,6,7,8,9,10,11],I=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],O=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function V(K,H){for(var X=0,me=0,ie=new Array,ee=1;ee<=16;ee++){for(var he=1;he<=K[ee];he++)ie[H[me]]=[],ie[H[me]][0]=X,ie[H[me]][1]=ee,me++,X++;X*=2}return ie}function G(K){for(var H=K[0],X=K[1]-1;X>=0;)H&1<<X&&(b|=1<<w),X--,--w<0&&(b==255?(B(255),B(0)):B(b),w=7,b=0)}function B(K){y.push(K)}function $(K){B(K>>8&255),B(255&K)}function W(K,H,X,me,ie){for(var ee,he=ie[0],ve=ie[240],Ce=function(Xe,Ft){var ce,fe,ge,Ge,Je,be,Pe,qe,Qe,We,dt=0;for(Qe=0;Qe<8;++Qe){ce=Xe[dt],fe=Xe[dt+1],ge=Xe[dt+2],Ge=Xe[dt+3],Je=Xe[dt+4],be=Xe[dt+5],Pe=Xe[dt+6];var Bt=ce+(qe=Xe[dt+7]),Lt=ce-qe,Vt=fe+Pe,cr=fe-Pe,wr=ge+be,Xt=ge-be,pt=Ge+Je,ir=Ge-Je,jr=Bt+pt,rs=Bt-pt,zr=Vt+wr,xr=Vt-wr;Xe[dt]=jr+zr,Xe[dt+4]=jr-zr;var Ds=.707106781*(xr+rs);Xe[dt+2]=rs+Ds,Xe[dt+6]=rs-Ds;var Er=.382683433*((jr=ir+Xt)-(xr=cr+Lt)),Ur=.5411961*jr+Er,ws=1.306562965*xr+Er,wn=.707106781*(zr=Xt+cr),hr=Lt+wn,ga=Lt-wn;Xe[dt+5]=ga+Ur,Xe[dt+3]=ga-Ur,Xe[dt+1]=hr+ws,Xe[dt+7]=hr-ws,dt+=8}for(dt=0,Qe=0;Qe<8;++Qe){ce=Xe[dt],fe=Xe[dt+8],ge=Xe[dt+16],Ge=Xe[dt+24],Je=Xe[dt+32],be=Xe[dt+40],Pe=Xe[dt+48];var Jn=ce+(qe=Xe[dt+56]),dn=ce-qe,gn=fe+Pe,jn=fe-Pe,xa=ge+be,_a=ge-be,Au=Ge+Je,Gc=Ge-Je,Uo=Jn+Au,xl=Jn-Au,Ho=gn+xa,po=gn-xa;Xe[dt]=Uo+Ho,Xe[dt+32]=Uo-Ho;var go=.707106781*(po+xl);Xe[dt+16]=xl+go,Xe[dt+48]=xl-go;var Du=.382683433*((Uo=Gc+_a)-(po=jn+dn)),yl=.5411961*Uo+Du,Tu=1.306562965*po+Du,Od=.707106781*(Ho=_a+jn),zd=dn+Od,Ql=dn-Od;Xe[dt+40]=Ql+yl,Xe[dt+24]=Ql-yl,Xe[dt+8]=zd+Tu,Xe[dt+56]=zd-Tu,dt++}for(Qe=0;Qe<64;++Qe)We=Xe[Qe]*Ft[Qe],m[Qe]=We>0?We+.5|0:We-.5|0;return m}(K,H),re=0;re<64;++re)g[T[re]]=Ce[re];var we=g[0]-X;X=g[0],we==0?G(me[0]):(G(me[f[ee=32767+we]]),G(h[ee]));for(var Ee=63;Ee>0&&g[Ee]==0;)Ee--;if(Ee==0)return G(he),X;for(var Me,ae=1;ae<=Ee;){for(var ze=ae;g[ae]==0&&ae<=Ee;)++ae;var mt=ae-ze;if(mt>=16){Me=mt>>4;for(var tt=1;tt<=Me;++tt)G(ve);mt&=15}ee=32767+g[ae],G(ie[(mt<<4)+f[ee]]),G(h[ee]),ae++}return Ee!=63&&G(he),X}function oe(K){K=Math.min(Math.max(K,1),100),i!=K&&(function(H){for(var X=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],me=0;me<64;me++){var ie=o((X[me]*H+50)/100);ie=Math.min(Math.max(ie,1),255),l[T[me]]=ie}for(var ee=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],he=0;he<64;he++){var ve=o((ee[he]*H+50)/100);ve=Math.min(Math.max(ve,1),255),c[T[he]]=ve}for(var Ce=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],re=0,we=0;we<8;we++)for(var Ee=0;Ee<8;Ee++)u[re]=1/(l[T[re]]*Ce[we]*Ce[Ee]*8),d[re]=1/(c[T[re]]*Ce[we]*Ce[Ee]*8),re++}(K<50?Math.floor(5e3/K):Math.floor(200-2*K)),i=K)}this.encode=function(K,H){H&&oe(H),y=new Array,b=0,w=7,$(65496),$(65504),$(16),B(74),B(70),B(73),B(70),B(0),B(1),B(1),B(0),$(1),$(1),B(0),B(0),function(){$(65499),$(132),B(0);for(var fe=0;fe<64;fe++)B(l[fe]);B(1);for(var ge=0;ge<64;ge++)B(c[ge])}(),function(fe,ge){$(65472),$(17),B(8),$(ge),$(fe),B(3),B(1),B(17),B(0),B(2),B(17),B(1),B(3),B(17),B(1)}(K.width,K.height),function(){$(65476),$(418),B(0);for(var fe=0;fe<16;fe++)B(D[fe+1]);for(var ge=0;ge<=11;ge++)B(A[ge]);B(16);for(var Ge=0;Ge<16;Ge++)B(R[Ge+1]);for(var Je=0;Je<=161;Je++)B(M[Je]);B(1);for(var be=0;be<16;be++)B(P[be+1]);for(var Pe=0;Pe<=11;Pe++)B(U[Pe]);B(17);for(var qe=0;qe<16;qe++)B(I[qe+1]);for(var Qe=0;Qe<=161;Qe++)B(O[Qe])}(),$(65498),$(12),B(3),B(1),B(0),B(2),B(17),B(3),B(17),B(0),B(63),B(0);var X=0,me=0,ie=0;
vendor: 48,505 bytes, lines 1140-1146
1140b=0,w=7,this.encode.displayName="_encode_";for(var ee,he,ve,Ce,re,we,Ee,Me,ae,ze=K.data,mt=K.width,tt=K.height,Xe=4*mt,Ft=0;Ft<tt;){for(ee=0;ee<Xe;){for(re=Xe*Ft+ee,Ee=-1,Me=0,ae=0;ae<64;ae++)we=re+(Me=ae>>3)*Xe+(Ee=4*(7&ae)),Ft+Me>=tt&&(we-=Xe*(Ft+1+Me-tt)),ee+Ee>=Xe&&(we-=ee+Ee-Xe+4),he=ze[we++],ve=ze[we++],Ce=ze[we++],j[ae]=(C[he]+C[ve+256|0]+C[Ce+512|0]>>16)-128,N[ae]=(C[he+768|0]+C[ve+1024|0]+C[Ce+1280|0]>>16)-128,S[ae]=(C[he+1280|0]+C[ve+1536|0]+C[Ce+1792|0]>>16)-128;X=W(j,u,X,e,n),me=W(N,d,me,r,a),ie=W(S,d,ie,r,a),ee+=32}Ft+=8}if(w>=0){var ce=[];ce[1]=w+1,ce[0]=(1<<w+1)-1,G(ce)}return $(65497),new Uint8Array(y)},t=t||50,function(){for(var K=String.fromCharCode,H=0;H<256;H++)E[H]=K(H)}(),e=V(D,A),r=V(P,U),n=V(R,M),a=V(I,O),function(){for(var K=1,H=2,X=1;X<=15;X++){for(var me=K;me<H;me++)f[32767+me]=X,h[32767+me]=[],h[32767+me][1]=X,h[32767+me][0]=me;for(var ie=-(H-1);ie<=-K;ie++)f[32767+ie]=X,h[32767+ie]=[],h[32767+ie][1]=X,h[32767+ie][0]=H-1+ie;K<<=1,H<<=1}}(),function(){for(var K=0;K<256;K++)C[K]=19595*K,C[K+256|0]=38470*K,C[K+512|0]=7471*K+32768,C[K+768|0]=-11059*K,C[K+1024|0]=-21709*K,C[K+1280|0]=32768*K+8421375,C[K+1536|0]=-27439*K,C[K+1792|0]=-5329*K}(),oe(t)}/** 1141 * @license 1142 * Copyright (c) 2017 Aras Abbasi 1143 * 1144 * Licensed under the MIT License. 1145 * http://opensource.org/licenses/mit-license 1146 */function Cc(t,e){if(this.pos=0,this.buffer=t,this.datav=new DataView(t.buffer),this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function AD(t){function e(A){if(!A)throw Error("assert :P")}function r(A,R,M){for(var P=0;4>P;P++)if(A[R+P]!=M.charCodeAt(P))return!0;return!1}function n(A,R,M,P,U){for(var I=0;I<U;I++)A[R+I]=M[P+I]}function a(A,R,M,P){for(var U=0;U<P;U++)A[R+U]=M}function i(A){return new Int32Array(A)}function o(A,R){for(var M=[],P=0;P<A;P++)M.push(new R);return M}function l(A,R){var M=[];return function P(U,I,O){for(var V=O[I],G=0;G<V&&(U.push(O.length>I+1?[]:new R),!(O.length<I+1));G++)P(U[G],I+1,O)}(M,0,A),M}var c=function(){var A=this;function R(F,_){for(var z=1<<_-1>>>0;F&z;)z>>>=1;return z?(F&z-1)+z:F}function M(F,_,z,J,ne){e(!(J%z));do F[_+(J-=z)]=ne;while(0<J)}function P(F,_,z,J,ne){if(e(2328>=ne),512>=ne)var le=i(512);else if((le=i(ne))==null)return 0;return function(ue,pe,ye,Se,Ie,Ze){var Fe,He,Ke=pe,nt=1<<ye,Ye=i(16),at=i(16);for(e(Ie!=0),e(Se!=null),e(ue!=null),e(0<ye),He=0;He<Ie;++He){if(15<Se[He])return 0;++Ye[Se[He]]}if(Ye[0]==Ie)return 0;for(at[1]=0,Fe=1;15>Fe;++Fe){if(Ye[Fe]>1<<Fe)return 0;at[Fe+1]=at[Fe]+Ye[Fe]}for(He=0;He<Ie;++He)Fe=Se[He],0<Se[He]&&(Ze[at[Fe]++]=He);if(at[15]==1)return(Se=new U).g=0,Se.value=Ze[0],M(ue,Ke,1,nt,Se),nt;var lt,jt=-1,bt=nt-1,lr=0,or=1,Lr=1,Qt=1<<ye;for(He=0,Fe=1,Ie=2;Fe<=ye;++Fe,Ie<<=1){if(or+=Lr<<=1,0>(Lr-=Ye[Fe]))return 0;for(;0<Ye[Fe];--Ye[Fe])(Se=new U).g=Fe,Se.value=Ze[He++],M(ue,Ke+lr,Ie,Qt,Se),lr=R(lr,Fe)}for(Fe=ye+1,Ie=2;15>=Fe;++Fe,Ie<<=1){if(or+=Lr<<=1,0>(Lr-=Ye[Fe]))return 0;for(;0<Ye[Fe];--Ye[Fe]){if(Se=new U,(lr&bt)!=jt){for(Ke+=Qt,lt=1<<(jt=Fe)-ye;15>jt&&!(0>=(lt-=Ye[jt]));)++jt,lt<<=1;nt+=Qt=1<<(lt=jt-ye),ue[pe+(jt=lr&bt)].g=lt+ye,ue[pe+jt].value=Ke-pe-jt}Se.g=Fe-ye,Se.value=Ze[He++],M(ue,Ke+(lr>>ye),Ie,Qt,Se),lr=R(lr,Fe)}}return or!=2*at[15]-1?0:nt}(F,_,z,J,ne,le)}function U(){this.value=this.g=0}function I(){this.value=this.g=0}function O(){this.G=o(5,U),this.H=i(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=o(Ou,I)}function V(F,_,z,J){e(F!=null),e(_!=null),e(2147483648>J),F.Ca=254,F.I=0,F.b=-8,F.Ka=0,F.oa=_,F.pa=z,F.Jd=_,F.Yc=z+J,F.Zc=4<=J?z+J-4+1:z,he(F)}function G(F,_){for(var z=0;0<_--;)z|=Ce(F,128)<<_;return z}function B(F,_){var z=G(F,_);return ve(F)?-z:z}function $(F,_,z,J){var ne,le=0;for(e(F!=null),e(_!=null),e(4294967288>J),F.Sb=J,F.Ra=0,F.u=0,F.h=0,4<J&&(J=4),ne=0;ne<J;++ne)le+=_[z+ne]<<8*ne;F.Ra=le,F.bb=J,F.oa=_,F.pa=z}function W(F){for(;8<=F.u&&F.bb<F.Sb;)F.Ra>>>=8,F.Ra+=F.oa[F.pa+F.bb]<<Zc-8>>>0,++F.bb,F.u-=8;me(F)&&(F.h=1,F.u=0)}function oe(F,_){if(e(0<=_),!F.h&&_<=Ji){var z=X(F)&ya[_];return F.u+=_,W(F),z}return F.h=1,F.u=0}function K(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function H(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function X(F){return F.Ra>>>(F.u&Zc-1)>>>0}function me(F){return e(F.bb<=F.Sb),F.h||F.bb==F.Sb&&F.u>Zc}function ie(F,_){F.u=_,F.h=me(F)}function ee(F){F.u>=Ko&&(e(F.u>=Ko),W(F))}function he(F){e(F!=null&&F.oa!=null),F.pa<F.Zc?(F.I=(F.oa[F.pa++]|F.I<<8)>>>0,F.b+=8):(e(F!=null&&F.oa!=null),F.pa<F.Yc?(F.b+=8,F.I=F.oa[F.pa++]|F.I<<8):F.Ka?F.b=0:(F.I<<=8,F.b+=8,F.Ka=1))}function ve(F){return G(F,1)}function Ce(F,_){var z=F.Ca;0>F.b&&he(F);var J=F.b,ne=z*_>>>8,le=(F.I>>>J>ne)+0;for(le?(z-=ne,F.I-=ne+1<<J>>>0):z=ne+1,J=z,ne=0;256<=J;)ne+=8,J>>=8;return J=7^ne+uc[J],F.b-=J,F.Ca=(z<<J)-1,le}function re(F,_,z){F[_+0]=z>>24&255,F[_+1]=z>>16&255,F[_+2]=z>>8&255,F[_+3]=255&z}function we(F,_){return F[_+0]|F[_+1]<<8}function Ee(F,_){return we(F,_)|F[_+2]<<16}function Me(F,_){return we(F,_)|we(F,_+2)<<16}function ae(F,_){var z=1<<_;return e(F!=null),e(0<_),F.X=i(z),F.X==null?0:(F.Mb=32-_,F.Xa=_,1)}function ze(F,_){e(F!=null),e(_!=null),e(F.Xa==_.Xa),n(_.X,0,F.X,0,1<<_.Xa)}function mt(){this.X=[],this.Xa=this.Mb=0}function tt(F,_,z,J){e(z!=null),e(J!=null);var ne=z[0],le=J[0];return ne==0&&(ne=(F*le+_/2)/_),le==0&&(le=(_*ne+F/2)/F),0>=ne||0>=le?0:(z[0]=ne,J[0]=le,1)}function Xe(F,_){return F+(1<<_)-1>>>_}function Ft(F,_){return((4278255360&F)+(4278255360&_)>>>0&4278255360)+((16711935&F)+(16711935&_)>>>0&16711935)>>>0}function ce(F,_){A[_]=function(z,J,ne,le,ue,pe,ye){var Se;for(Se=0;Se<ue;++Se){var Ie=A[F](pe[ye+Se-1],ne,le+Se);pe[ye+Se]=Ft(z[J+Se],Ie)}}}function fe(){this.ud=this.hd=this.jd=0}function ge(F,_){return((4278124286&(F^_))>>>1)+(F&_)>>>0}function Ge(F){return 0<=F&&256>F?F:0>F?0:255<F?255:void 0}function Je(F,_){return Ge(F+(F-_+.5>>1))}function be(F,_,z){return Math.abs(_-z)-Math.abs(F-z)}function Pe(F,_,z,J,ne,le,ue){for(J=le[ue-1],z=0;z<ne;++z)le[ue+z]=J=Ft(F[_+z],J)}function qe(F,_,z,J,ne){var le;for(le=0;le<z;++le){var ue=F[_+le],pe=ue>>8&255,ye=16711935&(ye=(ye=16711935&ue)+((pe<<16)+pe));J[ne+le]=(4278255360&ue)+ye>>>0}}function Qe(F,_){_.jd=255&F,_.hd=F>>8&255,_.ud=F>>16&255}function We(F,_,z,J,ne,le){var ue;for(ue=0;ue<J;++ue){var pe=_[z+ue],ye=pe>>>8,Se=pe,Ie=255&(Ie=(Ie=pe>>>16)+((F.jd<<24>>24)*(ye<<24>>24)>>>5));Se=255&(Se=(Se+=(F.hd<<24>>24)*(ye<<24>>24)>>>5)+((F.ud<<24>>24)*(Ie<<24>>24)>>>5)),ne[le+ue]=(4278255360&pe)+(Ie<<16)+Se}}function dt(F,_,z,J,ne){A[_]=function(le,ue,pe,ye,Se,Ie,Ze,Fe,He){for(ye=Ze;ye<Fe;++ye)for(Ze=0;Ze<He;++Ze)Se[Ie++]=ne(pe[J(le[ue++])])},A[F]=function(le,ue,pe,ye,Se,Ie,Ze){var Fe=8>>le.b,He=le.Ea,Ke=le.K[0],nt=le.w;if(8>Fe)for(le=(1<<le.b)-1,nt=(1<<Fe)-1;ue<pe;++ue){var Ye,at=0;for(Ye=0;Ye<He;++Ye)Ye&le||(at=J(ye[Se++])),Ie[Ze++]=ne(Ke[at&nt]),at>>=Fe}else A["VP8LMapColor"+z](ye,Se,Ke,nt,Ie,Ze,ue,pe,He)}}function Bt(F,_,z,J,ne){for(z=_+z;_<z;){var le=F[_++];J[ne++]=le>>16&255,J[ne++]=le>>8&255,J[ne++]=255&le}}function Lt(F,_,z,J,ne){for(z=_+z;_<z;){var le=F[_++];J[ne++]=le>>16&255,J[ne++]=le>>8&255,J[ne++]=255&le,J[ne++]=le>>24&255}}function Vt(F,_,z,J,ne){for(z=_+z;_<z;){var le=(ue=F[_++])>>16&240|ue>>12&15,ue=240&ue|ue>>28&15;J[ne++]=le,J[ne++]=ue}}function cr(F,_,z,J,ne){for(z=_+z;_<z;){var le=(ue=F[_++])>>16&248|ue>>13&7,ue=ue>>5&224|ue>>3&31;J[ne++]=le,J[ne++]=ue}}function wr(F,_,z,J,ne){for(z=_+z;_<z;){var le=F[_++];J[ne++]=255&le,J[ne++]=le>>8&255,J[ne++]=le>>16&255}}function Xt(F,_,z,J,ne,le){if(le==0)for(z=_+z;_<z;)re(J,((le=F[_++])[0]>>24|le[1]>>8&65280|le[2]<<8&16711680|le[3]<<24)>>>0),ne+=32;else n(J,ne,F,_,z)}function pt(F,_){A[_][0]=A[F+"0"],A[_][1]=A[F+"1"],A[_][2]=A[F+"2"],A[_][3]=A[F+"3"],A[_][4]=A[F+"4"],A[_][5]=A[F+"5"],A[_][6]=A[F+"6"],A[_][7]=A[F+"7"],A[_][8]=A[F+"8"],A[_][9]=A[F+"9"],A[_][10]=A[F+"10"],A[_][11]=A[F+"11"],A[_][12]=A[F+"12"],A[_][13]=A[F+"13"],A[_][14]=A[F+"0"],A[_][15]=A[F+"0"]}function ir(F){return F==th||F==rh||F==sh||F==Qx}function jr(){this.eb=[],this.size=this.A=this.fb=0}function rs(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function zr(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new jr,this.f.kb=new rs,this.sd=null}function xr(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function Ds(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function Er(F){return alert("todo:WebPSamplerProcessPlane"),F.T}function Ur(F,_){var z=F.T,J=_.ba.f.RGBA,ne=J.eb,le=J.fb+F.ka*J.A,ue=Yi[_.ba.S],pe=F.y,ye=F.O,Se=F.f,Ie=F.N,Ze=F.ea,Fe=F.W,He=_.cc,Ke=_.dc,nt=_.Mc,Ye=_.Nc,at=F.ka,lt=F.ka+F.T,jt=F.U,bt=jt+1>>1;for(at==0?ue(pe,ye,null,null,Se,Ie,Ze,Fe,Se,Ie,Ze,Fe,ne,le,null,null,jt):(ue(_.ec,_.fc,pe,ye,He,Ke,nt,Ye,Se,Ie,Ze,Fe,ne,le-J.A,ne,le,jt),++z);at+2<lt;at+=2)He=Se,Ke=Ie,nt=Ze,Ye=Fe,Ie+=F.Rc,Fe+=F.Rc,le+=2*J.A,ue(pe,(ye+=2*F.fa)-F.fa,pe,ye,He,Ke,nt,Ye,Se,Ie,Ze,Fe,ne,le-J.A,ne,le,jt);return ye+=F.fa,F.j+lt<F.o?(n(_.ec,_.fc,pe,ye,jt),n(_.cc,_.dc,Se,Ie,bt),n(_.Mc,_.Nc,Ze,Fe,bt),z--):1<||ue(pe,ye,null,null,Se,Ie,Ze,Fe,Se,Ie,Ze,Fe,ne,le+J.A,null,null,jt),z}function ws(F,_,z){var J=F.F,ne=[F.J];if(J!=null){var le=F.U,ue=_.ba.S,pe=ue==Pp||ue==sh;_=_.ba.f.RGBA;var ye=[0],Se=F.ka;ye[0]=F.T,F.Kb&&(Se==0?--ye[0]:(--Se,ne[0]-=F.width),F.j+F.ka+F.T==F.o&&(ye[0]=F.o-F.j-Se));var Ie=_.eb;Se=_.fb+Se*_.A,F=fb(J,ne[0],F.width,le,ye,Ie,Se+(pe?0:3),_.A),e(z==ye),F&&ir(ue)&&Qd(Ie,Se,pe,le,ye,_.A)}return 0}function wn(F){var _=F.ma,z=_.ba.S,J=11>z,ne=z==tu||z==Hu||z==Pp||z==Xx||z==12||ir(z);if(_.memory=null,_.Ib=null,_.Jb=null,_.Nd=null,!Mm(_.Oa,F,ne?11:12))return 0;if(ne&&ir(z)&&Am(),F.da)alert("todo:use_scaling");else{if(J){if(_.Ib=Er,F.Kb){if(z=F.U+1>>1,_.memory=i(F.U+2*z),_.memory==null)return 0;_.ec=_.memory,_.fc=0,_.cc=_.ec,_.dc=_.fc+F.U,_.Mc=_.cc,_.Nc=_.dc+z,_.Ib=Ur,Am()}}else alert("todo:EmitYUV");ne&&(_.Jb=ws,J&&Fi())}if(J&&!jb){for(F=0;256>F;++F)Dj[F]=89858*(F-128)+Cl>>Bp,Mj[F]=-22014*(F-128)+Cl,Tj[F]=-45773*(F-128),pc[F]=113618*(F-128)+Cl>>Bp;for(F=Jm;F<ry;++F)_=76283*(F-16)+Cl>>Bp,Pj[F-Jm]=bl(_,255),Rj[F-Jm]=bl(_+8>>4,15);jb=1}return 1}function hr(F){var _=F.ma,z=F.U,J=F.T;return e(!(1&F.ka)),0>=z||0>=J?0:(z=_.Ib(F,_),_.Jb!=null&&_.Jb(F,_,z),_.Dc+=z,1)}function ga(F){F.ma.memory=null}function Jn(F,_,z,J){return oe(F,8)!=47?0:(_[0]=oe(F,14)+1,z[0]=oe(F,14)+1,J[0]=oe(F,1),oe(F,3)!=0?0:!F.h)}function dn(F,_){if(4>F)return F+1;var z=F-2>>1;return(2+(1&F)<<z)+oe(_,z)+1}function gn(F,_){return 120<_?_-120:1<=(z=((z=Sj[_-1])>>4)*F+(8-(15&z)))?z:1;var z}function jn(F,_,z){var J=X(z),ne=F[_+=255&J].g-8;return 0<ne&&(ie(z,z.u+8),J=X(z),_+=F[_].value,_+=J&(1<<ne)-1),ie(z,z.u+F[_].g),F[_].value}function xa(F,_,z){return z.g+=F.g,z.value+=F.value<<_>>>0,e(8>=z.g),F.g}function _a(F,_,z){var J=F.xc;return e((_=J==0?0:F.vc[F.md*(z>>J)+(_>>J)])<F.Wb),F.Ya[_]}function Au(F,_,z,J){var ne=F.ab,le=F.c*_,ue=F.C;_=ue+_;var pe=z,ye=J;for(J=F.Ta,z=F.Ua;0<ne--;){var Se=F.gc[ne],Ie=ue,Ze=_,Fe=pe,He=ye,Ke=(ye=J,pe=z,Se.Ea);switch(e(Ie<Ze),e(Ze<=Se.nc),Se.hc){case 2:Tn(Fe,He,(Ze-Ie)*Ke,ye,pe);break;case 0:var nt=Ie,Ye=Ze,at=ye,lt=pe,jt=(Qt=Se).Ea;nt==0&&(bo(Fe,He,null,null,1,at,lt),Pe(Fe,He+1,0,0,jt-1,at,lt+1),He+=jt,lt+=jt,++nt);for(var bt=1<<Qt.b,lr=bt-1,or=Xe(jt,Qt.b),Lr=Qt.K,Qt=Qt.w+(nt>>Qt.b)*or;nt<Ye;){var js=Lr,Un=Qt,Kr=1;for(dc(Fe,He,at,lt-jt,1,at,lt);Kr<jt;){var dr=(Kr&~lr)+bt;dr>jt&&(dr=jt),(0,Xd[js[Un++]>>8&15])(Fe,He+ +Kr,at,lt+Kr-jt,dr-Kr,at,lt+Kr),Kr=dr}He+=jt,lt+=jt,++nt&lr||(Qt+=or)}Ze!=Se.nc&&n(ye,pe-Ke,ye,pe+(Ze-Ie-1)*Ke,Ke);break;case 1:for(Ke=Fe,Ye=He,jt=(Fe=Se.Ea)-(lt=Fe&~(at=(He=1<<Se.b)-1)),nt=Xe(Fe,Se.b),bt=Se.K,Se=Se.w+(Ie>>Se.b)*nt;Ie<Ze;){for(lr=bt,or=Se,Lr=new fe,Qt=Ye+lt,js=Ye+Fe;Ye<Qt;)Qe(lr[or++],Lr),Rm(Lr,Ke,Ye,He,ye,pe),Ye+=He,pe+=He;Ye<js&&(Qe(lr[or++],Lr),Rm(Lr,Ke,Ye,jt,ye,pe),Ye+=jt,pe+=jt),++Ie&at||(Se+=nt)}break;case 3:if(Fe==ye&&He==pe&&0<Se.b){for(Ye=ye,Fe=Ke=pe+(Ze-Ie)*Ke-(lt=(Ze-Ie)*Xe(Se.Ea,Se.b)),He=ye,at=pe,nt=[],lt=(jt=lt)-1;0<=lt;--lt)nt[lt]=He[at+lt];for(lt=jt-1;0<=lt;--lt)Ye[Fe+lt]=nt[lt];Mp(Se,Ie,Ze,ye,Ke,ye,pe)}else Mp(Se,Ie,Ze,Fe,He,ye,pe)}pe=J,ye=z}ye!=z&&n(J,z,pe,ye,le)}function Gc(F,_){var z=F.V,J=F.Ba+F.c*F.C,ne=_-F.C;if(e(_<=F.l.o),e(16>=ne),0<ne){var le=F.l,ue=F.Ta,pe=F.Ua,ye=le.width;if(Au(F,ne,z,J),ne=pe=[pe],e((z=F.C)<(J=_)),e(le.v<le.va),J>le.o&&(J=le.o),z<le.j){var Se=le.j-z;z=le.j,ne[0]+=Se*ye}if(z>=J?z=0:(ne[0]+=4*le.v,le.ka=z-le.j,le.U=le.va-le.v,le.T=J-z,z=1),z){if(pe=pe[0],11>(z=F.ca).S){var Ie=z.f.RGBA,Ze=(J=z.S,ne=le.U,le=le.T,Se=Ie.eb,Ie.A),Fe=le;for(Ie=Ie.fb+F.Ma*Ie.A;0<Fe--;){var He=ue,Ke=pe,nt=ne,Ye=Se,at=Ie;switch(J){case Wm:Bm(He,Ke,nt,Ye,at);break;case tu:Xc(He,Ke,nt,Ye,at);break;case th:Xc(He,Ke,nt,Ye,at),Qd(Ye,at,0,nt,1,0);break;case ru:vo(He,Ke,nt,Ye,at);break;case Hu:Xt(He,Ke,nt,Ye,at,1);break;case rh:Xt(He,Ke,nt,Ye,at,1),Qd(Ye,at,0,nt,1,0);break;case Pp:Xt(He,Ke,nt,Ye,at,0);break;case sh:Xt(He,Ke,nt,Ye,at,0),Qd(Ye,at,1,nt,1,0);break;case Xx:Qc(He,Ke,nt,Ye,at);break;case Qx:Qc(He,Ke,nt,Ye,at),zm(Ye,at,nt,1,0);break;case xb:eu(He,Ke,nt,Ye,at);break;default:e(0)}pe+=ye,Ie+=Ze}F.Ma+=le}else alert("todo:EmitRescaledRowsYUVA");e(F.Ma<=z.height)}}F.C=_,e(F.C<=F.i)}function Uo(F){var _;if(0<F.ua)return 0;for(_=0;_<F.Wb;++_){var z=F.Ya[_].G,J=F.Ya[_].H;if(0<z[1][J[1]+0].g||0<z[2][J[2]+0].g||0<z[3][J[3]+0].g)return 0}return 1}function xl(F,_,z,J,ne,le){if(F.Z!=0){var ue=F.qd,pe=F.rd;for(e(wo[F.Z]!=null);_<z;++_)wo[F.Z](ue,pe,J,ne,J,ne,le),ue=J,pe=ne,ne+=le;F.qd=ue,F.rd=pe}}function Ho(F,_){var z=F.l.ma,J=z.Z==0||z.Z==1?F.l.j:F.C;if(J=F.C<J?J:F.C,e(_<=F.l.o),_>J){var ne=F.l.width,le=z.ca,ue=z.tb+ne*J,pe=F.V,ye=F.Ba+F.c*J,Se=F.gc;e(F.ab==1),e(Se[0].hc==3),ci(Se[0],J,_,pe,ye,le,ue),xl(z,J,_,le,ue,ne)}F.C=F.Ma=_}function po(F,_,z,J,ne,le,ue){var pe=F.$/J,ye=F.$%J,Se=F.m,Ie=F.s,Ze=z+F.$,Fe=Ze;ne=z+J*ne;var He=z+J*le,Ke=280+Ie.ua,nt=F.Pb?pe:16777216,Ye=0<Ie.ua?Ie.Wa:null,at=Ie.wc,lt=Ze<He?_a(Ie,ye,pe):null;e(F.C<le),e(He<=ne);var jt=!1;e:for(;;){for(;jt||Ze<He;){var bt=0;if(pe>=nt){var lr=Ze-z;e((nt=F).Pb),nt.wd=nt.m,nt.xd=lr,0<nt.s.ua&&ze(nt.s.Wa,nt.s.vb),nt=pe+vb}if(ye&at||(lt=_a(Ie,ye,pe)),e(lt!=null),lt.Qb&&(_[Ze]=lt.qb,jt=!0),!jt)if(ee(Se),lt.jc){bt=Se,lr=_;var or=Ze,Lr=lt.pd[X(bt)&Ou-1];e(lt.jc),256>Lr.g?(ie(bt,bt.u+Lr.g),lr[or]=Lr.value,bt=0):(ie(bt,bt.u+Lr.g-256),e(256<=Lr.value),bt=Lr.value),bt==0&&(jt=!0)}else bt=jn(lt.G[0],lt.H[0],Se);if(Se.h)break;if(jt||256>bt){if(!jt)if(lt.nd)_[Ze]=(lt.qb|bt<<8)>>>0;else{if(ee(Se),jt=jn(lt.G[1],lt.H[1],Se),ee(Se),lr=jn(lt.G[2],lt.H[2],Se),or=jn(lt.G[3],lt.H[3],Se),Se.h)break;_[Ze]=(or<<24|jt<<16|bt<<8|lr)>>>0}if(jt=!1,++Ze,++ye>=J&&(ye=0,++pe,ue!=null&&pe<=le&&!(pe%16)&&ue(F,pe),Ye!=null))for(;Fe<Ze;)bt=_[Fe++],Ye.X[(506832829*bt&4294967295)>>>Ye.Mb]=bt}else if(280>bt){if(bt=dn(bt-256,Se),lr=jn(lt.G[4],lt.H[4],Se),ee(Se),lr=gn(J,lr=dn(lr,Se)),Se.h)break;if(Ze-z<lr||ne-Ze<bt)break e;for(or=0;or<bt;++or)_[Ze+or]=_[Ze+or-lr];for(Ze+=bt,ye+=bt;ye>=J;)ye-=J,++pe,ue!=null&&pe<=le&&!(pe%16)&&ue(F,pe);if(e(Ze<=ne),ye&at&&(lt=_a(Ie,ye,pe)),Ye!=null)for(;Fe<Ze;)bt=_[Fe++],Ye.X[(506832829*bt&4294967295)>>>Ye.Mb]=bt}else{if(!(bt<Ke))break e;for(jt=bt-280,e(Ye!=null);Fe<Ze;)bt=_[Fe++],Ye.X[(506832829*bt&4294967295)>>>Ye.Mb]=bt;bt=Ze,e(!(jt>>>(lr=Ye).Xa)),_[bt]=lr.X[jt],jt=!0}jt||e(Se.h==me(Se))}if(F.Pb&&Se.h&&Ze<ne)e(F.m.h),F.a=5,F.m=F.wd,F.$=F.xd,0<F.s.ua&&ze(F.s.vb,F.s.Wa);else{if(Se.h)break e;ue!=null&&ue(F,pe>le?le:pe),F.a=0,F.$=Ze-z}return 1}return F.a=3,0}function go(F){e(F!=null),F.vc=null,F.yc=null,F.Ya=null;var _=F.Wa;_!=null&&(_.X=null),F.vb=null,e(F!=null)}function Du(){var F=new Mr;return F==null?null:(F.a=0,F.xb=Vm,pt("Predictor","VP8LPredictors"),pt("Predictor","VP8LPredictors_C"),pt("PredictorAdd","VP8LPredictorsAdd"),pt("PredictorAdd","VP8LPredictorsAdd_C"),Tn=qe,Rm=We,Bm=Bt,Xc=Lt,Qc=Vt,eu=cr,vo=wr,A.VP8LMapColor32b=Sl,A.VP8LMapColor8b=ui,F)}function yl(F,_,z,J,ne){var le=1,ue=[F],pe=[_],ye=J.m,Se=J.s,Ie=null,Ze=0;e:for(;;){if(z)for(;le&&oe(ye,1);){var Fe=ue,He=pe,Ke=J,nt=1,Ye=Ke.m,at=Ke.gc[Ke.ab],lt=oe(Ye,2);if(Ke.Oc&1<<lt)le=0;else{switch(Ke.Oc|=1<<lt,at.hc=lt,at.Ea=Fe[0],at.nc=He[0],at.K=[null],++Ke.ab,e(4>=Ke.ab),lt){case 0:case 1:at.b=oe(Ye,3)+2,nt=yl(Xe(at.Ea,at.b),Xe(at.nc,at.b),0,Ke,at.K),at.K=at.K[0];break;case 3:var jt,bt=oe(Ye,8)+1,lr=16<bt?0:4<bt?1:2<bt?2:3;if(Fe[0]=Xe(at.Ea,lr),at.b=lr,jt=nt=yl(bt,1,0,Ke,at.K)){var or,Lr=bt,Qt=at,js=1<<(8>>Qt.b),Un=i(js);if(Un==null)jt=0;else{var Kr=Qt.K[0],dr=Qt.w;for(Un[0]=Qt.K[0][0],or=1;or<1*Lr;++or)Un[or]=Ft(Kr[dr+or],Un[or-1]);for(;or<4*js;++or)Un[or]=0;Qt.K[0]=null,Qt.K[0]=Un,jt=1}}nt=jt;break;case 2:break;default:e(0)}le=nt}}if(ue=ue[0],pe=pe[0],le&&oe(ye,1)&&!(le=1<=(Ze=oe(ye,4))&&11>=Ze)){J.a=3;break e}var _t;if(_t=le)t:{var Nn,qr,gs,an=J,ba=ue,Bs=pe,hn=Ze,Ta=z,mn=an.m,Mn=an.s,ys=[null],Ns=1,xn=0,Gr=Cj[hn];r:for(;;){if(Ta&&oe(mn,1)){var Qn=oe(mn,3)+2,Zo=Xe(ba,Qn),Pn=Xe(Bs,Qn),ki=Zo*Pn;if(!yl(Zo,Pn,0,an,ys))break r;for(ys=ys[0],Mn.xc=Qn,Nn=0;Nn<ki;++Nn){var Us=ys[Nn]>>8&65535;ys[Nn]=Us,Us>=Ns&&(Ns=Us+1)}}if(mn.h)break r;for(qr=0;5>qr;++qr){var ea=bb[qr];!qr&&0<hn&&(ea+=1<<hn),xn<ea&&(xn=ea)}var Ma=o(Ns*Gr,U),Va=Ns,Xi=o(Va,O);if(Xi==null)var Qi=null;else e(65536>=Va),Qi=Xi;var va=i(xn);if(Qi==null||va==null||Ma==null){an.a=1;break r}var eo=Ma;for(Nn=gs=0;Nn<Ns;++Nn){var en=Qi[Nn],hi=en.G,No=en.H,$u=0,gc=1,Pa=0;for(qr=0;5>qr;++qr){ea=bb[qr],hi[qr]=eo,No[qr]=gs,!qr&&0<hn&&(ea+=1<<hn);n:{var Ym,Zm=ea,Lp=an,Wu=va,Sb=eo,Cb=gs,Ip=0,Xo=Lp.m,Ij=oe(Xo,1);if(a(Wu,0,0,Zm),Ij){var kb=oe(Xo,1)+1,_b=oe(Xo,1),Eb=oe(Xo,_b==0?1:8);Wu[Eb]=1,kb==2&&(Wu[Eb=oe(Xo,8)]=1);var Xm=1}else{var Ab=i(19),Op=oe(Xo,4)+4;if(19<Op){Lp.a=3;var Qm=0;break n}for(Ym=0;Ym<Op;++Ym)Ab[Ga[Ym]]=oe(Xo,3);var ef=void 0,tf=void 0,zp=Lp,ns=Ab,Up=Zm,Db=Wu,qu=0,xc=zp.m,Tb=8,Mb=o(128,U);s:for(;P(Mb,0,7,ns,19);){if(oe(xc,1)){var Fo=2+2*oe(xc,3);if((ef=2+oe(xc,Fo))>Up)break s}else ef=Up;for(tf=0;tf<Up&&ef--;){ee(xc);var Pb=Mb[0+(127&X(xc))];ie(xc,xc.u+Pb.g);var yc=Pb.value;if(16>yc)Db[tf++]=yc,yc!=0&&(Tb=yc);else{var sy=yc==16,ny=yc-16,Rb=Fj[ny],_i=oe(xc,yb[ny])+Rb;if(tf+_i>Up)break s;for(var nu=sy?Tb:0;0<_i--;)Db[tf++]=nu}}qu=1;break s}qu||(zp.a=3),Xm=qu}(Xm=Xm&&!Xo.h)&&(Ip=P(Sb,Cb,8,Wu,Zm)),Xm&&Ip!=0?Qm=Ip:(Lp.a=3,Qm=0)}if(Qm==0)break r;if(gc&&Xn[qr]==1&&(gc=eo[gs].g==0),$u+=eo[gs].g,gs+=Qm,3>=qr){var Gu,Hp=va[0];for(Gu=1;Gu<ea;++Gu)va[Gu]>Hp&&(Hp=va[Gu]);Pa+=Hp}}if(en.nd=gc,en.Qb=0,gc&&(en.qb=(hi[3][No[3]+0].value<<24|hi[1][No[1]+0].value<<16|hi[2][No[2]+0].value)>>>0,$u==0&&256>hi[0][No[0]+0].value&&(en.Qb=1,en.qb+=hi[0][No[0]+0].value<<8)),en.jc=!en.Qb&&6>Pa,en.jc){var Vu,kl=en;for(Vu=0;Vu<Ou;++Vu){var _l=Vu,bc=kl.pd[_l],lh=kl.G[0][kl.H[0]+_l];256<=lh.value?(bc.g=lh.g+256,bc.value=lh.value):(bc.g=0,bc.value=0,_l>>=xa(lh,8,bc),_l>>=xa(kl.G[1][kl.H[1]+_l],16,bc),_l>>=xa(kl.G[2][kl.H[2]+_l],0,bc),xa(kl.G[3][kl.H[3]+_l],24,bc))}}}Mn.vc=ys,Mn.Wb=Ns,Mn.Ya=Qi,Mn.yc=Ma,_t=1;break t}_t=0}if(!(le=_t)){J.a=3;break e}if(0<Ze){if(Se.ua=1<<Ze,!ae(Se.Wa,Ze)){J.a=1,le=0;break e}}else Se.ua=0;var rf=J,vc=ue,Oj=pe,El=rf.s,$p=El.xc;if(rf.c=vc,rf.i=Oj,El.md=Xe(vc,$p),El.wc=$p==0?-1:(1<<$p)-1,z){J.xb=_j;break e}if((Ie=i(ue*pe))==null){J.a=1,le=0;break e}le=(le=po(J,Ie,0,ue,pe,pe,null))&&!ye.h;break e}return le?(ne!=null?ne[0]=Ie:(e(Ie==null),e(z)),J.$=0,z||go(Se)):go(Se),le}function Tu(F,_){var z=F.c*F.i,J=z+_+16*_;return e(F.c<=_),F.V=i(J),F.V==null?(F.Ta=null,F.Ua=0,F.a=1,0):(F.Ta=F.V,F.Ua=F.Ba+z+_,1)}function Od(F,_){var z=F.C,J=_-z,ne=F.V,le=F.Ba+F.c*z;for(e(_<=F.l.o);0<J;){var ue=16<J?16:J,pe=F.l.ma,ye=F.l.width,Se=ye*ue,Ie=pe.ca,Ze=pe.tb+ye*z,Fe=F.Ta,He=F.Ua;Au(F,ue,ne,le),pb(Fe,He,Ie,Ze,Se),xl(pe,z,z+ue,Ie,Ze,ye),J-=ue,ne+=ue*F.c,z+=ue}e(z==_),F.C=F.Ma=_}function zd(){this.ub=this.yd=this.td=this.Rb=0}function Ql(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function Ux(){this.Fb=this.Bb=this.Cb=0,this.Zb=i(4),this.Lb=i(4)}function Vc(){this.Yb=function(){var F=[];return function _(z,J,ne){for(var le=ne[J],ue=0;ue<le&&(z.push(ne.length>J+1?[]:0),!(ne.length<J+1));ue++)_(z[ue],J+1,ne)}(F,0,[3,11]),F}()}function Np(){this.jb=i(3),this.Wc=l([4,8],Vc),this.Xc=l([4,17],Vc)}function Fp(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new i(4),this.od=new i(4)}function xo(){this.ld=this.La=this.dd=this.tc=0}function Ud(){this.Na=this.la=0}function bm(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function Hd(){this.ad=i(384),this.Za=0,this.Ob=i(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function Sp(){this.uc=this.M=this.Nb=0,this.wa=Array(new xo),this.Y=0,this.ya=Array(new Hd),this.aa=0,this.l=new Mu}function Cp(){this.y=i(16),this.f=i(8),this.ea=i(8)}function kp(){this.cb=this.a=0,this.sc="",this.m=new K,this.Od=new zd,this.Kc=new Ql,this.ed=new Fp,this.Qa=new Ux,this.Ic=this.$c=this.Aa=0,this.D=new Sp,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=o(8,K),this.ia=0,this.pb=o(4,bm),this.Pa=new Np,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new Cp),this.Hd=0,this.rb=Array(new Ud),this.sb=0,this.wa=Array(new xo),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new Hd),this.L=this.aa=0,this.gd=l([4,2],xo),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function bl(F,_){return 0>F?0:F>_?_:F}function Mu(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function _p(){var F=new kp;return F!=null&&(F.a=0,F.sc="OK",F.cb=0,F.Xb=0,mc||(mc=Pu)),F}function An(F,_,z){return F.a==0&&(F.a=_,F.sc=z,F.cb=0),0}function $d(F,_,z){return 3<=z&&F[_+0]==157&&F[_+1]==1&&F[_+2]==42}function vl(F,_){if(F==null)return 0;if(F.a=0,F.sc="OK",_==null)return An(F,2,"null VP8Io passed to VP8GetHeaders()");var z=_.data,J=_.w,ne=_.ha;if(4>ne)return An(F,7,"Truncated header.");var le=z[J+0]|z[J+1]<<8|z[J+2]<<16,ue=F.Od;if(ue.Rb=!(1&le),ue.td=le>>1&7,ue.yd=le>>4&1,ue.ub=le>>5,3<ue.td)return An(F,3,"Incorrect keyframe parameters.");if(!ue.yd)return An(F,4,"Frame not displayable.");J+=3,ne-=3;var pe=F.Kc;if(ue.Rb){if(7>ne)return An(F,7,"cannot parse picture header");if(!$d(z,J,ne))return An(F,3,"Bad code word");pe.c=16383&(z[J+4]<<8|z[J+3]),pe.Td=z[J+4]>>6,pe.i=16383&(z[J+6]<<8|z[J+5]),pe.Ud=z[J+6]>>6,J+=7,ne-=7,F.za=pe.c+15>>4,F.Ub=pe.i+15>>4,_.width=pe.c,_.height=pe.i,_.Da=0,_.j=0,_.v=0,_.va=_.width,_.o=_.height,_.da=0,_.ib=_.width,_.hb=_.height,_.U=_.width,_.T=_.height,a((le=F.Pa).jb,0,255,le.jb.length),e((le=F.Qa)!=null),le.Cb=0,le.Bb=0,le.Fb=1,a(le.Zb,0,0,le.Zb.length),a(le.Lb,0,0,le.Lb)}if(ue.ub>ne)return An(F,7,"bad partition length");V(le=F.m,z,J,ue.ub),J+=ue.ub,ne-=ue.ub,ue.Rb&&(pe.Ld=ve(le),pe.Kd=ve(le)),pe=F.Qa;var ye,Se=F.Pa;if(e(le!=null),e(pe!=null),pe.Cb=ve(le),pe.Cb){if(pe.Bb=ve(le),ve(le)){for(pe.Fb=ve(le),ye=0;4>ye;++ye)pe.Zb[ye]=ve(le)?B(le,7):0;for(ye=0;4>ye;++ye)pe.Lb[ye]=ve(le)?B(le,6):0}if(pe.Bb)for(ye=0;3>ye;++ye)Se.jb[ye]=ve(le)?G(le,8):255}else pe.Bb=0;if(le.Ka)return An(F,3,"cannot parse segment header");if((pe=F.ed).zd=ve(le),pe.Tb=G(le,6),pe.wb=G(le,3),pe.Pc=ve(le),pe.Pc&&ve(le)){for(Se=0;4>Se;++Se)ve(le)&&(pe.vd[Se]=B(le,6));for(Se=0;4>Se;++Se)ve(le)&&(pe.od[Se]=B(le,6))}if(F.L=pe.Tb==0?0:pe.zd?1:2,le.Ka)return An(F,3,"cannot parse filter header");var Ie=ne;if(ne=ye=J,J=ye+Ie,pe=Ie,F.Xb=(1<<G(F.m,2))-1,Ie<3*(Se=F.Xb))z=7;else{for(ye+=3*Se,pe-=3*Se,Ie=0;Ie<Se;++Ie){var Ze=z[ne+0]|z[ne+1]<<8|z[ne+2]<<16;Ze>pe&&(Ze=pe),V(F.Jc[+Ie],z,ye,Ze),ye+=Ze,pe-=Ze,ne+=3}V(F.Jc[+Se],z,ye,pe),z=ye<J?0:5}if(z!=0)return An(F,z,"cannot parse partitions");for(z=G(ye=F.m,7),ne=ve(ye)?B(ye,4):0,J=ve(ye)?B(ye,4):0,pe=ve(ye)?B(ye,4):0,Se=ve(ye)?B(ye,4):0,ye=ve(ye)?B(ye,4):0,Ie=F.Qa,Ze=0;4>Ze;++Ze){if(Ie.Cb){var Fe=Ie.Zb[Ze];Ie.Fb||(Fe+=z)}else{if(0<Ze){F.pb[Ze]=F.pb[0];continue}Fe=z}var He=F.pb[Ze];He.Sc[0]=ey[bl(Fe+ne,127)],He.Sc[1]=qm[bl(Fe+0,127)],He.Eb[0]=2*ey[bl(Fe+J,127)],He.Eb[1]=101581*qm[bl(Fe+pe,127)]>>16,8>He.Eb[1]&&(He.Eb[1]=8),He.Qc[0]=ey[bl(Fe+Se,117)],He.Qc[1]=qm[bl(Fe+ye,127)],He.lc=Fe+ye}if(!ue.Rb)return An(F,4,"Not a key frame.");for(ve(le),ue=F.Pa,z=0;4>z;++z){for(ne=0;8>ne;++ne)for(J=0;3>J;++J)for(pe=0;11>pe;++pe)Se=Ce(le,ih[z][ne][J][pe])?G(le,8):Gm[z][ne][J][pe],ue.Wc[z][ne].Yb[J][pe]=Se;for(ne=0;17>ne;++ne)ue.Xc[z][ne]=ue.Wc[z][kj[ne]]}return F.kc=ve(le),F.kc&&(F.Bd=G(le,8)),F.cb=1}function Pu(F,_,z,J,ne,le,ue){var pe=_[ne].Yb[z];for(z=0;16>ne;++ne){if(!Ce(F,pe[z+0]))return ne;for(;!Ce(F,pe[z+1]);)if(pe=_[++ne].Yb[0],z=0,ne==16)return 16;var ye=_[ne+1].Yb;if(Ce(F,pe[z+2])){var Se=F,Ie=0;if(Ce(Se,(Fe=pe)[(Ze=z)+3]))if(Ce(Se,Fe[Ze+6])){for(pe=0,Ze=2*(Ie=Ce(Se,Fe[Ze+8]))+(Fe=Ce(Se,Fe[Ze+9+Ie])),Ie=0,Fe=ty[Ze];Fe[pe];++pe)Ie+=Ie+Ce(Se,Fe[pe]);Ie+=3+(8<<Ze)}else Ce(Se,Fe[Ze+7])?(Ie=7+2*Ce(Se,165),Ie+=Ce(Se,145)):Ie=5+Ce(Se,159);else Ie=Ce(Se,Fe[Ze+4])?3+Ce(Se,Fe[Ze+5]):2;pe=ye[2]}else Ie=1,pe=ye[1];ye=ue+nh[ne],0>(Se=F).b&&he(Se);var Ze,Fe=Se.b,He=(Ze=Se.Ca>>1)-(Se.I>>Fe)>>31;--Se.b,Se.Ca+=He,Se.Ca|=1,Se.I-=(Ze+1&He)<<Fe,le[ye]=((Ie^He)-He)*J[(0<ne)+0]}return 16}function Ru(F){var _=F.rb[F.sb-1];_.la=0,_.Na=0,a(F.zc,0,0,F.zc.length),F.ja=0}function Vi(F,_,z,J,ne){ne=F[_+z+32*J]+(ne>>3),F[_+z+32*J]=-256&ne?0>ne?0:255:ne}function Yn(F,_,z,J,ne,le){Vi(F,_,0,z,J+ne),Vi(F,_,1,z,J+le),Vi(F,_,2,z,J-le),Vi(F,_,3,z,J-ne)}function wl(F){return(20091*F>>16)+F}function vm(F,_,z,J){var ne,le=0,ue=i(16);for(ne=0;4>ne;++ne){var pe=F[_+0]+F[_+8],ye=F[_+0]-F[_+8],Se=(35468*F[_+4]>>16)-wl(F[_+12]),Ie=wl(F[_+4])+(35468*F[_+12]>>16);ue[le+0]=pe+Ie,ue[le+1]=ye+Se,ue[le+2]=ye-Se,ue[le+3]=pe-Ie,le+=4,_++}for(ne=le=0;4>ne;++ne)pe=(F=ue[le+0]+4)+ue[le+8],ye=F-ue[le+8],Se=(35468*ue[le+4]>>16)-wl(ue[le+12]),Vi(z,J,0,0,pe+(Ie=wl(ue[le+4])+(35468*ue[le+12]>>16))),Vi(z,J,1,0,ye+Se),Vi(z,J,2,0,ye-Se),Vi(z,J,3,0,pe-Ie),le++,J+=32}function wm(F,_,z,J){var ne=F[_+0]+4,le=35468*F[_+4]>>16,ue=wl(F[_+4]),pe=35468*F[_+1]>>16;Yn(z,J,0,ne+ue,F=wl(F[_+1]),pe),Yn(z,J,1,ne+le,F,pe),Yn(z,J,2,ne-le,F,pe),Yn(z,J,3,ne-ue,F,pe)}function Hx(F,_,z,J,ne){vm(F,_,z,J),ne&&vm(F,_+16,z,J+4)}function $o(F,_,z,J){st(F,_+0,z,J,1),st(F,_+32,z,J+128,1)}function Wd(F,_,z,J){var ne;for(F=F[_+0]+4,ne=0;4>ne;++ne)for(_=0;4>_;++_)Vi(z,J,_,ne,F)}function qd(F,_,z,J){F[_+0]&&Jt(F,_+0,z,J),F[_+16]&&Jt(F,_+16,z,J+4),F[_+32]&&Jt(F,_+32,z,J+128),F[_+48]&&Jt(F,_+48,z,J+128+4)}function Wo(F,_,z,J){var ne,le=i(16);for(ne=0;4>ne;++ne){var ue=F[_+0+ne]+F[_+12+ne],pe=F[_+4+ne]+F[_+8+ne],ye=F[_+4+ne]-F[_+8+ne],Se=F[_+0+ne]-F[_+12+ne];le[0+ne]=ue+pe,le[8+ne]=ue-pe,le[4+ne]=Se+ye,le[12+ne]=Se-ye}for(ne=0;4>ne;++ne)ue=(F=le[0+4*ne]+3)+le[3+4*ne],pe=le[1+4*ne]+le[2+4*ne],ye=le[1+4*ne]-le[2+4*ne],Se=F-le[3+4*ne],z[J+0]=ue+pe>>3,z[J+16]=Se+ye>>3,z[J+32]=ue-pe>>3,z[J+48]=Se-ye>>3,J+=64}function Kc(F,_,z){var J,ne=_-32,le=Ci,ue=255-F[ne-1];for(J=0;J<z;++J){var pe,ye=le,Se=ue+F[_-1];for(pe=0;pe<z;++pe)F[_+pe]=ye[Se+F[ne+pe]];_+=32}}function Ep(F,_){Kc(F,_,4)}function $x(F,_){Kc(F,_,8)}function Ap(F,_){Kc(F,_,16)}function Gd(F,_){var z;for(z=0;16>z;++z)n(F,_+32*z,F,_-32,16)}function jm(F,_){var z;for(z=16;0<z;--z)a(F,_,F[_-1],16),_+=32}function yo(F,_,z){var J;for(J=0;16>J;++J)a(_,z+32*J,F,16)}function Wx(F,_){var z,J=16;for(z=0;16>z;++z)J+=F[_-1+32*z]+F[_+z-32];yo(J>>5,F,_)}function Bu(F,_){var z,J=8;for(z=0;16>z;++z)J+=F[_-1+32*z];yo(J>>4,F,_)}function Nm(F,_){var z,J=8;for(z=0;16>z;++z)J+=F[_+z-32];yo(J>>4,F,_)}function Dp(F,_){yo(128,F,_)}function Hr(F,_,z){return F+2*_+z+2>>2}function qx(F,_){var z,J=_-32;for(J=new Uint8Array([Hr(F[J-1],F[J+0],F[J+1]),Hr(F[J+0],F[J+1],F[J+2]),Hr(F[J+1],F[J+2],F[J+3]),Hr(F[J+2],F[J+3],F[J+4])]),z=0;4>z;++z)n(F,_+32*z,J,0,J.length)}function Gx(F,_){var z=F[_-1],J=F[_-1+32],ne=F[_-1+64],le=F[_-1+96];re(F,_+0,16843009*Hr(F[_-1-32],z,J)),re(F,_+32,16843009*Hr(z,J,ne)),re(F,_+64,16843009*Hr(J,ne,le)),re(F,_+96,16843009*Hr(ne,le,le))}function Vx(F,_){var z,J=4;for(z=0;4>z;++z)J+=F[_+z-32]+F[_-1+32*z];for(J>>=3,z=0;4>z;++z)a(F,_+32*z,J,4)}function qo(F,_){var z=F[_-1+0],J=F[_-1+32],ne=F[_-1+64],le=F[_-1-32],ue=F[_+0-32],pe=F[_+1-32],ye=F[_+2-32],Se=F[_+3-32];F[_+0+96]=Hr(J,ne,F[_-1+96]),F[_+1+96]=F[_+0+64]=Hr(z,J,ne),F[_+2+96]=F[_+1+64]=F[_+0+32]=Hr(le,z,J),F[_+3+96]=F[_+2+64]=F[_+1+32]=F[_+0+0]=Hr(ue,le,z),F[_+3+64]=F[_+2+32]=F[_+1+0]=Hr(pe,ue,le),F[_+3+32]=F[_+2+0]=Hr(ye,pe,ue),F[_+3+0]=Hr(Se,ye,pe)}function ec(F,_){var z=F[_+1-32],J=F[_+2-32],ne=F[_+3-32],le=F[_+4-32],ue=F[_+5-32],pe=F[_+6-32],ye=F[_+7-32];F[_+0+0]=Hr(F[_+0-32],z,J),F[_+1+0]=F[_+0+32]=Hr(z,J,ne),F[_+2+0]=F[_+1+32]=F[_+0+64]=Hr(J,ne,le),F[_+3+0]=F[_+2+32]=F[_+1+64]=F[_+0+96]=Hr(ne,le,ue),F[_+3+32]=F[_+2+64]=F[_+1+96]=Hr(le,ue,pe),F[_+3+64]=F[_+2+96]=Hr(ue,pe,ye),F[_+3+96]=Hr(pe,ye,ye)}function Kx(F,_){var z=F[_-1+0],J=F[_-1+32],ne=F[_-1+64],le=F[_-1-32],ue=F[_+0-32],pe=F[_+1-32],ye=F[_+2-32],Se=F[_+3-32];F[_+0+0]=F[_+1+64]=le+ue+1>>1,F[_+1+0]=F[_+2+64]=ue+pe+1>>1,F[_+2+0]=F[_+3+64]=pe+ye+1>>1,F[_+3+0]=ye+Se+1>>1,F[_+0+96]=Hr(ne,J,z),F[_+0+64]=Hr(J,z,le),F[_+0+32]=F[_+1+96]=Hr(z,le,ue),F[_+1+32]=F[_+2+96]=Hr(le,ue,pe),F[_+2+32]=F[_+3+96]=Hr(ue,pe,ye),F[_+3+32]=Hr(pe,ye,Se)}function Jx(F,_){var z=F[_+0-32],J=F[_+1-32],ne=F[_+2-32],le=F[_+3-32],ue=F[_+4-32],pe=F[_+5-32],ye=F[_+6-32],Se=F[_+7-32];F[_+0+0]=z+J+1>>1,F[_+1+0]=F[_+0+64]=J+ne+1>>1,F[_+2+0]=F[_+1+64]=ne+le+1>>1,F[_+3+0]=F[_+2+64]=le+ue+1>>1,F[_+0+32]=Hr(z,J,ne),F[_+1+32]=F[_+0+96]=Hr(J,ne,le),F[_+2+32]=F[_+1+96]=Hr(ne,le,ue),F[_+3+32]=F[_+2+96]=Hr(le,ue,pe),F[_+3+64]=Hr(ue,pe,ye),F[_+3+96]=Hr(pe,ye,Se)}function Vd(F,_){var z=F[_-1+0],J=F[_-1+32],ne=F[_-1+64],le=F[_-1+96];F[_+0+0]=z+J+1>>1,F[_+2+0]=F[_+0+32]=J+ne+1>>1,F[_+2+32]=F[_+0+64]=ne+le+1>>1,F[_+1+0]=Hr(z,J,ne),F[_+3+0]=F[_+1+32]=Hr(J,ne,le),F[_+3+32]=F[_+1+64]=Hr(ne,le,le),F[_+3+64]=F[_+2+64]=F[_+0+96]=F[_+1+96]=F[_+2+96]=F[_+3+96]=le}function Fm(F,_){var z=F[_-1+0],J=F[_-1+32],ne=F[_-1+64],le=F[_-1+96],ue=F[_-1-32],pe=F[_+0-32],ye=F[_+1-32],Se=F[_+2-32];F[_+0+0]=F[_+2+32]=z+ue+1>>1,F[_+0+32]=F[_+2+64]=J+z+1>>1,F[_+0+64]=F[_+2+96]=ne+J+1>>1,F[_+0+96]=le+ne+1>>1,F[_+3+0]=Hr(pe,ye,Se),F[_+2+0]=Hr(ue,pe,ye),F[_+1+0]=F[_+3+32]=Hr(z,ue,pe),F[_+1+32]=F[_+3+64]=Hr(J,z,ue),F[_+1+64]=F[_+3+96]=Hr(ne,J,z),F[_+1+96]=Hr(le,ne,J)}function Ps(F,_){var z;for(z=0;8>z;++z)n(F,_+32*z,F,_-32,8)}function Hs(F,_){var z;for(z=0;8>z;++z)a(F,_,F[_-1],8),_+=32}function tc(F,_,z){var J;for(J=0;8>J;++J)a(_,z+32*J,F,8)}function Yx(F,_){var z,J=8;for(z=0;8>z;++z)J+=F[_+z-32]+F[_-1+32*z];tc(J>>4,F,_)}function Sm(F,_){var z,J=4;for(z=0;8>z;++z)J+=F[_+z-32];tc(J>>3,F,_)}function Cm(F,_){var z,J=4;for(z=0;8>z;++z)J+=F[_-1+32*z];tc(J>>3,F,_)}function Tp(F,_){tc(128,F,_)}function rc(F,_,z){var J=F[_-z],ne=F[_+0],le=3*(ne-J)+eh[1020+F[_-2*z]-F[_+z]],ue=$m[112+(le+4>>3)];F[_-z]=Ci[255+J+$m[112+(le+3>>3)]],F[_+0]=Ci[255+ne-ue]}function Kd(F,_,z,J){var ne=F[_+0],le=F[_+z];return di[255+F[_-2*z]-F[_-z]]>J||di[255+le-ne]>J}function Jd(F,_,z,J){return 4*di[255+F[_-z]-F[_+0]]+di[255+F[_-2*z]-F[_+z]]<=J}function Dn(F,_,z,J,ne){var le=F[_-3*z],ue=F[_-2*z],pe=F[_-z],ye=F[_+0],Se=F[_+z],Ie=F[_+2*z],Ze=F[_+3*z];return 4*di[255+pe-ye]+di[255+ue-Se]>J?0:di[255+F[_-4*z]-le]<=ne&&di[255+le-ue]<=ne&&di[255+ue-pe]<=ne&&di[255+Ze-Ie]<=ne&&di[255+Ie-Se]<=ne&&di[255+Se-ye]<=ne}function sc(F,_,z,J){var ne=2*J+1;for(J=0;16>J;++J)Jd(F,_+J,z,ne)&&rc(F,_+J,z)}function Go(F,_,z,J){var ne=2*J+1;for(J=0;16>J;++J)Jd(F,_+J*z,1,ne)&&rc(F,_+J*z,1)}function km(F,_,z,J){var ne;for(ne=3;0<ne;--ne)sc(F,_+=4*z,z,J)}function Yd(F,_,z,J){var ne;for(ne=3;0<ne;--ne)Go(F,_+=4,z,J)}function In(F,_,z,J,ne,le,ue,pe){for(le=2*le+1;0<ne--;){if(Dn(F,_,z,le,ue))if(Kd(F,_,z,pe))rc(F,_,z);else{var ye=F,Se=_,Ie=z,Ze=ye[Se-2*Ie],Fe=ye[Se-Ie],He=ye[Se+0],Ke=ye[Se+Ie],nt=ye[Se+2*Ie],Ye=27*(lt=eh[1020+3*(He-Fe)+eh[1020+Ze-Ke]])+63>>7,at=18*lt+63>>7,lt=9*lt+63>>7;ye[Se-3*Ie]=Ci[255+ye[Se-3*Ie]+lt],ye[Se-2*Ie]=Ci[255+Ze+at],ye[Se-Ie]=Ci[255+Fe+Ye],ye[Se+0]=Ci[255+He-Ye],ye[Se+Ie]=Ci[255+Ke-at],ye[Se+2*Ie]=Ci[255+nt-lt]}_+=J}}function jl(F,_,z,J,ne,le,ue,pe){for(le=2*le+1;0<ne--;){if(Dn(F,_,z,le,ue))if(Kd(F,_,z,pe))rc(F,_,z);else{var ye=F,Se=_,Ie=z,Ze=ye[Se-Ie],Fe=ye[Se+0],He=ye[Se+Ie],Ke=$m[112+(4+(nt=3*(Fe-Ze))>>3)],nt=$m[112+(nt+3>>3)],Ye=Ke+1>>1;ye[Se-2*Ie]=Ci[255+ye[Se-2*Ie]+Ye],ye[Se-Ie]=Ci[255+Ze+nt],ye[Se+0]=Ci[255+Fe-Ke],ye[Se+Ie]=Ci[255+He-Ye]}_+=J}}function _m(F,_,z,J,ne,le){In(F,_,z,1,16,J,ne,le)}function Jc(F,_,z,J,ne,le){In(F,_,1,z,16,J,ne,le)}function Em(F,_,z,J,ne,le){var ue;for(ue=3;0<ue;--ue)jl(F,_+=4*z,z,1,16,J,ne,le)}function L(F,_,z,J,ne,le){var ue;for(ue=3;0<ue;--ue)jl(F,_+=4,1,z,16,J,ne,le)}function se(F,_,z,J,ne,le,ue,pe){In(F,_,ne,1,8,le,ue,pe),In(z,J,ne,1,8,le,ue,pe)}function je(F,_,z,J,ne,le,ue,pe){In(F,_,1,ne,8,le,ue,pe),In(z,J,1,ne,8,le,ue,pe)}function Re(F,_,z,J,ne,le,ue,pe){jl(F,_+4*ne,ne,1,8,le,ue,pe),jl(z,J+4*ne,ne,1,8,le,ue,pe)}function $e(F,_,z,J,ne,le,ue,pe){jl(F,_+4,1,ne,8,le,ue,pe),jl(z,J+4,1,ne,8,le,ue,pe)}function it(){this.ba=new zr,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new Ds,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function yt(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function tr(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function mr(){this.ua=0,this.Wa=new mt,this.vb=new mt,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new O,this.yc=new U}function Mr(){this.xb=this.a=0,this.l=new Mu,this.ca=new zr,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new H,this.Pb=0,this.wd=new H,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new mr,this.ab=0,this.gc=o(4,tr),this.Oc=0}function ur(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Mu,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function es(F,_,z,J,ne,le,ue){for(F=F==null?0:F[_+0],_=0;_<ue;++_)ne[le+_]=F+z[J+_]&255,F=ne[le+_]}function nn(F,_,z,J,ne,le,ue){var pe;if(F==null)es(null,null,z,J,ne,le,ue);else for(pe=0;pe<ue;++pe)ne[le+pe]=F[_+pe]+z[J+pe]&255}function On(F,_,z,J,ne,le,ue){if(F==null)es(null,null,z,J,ne,le,ue);else{var pe,ye=F[_+0],Se=ye,Ie=ye;for(pe=0;pe<ue;++pe)Se=Ie+(ye=F[_+pe])-Se,Ie=z[J+pe]+(-256&Se?0>Se?0:255:Se)&255,Se=ye,ne[le+pe]=Ie}}function $s(F,_,z,J){var ne=_.width,le=_.o;if(e(F!=null&&_!=null),0>z||0>=J||z+J>le)return null;if(!F.Cc){if(F.ga==null){var ue;if(F.ga=new ur,(ue=F.ga==null)||(ue=_.width*_.o,e(F.Gb.length==0),F.Gb=i(ue),F.Uc=0,F.Gb==null?ue=0:(F.mb=F.Gb,F.nb=F.Uc,F.rc=null,ue=1),ue=!ue),!ue){ue=F.ga;var pe=F.Fa,ye=F.P,Se=F.qc,Ie=F.mb,Ze=F.nb,Fe=ye+1,He=Se-1,Ke=ue.l;if(e(pe!=null&&Ie!=null&&_!=null),wo[0]=null,wo[1]=es,wo[2]=nn,wo[3]=On,ue.ca=Ie,ue.tb=Ze,ue.c=_.width,ue.i=_.height,e(0<ue.c&&0<ue.i),1>=Se)_=0;else if(ue.$a=3&pe[ye+0],ue.Z=pe[ye+0]>>2&3,ue.Lc=pe[ye+0]>>4&3,ye=pe[ye+0]>>6&3,0>ue.$a||1<ue.$a||4<=ue.Z||1<ue.Lc||ye)_=0;else if(Ke.put=hr,Ke.ac=wn,Ke.bc=ga,Ke.ma=ue,Ke.width=_.width,Ke.height=_.height,Ke.Da=_.Da,Ke.v=_.v,Ke.va=_.va,Ke.j=_.j,Ke.o=_.o,ue.$a)e:{e(ue.$a==1),_=Du();t:for(;;){if(_==null){_=0;break e}if(e(ue!=null),ue.mc=_,_.c=ue.c,_.i=ue.i,_.l=ue.l,_.l.ma=ue,_.l.width=ue.c,_.l.height=ue.i,_.a=0,$(_.m,pe,Fe,He),!yl(ue.c,ue.i,1,_,null)||(_.ab==1&&_.gc[0].hc==3&&Uo(_.s)?(ue.ic=1,pe=_.c*_.i,_.Ta=null,_.Ua=0,_.V=i(pe),_.Ba=0,_.V==null?(_.a=1,_=0):_=1):(ue.ic=0,_=Tu(_,ue.c)),!_))break t;_=1;break e}ue.mc=null,_=0}else _=He>=ue.c*ue.i;ue=!_}if(ue)return null;F.ga.Lc!=1?F.Ga=0:J=le-z}e(F.ga!=null),e(z+J<=le);e:{if(_=(pe=F.ga).c,le=pe.l.o,pe.$a==0){if(Fe=F.rc,He=F.Vc,Ke=F.Fa,ye=F.P+1+z*_,Se=F.mb,Ie=F.nb+z*_,e(ye<=F.P+F.qc),pe.Z!=0)for(e(wo[pe.Z]!=null),ue=0;ue<J;++ue)wo[pe.Z](Fe,He,Ke,ye,Se,Ie,_),Fe=Se,He=Ie,Ie+=_,ye+=_;else for(ue=0;ue<J;++ue)n(Se,Ie,Ke,ye,_),Fe=Se,He=Ie,Ie+=_,ye+=_;F.rc=Fe,F.Vc=He}else{if(e(pe.mc!=null),_=z+J,e((ue=pe.mc)!=null),e(_<=ue.i),ue.C>=_)_=1;else if(pe.ic||Fi(),pe.ic){pe=ue.V,Fe=ue.Ba,He=ue.c;var nt=ue.i,Ye=(Ke=1,ye=ue.$/He,Se=ue.$%He,Ie=ue.m,Ze=ue.s,ue.$),at=He*nt,lt=He*_,jt=Ze.wc,bt=Ye<lt?_a(Ze,Se,ye):null;e(Ye<=at),e(_<=nt),e(Uo(Ze));t:for(;;){for(;!Ie.h&&Ye<lt;){if(Se&jt||(bt=_a(Ze,Se,ye)),e(bt!=null),ee(Ie),256>(nt=jn(bt.G[0],bt.H[0],Ie)))pe[Fe+Ye]=nt,++Ye,++Se>=He&&(Se=0,++ye<=_&&!(ye%16)&&Ho(ue,ye));else{if(!(280>nt)){Ke=0;break t}nt=dn(nt-256,Ie);var lr,or=jn(bt.G[4],bt.H[4],Ie);if(ee(Ie),!(Ye>=(or=gn(He,or=dn(or,Ie)))&&at-Ye>=nt)){Ke=0;break t}for(lr=0;lr<nt;++lr)pe[Fe+Ye+lr]=pe[Fe+Ye+lr-or];for(Ye+=nt,Se+=nt;Se>=He;)Se-=He,++ye<=_&&!(ye%16)&&Ho(ue,ye);Ye<lt&&Se&jt&&(bt=_a(Ze,Se,ye))}e(Ie.h==me(Ie))}Ho(ue,ye>_?_:ye);break t}!Ke||Ie.h&&Ye<at?(Ke=0,ue.a=Ie.h?5:3):ue.$=Ye,_=Ke}else _=po(ue,ue.V,ue.Ba,ue.c,ue.i,_,Od);if(!_){J=0;break e}}z+J>=le&&(F.Cc=1),J=1}if(!J)return null;if(F.Cc&&((J=F.ga)!=null&&(J.mc=null),F.ga=null,0<F.Ga))return alert("todo:WebPDequantizeLevels"),null}return F.nb+z*ne}function Zn(F,_,z,J,ne,le){for(;0<ne--;){var ue,pe=F,ye=_+(z?1:0),Se=F,Ie=_+(z?0:3);for(ue=0;ue<J;++ue){var Ze=Se[Ie+4*ue];Ze!=255&&(Ze*=32897,pe[ye+4*ue+0]=pe[ye+4*ue+0]*Ze>>23,pe[ye+4*ue+1]=pe[ye+4*ue+1]*Ze>>23,pe[ye+4*ue+2]=pe[ye+4*ue+2]*Ze>>23)}_+=le}}function zn(F,_,z,J,ne){for(;0<J--;){var le;for(le=0;le<z;++le){var ue=F[_+2*le+0],pe=15&(Se=F[_+2*le+1]),ye=4369*pe,Se=(240&Se|Se>>4)*ye>>16;F[_+2*le+0]=(240&ue|ue>>4)*ye>>16&240|(15&ue|ue<<4)*ye>>16>>4&15,F[_+2*le+1]=240&Se|pe}_+=ne}}function Ea(F,_,z,J,ne,le,ue,pe){var ye,Se,Ie=255;for(Se=0;Se<ne;++Se){for(ye=0;ye<J;++ye){var Ze=F[_+ye];le[ue+4*ye]=Ze,Ie&=Ze}_+=z,ue+=pe}return Ie!=255}function Nl(F,_,z,J,ne){var le;for(le=0;le<ne;++le)z[J+le]=F[_+le]>>8}function Fi(){Qd=Zn,zm=zn,fb=Ea,pb=Nl}function Si(F,_,z){A[F]=function(J,ne,le,ue,pe,ye,Se,Ie,Ze,Fe,He,Ke,nt,Ye,at,lt,jt){var bt,lr=jt-1>>1,or=pe[ye+0]|Se[Ie+0]<<16,Lr=Ze[Fe+0]|He[Ke+0]<<16;e(J!=null);var Qt=3*or+Lr+131074>>2;for(_(J[ne+0],255&Qt,Qt>>16,nt,Ye),le!=null&&(Qt=3*Lr+or+131074>>2,_(le[ue+0],255&Qt,Qt>>16,at,lt)),bt=1;bt<=lr;++bt){var js=pe[ye+bt]|Se[Ie+bt]<<16,Un=Ze[Fe+bt]|He[Ke+bt]<<16,Kr=or+js+Lr+Un+524296,dr=Kr+2*(js+Lr)>>3;Qt=dr+or>>1,or=(Kr=Kr+2*(or+Un)>>3)+js>>1,_(J[ne+2*bt-1],255&Qt,Qt>>16,nt,Ye+(2*bt-1)*z),_(J[ne+2*bt-0],255&or,or>>16,nt,Ye+(2*bt-0)*z),le!=null&&(Qt=Kr+Lr>>1,or=dr+Un>>1,_(le[ue+2*bt-1],255&Qt,Qt>>16,at,lt+(2*bt-1)*z),_(le[ue+2*bt+0],255&or,or>>16,at,lt+(2*bt+0)*z)),or=js,Lr=Un}1&jt||(Qt=3*or+Lr+131074>>2,_(J[ne+jt-1],255&Qt,Qt>>16,nt,Ye+(jt-1)*z),le!=null&&(Qt=3*Lr+or+131074>>2,_(le[ue+jt-1],255&Qt,Qt>>16,at,lt+(jt-1)*z)))}}function Am(){Yi[Wm]=de,Yi[tu]=Km,Yi[ru]=oh,Yi[Hu]=Zi,Yi[Pp]=ps,Yi[Xx]=wb,Yi[xb]=Ej,Yi[th]=Km,Yi[rh]=Zi,Yi[sh]=ps,Yi[Qx]=wb}function Lu(F){return F&-16384?0>F?0:255:F>>Aj}function nc(F,_){return Lu((19077*F>>8)+(26149*_>>8)-14234)}function ac(F,_,z){return Lu((19077*F>>8)-(6419*_>>8)-(13320*z>>8)+8708)}function ic(F,_){return Lu((19077*F>>8)+(33050*_>>8)-17685)}function oc(F,_,z,J,ne){J[ne+0]=nc(F,z),J[ne+1]=ac(F,_,z),J[ne+2]=ic(F,_)}function Aa(F,_,z,J,ne){J[ne+0]=ic(F,_),J[ne+1]=ac(F,_,z),J[ne+2]=nc(F,z)}function lc(F,_,z,J,ne){var le=ac(F,_,z);_=le<<3&224|ic(F,_)>>3,J[ne+0]=248&nc(F,z)|le>>5,J[ne+1]=_}function cc(F,_,z,J,ne){var le=240&ic(F,_)|15;J[ne+0]=240&nc(F,z)|ac(F,_,z)>>4,J[ne+1]=le}function Dm(F,_,z,J,ne){J[ne+0]=255,oc(F,_,z,J,ne+1)}function Zd(F,_,z,J,ne){Aa(F,_,z,J,ne),J[ne+3]=255}function Vs(F,_,z,J,ne){oc(F,_,z,J,ne),J[ne+3]=255}function Vo(F,_,z){A[F]=function(J,ne,le,ue,pe,ye,Se,Ie,Ze){for(var Fe=Ie+(-2&Ze)*z;Ie!=Fe;)_(J[ne+0],le[ue+0],pe[ye+0],Se,Ie),_(J[ne+1],le[ue+0],pe[ye+0],Se,Ie+z),ne+=2,++ue,++ye,Ie+=2*z;1&Ze&&_(J[ne+0],le[ue+0],pe[ye+0],Se,Ie)}}function Fl(F,_,z){return z==0?F==0?_==0?6:5:_==0?4:0:z}function Tm(F,_,z,J,ne){switch(F>>>30){case 3:st(_,z,J,ne,0);break;case 2:et(_,z,J,ne);break;case 1:Jt(_,z,J,ne)}}function Ki(F,_){var z,J,ne=_.M,le=_.Nb,ue=F.oc,pe=F.pc+40,ye=F.oc,Se=F.pc+584,Ie=F.oc,Ze=F.pc+600;for(z=0;16>z;++z)ue[pe+32*z-1]=129;for(z=0;8>z;++z)ye[Se+32*z-1]=129,Ie[Ze+32*z-1]=129;for(0<ne?ue[pe-1-32]=ye[Se-1-32]=Ie[Ze-1-32]=129:(a(ue,pe-32-1,127,21),a(ye,Se-32-1,127,9),a(Ie,Ze-32-1,127,9)),J=0;J<F.za;++J){var Fe=_.ya[_.aa+J];if(0<J){for(z=-1;16>z;++z)n(ue,pe+32*z-4,ue,pe+32*z+12,4);for(z=-1;8>z;++z)n(ye,Se+32*z-4,ye,Se+32*z+4,4),n(Ie,Ze+32*z-4,Ie,Ze+32*z+4,4)}var He=F.Gd,Ke=F.Hd+J,nt=Fe.ad,Ye=Fe.Hc;if(0<ne&&(n(ue,pe-32,He[Ke].y,0,16),n(ye,Se-32,He[Ke].f,0,8),n(Ie,Ze-32,He[Ke].ea,0,8)),Fe.Za){var at=ue,lt=pe-32+16;for(0<ne&&(J>=F.za-1?a(at,lt,He[Ke].y[15],4):n(at,lt,He[Ke+1].y,0,4)),z=0;4>z;z++)at[lt+128+z]=at[lt+256+z]=at[lt+384+z]=at[lt+0+z];for(z=0;16>z;++z,Ye<<=2)at=ue,lt=pe+Nb[z],Yo[Fe.Ob[z]](at,lt),Tm(Ye,nt,16*+z,at,lt)}else if(at=Fl(J,ne,Fe.Ob[0]),su[at](ue,pe),Ye!=0)for(z=0;16>z;++z,Ye<<=2)Tm(Ye,nt,16*+z,ue,pe+Nb[z]);for(z=Fe.Gc,at=Fl(J,ne,Fe.Dd),fc[at](ye,Se),fc[at](Ie,Ze),Ye=nt,at=ye,lt=Se,255&(Fe=0|z)&&(170&Fe?Ut(Ye,256,at,lt):Nr(Ye,256,at,lt)),Fe=Ie,Ye=Ze,255&(z>>=8)&&(170&z?Ut(nt,320,Fe,Ye):Nr(nt,320,Fe,Ye)),ne<F.Ub-1&&(n(He[Ke].y,0,ue,pe+480,16),n(He[Ke].f,0,ye,Se+224,8),n(He[Ke].ea,0,Ie,Ze+224,8)),z=8*le*F.B,He=F.sa,Ke=F.ta+16*J+16*le*F.R,nt=F.qa,Fe=F.ra+8*J+z,Ye=F.Ha,at=F.Ia+8*J+z,z=0;16>z;++z)n(He,Ke+z*F.R,ue,pe+32*z,16);for(z=0;8>z;++z)n(nt,Fe+z*F.B,ye,Se+32*z,8),n(Ye,at+z*F.B,Ie,Ze+32*z,8)}}function Iu(F,_,z,J,ne,le,ue,pe,ye){var Se=[0],Ie=[0],Ze=0,Fe=ye!=null?ye.kd:0,He=ye??new yt;if(F==null||12>z)return 7;He.data=F,He.w=_,He.ha=z,_=[_],z=[z],He.gb=[He.gb];e:{var Ke=_,nt=z,Ye=He.gb;if(e(F!=null),e(nt!=null),e(Ye!=null),Ye[0]=0,12<=nt[0]&&!r(F,Ke[0],"RIFF")){if(r(F,Ke[0]+8,"WEBP")){Ye=3;break e}var at=Me(F,Ke[0]+4);if(12>at||4294967286<at){Ye=3;break e}if(Fe&&at>nt[0]-8){Ye=7;break e}Ye[0]=at,Ke[0]+=12,nt[0]-=12}Ye=0}if(Ye!=0)return Ye;for(at=0<He.gb[0],z=z[0];;){e:{var lt=F;nt=_,Ye=z;var jt=Se,bt=Ie,lr=Ke=[0];if((Qt=Ze=[Ze])[0]=0,8>Ye[0])Ye=7;else{if(!r(lt,nt[0],"VP8X")){if(Me(lt,nt[0]+4)!=10){Ye=3;break e}if(18>Ye[0]){Ye=7;break e}var or=Me(lt,nt[0]+8),Lr=1+Ee(lt,nt[0]+12);if(2147483648<=Lr*(lt=1+Ee(lt,nt[0]+15))){Ye=3;break e}lr!=null&&(lr[0]=or),jt!=null&&(jt[0]=Lr),bt!=null&&(bt[0]=lt),nt[0]+=18,Ye[0]-=18,Qt[0]=1}Ye=0}}if(Ze=Ze[0],Ke=Ke[0],Ye!=0)return Ye;if(nt=!!(2&Ke),!at&&Ze)return 3;if(le!=null&&(le[0]=!!(16&Ke)),ue!=null&&(ue[0]=nt),pe!=null&&(pe[0]=0),ue=Se[0],Ke=Ie[0],Ze&&nt&&ye==null){Ye=0;break}if(4>z){Ye=7;break}if(at&&Ze||!at&&!Ze&&!r(F,_[0],"ALPH")){z=[z],He.na=[He.na],He.P=[He.P],He.Sa=[He.Sa];e:{or=F,Ye=_,at=z;var Qt=He.gb;jt=He.na,bt=He.P,lr=He.Sa,Lr=22,e(or!=null),e(at!=null),lt=Ye[0];var js=at[0];for(e(jt!=null),e(lr!=null),jt[0]=null,bt[0]=null,lr[0]=0;;){if(Ye[0]=lt,at[0]=js,8>js){Ye=7;break e}var Un=Me(or,lt+4);if(4294967286<Un){Ye=3;break e}var Kr=8+Un+1&-2;if(Lr+=Kr,0<Qt&&Lr>Qt){Ye=3;break e}if(!r(or,lt,"VP8 ")||!r(or,lt,"VP8L")){Ye=0;break e}if(js[0]<Kr){Ye=7;break e}r(or,lt,"ALPH")||(jt[0]=or,bt[0]=lt+8,lr[0]=Un),lt+=Kr,js-=Kr}}if(z=z[0],He.na=He.na[0],He.P=He.P[0],He.Sa=He.Sa[0],Ye!=0)break}z=[z],He.Ja=[He.Ja],He.xa=[He.xa];e:if(Qt=F,Ye=_,at=z,jt=He.gb[0],bt=He.Ja,lr=He.xa,or=Ye[0],lt=!r(Qt,or,"VP8 "),Lr=!r(Qt,or,"VP8L"),e(Qt!=null),e(at!=null),e(bt!=null),e(lr!=null),8>at[0])Ye=7;else{if(lt||Lr){if(Qt=Me(Qt,or+4),12<=jt&&Qt>jt-12){Ye=3;break e}if(Fe&&Qt>at[0]-8){Ye=7;break e}bt[0]=Qt,Ye[0]+=8,at[0]-=8,lr[0]=Lr}else lr[0]=5<=at[0]&&Qt[or+0]==47&&!(Qt[or+4]>>5),bt[0]=at[0];Ye=0}if(z=z[0],He.Ja=He.Ja[0],He.xa=He.xa[0],_=_[0],Ye!=0)break;if(4294967286<He.Ja)return 3;if(pe==null||nt||(pe[0]=He.xa?2:1),ue=[ue],Ke=[Ke],He.xa){if(5>z){Ye=7;break}pe=ue,Fe=Ke,nt=le,F==null||5>z?F=0:5<=z&&F[_+0]==47&&!(F[_+4]>>5)?(at=[0],Qt=[0],jt=[0],$(bt=new H,F,_,z),Jn(bt,at,Qt,jt)?(pe!=null&&(pe[0]=at[0]),Fe!=null&&(Fe[0]=Qt[0]),nt!=null&&(nt[0]=jt[0]),F=1):F=0):F=0}else{if(10>z){Ye=7;break}pe=Ke,F==null||10>z||!$d(F,_+3,z-3)?F=0:(Fe=F[_+0]|F[_+1]<<8|F[_+2]<<16,nt=16383&(F[_+7]<<8|F[_+6]),F=16383&(F[_+9]<<8|F[_+8]),1&Fe||3<(Fe>>1&7)||!(Fe>>4&1)||Fe>>5>=He.Ja||!nt||!F?F=0:(ue&&(ue[0]=nt),pe&&(pe[0]=F),F=1))}if(!F||(ue=ue[0],Ke=Ke[0],Ze&&(Se[0]!=ue||Ie[0]!=Ke)))return 3;ye!=null&&(ye[0]=He,ye.offset=_-ye.w,e(4294967286>_-ye.w),e(ye.offset==ye.ha-z));break}return Ye==0||Ye==7&&Ze&&ye==null?(le!=null&&(le[0]|=He.na!=null&&0<He.na.length),J!=null&&(J[0]=ue),ne!=null&&(ne[0]=Ke),0):Ye}function Mm(F,_,z){var J=_.width,ne=_.height,le=0,ue=0,pe=J,ye=ne;if(_.Da=F!=null&&0<F.Da,_.Da&&(pe=F.cd,ye=F.bd,le=F.v,ue=F.j,11>z||(le&=-2,ue&=-2),0>le||0>ue||0>=pe||0>=ye||le+pe>J||ue+ye>ne))return 0;if(_.v=le,_.j=ue,_.va=le+pe,_.o=ue+ye,_.U=pe,_.T=ye,_.da=F!=null&&0<F.da,_.da){if(!tt(pe,ye,z=[F.ib],le=[F.hb]))return 0;_.ib=z[0],_.hb=le[0]}return _.ob=F!=null&&F.ob,_.Kb=F==null||!F.Sd,_.da&&(_.ob=_.ib<3*J/4&&_.hb<3*ne/4,_.Kb=0),1}function Pm(F){if(F==null)return 2;if(11>F.S){var _=F.f.RGBA;_.fb+=(F.height-1)*_.A,_.A=-_.A}else _=F.f.kb,F=F.height,_.O+=(F-1)*_.fa,_.fa=-_.fa,_.N+=(F-1>>1)*_.Ab,_.Ab=-_.Ab,_.W+=(F-1>>1)*_.Db,_.Db=-_.Db,_.F!=null&&(_.J+=(F-1)*_.lb,_.lb=-_.lb);return 0}function Yc(F,_,z,J){if(J==null||0>=F||0>=_)return 2;if(z!=null){if(z.Da){var ne=z.cd,le=z.bd,ue=-2&z.v,pe=-2&z.j;if(0>ue||0>pe||0>=ne||0>=le||ue+ne>F||pe+le>_)return 2;F=ne,_=le}if(z.da){if(!tt(F,_,ne=[z.ib],le=[z.hb]))return 2;F=ne[0],_=le[0]}}J.width=F,J.height=_;e:{var ye=J.width,Se=J.height;if(F=J.S,0>=ye||0>=Se||!(F>=Wm&&13>F))F=2;else{if(0>=J.Rd&&J.sd==null){ue=le=ne=_=0;var Ie=(pe=ye*Fb[F])*Se;if(11>F||(le=(Se+1)/2*(_=(ye+1)/2),F==12&&(ue=(ne=ye)*Se)),(Se=i(Ie+2*le+ue))==null){F=1;break e}J.sd=Se,11>F?((ye=J.f.RGBA).eb=Se,ye.fb=0,ye.A=pe,ye.size=Ie):((ye=J.f.kb).y=Se,ye.O=0,ye.fa=pe,ye.Fd=Ie,ye.f=Se,ye.N=0+Ie,ye.Ab=_,ye.Cd=le,ye.ea=Se,ye.W=0+Ie+le,ye.Db=_,ye.Ed=le,F==12&&(ye.F=Se,ye.J=0+Ie+2*le),ye.Tc=ue,ye.lb=ne)}if(_=1,ne=J.S,le=J.width,ue=J.height,ne>=Wm&&13>ne)if(11>ne)F=J.f.RGBA,_&=(pe=Math.abs(F.A))*(ue-1)+le<=F.size,_&=pe>=le*Fb[ne],_&=F.eb!=null;else{F=J.f.kb,pe=(le+1)/2,Ie=(ue+1)/2,ye=Math.abs(F.fa),Se=Math.abs(F.Ab);var Ze=Math.abs(F.Db),Fe=Math.abs(F.lb),He=Fe*(ue-1)+le;_&=ye*(ue-1)+le<=F.Fd,_&=Se*(Ie-1)+pe<=F.Cd,_=(_&=Ze*(Ie-1)+pe<=F.Ed)&ye>=le&Se>=pe&Ze>=pe,_&=F.y!=null,_&=F.f!=null,_&=F.ea!=null,ne==12&&(_&=Fe>=le,_&=He<=F.Tc,_&=F.F!=null)}else _=0;F=_?0:2}}return F!=0||z!=null&&z.fd&&(F=Pm(J)),F}var Ou=64,ya=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],Ji=24,Zc=32,Ko=8,uc=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];ce("Predictor0","PredictorAdd0"),A.Predictor0=function(){return 4278190080},A.Predictor1=function(F){return F},A.Predictor2=function(F,_,z){return _[z+0]},A.Predictor3=function(F,_,z){return _[z+1]},A.Predictor4=function(F,_,z){return _[z-1]},A.Predictor5=function(F,_,z){return ge(ge(F,_[z+1]),_[z+0])},A.Predictor6=function(F,_,z){return ge(F,_[z-1])},A.Predictor7=function(F,_,z){return ge(F,_[z+0])},A.Predictor8=function(F,_,z){return ge(_[z-1],_[z+0])},A.Predictor9=function(F,_,z){return ge(_[z+0],_[z+1])},A.Predictor10=function(F,_,z){return ge(ge(F,_[z-1]),ge(_[z+0],_[z+1]))},A.Predictor11=function(F,_,z){var J=_[z+0];return 0>=be(J>>24&255,F>>24&255,(_=_[z-1])>>24&255)+be(J>>16&255,F>>16&255,_>>16&255)+be(J>>8&255,F>>8&255,_>>8&255)+be(255&J,255&F,255&_)?J:F},A.Predictor12=function(F,_,z){var J=_[z+0];return(Ge((F>>24&255)+(J>>24&255)-((_=_[z-1])>>24&255))<<24|Ge((F>>16&255)+(J>>16&255)-(_>>16&255))<<16|Ge((F>>8&255)+(J>>8&255)-(_>>8&255))<<8|Ge((255&F)+(255&J)-(255&_)))>>>0},A.Predictor13=function(F,_,z){var J=_[z-1];return(Je((F=ge(F,_[z+0]))>>24&255,J>>24&255)<<24|Je(F>>16&255,J>>16&255)<<16|Je(F>>8&255,J>>8&255)<<8|Je(255&F,255&J))>>>0};var bo=A.PredictorAdd0;A.PredictorAdd1=Pe,ce("Predictor2","PredictorAdd2"),ce("Predictor3","PredictorAdd3"),ce("Predictor4","PredictorAdd4"),ce("Predictor5","PredictorAdd5"),ce("Predictor6","PredictorAdd6"),ce("Predictor7","PredictorAdd7"),ce("Predictor8","PredictorAdd8"),ce("Predictor9","PredictorAdd9"),ce("Predictor10","PredictorAdd10"),ce("Predictor11","PredictorAdd11"),
vendor: 5,362 bytes, line 1146
1146ce("Predictor12","PredictorAdd12"),ce("Predictor13","PredictorAdd13");var dc=A.PredictorAdd2;dt("ColorIndexInverseTransform","MapARGB","32b",function(F){return F>>8&255},function(F){return F}),dt("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(F){return F},function(F){return F>>8&255});var Tn,Mp=A.ColorIndexInverseTransform,Sl=A.MapARGB,ci=A.VP8LColorIndexInverseTransformAlpha,ui=A.MapAlpha,Xd=A.VP8LPredictorsAdd=[];Xd.length=16,(A.VP8LPredictors=[]).length=16,(A.VP8LPredictorsAdd_C=[]).length=16,(A.VP8LPredictors_C=[]).length=16;var Rm,Bm,Xc,Qc,eu,vo,Ue,st,et,Ut,Jt,Nr,ss,$r,Jo,Lm,Da,zu,hb,Uu,Im,Om,Rs,mb,Qd,zm,fb,pb,gb=i(511),Um=i(2041),hc=i(225),Hm=i(767),Zx=0,eh=Um,$m=hc,Ci=Hm,di=gb,Wm=0,tu=1,ru=2,Hu=3,Pp=4,Xx=5,xb=6,th=7,rh=8,sh=9,Qx=10,yb=[2,3,7],Fj=[3,3,11],bb=[280,256,256,256,40],Xn=[0,1,1,1,0],Ga=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Sj=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Cj=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],vb=8,ey=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],qm=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],mc=null,ty=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],nh=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],ah=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],Gm=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,25
11465,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],Rp=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,
11461,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],ih=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,25
vendor: 4,897 bytes, line 1146
11465,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],kj=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],su=[],Yo=[],fc=[],_j=1,Vm=2,wo=[],Yi=[];Si("UpsampleRgbLinePair",oc,3),Si("UpsampleBgrLinePair",Aa,3),Si("UpsampleRgbaLinePair",Vs,4),Si("UpsampleBgraLinePair",Zd,4),Si("UpsampleArgbLinePair",Dm,4),Si("UpsampleRgba4444LinePair",cc,2),Si("UpsampleRgb565LinePair",lc,2);var de=A.UpsampleRgbLinePair,oh=A.UpsampleBgrLinePair,Km=A.UpsampleRgbaLinePair,Zi=A.UpsampleBgraLinePair,ps=A.UpsampleArgbLinePair,wb=A.UpsampleRgba4444LinePair,Ej=A.UpsampleRgb565LinePair,Bp=16,Cl=1<<Bp-1,Jm=-227,ry=482,Aj=6,jb=0,Dj=i(256),pc=i(256),Tj=i(256),Mj=i(256),Pj=i(ry-Jm),Rj=i(ry-Jm);Vo("YuvToRgbRow",oc,3),Vo("YuvToBgrRow",Aa,3),Vo("YuvToRgbaRow",Vs,4),Vo("YuvToBgraRow",Zd,4),Vo("YuvToArgbRow",Dm,4),Vo("YuvToRgba4444Row",cc,2),Vo("YuvToRgb565Row",lc,2);var Nb=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],jo=[0,2,8],Bj=[8,7,6,4,4,2,2,2,1,1,1,1],Lj=1;this.WebPDecodeRGBA=function(F,_,z,J,ne){var le=tu,ue=new it,pe=new zr;ue.ba=pe,pe.S=le,pe.width=[pe.width],pe.height=[pe.height];var ye=pe.width,Se=pe.height,Ie=new xr;if(Ie==null||F==null)var Ze=2;else e(Ie!=null),Ze=Iu(F,_,z,Ie.width,Ie.height,Ie.Pd,Ie.Qd,Ie.format,null);if(Ze!=0?ye=0:(ye!=null&&(ye[0]=Ie.width[0]),Se!=null&&(Se[0]=Ie.height[0]),ye=1),ye){pe.width=pe.width[0],pe.height=pe.height[0],J!=null&&(J[0]=pe.width),ne!=null&&(ne[0]=pe.height);e:{if(J=new Mu,(ne=new yt).data=F,ne.w=_,ne.ha=z,ne.kd=1,_=[0],e(ne!=null),((F=Iu(ne.data,ne.w,ne.ha,null,null,null,_,null,ne))==0||F==7)&&_[0]&&(F=4),(_=F)==0){if(e(ue!=null),J.data=ne.data,J.w=ne.w+ne.offset,J.ha=ne.ha-ne.offset,J.put=hr,J.ac=wn,J.bc=ga,J.ma=ue,ne.xa){if((F=Du())==null){ue=1;break e}if(function(Fe,He){var Ke=[0],nt=[0],Ye=[0];t:for(;;){if(Fe==null)return 0;if(He==null)return Fe.a=2,0;if(Fe.l=He,Fe.a=0,$(Fe.m,He.data,He.w,He.ha),!Jn(Fe.m,Ke,nt,Ye)){Fe.a=3;break t}if(Fe.xb=Vm,He.width=Ke[0],He.height=nt[0],!yl(Ke[0],nt[0],1,Fe,null))break t;return 1}return e(Fe.a!=0),0}(F,J)){if(J=(_=Yc(J.width,J.height,ue.Oa,ue.ba))==0){t:{J=F;r:for(;;){if(J==null){J=0;break t}if(e(J.s.yc!=null),e(J.s.Ya!=null),e(0<J.s.Wb),e((z=J.l)!=null),e((ne=z.ma)!=null),J.xb!=0){if(J.ca=ne.ba,J.tb=ne.tb,e(J.ca!=null),!Mm(ne.Oa,z,Hu)){J.a=2;break r}if(!Tu(J,z.width)||z.da)break r;if((z.da||ir(J.ca.S))&&Fi(),11>J.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),J.ca.f.kb.F!=null&&Fi()),J.Pb&&0<J.s.ua&&J.s.vb.X==null&&!ae(J.s.vb,J.s.Wa.Xa)){J.a=1;break r}J.xb=0}if(!po(J,J.V,J.Ba,J.c,J.i,z.o,Gc))break r;ne.Dc=J.Ma,J=1;break t}e(J.a!=0),J=0}J=!J}J&&(_=F.a)}else _=F.a}else{if((F=new _p)==null){ue=1;break e}if(F.Fa=ne.na,F.P=ne.P,F.qc=ne.Sa,vl(F,J)){if((_=Yc(J.width,J.height,ue.Oa,ue.ba))==0){if(F.Aa=0,z=ue.Oa,e((ne=F)!=null),z!=null){if(0<(ye=0>(ye=z.Md)?0:100<ye?255:255*ye/100)){for(Se=Ie=0;4>Se;++Se)12>(Ze=ne.pb[Se]).lc&&(Ze.ia=ye*Bj[0>Ze.lc?0:Ze.lc]>>3),Ie|=Ze.ia;Ie&&(alert("todo:VP8InitRandom"),ne.ia=1)}ne.Ga=z.Id,100<ne.Ga?ne.Ga=100:0>ne.Ga&&(ne.Ga=0)}(function(Fe,He){if(Fe==null)return 0;if(He==null)return An(Fe,2,"NULL VP8Io parameter in VP8Decode().");if(!Fe.cb&&!vl(Fe,He))return 0;if(e(Fe.cb),He.ac==null||He.ac(He)){He.ob&&(Fe.L=0);var Ke=jo[Fe.L];if(Fe.L==2?(Fe.yb=0,Fe.zb=0):(Fe.yb=He.v-Ke>>4,Fe.zb=He.j-Ke>>4,0>Fe.yb&&(Fe.yb=0),0>Fe.zb&&(Fe.zb=0)),Fe.Va=He.o+15+Ke>>4,Fe.Hb=He.va+15+Ke>>4,Fe.Hb>Fe.za&&(Fe.Hb=Fe.za),Fe.Va>Fe.Ub&&(Fe.Va=Fe.Ub),0<Fe.L){var nt=Fe.ed;for(Ke=0;4>Ke;++Ke){var Ye;if(Fe.Qa.Cb){var at=Fe.Qa.Lb[Ke];Fe.Qa.Fb||(at+=nt.Tb)}else at=nt.Tb;for(Ye=0;1>=Ye;++Ye){var lt=Fe.gd[Ke][Ye],jt=at;if(nt.Pc&&(jt+=nt.vd[0],Ye&&(jt+=nt.od[0])),0<(jt=0>jt?0:63<jt?63:jt)){var bt=jt;0<nt.wb&&(bt=4<nt.wb?bt>>2:bt>>1)>9-nt.wb&&(bt=9-nt.wb),1>bt&&(bt=1),lt.dd=bt,lt.tc=2*jt+bt,lt.ld=40<=jt?2:15<=jt?1:0}else lt.tc=0;lt.La=Ye}}}Ke=0}else An(Fe,6,"Frame setup failed"),Ke=Fe.a;if(Ke=Ke==0){if(Ke){Fe.$c=0,0<Fe.Aa||(Fe.Ic=Lj);t:{Ke=Fe.Ic,nt=4*(bt=Fe.za);var lr=32*bt,or=bt+1,Lr=0<Fe.L?bt*(0<Fe.Aa?2:1):0,Qt=(Fe.Aa==2?2:1)*bt;if((lt=nt+832+(Ye=3*(16*Ke+jo[Fe.L])/2*lr)+(at=Fe.Fa!=null&&0<Fe.Fa.length?Fe.Kc.c*Fe.Kc.i:0))!=lt)Ke=0;else{if(lt>Fe.Vb){if(Fe.Vb=0,Fe.Ec=i(lt),Fe.Fc=0,Fe.Ec==null){Ke=An(Fe,1,"n
1146o memory during frame initialization.");break t}Fe.Vb=lt}lt=Fe.Ec,jt=Fe.Fc,Fe.Ac=lt,Fe.Bc=jt,jt+=nt,Fe.Gd=o(lr,Cp),Fe.Hd=0,Fe.rb=o(or+1,Ud),Fe.sb=1,Fe.wa=Lr?o(Lr,xo):null,Fe.Y=0,Fe.D.Nb=0,Fe.D.wa=Fe.wa,Fe.D.Y=Fe.Y,0<Fe.Aa&&(Fe.D.Y+=bt),e(!0),Fe.oc=lt,Fe.pc=jt,jt+=832,Fe.ya=o(Qt,Hd),Fe.aa=0,Fe.D.ya=Fe.ya,Fe.D.aa=Fe.aa,Fe.Aa==2&&(Fe.D.aa+=bt),Fe.R=16*bt,Fe.B=8*bt,bt=(lr=jo[Fe.L])*Fe.R,lr=lr/2*Fe.B,Fe.sa=lt,Fe.ta=jt+bt,Fe.qa=Fe.sa,Fe.ra=Fe.ta+16*Ke*Fe.R+lr,Fe.Ha=Fe.qa,Fe.Ia=Fe.ra+8*Ke*Fe.B+lr,Fe.$c=0,jt+=Ye,Fe.mb=at?lt:null,Fe.nb=at?jt:null,e(jt+at<=Fe.Fc+Fe.Vb),Ru(Fe),a(Fe.Ac,Fe.Bc,0,nt),Ke=1}}if(Ke){if(He.ka=0,He.y=Fe.sa,He.O=Fe.ta,He.f=Fe.qa,He.N=Fe.ra,He.ea=Fe.Ha,He.Vd=Fe.Ia,He.fa=Fe.R,He.Rc=Fe.B,He.F=null,He.J=0,!Zx){for(Ke=-255;255>=Ke;++Ke)gb[255+Ke]=0>Ke?-Ke:Ke;for(Ke=-1020;1020>=Ke;++Ke)Um[1020+Ke]=-128>Ke?-128:127<Ke?127:Ke;for(Ke=-112;112>=Ke;++Ke)hc[112+Ke]=-16>Ke?-16:15<Ke?15:Ke;for(Ke=-255;510>=Ke;++Ke)Hm[255+Ke]=0>Ke?0:255<Ke?255:Ke;Zx=1}Ue=Wo,st=Hx,Ut=$o,Jt=Wd,Nr=qd,et=wm,ss=_m,$r=Jc,Jo=se,Lm=je,Da=Em,zu=L,hb=Re,Uu=$e,Im=sc,Om=Go,Rs=km,mb=Yd,Yo[0]=Vx,Yo[1]=Ep,Yo[2]=qx,Yo[3]=Gx,Yo[4]=qo,Yo[5]=Kx,Yo[6]=ec,Yo[7]=Jx,Yo[8]=Fm,Yo[9]=Vd,su[0]=Wx,su[1]=Ap,su[2]=Gd,su[3]=jm,su[4]=Bu,su[5]=Nm,su[6]=Dp,fc[0]=Yx,fc[1]=$x,fc[2]=Ps,fc[3]=Hs,fc[4]=Cm,fc[5]=Sm,fc[6]=Tp,Ke=1}else Ke=0}Ke&&(Ke=function(js,Un){for(js.M=0;js.M<js.Va;++js.M){var Kr,dr=js.Jc[js.M&js.Xb],_t=js.m,Nn=js;for(Kr=0;Kr<Nn.za;++Kr){var qr=_t,gs=Nn,an=gs.Ac,ba=gs.Bc+4*Kr,Bs=gs.zc,hn=gs.ya[gs.aa+Kr];if(gs.Qa.Bb?hn.$b=Ce(qr,gs.Pa.jb[0])?2+Ce(qr,gs.Pa.jb[2]):Ce(qr,gs.Pa.jb[1]):hn.$b=0,gs.kc&&(hn.Ad=Ce(qr,gs.Bd)),hn.Za=!Ce(qr,145)+0,hn.Za){var Ta=hn.Ob,mn=0;for(gs=0;4>gs;++gs){var Mn,ys=Bs[0+gs];for(Mn=0;4>Mn;++Mn){ys=Rp[an[ba+Mn]][ys];for(var Ns=ah[Ce(qr,ys[0])];0<Ns;)Ns=ah[2*Ns+Ce(qr,ys[Ns])];ys=-Ns,an[ba+Mn]=ys}n(Ta,mn,an,ba,4),mn+=4,Bs[0+gs]=ys}}else ys=Ce(qr,156)?Ce(qr,128)?1:3:Ce(qr,163)?2:0,hn.Ob[0]=ys,a(an,ba,ys,4),a(Bs,0,ys,4);hn.Dd=Ce(qr,142)?Ce(qr,114)?Ce(qr,183)?1:3:2:0}if(Nn.m.Ka)return An(js,7,"Premature end-of-partition0 encountered.");for(;js.ja<js.za;++js.ja){if(Nn=dr,qr=(_t=js).rb[_t.sb-1],an=_t.rb[_t.sb+_t.ja],Kr=_t.ya[_t.aa+_t.ja],ba=_t.kc?Kr.Ad:0)qr.la=an.la=0,Kr.Za||(qr.Na=an.Na=0),Kr.Hc=0,Kr.Gc=0,Kr.ia=0;else{var xn,Gr;if(qr=an,an=Nn,ba=_t.Pa.Xc,Bs=_t.ya[_t.aa+_t.ja],hn=_t.pb[Bs.$b],gs=Bs.ad,Ta=0,mn=_t.rb[_t.sb-1],ys=Mn=0,a(gs,Ta,0,384),Bs.Za)var Qn=0,Zo=ba[3];else{Ns=i(16);var Pn=qr.Na+mn.Na;if(Pn=mc(an,ba[1],Pn,hn.Eb,0,Ns,0),qr.Na=mn.Na=(0<Pn)+0,1<Pn)Ue(Ns,0,gs,Ta);else{var ki=Ns[0]+3>>3;for(Ns=0;256>Ns;Ns+=16)gs[Ta+Ns]=ki}Qn=1,Zo=ba[0]}var Us=15&qr.la,ea=15&mn.la;for(Ns=0;4>Ns;++Ns){var Ma=1&ea;for(ki=Gr=0;4>ki;++ki)Us=Us>>1|(Ma=(Pn=mc(an,Zo,Pn=Ma+(1&Us),hn.Sc,Qn,gs,Ta))>Qn)<<7,Gr=Gr<<2|(3<Pn?3:1<Pn?2:gs[Ta+0]!=0),Ta+=16;Us>>=4,ea=ea>>1|Ma<<7,Mn=(Mn<<8|Gr)>>>0}for(Zo=Us,Qn=ea>>4,xn=0;4>xn;xn+=2){for(Gr=0,Us=qr.la>>4+xn,ea=mn.la>>4+xn,Ns=0;2>Ns;++Ns){for(Ma=1&ea,ki=0;2>ki;++ki)Pn=Ma+(1&Us),Us=Us>>1|(Ma=0<(Pn=mc(an,ba[2],Pn,hn.Qc,0,gs,Ta)))<<3,Gr=Gr<<2|(3<Pn?3:1<Pn?2:gs[Ta+0]!=0),Ta+=16;Us>>=2,ea=ea>>1|Ma<<5}ys|=Gr<<4*xn,Zo|=Us<<4<<xn,Qn|=(240&ea)<<xn}qr.la=Zo,mn.la=Qn,Bs.Hc=Mn,Bs.Gc=ys,Bs.ia=43690&ys?0:hn.ia,ba=!(Mn|ys)}if(0<_t.L&&(_t.wa[_t.Y+_t.ja]=_t.gd[Kr.$b][Kr.Za],_t.wa[_t.Y+_t.ja].La|=!ba),Nn.Ka)return An(js,7,"Premature end-of-file encountered.")}if(Ru(js),_t=Un,Nn=1,Kr=(dr=js).D,qr=0<dr.L&&dr.M>=dr.zb&&dr.M<=dr.Va,dr.Aa==0)t:{if(Kr.M=dr.M,Kr.uc=qr,Ki(dr,Kr),Nn=1,Kr=(Gr=dr.D).Nb,qr=(ys=jo[dr.L])*dr.R,an=ys/2*dr.B,Ns=16*Kr*dr.R,ki=8*Kr*dr.B,ba=dr.sa,Bs=dr.ta-qr+Ns,hn=dr.qa,gs=dr.ra-an+ki,Ta=dr.Ha,mn=dr.Ia-an+ki,ea=(Us=Gr.M)==0,Mn=Us>=dr.Va-1,dr.Aa==2&&Ki(dr,Gr),Gr.uc)for(Ma=(Pn=dr).D.M,e(Pn.D.uc),Gr=Pn.yb;Gr<Pn.Hb;++Gr){Qn=Gr,Zo=Ma;var Va=(Xi=(Pa=Pn).D).Nb;xn=Pa.R;var Xi=Xi.wa[Xi.Y+Qn],Qi=Pa.sa,va=Pa.ta+16*Va*xn+16*Qn,eo=Xi.dd,en=Xi.tc;if(en!=0)if(e(3<=en),Pa.L==1)0<Qn&&Om(Qi,va,xn,en+4),Xi.La&&mb(Qi,va,xn,en),0<Zo&&Im(Qi,va,xn,en+4),Xi.La&&Rs(Qi,va,xn,en);else{var hi=Pa.B,No=Pa.qa,$u=Pa.ra+8*Va*hi+8*Qn,gc=Pa.Ha,Pa=Pa.Ia+8*Va*hi+8*Qn;Va=Xi.ld,0<Qn&&($r(Qi,va,xn,en+4,eo,Va),Lm(No,$u,gc,Pa,hi,en+4,eo,Va)),Xi.La&&(zu(Qi,va,xn,en,eo,Va),Uu(No,$u,gc,Pa,hi,en,eo,Va)),0<Zo&&(ss(Qi,va,xn,en+4,eo,Va),Jo(No,$u,gc,Pa,hi,en+4,eo,Va)),Xi.La&&(Da(Qi,va,xn,en,eo,Va),hb(No,$u,gc,Pa,hi,en,eo,Va))}}if(dr.ia&&alert("todo:DitherRow"),_t.put!=null){if(Gr=16*Us,Us=16*(Us+1),ea?(_t.y=dr.sa,_t.O=dr.ta+Ns,_t.f=
vendor: 13,118 bytes, line 1146
1146dr.qa,_t.N=dr.ra+ki,_t.ea=dr.Ha,_t.W=dr.Ia+ki):(Gr-=ys,_t.y=ba,_t.O=Bs,_t.f=hn,_t.N=gs,_t.ea=Ta,_t.W=mn),Mn||(Us-=ys),Us>_t.o&&(Us=_t.o),_t.F=null,_t.J=null,dr.Fa!=null&&0<dr.Fa.length&&Gr<Us&&(_t.J=$s(dr,_t,Gr,Us-Gr),_t.F=dr.mb,_t.F==null&&_t.F.length==0)){Nn=An(dr,3,"Could not decode alpha data.");break t}Gr<_t.j&&(ys=_t.j-Gr,Gr=_t.j,e(!(1&ys)),_t.O+=dr.R*ys,_t.N+=dr.B*(ys>>1),_t.W+=dr.B*(ys>>1),_t.F!=null&&(_t.J+=_t.width*ys)),Gr<Us&&(_t.O+=_t.v,_t.N+=_t.v>>1,_t.W+=_t.v>>1,_t.F!=null&&(_t.J+=_t.v),_t.ka=Gr-_t.j,_t.U=_t.va-_t.v,_t.T=Us-Gr,Nn=_t.put(_t))}Kr+1!=dr.Ic||Mn||(n(dr.sa,dr.ta-qr,ba,Bs+16*dr.R,qr),n(dr.qa,dr.ra-an,hn,gs+8*dr.B,an),n(dr.Ha,dr.Ia-an,Ta,mn+8*dr.B,an))}if(!Nn)return An(js,6,"Output aborted.")}return 1}(Fe,He)),He.bc!=null&&He.bc(He),Ke&=1}return Ke?(Fe.cb=0,Ke):0})(F,J)||(_=F.a)}}else _=F.a}_==0&&ue.Oa!=null&&ue.Oa.fd&&(_=Pm(ue.ba))}ue=_}le=ue!=0?null:11>le?pe.f.RGBA.eb:pe.f.kb.y}else le=null;return le};var Fb=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function u(A,R){for(var M="",P=0;P<4;P++)M+=String.fromCharCode(A[R++]);return M}function d(A,R){return A[R+0]|A[R+1]<<8}function h(A,R){return(A[R+0]|A[R+1]<<8|A[R+2]<<16)>>>0}function f(A,R){return(A[R+0]|A[R+1]<<8|A[R+2]<<16|A[R+3]<<24)>>>0}new c;var m=[0],g=[0],y=[],b=new c,w=t,j=function(A,R){var M={},P=0,U=!1,I=0,O=0;if(M.frames=[],!function(K,H){for(var X=0;X<4;X++)if(K[H+X]!="RIFF".charCodeAt(X))return!0;return!1}(A,R)){for(f(A,R+=4),R+=8;R<A.length;){var V=u(A,R),G=f(A,R+=4);R+=4;var B=G+(1&G);switch(V){case"VP8 ":case"VP8L":M.frames[P]===void 0&&(M.frames[P]={}),(oe=M.frames[P]).src_off=U?O:R-8,oe.src_size=I+G+8,P++,U&&(U=!1,I=0,O=0);break;case"VP8X":(oe=M.header={}).feature_flags=A[R];var $=R+4;oe.canvas_width=1+h(A,$),$+=3,oe.canvas_height=1+h(A,$),$+=3;break;case"ALPH":U=!0,I=B+8,O=R-8;break;case"ANIM":(oe=M.header).bgcolor=f(A,R),$=R+4,oe.loop_count=d(A,$),$+=2;break;case"ANMF":var W,oe;(oe=M.frames[P]={}).offset_x=2*h(A,R),R+=3,oe.offset_y=2*h(A,R),R+=3,oe.width=1+h(A,R),R+=3,oe.height=1+h(A,R),R+=3,oe.duration=h(A,R),R+=3,W=A[R++],oe.dispose=1&W,oe.blend=W>>1&1}V!="ANMF"&&(R+=B)}return M}}(w,0);j.response=w,j.rgbaoutput=!0,j.dataurl=!1;var N=j.header?j.header:null,S=j.frames?j.frames:null;if(N){N.loop_counter=N.loop_count,m=[N.canvas_height],g=[N.canvas_width];for(var E=0;E<S.length&&S[E].blend!=0;E++);}var C=S[0],T=b.WebPDecodeRGBA(w,C.src_off,C.src_size,g,m);C.rgba=T,C.imgwidth=g[0],C.imgheight=m[0];for(var D=0;D<g[0]*m[0]*4;D++)y[D]=T[D];return this.width=g,this.height=m,this.data=y,this}(function(t){var e,r,n,a,i,o,l,c,u,d=function(K){return K=K||{},this.isStrokeTransparent=K.isStrokeTransparent||!1,this.strokeOpacity=K.strokeOpacity||1,this.strokeStyle=K.strokeStyle||"#000000",this.fillStyle=K.fillStyle||"#000000",this.isFillTransparent=K.isFillTransparent||!1,this.fillOpacity=K.fillOpacity||1,this.font=K.font||"10px sans-serif",this.textBaseline=K.textBaseline||"alphabetic",this.textAlign=K.textAlign||"left",this.lineWidth=K.lineWidth||1,this.lineJoin=K.lineJoin||"miter",this.lineCap=K.lineCap||"butt",this.path=K.path||[],this.transform=K.transform!==void 0?K.transform.clone():new c,this.globalCompositeOperation=K.globalCompositeOperation||"normal",this.globalAlpha=K.globalAlpha||1,this.clip_path=K.clip_path||[],this.currentPoint=K.currentPoint||new o,this.miterLimit=K.miterLimit||10,this.lastPoint=K.lastPoint||new o,this.lineDashOffset=K.lineDashOffset||0,this.lineDash=K.lineDash||[],this.margin=K.margin||[0,0,0,0],this.prevPageLastElemOffset=K.prevPageLastElemOffset||0,this.ignoreClearRect=typeof K.ignoreClearRect!="boolean"||K.ignoreClearRect,this};t.events.push(["initialized",function(){this.context2d=new h(this),e=this.internal.f2,r=this.internal.getCoordinateString,n=this.internal.getVerticalCoordinateString,a=this.internal.getHorizontalCoordinate,i=this.internal.getVerticalCoordinate,o=this.internal.Point,l=this.internal.Rectangle,c=this.internal.Matrix,u=new d}]);var h=function(K){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var H=K;Object.defineProperty(this,"pdf",{get:function(){return H}});var X=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return X},set:function(ae){X=!!ae}});var me=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return me},set:function(ae){me=!!ae}});var ie=0;Object.defineProperty(this,"posX",{get:function(){return ie},set:function(ae){isNaN(ae)||(ie=ae)}});var ee=0;Object.defineProperty(this,"posY",{get:function(){return ee},set:function(ae){isNaN(ae)||(ee=ae)}}),Object.defineProperty(this,"margin",{get:function(){return u.margin},set:function(ae){var ze;typeof ae=="number"?ze=[ae,ae,ae,ae]:((ze=new Array(4))[0]=ae[0],ze[1]=ae.length>=2?ae[1]:ze[0],ze[2]=ae.length>=3?ae[2]:ze[0],ze[3]=ae.length>=4?ae[3]:ze[1]),u.margin=ze}});var he=!1;Object.defineProperty(this,"autoPaging",{get:function(){return he},set:function(ae){he=ae}});var ve=0;Object.defineProperty(this,"lastBreak",{get:function(){return ve},set:function(ae){ve=ae}});var Ce=[];Object.defineProperty(this,"pageBreaks",{get:function(){return Ce},set:function(ae){Ce=ae}}),Object.defineProperty(this,"ctx",{get:function(){return u},set:function(ae){ae instanceof d&&(u=ae)}}),Object.defineProperty(this,"path",{get:function(){return u.path},set:function(ae){u.path=ae}});var re=[];Object.defineProperty(this,"ctxStack",{get:function(){return re},set:function(ae){re=ae}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(ae){var ze;ze=f(ae),this.ctx.fillStyle=ze.style,this.ctx.isFillTransparent=ze.a===0,this.ctx.fillOpacity=ze.a,this.pdf.setFillColor(ze.r,ze.g,ze.b,{a:ze.a}),this.pdf.setTextColor(ze.r,ze.g,ze.b,{a:ze.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(ae){var ze=f(ae);this.ctx.strokeStyle=ze.style,this.ctx.isStrokeTransparent=ze.a===0,this.ctx.strokeOpacity=ze.a,ze.a===0?this.pdf.setDrawColor(255,255,255):(ze.a,this.pdf.setDrawColor(ze.r,ze.g,ze.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(ae){["butt","round","square"].indexOf(ae)!==-1&&(this.ctx.lineCap=ae,this.pdf.setLineCap(ae))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(ae){isNaN(ae)||(this.ctx.lineWidth=ae,this.pdf.setLineWidth(ae))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(ae){["bevel","round","miter"].indexOf(ae)!==-1&&(this.ctx.lineJoin=ae,this.pdf.setLineJoin(ae))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(ae){isNaN(ae)||(this.ctx.miterLimit=ae,this.pdf.setMiterLimit(ae))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(ae){this.ctx.textBaseline=ae}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(ae){["right","end","center","left","start"].indexOf(ae)!==-1&&(this.ctx.textAlign=ae)}});var we=null,Ee=null,Me=null;Object.defineProperty(this,"fontFaces",{get:function(){return Me},set:function(ae){we=null,Ee=null,Me=ae}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(ae){var ze;if(this.ctx.font=ae,(ze=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z0-9]+?)\s*$/i.exec(ae))!==null){var mt=ze[1];ze[2];var tt=ze[3],Xe=ze[4];ze[5];var Ft=ze[6],ce=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Xe)[2];Xe=Math.floor(ce==="px"?parseFloat(Xe)*this.pdf.internal.scaleFactor:ce==="em"?parseFloat(Xe)*this.pdf.getFontSize():parseFloat(Xe)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(Xe);var fe=function(dt){var Bt,Lt,Vt=[],cr=dt.trim();if(cr==="")return jN;if(cr in pD)return[pD[cr]];for(;cr!=="";){switch(Lt=null,Bt=(cr=xD(cr)).charAt(0)){case'"':case"'":Lt=NNe(cr.substring(1),Bt);break;default:Lt=FNe(cr)}if(Lt===null||(Vt.push(Lt[0]),(cr=xD(Lt[1]))!==""&&cr.charAt(0)!==","))return jN;cr=cr.replace(/^,/,"")}return Vt}(Ft);if(this.fontFaces){var ge=function(dt,Bt){var Lt=dt.getFontList(),Vt=JSON.stringify(Lt);if(we===null||Ee!==Vt){var cr=function(wr){var Xt=[];return Object.keys(wr).forEach(function(pt){wr[pt].forEach(function(ir){var jr=null;switch(ir){case"bold":jr={family:pt,weight:"bold"};break;case"italic":jr={family:pt,style:"italic"};break;case"bolditalic":jr={family:pt,weight:"bold",style:"italic"};break;case"":case"normal":jr={family:pt}}jr!==null&&(jr.ref={name:pt,style:ir},Xt.push(jr))})}),Xt}(Lt);we=function(wr){for(var Xt={},pt=0;pt<wr.length;++pt){var ir=wN(wr[pt]),jr=ir.family,rs=ir.stretch,zr=ir.style,xr=ir.weight;Xt[jr]=Xt[jr]||{},Xt[jr][rs]=Xt[jr][rs]||{},Xt[jr][rs][zr]=Xt[jr][rs][zr]||{},Xt[jr][rs][zr][xr]=ir}return Xt}(cr.concat(Bt)),Ee=Vt}return we}(this.pdf,this.fontFaces),Ge=fe.map(function(dt){return{family:dt,stretch:"normal",weight:tt,style:mt}}),Je=function(dt,Bt,Lt){for(var Vt=(Lt=Lt||{}).defaultFontFamily||"times",cr=Object.assign({},jNe,Lt.genericFontFamilies||{}),wr=null,Xt=null,pt=0;pt<Bt.length;++pt)if(cr[(wr=wN(Bt[pt])).family]&&(wr.family=cr[wr.family]),dt.hasOwnProperty(wr.family)){Xt=dt[wr.family];break}if(!(Xt=Xt||dt[Vt]))throw new Error("Could not find a font-family for the rule '"+gD(wr)+"' and default family '"+Vt+"'.");if(Xt=function(ir,jr){if(jr[ir])return jr[ir];var rs=MS[ir],zr=rs<=MS.normal?-1:1,xr=fD(jr,y7,rs,zr);if(!xr)throw new Error("Could not find a matching font-stretch value for "+ir);return xr}(wr.stretch,Xt),Xt=function(ir,jr){if(jr[ir])return jr[ir];for(var rs=x7[ir],zr=0;zr<rs.length;++zr)if(jr[rs[zr]])return jr[rs[zr]];throw new Error("Could not find a matching font-style for "+ir)}(wr.style,Xt),!(Xt=function(ir,jr){if(jr[ir])return jr[ir];if(ir===400&&jr[500])return jr[500];if(ir===500&&jr[400])return jr[400];var rs=wNe[ir],zr=fD(jr,b7,rs,ir<400?-1:1);if(!zr)throw new Error("Could not find a matching font-weight for value "+ir);return zr}(wr.weight,Xt)))throw new Error("Failed to resolve a font for the rule '"+gD(wr)+"'.");return Xt}(ge,Ge);this.pdf.setFont(Je.ref.name,Je.ref.style)}else{var be="";(tt==="bold"||parseInt(tt,10)>=700||mt==="bold")&&(be="bold"),mt==="italic"&&(be+="italic"),be.length===0&&(be="normal");for(var Pe="",qe={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},Qe=0;Qe<fe.length;Qe++){if(this.pdf.internal.getFont(fe[Qe],be,{noFallback:!0,disableWarning:!0})!==void 0){Pe=fe[Qe];break}if(be==="bolditalic"&&this.pdf.internal.getFont(fe[Qe],"bold",{noFallback:!0,disableWarning:!0})!==void 0)Pe=fe[Qe],be="bold";else if(this.pdf.internal.getFont(fe[Qe],"normal",{noFallback:!0,disableWarning:!0})!==void 0){Pe=fe[Qe],be="normal";break}}if(Pe===""){for(var We=0;We<fe.length;We++)if(qe[fe[We]]){Pe=qe[fe[We]];break}}Pe=Pe===""?"Times":Pe,this.pdf.setFont(Pe,be)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(ae){this.ctx.globalCompositeOperation=ae}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(ae){this.ctx.globalAlpha=ae}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(ae){this.ctx.lineDashOffset=ae,oe.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(ae){this.ctx.lineDash=ae,oe.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(ae){this.ctx.ignoreClearRect=!!ae}})};h.prototype.setLineDash=function(K){this.lineDash=K},h.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},h.prototype.fill=function(){S.call(this,"fill",!1)},h.prototype.stroke=function(){S.call(this,"stroke",!1)},h.prototype.beginPath=function(){this.path=[{type:"begin"}]},h.prototype.moveTo=function(K,H){if(isNaN(K)||isNaN(H))throw on.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var X=this.ctx.transform.applyToPoint(new o(K,H));this.path.push({type:"mt",x:X.x,y:X.y}),this.ctx.lastPoint=new o(K,H)},h.prototype.closePath=function(){var K=new o(0,0),H=0;for(H=this.path.length-1;H!==-1;H--)if(this.path[H].type==="begin"&&Ys(this.path[H+1])==="object"&&typeof this.path[H+1].x=="number"){K=new o(this.path[H+1].x,this.path[H+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new o(K.x,K.y)},h.prototype.lineTo=function(K,H){if(isNaN(K)||isNaN(H))throw on.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to
1146jsPDF.context2d.lineTo");var X=this.ctx.transform.applyToPoint(new o(K,H));this.path.push({type:"lt",x:X.x,y:X.y}),this.ctx.lastPoint=new o(X.x,X.y)},h.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),S.call(this,null,!0)},h.prototype.quadraticCurveTo=function(K,H,X,me){if(isNaN(X)||isNaN(me)||isNaN(K)||isNaN(H))throw on.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var ie=this.ctx.transform.applyToPoint(new o(X,me)),ee=this.ctx.transform.applyToPoint(new o(K,H));this.path.push({type:"qct",x1:ee.x,y1:ee.y,x:ie.x,y:ie.y}),this.ctx.lastPoint=new o(ie.x,ie.y)},h.prototype.bezierCurveTo=function(K,H,X,me,ie,ee){if(isNaN(ie)||isNaN(ee)||isNaN(K)||isNaN(H)||isNaN(X)||isNaN(me))throw on.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var he=this.ctx.transform.applyToPoint(new o(ie,ee)),ve=this.ctx.transform.applyToPoint(new o(K,H)),Ce=this.ctx.transform.applyToPoint(new o(X,me));this.path.push({type:"bct",x1:ve.x,y1:ve.y,x2:Ce.x,y2:Ce.y,x:he.x,y:he.y}),this.ctx.lastPoint=new o(he.x,he.y)},h.prototype.arc=function(K,H,X,me,ie,ee){if(isNaN(K)||isNaN(H)||isNaN(X)||isNaN(me)||isNaN(ie))throw on.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(ee=!!ee,!this.ctx.transform.isIdentity){var he=this.ctx.transform.applyToPoint(new o(K,H));K=he.x,H=he.y;var ve=this.ctx.transform.applyToPoint(new o(0,X)),Ce=this.ctx.transform.applyToPoint(new o(0,0));X=Math.sqrt(Math.pow(ve.x-Ce.x,2)+Math.pow(ve.y-Ce.y,2))}Math.abs(ie-me)>=2*Math.PI&&(me=0,ie=2*Math.PI),this.path.push({type:"arc",x:K,y:H,radius:X,startAngle:me,endAngle:ie,counterclockwise:ee})},h.prototype.arcTo=function(K,H,X,me,ie){throw new Error("arcTo not implemented.")},h.prototype.rect=function(K,H,X,me){if(isNaN(K)||isNaN(H)||isNaN(X)||isNaN(me))throw on.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(K,H),this.lineTo(K+X,H),this.lineTo(K+X,H+me),this.lineTo(K,H+me),this.lineTo(K,H),this.lineTo(K+X,H),this.lineTo(K,H)},h.prototype.fillRect=function(K,H,X,me){if(isNaN(K)||isNaN(H)||isNaN(X)||isNaN(me))throw on.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!m.call(this)){var ie={};this.lineCap!=="butt"&&(ie.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(ie.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(K,H,X,me),this.fill(),ie.hasOwnProperty("lineCap")&&(this.lineCap=ie.lineCap),ie.hasOwnProperty("lineJoin")&&(this.lineJoin=ie.lineJoin)}},h.prototype.strokeRect=function(K,H,X,me){if(isNaN(K)||isNaN(H)||isNaN(X)||isNaN(me))throw on.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");g.call(this)||(this.beginPath(),this.rect(K,H,X,me),this.stroke())},h.prototype.clearRect=function(K,H,X,me){if(isNaN(K)||isNaN(H)||isNaN(X)||isNaN(me))throw on.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(K,H,X,me))},h.prototype.save=function(K){K=typeof K!="boolean"||K;for(var H=this.pdf.internal.getCurrentPageInfo().pageNumber,X=0;X<this.pdf.internal.getNumberOfPages();X++)this.pdf.setPage(X+1),this.pdf.internal.out("q");if(this.pdf.setPage(H),K){this.ctx.fontSize=this.pdf.internal.getFontSize();var me=new d(this.ctx);this.ctxStack.push(this.ctx),this.ctx=me}},h.prototype.restore=function(K){K=typeof K!="boolean"||K;for(var H=this.pdf.internal.getCurrentPageInfo().pageNumber,X=0;X<this.pdf.internal.getNumberOfPages();X++)this.pdf.setPage(X+1),this.pdf.internal.out("Q");this.pdf.setPage(H),K&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},h.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var f=function(K){var H,X,me,ie;if(K.isCanvasGradient===!0&&(K=K.getColor()),!K)return{r:0,g:0,b:0,a:0,style:K};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(K))H=0,X=0,me=0,ie=0;else{var ee=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(K);if(ee!==null)H=parseInt(ee[1]),X=parseInt(ee[2]),me=parseInt(ee[3]),ie=1;else if((ee=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(K))!==null)H=parseInt(ee[1]),X=parseInt(ee[2]),me=parseInt(ee[3]),ie=parseFloat(ee[4]);else{if(ie=1,typeof K=="string"&&K.charAt(0)!=="#"){var he=new u7(K);K=he.ok?he.toHex():"#000000"}
vendor: 31,306 bytes, line 1146
1146K.length===4?(H=K.substring(1,2),H+=H,X=K.substring(2,3),X+=X,me=K.substring(3,4),me+=me):(H=K.substring(1,3),X=K.substring(3,5),me=K.substring(5,7)),H=parseInt(H,16),X=parseInt(X,16),me=parseInt(me,16)}}return{r:H,g:X,b:me,a:ie,style:K}},m=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},g=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};h.prototype.fillText=function(K,H,X,me){if(isNaN(H)||isNaN(X)||typeof K!="string")throw on.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(me=isNaN(me)?void 0:me,!m.call(this)){var ie=B(this.ctx.transform.rotation),ee=this.ctx.transform.scaleX;P.call(this,{text:K,x:H,y:X,scale:ee,angle:ie,align:this.textAlign,maxWidth:me})}},h.prototype.strokeText=function(K,H,X,me){if(isNaN(H)||isNaN(X)||typeof K!="string")throw on.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!g.call(this)){me=isNaN(me)?void 0:me;var ie=B(this.ctx.transform.rotation),ee=this.ctx.transform.scaleX;P.call(this,{text:K,x:H,y:X,scale:ee,renderingMode:"stroke",angle:ie,align:this.textAlign,maxWidth:me})}},h.prototype.measureText=function(K){if(typeof K!="string")throw on.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var H=this.pdf,X=this.pdf.internal.scaleFactor,me=H.internal.getFontSize(),ie=H.getStringUnitWidth(K)*me/H.internal.scaleFactor;return new function(ee){var he=(ee=ee||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return he}}),this}({width:ie*=Math.round(96*X/72*1e4)/1e4})},h.prototype.scale=function(K,H){if(isNaN(K)||isNaN(H))throw on.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var X=new c(K,0,0,H,0,0);this.ctx.transform=this.ctx.transform.multiply(X)},h.prototype.rotate=function(K){if(isNaN(K))throw on.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var H=new c(Math.cos(K),Math.sin(K),-Math.sin(K),Math.cos(K),0,0);this.ctx.transform=this.ctx.transform.multiply(H)},h.prototype.translate=function(K,H){if(isNaN(K)||isNaN(H))throw on.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var X=new c(1,0,0,1,K,H);this.ctx.transform=this.ctx.transform.multiply(X)},h.prototype.transform=function(K,H,X,me,ie,ee){if(isNaN(K)||isNaN(H)||isNaN(X)||isNaN(me)||isNaN(ie)||isNaN(ee))throw on.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var he=new c(K,H,X,me,ie,ee);this.ctx.transform=this.ctx.transform.multiply(he)},h.prototype.setTransform=function(K,H,X,me,ie,ee){K=isNaN(K)?1:K,H=isNaN(H)?0:H,X=isNaN(X)?0:X,me=isNaN(me)?1:me,ie=isNaN(ie)?0:ie,ee=isNaN(ee)?0:ee,this.ctx.transform=new c(K,H,X,me,ie,ee)};var y=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};h.prototype.drawImage=function(K,H,X,me,ie,ee,he,ve,Ce){var re=this.pdf.getImageProperties(K),we=1,Ee=1,Me=1,ae=1;me!==void 0&&ve!==void 0&&(Me=ve/me,ae=Ce/ie,we=re.width/me*ve/me,Ee=re.height/ie*Ce/ie),ee===void 0&&(ee=H,he=X,H=0,X=0),me!==void 0&&ve===void 0&&(ve=me,Ce=ie),me===void 0&&ve===void 0&&(ve=re.width,Ce=re.height);var ze=this.ctx.transform.decompose(),mt=B(ze.rotate.shx),tt=new c,Xe=(tt=(tt=(tt=tt.multiply(ze.translate)).multiply(ze.skew)).multiply(ze.scale)).applyToRectangle(new l(ee-H*Me,he-X*ae,me*we,ie*Ee));if(this.autoPaging){for(var Ft,ce=b.call(this,Xe),fe=[],ge=0;ge<ce.length;ge+=1)fe.indexOf(ce[ge])===-1&&fe.push(ce[ge]);N(fe);for(var Ge=fe[0],Je=fe[fe.length-1],be=Ge;be<Je+1;be++){this.pdf.setPage(be);var Pe=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],qe=be===1?this.posY+this.margin[0]:this.margin[0],Qe=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],We=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],dt=be===1?0:Qe+(be-2)*We;if(this.ctx.clip_path.length!==0){var Bt=this.path;Ft=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=j(Ft,this.posX+this.margin[3],-dt+qe+this.ctx.prevPageLastElemOffset),E.call(this,"fill",!0),this.path=Bt}var Lt=JSON.parse(JSON.stringify(Xe));Lt=j([Lt],this.posX+this.margin[3],-dt+qe+this.ctx.prevPageLastElemOffset)[0];var Vt=(be>Ge||be<Je)&&y.call(this);Vt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Pe,We,null).clip().discardPath()),this.pdf.addImage(K,"JPEG",Lt.x,Lt.y,Lt.w,Lt.h,null,null,mt),Vt&&this.pdf.restoreGraphicsState()}}else this.pdf.addImage(K,"JPEG",Xe.x,Xe.y,Xe.w,Xe.h,null,null,mt)};var b=function(K,H,X){var me=[];H=H||this.pdf.internal.pageSize.width,X=X||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var ie=this.posY+this.ctx.prevPageLastElemOffset;switch(K.type){default:case"mt":case"lt":me.push(Math.floor((K.y+ie)/X)+1);break;case"arc":me.push(Math.floor((K.y+ie-K.radius)/X)+1),me.push(Math.floor((K.y+ie+K.radius)/X)+1);break;case"qct":var ee=$(this.ctx.lastPoint.x,this.ctx.lastPoint.y,K.x1,K.y1,K.x,K.y);me.push(Math.floor((ee.y+ie)/X)+1),me.push(Math.floor((ee.y+ee.h+ie)/X)+1);break;case"bct":var he=W(this.ctx.lastPoint.x,this.ctx.lastPoint.y,K.x1,K.y1,K.x2,K.y2,K.x,K.y);me.push(Math.floor((he.y+ie)/X)+1),me.push(Math.floor((he.y+he.h+ie)/X)+1);break;case"rect":me.push(Math.floor((K.y+ie)/X)+1),me.push(Math.floor((K.y+K.h+ie)/X)+1)}for(var ve=0;ve<me.length;ve+=1)for(;this.pdf.internal.getNumberOfPages()<me[ve];)w.call(this);return me},w=function(){var K=this.fillStyle,H=this.strokeStyle,X=this.font,me=this.lineCap,ie=this.lineWidth,ee=this.lineJoin;this.pdf.addPage(),this.fillStyle=K,this.strokeStyle=H,this.font=X,this.lineCap=me,this.lineWidth=ie,this.lineJoin=ee},j=function(K,H,X){for(var me=0;me<K.length;me++)switch(K[me].type){case"bct":K[me].x2+=H,K[me].y2+=X;case"qct":K[me].x1+=H,K[me].y1+=X;default:K[me].x+=H,K[me].y+=X}return K},N=function(K){return K.sort(function(H,X){return H-X})},S=function(K,H){var X=this.fillStyle,me=this.strokeStyle,ie=this.lineCap,ee=this.lineWidth,he=Math.abs(ee*this.ctx.transform.scaleX),ve=this.lineJoin;if(this.autoPaging){for(var Ce,re,we=JSON.parse(JSON.stringify(this.path)),Ee=JSON.parse(JSON.stringify(this.path)),Me=[],ae=0;ae<Ee.length;ae++)if(Ee[ae].x!==void 0)for(var ze=b.call(this,Ee[ae]),mt=0;mt<ze.length;mt+=1)Me.indexOf(ze[mt])===-1&&Me.push(ze[mt]);for(var tt=0;tt<Me.length;tt++)for(;this.pdf.internal.getNumberOfPages()<Me[tt];)w.call(this);N(Me);for(var Xe=Me[0],Ft=Me[Me.length-1],ce=Xe;ce<Ft+1;ce++){this.pdf.setPage(ce),this.fillStyle=X,this.strokeStyle=me,this.lineCap=ie,this.lineWidth=he,this.lineJoin=ve;var fe=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],ge=ce===1?this.posY+this.margin[0]:this.margin[0],Ge=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Je=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],be=ce===1?0:Ge+(ce-2)*Je;if(this.ctx.clip_path.length!==0){var Pe=this.path;Ce=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=j(Ce,this.posX+this.margin[3],-be+ge+this.ctx.prevPageLastElemOffset),E.call(this,K,!0),this.path=Pe}if(re=JSON.parse(JSON.stringify(we)),this.path=j(re,this.posX+this.margin[3],-be+ge+this.ctx.prevPageLastElemOffset),H===!1||ce===0){var qe=(ce>Xe||ce<Ft)&&y.call(this);qe&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],fe,Je,null).clip().discardPath()),E.call(this,K,H),qe&&this.pdf.restoreGraphicsState()}this.lineWidth=ee}this.path=we}else this.lineWidth=he,E.call(this,K,H),this.lineWidth=ee},E=function(K,H){if((K!=="stroke"||H||!g.call(this))&&(K==="stroke"||H||!m.call(this))){for(var X,me,ie=[],ee=this.path,he=0;he<ee.length;he++){var ve=ee[he];switch(ve.type){case"begin":ie.push({begin:!0});break;case"close":ie.push({close:!0});break;case"mt":ie.push({start:ve,deltas:[],abs:[]});break;case"lt":var Ce=ie.length;if(ee[he-1]&&!isNaN(ee[he-1].x)&&(X=[ve.x-ee[he-1].x,ve.y-ee[he-1].y],Ce>0)){for(;Ce>=0;Ce--)if(ie[Ce-1].close!==!0&&ie[Ce-1].begin!==!0){ie[Ce-1].deltas.push(X),ie[Ce-1].abs.push(ve);break}}break;case"bct":X=[ve.x1-ee[he-1].x,ve.y1-ee[he-1].y,ve.x2-ee[he-1].x,ve.y2-ee[he-1].y,ve.x-ee[he-1].x,ve.y-ee[he-1].y],ie[ie.length-1].deltas.push(X);break;case"qct":var re=ee[he-1].x+2/3*(ve.x1-ee[he-1].x),we=ee[he-1].y+2/3*(ve.y1-ee[he-1].y),Ee=ve.x+2/3*(ve.x1-ve.x),Me=ve.y+2/3*(ve.y1-ve.y),ae=ve.x,ze=ve.y;X=[re-ee[he-1].x,we-ee[he-1].y,Ee-ee[he-1].x,Me-ee[he-1].y,ae-ee[he-1].x,ze-ee[he-1].y],ie[ie.length-1].deltas.push(X);break;case"arc":ie.push({deltas:[],abs:[],arc:!0}),Array.isArray(ie[ie.length-1].abs)&&ie[ie.length-1].abs.push(ve)}}me=H?null:K==="stroke"?"stroke":"fill";for(var mt=!1,tt=0;tt<ie.length;tt++)if(ie[tt].arc)for(var Xe=ie[tt].abs,Ft=0;Ft<Xe.length;Ft++){var ce=Xe[Ft];ce.type==="arc"?D.call(this,ce.x,ce.y,ce.radius,ce.startAngle,ce.endAngle,ce.counterclockwise,void 0,H,!mt):U.call(this,ce.x,ce.y),mt=!0}else if(ie[tt].close===!0)this.pdf.internal.out("h"),mt=!1;else if(ie[tt].begin!==!0){var fe=ie[tt].start.x,ge=ie[tt].start.y;I.call(this,ie[tt].deltas,fe,ge),mt=!0}me&&A.call(this,me),H&&R.call(this)}},C=function(K){var H=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,X=H*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return K-X;case"top":return K+H-X;case"hanging":return K+H-2*X;case"middle":return K+H/2-X;default:return K}},T=function(K){return K+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};h.prototype.createLinearGradient=function(){var K=function(){};return K.colorStops=[],K.addColorStop=function(H,X){this.colorStops.push([H,X])},K.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},K.isCanvasGradient=!0,K},h.prototype.createPattern=function(){return this.createLinearGradient()},h.prototype.createRadialGradient=function(){return this.createLinearGradient()};var D=function(K,H,X,me,ie,ee,he,ve,Ce){for(var re=V.call(this,X,me,ie,ee),we=0;we<re.length;we++){var Ee=re[we];we===0&&(Ce?M.call(this,Ee.x1+K,Ee.y1+H):U.call(this,Ee.x1+K,Ee.y1+H)),O.call(this,K,H,Ee.x2,Ee.y2,Ee.x3,Ee.y3,Ee.x4,Ee.y4)}ve?R.call(this):A.call(this,he)},A=function(K){switch(K){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},R=function(){this.pdf.clip(),this.pdf.discardPath()},M=function(K,H){this.pdf.internal.out(r(K)+" "+n(H)+" m")},P=function(K){var H;switch(K.align){case"right":case"end":H="right";break;case"center":H="center";break;default:H="left"}var X,me,ie,ee=this.pdf.getTextDimensions(K.text),he=C.call(this,K.y),ve=T.call(this,he)-ee.h,Ce=this.ctx.transform.applyToPoint(new o(K.x,he));if(this.autoPaging){var re=this.ctx.transform.decompose(),we=new c;we=(we=(we=we.multiply(re.translate)).multiply(re.skew)).multiply(re.scale);for(var Ee=this.ctx.transform.applyToRectangle(new l(K.x,he,ee.w,ee.h)),Me=we.applyToRectangle(new l(K.x,ve,ee.w,ee.h)),ae=b.call(this,Me),ze=[],mt=0;mt<ae.length;mt+=1)ze.indexOf(ae[mt])===-1&&ze.push(ae[mt]);N(ze);for(var tt=ze[0],Xe=ze[ze.length-1],Ft=tt;Ft<Xe+1;Ft++){this.pdf.setPage(Ft);var ce=Ft===1?this.posY+this.margin[0]:this.margin[0],fe=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],ge=this.pdf.internal.pageSize.height-this.margin[2],Ge=ge-this.margin[0],Je=this.pdf.internal.pageSize.width-this.margin[1],be=Je-this.margin[3],Pe=Ft===1?0:fe+(Ft-2)*Ge;if(this.ctx.clip_path.length!==0){var qe=this.path;X=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=j(X,this.posX+this.margin[3],-1*Pe+ce),E.call(this,"fill",!0),this.path=qe}var Qe=j([JSON.parse(JSON.stringify(Me))],this.posX+this.margin[3],-Pe+ce+this.ctx.prevPageLastElemOffset)[0];K.scale>=.01&&(me=this.pdf.internal.getFontSize(),this.pdf.setFontSize(me*K.scale),ie=this.lineWidth,this.lineWidth=ie*K.scale);var We=this.autoPaging!=="text";if(We||Qe.y+Qe.h<=ge){if(We||Qe.y>=ce&&Qe.x<=Je){var dt=We?K.text:this.pdf.splitTextToSize(K.text,K.maxWidth||Je-Qe.x)[0],Bt=j([JSON.parse(JSON.stringify(Ee))],this.posX+this.margin[3],-Pe+ce+this.ctx.prevPageLastElemOffset)[0],Lt=We&&(Ft>tt||Ft<Xe)&&y.call(this);Lt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],be,Ge,null).clip().discardPath()),this.pdf.text(dt,Bt.x,Bt.y,{angle:K.angle,align:H,renderingMode:K.renderingMode}),Lt&&this.pdf.restoreGraphicsState()}}else Qe.y<ge&&(this.ctx.prevPageLastElemOffset+=ge-Qe.y);K.scale>=.01&&(this.pdf.setFontSize(me),this.lineWidth=ie)}}else K.scale>=.01&&(me=this.pdf.internal.getFontSize(),this.pdf.setFontSize(me*K.scale),ie=this.lineWidth,this.lineWidth=ie*K.scale),this.pdf.text(K.text,Ce.x+this.posX,Ce.y+this.posY,{angle:K.angle,align:H,renderingMode:K.renderingMode,maxWidth:K.maxWidth}),K.scale>=.01&&(this.pdf.setFontSize(me),this.lineWidth=ie)},U=function(K,H,X,me){X=X||0,me=me||0,this.pdf.internal.out(r(K+X)+" "+n(H+me)+" l")},I=function(K,H,X){return this.pdf.lines(K,H,X,null,null)},O=function(K,H,X,me,ie,ee,he,ve){this.pdf.internal.out([e(a(X+K)),e(i(me+H)),e(a(ie+K)),e(i(ee+H)),e(a(he+K)),e(i(ve+H)),"c"].join(" "))},V=function(K,H,X,me){for(var ie=2*Math.PI,ee=Math.PI/2;H>X;)H-=ie;var he=Math.abs(X-H);he<ie&&me&&(he=ie-he);for(var ve=[],Ce=me?-1:1,re=H;he>1e-5;){var we=re+Ce*Math.min(he,ee);ve.push(G.call(this,K,re,we)),he-=Math.abs(we-re),re=we}return ve},G=function(K,H,X){var me=(X-H)/2,ie=K*Math.cos(me),ee=K*Math.sin(me),he=ie,ve=-ee,Ce=he*he+ve*ve,re=Ce+he*ie+ve*ee,we=4/3*(Math.sqrt(2*Ce*re)-re)/(he*ee-ve*ie),Ee=he-we*ve,Me=ve+we*he,ae=Ee,ze=-Me,mt=me+H,tt=Math.cos(mt),Xe=Math.sin(mt);return{x1:K*Math.cos(H),y1:K*Math.sin(H),x2:Ee*tt-Me*Xe,y2:Ee*Xe+Me*tt,x3:ae*tt-ze*Xe,y3:ae*Xe+ze*tt,x4:K*Math.cos(X),y4:K*Math.sin(X)}},B=function(K){return 180*K/Math.PI},$=function(K,H,X,me,ie,ee){var he=K+.5*(X-K),ve=H+.5*(me-H),Ce=ie+.5*(X-ie),re=ee+.5*(me-ee),we=Math.min(K,ie,he,Ce),Ee=Math.max(K,ie,he,Ce),Me=Math.min(H,ee,ve,re),ae=Math.max(H,ee,ve,re);return new l(we,Me,Ee-we,ae-Me)},W=function(K,H,X,me,ie,ee,he,ve){var Ce,re,we,Ee,Me,ae,ze,mt,tt,Xe,Ft,ce,fe,ge,Ge=X-K,Je=me-H,be=ie-X,Pe=ee-me,qe=he-ie,Qe=ve-ee;for(re=0;re<41;re++)tt=(ze=(we=K+(Ce=re/40)*Ge)+Ce*((Me=X+Ce*be)-we))+Ce*(Me+Ce*(ie+Ce*qe-Me)-ze),Xe=(mt=(Ee=H+Ce*Je)+Ce*((ae=me+Ce*Pe)-Ee))+Ce*(ae+Ce*(ee+Ce*Qe-ae)-mt),re==0?(Ft=tt,ce=Xe,fe=tt,ge=Xe):(Ft=Math.min(Ft,tt),ce=Math.min(ce,Xe),fe=Math.max(fe,tt),ge=Math.max(ge,Xe));return new l(Math.round(Ft),Math.round(ce),Math.round(fe-Ft),Math.round(ge-ce))},oe=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var K,H,X=(K=this.ctx.lineDash,H=this.ctx.lineDashOffset,JSON.stringify({lineDash:K,lineDashOffset:H}));this.prevLineDash!==X&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=X)}}})(Fr.API),function(t){var e=function(o){var l,c,u,d,h,f,m,g,y,b;for(c=[],u=0,d=(o+=l="\0\0\0\0".slice(o.length%4||4)).length;d>u;u+=4)(h=(o.charCodeAt(u)<<24)+(o.charCodeAt(u+1)<<16)+(o.charCodeAt(u+2)<<8)+o.charCodeAt(u+3))!==0?(f=(h=((h=((h=((h=(h-(b=h%85))/85)-(y=h%85))/85)-(g=h%85))/85)-(m=h%85))/85)%85,c.push(f+33,m+33,g+33,y+33,b+33)):c.push(122);return function(w,j){for(var N=j;N>0;N--)w.pop()}(c,l.length),String.fromCharCode.apply(String,c)+"~>"},r=function(o){var l,c,u,d,h,f=String,m="length",g=255,y="charCodeAt",b="slice",w="replace";for(o[b](-2),o=o[b](0,-2)[w](/\s/g,"")[w]("z","!!!!!"),u=[],d=0,h=(o+=l="uuuuu"[b](o[m]%5||5))[m];h>d;d+=5)c=52200625*(o[y](d)-33)+614125*(o[y](d+1)-33)+7225*(o[y](d+2)-33)+85*(o[y](d+3)-33)+(o[y](d+4)-33),u.push(g&c>>24,g&c>>16,g&c>>8,g&c);return function(j,N){for(var S=N;S>0;S--)j.pop()}(u,l[m]),f.fromCharCode.apply(f,u)},n=function(o){return o.split("").map(function(l){return("0"+l.charCodeAt().toString(16)).slice(-2)}).join("")+">"},a=function(o){var l=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((o=o.replace(/\s/g,"")).indexOf(">")!==-1&&(o=o.substr(0,o.indexOf(">"))),o.length%2&&(o+="0"),l.test(o)===!1)return"";for(var c="",u=0;u<o.length;u+=2)c+=String.fromCharCode("0x"+(o[u]+o[u+1]));return c},i=function(o){for(var l=new Uint8Array(o.length),c=o.length;c--;)l[c]=o.charCodeAt(c);return(l=CS(l)).reduce(function(u,d){return u+String.fromCharCode(d)},"")};t.processDataByFilters=function(o,l){var c=0,u=o||"",d=[];for(typeof(l=l||[])=="string"&&(l=[l]),c=0;c<l.length;c+=1)switch(l[c]){case"ASCII85Decode":case"/ASCII85Decode":u=r(u),d.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":u=e(u),d.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":u=a(u),d.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":u=n(u),d.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":u=i(u),d.push("/FlateDecode");break;default:throw new Error('The filter: "'+l[c]+'" is not implemented')}return{data:u,reverseChain:d.reverse().join(" ")}}}(Fr.API),function(t){t.loadFile=function(e,r,n){return function(a,i,o){i=i!==!1,o=typeof o=="function"?o:function(){};var l=void 0;try{l=function(c,u,d){var h=new XMLHttpRequest,f=0,m=function(g){var y=g.length,b=[],w=String.fromCharCode;for(f=0;f<y;f+=1)b.push(w(255&g.charCodeAt(f)));return b.join("")};if(h.open("GET",c,!u),h.overrideMimeType("text/plain; charset=x-user-defined"),u===!1&&(h.onload=function(){h.status===200?d(m(this.responseText)):d(void 0)}),h.send(null),u&&h.status===200)return m(h.responseText)}(a,i,o)}catch{}return l}(e,r,n)},t.loadImageFile=t.loadFile}(Fr.API),function(t){function e(){return(Wr.html2canvas?Promise.resolve(Wr.html2canvas):Wv(()=>import("./html2canvas.esm-CBrSDip1.js"),[])).catch(function(l){return Promise.reject(new Error("Could not load html2canvas: "+l))}).then(function(l){return l.default?l.default:l})}function r(){return(Wr.DOMPurify?Promise.resolve(Wr.DOMPurify):Wv(()=>import("./purify.es-BgtpMKW3.js"),[])).catch(function(l){return Promise.reject(new Error("Could not load dompurify: "+l))}).then(function(l){return l.default?l.default:l})}var n=function(l){var c=Ys(l);return c==="undefined"?"undefined":c==="string"||l instanceof String?"string":c==="number"||l instanceof Number?"number":c==="function"||l instanceof Function?"function":l&&l.constructor===Array?"array":l&&l.nodeType===1?"element":c==="object"?"object":"unknown"},a=function(l,c){var u=document.createElement(l);for(var d in c.className&&(u.className=c.className),c.innerHTML&&c.dompurify&&(u.innerHTML=c.dompurify.sanitize(c.innerHTML)),c.style)u.style[d]=c.style[d];return u},i=function l(c,u){for(var d=c.nodeType===3?document.createTextNode(c.nodeValue):c.cloneNode(!1),h=c.firstChild;h;h=h.nextSibling)u!==!0&&h.nodeType===1&&h.nodeName==="SCRIPT"||d.appendChild(l(h,u));return c.nodeType===1&&(c.nodeName==="CANVAS"?(d.width=c.width,d.height=c.height,d.getContext("2d").drawImage(c,0,0)):c.nodeName!=="TEXTAREA"&&c.nodeName!=="SELECT"||(d.value=c.value),d.addEventListener("load",function(){d.scrollTop=c.scrollTop,d.scrollLeft=c.scrollLeft},!0)),d},o=function l(c){var u=Object.assign(l.convert(Promise.resolve()),JSON.parse(JSON.stringify(l.template))),d=l.convert(Promise.resolve(),u);return(d=d.setProgress(1,l,1,[l])).set(c)};(o.prototype=Object.create(Promise.prototype)).constructor=o,o.convert=function(l,c){return l.__proto__=c||o.prototype,l},o.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},o.prototype.from=function(l,c){return this.then(function(){switch(c=c||function(u){switch(n(u)){case"string":return"string";case"element":return u.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}}(l),c){case"string":return this.then(r).then(function(u){return this.set({src:a("div",{innerHTML:l,dompurify:u})})});case"element":return this.set({src:l});case"canvas":return this.set({canvas:l});case"img":return this.set({img:l});default:return this.error("Unknown source type.")}})},o.prototype.to=function(l){switch(l){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},o.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var l={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},c=i(this.prop.src,this.opt.html2canvas.javascriptEnabled);c.tagName==="BODY"&&(l.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=a("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=a("div",{className:"html2pdf__container",style:l}),this.prop.container.appendChild(c),this.prop.container.firstChild.appendChild(a("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},o.prototype.toCanvas=function(){var l=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(l).then(e).then(function(c){var u=Object.assign({},this.opt.html2canvas);return delete u.onrendered,c(this.prop.container,u)}).then(function(c){(this.opt.html2canvas.onrendered||function(){})(c),this.prop.canvas=c,document.body.removeChild(this.prop.overlay)})},o.prototype.toContext2d=function(){var l=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(l).then(e).then(function(c){var u=this.opt.jsPDF,d=this.opt.fontFaces,h=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,f=Object.assign({async:!0,allowTaint:!0,scale:h,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete f.onrendered,u.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,u.context2d.posX=this.opt.x,u.context2d.posY=this.opt.y,u.context2d.margin=this.opt.margin,u.context2d.fontFaces=d,d)for(var m=0;m<d.length;++m){var g=d[m],y=g.src.find(function(b){return b.format==="truetype"});y&&u.addFont(y.url,g.ref.name,g.ref.style)}return f.windowHeight=f.windowHeight||0,f.windowHeight=f.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):f.windowHeight,u.context2d.save(!0),c(this.prop.container,f)}).then(function(c){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(c),this.prop.canvas=c,document.body.removeChild(this.prop.overlay)})},o.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var l=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=l})},o.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},o.prototype.output=function(l,c,u){return(u=u||"pdf").toLowerCase()==="img"||u.toLowerCase()==="image"?this.outputImg(l,c):this.outputPdf(l,c)},o.prototype.outputPdf=function(l,c){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(l,c)})},o.prototype.outputImg=function(l){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(l){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+l+'" is not supported.'}})},o.prototype.save=function(l){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(l?{filename:l}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},o.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},o.prototype.set=function(l){if(n(l)!=="object")return this;var c=Object.keys(l||{}).map(function(u){if(u in o.template.prop)return function(){this.prop[u]=l[u]};switch(u){case"margin":return this.setMargin.bind(this,l.margin);case"jsPDF":return function(){return this.opt.jsPDF=l.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,l.pageSize);default:return function(){this.opt[u]=l[u]}}},this);return this.then(function(){return this.thenList(c)})},o.prototype.get=function(l,c){return this.then(function(){var u=l in o.template.prop?this.prop[l]:this.opt[l];return c?c(u):u})},o.prototype.setMargin=function(l){return this.then(function(){switch(n(l)){case"number":l=[l,l,l,l];case"array":if(l.length===2&&(l=[l[0],l[1],l[0],l[1]]),l.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=l}).then(this.setPageSize)},o.prototype.setPageSize=function(l){function c(u,d){return Math.floor(u*d/72*96)}return this.then(function(){(l=l||Fr.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(l.inner={width:l.width-this.opt.margin[1]-this.opt.margin[3],height:l.height-this.opt.margin[0]-this.opt.margin[2]},l.inner.px={width:c(l.inner.width,l.k),height:c(l.inner.height,l.k)},l.inner.ratio=l.inner.height/l.inner.width),this.prop.pageSize=l})},o.prototype.setProgress=function(l,c,u,d){return l!=null&&(this.progress.val=l),c!=null&&(this.progress.state=c),u!=null&&(this.progress.n=u),d!=null&&(this.progress.stack=d),this.progress.ratio=this.progress.val/this.progress.state,this},o.prototype.updateProgress=function(l,c,u,d){return this.setProgress(l?this.progress.val+l:null,c||null,u?this.progress.n+u:null,d?this.progress.stack.concat(d):null)},o.prototype.then=function(l,c){var u=this;return this.thenCore(l,c,function(d,h){return u.updateProgress(null,null,1,[d]),Promise.prototype.then.call(this,function(f){return u.updateProgress(null,d),f}).then(d,h).then(function(f){return u.updateProgress(1),f})})},o.prototype.thenCore=function(l,c,u){u=u||Promise.prototype.then;var d=this;l&&(l=l.bind(d)),c&&(c=c.bind(d));var h=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?d:o.convert(Object.assign({},d),Promise.prototype),f=u.call(h,l,c);return o.convert(f,d.__proto__)},o.prototype.thenExternal=function(l,c){return Promise.prototype.then.call(this,l,c)},o.prototype.thenList=function(l){var c=this;return l.forEach(function(u){c=c.thenCore(u)}),c},o.prototype.catch=function(l){l&&(l=l.bind(this));var c=Promise.prototype.catch.call(this,l);return o.convert(c,this)},o.prototype.catchExternal=function(l){return Promise.prototype.catch.call(this,l)},o.prototype.error=function(l){return this.then(function(){throw new Error(l)})},o.prototype.using=o.prototype.set,o.prototype.saveAs=o.prototype.save,o.prototype.export=o.prototype.output,o.prototype.run=o.prototype.then,Fr.getPageSize=function(l,c,u){if(Ys(l)==="object"){var d=l;l=d.orientation,c=d.unit||c,u=d.format||u}c=c||"mm",u=u||"a4",l=(""+(l||"P")).toLowerCase();var h,f=(""+u).toLowerCase(),m={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(c){case"pt":h=1;break;case"mm":h=72/25.4;break;case"cm":h=72/2.54;break;case"in":h=72;break;case"px":h=.75;break;case"pc":case"em":h=12;break;case"ex":h=6;break;default:throw"Invalid unit: "+c}var g,y=0,b=0;if(m.hasOwnProperty(f))y=m[f][1]/h,b=m[f][0]/h;else try{y=u[1],b=u[0]}catch{throw new Error("Invalid format: "+u)}if(l==="p"||l==="portrait")l="p",b>y&&(g=b,b=y,y=g);else{if(l!=="l"&&l!=="landscape")throw"Invalid orientation: "+l;l="l",y>b&&(g=b,b=y,y=g)}return{width:b,height:y,unit:c,k:h,orientation:l}},t.html=function(l,c){(c=c||{}).callback=c.callback||function(){},c.html2canvas=c.html2canvas||{},c.html2canvas.canvas=c.html2canvas.canvas||this.canvas,c.jsPDF=c.jsPDF||this,c.fontFaces=c.fontFaces?c.fontFaces.map(wN):null;var u=new o(c);return c.worker?u:u.from(l).doCallback()}}(Fr.API),Fr.API.addJS=function(t){return bD=t,this.internal.events.subscribe("postPutResources",function(){_v=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(_v+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),yD=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+bD+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){_v!==void 0&&yD!==void 0&&this.internal.out("/Names <</JavaScript "+_v+" 0 R>>")}),this},function(t){var e;t.events.push(["postPutResources",function(){var r=this,n=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var a=r.outline.render().split(/\r\n/),i=0;i<a.length;i++){var o=a[i],l=n.exec(o);if(l!=null){var c=l[1];r.internal.newObjectDeferredBegin(c,!1)}r.internal.write(o)}if(this.outline.createNamedDestinations){var u=this.internal.pages.length,d=[];for(i=0;i<u;i++){var h=r.internal.newObject();d.push(h);var f=r.internal.getPageInfo(i+1);r.internal.write("<< /D["+f.objId+" 0 R /XYZ null null null]>> endobj")}var m=r.internal.newObject();for(r.internal.write("<< /Names [ "),i=0;i<d.length;i++)r.internal.write("(page_"+(i+1)+")"+d[i]+" 0 R");r.internal.write(" ] >>
1146","endobj"),e=r.internal.newObject(),r.internal.write("<< /Dests "+m+" 0 R"),r.internal.write(">>","endobj")}}]),t.events.push(["putCatalog",function(){var r=this;r.outline.root.children.length>0&&(r.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&r.internal.write("/Names "+e+" 0 R"))}]),t.events.push(["initialized",function(){var r=this;r.outline={createNamedDestinations:!1,root:{children:[]}},r.outline.add=function(n,a,i){var o={title:a,options:i,children:[]};return n==null&&(n=this.root),n.children.push(o),o},r.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=r,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},r.outline.genIds_r=function(n){n.id=r.internal.newObjectDeferred();for(var a=0;a<n.children.length;a++)this.genIds_r(n.children[a])},r.outline.renderRoot=function(n){this.objStart(n),this.line("/Type /Outlines"),n.children.length>0&&(this.line("/First "+this.makeRef(n.children[0])),this.line("/Last "+this.makeRef(n.children[n.children.length-1]))),this.line("/Count "+this.count_r({count:0},n)),this.objEnd()},r.outline.renderItems=function(n){for(var a=this.ctx.pdf.internal.getVerticalCoordinateString,i=0;i<n.children.length;i++){var o=n.children[i];this.objStart(o),this.line("/Title "+this.makeString(o.title)),this.line("/Parent "+this.makeRef(n)),i>0&&this.line("/Prev "+this.makeRef(n.children[i-1])),i<n.children.length-1&&this.line("/Next "+this.makeRef(n.children[i+1])),o.children.length>0&&(this.line("/First "+this.makeRef(o.children[0])),this.line("/Last "+this.makeRef(o.children[o.children.length-1])));var l=this.count=this.count_r({count:0},o);if(l>0&&this.line("/Count "+l),o.options&&o.options.pageNumber){var c=r.internal.getPageInfo(o.options.pageNumber);this.line("/Dest ["+c.objId+" 0 R /XYZ 0 "+a(0)+" 0]")}this.objEnd()}for(var u=0;u<n.children.length;u++)this.renderItems(n.children[u])},r.outline.line=function(n){this.ctx.val+=n+`\r 1147`},r.outline.makeRef=function(n){return n.id+" 0 R"},r.outline.makeString=function(n){return"("+r.internal.pdfEscape(n)+")"},r.outline.objStart=function(n){this.ctx.val+=`\r 1148`+n.id+` 0 obj\r 1149<<\r 1150`},r.outline.objEnd=function(){this.ctx.val+=`>> \r 1151endobj\r 1152`},r.outline.count_r=function(n,a){for(var i=0;i<a.children.length;i++)n.count++,this.count_r(n,a.children[i]);return n.count}}])}(Fr.API),function(t){var e=[192,193,194,195,196,197,198,199];t.processJPEG=function(r,n,a,i,o,l){var c,u=this.decode.DCT_DECODE,d=null;if(typeof r=="string"||this.__addimage__.isArrayBuffer(r)||this.__addimage__.isArrayBufferView(r)){switch(r=o||r,r=this.__addimage__.isArrayBuffer(r)?new Uint8Array(r):r,c=function(h){for(var f,m=256*h.charCodeAt(4)+h.charCodeAt(5),g=h.length,y={width:0,height:0,numcomponents:1},b=4;b<g;b+=2){if(b+=m,e.indexOf(h.charCodeAt(b+1))!==-1){f=256*h.charCodeAt(b+5)+h.charCodeAt(b+6),y={width:256*h.charCodeAt(b+7)+h.charCodeAt(b+8),height:f,numcomponents:h.charCodeAt(b+9)};break}m=256*h.charCodeAt(b+2)+h.charCodeAt(b+3)}return y}(r=this.__addimage__.isArrayBufferView(r)?this.__addimage__.arrayBufferToBinaryString(r):r),c.numcomponents){case 1:l=this.color_spaces.DEVICE_GRAY;break;case 4:l=this.color_spaces.DEVICE_CMYK;break;case 3:l=this.color_spaces.DEVICE_RGB}d={data:r,width:c.width,height:c.height,colorSpace:l,bitsPerComponent:8,filter:u,index:n,alias:a}}return d}}(Fr.API),Fr.API.processPNG=function(t,e,r,n){if(this.__addimage__.isArrayBuffer(t)&&(t=new Uint8Array(t)),this.__addimage__.isArrayBufferView(t)){var a,i=oNe(t,{checkCrc:!0}),o=i.width,l=i.height,c=i.channels,u=i.palette,d=i.depth;a=u&&c===1?function(D){for(var A=D.width,R=D.height,M=D.data,P=D.palette,U=D.depth,I=!1,O=[],V=[],G=void 0,B=!1,$=0,W=0;W<P.length;W++){var oe=N3(P[W],4),K=oe[0],H=oe[1],X=oe[2],me=oe[3];O.push(K,H,X),me!=null&&(me===0?($++,V.length<1&&V.push(W)):me<255&&(B=!0))}if(B||$>1){I=!0,V=void 0;var ie=A*R;G=new Uint8Array(ie);for(var ee=new DataView(M.buffer),he=0;he<ie;he++){var ve=NN(ee,he,U),Ce=N3(P[ve],4)[3];G[he]=Ce}}else $===0&&(V=void 0);return{colorSpace:"Indexed",colorsPerPixel:1,sMaskBitsPerComponent:I?8:void 0,colorBytes:M,alph
vendor: 11,088 bytes, line 1152
1152aBytes:G,needSMask:I,palette:O,mask:V}}(i):c===2||c===4?function(D){for(var A=D.data,R=D.width,M=D.height,P=D.channels,U=D.depth,I=P===2?"DeviceGray":"DeviceRGB",O=P-1,V=R*M,G=O,B=V*G,$=1*V,W=Math.ceil(B*U/8),oe=Math.ceil($*U/8),K=new Uint8Array(W),H=new Uint8Array(oe),X=new DataView(A.buffer),me=new DataView(K.buffer),ie=new DataView(H.buffer),ee=!1,he=0;he<V;he++){for(var ve=he*P,Ce=0;Ce<G;Ce++)_D(me,NN(X,ve+Ce,U),he*G+Ce,U);var re=NN(X,ve+G,U);re<(1<<U)-1&&(ee=!0),_D(ie,re,1*he,U)}return{colorSpace:I,colorsPerPixel:O,sMaskBitsPerComponent:ee?U:void 0,colorBytes:K,alphaBytes:H,needSMask:ee}}(i):function(D){var A=D.data,R=D.channels===1?"DeviceGray":"DeviceRGB";return{colorSpace:R,colorsPerPixel:R==="DeviceGray"?1:3,colorBytes:A instanceof Uint16Array?function(M){for(var P=M.length,U=new Uint8Array(2*P),I=new DataView(U.buffer,U.byteOffset,U.byteLength),O=0;O<P;O++)I.setUint16(2*O,M[O],!1);return U}(A):A,needSMask:!1}}(i);var h,f,m,g=a,y=g.colorSpace,b=g.colorsPerPixel,w=g.sMaskBitsPerComponent,j=g.colorBytes,N=g.alphaBytes,S=g.needSMask,E=g.palette,C=g.mask,T=null;return n!==Fr.API.image_compression.NONE&&typeof CS=="function"?(T=function(D){var A;switch(D){case Fr.API.image_compression.FAST:A=11;break;case Fr.API.image_compression.MEDIUM:A=13;break;case Fr.API.image_compression.SLOW:A=14;break;default:A=12}return A}(n),h=this.decode.FLATE_DECODE,f="/Predictor ".concat(T," /Colors ").concat(b," /BitsPerComponent ").concat(d," /Columns ").concat(o),t=ND(j,Math.ceil(o*b*d/8),b,d,n),S&&(m=ND(N,Math.ceil(o*w/8),1,w,n))):(h=void 0,f=void 0,t=j,S&&(m=N)),(this.__addimage__.isArrayBuffer(t)||this.__addimage__.isArrayBufferView(t))&&(t=this.__addimage__.arrayBufferToBinaryString(t)),(m&&this.__addimage__.isArrayBuffer(m)||this.__addimage__.isArrayBufferView(m))&&(m=this.__addimage__.arrayBufferToBinaryString(m)),{alias:r,data:t,index:e,filter:h,decodeParameters:f,transparency:C,palette:E,sMask:m,predictor:T,width:o,height:l,bitsPerComponent:d,sMaskBitsPerComponent:w,colorSpace:y}}},function(t){t.processGIF89A=function(e,r,n,a){var i=new _Ne(e),o=i.width,l=i.height,c=[];i.decodeAndBlitFrameRGBA(0,c);var u={data:c,width:o,height:l},d=new FN(100).encode(u,100);return t.processJPEG.call(this,d,r,n,a)},t.processGIF87A=t.processGIF89A}(Fr.API),Cc.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var t=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var e=0;e<t;e++){var r=this.datav.getUint8(this.pos++,!0),n=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0);this.palette[e]={red:a,green:n,blue:r,quad:i}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},Cc.prototype.parseBGR=function(){this.pos=this.offset;try{var t="bit"+this.bitPP,e=this.width*this.height*4;this.data=new Uint8Array(e),this[t]()}catch(r){on.log("bit decode error:"+r)}},Cc.prototype.bit1=function(){var t,e=Math.ceil(this.width/8),r=e%4;for(t=this.height-1;t>=0;t--){for(var n=this.bottom_up?t:this.height-1-t,a=0;a<e;a++)for(var i=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+8*a*4,l=0;l<8&&8*a+l<this.width;l++){var c=this.palette[i>>7-l&1];this.data[o+4*l]=c.blue,this.data[o+4*l+1]=c.green,this.data[o+4*l+2]=c.red,this.data[o+4*l+3]=255}r!==0&&(this.pos+=4-r)}},Cc.prototype.bit4=function(){for(var t=Math.ceil(this.width/2),e=t%4,r=this.height-1;r>=0;r--){for(var n=this.bottom_up?r:this.height-1-r,a=0;a<t;a++){var i=this.datav.getUint8(this.pos++,!0),o=n*this.width*4+2*a*4,l=i>>4,c=15&i,u=this.palette[l];if(this.data[o]=u.blue,this.data[o+1]=u.green,this.data[o+2]=u.red,this.data[o+3]=255,2*a+1>=this.width)break;u=this.palette[c],this.data[o+4]=u.blue,this.data[o+4+1]=u.green,this.data[o+4+2]=u.red,this.data[o+4+3]=255}e!==0&&(this.pos+=4-e)}},Cc.prototype.bit8=function(){for(var t=this.width%4,e=this.height-1;e>=0;e--){for(var r=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var a=this.datav.getUint8(this.pos++,!0),i=r*this.width*4+4*n;if(a<this.palette.length){var o=this.palette[a];this.data[i]=o.red,this.data[i+1]=o.green,this.data[i+2]=o.blue,this.data[i+3]=255}else this.data[i]=255,this.data[i+1]=255,this.data[i+2]=255,this.data[i+3]=255}t!==0&&(this.pos+=4-t)}},Cc.prototype.bit15=function(){for(var t=this.width%3,e=parseInt("11111",2),r=this.height-1;r>=0;r--){for(var n=this.bottom_up?r:this.height-1-r,a=0;a<this.width;a++){var i=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(i&e)/e*255|0,l=(i>>5&e)/e*255|0,c=(i>>10&e)/e*255|0,u=i>>15?255:0,d=n*this.width*4+4*a;this.data[d]=c,this.data[d+1]=l,this.data[d+2]=o,this.data[d+3]=u}this.pos+=t}},Cc.prototype.bit16=function(){for(var t=this.width%3,e=parseInt("11111",2),r=parseInt("111111",2),n=this.height-1;n>=0;n--){for(var a=this.bottom_up?n:this.height-1-n,i=0;i<this.width;i++){var o=this.datav.getUint16(this.pos,!0);this.pos+=2;var l=(o&e)/e*255|0,c=(o>>5&r)/r*255|0,u=(o>>11)/e*255|0,d=a*this.width*4+4*i;this.data[d]=u,this.data[d+1]=c,this.data[d+2]=l,this.data[d+3]=255}this.pos+=t}},Cc.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var e=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var n=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=e*this.width*4+4*r;this.data[o]=i,this.data[o+1]=a,this.data[o+2]=n,this.data[o+3]=255}this.pos+=this.width%4}},Cc.prototype.bit32=function(){for(var t=this.height-1;t>=0;t--)for(var e=this.bottom_up?t:this.height-1-t,r=0;r<this.width;r++){var n=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),o=this.datav.getUint8(this.pos++,!0),l=e*this.width*4+4*r;this.data[l]=i,this.data[l+1]=a,this.data[l+2]=n,this.data[l+3]=o}},Cc.prototype.getData=function(){return this.data},function(t){t.processBMP=function(e,r,n,a){var i=new Cc(e,!1),o=i.width,l=i.height,c={data:i.getData(),width:o,height:l},u=new FN(100).encode(c,100);return t.processJPEG.call(this,u,r,n,a)}}(Fr.API),AD.prototype.getData=function(){return this.data},function(t){t.processWEBP=function(e,r,n,a){var i=new AD(e),o=i.width,l=i.height,c={data:i.getData(),width:o,height:l},u=new FN(100).encode(c,100);return t.processJPEG.call(this,u,r,n,a)}}(Fr.API),Fr.API.processRGBA=function(t,e,r){for(var n=t.data,a=n.length,i=new Uint8Array(a/4*3),o=new Uint8Array(a/4),l=0,c=0,u=0;u<a;u+=4){var d=n[u],h=n[u+1],f=n[u+2],m=n[u+3];i[l++]=d,i[l++]=h,i[l++]=f,o[c++]=m}var g=this.__addimage__.arrayBufferToBinaryString(i);return{alpha:this.__addimage__.arrayBufferToBinaryString(o),data:g,index:e,alias:r,colorSpace:"DeviceRGB",bitsPerComponent:8,width:t.width,height:t.height}},Fr.API.setLanguage=function(t){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Sp
1152ain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[t]!==void 0&&(this.internal.languageSettings.languageCode=t,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},ag=Fr.API,Ev=ag.getCharWidthsArray=function(t,e){var r,n,a=(e=e||{}).font||this.internal.getFont(),i=e.fontSize||this.internal.getFontSize(),o=e.charSpace||this.internal.getCharSpace(),l=e.widths?e.widths:a.metadata.Unicode.widths,c=l.fof?l.fof:1,u=e.kerning?e.kerning:a.metadata.Unicode.kerning,d=u.fof?u.fof:1,h=e.doKerning!==!1,f=0,m=t.length,g=0,y=l[0]||c,b=[];for(r=0;r<m;r++)n=t.charCodeAt(r),typeof a.metadata.widthOfString=="function"?b.push((a.metadata.widthOfGlyph(a.metadata.characterToGlyph(n))+o*(1e3/i)||0)/1e3):(f=h&&Ys(u[n])==="object"&&!isNaN(parseInt(u[n][g],10))?u[n][g]/d:0,b.push((l[n]||y)/c+f)),g=n;return b},vD=ag.getStringUnitWidth=function(t,e){var r=(e=e||{}).fontSize||this.internal.getFontSize(),n=e.font||this.internal.getFont(),a=e.charSpace||this.internal.getCharSpace();return ag.processArabic&&(t=ag.processArabic(t)),typeof n.metadata.widthOfString=="function"?n.metadata.widthOfString(t,r,a)/r:Ev.apply(this,arguments).reduce(function(i,o){return i+o},0)},wD=function(t,e,r,n){for(var a=[],i=0,o=t.length,l=0;i!==o&&l+e[i]<r;)l+=e[i],i++;a.push(t.slice(0,i));var c=i;for(l=0;i!==o;)l+e[i]>n&&(a.push(t.slice(c,i)),l=0,c=i),l+=e[i],i++;return c!==i&&a.push(t.slice(c,i)),a},jD=function(t,e,r){r||(r={});var n,a,i,o,l,c,u,d=[],h=[d],f=r.textIndent||0,m=0,g=0,y=t.split(" "),b=Ev.apply(this,[" ",r])[0];if(c=r.lineIndent===-1?y[0].length+2:r.lineIndent||0){var w=Array(c).join(" "),j=[];y.map(function(S){(S=S.split(/\s*\n/)).length>1?j=j.concat(S.map(function(E,C){return(C&&E.length?` 1153`:"")+E})):j.push(S[0])}),y=j,c=vD.apply(this,[w,r])}for(i=0,o=y.length;i<o;i++){var N=0;if(n=y[i],c&&n[0]==` 1154`&&(n=n.substr(1),N=1),f+m+(g=(a=Ev.apply(this,[n,r])).reduce(function(S,E){return S+E},0))>e||N){if(g>e){for(l=wD.apply(this,[n,a,e-(f+m),e]),d.push(l.shift()),d=[l.pop()];l.length;)h.push([l.shift()]);g=a.slice(n.length-(d[0]?d[0].length:0)).reduce(function(S,E){return S+E},0)}else d=[n];h.push(d),f=g+c,m=b}else d.push(n),f+=m+g,m=b}return u=c?function(S,E){return(E?w:"")+S.join(" ")}:function(S){return S.join(" ")},h.map(u)},ag.splitTextToSize=function(t,e,r){var n,a=(r=r||{}).fontSize||this.internal.getFontSize(),i=(function(d){if(d.widths&&d.kerning)return{widths:d.widths,kerning:d.kerning};var h=this.internal.getFont(d.fontName,d.fontStyle),f="Unicode";return h.metadata[f]?{widths:h.metadata[f].widths||{0:1},kerning:h.metadata[f].kerning||{}}:{font:h.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,r);
vendor: 1,415 bytes, line 1154
1154n=Array.isArray(t)?t:String(t).split(/\r?\n/);var o=1*this.internal.scaleFactor*e/a;i.textIndent=r.textIndent?1*r.textIndent*this.internal.scaleFactor/a:0,i.lineIndent=r.lineIndent;var l,c,u=[];for(l=0,c=n.length;l<c;l++)u=u.concat(jD.apply(this,[n[l],o,i]));return u},function(t){t.__fontmetrics__=t.__fontmetrics__||{};for(var e="0123456789abcdef",r="klmnopqrstuvwxyz",n={},a={},i=0;i<16;i++)n[r[i]]=e[i],a[e[i]]=r[i];var o=function(f){return"0x"+parseInt(f,10).toString(16)},l=t.__fontmetrics__.compress=function(f){var m,g,y,b,w=["{"];for(var j in f){if(m=f[j],isNaN(parseInt(j,10))?g="'"+j+"'":(j=parseInt(j,10),g=(g=o(j).slice(2)).slice(0,-1)+a[g.slice(-1)]),typeof m=="number")m<0?(y=o(m).slice(3),b="-"):(y=o(m).slice(2),b=""),y=b+y.slice(0,-1)+a[y.slice(-1)];else{if(Ys(m)!=="object")throw new Error("Don't know what to do with value type "+Ys(m)+".");y=l(m)}w.push(g+y)}return w.push("}"),w.join("")},c=t.__fontmetrics__.uncompress=function(f){if(typeof f!="string")throw new Error("Invalid argument passed to uncompress.");for(var m,g,y,b,w={},j=1,N=w,S=[],E="",C="",T=f.length-1,D=1;D<T;D+=1)(b=f[D])=="'"?m?(y=m.join(""),m=void 0):m=[]:m?m.push(b):b=="{"?(S.push([N,y]),N={},y=void 0):b=="}"?((g=S.pop())[0][g[1]]=N,y=void 0,N=g[0]):b=="-"?j=-1:y===void 0?n.hasOwnProperty(b)?(E+=n[b],y=parseInt(E,16)*j,j=1,E=""):E+=b:n.hasOwnProperty(b)?(C+=n[b],N[y]=parseInt(C,16)*j,j=1,y=void 0,C=""):C+=b;return w
vendor: 15,139 bytes, line 1154
1154},u={codePages:["WinAnsiEncoding"],WinAnsiEncoding:c("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},d={Unicode:{Courier:u,"Courier-Bold":u,"Courier-BoldOblique":u,"Courier-Oblique":u,Helvetica:u,"Helvetica-Bold":u,"Helvetica-BoldOblique":u,"Helvetica-Oblique":u,"Times-Roman":u,"Times-Bold":u,"Times-BoldItalic":u,"Times-Italic":u}},h={Unicode:{"Courier-Oblique":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":c("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":c("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":c("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:c("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:c("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":c("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:c("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":c("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":c("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":c("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};
vendor: 44,493 bytes, lines 1154-1182
1154t.events.push(["addFont",function(f){var m=f.font,g=h.Unicode[m.postScriptName];g&&(m.metadata.Unicode={},m.metadata.Unicode.widths=g.widths,m.metadata.Unicode.kerning=g.kerning);var y=d.Unicode[m.postScriptName];y&&(m.metadata.Unicode.encoding=y,m.encoding=y.codePages[0])}])}(Fr.API),function(t){var e=function(r){for(var n=r.length,a=new Uint8Array(n),i=0;i<n;i++)a[i]=r.charCodeAt(i);return a};t.API.events.push(["addFont",function(r){var n=void 0,a=r.font,i=r.instance;if(!a.isStandardFont){if(i===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+a.postScriptName+"').");if(typeof(n=i.existsFileInVFS(a.postScriptName)===!1?i.loadFile(a.postScriptName):i.getFileFromVFS(a.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+a.postScriptName+"').");(function(o,l){l=/^\x00\x01\x00\x00/.test(l)?e(l):e(Xv(l)),o.metadata=t.API.TTFFont.open(l),o.metadata.Unicode=o.metadata.Unicode||{encoding:{},kerning:{},widths:[]},o.metadata.glyIdsUsed=[0]})(a,n)}}])}(Fr),Fr.API.addSvgAsImage=function(t,e,r,n,a,i,o,l){if(isNaN(e)||isNaN(r))throw on.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(n)||isNaN(a))throw on.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var c=document.createElement("canvas");c.width=n,c.height=a;var u=c.getContext("2d");u.fillStyle="#fff",u.fillRect(0,0,c.width,c.height);var d={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},h=this;return(Wr.canvg?Promise.resolve(Wr.canvg):Wv(()=>import("./index.es-D1qSwV50.js"),__vite__mapDeps([4,1,2,3]))).catch(function(f){return Promise.reject(new Error("Could not load canvg: "+f))}).then(function(f){return f.default?f.default:f}).then(function(f){return f.fromString(u,t,d)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(f){return f.render(d)}).then(function(){h.addImage(c.toDataURL("image/jpeg",1),e,r,n,a,o,l)})},Fr.API.putTotalPages=function(t){var e,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),r=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),r=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var n=1;n<=this.internal.getNumberOfPages();n++)for(var a=0;a<this.internal.pages[n].length;a++)this.internal.pages[n][a]=this.internal.pages[n][a].replace(e,r);return this},Fr.API.viewerPreferences=function(t,e){var r;t=t||{},e=e||!1;var n,a,i,o={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},l=Object.keys(o),c=[],u=0,d=0,h=0;function f(g,y){var b,w=!1;for(b=0;b<g.length;b+=1)g[b]===y&&(w=!0);return w}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(o)),this.internal.viewerpreferences.isSubscribed=!1),r=this.internal.viewerpreferences.configuration,t==="reset"||e===!0){var m=l.length;for(h=0;h<m;h+=1)r[l[h]].value=r[l[h]].defaultValue,r[l[h]].explicitSet=!1}if(Ys(t)==="object"){for(a in t)if(i=t[a],f(l,a)&&i!==void 0){if(r[a].type==="boolean"&&typeof i=="boolean")r[a].value=i;else if(r[a].type==="name"&&f(r[a].valueSet,i))r[a].value=i;else if(r[a].type==="integer"&&Number.isInteger(i))r[a].value=i;else if(r[a].type==="array"){for(u=0;u<i.length;u+=1)if(n=!0,i[u].length===1&&typeof i[u][0]=="number")c.push(String(i[u]-1));else if(i[u].length>1){for(d=0;d<i[u].length;d+=1)typeof i[u][d]!="number"&&(n=!1);n===!0&&c.push([i[u][0]-1,i[u][1]-1].join(" "))}r[a].value="["+c.join(" ")+"]"}else r[a].value=r[a].defaultValue;r[a].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var g,y=[];for(g in r)r[g].explicitSet===!0&&(r[g].type==="name"?y.push("/"+g+" /"+r[g].value):y.push("/"+g+" "+r[g].value));y.length!==0&&this.internal.write(`/ViewerPreferences 1155<< 1156`+y.join(` 1157`)+` 1158>>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=r,this},function(t){var e=function(){var n='<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceuri+'"><jspdf:metadata>',a=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),i=unescape(encodeURIComponent(n)),o=unescape(encodeURIComponent(this.internal.__metadata__.metadata)),l=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),c=unescape(encodeURIComponent("</x:xmpmeta>")),u=i.length+o.length+l.length+a.length+c.length;this.internal.__metadata__.metadata_object_number=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+u+" >>"),this.internal.write("stream"),this.internal.write(a+i+o+l+c),this.internal.write("endstream"),this.internal.write("endobj")},r=function(){this.internal.__metadata__.metadata_object_number&&this.internal.write("/Metadata "+this.internal.__metadata__.metadata_object_number+" 0 R")};t.addMetadata=function(n,a){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:n,namespaceuri:a||"http://jspdf.default.namespaceuri/"},this.internal.events.subscribe("putCatalog",r),this.internal.events.subscribe("postPutResources",e)),this}}(Fr.API),function(t){var e=t.API,r=e.pdfEscape16=function(i,o){for(var l,c=o.metadata.Unicode.widths,u=["","0","00","000","0000"],d=[""],h=0,f=i.length;h<f;++h){if(l=o.metadata.characterToGlyph(i.charCodeAt(h)),o.metadata.glyIdsUsed.push(l),o.metadata.toUnicode[l]=i.charCodeAt(h),c.indexOf(l)==-1&&(c.push(l),c.push([parseInt(o.metadata.widthOfGlyph(l),10)])),l=="0")return d.join("");l=l.toString(16),d.push(u[4-l.length],l)}return d.join("")},n=function(i){var o,l,c,u,d,h,f;for(d=`/CIDInit /ProcSet findresource begin 115912 dict begin 1160begincmap 1161/CIDSystemInfo << 1162 /Registry (Adobe) 1163 /Ordering (UCS) 1164 /Supplement 0 1165>> def 1166/CMapName /Adobe-Identity-UCS def 1167/CMapType 2 def 11681 begincodespacerange 1169<0000><ffff> 1170endcodespacerange`,c=[],h=0,f=(l=Object.keys(i).sort(function(m,g){return m-g})).length;h<f;h++)o=l[h],c.length>=100&&(d+=` 1171`+c.length+` beginbfchar 1172`+c.join(` 1173`)+` 1174endbfchar`,c=[]),i[o]!==void 0&&i[o]!==null&&typeof i[o].toString=="function"&&(u=("0000"+i[o].toString(16)).slice(-4),o=("0000"+(+o).toString(16)).slice(-4),c.push("<"+o+"><"+u+">"));return c.length&&(d+=` 1175`+c.length+` beginbfchar 1176`+c.join(` 1177`)+` 1178endbfchar 1179`),d+`endcmap 1180CMapName currentdict /CMap defineresource pop 1181end 1182end`};e.events.push(["putFont",function(i){(function(o){var l=o.font,c=o.out,u=o.newObject,d=o.putStream;if(l.metadata instanceof t.API.TTFFont&&l.encoding==="Identity-H"){for(var h=l.metadata.Unicode.widths,f=l.metadata.subset.encode(l.metadata.glyIdsUsed,1),m="",g=0;g<f.length;g++)m+=String.fromCharCode(f[g]);var y=u();d({data:m,addLength1:!0,objectId:y}),c("endobj");var b=u();d({data:n(l.metadata.toUnicode),addLength1:!0,objectId:b}),c("endobj");var w=u();c("<<"),c("/Type /FontDescriptor"),c("/FontName /"+xg(l.fontName)),c("/FontFile2 "+y+" 0 R"),c("/FontBBox "+t.API.PDFObject.convert(l.metadata.bbox)),c("/Flags "+l.metadata.flags),c("/StemV "+l.metadata.stemV),c("/ItalicAngle "+l.metadata.italicAngle),c("/Ascent "+l.metadata.ascender),c("/Descent "+l.metadata.decender),c("/CapHeight "+l.metadata.capHeight),c(">>"),c("endobj");var j=u();c("<<"),c("/Type /Font"),c("/BaseFont /"+xg(l.fontName)),c("/FontDescriptor "+w+" 0 R"),c("/W "+t.API.PDFObject.convert(h)),c("/CIDToGIDMap /Identity"),c("/DW 1000"),c("/Subtype /CIDFontType2"),c("/CIDSystemInfo"),c("<<"),c("/Supplement 0"),c("/Registry (Adobe)"),c("/Ordering ("+l.encoding+")"),c(">>"),c(">>"),c("endobj"),l.objectNumber=u(),c("<<"),c("/Type /Font"),c("/Subtype /Type0"),c("/ToUnicode "+b+" 0 R"),c("/BaseFont /"+xg(l.fontName)),c("/Encoding /"+l.encoding),c("/DescendantFonts ["+j+" 0 R]"),c(">>"),c("endobj"),l.isAlreadyPutted=!0}})(i)}]),e.events.push(["putFont",function(i){(function(o){var l=o.font,c=o.out,u=o.newObject,d=o.putStream;if(l.metadata instanceof t.API.TTFFont&&l.encoding==="WinAnsiEncoding"){for(var h=l.metadata.rawData,f="",m=0;m<h.length;m++)f+=String.fromCharCode(h[m]);var g=u();d({data:f,addLength1:!0,objectId:g}),c("endobj");var y=u();d({data:n(l.metadata.toUnicode),addLength1:!0,objectId:y}),c("endobj");var b=u();c("<<"),c("/Descent "+l.metadata.decender),c("/CapHeight "+l.metadata.capHeight),c("/StemV "+l.metadata.stemV),c("/Type /FontDescriptor"),c("/FontFile2 "+g+" 0 R"),c("/Flags 96"),c("/FontBBox "+t.API.PDFObject.convert(l.metadata.bbox)),c("/FontName /"+xg(l.fontName)),c("/ItalicAngle "+l.metadata.italicAngle),c("/Ascent "+l.metadata.ascender),c(">>"),c("endobj"),l.objectNumber=u();for(var w=0;w<l.metadata.hmtx.widths.length;w++)l.metadata.hmtx.widths[w]=parseInt(l.metadata.hmtx.widths[w]*(1e3/l.metadata.head.unitsPerEm));c("<</Subtype/TrueType/Type/Font/ToUnicode "+y+" 0 R/BaseFont/"+xg(l.fontName)+"/FontDescriptor "+b+" 0 R/Encoding/"+l.encoding+" /FirstChar 29 /LastChar 255 /Widths "+t.API.PDFObject.convert(l.metadata.hmtx.widths)+">>"),c("endobj"),l.isAlreadyPutted=!0}})(i)}]);var a=function(i){var o,l=i.text||"",c=i.x,u=i.y,d=i.options||{},h=i.mutex||{},f=h.pdfEscape,m=h.activeFontKey,g=h.fonts,y=m,b="",w=0,j="",N=g[y].encoding;if(g[y].encoding!=="Identity-H")return{text:l,x:c,y:u,options:d,mutex:h};for(j=l,y=m,Array.isArray(l)&&(j=l[0]),w=0;w<j.length;w+=1)g[y].metadata.hasOwnProperty("cmap")&&(o=g[y].metadata.cmap.unicode.codeMap[j[w].charCodeAt(0)]),o||j[w].charCodeAt(0)<256&&g[y].metadata.hasOwnProperty("Unicode")?b+=j[w]:b+="";var S="";return parseInt(y.slice(1))<14||N==="WinAnsiEncoding"?S=f(b,y).split("").map(function(E){return E.charCodeAt(0).toString(16)}).join(""):N==="Identity-H"&&(S=r(b,g[y])),h.isHex=!0,{text:S,x:c,y:u,options:d,mutex:h}};e.events.push(["postProcessText",function(i){var o=i.text||"",l=[],c={text:o,x:i.x,y:i.y,options:i.options,mutex:i.mutex};if(Array.isArray(o)){var u=0;for(u=0;u<o.length;u+=1)Array.isArray(o[u])&&o[u].length===3?l.push([a(Object.assign({},c,{text:o[u][0]})).text,o[u][1],o[u][2]]):l.push(a(Object.assign({},c,{text:o[u]})).text);i.text=l}else i.text=a(Object.assign({},c,{text:o})).text}])}(Fr),function(t){var e=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};t.existsFileInVFS=function(r){return e.call(this),this.internal.vFS[r]!==void 0},t.addFileToVFS=function(r,n){return e.call(this),this.internal.vFS[r]=n,this},t.getFileFromVFS=function(r){return e.call(this),this.internal.vFS[r]!==void 0?this.internal.vFS[r]:null}}(Fr.API),function(t){t.__bidiEngine__=t.prototype.__bidiEngine__=function(n){var a,i,o,l,c,u,d,h=e,f=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],m=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],g={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},y={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},b=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","â¹","âº","â¹","â ","â","â ","â½","â¾","â½","â","â","â","â¤","â¥","â¤","â©","âª","â©","ï¹","ï¹","ï¹","ï¹","ï¹","ï¹","ï¹","ï¹","ï¹","﹤","ï¹¥","﹤"],w=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),j=!1,N=0;this.__bidiEngine__={};var S=function(M){var P=M.charCodeAt(),U=P>>8,I=y[U];return I!==void 0?h[256*I+(255&P)]:U===252||U===253?"AL":w.test(U)?"L":U===8?"R":"N"},E=function(M){for(var P,U=0;U<M.length;U++){if((P=S(M.charAt(U)))==="L")return!1;if(P==="R")return!0}return!1},C=function(M,P,U,I){var O,V,G,B,$=P[I];switch($){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":j=!1;break;case"N":case"AN":break;case"EN":j&&($="AN");break;case"AL":j=!0,$="R";break;case"WS":case"BN":$="N";break;case"CS":I<1||I+1>=P.length||(O=U[I-1])!=="EN"&&O!=="AN"||(V=P[I+1])!=="EN"&&V!=="AN"?$="N":j&&(V="AN"),$=V===O?V:"N";break;case"ES":$=(O=I>0?U[I-1]:"B")==="EN"&&I+1<P.length&&P[I+1]==="EN"?"EN":"N";break;case"ET":if(I>0&&U[I-1]==="EN"){$="EN";break}if(j){$="N";break}for(G=I+1,B=P.length;G<B&&P[G]==="ET";)G++;$=G<B&&P[G]==="EN"?"EN":"N";break;case"NSM":if(o&&!l){for(B=P.length,G=I+1;G<B&&P[G]==="NSM";)G++;if(G<B){var W=M[I],oe=W>=1425&&W<=2303||W===64286;if(O=P[G],oe&&(O==="R"||O==="AL")){$="R";break}}}$=I<1||(O=P[I-1])==="B"?"N":U[I-1];break;case"B":j=!1,a=!0,$=N;break;case"S":i=!0,$="N"}return $},T=function(M,P,U){var I=M.split("");return U&&D(I,U,{hiLevel:N}),I.reverse(),P&&P.reverse(),I.join("")},D=function(M,P,U){var I,O,V,G,B,$=-1,W=M.length,oe=0,K=[],H=N?m:f,X=[];for(j=!1,a=!1,i=!1,O=0;O<W;O++)X[O]=S(M[O]);for(V=0;V<W;V++){if(B=oe,K[V]=C(M,X,K,V),I=240&(oe=H[B][g[K[V]]]),oe&=15,P[V]=G=H[oe][5],I>0)if(I===16){for(O=$;O<V;O++)P[O]=1;$=-1}else $=-1;if(H[oe][6])$===-1&&($=V);else if($>-1){for(O=$;O<V;O++)P[O]=G;$=-1}X[V]==="B"&&(P[V]=0),U.hiLevel|=G}i&&function(me,ie,ee){for(var he=0;he<ee;he++)if(me[he]==="S"){ie[he]=N;for(var ve=he-1;ve>=0&&me[ve]==="WS";ve--)ie[ve]=N}}(X,P,W)},A=function(M,P,U,I,O){if(!(O.hiLevel<M)){if(M===1&&N===1&&!a)return P.reverse(),void(U&&U.reverse());for(var V,G,B,$,W=P.length,oe=0;oe<W;){if(I[oe]>=M){for(B=oe+1;B<W&&I[B]>=M;)B++;for($=oe,G=B-1;$<G;$++,G--)V=P[$],P[$]=P[G],P[G]=V,U&&(V=U[$],U[$]=U[G],U[G]=V);oe=B}oe++}}},R=function(M,P,U){var I=M.split(""),O={hiLevel:N};return U||(U=[]),D(I,U,O),function(V,G,B){if(B.hiLevel!==0&&d)for(var $,W=0;W<V.length;W++)G[W]===1&&($=b.indexOf(V[W]))>=0&&(V[W]=b[$+1])}(I,U,O),A(2,I,P,U,O),A(1,I,P,U,O),I.join("")};return this.__bidiEngine__.doBidiReorder=function(M,P,U){if(function(O,V){if(V)for(var G=0;G<O.length;G++)V[G]=G;l===void 0&&(l=E(O)),u===void 0&&(u=E(O))}(M,P),o||!c||u)if(o&&c&&l^u)N=l?1:0,M=T(M,P,U);else if(!o&&c&&u)N=l?1:0,M=R(M,P,U),M=T(M,P);else if(!o||l||c||u){if(o&&!c&&l^u)M=T(M,P),l?(N=0,M=R(M,P,U)):(N=1,M=R(M,P,U),M=T(M,P));else if(o&&l&&!c&&u)N=1,M=R(M,P,U),M=T(M,P);else if(!o&&!c&&l^u){var I=d;l?(N=1,M=R(M,P,U),N=0,d=!1,M=R(M,P,U),d=I):(N=0,M=R(M,P,U),M=T(M,P),N=1,d=!1,M=R(M,P,U),d=I,M=T(M,P))}}else N=0,M=R(M,P,U);else N=l?1:0,M=R(M,P,U);return M},this.__bidiEngine__.setOptions=function(M){M&&(o=M.isInputVisual,c=M.isOutputVisual,l=M.isInputRtl,u=M.isOutputRtl,d=M.isSymmetricSwapping)},this.__bidiEngine__.setOptions(n),this.__bidiEngine__};var e=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],r=new t.__bidiEngine__({isInputVisual:!0});t.API.events.push(["postProcessText",function(n){var a=n.text;n.x,n.y;var i=n.options||{};n.mutex,i.lang;var o=[];if(i.isInputVisual=typeof i.isInputVisual!="boolean"||i.isInputVisual,r.setOptions(i),Object.prototype.toString.call(a)==="[object Array]"){var l=0;for(o=[],l=0;l<a.length;l+=1)Object.prototype.toString.call(a[l])==="[object Array]"?o.push([r.doBidiReorder(a[l][0]),a[l][1],a[l][2]]):o.push([r.doBidiReorder(a[l])]);n.text=o}else n.text=r.doBidiReorder(a);r.setOptions({isInputVisual:!0})}])}(Fr),Fr.API.TTFFont=function(){function t(e){var r;if(this.rawData=e,r=this.contents=new lm(e),this.contents.pos=4,r.readString(4)==="ttcf")throw new Error("TTCF not supported.");r.pos=0,this.parse(),this.subset=new $Ne(this),this.registerTTF()}return t.open=function(e){return new t(e)},t.prototype.parse=function(){return this.directory=new ENe(this.contents),this.head=new DNe(this),this.name=new BNe(this),this.cmap=new w7(this),this.toUnicode={},this.hhea=new TNe(this),this.maxp=new LNe(this),this.hmtx=new INe(this),this.post=new PNe(this),this.os2=new MNe(this),this.loca=new HNe(this),this.glyf=new ONe(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},t.prototype.registerTTF=function(){var e,r,n,a,i;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var o,l,c,u;for(u=[],o=0,l=(c=this.bbox).length;o<l;o++)e=c[o],u.push(Math.round(e*this.scaleFactor));return u}).call(this),this.stemV=0,this.post.exists?(n=255&(a=this.post.italic_angle),32768&(r=a>>16)&&(r=-(1+(65535^r))),this.italicAngle=+(r+"."+n)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(i=this.familyClass)===1||i===2||i===3||i===4||i===5||i===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},t.prototype.characterToGlyph=function(e){var r;return((r=this.cmap.unicode)!=null?r.codeMap[e]:void 0)||0},t.prototype.widthOfGlyph=function(e){var r;return r=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(e).advance*r},t.prototype.widthOfString=function(e,r,n){var a,i,o,l;for(o=0,i=0,l=(e=""+e).length;0<=l?i<l:i>l;i=0<=l?++i:--i)a=e.charCodeAt(i),o+=this.widthOfGlyph(this.characterToGlyph(a))+n*(1e3/r)||0;return o*(r/1e3)},t.prototype.lineHeight=function(e,r){var n;return r==null&&(r=!1),n=r?this.lineGap:0,(this.ascender+n-this.decender)/1e3*e},t}();var Wc,lm=function(){function t(e){this.data=e??[],this.pos=0,this.length=this.data.length}return t.prototype.readByte=function(){return this.data[this.pos++]},t.prototype.writeByte=function(e){return this.data[this.pos++]=e},t.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},t.prototype.writeUInt32=function(e){return this.writeByte(e>>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)},t.prototype.readInt32=function(){var e;return(e=this.readUInt32())>=2147483648?e-4294967296:e},t.prototype.writeInt32=function(e){return e<0&&(e+=4294967296),this.writeUInt32(e)},t.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},t.prototype.writeUInt16=function(e){return this.writeByte(e>>8&255),this.writeByte(255&e)},t.prototype.readInt16=function(){var e;return(e=this.readUInt16())>=32768?e-65536:e},t.prototype.writeInt16=function(e){return e<0&&(e+=65536),this.writeUInt16(e)},t.prototype.readString=function(e){var r,n;for(n=[],r=0;0<=e?r<e:r>e;r=0<=e?++r:--r)n[r]=String.fromCharCode(this.readByte());return n.join("")},t.prototype.writeString=function(e){var r,n,a;for(a=[],r=0,n=e.length;0<=n?r<n:r>n;r=0<=n?++r:--r)a.push(this.writeByte(e.charCodeAt(r)));return a},t.prototype.readShort=function(){return this.readInt16()},t.prototype.writeShort=function(e){return this.writeInt16(e)},t.prototype.readLongLong=function(){var e,r,n,a,i,o,l,c;return e=this.readByte(),r=this.readByte(),n=this.readByte(),a=this.readByte(),i=this.readByte(),o=this.readByte(),l=this.readByte(),c=this.readByte(),128&e?-1*(72057594037927940*(255^e)+281474976710656*(255^r)+1099511627776*(255^n)+4294967296*(255^a)+16777216*(255^i)+65536*(255^o)+256*(255^l)+(255^c)+1):72057594037927940*e+281474976710656*r+1099511627776*n+4294967296*a+16777216*i+65536*o+256*l+c},t.prototype.writeLongLong=function(e){var r,n;return r=Math.floor(e/4294967296),n=4294967295&e,this.writeByte(r>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r),this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n)},t.prototype.readInt=function(){return this.readInt32()},t.prototype.writeInt=function(e){return this.writeInt32(e)},t.prototype.read=function(e){var r,n;for(r=[],n=0;0<=e?n<e:n>e;n=0<=e?++n:--n)r.push(this.readByte());return r},t.prototype.write=function(e){var r,n,a,i;for(i=[],n=0,a=e.length;n<a;n++)r=e[n],i.push(this.writeByte(r));return i},t}(),ENe=function(){var t;function e(r){var n,a,i;for(this.scalarType=r.readInt(),this.tableCount=r.readShort(),this.searchRange=r.readShort(),this.entrySelector=r.readShort(),this.rangeShift=r.readShort(),this.tables={},a=0,i=this.tableCount;0<=i?a<i:a>i;a=0<=i?++a:--a)n={tag:r.readString(4),checksum:r.readInt(),offset:r.readInt(),length:r.readInt()},this.tables[n.tag]=n}return e.prototype.encode=function(r){var n,a,i,o,l,c,u,d,h,f,m,g,y;for(y in m=Object.keys(r).length,c=Math.log(2),h=16*Math.floor(Math.log(m)/c),o=Math.floor(h/c),d=16*m-h,(a=new lm).writeInt(this.scalarType),a.writeShort(m),a.writeShort(h),a.writeShort(o),a.writeShort(d),i=16*m,u=a.pos+i,l=null,g=[],r)for(f=r[y],a.writeString(y),a.writeInt(t(f)),a.writeInt(u),a.writeInt(f.length),g=g.concat(f),y==="head"&&(l=u),u+=f.length;u%4;)g.push(0),u++;return a.write(g),n=2981146554-t(a.data),a.pos=l+8,a.writeUInt32(n),a.data},t=function(r){var n,a,i,o;for(r=j7.call(r);r.length%4;)r.push(0);for(i=new lm(r),a=0,n=0,o=r.length;n<o;n=n+=4)a+=i.readUInt32();return 4294967295&a},e}(),ANe={}.hasOwnProperty,Eu=function(t,e){for(var r in e)ANe.call(e,r)&&(t[r]=e[r]);function n(){this.constructor=t}return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t};Wc=function(){function t(e){var r;this.file=e,r=this.file.directory.tables[this.tag],this.exists=!!r,r&&(this.offset=r.offset,this.length=r.length,this.parse(this.file.contents))}return t.prototype.parse=function(){},t.prototype.encode=function(){},t.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},t}();var DNe=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Eu(t,Wc),t.prototype.tag="head",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.revision=e.readInt(),this.checkSumAdjustment=e.readInt(),this.magicNumber=e.readInt(),this.flags=e.readShort(),this.unitsPerEm=e.readShort(),this.created=e.readLongLong(),this.modified=e.readLongLong(),this.xMin=e.readShort(),this.yMin=e.readShort(),this.xMax=e.readShort(),this.yMax=e.readShort(),this.macStyle=e.readShort(),this.lowestRecPPEM=e.readShort(),this.fontDirectionHint=e.readShort(),this.indexToLocFormat=e.readShort(),this.glyphDataFormat=e.readShort()},t.prototype.encode=function(e){var r;return(r=new lm).writeInt(this.version),r.writeInt(this.revision),r.writeInt(this.checkSumAdjustment),r.writeInt(this.magicNumber),r.writeShort(this.flags),r.writeShort(this.unitsPerEm),r.writeLongLong(this.created),r.writeLongLong(this.modified),r.writeShort(this.xMin),r.writeShort(this.yMin),r.writeShort(this.xMax),r.writeShort(this.yMax),r.writeShort(this.macStyle),r.writeShort(this.lowestRecPPEM),r.writeShort(this.fontDirectionHint),r.writeShort(e),r.writeShort(this.glyphDataFormat),r.data},t}(),DD=function(){function t(e,r){var n,a,i,o,l,c,u,d,h,f,m,g,y,b,w,j,N;switch(this.platformID=e.readUInt16(),this.encodingID=e.readShort(),this.offset=r+e.readInt(),h=e.pos,e.pos=this.offset,this.format=e.readUInt16(),this.length=e.readUInt16(),this.language=e.readUInt16(),this.isUnicode=this.platformID===3&&this.encodingID===1&&this.format===4||this.platformID===0&&this.format===4,this.codeMap={},this.format){case 0:for(c=0;c<256;++c)this.codeMap[c]=e.readByte();break;case 4:for(m=e.readUInt16(),f=m/2,e.pos+=6,i=function(){var S,E;for(E=[],c=S=0;0<=f?S<f:S>f;c=0<=f?++S:--S)E.push(e.readUInt16());return E}(),e.pos+=2,y=function(){var S,E;for(E=[],c=S=0;0<=f?S<f:S>f;c=0<=f?++S:--S)E.push(e.readUInt16());return E}(),u=function(){var S,E;for(E=[],c=S=0;0<=f?S<f:S>f;c=0<=f?++S:--S)E.push(e.readUInt16());return E}(),d=function(){var S,E;for(E=[],c=S=0;0<=f?S<f:S>f;c=0<=f?++S:--S)E.push(e.readUInt16());return E}(),a=(this.length-e.pos+this.offset)/2,l=function(){var S,E;for(E=[],c=S=0;0<=a?S<a:S>a;c=0<=a?++S:--S)E.push(e.readUInt16());return E}(),c=w=0,N=i.length;w<N;c=++w)for(b=i[c],n=j=g=y[c];g<=b?j<=b:j>=b;n=g<=b?++j:--j)d[c]===0?o=n+u[c]:(o=l[d[c]/2+(n-g)-(f-c)]||0)!==0&&(o+=u[c]),this.codeMap[n]=65535&o}e.pos=h}return t.encode=function(e,r){var n,a,i,o,l,c,u,d,h,f,m,g,y,b,w,j,N,S,E,C,T,D,A,R,M,P,U,I,O,V,G,B,$,W,oe,K,H,X,me,ie,ee,he,ve,Ce,re,we;switch(I=new lm,o=Object.keys(e).sort(function(Ee,Me){return Ee-Me}),r){case"macroman":for(y=0,b=function(){var Ee=[];for(g=0;g<256;++g)Ee.push(0);return Ee}(),j={0:0},i={},O=0,$=o.length;O<$;O++)j[ve=e[a=o[O]]]==null&&(j[ve]=++y),i[a]={old:e[a],new:j[e[a]]},b[a]=j[e[a]];return I.writeUInt16(1),I.writeUInt16(0),I.writeUInt32(12),I.writeUInt16(0),I.writeUInt16(262),I.writeUInt16(0),I.write(b),{charMap:i,subtable:I.data,maxGlyphID:y+1};case"unicode":for(P=[],h=[],N=0,j={},n={},w=u=null,V=0,W=o.length;V<W;V++)j[E=e[a=o[V]]]==null&&(j[E]=++N),n[a]={old:E,new:j[E]},l=j[E]-a,w!=null&&l===u||(w&&h.push(w),P.push(a),u=l),w=a;for(w&&h.push(w),h.push(65535),P.push(65535),R=2*(A=P.length),D=2*Math.pow(Math.log(A)/Math.LN2,2),f=Math.log(D/2)/Math.LN2,T=2*A-D,c=[],C=[],m=[],g=G=0,oe=P.length;G<oe;g=++G){if(M=P[g],d=h[g],M===65535){c.push(0),C.push(0);break}if(M-(U=n[M].new)>=32768)for(c.push(0),C.push(2*(m.length+A-g)),a=B=M;M<=d?B<=d:B>=d;a=M<=d?++B:--B)m.push(n[a].new);else c.push(U-M),C.push(0)}for(I.writeUInt16(3),I.writeUInt16(1),I.writeUInt32(12),I.writeUInt16(4),I.writeUInt16(16+8*A+2*m.length),I.writeUInt16(0),I.writeUInt16(R),I.writeUInt16(D),I.writeUInt16(f),I.writeUInt16(T),ee=0,K=h.length;ee<K;ee++)a=h[ee],I.writeUInt16(a);for(I.writeUInt16(0),he=0,H=P.length;he<H;he++)a=P[he],I.writeUInt16(a);for(Ce=0,X=c.length;Ce<X;Ce++)l=c[Ce],I.writeUInt16(l);for(re=0,me=C.length;re<me;re++)S=C[re],I.writeUInt16(S);for(we=0,ie=m.length;we<ie;we++)y=m[we],I.writeUInt16(y);return{charMap:n,subtable:I.data,maxGlyphID:N+1}}},t}(),w7=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Eu(t,Wc),t.prototype.tag="cmap",t.prototype.parse=function(e){var r,n,a;for(e.pos=this.offset,this.version=e.readUInt16(),a=e.readUInt16(),this.tables=[],this.unicode=null,n=0;0<=a?n<a:n>a;n=0<=a?++n:--n)r=new DD(e,this.offset),this.tables.push(r),r.isUnicode&&this.unicode==null&&(this.unicode=r);return!0},t.encode=function(e,r){var n,a;return r==null&&(r="macroman"),n=DD.encode(e,r),(a=new lm).writeUInt16(0),a.writeUInt16(1),n.table=a.data.concat(n.subtable),n},t}(),TNe=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Eu(t,Wc),t.prototype.tag="hhea",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.ascender=e.readShort(),this.decender=e.readShort(),this.lineGap=e.readShort(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort(),this.minRightSideBearing=e.readShort(),this.xMaxExtent=e.readShort(),this.caretSlopeRise=e.readShort(),this.caretSlopeRun=e.readShort(),this.caretOffset=e.readShort(),e.pos+=8,this.metricDataFormat=e.readShort(),this.numberOfMetrics=e.readUInt16()},t}(),MNe=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Eu(t,Wc),t.prototype.tag="OS/2",t.prototype.parse=function(e){if(e.pos=this.offset,this.version=e.readUInt16(),this.averageCharWidth=e.readShort(),this.weightClass=e.readUInt16(),this.widthClass=e.readUInt16(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort(),this.ySubscriptYSize=e.readShort(),this.ySubscriptXOffset=e.readShort(),this.ySubscriptYOffset=e.readShort(),this.ySuperscriptXSize=e.readShort(),this.ySuperscriptYSize=e.readShort(),this.ySuperscriptXOffset=e.readShort(),this.ySuperscriptYOffset=e.readShort(),this.yStrikeoutSize=e.readShort(),this.yStrikeoutPosition=e.readShort(),this.familyClass=e.readShort(),this.panose=function(){var r,n;for(n=[],r=0;r<10;++r)n.push(e.readByte());return n}(),this.charRange=function(){var r,n;for(n=[],r=0;r<4;++r)n.push(e.readInt());return n}(),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),this.version>0&&(this.ascent=e.readShort(),this.descent=e.readShort(),this.lineGap=e.readShort(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=function(){var r,n;for(n=[],r=0;r<2;r=++r)n.push(e.readInt());return n}(),this.version>1))return this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()},t}(),PNe=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Eu(t,Wc),t.prototype.tag="post",t.prototype.parse=function(e){var r,n,a;switch(e.pos=this.offset,this.format=e.readInt(),this.italicAngle=e.readInt(),this.underlinePosition=e.readShort(),this.underlineThickness=e.readShort(),this.isFixedPitch=e.readInt(),this.minMemType42=e.readInt(),this.maxMemType42=e.readInt(),this.minMemType1=e.readInt(),this.maxMemType1=e.readInt(),this.format){case 65536:case 196608:break;case 131072:var i;for(n=e.readUInt16(),this.glyphNameIndex=[],i=0;0<=n?i<n:i>n;i=0<=n?++i:--i)this.glyphNameIndex.push(e.readUInt16());for(this.names=[],a=[];e.pos<this.offset+this.length;)r=e.readByte(),a.push(this.names.push(e.readString(r)));return a;case 151552:return n=e.readUInt16(),this.offsets=e.read(n);case 262144:return this.map=(function(){var o,l,c;for(c=[],i=o=0,l=this.file.maxp.numGlyphs;0<=l?o<l:o>l;i=0<=l?++o:--o)c.push(e.readUInt32());return c}).call(this)}},t}(),RNe=function(t,e){this.raw=t,this.length=t.length,this.platformID=e.platformID,this.encodingID=e.encodingID,this.languageID=e.languageID},BNe=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Eu(t,Wc),t.prototype.tag="name",t.prototype.parse=function(e){var r,n,a,i,o,l,c,u,d,h,f;for(e.pos=this.offset,e.readShort(),r=e.readShort(),l=e.readShort(),n=[],i=0;0<=r?i<r:i>r;i=0<=r?++i:--i)n.push({platformID:e.readShort(),encodingID:e.readShort(),languageID:e.readShort(),nameID:e.readShort(),length:e.readShort(),offset:this.offset+l+e.readShort()});for(c={},i=d=0,h=n.length;d<h;i=++d)a=n[i],e.pos=a.offset,u=e.readString(a.length),o=new RNe(u,a),c[f=a.nameID]==null&&(c[f]=[]),c[a.nameID].push(o);this.strings=c,this.copyright=c[0],this.fontFamily=c[1],this.fontSubfamily=c[2],this.uniqueSubfamily=c[3],this.fontName=c[4],this.version=c[5];try{this.postscriptName=c[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=c[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=c[7],this.manufacturer=c[8],this.designer=c[9],this.description=c[10],this.vendorUrl=c[11],this.designerUrl=c[12],this.license=c[13],this.licenseUrl=c[14],this.preferredFamily=c[15],this.preferredSubfamily=c[17],this.compatibleFull=c[18],this.sampleText=c[19]},t}(),LNe=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Eu(t,Wc),t.prototype.tag="maxp",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.numGlyphs=e.readUInt16(),this.maxPoints=e.readUInt16(),this.maxContours=e.readUInt16(),this.maxCompositePoints=e.readUInt16(),this.maxComponentContours=e.readUInt16(),this.maxZones=e.readUInt16(),this.maxTwilightPoints=e.readUInt16(),this.maxStorage=e.readUInt16(),this.maxFunctionDefs=e.readUInt16(),this.maxInstructionDefs=e.readUInt16(),this.maxStackElements=e.readUInt16(),this.maxSizeOfInstructions=e.readUInt16(),this.maxComponentElements=e.readUInt16(),this.maxComponentDepth=e.readUInt16()},t}(),INe=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Eu(t,Wc),t.prototype.tag="hmtx",t.prototype.parse=function(e){var r,n,a,i,o,l,c;for(e.pos=this.offset,this.metrics=[],r=0,l=this.file.hhea.numberOfMetrics;0<=l?r<l:r>l;r=0<=l?++r:--r)this.metrics.push({advance:e.readUInt16(),lsb:e.readInt16()});for(a=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var u,d;for(d=[],r=u=0;0<=a?u<a:u>a;r=0<=a?++u:--u)d.push(e.readInt16());return d}(),this.widths=(function(){var u,d,h,f;for(f=[],u=0,d=(h=this.metrics).length;u<d;u++)i=h[u],f.push(i.advance);return f}).call(this),n=this.widths[this.widths.length-1],c=[],r=o=0;0<=a?o<a:o>a;r=0<=a?++o:--o)c.push(this.widths.push(n));return c},t.prototype.forGlyph=function(e){return e in this.metrics?this.metrics[e]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[e-this.metrics.length]}},t}(),j7=[].slice,ONe=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Eu(t,Wc),t.prototype.tag="glyf",t.prototype.parse=function(){return this.cache={}},t.prototype.glyphFor=function(e){var r,n,a,i,o,l,c,u,d,h;return e in this.cache?this.cache[e]:(i=this.file.loca,r=this.file.contents,n=i.indexOf(e),(a=i.lengthOf(e))===0?this.cache[e]=null:(r.pos=this.offset+n,o=(l=new lm(r.read(a))).readShort(),u=l.readShort(),h=l.readShort(),c=l.readShort(),d=l.readShort(),this.cache[e]=o===-1?new UNe(l,u,h,c,d):new zNe(l,o,u,h,c,d),this.cache[e]))},t.prototype.encode=function(e,r,n){var a,i,o,l,c;for(o=[],i=[],l=0,c=r.length;l<c;
1182l++)a=e[r[l]],i.push(o.length),a&&(o=o.concat(a.encode(n)));return i.push(o.length),{table:o,offsets:i}},t}(),zNe=function(){function t(e,r,n,a,i,o){this.raw=e,this.numberOfContours=r,this.xMin=n,this.yMin=a,this.xMax=i,this.yMax=o,this.compound=!1}return t.prototype.encode=function(){return this.raw.data},t}(),UNe=function(){function t(e,r,n,a,i){var o,l;for(this.raw=e,this.xMin=r,this.yMin=n,this.xMax=a,this.yMax=i,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],o=this.raw;l=o.readShort(),this.glyphOffsets.push(o.pos),this.glyphIDs.push(o.readUInt16()),32&l;)o.pos+=1&l?4:2,128&l?o.pos+=8:64&l?o.pos+=4:8&l&&(o.pos+=2)}return t.prototype.encode=function(){var e,r,n;for(r=new lm(j7.call(this.raw.data)),e=0,n=this.glyphIDs.length;e<n;++e)r.pos=this.glyphOffsets[e];return r.data},t}(),HNe=function(){function t(){return t.__super__.constructor.apply(this,arguments)}return Eu(t,Wc),t.prototype.tag="loca",t.prototype.parse=function(e){var r,n;return e.pos=this.offset,r=this.file.head.indexToLocFormat,this.offsets=r===0?(function(){var a,i;for(i=[],n=0,a=this.length;n<a;n+=2)i.push(2*e.readUInt16());return i}).call(this):(function(){var a,i;for(i=[],n=0,a=this.length;n<a;n+=4)i.push(e.readUInt32());return i}).call(this)},t.prototype.indexOf=function(e){return this.offsets[e]},t.prototype.lengthOf=function(e){return this.offsets[e+1]-this.offsets[e]},t.prototype.encode=function(e,r){for(var n=new Uint32Array(this.offsets.length),a=0,i=0,o=0;o<n.length;++o)if(n[o]=a,i<r.length&&r[i]==o){++i,n[o]=a;var l=this.offsets[o],c=this.offsets[o+1]-l;c>0&&(a+=c)}for(var u=new Array(4*n.length),d=0;d<n.length;++d)u[4*d+3]=255&n[d],u[4*d+2]=(65280&n[d])>>8,u[4*d+1]=(16711680&n[d])>>16,u[4*d]=(4278190080&n[d])>>24;return u},t}(),$Ne=function(){function t(e){this.font=e,this.subset={},this.unicodes={},this.next=33}return t.prototype.generateCmap=function(){var e,r,n,a,i;for(r in a=this.font.cmap.tables[0].codeMap,e={},i=this.subset)n=i[r],e[r]=a[n];return e},t.prototype.glyphsFor=function(e){var r,n,a,i,o,l,c;for(a={},o=0,l=e.length;o<l;o++)a[i=e[o]]=this.font.glyf.glyphFor(i);for(i in r=[],a)(n=a[i])!=null&&n.compound&&r.push.apply(r,n.glyphIDs);if(r.length>0)for(i in c=this.glyphsFor(r))n=c[i],a[i]=n;return a},t.prototype.encode=function(e,r){var n,a,i,o,l,c,u,d,h,f,m,g,y,b,w;for(a in n=w7.encode(this.generateCmap(),"unicode"),o=this.glyphsFor(e),m={0:0},w=n.charMap)m[(c=w[a]).old]=c.new;for(g in f=n.maxGlyphID,o)g in m||(m[g]=f++);return d=function(j){var N,S;for(N in S={},j)S[j[N]]=N;return S}(m),h=Object.keys(d).sort(function(j,N){return j-N}),y=function(){var j,N,S;for(S=[],j=0,N=h.length;j<N;j++)l=h[j],S.push(d[l]);return S}(),i=this.font.glyf.encode(o,y,m),u=this.font.loca.encode(i.offsets,y),b={cmap:this.font.cmap.raw(),glyf:i.table,loca:u,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(r)},this.font.os2.exists&&(b["OS/2"]=this.font.os2.raw()),this.font.directory.encode(b)},t}();Fr.API.PDFObject=function(){var t;function e(){}return t=function(r,n){return(Array(n+1).join("0")+r).slice(-n)},e.convert=function(r){var n,a,i,o;if(Array.isArray(r))return"["+function(){var l,c,u;for(u=[],l=0,c=r.length;l<c;l++)n=r[l],u.push(e.convert(n));return u}().join(" ")+"]";if(typeof r=="string")return"/"+r;if(r!=null&&r.isString)return"("+r+")";if(r instanceof Date)return"(D:"+t(r.getUTCFullYear(),4)+t(r.getUTCMonth(),2)+t(r.getUTCDate(),2)+t(r.getUTCHours(),2)+t(r.getUTCMinutes(),2)+t(r.getUTCSeconds(),2)+"Z)";if({}.toString.call(r)==="[object Object]"){for(a in i=["<<"],r)o=r[a],i.push("/"+a+" "+e.convert(o));return i.push(">>"),i.join(` 1183`)}return""+r},e}();function N7(t,e,r,n,a){n=n||{};var i=1.15,o=a.internal.scaleFactor,l=a.internal.getFontSize()/o,c=a.getLineHeightFactor?a.getLineHeightFactor():i,u=l*c,d=/\r\n|\r|\n/g,h="",f=1;if((n.valign==="middle"||n.valign==="bottom"||n.halign==="center"||n.halign==="right")&&(h=typeof t=="string"?t.split(d):t,f=h.length||1),r+=l*(2-i),n.valign==="middle"?r-=f/2*u:n.valign==="bottom"&&(r-=f*u),n.halign==="center"||n.halign==="right"){var m=l;if(n.halign==="center"&&(m*=.5),h&&f>=1){for(var g=0;g<h.length;g++)a.text(h[g],e-a.getStringUnitWidth(h[g])*m,r),r+=u;return a}e-=a.getStringUnitWidth(t)*m}return n.halign==="justify"?a.text(t,e,r,{maxWidth:n.maxWidth||100,align:"justify"}):a.text(t,e,r),a}var TD={},Tg=function(){function t(e){this.jsPDFDocument=e,this.userStyles={textColor:e.getTextColor?this.jsPDFDocument.getTextColor():0,fontSize:e.internal.getFontSize(),fontStyle:e.internal.getFont().fontStyle,font:e.internal.getFont().fontName,lineWidth:e.getLineWidth?this.jsPDFDocument.getLineWidth():0,lineColor:e.getDrawColor?this.jsPDFDocument.getDrawColor():0}}return t.setDefaults=function(e,r){r===void 0&&(r=null),r?r.__autoTableDocumentDefaults=e:TD=e},t.unifyColor=function(e){return Array.isArray(e)?e:typeof e=="number"?[e,e,e]:typeof e=="string"?[e]:null},t.prototype.applyStyles=function(e,r){var n,a,i;r===void 0&&(r=!1),e.fontStyle&&this.jsPDFDocument.setFontStyle&&this.jsPDFDocument.setFontStyle(e.fontStyle);var o=this.jsPDFDocument.internal.getFont(),l=o.fontStyle,c=o.fontName;if(e.font&&(c=e.font),e.fontStyle){l=e.fontStyle;
1183var u=this.getFontList()[c];u&&u.indexOf(l)===-1&&this.jsPDFDocument.setFontStyle&&(this.jsPDFDocument.setFontStyle(u[0]),l=u[0])}if(this.jsPDFDocument.setFont(c,l),e.fontSize&&this.jsPDFDocument.setFontSize(e.fontSize),!r){var d=t.unifyColor(e.fillColor);d&&(n=this.jsPDFDocument).setFillColor.apply(n,d),d=t.unifyColor(e.textColor),d&&(a=this.jsPDFDocument).setTextColor.apply(a,d),d=t.unifyColor(e.lineColor),d&&(i=this.jsPDFDocument).setDrawColor.apply(i,d),typeof e.lineWidth=="number"&&this.jsPDFDocument.setLineWidth(e.lineWidth)}},t.prototype.splitTextToSize=function(e,r,n){return this.jsPDFDocument.splitTextToSize(e,r,n)},t.prototype.rect=function(e,r,n,a,i){return this.jsPDFDocument.rect(e,r,n,a,i)},t.prototype.getLastAutoTable=function(){return this.jsPDFDocument.lastAutoTable||null},t.prototype.getTextWidth=function(e){return this.jsPDFDocument.getTextWidth(e)},t.prototype.getDocument=function(){return this.jsPDFDocument},t.prototype.setPage=function(e){this.jsPDFDocument.setPage(e)},t.prototype.addPage=function(){return this.jsPDFDocument.addPage()},t.prototype.getFontList=function(){return this.jsPDFDocument.getFontList()},t.prototype.getGlobalOptions=function(){return TD||{}},t.prototype.getDocumentOptions=function(){return this.jsPDFDocument.__autoTableDocumentDefaults||{}},t.prototype.pageSize=function(){var e=this.jsPDFDocument.internal.pageSize;return e.width==null&&(e={width:e.getWidth(),height:e.getHeight()}),e},t.prototype.scaleFactor=function(){return this.jsPDFDocument.internal.scaleFactor},t.prototype.getLineHeightFactor=function(){var e=this.jsPDFDocument;return e.getLineHeightFactor?e.getLineHeightFactor():1.15},t.prototype.getLineHeight=function(e){return e/this.scaleFactor()*this.getLineHeightFactor()},t.prototype.pageNumber=function(){var e=this.jsPDFDocument.internal.getCurrentPageInfo();return e?e.pageNumber:this.jsPDFDocument.internal.getNumberOfPages()},t}
1183(),PS=function(t,e){return PS=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])},PS(t,e)};function F7(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");PS(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var S7=function(t){F7(e,t);function e(r){var n=t.call(this)||this;return n._element=r,n}return e}(Array);function WNe(t){return{font:"helvetica",fontStyle:"normal",overflow:"linebreak",fillColor:!1,textColor:20,halign:"left",valign:"top",fontSize:10,cellPadding:5/t,lineColor:200,lineWidth:0,cellWidth:"auto",minCellHeight:0,minCellWidth:0}}function qNe(t){var e={striped:{table:{fillColor:255,textColor:80,fontStyle:"normal"},head:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},body:{},foot:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},alternateRow:{fillColor:245}},grid:{table:{fillColor:255,textColor:80,fontStyle:"normal",lineWidth:.1},head:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},body:{},foot:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},alternateRow:{}},plain:{head:{fontStyle:"bold"},foot:{fontStyle:"bold"}}};return e[t]}function V1(t,e,r){r.applyStyles(e,!0);var n=Array.isArray(t)?t:[t],a=n.map(function(i){return r.getTextWidth(i)}).reduce(function(i,o){return Math.max(i,o)},0);return a}function C7(t,e,r,n){var a=e.settings.tableLineWidth,i=e.settings.tableLineColor;t.applyStyles({lineWidth:a,lineColor:i});var o=k7(a,!1);o&&t.rect(r.x,r.y,e.getWidth(t.pageSize().width),n.y-r.y,o)}function k7(t,e){var r=t>0,n=e||e===0;return r&&n?"DF":r?"S":n?"F":null}function uj(t,e){var r,n,a,i;if(t=t||e,Array.isArray(t)){if(t.length>=4)return{top:t[0],right:t[1],bottom:t[2],left:t[3]};if(t.length===3)return{top:t[0],right:t[1],bottom:t[2],left:t[1]};if(t.length===2)return{top:t[0],right:t[1],bottom:t[0],left:t[1]};t.length===1?t=t[0]:t=e}return typeof t=="object"?(typeof t.vertical=="number"&&(t.top=t.vertical,t.bottom=t.vertical),typeof t.horizontal=="number"&&(t.right=t.horizontal,t.left=t.horizontal),{left:(r=t.left)!==null&&r!==void 0?r:e,top:(n=t.top)!==null&&n!==void 0?n:e,right:(a=t.right)!==null&&a!==void 0?a:e,bottom:(i=t.bottom)!==null&&i!==void 0?i:e}):(typeof t!="number"&&(t=e),{top:t,right:t,bottom:t,left:t})}function _7(t,e){var r=uj(e.settings.margin,0);return t.pageSize().width-(r.left+r.right)}function GNe(t,e,r,n,a){var i={},o=1.3333333333333333,l=SN(e,function(N){return a.getComputedStyle(N).backgroundColor});l!=null&&(i.fillColor=l);var c=SN(e,function(N){return a.getComputedStyle(N).color});c!=null&&(i.textColor=c);var u=KNe(n,r);u&&(i.cellPadding=u);var d="borderTopColor",h=o*r,f=n.borderTopWidth;if(n.borderBottomWidth===f&&n.borderRightWidth===f&&n.borderLeftWidth===f){var m=(parseFloat(f)||0)/h;m&&(i.lineWidth=m)}else i.lineWidth={top:(parseFloat(n.borderTopWidth)||0)/h,right:(parseFloat(n.borderRightWidth)||0)/h,bottom:(parseFloat(n.borderBottomWidth)||0)/h,left:(parseFloat(n.borderLeftWidth)||0)/h},i.lineWidth.top||(i.lineWidth.right?d="borderRightColor":i.lineWidth.bottom?d="borderBottomColor":i.lineWidth.left&&(d="borderLeftColor"));var g=SN(e,function(N){return a.getComputedStyle(N)[d]});g!=null&&(i.lineColor=g);var y=["left","right","center","justify"];y.indexOf(n.textAlign)!==-1&&(i.halign=n.textAlign),y=["middle","bottom","top"],y.indexOf(n.verticalAlign)!==-1&&(i.valign=n.verticalAlign);var b=parseInt(n.fontSize||"");isNaN(b)||(i.fontSize=b/o);var w=VNe(n);w&&(i.fontStyle=w);var j=(n.fontFamily||"").toLowerCase();return t.indexOf(j)!==-1&&(i.font=j),i}function VNe(t){var e="";return(t.fontWeight==="bold"||t.fontWeight==="bolder"||parseInt(t.fontWeight)>=700)&&(e="bold"),(t.fontStyle==="italic"||t.fontStyle==="oblique")&&(e+="italic"),e}function SN(t,e){var r=E7(t,e);if(!r)return null;var n=r.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d*))?\)$/);if(!n||!Array.isArray(n))return null;var a=[parseInt(n[1]),parseInt(n[2]),parseInt(n[3])],i=parseInt(n[4]);return i===0||isNaN(a[0])||isNaN(a[1])||isNaN(a[2])?null:a}function E7(t,e){var r=e(t);return r==="rgba(0, 0, 0, 0)"||r==="transparent"||r==="initial"||r==="inherit"?t.parentElement==null?null:E7(t.parentElement,e):r}function KNe(t,e){var r=[t.paddingTop,t.paddingRight,t.paddingBottom,t.paddingLeft],n=96/(72/e),a=(parseInt(t.lineHeight)-parseInt(t.fontSize))/e/2,i=r.map(function(l){return parseInt(l||"0")/n}),o=uj(i,0);return a>
1183o.top&&(o.top=a),a>o.bottom&&(o.bottom=a),o}function A7(t,e,r,n,a){var i,o;n===void 0&&(n=!1),a===void 0&&(a=!1);var l;typeof e=="string"?l=r.document.querySelector(e):l=e;var c=Object.keys(t.getFontList()),u=t.scaleFactor(),d=[],h=[],f=[];if(!l)return console.error("Html table could not be found with input: ",e),{head:d,body:h,foot:f};for(var m=0;m<l.rows.length;m++){var g=l.rows[m],y=(o=(i=g==null?void 0:g.parentElement)===null||i===void 0?void 0:i.tagName)===null||o===void 0?void 0:o.toLowerCase(),b=JNe(c,u,r,g,n,a);b&&(y==="thead"?d.push(b):y==="tfoot"?f.push(b):h.push(b))}return{head:d,body:h,foot:f}}function JNe(t,e,r,n,a,i){for(var o=new S7(n),l=0;l<n.cells.length;l++){var c=n.cells[l],u=r.getComputedStyle(c);if(a||u.display!=="none"){var d=void 0;i&&(d=GNe(t,c,e,u,r)),o.push({rowSpan:c.rowSpan,colSpan:c.colSpan,styles:d,_element:c,content:YNe(c)})}}var h=r.getComputedStyle(n);if(o.length>0&&(a||h.display!=="none"))return o}function YNe(t){var e=t.cloneNode(!0);return e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/ +/g," "),e.innerHTML=e.innerHTML.split(/<br.*?>/).map(function(r){return r.trim()}).join(` 1184`),e.innerText||e.textContent||""}function ZNe(t,e,r){for(var n=0,a=[t,e,r];n<a.length;n++){var i=a[n];i&&typeof i!="object"&&console.error("The options parameter should be of type object, is: "+typeof i),i.startY&&typeof i.startY!="number"&&(console.error("Invalid value for startY option",i.startY),delete i.startY)}}function gd(t,e,r,n,a){if(t==null)throw new TypeError("Cannot convert undefined or null to object");for(var i=Object(t),o=1;o<arguments.length;o++){var l=arguments[o];if(l!=null)for(var c in l)Object.prototype.hasOwnProperty.call(l,c)&&(i[c]=l[c])}return i}function D7(t,e){var r=new Tg(t),n=r.getDocumentOptions(),a=r.getGlobalOptions();ZNe(a,n,e);var i=gd({},a,n,e),o;typeof window<"u"&&(o=window);var l=XNe(a,n,e),c=QNe(a,n,e),u=eFe(r,i),d=rFe(r,i,o);return{id:e.tableId,content:d,hooks:c,styles:l,settings:u}}function XNe(t,e,r){for(var n={styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{}},a=function(c){if(c==="columnStyles"){var u=t[c],d=e[c],h=r[c];n.columnStyles=gd({},u,d,h)}else{var f=[t,e,r],m=f.map(function(g){return g[c]||{}});n[c]=gd({},m[0],m[1],m[2])}},i=0,o=Object.keys(n);i<o.length;i++){var l=o[i];a(l)}return n}function QNe(t,e,r){for(var n=[t,e,r],a={didParseCell:[],willDrawCell:[],didDrawCell:[],willDrawPage:[],didDrawPage:[]},i=0,o=n;i<o.length;i++){var l=o[i];l.didParseCell&&a.didParseCell.push(l.didParseCell),l.willDrawCell&&a.willDrawCell.push(l.willDrawCell),l.didDrawCell&&a.didDrawCell.push(l.didDrawCell),l.willDrawPage&&a.willDrawPage.push(l.willDrawPage),l.didDrawPage&&a.didDrawPage.push(l.didDrawPage)}return a}function eFe(t,e){var r,n,a,i,o,l,c,u,d,h,f,m,g=uj(e.margin,40/t.scaleFactor()),y=(r=tFe(t,e.startY))!==null&&r!==void 0?r:g.top,b;e.showFoot===!0?b="everyPage":e.showFoot===!1?b="never":b=(n=e.showFoot)!==null&&n!==void 0?n:"everyPage";var w;e.showHead===!0?w="everyPage":e.showHead===!1?w="never":w=(a=e.showHead)!==null&&a!==void 0?a:"everyPage";var j=(i=e.useCss)!==null&&i!==void 0?i:!1,N=e.theme||(j?"plain":"striped"),S=!!e.horizontalPageBreak,E=(o=e.horizontalPageBreakRepeat)!==null&&o!==void 0?o:null;return{includeHiddenHtml:(l=e.includeHiddenHtml)!==null&&l!==void 0?l:!1,useCss:j,theme:N,startY:y,margin:g,pageBreak:(c=e.pageBreak)!==null&&c!==void 0?c:"auto",rowPageBreak:(u=e.rowPageBreak)!==null&&u!==void 0?u:"auto",tableWidth:(d=e.tableWidth)!==null&&d!==void 0?d:"auto",showHead:w,showFoot:b,tableLineWidth:(h=e.tableLineWidth)!==null&&h!==void 0?h:0,tableLineColor:(f=e.tableLineColor)!==null&&f!==void 0?f:200,horizontalPageBreak:S,horizontalPageBreakRepeat:E,horizontalPageBreakBehaviour:(m=e.horizontalPageBreakBehaviour)!==null&&m!==void 0?m:"afterAllRows"}}function tFe(t,e){var r=t.getLastAutoTable(),n=t.scaleFactor(),a=t.pageNumber(),i=!1;if(r&&r.startPageNumber){var o=r.startPageNumber+r.pageNumber-1;i=o===a}return typeof e=="number"?e:(e==null||e===!1)&&i&&(r==null?void 0:r.finalY)!=null?r.finalY+20/n:null}function rFe(t,e,r){var n=e.head||[],a=e.body||[],i=e.foot||[];if(e.html){var o=e.includeHiddenHtml;if(r){var l=A7(t,e.html,r,o,e.useCss)||{};n=l.head||n,a=l.body||n,i=l.foot||n}else console.error("Cannot parse html in non browser environment")}var c=e.columns||sFe(n,a,i);return{columns:c,head:n,body:a,foot:i}}function sFe(t,e,r){var n=t[0]||e[0]||r[0]||[],a=[];return Object.keys(n).filter(function(i){return i!=="_element"}
1184).forEach(function(i){var o=1,l;Array.isArray(n)?l=n[parseInt(i)]:l=n[i],typeof l=="object"&&!Array.isArray(l)&&(o=(l==null?void 0:l.colSpan)||1);for(var c=0;c<o;c++){var u=void 0;Array.isArray(n)?u=a.length:u=i+(c>0?"_".concat(c):"");var d={dataKey:u};a.push(d)}}),a}var RS=function(){function t(e,r,n){this.table=r,this.pageNumber=r.pageNumber,this.settings=r.settings,this.cursor=n,this.doc=e.getDocument()}return t}(),nFe=function(t){F7(e,t);function e(r,n,a,i,o,l){var c=t.call(this,r,n,l)||this;return c.cell=a,c.row=i,c.column=o,c.section=i.section,c}return e}(RS),aFe=function(){function t(e,r){this.pageNumber=1,this.id=e.id,this.settings=e.settings,this.styles=e.styles,this.hooks=e.hooks,this.columns=r.columns,this.head=r.head,this.body=r.body,this.foot=r.foot}return t.prototype.getHeadHeight=function(e){return this.head.reduce(function(r,n){return r+n.getMaxCellHeight(e)},0)},t.prototype.getFootHeight=function(e){return this.foot.reduce(function(r,n){return r+n.getMaxCellHeight(e)},0)},t.prototype.allRows=function(){return this.head.concat(this.body).concat(this.foot)},t.prototype.callCellHooks=function(e,r,n,a,i,o){for(var l=0,c=r;l<c.length;l++){var u=c[l],d=new nFe(e,this,n,a,i,o),h=u(d)===!1;if(n.text=Array.isArray(n.text)?n.text:[n.text],h)return!1}return!0},t.prototype.callEndPageHooks=function(e,r){e.applyStyles(e.userStyles);for(var n=0,a=this.hooks.didDrawPage;n<a.length;n++){var i=a[n];i(new RS(e,this,r))}},t.prototype.callWillDrawPageHooks=function(e,r){for(var n=0,a=this.hooks.willDrawPage;n<a.length;n++){var i=a[n];i(new RS(e,this,r))}},t.prototype.getWidth=function(e){if(typeof this.settings.tableWidth=="number")return this.settings.tableWidth;if(this.settings.tableWidth==="wrap"){var r=this.columns.reduce(function(a,i){return a+i.wrappedWidth},0);return r}else{var n=this.settings.margin;return e-n.left-n.right}},t}(),T7=function(){function t(e,r,n,a,i){i===void 0&&(i=!1),this.height=0,this.raw=e,e instanceof S7&&(this.raw=e._element,this.element=e._element),this.index=r,this.section=n,this.cells=a,this.spansMultiplePages=i}return t.prototype.getMaxCellHeight=function(e){var r=this;return e.reduce(function(n,a){var i;return Math.max(n,((i=r.cells[a.index])===null||i===void 0?void 0:i.height)||0)},0)},t.prototype.hasRowSpan=function(e){var r=this;return e.filter(function(n){var a=r.cells[n.index];return a?a.rowSpan>1:!1}).length>0},t.prototype.canEntireRowFit=function(e,r){return this.getMaxCellHeight(r)<=e},t.prototype.getMinimumRowHeight=function(e,r){var n=this;return e.reduce(function(a,i){var o=n.cells[i.index];if(!o)return 0;var l=r.getLineHeight(o.styles.fontSize),c=o.padding("vertical"),u=c+l;return u>a?u:a},0)},t}(),M7=function(){function t(e,r,n){var a;this.contentHeight=0,this.contentWidth=0,this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.height=0,this.x=0,this.y=0,this.styles=r,this.section=n,this.raw=e;var i=e;e!=null&&typeof e=="object"&&!Array.isArray(e)?(this.rowSpan=e.rowSpan||1,this.colSpan=e.colSpan||1,i=(a=e.content)!==null&&a!==void 0?a:e,e._element&&(this.raw=e._element)):(this.rowSpan=1,this.colSpan=1);var o=i!=null?""+i:"",l=/\r\n|\r|\n/g;this.text=o.split(l)}return t.prototype.getTextPos=function(){var e;if(this.styles.valign==="top")e=this.y+this.padding("top");else if(this.styles.valign==="bottom")e=this.y+this.height-this.padding("bottom");else{var r=this.height-this.padding("vertical");e=this.y+r/2+this.padding("top")}var n;if(this.styles.halign==="right")n=this.x+this.width-this.padding("right");else if(this.styles.halign==="center"){var a=this.width-this.padding("horizontal");n=this.x+a/2+this.padding("left")}else n=this.x+this.padding("left");return{x:n,y:e}},t.prototype.getContentHeight=function(e,r){r===void 0&&(r=1.15);var n=Array.isArray(this.text)?this.text.length:1,a=this.styles.fontSize/e*r,i=n*a+this.padding("vertical");return Math.max(i,this.styles.minCellHeight)},t.prototype.padding=function(e){var r=uj(this.styles.cellPadding,0);return e==="vertical"?r.top+r.bottom:e==="horizontal"?r.left+r.right:r[e]},t}(),iFe=function(){function t(e,r,n){this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.dataKey=e,this.raw=r,this.index=n}return t.prototype.getMaxCustomCellWidth=function(e){for(var r=0,n=0,a=e.allRows();n<a.length;n++){var i=a[n],o=i.cells[this.index];
1184o&&typeof o.styles.cellWidth=="number"&&(r=Math.max(r,o.styles.cellWidth))}return r},t}();function oFe(t,e){lFe(t,e);var r=[],n=0;e.columns.forEach(function(i){var o=i.getMaxCustomCellWidth(e);o?i.width=o:(i.width=i.wrappedWidth,r.push(i)),n+=i.width});var a=e.getWidth(t.pageSize().width)-n;a&&(a=BS(r,a,function(i){return Math.max(i.minReadableWidth,i.minWidth)})),a&&(a=BS(r,a,function(i){return i.minWidth})),a=Math.abs(a),!e.settings.horizontalPageBreak&&a>.1/t.scaleFactor()&&(a=a<1?a:Math.round(a),console.log("Of the table content, ".concat(a," units width could not fit page"))),uFe(e),dFe(e,t),cFe(e)}function lFe(t,e){var r=t.scaleFactor(),n=e.settings.horizontalPageBreak,a=_7(t,e);e.allRows().forEach(function(i){for(var o=0,l=e.columns;o<l.length;o++){var c=l[o],u=i.cells[c.index];if(u){var d=e.hooks.didParseCell;e.callCellHooks(t,d,u,i,c,null);var h=u.padding("horizontal");u.contentWidth=V1(u.text,u.styles,t)+h;var f=V1(u.text.join(" ").split(/[^\S\u00A0]+/),u.styles,t);if(u.minReadableWidth=f+u.padding("horizontal"),typeof u.styles.cellWidth=="number")u.minWidth=u.styles.cellWidth,u.wrappedWidth=u.styles.cellWidth;else if(u.styles.cellWidth==="wrap"||n===!0)u.contentWidth>a?(u.minWidth=a,u.wrappedWidth=a):(u.minWidth=u.contentWidth,u.wrappedWidth=u.contentWidth);else{var m=10/r;u.minWidth=u.styles.minCellWidth||m,u.wrappedWidth=u.contentWidth,u.minWidth>u.wrappedWidth&&(u.wrappedWidth=u.minWidth)}}}}),e.allRows().forEach(function(i){for(var o=0,l=e.columns;o<l.length;o++){var c=l[o],u=i.cells[c.index];if(u&&u.colSpan===1)c.wrappedWidth=Math.max(c.wrappedWidth,u.wrappedWidth),c.minWidth=Math.max(c.minWidth,u.minWidth),c.minReadableWidth=Math.max(c.minReadableWidth,u.minReadableWidth);else{var d=e.styles.columnStyles[c.dataKey]||e.styles.columnStyles[c.index]||{},h=d.cellWidth||d.minCellWidth;h&&typeof h=="number"&&(c.minWidth=h,c.wrappedWidth=h)}u&&(u.colSpan>1&&!c.minWidth&&(c.minWidth=u.minWidth),u.colSpan>1&&!c.wrappedWidth&&(c.wrappedWidth=u.minWidth))}})}function BS(t,e,r){for(var n=e,a=t.reduce(function(m,g){return m+g.wrappedWidth},0),i=0;i<t.length;i++){var o=t[i],l=o.wrappedWidth/a,c=n*l,u=o.width+c,d=r(o),h=u<d?d:u;e-=h-o.width,o.width=h}if(e=Math.round(e*1e10)/1e10,e){var f=t.filter(function(m){return e<0?m.width>r(m):!0});f.length&&(e=BS(f,e,r))}return e}function cFe(t){for(var e={},r=1,n=t.allRows(),a=0;a<n.length;a++)for(var i=n[a],o=0,l=t.columns;o<l.length;o++){var c=l[o],u=e[c.index];if(r>1)r--,delete i.cells[c.index];else if(u)u.cell.height+=i.height,r=u.cell.colSpan,delete i.cells[c.index],u.left--,u.left<=1&&delete e[c.index];else{var d=i.cells[c.index];if(!d)continue;if(d.height=i.height,d.rowSpan>1){var h=n.length-a,f=d.rowSpan>h?h:d.rowSpan;e[c.index]={cell:d,left:f,row:i}}}}}function uFe(t){for(var e=t.allRows(),r=0;r<e.length;r++)for(var n=e[r],a=null,i=0,o=0,l=0;l<t.columns.length;l++){var c=t.columns[l];if(o-=1,o>1&&t.columns[l+1])i+=c.width,delete n.cells[c.index];else if(a){var u=a;delete n.cells[c.index],a=null,u.width=c.width+i}else{var u=n.cells[c.index];if(!u)continue;if(o=u.colSpan,i=0,u.colSpan>1){a=u,i+=c.width;continue}u.width=c.width+i}}}function dFe(t,e){for(var r={count:0,height:0},n=0,a=t.allRows();n<a.length;n++){for(var i=a[n],o=0,l=t.columns;o<l.length;o++){var c=l[o],u=i.cells[c.index];if(u){e.applyStyles(u.styles,!0);var d=u.width-u.padding("horizontal");if(u.styles.overflow==="linebreak")u.text=e.splitTextToSize(u.text,d+1/e.scaleFactor(),{fontSize:u.styles.fontSize});else if(u.styles.overflow==="ellipsize")u.text=MD(u.text,d,u.styles,e,"...");else if(u.styles.overflow==="hidden")u.text=MD(u.text,d,u.styles,e,"");else if(typeof u.styles.overflow=="function"){var h=u.styles.overflow(u.text,d);typeof h=="string"?u.text=[h]:u.text=h}u.contentHeight=u.getContentHeight(e.scaleFactor(),e.getLineHeightFactor());var f=u.contentHeight/u.rowSpan;u.rowSpan>1&&r.count*r.height<f*u.rowSpan?r={height:f,count:u.rowSpan}:r&&r.count>0&&r.height>f&&(f=r.height),f>i.height&&(i.height=f)}}r.count--}}function MD(t,e,r,n,a){return t.map(function(i){return hFe(i,e,r,n,a)})}function hFe(t,e,r,n,a){var i=1e4*n.scaleFactor();if(e=Math.ceil(e*i)/i,e>=V1(t,r,n))return t;for(;e<V1(t+a,r,n)&&!(t.length<=1);)t=t.substring(0,t.length-1);return t.trim()+a}function P7(t,e){var r=new Tg(t),n=mFe(e,r.scaleFactor()),a=new aFe(e,n);return oFe(r,a),r.applyStyles(r.userStyles),a}function mFe(t,e){var r=t.content,n=pFe(r.columns);if(r.head.length===0){var a=PD(n,"head");a&&r.head.push(a)}if(r.foot.length===0){var a=PD(n,"foot");a&&r.foot.push(a)}var i=t.settings.theme,o=t.styles;return{columns:n,head:CN("head",r.head,n,o,i,e),body:CN("body",r.body,n,o,i,e),foot:CN("foot",r.foot,n,o,i,e)}}function CN(t,e,r,n,a,i){var o={},l=e.map(function(c,u){for(var d=0,h={},f=0,m=0,g=0,y=r;g<y.length;g++){var b=y[g];
1184if(o[b.index]==null||o[b.index].left===0)if(m===0){var w=void 0;Array.isArray(c)?w=c[b.index-f-d]:w=c[b.dataKey];var j={};typeof w=="object"&&!Array.isArray(w)&&(j=(w==null?void 0:w.styles)||{});var N=gFe(t,b,u,a,n,i,j),S=new M7(w,N,t);h[b.dataKey]=S,h[b.index]=S,m=S.colSpan-1,o[b.index]={left:S.rowSpan-1,times:m}}else m--,f++;else o[b.index].left--,m=o[b.index].times,d++}return new T7(c,u,t,h)});return l}function PD(t,e){var r={};return t.forEach(function(n){if(n.raw!=null){var a=fFe(e,n.raw);a!=null&&(r[n.dataKey]=a)}}),Object.keys(r).length>0?r:null}function fFe(t,e){if(t==="head"){if(typeof e=="object")return e.header||null;if(typeof e=="string"||typeof e=="number")return e}else if(t==="foot"&&typeof e=="object")return e.footer;return null}function pFe(t){return t.map(function(e,r){var n,a;return typeof e=="object"?a=(n=e.dataKey)!==null&&n!==void 0?n:r:a=r,new iFe(a,e,r)})}function gFe(t,e,r,n,a,i,o){var l=qNe(n),c;t==="head"?c=a.headStyles:t==="body"?c=a.bodyStyles:t==="foot"&&(c=a.footStyles);var u=gd({},l.table,l[t],a.styles,c),d=a.columnStyles[e.dataKey]||a.columnStyles[e.index]||{},h=t==="body"?d:{},f=t==="body"&&r%2===0?gd({},l.alternateRow,a.alternateRowStyles):{},m=WNe(i),g=gd({},m,u,f,h);return gd(g,o)}function xFe(t,e,r){var n;r===void 0&&(r={});var a=_7(t,e),i=new Map,o=[],l=[],c=[];Array.isArray(e.settings.horizontalPageBreakRepeat)?c=e.settings.horizontalPageBreakRepeat:(typeof e.settings.horizontalPageBreakRepeat=="string"||typeof e.settings.horizontalPageBreakRepeat=="number")&&(c=[e.settings.horizontalPageBreakRepeat]),c.forEach(function(f){var m=e.columns.find(function(g){return g.dataKey===f||g.index===f});m&&!i.has(m.index)&&(i.set(m.index,!0),o.push(m.index),l.push(e.columns[m.index]),a-=m.wrappedWidth)});for(var u=!0,d=(n=r==null?void 0:r.start)!==null&&n!==void 0?n:0;d<e.columns.length;){if(i.has(d)){d++;continue}var h=e.columns[d].wrappedWidth;if(u||a>=h)u=!1,o.push(d),l.push(e.columns[d]),a-=h;else break;d++}return{colIndexes:o,columns:l,lastIndex:d-1}}function yFe(t,e){for(var r=[],n=0;n<e.columns.length;n++){var a=xFe(t,e,{start:n});a.columns.length&&(r.push(a),n=a.lastIndex)}return r}function R7(t,e){var r=e.settings,n=r.startY,a=r.margin,i={x:a.left,y:n},o=e.getHeadHeight(e.columns)+e.getFootHeight(e.columns),l=n+a.bottom+o;if(r.pageBreak==="avoid"){var c=e.body,u=c.reduce(function(f,m){return f+m.height},0);l+=u}var d=new Tg(t);(r.pageBreak==="always"||r.startY!=null&&l>d.pageSize().height)&&(L7(d),i.y=a.top),e.callWillDrawPageHooks(d,i);var h=gd({},i);e.startPageNumber=d.pageNumber(),r.horizontalPageBreak?bFe(d,e,h,i):(d.applyStyles(d.userStyles),(r.showHead==="firstPage"||r.showHead==="everyPage")&&e.head.forEac
vendor: 1,101 bytes, line 1184
1184h(function(f){return _d(d,e,f,i,e.columns)}),d.applyStyles(d.userStyles),e.body.forEach(function(f,m){var g=m===e.body.length-1;K1(d,e,f,g,h,i,e.columns)}),d.applyStyles(d.userStyles),(r.showFoot==="lastPage"||r.showFoot==="everyPage")&&e.foot.forEach(function(f){return _d(d,e,f,i,e.columns)})),C7(d,e,h,i),e.callEndPageHooks(d,i),e.finalY=i.y,t.lastAutoTable=e,d.applyStyles(d.userStyles)}function bFe(t,e,r,n){var a=yFe(t,e),i=e.settings;if(i.horizontalPageBreakBehaviour==="afterAllRows")a.forEach(function(u,d){t.applyStyles(t.userStyles),d>0?$y(t,e,r,n,u.columns,!0):RD(t,e,n,u.columns),vFe(t,e,r,n,u.columns),kN(t,e,n,u.columns)});else for(var o=-1,l=a[0],c=function(){var u=o;if(l){t.applyStyles(t.userStyles);var d=l.columns;o>=0?$y(t,e,r,n,d,!0):RD(t,e,n,d),u=BD(t,e,o+1,n,d),kN(t,e,n,d)}var h=u-o;a.slice(1).forEach(function(f){t.applyStyles(t.userStyles),$y(t,e,r,n,f.columns,!0),BD(t,e,o+1,n,f.columns,h),kN(t,e,n,f.columns)}),o=u};o<e.body.length-1;)c()}function RD(t,e,r,n){var a=e.settings;t.applyStyles(t.userStyles),(a.showHead==="firstPage"||a.showHead==="everyPage")&&e.head.forEac
1184h(function(i){return _d(t,e,i,r,n)})}function vFe(t,e,r,n,a){t.applyStyles(t.userStyles),e.body.forEach(function(i,o){var l=o===e.body.length-1;K1(t,e,i,l,r,n,a)})}function BD(t,e,r,n,a,i){t.applyStyles(t.userStyles),i=i??e.body.length;var o=Math.min(r+i,e.body.length),l=-1;return e.body.slice(r,o).forEach(function(c,u){var d=r+u===e.body.length-1,h=B7(t,e,d,n);c.canEntireRowFit(h,a)&&(_d(t,e,c,n,a),l=r+u)}),l}function kN(t,e,r,n){var a=e.settings;t.applyStyles(t.userStyles),(a.showFoot==="lastPage"||a.showFoot==="everyPage")&&e.foot.forEach(function(i){return _d(t,e,i,r,n)})}function wFe(t,e,r){var n=r.getLineHeight(t.styles.fontSize),a=t.padding("vertical"),i=Math.floor((e-a)/n);return Math.max(0,i)}function jFe(t,e,r,n){var a={};t.spansMultiplePages=!0,t.height=0;for(var i=0,o=0,l=r.columns;o<l.length;o++){var c=l[o],u=t.cells[c.index];if(u){Array.isArray(u.text)||(u.text=[u.text]);var d=new M7(u.raw,u.styles,u.section);d=gd(d,u),d.text=[];var h=wFe(u,e,n);u.text.length>h&&(d.text=u.text.splice(h,u.text.length));var f=n.scaleFactor(),m=n.getLineHeightFactor();u.contentHeight=u.getContentHeight(f,m),u.contentHeight>=e&&(u.contentHeight=e,d.styles.minCellHeight-=e),u.contentHeight>t.height&&(t.height=u.contentHeight),d.contentHeight=d.getContentHeight(f,m),d.contentHeight>i&&(i=d.contentHeight),a[c.index]=d}}var g=new T7(t.raw,-1,t.section,a,!0);g.height=i;for(var y=0,b=r.columns;y<b.length;y++){var c=b[y],d=g.cells[c.index];d&&(d.height=g.height);var u=t.cells[c.index];u&&(u.height=t.height)}return g}function NFe(t,e,r,n){var a=t.pageSize().height,i=n.settings.margin,o=i.top+i.bottom,l=a-o;e.section==="body"&&(l-=n.getHeadHeight(n.columns)+n.getFootHeight(n.columns));var c=e.getMinimumRowHeight(n.columns,t),u=c<r;if(c>l)return console.log("Will not be able to print row ".concat(e.index," correctly since it's minimum height is larger than page height")),!0;if(!u)return!1;var d=e.hasRowSpan(n.columns),h=e.getMaxCellHeight(n.columns)>l;return h?(d&&console.log("The content of row ".concat(e.index," will not be drawn correctly since drawing rows with a height larger than the page height and has cells with rowspans is not supported.")),!0):!(d||n.settings.rowPageBreak==="avoid")}function K1(t,e,r,n,a,i,o){var l=B7(t,e,n,i);if(r.canEntireRowFit(l,o))_d(t,e,r,i,o);else if(NFe(t,r,l,e)){var c=jFe(r,l,e,t);_d(t,e,r,i,o),$y(t,e,a,i,o),K1(t,e,c,n,a,i,o)}else $y(t,e,a,i,o),K1(t,e,r,n,a,i,o)}function _d(t,e,r,n,a){n.x=e.settings.margin.left;for(var i=0,o=a;i<o.length;i++){var l=o[i],c=r.cells[l.index];if(!c){n.x+=l.width;continue}t.applyStyles(c.styles),c.x=n.x,c.y=n.y;var u=e.callCellHooks(t,e.hooks.willDrawCell,c,r,l,n);if(u===!1){n.x+=l.width;continue}FFe(t,c,n);var d=c.getTextPos();N7(c.text,d.x,d.y,{halign:c.styles.halign,valign:c.styles.valign,maxWidth:Math.ceil(c.width-c.padding("left")-c.padding("right"))},t.getDocument()),e.callCellHooks(t,e.hooks.didDrawCell,c,r,l,n),n.x+=l.width}n.y+=r.height}function FFe(t,e,r){var n=e.styles;if(t.getDocument().setFillColor(t.getDocument().getFillColor()),typeof n.lineWidth=="number"){var a=k7(n.lineWidth,n.fillColor);a&&t.rect(e.x,r.y,e.width,e.height,a)}else typeof n.lineWidth=="object"&&(n.fillColor&&t.rect(e.x,r.y,e.width,e.height,"F"),SFe(t,e,r,n.lineWidth))}function SFe(t,e,r,n){var a,i,o,l;n.top&&(a=r.x,i=r.y,o=r.x+e.width,l=r.y,n.right&&(o+=.5*n.right),n.left&&(a-=.5*n.left),c(n.top,a,i,o,l)),n.bottom&&(a=r.x,i=r.y+e.height,o=r.x+e.width,l=r.y+e.height,n.right&&(o+=.5*n.right),n.left&&(a-=.5*n.left),c(n.bottom,a,i,o,l)),n.left&&(a=r.x,i=r.y,o=r.x,l=r.y+e.height,n.top&&(i-=.5*n.top),n.bottom&&(l+=.5*n.bottom),c(n.left,a,i,o,l)),n.right&&(a=r.x+e.width,i=r.y,o=r.x+e.width,l=r.y+e.height,n.top&&(i-=.5*n.top),n.bottom&&(l+=.5*n.bottom),c(n.right,a,i,o,l));function c(u,d,h,f,m){t.getDocument().setLineWidth(u),t.getDocument().line(d,h,f,m,"S")}}function B7(t,e,r,n){var a=e.settings.margin.bottom,i=e.settings.showFoot;return(i==="everyPage"||i==="lastPage"&&r)&&(a+=e.getFootHeight(e.columns)),t.pageSize().height-n.y-a}function $y(t,e,r,n,a,i){a===void 0&&(a=[]),i===void 0&&(i=!1),t.applyStyles(t.userStyles),e.settings.showFoot==="everyPage"&&!i&&e.foot.forEach(function(l){return _d(t,e,l,n,a)}),e.callEndPageHooks(t,n);var o=e.settings.margin;C7(t,e,r,n),L7(t),e.pageNumber++,n.x=o.left,n.y=o.top,r.y=o.top,e.callWillDrawPageHooks(t,n),e.settings.showHead==="everyPage"&&(e.head.forEac
1184h(function(l){return _d(t,e,l,n,a)}),t.applyStyles(t.userStyles))}function L7(t){var e=t.pageNumber();t.setPage(e+1);var r=t.pageNumber();return r===e?(t.addPage(),!0):!1}function CFe(t){t.API.autoTable=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=e[0],a=D7(this,n),i=P7(this,a);return R7(this,i),this},t.API.lastAutoTable=!1,t.API.autoTableText=function(e,r,n,a){N7(e,r,n,a,this)},t.API.autoTableSetDefaults=function(e){return Tg.setDefaults(e,this),this},t.autoTableSetDefaults=function(e,r){Tg.setDefaults(e,r)},t.API.autoTableHtmlToJson=function(e,r){var n;if(r===void 0&&(r=!1),typeof window>"u")return console.error("Cannot run autoTableHtmlToJson in non browser environment"),null;var a=new Tg(this),i=A7(a,e,window,r,!1),o=i.head,l=i.body,c=((n=o[0])===null||n===void 0?void 0:n.map(function(u){return u.content}))||[];return{columns:c,rows:l,data:l}}}var _N;function LD(t,e){var r=D7(t,e),n=P7(t,r);R7(t,n)}try{if(typeof window<"u"&&window){var ID=window,OD=ID.jsPDF||((_N=ID.jspdf)===null||_N===void 0?void 0:_N.jsPDF);OD&&CFe(OD)}}catch(t){console.error("Could not apply autoTable plugin",t)}var I7={exports:{}};/* @license
1185Papa Parse 1186v5.5.3 1187https://github.com/mholt/PapaParse 1188License: MIT 1189*/(function(t,e){((r,n)=>{t.exports=n()})(io,function r(){var n=typeof self<"u"?self:typeof window<"u"?window:n!==void 0?n:{},a,i=!n.document&&!!n.postMessage,o=n.IS_PAPA_WORKER||!1,l={},c=0,u={};function d(D){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},(function(A){var R=E(A);R.chunkSize=parseInt(R.chunkSize),A.step||A.chunk||(R.chunkSize=null),this._handle=new y(R),(this._handle.streamer=this)._config=R}).call(this,D),this.parseChunk=function(A,R){var M=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<M){let U=this._config.newline;U||(P=this._config.quoteChar||'"',U=this._handle.guessLineEndings(A,P)),A=[...A.split(U).slice(M)].join(U)}this.isFirstChunk&&T(this._config.beforeFirstChunk)&&(P=this._config.beforeFirstChunk(A))!==void 0&&(A=P),this.isFirstChunk=!1,this._halted=!1;var M=this._partialLine+A,P=(this._partialLine="",this._handle.parse(M,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){if(A=P.meta.cursor,M=(this._finished||(this._partialLine=M.substring(A-this._baseIndex),this._baseIndex=A),P&&P.data&&(this._rowCount+=P.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview),o)n.postMessage({results:P,workerId:u.WORKER_ID,finished:M});else if(T(this._config.chunk)&&!R){if(this._config.chunk(P,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);this._completeResults=P=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(P.data),this._completeResults.errors=this._completeResults.errors.concat(P.errors),this._completeResults.meta=P.meta),this._completed||!M||!T(this._config.complete)||P&&P.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),M||P&&P.meta.paused||this._nextChunk(),P}this._halted=!0},this._sendError=function(A){T(this._config.error)?this._config.error(A):o&&this._config.error&&n.postMessage({workerId:u.WORKER_ID,error:A,finished:!1})}}function h(D){var A;(D=D||{}).chunkSize||(D.chunkSize=u.RemoteChunkSize),d.call(this,D),this._nextChunk=i?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(R){this._input=R,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(A=new XMLHttpRequest,this._config.withCredentials&&(A.withCredentials=this._config.withCredentials),i||(A.onload=C(this._chunkLoaded,this),A.onerror=C(this._chunkError,this)),A.open(this._config.downloadRequestBody?"POST":"GET",this._input,!i),this._config.downloadRequestHeaders){var R,M=this._config.downloadRequestHeaders;for(R in M)A.setRequestHeader(R,M[R])}var P;this._config.chunkSize&&(P=this._start+this._config.chunkSize-1,A.setRequestHeader("Range","bytes="+this._start+"-"+P));try{A.send(this._config.downloadRequestBody)}catch(U){this._chunkError(U.message)}i&&A.status===0&&this._chunkError()}},this._chunkLoaded=function(){A.readyState===4&&(A.status<200||400<=A.status?this._chunkError():(this._start+=this._config.chunkSize||A.responseText.length,this._finished=!this._config.chunkSize||this._start>=(R=>(R=R.getResponseHeader("Content-Range"))!==null?parseInt(R.substring(R.lastIndexOf("/")+1)):-1)(A),this.parseChunk(A.responseText)))},this._chunkError=function(R){R=A.statusText||R,this._sendError(new Error(R))}}function f(D){(D=D||{}).chunkSize||(D.chunkSize=u.LocalChunkSize),d.call(this,D);var A,R,M=typeof FileReader<"u";this.stream=function(P){this._input=P,R=P.slice||P.webkitSlice||P.mozSlice,M?((A=new FileReader).onload=C(this._chunkLoaded,this),A.onerror=C(this._chunkError,this)):A=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var P=this._input,U=(this._config.chunkSize&&(U=Math.min(this._start+this._config.chunkSize,this._input.size),P=R.c
vendor: 16,040 bytes, lines 1189-1198
1189all(P,this._start,U)),A.readAsText(P,this._config.encoding));M||this._chunkLoaded({target:{result:U}})},this._chunkLoaded=function(P){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(P.target.result)},this._chunkError=function(){this._sendError(A.error)}}function m(D){var A;d.call(this,D=D||{}),this.stream=function(R){return A=R,this._nextChunk()},this._nextChunk=function(){var R,M;if(!this._finished)return R=this._config.chunkSize,A=R?(M=A.substring(0,R),A.substring(R)):(M=A,""),this._finished=!A,this.parseChunk(M)}}function g(D){d.call(this,D=D||{});var A=[],R=!0,M=!1;this.pause=function(){d.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){d.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(P){this._input=P,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){M&&A.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),A.length?this.parseChunk(A.shift()):R=!0},this._streamData=C(function(P){try{A.push(typeof P=="string"?P:P.toString(this._config.encoding)),R&&(R=!1,this._checkIsFinished(),this.parseChunk(A.shift()))}catch(U){this._streamError(U)}},this),this._streamError=C(function(P){this._streamCleanUp(),this._sendError(P)},this),this._streamEnd=C(function(){this._streamCleanUp(),M=!0,this._streamData("")},this),this._streamCleanUp=C(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function y(D){var A,R,M,P,U=Math.pow(2,53),I=-U,O=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,V=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,G=this,B=0,$=0,W=!1,oe=!1,K=[],H={data:[],errors:[],meta:{}};function X(he){return D.skipEmptyLines==="greedy"?he.join("").trim()==="":he.length===1&&he[0].length===0}function me(){if(H&&M&&(ee("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+u.DefaultDelimiter+"'"),M=!1),D.skipEmptyLines&&(H.data=H.data.filter(function(re){return!X(re)})),ie()){let re=function(we,Ee){T(D.transformHeader)&&(we=D.transformHeader(we,Ee)),K.push(we)};if(H)if(Array.isArray(H.data[0])){for(var he=0;ie()&&he<H.data.length;he++)H.data[he].forEach(re);H.data.splice(0,1)}else H.data.forEach(re)}function ve(re,we){for(var Ee=D.header?{}:[],Me=0;Me<re.length;Me++){var ae=Me,ze=re[Me],ze=((mt,tt)=>(Xe=>(D.dynamicTypingFunction&&D.dynamicTyping[Xe]===void 0&&(D.dynamicTyping[Xe]=D.dynamicTypingFunction(Xe)),(D.dynamicTyping[Xe]||D.dynamicTyping)===!0))(mt)?tt==="true"||tt==="TRUE"||tt!=="false"&&tt!=="FALSE"&&((Xe=>{if(O.test(Xe)&&(Xe=parseFloat(Xe),I<Xe&&Xe<U))return 1})(tt)?parseFloat(tt):V.test(tt)?new Date(tt):tt===""?null:tt):tt)(ae=D.header?Me>=K.length?"__parsed_extra":K[Me]:ae,ze=D.transform?D.transform(ze,ae):ze);ae==="__parsed_extra"?(Ee[ae]=Ee[ae]||[],Ee[ae].push(ze)):Ee[ae]=ze}return D.header&&(Me>K.length?ee("FieldMismatch","TooManyFields","Too many fields: expected "+K.length+" fields but parsed "+Me,$+we):Me<K.length&&ee("FieldMismatch","TooFewFields","Too few fields: expected "+K.length+" fields but parsed "+Me,$+we)),Ee}var Ce;H&&(D.header||D.dynamicTyping||D.transform)&&(Ce=1,!H.data.length||Array.isArray(H.data[0])?(H.data=H.data.map(ve),Ce=H.data.length):H.data=ve(H.data,0),D.header&&H.meta&&(H.meta.fields=K),$+=Ce)}function ie(){return D.header&&K.length===0}function ee(he,ve,Ce,re){he={type:he,code:ve,message:Ce},re!==void 0&&(he.row=re),H.errors.push(he)}T(D.step)&&(P=D.step,D.step=function(he){H=he,ie()?me():(me(),H.data.length!==0&&(B+=he.data.length,D.preview&&B>D.preview?R.abort():(H.data=H.data[0],P(H,G))))}),this.parse=function(he,ve,Ce){var re=D.quoteChar||'"',re=(D.newline||(D.newline=this.guessLineEndings(he,re)),M=!1,D.delimiter?T(D.delimiter)&&(D.delimiter=D.delimiter(he),H.meta.delimiter=D.delimiter):((re=((we,Ee,Me,ae,ze)=>{var mt,tt,Xe,Ft;ze=ze||[","," ","|",";",u.RECORD_SEP,u.UNIT_SEP];for(var ce=0;ce<ze.length;ce++){for(var fe,ge=ze[ce],Ge=0,Je=0,be=0,Pe=(Xe=void 0,new w({comments:ae,delimiter:ge,newline:Ee,preview:10}).parse(we)),qe=0;qe<Pe.data.length;qe++)Me&&X(Pe.data[qe])?be++:(fe=Pe.data[qe].length,Je+=fe,Xe===void 0?Xe=fe:0<fe&&(Ge+=Math.abs(fe-Xe),Xe=fe));0<Pe.data.length&&(Je/=Pe.data.length-be),(tt===void 0||Ge<=tt)&&(Ft===void 0||Ft<Je)&&1.99<Je&&(tt=Ge,mt=ge,Ft=Je)}return{successful:!!(D.delimiter=mt),bestDelimiter:mt}})(he,D.newline,D.skipEmptyLines,D.comments,D.delimitersToGuess)).successful?D.delimiter=re.bestDelimiter:(M=!0,D.delimiter=u.DefaultDelimiter),H.meta.delimiter=D.delimiter),E(D));return D.preview&&D.header&&re.preview++,A=he,R=new w(re),H=R.parse(A,ve,Ce),me(),W?{meta:{paused:!0}}:H||{meta:{paused:!1}}},this.paused=function(){return W},this.pause=function(){W=!0,R.abort(),A=T(D.chunk)?"":A.substring(R.getCharIndex())},this.resume=function(){G.streamer._halted?(W=!1,G.streamer.parseChunk(A,!0)):setTimeout(G.resume,3)},this.aborted=function(){return oe},this.abort=function(){oe=!0,R.abort(),H.meta.aborted=!0,T(D.complete)&&D.complete(H),A=""},this.guessLineEndings=function(we,re){we=we.substring(0,1048576);var re=new RegExp(b(re)+"([^]*?)"+b(re),"gm"),Ce=(we=we.replace(re,"")).split("\r"),re=we.split(` 1190`),we=1<re.length&&re[0].length<Ce[0].length;if(Ce.length===1||we)return` 1191`;for(var Ee=0,Me=0;Me<Ce.length;Me++)Ce[Me][0]===` 1192`&&Ee++;return Ee>=Ce.length/2?`\r 1193`:"\r"}}function b(D){return D.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function w(D){var A=(D=D||{}).delimiter,R=D.newline,M=D.comments,P=D.step,U=D.preview,I=D.fastMode,O=null,V=!1,G=D.quoteChar==null?'"':D.quoteChar,B=G;if(D.escapeChar!==void 0&&(B=D.escapeChar),(typeof A!="string"||-1<u.BAD_DELIMITERS.indexOf(A))&&(A=","),M===A)throw new Error("Comment character same as delimiter");M===!0?M="#":(typeof M!="string"||-1<u.BAD_DELIMITERS.indexOf(M))&&(M=!1),R!==` 1194`&&R!=="\r"&&R!==`\r 1195`&&(R=` 1196`);var $=0,W=!1;this.parse=function(oe,K,H){if(typeof oe!="string")throw new Error("Input must be a string");var X=oe.length,me=A.length,ie=R.length,ee=M.length,he=T(P),ve=[],Ce=[],re=[],we=$=0;if(!oe)return Ge();if(I||I!==!1&&oe.indexOf(G)===-1){for(var Ee=oe.split(R),Me=0;Me<Ee.length;Me++){if(re=Ee[Me],$+=re.length,Me!==Ee.length-1)$+=R.length;else if(H)return Ge();if(!M||re.substring(0,ee)!==M){if(he){if(ve=[],Ft(re.split(A)),Je(),W)return Ge()}else Ft(re.split(A));if(U&&U<=Me)return ve=ve.slice(0,U),Ge(!0)}}return Ge()}for(var ae=oe.indexOf(A,$),ze=oe.indexOf(R,$),mt=new RegExp(b(B)+b(G),"g"),tt=oe.indexOf(G,$);;)if(oe[$]===G)for(tt=$,$++;;){if((tt=oe.indexOf(G,tt+1))===-1)return H||Ce.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:ve.length,index:$}),fe();if(tt===X-1)return fe(oe.substring($,tt).replace(mt,G));if(G===B&&oe[tt+1]===B)tt++;else if(G===B||tt===0||oe[tt-1]!==B){ae!==-1&&ae<tt+1&&(ae=oe.indexOf(A,tt+1));var Xe=ce((ze=ze!==-1&&ze<tt+1?oe.indexOf(R,tt+1):ze)===-1?ae:Math.min(ae,ze));if(oe.substr(tt+1+Xe,me)===A){re.push(oe.substring($,tt).replace(mt,G)),oe[$=tt+1+Xe+me]!==G&&(tt=oe.indexOf(G,$)),ae=oe.indexOf(A,$),ze=oe.indexOf(R,$);break}if(Xe=ce(ze),oe.substring(tt+1+Xe,tt+1+Xe+ie)===R){if(re.push(oe.substring($,tt).replace(mt,G)),ge(tt+1+Xe+ie),ae=oe.indexOf(A,$),tt=oe.indexOf(G,$),he&&(Je(),W))return Ge();if(U&&ve.length>=U)return Ge(!0);break}Ce.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:ve.length,index:$}),tt++}}else if(M&&re.length===0&&oe.substring($,$+ee)===M){if(ze===-1)return Ge();$=ze+ie,ze=oe.indexOf(R,$),ae=oe.indexOf(A,$)}else if(ae!==-1&&(ae<ze||ze===-1))re.push(oe.substring($,ae)),$=ae+me,ae=oe.indexOf(A,$);else{if(ze===-1)break;if(re.push(oe.substring($,ze)),ge(ze+ie),he&&(Je(),W))return Ge();if(U&&ve.length>=U)return Ge(!0)}return fe();function Ft(be){ve.push(be),we=$}function ce(be){var Pe=0;return Pe=be!==-1&&(be=oe.substring(tt+1,be))&&be.trim()===""?be.length:Pe}function fe(be){return H||(be===void 0&&(be=oe.substring($)),re.push(be),$=X,Ft(re),he&&Je()),Ge()}function ge(be){$=be,Ft(re),re=[],ze=oe.indexOf(R,$)}function Ge(be){if(D.header&&!K&&ve.length&&!V){var Pe=ve[0],qe=Object.create(null),Qe=new Set(Pe);let We=!1;for(let dt=0;dt<Pe.length;dt++){let Bt=Pe[dt];if(qe[Bt=T(D.transformHeader)?D.transformHeader(Bt,dt):Bt]){let Lt,Vt=qe[Bt];for(;Lt=Bt+"_"+Vt,Vt++,Qe.has(Lt););Qe.add(Lt),Pe[dt]=Lt,qe[Bt]++,We=!0,(O=O===null?{}:O)[Lt]=Bt}else qe[Bt]=1,Pe[dt]=Bt;Qe.add(Bt)}We&&console.warn("Duplicate headers found and renamed."),V=!0}return{data:ve,errors:Ce,meta:{delimiter:A,linebreak:R,aborted:W,truncated:!!be,cursor:we+(K||0),renamedHeaders:O}}}function Je(){P(Ge()),ve=[],Ce=[]}},this.abort=function(){W=!0},this.getCharIndex=function(){return $}}function j(D){var A=D.data,R=l[A.workerId],M=!1;if(A.error)R.userError(A.error,A.file);else if(A.results&&A.results.data){var P={abort:function(){M=!0,N(A.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:S,resume:S};if(T(R.userStep)){for(var U=0;U<A.results.data.length&&(R.userStep({data:A.results.data[U],errors:A.results.errors,meta:A.results.meta},P),!M);U++);delete A.results}else T(R.userChunk)&&(R.userChunk(A.results,P,A.file),delete A.results)}A.finished&&!M&&N(A.workerId,A.results)}function N(D,A){var R=l[D];T(R.userComplete)&&R.userComplete(A),R.terminate(),delete l[D]}function S(){throw new Error("Not implemented.")}function E(D){if(typeof D!="object"||D===null)return D;var A,R=Array.isArray(D)?[]:{};for(A in D)R[A]=E(D[A]);return R}function C(D,A){return function(){D.apply(A,arguments)}}function T(D){return typeof D=="function"}return u.parse=function(D,A){var R=(A=A||{}).dynamicTyping||!1;if(T(R)&&(A.dynamicTypingFunction=R,R={}),A.dynamicTyping=R,A.transform=!!T(A.transform)&&A.transform,!A.worker||!u.WORKERS_SUPPORTED)return R=null,u.NODE_STREAM_INPUT,typeof D=="string"?(D=(M=>M.charCodeAt(0)!==65279?M:M.slice(1))(D),R=new(A.download?h:m)(A)):D.readable===!0&&T(D.read)&&T(D.on)?R=new g(A):(n.File&&D instanceof File||D instanceof Object)&&(R=new f(A)),R.stream(D);(R=(()=>{var M;return!!u.WORKERS_SUPPORTED&&(M=(()=>{var P=n.URL||n.webkitURL||null,U=r.toString();return u.BLOB_URL||(u.BLOB_URL=P.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",U,")();"],{type:"text/javascript"})))})(),(M=new n.Worker(M)).onmessage=j,M.id=c++,l[M.id]=M)})()).userStep=A.step,R.userChunk=A.chunk,R.userComplete=A.complete,R.userError=A.error,A.step=T(A.step),A.chunk=T(A.chunk),A.complete=T(A.complete),A.error=T(A.error),delete A.worker,R.postMessage({input:D,config:A,workerId:R.id})},u.unparse=function(D,A){var R=!1,M=!0,P=",",U=`\r 1197`,I='"',O=I+I,V=!1,G=null,B=!1,$=((()=>{if(typeof A=="object"){if(typeof A.delimiter!="string"||u.BAD_DELIMITERS.filter(function(K){return A.delimiter.indexOf(K)!==-1}).length||(P=A.delimiter),typeof A.quotes!="boolean"&&typeof A.quotes!="function"&&!Array.isArray(A.quotes)||(R=A.quotes),typeof A.skipEmptyLines!="boolean"&&typeof A.skipEmptyLines!="string"||(V=A.skipEmptyLines),typeof A.newline=="string"&&(U=A.newline),typeof A.quoteChar=="string"&&(I=A.quoteChar),typeof A.header=="boolean"&&(M=A.header),Array.isArray(A.columns)){if(A.columns.length===0)throw new Error("Option columns is empty");G=A.columns}A.escapeChar!==void 0&&(O=A.escapeChar+I),A.escapeFormulae instanceof RegExp?B=A.escapeFormulae:typeof A.escapeFormulae=="boolean"&&A.escapeFormulae&&(B=/^[=+\-@\t\r].*$/)}})(),new RegExp(b(I),"g"));if(typeof D=="string"&&(D=JSON.parse(D)),Array.isArray(D)){if(!D.length||Array.isArray(D[0]))return W(null,D,V);if(typeof D[0]=="object")return W(G||Object.keys(D[0]),D,V)}else if(typeof D=="object")return typeof D.data=="string"&&(D.data=JSON.parse(D.data)),Array.isArray(D.data)&&(D.fields||(D.fields=D.meta&&D.meta.fields||G),D.fields||(D.fields=Array.isArray(D.data[0])?D.fields:typeof D.data[0]=="object"?Object.keys(D.data[0]):[]),Array.isArray(D.data[0])||typeof D.data[0]=="object"||(D.data=[D.data])),W(D.fields||[],D.data||[],V);throw new Error("Unable to serialize unrecognized input");function W(K,H,X){var me="",ie=(typeof K=="string"&&(K=JSON.parse(K)),typeof H=="string"&&(H=JSON.parse(H)),Array.isArray(K)&&0<K.length),ee=!Array.isArray(H[0]);if(ie&&M){for(var he=0;he<K.length;he++)0<he&&(me+=P),me+=oe(K[he],he);0<H.length&&(me+=U)}for(var ve=0;ve<H.length;ve++){var Ce=(ie?K:H[ve]).length,re=!1,we=ie?Object.keys(H[ve]).length===0:H[ve].length===0;if(X&&!ie&&(re=X==="greedy"?H[ve].join("").trim()==="":H[ve].length===1&&H[ve][0].length===0),X==="greedy"&&ie){for(var Ee=[],Me=0;Me<Ce;Me++){var ae=ee?K[Me]:Me;Ee.push(H[ve][ae])}re=Ee.join("").trim()===""}if(!re){for(var ze=0;ze<Ce;ze++){0<ze&&!we&&(me+=P);var mt=ie&&ee?K[ze]:ze;me+=oe(H[ve][mt],ze)}ve<H.length-1&&(!X||0<Ce&&!we)&&(me+=U)}}return me}function oe(K,H){var X,me;return K==null?"":K.constructor===Date?JSON.stringify(K).slice(1,25):(me=!1,B&&typeof K=="string"&&B.test(K)&&(K="'"+K,me=!0),X=K.toString().replace($,O),(me=me||R===!0||typeof R=="function"&&R(K,H)||Array.isArray(R)&&R[H]||((ie,ee)=>{for(var he=0;he<ee.length;he++)if(-1<ie.indexOf(ee[he]))return!0;return!1})(X,u.BAD_DELIMITERS)||-1<X.indexOf(P)||X.charAt(0)===" "||X.charAt(X.length-1)===" ")?I+X+I:X)}},u.RECORD_SEP="�",u.UNIT_SEP="�",u.BYTE_ORDER_MARK="\uFEFF",u.BAD_DELIMITERS=["\r",` 1198`,'"',u.BYTE_ORDER_MARK],u.WORKERS_SUPPORTED=!i&&!!n.Worker,u.NODE_STREAM_INPUT=1,u.LocalChunkSize=10485760,u.RemoteChunkSize=5242880,u.DefaultDelimiter=",",u.Parser=w,u.ParserHandle=y,u.NetworkStreamer=h,u.FileStreamer=f,u.StringStreamer=m,u.ReadableStreamStreamer=g,n.jQuery&&((a=n.jQuery).fn.parse=function(D){var A=D.config||{},R=[];return this.each(function(U){if(!(a(this).prop("tagName").toUpperCase()==="INPUT"&&a(this).attr("type").toLowerCase()==="file"&&n.FileReader)||!this.files||this.files.length===0)return!0;for(var I=0;I<this.files.length;I++)R.push({file:this.files[I],inputElem:this,instanceConfig:a.extend({},A)})}),M(),this;function M(){if(R.length===0)T(D.complete)&&D.complete();else{var U,I,O,V,G=R[0];if(T(D.before)){var B=D.before(G.file,G.inputElem);if(typeof B=="object"){if(B.action==="abort")return U="AbortError",I=G.file,O=G.inputElem,V=B.reason,void(T(D.error)&&D.error({name:U},I,O,V));if(B.action==="skip")return void P();typeof B.config=="object"&&(G.instanceConfig=a.extend(G.instanceConfig,B.config))}else if(B==="skip")return void P()}var $=G.instanceConfig.complete;G.instanceConfig.complete=function(W){T($)&&$(W,G.file,G.inputElem),P()},u.parse(G.file,G.instanceConfig)}}function P(){R.splice(0,1),M()}}),o&&(n.onmessage=function(D){D=D.data,u.WORKER_ID===void 0&&D&&(u.WORKER_ID=D.workerId),typeof D.input=="string"?n.postMessage({workerId:u.WORKER_ID,results:u.parse(D.input,D.config),finished:!0}):(n.File&&D.input instanceof File||D.input instanceof Object)&&(D=u.parse(D.input,D.config))&&n.postMessage({workerId:u.WORKER_ID,results:D,finished:!0})}),(h.prototype=Object.create(d.prototype)).constructor=h,(f.prototype=Object.create(d.prototype)).constructor=f,(m.prototype=Object.create(m.prototype)).constructor=m,(g.prototype=Object.create(d.prototype)).constructor=g,u})})(I7);var Av=I7.exports;const uf={generateMembersPDF:async()=>{try{const{data:t,error:e}=await Q.from("profiles").select("*").order("created_at",{ascending:!1});if(e)throw e;const r=new Fr;r.setFontSize(18),r.text("Chamber of Commerce - Members Report",14,22),r.setFontSize(11),r.text(`Generated on: ${new Date().toLocaleDateString()}`,14,30);const n=["Name","Email","Role","Membership Status","Member Since"],a=t.map(i=>[`${i.first_name} ${i.last_name}
1198`,i.email,i.user_type==="business"?"Business Owner":i.user_type==="residential"?"Resident":"Admin",i.membership_status||"N/A",new Date(i.created_at).toLocaleDateString()]);return LD(r,{head:[n],body:a,startY:40,theme:"grid",styles:{fontSize:10,cellPadding:3},headStyles:{fillColor:[66,135,245]}}),r.output("blob")}catch(t){throw console.error("Error generating members PDF:",t),t}},generateBusinessesPDF:async()=>{try{const{data:t,error:e}=await Q.from("business_profiles").select("*").order("business_name",{ascending:!0});if(e)throw e;const{data:r,error:n}=await Q.from("profiles").select("id, first_name, last_name");if(n)throw n;const a=new Map;r==null||r.forEach(c=>{a.set(c.id,c)});const i=new Fr("landscape");i.setFontSize(16),i.text("Chamber of Commerce - Businesses Report",14,20),i.setFontSize(10),i.text(`Generated on: ${new Date().toLocaleDateString()}`,14,30);const o=["Business Name","Address","Phone","Website","Email","Facebook","Instagram","Twitter"],l=t.map(c=>{const u=[c.address_line1,c.address_line2,`${c.city}, ${c.state} ${c.zip_code}`].filter(Boolean).join(` 1199`);return[c.business_name||"",u,c.phone||"",c.website||"",c.email||"",c.facebook_url||"",c.instagram_url||"",c.twitter_url||""]});return LD(i,{head:[o],body:l,startY:40,theme:"striped",styles:{fontSize:8,cellPadding:2,overflow:"linebreak",cellWidth:"wrap"},headStyles:{fillColor:[66,135,245],textColor:255,fontStyle:"bold",fontSize:9},columnStyles:{0:{cellWidth:40},1:{cellWidth:50},2:{cellWidth:25},3:{cellWidth:35},4:{cellWidth:35},5:{cellWidth:30},6:{cellWidth:30},7:{cellWidth:30}},alternateRowStyles:{fillColor:[245,245,245]},margin:{top:40,left:10,right:10,bottom:20},pageBreak:"auto",rowPageBreak:"avoid"}),i.output("blob")}catch(t){throw console.error("Error generating businesses PDF:",t),t}},exportMembersData:async()=>{try{const{data:t,error:e}=await Q.from("profiles").select("*").order("created_at",{ascending:!1});if(e)throw e;const r=t.map(a=>({FirstName:a.first_name,LastName:a.last_name,Email:a.email,Role:a.user_type==="business"?"Business Owner":a.user_t
1199ype==="residential"?"Resident":"Admin",MembershipStatus:a.membership_status||"N/A",MembershipExpiresAt:a.membership_expires_at?new Date(a.membership_expires_at).toLocaleDateString():"N/A",StripeCustomerId:a.stripe_customer_id||"N/A",PaymentStatus:a.payment_status||"N/A",LastPaymentDate:a.last_payment_date?new Date(a.last_payment_date).toLocaleDateString():"N/A",Bio:a.bio||"",JoinedDate:new Date(a.created_at).toLocaleDateString(),LastUpdated:new Date(a.updated_at).toLocaleDateString()})),n=Av.unparse(r);return new Blob([n],{type:"text/csv;charset=utf-8"})}catch(t){throw console.error("Error exporting members data:",t),t}},exportBusinessesData:async()=>{try{const{data:t,error:e}=await Q.from("business_profiles").select("*").order("business_name",{ascending:!0});if(e)throw e;const{data:r,error:n}=await Q.from("profiles").select("id, first_name, last_name, email");if(n)throw n;const a=new Map;r==null||r.forEach(l=>{a.set(l.id,l)});const i=t.map(l=>{const c=a.get(l.owner_id);return{BusinessName:l.business_name,Address:`${l.address_line1}${l.address_line2?", "+l.address_line2:""}, ${l.city}, ${l.state} ${l.zip_code}`,Phone:l.phone,Email:l.email||"",Website:l.website||"",FacebookUrl:l.facebook_url||"",InstagramUrl:l.instagram_url||"",TwitterUrl:l.twitter_url||"",Owner:c?`${c.first_name} ${c.last_name}`:"Unknown",OwnerEmail:(c==null?void 0:c.email)||""}}),o=Av.unparse(i);return new Blob([o],{type:"text/csv;charset=utf-8"})}catch(t){throw console.error("Error exporting businesses data:",t),t}},exportFullBusinessesData:async()=>{try{const{data:t,error:e}=await Q.from("business_profiles").select("*").order("business_name",{ascending:!0});if(e)throw e;const{data:r,error:n}=await Q.from("profiles").select("id, first_name, last_name, email");if(n)throw n;const a=new Map;r==null||r.forEach(l=>{a.set(l.id,l)});const i=t.map(l=>{const c=a.get(l.owner_id);return{BusinessName:l.business_name,ShortDescription:l.short_description||"",Description:l.business_description||"",Address:`${l.address_line1}${l.address_line2?", "+l.address_line2:""}, ${l.city}, ${l.state} ${l.zip_code}`,Phone:l.phone,Email:l.email||"",Website:l.website||"",FacebookUrl:l.facebook_url||"",InstagramUrl:l.instagram_url||"",TwitterUrl:l.twitter_url||"",BusinessHours:l.business_hours||"",Status:l.status,Owner:c?`${c.first_name} ${c.last_name}`:"Unknown",OwnerEmail:(c==null?void 0:c.email)||"",Featured:l.featured?"Yes":"No",FeatureSubscriptionStatus:l.feature_subscription_status||"inactive",FeatureExpiresAt:l.feature_expires_at?new Date(l.feature_expires_at).toLocaleDateString():"N/A",BusinessSubscriptionStatus:l.business_subscription_status||"inactive",BusinessSubscriptionExpiresAt:l.business_subscription_expires_at?new Date(l.business_subscription_expires_at).toLocaleDateString():"N/A",IsFirstBusiness:l.is_first_business?"Yes":"No",ViewCount:l.view_count||0,LastShownAt:l.last_shown_at?new Date(l.last_shown_at).toLocaleDateString():"Never",CreatedDate:new Date(l.created_at).toLocaleDateString(),LastUpdated:new Date(l.updated_at).toLocaleDateString()}}),o=Av.unparse(i);return new Blob([o],{type:"text/csv;charset=utf-8"})}catch(t){throw console.error("Error exporting full businesses data:",t),t}},exportResidentialUsersData:async()=>{try{const{data:t,error:e}=await Q.from("profiles").select("*").eq("user_type","residential").order("created_at",{ascending:!1});if(e)throw e;const r=(t||[]).map(a=>({FirstName:a.first_name,LastName:a.last_name,Email:a.email,Role:"Resident",MembershipStatus:a.membership_status||"N/A",MembershipExpiresAt:a.membership_expires_at?new Date(a.membership_expires_at).toLocaleDateString():"N/A",StripeCustomerId:a.stripe_customer_id||"N/A",PaymentStatus:a.payment_status||"N/A",LastPaymentDate:a.last_payment_date?new Date(a.last_payment_date).toLocaleDateString():"N/A",Bio:a.bio||"",JoinedDate:new Date(a.created_at).toLocaleDateString(),LastUpdated:new Date(a.updated_at).toLocaleDateString()})),n=Av.unparse(r);return new Blob([n],{type:"text/csv;charset=utf-8"})}catch(t){throw console.error("Error exporting residential users data:",t),t}},createDatabaseBackup:async()=>{try{const[t,e,r,n]=await Promise.all([Q.from("profiles").select("*"),Q.from("business_profiles").select("*"),Q.from("business_category").select("*"),Q.from("events").select("*")]);if(t.error)throw t.error;if(e.error)throw e.error;if(r.error)throw r.error;if(n.error)throw n.error;const a={version:"1.0",timestamp:new Date().toISOString(),profiles:t.data,businesses:e.data,categories:r.data,events:n.data},i=JSON.stringify(a,null,2);return new Blob([i],{type:"application/json"})}catch(t){throw console.error("Error creating database backup:",t),t}}};class kFe{constructor(){sr(this,"dryRunPriceUpdate",async(e,r)=>
1199this.makeRequest("update-stripe-price-id",{oldPriceId:e,newPriceId:r,dryRun:!0}));sr(this,"updatePriceIds",async(e,r)=>this.makeRequest("update-stripe-price-id",{oldPriceId:e,newPriceId:r,dryRun:!1}));sr(this,"updatePricing",async(e,r)=>{const{data:n,error:a}=await Q.from("pricing").update(r).eq("id",e).select().single();if(a)throw console.error("Error updating pricing:",a),new Error("Failed to update pricing");return n})}async makeRequest(e,r){const{data:{session:n}}=await Q.auth.getSession();if(!(n!=null&&n.access_token))throw new Error("No active session found. Please log in again.");const a=await fetch(`https://ntfepejabevzvrpomvpd.supabase.co/functions/v1/${e}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n.access_token}`},body:JSON.stringify(r)});if(!a.ok){const i=await a.json();throw new Error(i.error||`HTTP error! status: ${a.status}`)}return a.json()}}const EN=new kFe,Po={getMembers:Rf.getMembers,updateMember:Rf.updateMember,getBusinesses:na.getBusinesses,updateBusinessStatus:na.updateBusinessStatus,updateOutsidePayment:na.updateOutsidePayment,getStats:na.getStats,getCategories:vv.getCategories,createCategory:vv.createCategory,updateCategory:vv.updateCategory,deleteCategory:vv.deleteCategory,generateMembersPDF:uf.generateMembersPDF,generateBusinessesPDF:uf.generateBusinessesPDF,exportMembersData:uf.exportMembersData,exportBusinessesData:uf.exportBusinessesData,exportFullBusinessesData:uf.exportFullBusinessesData,exportResidentialUsersData:uf.exportResidentialUsersData,createDatabaseBackup:uf.createDatabaseBackup,dryRunPriceUpdate:EN.dryRunPriceUpdate,updatePriceIds:EN.updatePriceIds,updatePricing:EN.updatePricing},_Fe=({currentPage:t,totalPages:e,itemsPerPage:r,totalBusinesses:n,onPageChange:a,onItemsPerPageChange:i})=>{if(e<=1)return null;const o=()=>{t>1&&a(t-1)},l=()=>{t<e&&a(t+1)},u=(()=>{const f=[];if(f.push(1),e<=7){for(let m=2;m<=e;m++)f.push(m);return f}if(t<=4)return f.push(2,3,4,5),f.push("ellipsis"),f.push(e),f;if(t>=e-3){f.push("ellipsis");for(let m=e-4;m<=e;m++)f.push(m);return f}return f.push("ellipsis"),f.push(t-1,t,t+1),f.push("ellipsis"),f.push(e),f})(),d=Math.min((t-1)*r+1,n),h=Math.min(t*r,n);return s.jsxs("div",{className:"flex flex-col space-y-4 mt-6",children:[s.jsxs("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[s.jsxs("div",{children:["Showing ",d,"-",h," of ",n," businesses"]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("span",{children:"Items per page:"}),s.jsxs(Wt,{value:r.toString(),onValueChange:f=>i(Number(f)),children:[s.jsx(Ht,{className:"h-8 w-[70px]",children:s.jsx(qt,{placeholder:r.toString()})}),s.jsx($t,{children:[5,10,20,50,100].map(f=>s.jsx(Ae,{value:f.toString(),children:f},f))})]})]})]}),s.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[s.jsxs(Y,{variant:"outline",size:"sm",onClick:o,disabled:t===1,children:[s.jsx(hC,{className:"h-4 w-4 mr-1"}),"Prev"]}),s.jsx("div",{className:"flex items-center space-x-1",children:u.map((f,m)=>f==="ellipsis"?s.jsx("span",{className:"px-2",children:"..."},`ellipsis-${m}`):s.jsx(Y,{variant:t===f?"default":"outline",size:"sm",onClick:()=>a(f),className:"min-w-[36px]",children:f},`page-${f}`))}),s.jsxs(Y,{variant:"outline",size:"sm",onClick:l,disabled:t===e,children:["Next",s.jsx(Ih,{className:"h-4 w-4 ml-1"})]})]})]})},EFe=({isOpen:t,onOpenChange:e,selectedBusiness:r,onDeleteBusiness:n,isPending:a})=>{const[i,o]=x.useState(""),[l,c]=x.useState("");if(!r)return null;const u=r.name.toUpperCase(),d=i.trim().toUpperCase()===u,h=()=>{if(!d){c("Please type the business name exactly as shown to confirm deletion");return}n()},f=()=>{o(""),c(""),e(!1)};return s.jsx(Tt,{open:t,onOpenChange:e,children:s.jsxs(Dt,{className:"sm:max-w-[500px]",children:[s.jsxs(It,{children:[s.jsxs(Ot,{className:"flex items-center gap-2 text-red-600",children:[s.jsx(vr,{className:"h-5 w-5"}),"Delete Business"]}),s.jsx(rr,{children:"This action cannot be undone. This will permanently delete the business and all related data."})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs(da,{className:"border-red-200 bg-red-50",children:[s.jsx(yd,{className:"h-4 w-4 text-red-600"}),s.jsxs(ha,{className:"text-red-800",children:[s.jsx("strong",{children:"Warning:"})," This will permanently delete:",s.jsxs("ul",{className:"mt-2 ml-4 list-disc space-y-1",children:[s.jsxs("li",{children:["The business profile: ",s.jsx("strong",{children:r.name})]}),s.jsx("li",{children:"All business categories and associations"}),s.jsx("li",{children:"All events created by this business"}),s.jsx("li",{children:"All job postings from this business"}),s.jsx("li",{children:"All event registrations for business events"})]})]})]}),s.jsx("div",{className:"space-y-2",children:s.jsxs("div",{className:"p-3 bg-gray-50 rounded-md",children:[s.jsx("p",{className:"text-sm font-medium text-gray-700",children:"Business Details:"}),s.jsxs("p",{className:"text-sm text-gray-600",children:["Name: ",r.name]}),s.jsxs("p",{className:"text-sm text-gray-600",children:["Owner: ",r.owner.name]}),s.jsxs("p",{className:"text-sm text-gray-600",children:["Email: ",r.owner.email]}),s.jsxs("p",{className:"text-sm text-gray-600",children:["Address: ",r.address]})]})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"confirmation",className:"text-sm font-medium",children:"Type the business name to confirm deleti
1199on:"}),s.jsx("p",{className:"text-sm text-gray-600 font-mono bg-gray-100 p-2 rounded",children:r.name}),s.jsx(Ne,{id:"confirmation",placeholder:"Type the business name here",value:i,onChange:m=>{o(m.target.value),l&&c("")},className:l?"border-red-500":"",disabled:a}),l&&s.jsx("p",{className:"text-sm text-red-600",children:l})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",onClick:f,disabled:a,children:"Cancel"}),s.jsx(Y,{variant:"destructive",onClick:h,disabled:a||!d,children:a?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"}),"Deleting..."]}):s.jsxs(s.Fragment,{children:[s.jsx(vr,{className:"mr-2 h-4 w-4"}),"Delete Business"]})})]})]})})},AFe=()=>{const{toast:t}=St(),{user:e}=ts(),r=Su(),[n,a]=x.useState("all"),[i,o]=x.useState("name"),[l,c]=x.useState("asc"),[u,d]=x.useState(1),[h,f]=x.useState(8),[m,g]=x.useState(""),[y,b]=x.useState(!1),[w,j]=x.useState(null),[N,S]=x.useState("pending"),[E,C]=x.useState(!1),[T,D]=x.useState(null),[A,R]=x.useState("inactive"),[M,P]=x.useState(null),[U,I]=x.useState(!1),[O,V]=x.useState(!1),[G,B]=x.useState(null),[$,W]=x.useState(!1),[oe,K]=x.useState(null),[H,X]=x.useState(!1),[me,ie]=x.useState(null),[ee,he]=x.useState(!1),{data:ve,isLoading:Ce,error:re}=kx({queryKey:["admin","businesses",n,i,l,u,h,m],queryFn:async()=>na.getBusinesses({status:n,page:u,limit:h,sortField:i,sortDirection:l,searchQuery:m})}),we=$l({mutationFn:async({id:Ge,status:Je,adminNotes:be,featured:Pe,featurePaymentStatus:qe})=>{if(!(e!=null&&e.id))throw new Error("User not authenticated");if(Je==="approved")await f_({id:Ge,reviewedBy:e.id,adminNotes:be});else if(Je==="rejected"){if(!be)throw new Error("Admin notes required for rejection");await m_({id:Ge,adminNotes:be,reviewedBy:e.id})}else await na.updateBusinessStatus(Ge,Je);return Pe!==void 0&&await na.updateFeatured(Ge,Pe),qe!==void 0&&await na.updateFeatureSubscriptionStatus(Ge,qe),{success:!0}},onSuccess:Ge=>{if("success"in Ge&&!Ge.success)throw new Error(Ge.error||"Failed to update business status");t({title:"Business updated successfully",description:`The business status has been updated to ${N}.`}),r.invalidateQueries({queryKey:["admin","businesses"]}),b(!1)},onError:Ge=>{t({title:"Error updating business",description:`Failed to update business: ${Ge instanceof Error?Ge.message:"Unknown error"}`,variant:"destructive"})}}),Ee=$l({mutationFn:({id:Ge,outsidePaymentData:Je})=>na.updateOutsidePayment(Ge,Je),onSuccess:()=>{t({title:"Outside payment updated successfully",description:"The outside payment settings have been updated."}),r.invalidateQueries({queryKey:["admin","businesses"]}),V(!1),B(null)},onError:Ge=>{t({title:"Error updating outside payment",description:`Failed to update outside payment: ${Ge instanceof Error?Ge.message:"Unknown error"}`,variant:"destructive"})}}),Me=$l({mutationFn:Ge=>na.deleteBusiness(Ge),onSuccess:()=>{t({title:"Business deleted successfully",description:"The business and all related data have been permanently deleted."}),r.invalidateQueries({queryKey:["admin","businesses"]}),W(!1),K(null),b(!1)},onError:Ge=>{t({title:"Error deleting business",description:`Failed to delete business: ${Ge instanceof Error?Ge.message:"Unknown error"}`,variant:"destructive"})}});x.useEffect(()=>{d(1)},[n,m,h]),x.useEffect(()=>{re&&(console.error("â Error in business management hook:",re),t({title:"Error loading businesses",description:"Failed to load business data. Please try again later.",variant:"destructive"}))},[re,t]);const ae=Ge=>{i===Ge?c(l==="asc"?"desc":"asc"):(o(Ge),c("asc"))},ze=Ge=>{j(Ge),S(Ge.status),C(Ge.featured??!1),D(null),R(Ge.feature_subscription_status==="active"?"active":"inactive"),P(null),b(!0)};x.useEffect(()=>{if(!y||!w)return;let Ge=!1;return I(!0),Promise.all([na.getFeatured(w.id),na.getFeatureSubscriptionStatus(w.id
1199)]).then(([Je,be])=>{if(!Ge){C(Je),D(Je);const Pe=be==="active"?"active":"inactive";R(Pe),P(Pe)}}).catch(()=>{Ge||(C(!1),R("inactive"))}).finally(()=>{Ge||I(!1)}),()=>{Ge=!0}},[y,w==null?void 0:w.id]),x.useEffect(()=>{A!=="active"&&E&&C(!1)},[A,E]);const mt=(Ge,Je,be)=>{w&&N&&we.mutate({id:w.id,status:N,adminNotes:Ge,featured:Je,featurePaymentStatus:be})},tt=()=>{w&&(B(w),V(!0))},Xe=Ge=>{G&&Ee.mutate({id:G.id,outsidePaymentData:Ge})},Ft=()=>{w&&(K(w),W(!0))},ce=()=>{oe&&Me.mutate(oe.id)},fe=async Ge=>{he(!0);try{const Je=await Jf(Ge.id);Je?(ie(Je),X(!0)):t({title:"Error",description:"Could not load business details for editing.",variant:"destructive"})}catch(Je){console.error("Error fetching business details for editing:",Je),t({title:"Error",description:"Failed to load business details. Please try again.",variant:"destructive"})}finally{he(!1)}},ge=()=>{r.invalidateQueries({queryKey:["admin","businesses"]}),X(!1),ie(null),t({title:"Business Updated",description:"The business has been successfully updated."})};return{businesses:(ve==null?void 0:ve.businesses)||[],totalBusinesses:(ve==null?void 0:ve.total)||0,totalPages:Math.ceil(((ve==null?void 0:ve.total)||0)/h),isLoading:Ce,statusFilter:n,sortField:i,sortDirection:l,currentPage:u,itemsPerPage:h,searchQuery:m,isModalOpen:y,selectedBusiness:w,newStatus:N,updateStatusMutation:we,isOutsidePaymentModalOpen:O,outsidePaymentBusiness:G,updateOutsidePaymentMutation:Ee,isDeleteDialogOpen:$,businessToDelete:oe,deleteBusinessMutation:Me,isEditModalOpen:H,businessToEdit:me,isLoadingBusinessDetails:ee,setStatusFilter:a,setCurrentPage:d,setItemsPerPage:f,setSearchQuery:g,handleSort:ae,handleOpenModal:ze,setIsModalOpen:b,setNewStatus:S,featured:E,setFeatured:C,featurePaymentStatus:A,setFeaturePaymentStatus:R,isFeaturedLoading:U,hasStatusOrFeaturedChange:w!=null&&N!==w.status||T!==null&&E!==T||M!==null&&A!==M,handleUpdateStatus:mt,handleOpenOutsidePayment:tt,handleOutsidePaymentUpdate:Xe,setIsOutsidePaymentModalOpen:V,handleOpenDeleteDialog:Ft,handleDeleteBusiness:ce,setIsDeleteDialogOpen:W,handleEditBusiness:fe,handleBusinessUpdated:ge,setIsEditModalOpen:X}},DFe=()=>{const{businesses:t,totalBusinesses:e,totalPages:r,isLoading:n,statusFilter:a,sortField:i,sortDirection:o,currentPage:l,itemsPerPage:c,searchQuery:u,isModalOpen:d,selectedBusiness:h,newStatus:f,updateStatusMutation:m,isOutsidePaymentModalOpen:g,outsidePaymentBusiness:y,updateOutsidePaymentMutation:b,isDeleteDialogOpen:w,businessToDelete:j,deleteBusinessMutation:N,isEditModalOpen:S,businessToEdit:E,setStatusFilter:C,setCurrentPage:T,setItemsPerPage:D,setSearchQuery:A,handleSort:R,handleOpenModal:M,setIsModalOpen:P,setNewStatus:U,featured:I,setFeatured:O,featurePaymentStatus:V,setFeaturePaymentStatus:G,isFeaturedLoading:B,hasStatusOrFeaturedChange:$,handleUpdateStatus:W,handleOpenOutsidePayment:oe,handleOutsidePaymentUpdate:K,setIsOutsidePaymentModalOpen:H,handleOpenDeleteDialog:X,handleDeleteBusiness:me,setIsDeleteDialogOpen:ie,handleEditBusiness:ee,handleBusinessUpdated:he,setIsEditModalOpen:ve}=AFe(),Ce=Ee=>Ee.businessSubscriptionStatus==="active"||Ee.businessSubscriptionStatus==="trialing"?s.jsxs(ke,{variant:"default",className:"bg-green-500 text-white text-xs",children:[s.jsx(Or,{className:"w-3 h-3 mr-1"})," Paid"]}):s.jsxs(ke,{variant:"outline",className:"bg-red-50 text-red-700 border-red-200 text-xs",children:[s.jsx(Hl,{className:"w-3 h-3 mr-1"})," Unpaid"]}),re=Ee=>{switch(Ee){case"approved":return s.jsx(ke,{variant:"default",className:"bg-green-600",children:"Approved"});case"pending":return s.jsx(ke,{variant:"secondary",className:"bg-amber-100 text-amber-800",children:"Pending"});case"rejected":return s.jsx(ke,{variant:"destructive",children:"Rejected"});default:return s.jsx(ke,{children:Ee})}},we=Ee=>new Date(Ee).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"});return s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsx(Xwe,{searchQuery:u,onSearchChange:A,statusFilter:a,onStatusFilterChange:C}),n?s.jsx("div",{className:"py-8 text-center text-gray-500",children:"Loading businesses..."}):t.length===0?s.jsx("div",{className:"py-8 text-center text-gray-500 rounded-lg border",children:u?s.jsxs(s.Fragment,{children:['No businesses matching "',u,'"']}):s.jsx(s.Fragment,{children:"No businesses found."})}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"md:hidden space-y-3",children:t.map(Ee=>s.jsx(De,{className:"overflow-hidden",children:s.jsx(Be,{className:"p-4",children:s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx(rt,{to:`/dashboard/admin/businesses/${Ee.id}`,className:"font-medium text-blue-600 hover:underline truncate",children:Ee.name}),Ee.isOutsidePayment&&s.jsx(ke,{variant:"outline",className:"bg-purple-50 text-purple-700 border-purple-200 text-xs",children:"Outside"})]}),s.jsx("div",{className:"text-sm text-gray-500 truncate mt-0.5",children:Ee.address})]}),s.jsxs("div",{className:"text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Owner: "}),s.jsx("span",{className:"font-medium",children:Ee.owner.name})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[re(Ee.status),Ce(Ee),Ee.featured&&s.jsxs(ke,{variant:"default",className:"bg-amber-500 text-white text-xs",children:[s.jsx(ri,{className:"w-3 h-3 mr-1"}),"Featured"]})]}),s.jsxs("div",{className:"text-xs text-muted-foreground",children:["Modified ",we(Ee.lastModified)]}),s.jsxs("div",{className:"flex gap-2 pt-1 border-t",children:[s.jsx(Y,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>M(Ee),children:"Manage"}),s.jsxs(Y,{variant:"outline",size:"sm",className:"flex-1 text-green-600 border-green-200 hover:bg-green-50",onClick:()=>ee(Ee),children:[s.jsx(zs,{className:"h-4 w-4 mr-1.5"}),"Edit"]}),s.jsx(Y,{variant:"outline",size:"sm",asChild:!0,className:"flex-1",children:s.jsx(rt,{to:`/dashboard/admin/businesses/${Ee.id}`,children:"View"})})]})]})})},Ee.id))}),s.jsx("div",{className:"hidden md:block overflow-x-auto -mx-1 px-1 rounded-lg border",children:s.jsx(Zwe,{businesses:t,isLoading:!1,searchQuery:u,sortField:i,sortDirection:o,onSort:R,onOpenModal:M,onEditBusiness:ee})})]}),!n&&t.length>0&&s.jsx(_Fe,{currentPage:l,totalPages:r,itemsPerPage:c,totalBusinesses:e,onPageChange:T,onItemsPerPageChange:D}),s.jsx(Qwe,{isOpen:d,onOpenChange:P,selectedBusiness:h,newStatus:f,onStatusChange:U,onUpdateStatus:W,onOpenOutsidePayment:oe,onOpenDeleteDialog:X,isPending:m.isPending,featured:I,onFeaturedChange:O,featurePaymentStatus:V,onFeaturePaymentStatusChange:G,isFeaturedLoading:B,hasStatusOrFeaturedChange:$}),s.jsx(eje,{isOpen:g,onOpenChange:H,selectedBusiness:y,onUpdateOutsidePayment:K,isPending:b.isPending}),s.jsx(EFe,{isOpen:w,onOpenChange:ie,selectedBusiness:j,onDeleteBusiness:me,isPending:N.isPending}),s.jsx(tje,{open:S,onOpenChange:ve,business:E,onBusinessUpdated:he})]})},TFe=({refreshTimestamp:t})=>
1199{const[e,r]=x.useState([]),[n,a]=x.useState([]),[i,o]=x.useState(!0),[l,c]=x.useState(""),[u,d]=x.useState("all"),[h,f]=x.useState("all"),m=Oe.useMemo(()=>{const b=e.map(j=>j.event),w=new Map;return b.forEach(j=>{w.has(j.title)||w.set(j.title,j)}),Array.from(w.values())},[e]),g=async()=>{o(!0);try{const b=await ore();b.success&&b.data?(r(b.data),a(b.data)):ct.error(b.message||"Failed to load event registrations")}catch(b){console.error("Error fetching registrations:",b),ct.error("Failed to load event registrations")}finally{o(!1)}};x.useEffect(()=>{g()},[t]),x.useEffect(()=>{let b=e;l&&(b=b.filter(w=>`${w.user.first_name} ${w.user.last_name}`.toLowerCase().includes(l.toLowerCase()))),u!=="all"&&(b=b.filter(w=>w.status===u)),h!=="all"&&(b=b.filter(w=>w.event.title===h)),a(b)},[e,l,u,h]);const y=b=>{switch(b){case"confirmed":return"default";case"canceled":return"destructive";default:return"outline"}};return i?s.jsx("div",{className:"py-8 text-center",children:"Loading event registrations..."}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-center",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(Uc,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 h-4 w-4"}),s.jsx(Ne,{placeholder:"Search by user name...",value:l,onChange:b=>c(b.target.value),className:"pl-10"})]}),s.jsxs(Wt,{value:u,onValueChange:d,children:[s.jsx(Ht,{className:"w-[180px]",children:s.jsx(qt,{placeholder:"Filter by status"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"all",children:"All Statuses"}),s.jsx(Ae,{value:"confirmed",children:"Confirmed"}),s.jsx(Ae,{value:"canceled",children:"Canceled"})]})]}),s.jsxs(Wt,{value:h,onValueChange:f,children:[s.jsx(Ht,{className:"w-[200px]",children:s.jsx(qt,{placeholder:"Filter by event"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"all",children:"All Events"}),m.map(b=>s.jsx(Ae,{value:b.title,children:b.title},b.title))]})]})]}),s.jsxs("div",{className:"text-sm text-gray-600",children:["Showing ",n.length," of ",e.length," registrations"]}),s.jsx("div",{className:"border rounded-lg",children:s.jsxs(Oi,{children:[s.jsx(zi,{children:s.jsxs(As,{children:[s.jsx(At,{children:"User"}),s.jsx(At,{children:"Event"}),s.jsx(At,{children:"Status"}),s.jsx(At,{children:"Registered"})]})}),s.jsx(Ui,{children:n.length===0?s.jsx(As,{children:s.jsx(Ct,{colSpan:4,className:"text-center py-8 text-gray-500",children:"No event registrations found"})}):n.map(b=>s.jsxs(As,{children:[s.jsxs(Ct,{className:"font-medium",children:[b.user.first_name," ",b.user.last_name]}),s.jsx(Ct,{children:b.event.title}),s.jsx(Ct,{children:s.jsx(ke,{variant:y(b.status),children:b.status})}),s.jsx(Ct,{className:"text-sm text-gray-600",children:Cs(new Date(b.created_at),"MMM d, yyyy")})]},b.id))})]})})]})},MFe=({activeTab:t,setActiveTab:e,upcomingEvents:r,pastEvents:n,pendingEvents:a,isLoading:i,onEdit:o,onDelete:l,onApprove:c,onReject:u,selectedEvents:d,onSelectEvent:h,onSelectAll:f,refreshTimestamp:m,config:g})=>{x.useEffect(()=>{console.log(`â¬
ï¸ [EventsContainer] Received Props: ${r.length} upcoming, ${n.length} past, Timestamp: ${m}`)},[r,n,m]);const y=`upcoming-${m}`,b=`past-${m}`;x.useEffect(()=>{console.log(`ð [EventsContainer] Upcoming Table Key: ${y}`),console.log(`ð [EventsContainer] Past Table Key: ${b}`)},[y,b]),x.useEffect(()=>{console.log(`ð [EventsContainer] Rendering ${r.length} upcoming events`),console.log(`ð [EventsContainer] Rendering ${n.length} past events`)},[r,n,m]);const[w,j]=x.useState(null),[N,S]=x.useState(null),[E,C]=x.useState(""),[T,D]=x.useState(!1),[A,R]=x.useState(!1),M=async()=>{if(w){D(!0);try{await l(w),j(null)}finally{D(!1)}}},P=async()=>{if(!(!N||!u||!E.trim())){R(!0);try{await u(N,E),S(null),C("")}finally{R(!1)}}},U=I=>{switch(I){case"pending":return s.jsx(ke,{variant:"outline",className:"text-yellow-600 border-yellow-600 text-xs",children:"Pending"});case"approved":return s.jsx(ke,{variant:"outline",className:"text-green-600 border-green-600 text-xs",children:"Approved"});case"rejected":return s.jsx(ke,{variant:"outline",className:"text-red-600 border-red-600 text-xs",children:"Rejected"});default:return null}};return s.jsxs(s.Fragment,{children:[s.jsxs(De,{children:[s.jsx(ot,{className:"p-4 sm:p-6",children:s.jsx(ut,{className:"text-lg sm:text-xl",children:"Events"})}),s.jsx(Be,{className:"p-4 sm:p-6 pt-0",children:s.jsxs(sn,{value:t,onValueChange:e,children:[s.jsxs(Qs,{className:"mb-4 flex flex-wrap h-auto p-1 gap-1 w-full sm:w-auto",children:[s.jsxs(Gt,{value:"upcoming",className:"text-xs sm:text-sm flex-1 sm:flex-initial",children:["Upcoming (",r.length,")"]}),s.jsxs(Gt,{value:"past",className:"text-xs sm:text-sm flex-1 sm:flex-initial",children:["Past (",n.length,")"]}),s.jsxs(Gt,{value:"pending",className:"text-xs sm:text-sm flex-1 sm:flex-initial",children:["Pending (",a.length,")"]}),s.jsx(Gt,{value:"registrations",className:"text-xs sm:text-sm flex-1 sm:flex-initial",children:"Registrations"})]}
1199),s.jsx(Rt,{value:"upcoming",className:"space-y-4 mt-0",children:i?s.jsx("div",{className:"py-8 text-center text-muted-foreground text-sm",children:"Loading events..."}):r.length===0?s.jsx("div",{className:"py-8 text-center text-muted-foreground text-sm",children:"No upcoming events"}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"md:hidden space-y-3",children:r.map(I=>s.jsx(De,{className:"overflow-hidden border",children:s.jsx(Be,{className:"p-4",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("div",{className:"font-medium truncate",children:I.title}),s.jsx("div",{className:"text-sm text-muted-foreground",children:I.date}),s.jsx("div",{className:"text-xs text-muted-foreground",children:I.time}),s.jsx("div",{className:"text-sm truncate",children:I.location}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.event_type&&s.jsx(ke,{variant:"outline",className:"text-xs capitalize",children:I.event_type}),I.ticket_price!==void 0&&I.ticket_price!==null&&s.jsx("span",{className:"text-xs",children:I.ticket_price===0?"Free":`$${I.ticket_price.toFixed(2)}`})]}),s.jsxs("div",{className:"flex gap-2 pt-2 border-t",children:[s.jsxs(Y,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>o(I),children:[s.jsx(bu,{className:"h-3 w-3 mr-1"})," Edit"]}),s.jsxs(Y,{variant:"outline",size:"sm",className:"flex-1 text-destructive",onClick:()=>j(I),children:[s.jsx(vr,{className:"h-3 w-3 mr-1"})," Delete"]})]})]})})},I.id))}),s.jsx("div",{className:"hidden md:block mb-4",children:s.jsx(AN,{events:r,onEdit:o,onDelete:l,isLoading:i,selectedEvents:d,onSelectEvent:h,onSelectAll:f,config:g},y)})]})}),s.jsx(Rt,{value:"past",className:"space-y-4 mt-0",children:i?s.jsx("div",{className:"py-8 text-center text-muted-foreground text-sm",children:"Loading events..."}):n.length===0?s.jsx("div",{className:"py-8 text-center text-muted-foreground text-sm",children:"No past events"}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"md:hidden space-y-3",children:n.map(I=>s.jsx(De,{className:"overflow-hidden border",children:s.jsx(Be,{className:"p-4",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("div",{className:"font-medium truncate",children:I.title}),s.jsx("div",{className:"text-sm text-muted-foreground",children:I.date}),s.jsx("div",{className:"text-xs text-muted-foreground",children:I.time}),s.jsx("div",{className:"text-sm truncate",children:I.location}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.event_type&&s.jsx(ke,{variant:"outline",className:"text-xs capitalize",children:I.event_type}),I.ticket_price!==void 0&&I.ticket_price!==null&&s.jsx("span",{className:"text-xs",children:I.ticket_price===0?"Free":`$${I.ticket_price.toFixed(2)}`})]}),s.jsxs("div",{className:"flex gap-2 pt-2 border-t",children:[s.jsxs(Y,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>o(I),children:[s.jsx(bu,{className:"h-3 w-3 mr-1"})," Edit"]}),s.jsxs(Y,{variant:"outline",size:"sm",className:"flex-1 text-destructive",onClick:()=>j(I),children:[s.jsx(vr,{className:"h-3 w-3 mr-1"})," Delete"]})]})]})})},I.id))}),s.jsx("div",{className:"hidden md:block mb-4",children:s.jsx(AN,{events:n,onEdit:o,onDelete:l,isLoading:i,selectedEvents:d,onSelectEvent:h,onSelectAll:f,config:g},b)})]})}),s.jsx(Rt,{value:"pending",className:"space-y-4 mt-0",children:i?s.jsx("div",{className:"py-8 text-center text-muted-foreground text-sm",children:"Loading events..."}):a.length===0?s.jsx("div",{className:"py-8 text-center text-muted-foreground text-sm",children:"No pending events"}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"md:hidden space-y-3",children:a.map(I=>s.jsx(De,{className:"overflow-hidden border",children:s.jsx(Be,{className:"p-4",children:s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("div",{className:"font-medium truncate",children:I.title}),U(I.approval_status),s.jsx("div",{className:"text-sm text-muted-foreground",children:I.date}),s.jsx("div",{className:"text-xs text-muted-foreground",children:I.time}),s.jsx("div",{className:"text-sm truncate",children:I.location}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[I.event_type&&s.jsx(ke,{variant:"outline",className:"text-xs capitalize",children:I.event_type}),I.ticket_price!==void 0&&I.ticket_price!==null&&s.jsx("span",{className:"text-xs",children:I.ticket_price===0?"Free":`$${I.ticket_price.toFixed(2)}`})]}),s.jsxs("div",{className:"flex flex-wrap gap-2 pt-2 border-t",children:[I.approval_status==="pending"&&c&&u&&s.jsxs(s.Fragment,{children:[s.jsxs(Y,{variant:"outline",size:"sm",className:"flex-1 text-green-600 border-green-200",onClick:()=>c(I),disabled:A,children:[s.jsx(un,{className:"h-3 w-3 mr-1"})," Approve"]}),s.jsxs(Y,{variant:"outline",size:"sm",className:"flex-1 text-destructive",onClick:()=>S(I),disabled:A,children:[s.jsx(Ir,{className:"h-3 w-3 mr-1"})," Reject"]})]}),s.jsxs(Y,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>o(I),children:[s.jsx(bu,{className:"h-3 w-3 mr-1"})," Edit"]}),s.jsxs(Y,{variant:"outline",size:"sm",className:"flex-1 text-destructive",onClick:()=>j(I),children:[s.jsx(vr,{className:"h-3 w-3 mr-1"})," Delete"]})]})]})})},I.id))}),s.jsx("div",{className:"hidden md:block mb-4",children:s.jsx(AN,{events:a,onEdit:o,onDelete:l,onApprove:c,onReject:u,isLoading:i,selectedEvents:d,onSelectEvent:h,onSelectAll:f,config:g,showApprovalActions:!0},`pending-${m}`)})]})}
1199),s.jsx(Rt,{value:"registrations",className:"space-y-4 mt-0",children:s.jsx("div",{className:"overflow-x-auto -mx-1 px-1",children:s.jsx(TFe,{refreshTimestamp:m})})})]})})]}),s.jsx(ai,{open:!!w,onOpenChange:I=>!I&&j(null),children:s.jsxs(Oa,{className:"max-w-[min(100vw-2rem,28rem)]",children:[s.jsxs(za,{children:[s.jsx(Ha,{children:"Delete Event"}),s.jsxs($a,{children:['Are you sure you want to delete "',w==null?void 0:w.title,'"? This action cannot be undone.']})]}),s.jsxs(Ua,{children:[s.jsx(qa,{onClick:()=>j(null),children:"Cancel"}),s.jsx(Wa,{onClick:M,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",disabled:T,children:T?"Deleting...":"Delete Event"})]})]})}),s.jsx(Tt,{open:!!N,onOpenChange:I=>{I||(S(null),C(""))},children:s.jsxs(Dt,{className:"max-w-[min(100vw-2rem,28rem)]",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Reject Event"}),s.jsxs(rr,{children:['Please provide a reason for rejecting "',N==null?void 0:N.title,'".']})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx(Z,{htmlFor:"mobile-rejection-reason",children:"Rejection Reason *"}),s.jsx(zt,{id:"mobile-rejection-reason",value:E,onChange:I=>C(I.target.value),placeholder:"Explain why this event cannot be approved...",rows:4,className:"resize-none"})]}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(Y,{variant:"outline",onClick:()=>{S(null),C("")},children:"Cancel"}),s.jsx(Y,{variant:"destructive",onClick:P,disabled:!E.trim()||A,children:A?"Rejecting...":"Reject Event"})]})]})})]})},AN=({events:t,isLoading:e,onEdit:r,onDelete:n,onApprove:a,onReject:i,selectedEvents:o,onSelectEvent:l,onSelectAll:c,config:u,showApprovalActions:d=!1})=>{const[h,f]=x.useState(null),[m,g]=x.useState(!1),[y,b]=x.useState(null),[w,j]=x.useState(""),[N,S]=x.useState(!1),[E,C]=x.useState(null),T=t.length>0&&t.every(B=>o.includes(B.id));o.length>0;const D=B=>{c(B)},A=B=>{f(B)},R=async()=>{if(h){g(!0);try{await n(h)}finally{g(!1),f(null)}}},M=()=>{f(null)},P=async B=>{if(a){S(!0);try{await a(B)}finally{S(!1)}}},U=B=>{b(B),j("")},I=async()=>{if(!(!y||!i||!w.trim())){S(!0);try{await i(y,w),b(null),j("")}finally{S(!1)}}},O=B=>{C(B)},V=B=>{if(B.contact_name||B.contact_email)return{contact_name:B.contact_name,contact_email:B.contact_email,contact_phone:B.contact_phone,organization_name:B.organization_name,event_website:B.event_website,additional_info:B.additional_info,submission_type:"public_submission"};try{if(B.admin_notes){const $=JSON.parse(B.admin_notes);if($.submission_type==="public_submission")return $}}catch{}return null},G=B=>{switch(B){case"pending":return s.jsx(ke,{variant:"outline",className:"text-yellow-600 border-yellow-600",children:"Pending"});case"approved":return s.jsx(ke,{variant:"outline",className:"text-green-600 border-green-600",children:"Approved"});case"rejected":return s.jsx(ke,{variant:"outline",className:"text-red-600 border-red-600",children:"Rejected"});default:return s.jsx(ke,{variant:"outline",children:"Unknown"})}};return e?s.jsx("div",{className:"py-8 text-center",children:"Loading events..."}):t.length===0?s.jsx("div",{className:"py-8 text-center",children:"No events found"}):s.jsxs("div",{className:"rounded-md border overflow-x-auto",children:[s.jsxs(Oi,{className:"min-w-[800px]",children:[s.jsx(zi,{children:s.jsxs(As,{children:[s.jsx(At,{className:"w-[50px]",children:s.jsx(Wl,{checked:T,onCheckedChange:D})}),s.jsx(At,{children:"Title"}),s.jsx(At,{children:"Date & Time"}),s.jsx(At,{children:"Location"}),s.jsx(At,{children:"Type"}),s.jsx(At,{children:"Price"}),d&&s.jsx(At,{children:"Status"}),s.jsx(At,{className:"text-right",children:"Actions"})]})}),s.jsx(Ui,{children:t.map(B=>s.jsxs(As,{children:[s.jsx(Ct,{children:s.jsx(Wl,{checked:o.includes(B.id),onCheckedChange:$=>l(B.id,!!$)})}),s.jsx(Ct,{className:"font-medium",children:B.title}),s.jsx(Ct,{children:s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"text-sm",children:B.date}),s.jsx("span",{className:"text-xs text-gray-500",children:B.time})]})}),s.jsx(Ct,{children:B.location}),s.jsx(Ct,{children:B.event_type?s.jsx(ke,{variant:"outline",className:"capitalize",children:B.event_type}):s.jsx("span",{className:"text-gray-400",children:"-"})}),s.jsx(Ct,{children:B.ticket_price!==void 0&&B.ticket_price!==null?s.jsx("span",{className:"text-sm",children:B.ticket_price===0?s.jsx(ke,{variant:"outline",className:"text-green-600 border-green-600",children:"Free"}):`$${B.ticket_price.toFixed(2)}`}):s.jsx("span",{className:"text-gray-400",children:"-"})}),d&&s.jsx(Ct,{children:G(B.approval_status)}),s.jsx(Ct,{className:"text-right",children:s.jsxs(tb,{children:[s.jsx(rb,{asChild:!0,children:s.jsxs(Y,{variant:"ghost",className:"h-8 w-8 p-0",children:[s.jsx("span",{className:"sr-only",children:"Open menu"}),s.jsx(mC,{className:"h-4 w-4"})]})}),s.jsxs(Ix,{align:"end",children:[d&&s.jsxs(s.Fragment,{children:[s.jsxs(Gn,{onClick:()=>O(B),children:[s.jsx(Xs,{className:"mr-2 h-4 w-4"}),"View Details"]}
1199),B.approval_status==="pending"&&s.jsxs(s.Fragment,{children:[s.jsx(pd,{}),s.jsxs(Gn,{onClick:()=>P(B),disabled:N,className:"text-green-600 focus:text-green-600",children:[s.jsx(un,{className:"mr-2 h-4 w-4"}),"Approve Event"]}),s.jsxs(Gn,{onClick:()=>U(B),disabled:N,className:"text-red-600 focus:text-red-600",children:[s.jsx(Ir,{className:"mr-2 h-4 w-4"}),"Reject Event"]})]}),s.jsx(pd,{})]}),s.jsxs(Gn,{onClick:()=>r(B),children:[s.jsx(bu,{className:"mr-2 h-4 w-4"}),"Edit"]}),s.jsxs(Gn,{onClick:()=>A(B),className:"text-red-600 focus:text-red-600",children:[s.jsx(vr,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})})]},B.id))})]}),s.jsx(ai,{open:!!h,onOpenChange:B=>!B&&M(),children:s.jsxs(Oa,{children:[s.jsxs(za,{children:[s.jsx(Ha,{children:"Delete Event"}),s.jsxs($a,{children:['Are you sure you want to delete "',h==null?void 0:h.title,'"? This action cannot be undone.']})]}),s.jsxs(Ua,{children:[s.jsx(qa,{onClick:M,children:"Cancel"}),s.jsx(Wa,{onClick:R,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",disabled:m,children:m?"Deleting...":"Delete Event"})]})]})}),s.jsx(Tt,{open:!!y,onOpenChange:B=>!B&&b(null),children:s.jsxs(Dt,{children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Reject Event"}),s.jsxs(rr,{children:['Please provide a reason for rejecting "',y==null?void 0:y.title,'". This will be sent to the event submitter.']})]}),s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"rejectionReason",children:"Rejection Reason *"}),s.jsx(zt,{id:"rejectionReason",value:w,onChange:B=>j(B.target.value),placeholder:"Please explain why this event cannot be approved...",rows:4,required:!0})]})}),s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(Y,{variant:"outline",onClick:()=>b(null),children:"Cancel"}),s.jsx(Y,{variant:"destructive",onClick:I,disabled:!w.trim()||N,children:N?"Rejecting...":"Reject Event"})]})]})}),s.jsx(Tt,{open:!!E,onOpenChange:B=>!B&&C(null),children:s.jsxs(Dt,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Event Submission Details"}),s.jsx(rr,{children:"Review the complete event submission information"})]}),E&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(Z,{className:"font-semibold",children:"Event Title"}),s.jsx("p",{className:"text-sm",children:E.title})]}),s.jsxs("div",{children:[s.jsx(Z,{className:"font-semibold",children:"Status"}),s.jsx("div",{children:G(E.approval_status)})]})]}),s.jsxs("div",{children:[s.jsx(Z,{className:"font-semibold",children:"Description"}),s.jsx("p",{className:"text-sm whitespace-pre-wrap",children:E.description})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(Z,{className:"font-semibold",children:"Date & Time"}),s.jsx("p",{className:"text-sm",children:E.date}),s.jsx("p",{className:"text-sm text-gray-600",children:E.time})]}),s.jsxs("div",{children:[s.jsx(Z,{className:"font-semibold",children:"Location"}),s.jsx("p",{className:"text-sm",children:E.location})]})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[E.event_type&&s.jsxs("div",{children:[s.jsx(Z,{className:"font-semibold",children:"Event Type"}),s.jsx("p",{className:"text-sm capitalize",children:E.event_type})]}),E.ticket_price!==void 0&&E.ticket_price!==null&&s.jsxs("div",{children:[s.jsx(Z,{className:"font-semibold",children:"Ticket Price"}),s.jsx("p",{className:"text-sm",children:E.ticket_price===0?"Free":`$${E.ticket_price.toFixed(2)}`})]})]}),(()=>{const B=V(E);return B?s.jsxs("div",{className:"border-t pt-4",children:[s.jsx("h4",{className:"font-semibold mb-3",children:"Contact Information"}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs("div",{children:[s.jsx(Z,{className:"font-semibold",children:"Contact Name"}),s.jsx("p",{className:"text-sm",children:B.contact_name})]}),s.jsxs("div",{children:[s.jsx(Z,{className:"font-semibold",children:"Contact Email"}),s.jsx("p",{className:"text-sm",children:B.contact_email})]}),B.contact_phone&&s.jsxs("div",{children:[s.jsx(Z,{className:"font-semibold",children:"Contact Phone"}),s.jsx("p",{className:"text-sm",children:B.contact_phone})]}),B.organization_name&&s.jsxs("div",{children:[s.jsx(Z,{className:"font-semibold",children:"Organization"}),s.jsx("p",{className:"text-sm",children:B.organization_name})]})]}),B.event_website&&s.jsxs("div",{className:"mt-4",children:[s.jsx(Z,{className:"font-semibold",children:"Event Website"}),s.jsx("p",{className:"text-sm",children:s.jsx("a",{href:B.event_website,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline",children:B.event_website})})]}),B.additional_info&&s.jsxs("div",{className:"mt-4",children:[s.jsx(Z,{className:"font-semibold",children:"Additional Information"}),s.jsx("p",{className:"text-sm whitespace-pre-wrap",children:B.additional_info})]})]}):null})(),E.created_at&&s.jsxs("div",{className:"border-t pt-4 text-sm text-gray-600",children:["Submitted on ",new Date(E.created_at).toLocaleDateString()]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsx(Y,{onClick:()=>C(null),children:"Close"})})]})})]})},PFe=async(t,e="business-logos",r="")=>{try{const n=t.name.split(".").pop(),a=`${Wn()}.${n}`,i=r?`${r}/${a}`:a,{data:o,error:l}=await Q.storage.from(e).upload(i,t,{cacheControl:"3600",upsert:!1});if(l)throw console.error("Error uploading file:",l),new Error(`File upload failed: ${l.message}`);const{data:c}=Q.storage.from(e).getPublicUrl(i);return c.publicUrl}catch(n){throw console.error("Error in uploadFile:",n),n}},RFe=async(t,e="business-logos")=>{try{const r=Q.storage.from(e).getPublicUrl("").data.publicUrl,n=t.replace(r,"");if(!n){console.error("Could not extract file path from URL:",t);return}const{error:a}=await Q.storage.from(e).remove([n]);if(a)throw console.error("Error deleting file:",a),new Error(`File deleti
1199on failed: ${a.message}`)}catch(r){throw console.error("Error in deleteFileByUrl:",r),r}},BFe="event-images",LFe={uploadFile:PFe,deleteFileByUrl:RFe},zD=["image/jpeg","image/jpg","image/png"],IFe=2*1024*1024,OFe=({isOpen:t,onClose:e,onSubmit:r,formData:n,onChange:a})=>{const[i,o]=Oe.useState(null),[l,c]=Oe.useState(""),[u,d]=Oe.useState(!1),[h,f]=Oe.useState("upload"),[m,g]=Oe.useState(null),y=async j=>{if(g(null),!j.target.files||j.target.files.length===0)return;const N=j.target.files[0];if(!zD.includes(N.type)){g("Please upload only JPG or PNG image files.");return}if(N.size>IFe){g("Image must be less than 2MB.");return}o(N),c(URL.createObjectURL(N)),h==="upload"&&a({target:{name:"imageUrl",value:""}})};Oe.useEffect(()=>{(async()=>{if(i&&h==="upload"){d(!0);try{const N=await LFe.uploadFile(i,BFe);a({target:{name:"imageUrl",value:N}})}catch{g("Failed to upload image.")}finally{d(!1)}}})()},[i,h]);const b=j=>{a(j),j.target.value&&i&&(o(null),c(""))},w=async j=>{var N,S;if(j.preventDefault(),!((N=n.title)!=null&&N.trim())){alert("Please enter an event title");return}if(!n.date){alert("Please select a date");return}if(!n.time){alert("Please select a time");return}if(!n.endTime){alert("Please select an end time");return}if(!((S=n.location)!=null&&S.trim())){alert("Please enter a location");return}try{await r()}catch{alert("Error submitting form. Please try again.")}};return s.jsx(Tt,{open:t,onOpenChange:j=>!j&&e(),children:s.jsxs(Dt,{className:"sm:max-w-[500px] max-h-[90vh] overflow-y-auto",children:[s.jsx(It,{children:s.jsx(Ot,{children:"Create New Event"})}),s.jsxs("form",{onSubmit:w,children:[s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"title",children:"Event Title *"}),s.jsx(Ne,{id:"title",name:"title",value:n.title||"",onChange:a,required:!0,placeholder:"Enter event title"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"date",children:"Date *"}),s.jsx(Ne,{id:"date",name:"date",type:"date",value:n.date,onChange:a,required:!0,min:new Date().toISOString().split("T")[0]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"time",children:"Start Time *"}),s.jsx(Ne,{id:"time",name:"time",type:"time",value:n.time,onChange:a,required:!0})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"endTime",children:"End Time *"}),s.jsx(Ne,{id:"endTime",name:"endTime",type:"time",value:n.endTime,onChange:a,required:!0})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"location",children:"Location *"}),s.jsx(Ne,{id:"location",name:"location",value:n.location||"",onChange:a,required:!0,placeholder:"Enter event location"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{children:"Event Image"}),s.jsxs("div",{className:"flex gap-2 mb-2",children:[s.jsx("button",{type:"button",className:`px-2 py-1 rounded ${h==="upload"?"bg-primary text-white":"bg-muted"}`,onClick:()=>f("upload"),disabled:u,children:"Upload"}),s.jsx("button",{type:"button",className:`px-2 py-1 rounded ${h==="url"?"bg-primary text-white":"bg-muted"}`,onClick:()=>f("url"),disabled:u,children:"URL"})]}),h==="upload"?s.jsxs(s.Fragment,{children:[s.jsx(Ne,{id:"eventImageUpload",name:"eventImageUpload",type:"file",accept:zD.join(","),onChange:y,disabled:u}),u&&s.jsx("div",{className:"text-xs text-gray-500",children:"Uploading..."})]}):s.jsx(Ne,{id:"imageUrl",name:"imageUrl",value:n.imageUrl||"",onChange:b,placeholder:"Enter image URL (optional)",disabled:u}),m&&s.jsx("div",{className:"text-xs text-red-500",children:m}),(l||n.imageUrl)&&s.jsx("div",{className:"mt-2",children:s.jsx("img",{src:l||n.imageUrl,alt:"Event preview",className:"w-32 h-32 object-cover border rounded"})}),s.jsx("div",{className:"text-xs text-gray-500",children:"JPG or PNG, max 2MB. Leave blank to use default image."})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"description",children:"Description"}),s.jsx(zt,{id:"description",name:"description",value:n.description||"",onChange:a,rows:3,placeholder:"Enter event description (optional)"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"organizationName",children:"Organization/Host"}),s.jsx(Ne,{id:"organizationName",name:"organizationName",value:n.organizationName||"",onChange:a,placeholder:"Organization or business name"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"eventType",children:"Event Type"}),s.jsxs(Wt,{value:n.eventType||"",onValueChange:j=>a({target:{name:"eventType",value:j}}),children:[s.jsx(Ht,{children:s.jsx(qt,{placeholder:"Select event type"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"conference",children:"Conference"}),s.jsx(Ae,{value:"workshop",children:"Workshop"}),s.jsx(Ae,{value:"seminar",children:"Seminar"}),s.jsx(Ae,{value:"networking",children:"Networking"}),s.jsx(Ae,{value:"fundraiser",children:"Fundraiser"}),s.jsx(Ae,{value:"social",children:"Social Event"}),s.jsx(Ae,{value:"educational",children:"Educational"}),s.jsx(Ae,{value:"community",children:"Community Event"}),s.jsx(Ae,{value:"business",children:"Business Event"}),s.jsx(Ae,{value:"other",children:"Other"})]})]})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"ticketPrice",children:"Ticket Price"}),s.jsx(Ne,{id:"ticketPrice",name:"ticketPrice",type:"number",min:"0",step:"0.01",value:n.ticketPrice||"",onChange:a,placeholder:"0.00 (leave blank if free)"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"eventWebsite",children:"Event Website"}),s.jsx(Ne,{id:"eventWebsite",name:"eventWebsite",type:"url",value:n.eventWebsite||"",onChange:a,placeholder:"https://..."})]})]}),s.jsxs("div",{className:"border-t pt-4",children:[s.jsx("h3",{className:"text-sm font-semibold mb-3",children:"Contact Information"}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"contactName",children:"Contact Name"}),s.jsx(Ne,{id:"contactName",name:"contactName",value:n.contactName||"",onChange:a,placeholder:"Contact person name"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"contactPhone",children:"Contact Phone"}),s.jsx(Ne,{id:"contactPhone",name:"contactPhone",value:n.contactPhone||"",onChange:a,placeholder:"(555) 123-4567"})]})]}),s.jsxs("div",{className:"grid gap-2 mt-4",children:[s.jsx(Z,{htmlFor:"contactEmail",children:"Contact Email"}
1199),s.jsx(Ne,{id:"contactEmail",name:"contactEmail",type:"email",value:n.contactEmail||"",onChange:a,placeholder:"[email protected]"})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"additionalInfo",children:"Additional Information"}),s.jsx(zt,{id:"additionalInfo",name:"additionalInfo",value:n.additionalInfo||"",onChange:a,rows:2,placeholder:"Any additional details, special requirements, accessibility information, etc."})]}),s.jsxs("div",{className:"border-t pt-4",children:[s.jsx("h3",{className:"text-sm font-semibold mb-3",children:"Admin Settings"}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Wl,{id:"isFeatured",checked:n.isFeatured||!1,onCheckedChange:j=>a({target:{name:"isFeatured",value:j}})}),s.jsx(Z,{htmlFor:"isFeatured",className:"text-sm font-medium",children:"Featured Event"})]}),s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Featured events will be displayed on the home page"})]}),s.jsx("div",{className:"text-xs text-gray-500",children:"Fields marked with * are required"})]}),s.jsxs(Sr,{children:[s.jsx(Y,{type:"button",variant:"outline",onClick:e,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:u,children:"Create Event"})]})]})]})})},zFe=({isOpen:t,onClose:e,onSubmit:r,formData:n,onChange:a})=>{const i=async o=>{o.preventDefault(),await r()};return s.jsx(Tt,{open:t,onOpenChange:o=>!o&&e(),children:s.jsxs(Dt,{className:"sm:max-w-[500px] max-h-[90vh] overflow-y-auto",children:[s.jsx(It,{children:s.jsx(Ot,{children:"Edit Event"})}),s.jsxs("form",{onSubmit:i,children:[s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"title",children:"Event Title *"}),s.jsx(Ne,{id:"title",name:"title",value:n.title||"",onChange:a,required:!0})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"organizationName",children:"Organization/Host"}),s.jsx(Ne,{id:"organizationName",name:"organizationName",value:n.organizationName||"",onChange:a,placeholder:"Organization or business name"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"eventType",children:"Event Type"}),s.jsxs(Wt,{value:n.eventType||"",onValueChange:o=>a({target:{name:"eventType",value:o}}),children:[s.jsx(Ht,{children:s.jsx(qt,{placeholder:"Select event type"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"conference",children:"Conference"}),s.jsx(Ae,{value:"workshop",children:"Workshop"}),s.jsx(Ae,{value:"seminar",children:"Seminar"}),s.jsx(Ae,{value:"networking",children:"Networking"}),s.jsx(Ae,{value:"fundraiser",children:"Fundraiser"}),s.jsx(Ae,{value:"social",children:"Social Event"}),s.jsx(Ae,{value:"educational",children:"Educational"}),s.jsx(Ae,{value:"community",children:"Community Event"}),s.jsx(Ae,{value:"business",children:"Business Event"}),s.jsx(Ae,{value:"other",children:"Other"})]})]})]})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"date",children:"Date *"}),s.jsx(Ne,{id:"date",name:"date",type:"date",value:n.date||"",onChange:a,required:!0})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"time",children:"Start Time *"}),s.jsx(Ne,{id:"time",name:"time",type:"time",value:n.time||"",onChange:a,required:!0})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"endTime",children:"End Time *"}),s.jsx(Ne,{id:"endTime",name:"endTime",type:"time",value:n.endTime||"",onChange:a,required:!0})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"location",children:"Location *"}),s.jsx(Ne,{id:"location",name:"location",value:n.location||"",onChange:a,required:!0,placeholder:"Enter full address"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"ticketPrice",children:"Ticket Price"}),s.jsx(Ne,{id:"ticketPrice",name:"ticketPrice",type:"number",min:"0",step:"0.01",value:n.ticketPrice||"",onChange:a,placeholder:"0.00 (leave blank if free)"})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"description",children:"Description *"}),s.jsx(zt,{id:"description",name:"description",value:n.description||"",onChange:a,rows:3,placeholder:"Describe the event..."})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"eventWebsite",children:"Event Website"}),s.jsx(Ne,{id:"eventWebsite",name:"eventWebsite",type:"url",value:n.eventWebsite||"",onChange:a,placeholder:"https://..."})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"imageUrl",children:"Image URL"}),s.jsx(Ne,{id:"imageUrl",name:"imageUrl",value:n.imageUrl||"",onChange:a,placeholder:"Enter image URL (optional)"}),s.jsx("div",{className:"text-xs text-gray-500",children:"Leave blank to use default image"})]}),s.jsxs("div",{className:"border-t pt-4",children:[s.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Contact Information"}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"contactName",children:"Contact Name"}),s.jsx(Ne,{id:"contactName",name:"contactName",value:n.contactName||"",onChange:a,placeholder:"Contact person name"})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"contactPhone",children:"Contact Phone"}),s.jsx(Ne,{id:"contactPhone",name:"contactPhone",value:n.contactPhone||"",onChange:a,placeholder:"(555) 123-4567"})]})]}),s.jsxs("div",{className:"grid gap-2 mt-4",children:[s.jsx(Z,{htmlFor:"contactEmail",children:"Contact Email"}
1199),s.jsx(Ne,{id:"contactEmail",name:"contactEmail",type:"email",value:n.contactEmail||"",onChange:a,placeholder:"[email protected]"})]})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"additionalInfo",children:"Additional Information"}),s.jsx(zt,{id:"additionalInfo",name:"additionalInfo",value:n.additionalInfo||"",onChange:a,rows:2,placeholder:"Any additional details, special requirements, accessibility information, etc."})]}),s.jsxs("div",{className:"border-t pt-4",children:[s.jsx("h3",{className:"text-lg font-semibold mb-3",children:"Admin Controls"}),s.jsx("div",{className:"grid grid-cols-2 gap-4",children:s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"approvalStatus",children:"Approval Status"}),s.jsxs(Wt,{value:n.approvalStatus||"pending",onValueChange:o=>a({target:{name:"approvalStatus",value:o}}),children:[s.jsx(Ht,{children:s.jsx(qt,{placeholder:"Select status"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"pending",children:"Pending"}),s.jsx(Ae,{value:"approved",children:"Approved"}),s.jsx(Ae,{value:"rejected",children:"Rejected"})]})]})]})}),s.jsxs("div",{className:"flex items-center space-x-2 mt-4",children:[s.jsx(Wl,{id:"isFeatured",checked:n.isFeatured||!1,onCheckedChange:o=>a({target:{name:"isFeatured",value:o}})}),s.jsx(Z,{htmlFor:"isFeatured",className:"text-sm font-medium",children:"Featured Event"})]}),s.jsx("p",{className:"text-xs text-gray-500 mt-1 mb-4",children:"Featured events will be displayed on the home page"}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Z,{htmlFor:"adminNotes",children:"Admin Notes"}),s.jsx(zt,{id:"adminNotes",name:"adminNotes",value:n.adminNotes||"",onChange:a,rows:2,placeholder:"Internal notes for approval/rejection reasons..."})]})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{type:"button",variant:"outline",onClick:e,children:"Cancel"}),s.jsx(Y,{type:"submit",children:"Save Changes"})]})]})]})})},UFe=({selectedEvents:t,isDeletingMultiple:e,handleDeleteSelected:r,openCreateModal:n})=>{const a=t.length;return s.jsxs("div",{className:"flex flex-wrap items-center gap-2 w-full sm:w-auto",children:[a>0&&s.jsx(Y,{variant:"destructive",size:"sm",onClick:r,disabled:e,className:"flex items-center gap-1 shrink-0",children:e?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"h-4 w-4 animate-spin"}),s.jsx("span",{children:"Deleting..."})]}):s.jsxs(s.Fragment,{children:[s.jsx(vr,{className:"h-4 w-4"}),s.jsxs("span",{children:["Delete ",a," ",a===1?"Event":"Events"]})]})}),s.jsxs(Y,{onClick:n,size:"sm",className:"flex items-center gap-1 shrink-0",children:[s.jsx(vs,{className:"h-4 w-4"}),s.jsx("span",{children:"Create Event"})]})]})},HFe=()=>{const[t,e]=x.useState("upcoming"),[r,n]=x.useState(!1),[a,i]=x.useState([]),[o,l]=x.useState([]),[c,u]=x.useState([]),[d,h]=x.useState(Date.now()),f=x.useCallback(()=>{h(Date.now())},[]),m=x.useCallback(async()=>{console.log("â³ [useEventList] Fetching events..."),n(!0);try{const y=await Mf({upcoming:!0,limit:100,includeUnapproved:!0});console.log(`ð [useEventList] Fetched ${y.events.length} upcoming events`),i(y.events);const b=await Mf({upcoming:!1,limit:100,includeUnapproved:!0});console.log(`ð [useEventList] Fetched ${b.events.length} past events`),l(b.events);const w=await Mf({approval_status:"pending",limit:100,includeUnapproved:!0});console.log(`ð [useEventList] Fetched ${w.events.length} pending events`),u(w.events)}catch(y){console.error("â [useEventList] Error fetching events:",y),ct.error("Failed to load events")}finally{n(!1)}},[]);return x.useEffect(()=>{m()},[m,d]),x.useEffect(()=>{console.log(`ð¦ [useEventList] State Updated: ${a.length} upcoming, ${o.length} past, ${c.length} pending. Timestamp: ${d}`)},[a,o,c,d]),{activeTab:t,setActiveTab:e,isLoading:r,upcomingEvents:a,pastEvents:o,pendingEvents:c,currentEvents:t==="upcoming"?a:t==="past"?o:c,fetchEvents:m,refreshTimestamp:d,forceRefresh:f}},O7=()=>{const t=()=>{const c=new Date,u=c.getFullYear(),d=String(c.getMonth()+1).padStart(2,"0"),h=String(c.getDate()).padStart(2,"0");return`${u}-${d}-${h}`},e=()=>{const c=new Date;return c.setMinutes(0),c.setHours(c.getHours()+1),`${String(c.getHours()).padStart(2,"0")}:00`},r=()=>{const c=new Date;return c.setMinutes(0),c.setHours(c.getHours()+3),`${String(c.getHours()).padStart(2,"0")}:00`},[n,a]=x.useState({title:"",date:t(),time:e(),endTime:r(),location:"",description:"",imageUrl:"",contactName:"",contactEmail:"",contactPhone:"",organizationName:"",eventWebsite:"",additionalInfo:"",ticketPrice:"",eventType:"",approvalStatus:"approved",adminNotes:"",isFeatured:!1}),i=x.useCallback(c=>{const{name:u,value:d}=c.target;console.log(`Field '${u}' changed to: '${d}'`),a(h=>({...h,[u]:d}))},[]),o=x.useCallback(()=>{const c={title:"",date:t(),time:e(),endTime:r(),location:"",description:"",imageUrl:"",contactName:"",contactEmail:"",contactPhone:"",organizationName:"",eventWebsite:"",additionalInfo:"",ticketPrice:"",eventType:"",approvalStatus:"approved",adminNotes:"",isFeatured:!1};console.log("Resetting form data to defaults:",c),a(c)},[]),l=x.useCallback(c=>{const u=c.date.split(", "),d=u[1]+" "+u[2],h=new Date(d),f=c.time.split(" - "),m=f[0],g=f[1],y=N=>{const[S,E]=N.split(" ");let[C,T]=S.split(":").map(Number);return E.toLowerCase()==="pm"&&C<12?C+=12:E.toLowerCase()==="am"&&C===12&&(C=0),`${String(C).padStart(2,"0")}
1199:${String(T).padStart(2,"0")}`},b=y(m),w=y(g),j={title:c.title,date:Cs(h,"yyyy-MM-dd"),time:b,endTime:w,location:c.location,description:c.description||"",imageUrl:c.imageUrl||"",contactName:c.contact_name||"",contactEmail:c.contact_email||"",contactPhone:c.contact_phone||"",organizationName:c.organization_name||"",eventWebsite:c.event_website||"",additionalInfo:c.additional_info||"",ticketPrice:c.ticket_price?c.ticket_price.toString():"",eventType:c.event_type||"",approvalStatus:c.approval_status||"approved",adminNotes:c.admin_notes||"",isFeatured:c.is_featured||!1};console.log("Setting form data from event:",j),a(j)},[]);return{formData:n,setFormData:a,handleInputChange:i,resetFormData:o,setFormDataFromEvent:l}},$Fe=(t,e)=>{const[r,n]=x.useState(!1),a=x.useCallback(async()=>{console.log("ð [useEventActions] No fetchEvents provided, using default empty implementation")},[]),i=x.useCallback(()=>{console.log("ð [useEventActions] No forceRefresh provided, using default empty implementation")},[]),o=(e==null?void 0:e.fetchEvents)||a,l=(e==null?void 0:e.forceRefresh)||i,c=x.useCallback(async()=>{var m,g,y,b,w,j,N,S,E,C,T,D,A;console.log("ð [useEventActions] Creating new event with form data:",t),console.log("ð Form data properties:",Object.keys(t)),console.log("ð Title property type:",typeof t.title),console.log("ð Title length:",(m=t.title)==null?void 0:m.length),console.log("ð Title exact value:",JSON.stringify(t.title));try{if(!t.title)return console.error("â [useEventActions] Missing title - title is undefined or null"),ct.error("Please provide a title for the event"),!1;if(typeof t.title!="string")return console.error(`â [useEventActions] Title is not a string, but ${typeof t.title}`),ct.error("Title has incorrect type"),!1;if(t.title.trim()==="")return console.error("â [useEventActions] Title is empty string after trimming"),ct.error("Please provide a non-empty title for the event"),!1;if(!t.location||t.location.trim()==="")return console.error("â [useEventActions] Missing location for event creation"),ct.error("Please provide a location for the event"),!1;if(console.log(`Title: '${t.title}', Location: '${t.location}'`),console.log(`Raw Date: '${t.date}', Raw Time: '${t.time}', Raw End Time: '${t.endTime}'`),console.log(`Date type: ${typeof t.date}, Time type: ${typeof t.time}`),console.log(`Date length: ${((g=t.date)==null?void 0:g.length)||0}, Time length: ${((y=t.time)==null?void 0:y.length)||0}`),console.log(`Image URL: '${t.imageUrl}'`),!t.date||t.date.trim()==="")return console.error("â [useEventActions] Missing date for event creation"),ct.error("Please provide a date for the event"),!1;if(!t.time||t.time.trim()==="")return console.error("â [useEventActions] Missing time for event creation"),ct.error("Please provide a start time for the event"),!1;if(!t.endTime||t.endTime.trim()==="")return console.error("â [useEventActions] Missing end time for event creation"),ct.error("Please provide an end time for the event"),!1;let R,M;if(t.date.match(/^\d{4}-\d{2}-\d{2}$/)){const[V,G,B]=t.date.split("-").map(Number);if(t.time.match(/^\d{1,2}:\d{2}$/)){const $=t.time.split(":"),W=parseInt($[0],10),oe=parseInt($[1],10);R=new Date(V,G-1,B,W,oe,0),console.log(`Parsed start date: ${R.toISOString()}`)}else return console.error("â [useEventActions] Invalid start time format",t.time),ct.error("Invalid start time format. Please use H
1199H:MM format"),!1;if(t.endTime.match(/^\d{1,2}:\d{2}$/)){const $=t.endTime.split(":"),W=parseInt($[0],10),oe=parseInt($[1],10);M=new Date(V,G-1,B,W,oe,0),console.log(`Parsed end date: ${M.toISOString()}`),M<R&&(console.log("End time is before start time, assuming next day"),M.setDate(M.getDate()+1))}else return console.error("â [useEventActions] Invalid end time format",t.endTime),ct.error("Invalid end time format. Please use HH:MM format"),!1}else return console.error("â [useEventActions] Invalid date format",t.date),ct.error("Invalid date format. Please use YYYY-MM-DD format"),!1;if(isNaN(R.getTime())||isNaN(M.getTime()))return console.error("â [useEventActions] Invalid date created from inputs"),ct.error("Couldn't create valid dates from the inputs provided"),!1;console.log(`Creating event with start date: ${R.toISOString()}, end date: ${M.toISOString()}`);const U={title:t.title.trim(),description:((b=t.description)==null?void 0:b.trim())||"No description provided",location:t.location.trim(),start_date:R.toISOString(),end_date:M.toISOString(),is_featured:t.isFeatured||!1,image_url:((w=t.imageUrl)==null?void 0:w.trim())||"https://images.unsplash.com/photo-1511795409834-ef04bbd61622?w=800&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8M3x8ZXZlbnR8ZW58MHx8MHx8fDA%3D",contact_name:((j=t.contactName)==null?void 0:j.trim())||null,contact_email:((N=t.contactEmail)==null?void 0:N.trim())||null,contact_phone:((S=t.contactPhone)==null?void 0:S.trim())||null,organization_name:((E=t.organizationName)==null?void 0:E.trim())||null,event_website:((C=t.eventWebsite)==null?void 0:C.trim())||null,additional_info:((T=t.additionalInfo)==null?void 0:T.trim())||null,ticket_price:t.ticketPrice?parseFloat(t.ticketPrice):null,event_type:((D=t.eventType)==null?void 0:D.trim())||null,approval_status:t.approvalStatus||"approved",admin_notes:((A=t.adminNotes)==null?void 0:A.trim())||null};console.log("Event data to insert:",U);const{data:I,error:O}=await Q.from("events").insert([U]).select();return O?(console.error("â [useEventActions] Error creating event:",O),ct.error("Failed to create event: "+O.message),!1):(console.log("â
[useEventActions] Event created successfully:",I),ct.success("Event created successfully!"),await o(),l(),!0)}catch(R){const M=R;return console.error("â [useEventActions] Error creating event:",M.message,M.stack),ct.error(`Failed to create event: ${M.message}`),!1}},[t,o,l]),u=x.useCallback(async m=>{var g,y,b,w,j,N,S,E,C,T;if(!m)return console.error("â [useEventActions] No event ID provided for update"),ct.error("Failed to update: No event selected"),!1;console.log(`ð [useEventActions] Updating event ${m}:`,t);try{if(!t.title||t.title.trim()==="")return console.error("â [useEventActions] Missing title for event update"),ct.error("Please provide a title for the event"),!1;if(!t.location||t.location.trim()==="")return console.error("â [useEventActions] Missing location for event update"),ct.error("Please provide a location for the event"),!1;console.log(`Raw Date: '${t.date}', Raw Start Time: '${t.time}', Raw End Time: '${t.endTime}'`),console.log(`Image URL: '${t.imageUrl}'`);let D,A;if(t.date.match(/^\d{4}-\d{2}-\d{2}$/)){const[P,U,I]=t.date.split("-").map(Number);if(t.time.match(/^\d{1,2}:\d{2}$/)){const O=t.time.split(":"),V=parseInt(O[0],10),G=parseInt(O[1],10);D=new Date(P,U-1,I,V,G,0),console.log(`Parsed start date: ${D.toISOString()}`)}else return console.error("â [useEventActions] Invalid start time format",t.time),ct.error("Invalid start time format. Please use H
1199H:MM format"),!1;if(t.endTime.match(/^\d{1,2}:\d{2}$/)){const O=t.endTime.split(":"),V=parseInt(O[0],10),G=parseInt(O[1],10);A=new Date(P,U-1,I,V,G,0),console.log(`Parsed end date: ${A.toISOString()}`),A<D&&(console.log("End time is before start time, assuming next day"),A.setDate(A.getDate()+1))}else return console.error("â [useEventActions] Invalid end time format",t.endTime),ct.error("Invalid end time format. Please use HH:MM format"),!1}else return console.error("â [useEventActions] Invalid date format",t.date),ct.error("Invalid date format. Please use YYYY-MM-DD format"),!1;if(isNaN(D.getTime())||isNaN(A.getTime()))return console.error("â [useEventActions] Invalid date created from inputs"),ct.error("Couldn't create valid dates from the inputs provided"),!1;const R="https://images.unsplash.com/photo-1511795409834-ef04bbd61622?w=800&auto=format&fit=crop&q=60&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxzZWFyY2h8M3x8ZXZlbnR8ZW58MHx8MHx8fDA%3D",{error:M}=await Q.from("events").update({title:t.title.trim(),description:((g=t.description)==null?void 0:g.trim())||"No description provided",location:t.location.trim(),start_date:D.toISOString(),end_date:A.toISOString(),image_url:((y=t.imageUrl)==null?void 0:y.trim())||R,contact_name:((b=t.contactName)==null?void 0:b.trim())||null,contact_email:((w=t.contactEmail)==null?void 0:w.trim())||null,contact_phone:((j=t.contactPhone)==null?void 0:j.trim())||null,organization_name:((N=t.organizationName)==null?void 0:N.trim())||null,event_website:((S=t.eventWebsite)==null?void 0:S.trim())||null,additional_info:((E=t.additionalInfo)==null?void 0:E.trim())||null,ticket_price:t.ticketPrice?parseFloat(t.ticketPrice):null,event_type:((C=t.eventType)==null?void 0:C.trim())||null,approval_status:t.approvalStatus||"approved",admin_notes:((T=t.adminNotes)==null?void 0:T.trim())||null,is_featured:t.isFeatured||!1}).eq("id",m);return M?(console.error("â [useEventActions] Error updating event:",M),ct.error("Failed to update event: "+M.message),!1):(console.log("â
[useEventActions] Event updated successfully"),ct.success("Event updated successfully!"),await o(),l(),!0)}catch(D){return console.error("â [useEventActions] Error updating event:",D),ct.error("Failed to update event due to an unexpected error"),!1}},[t,o,l]),d=x.useCallback(async(m,g)=>{if(!m||!m.id)return console.error("â [useEventActions] No valid event provided for deletion"),ct.error("Failed to delete: No valid event selected"),!1;console.log(`ðï¸ [useEventActions] Deleting event ${m.id}: ${m.title}`),n(!0);try{const{error:y}=await Q.from("events").delete().eq("id",m.id);return y?(console.error("â [useEventActions] Error deleting event:",y),ct.error("Failed to delete event: "+y.message),!1):(console.log("â
[useEventActions] Event deleted successfully"),ct.success(`Event "${m.title}" deleted successfully`),g!=null&&g.fetchEvents?await g.fetchEvents():(await o(),l()),!0)}catch(y){return console.error("â [useEventActions] Error deleting event:",y),ct.error("Failed to delete event due to an unexpected error"),!1}finally{n(!1)}},[o,l]),h=x.useCallback(async m=>{console.log("â¡ [useEventActions] Approving event:",m.id);try{const g={id:m.id,approval_status:"approved"};return await h5(g),console.log("â
[useEventActions] Event approved successfully:",m.id),ct.success("Event approved successfully!"),await o(),l(),!0}catch(g){const y=g;return console.error("â [useEventActions] Error approving event:",y.message,y.stack),ct.error(`Failed to approve event: ${y.message}`),!1}},[o,l]),f=x.useCallback(async(m,g)=>{console.log("â¡ [useEventActions] Rejecting event:",m.id,"Reason:",g);try{const y={id:m.id,approval_status:"rejected",admin_notes:g};return await h5(y),console.log("â
[useEventActions] Event rejected successfully:",m.id),ct.success("Event rejected"),await o(),l(),!0}catch(y){const b=y;return console.error("â [useEventActions] Error rejecting event:",b.message,b.stack),ct.error(`Failed to reject event: ${b.message}`),!1}},[o,l]);return{handleCreateEvent:c,handleUpdateEvent:u,handleDeleteEvent:d,handleApproveEvent:h,handleRejectEvent:f,isDeletingEvent:r,fetchEvents:o,forceRefresh:l}},WFe=({activeTab:t,fetchEvents:e,handleDeleteEvent:r})=>{const[n,a]=x.useState([]),[i,o]=x.useState(!1);x.useEffect(()=>{a([])},[t]);const l=x.useCallback((d,h)=>{a(f=>h?[...f,d]:f.filter(m=>m!==d))},[]),c=x.useCallback((d,h)=>{a(d?h.map(f=>f.id):[])},[]),u=x.useCallback(async d=>
1199{if(n.length===0){ct.error("No events selected for deletion");return}if(confirm(`Are you sure you want to delete ${n.length} events?`)){o(!0);try{let h=0,f=0;const m=d.filter(g=>n.includes(g.id));for(const g of m)await r(g)?h++:f++;h>0&&ct.success(`Successfully deleted ${h} events`),f>0&&ct.error(`Failed to delete ${f} events`),a([]),await e()}catch(h){console.error("Error in bulk delete:",h),ct.error("An unexpected error occurred during bulk delete")}finally{o(!1)}}},[n,r,e]);return{selectedEvents:n,isDeletingMultiple:i,handleSelectEvent:l,handleSelectAll:c,handleDeleteSelected:u}},qFe=()=>{const[t,e]=x.useState(null),[r,n]=x.useState(!1),[a,i]=x.useState(!1),[o,l]=x.useState(!1),{resetFormData:c,setFormDataFromEvent:u}=O7(),d=x.useCallback(()=>{console.log("Opening create modal - resetting form"),c(),n(!0)},[c]),h=x.useCallback(y=>{console.log("Opening edit modal for event:",y),e(y),u(y),i(!0)},[u]),f=x.useCallback(y=>{console.log("Opening delete modal for event:",y),e(y),l(!0)},[]),m=x.useCallback(()=>{l(!1)},[]),g=x.useCallback(()=>{e(null)},[]);return{selectedEvent:t,setSelectedEvent:e,isCreateModalOpen:r,setIsCreateModalOpen:n,isEditModalOpen:a,setIsEditModalOpen:i,isDeleteModalOpen:o,setIsDeleteModalOpen:l,openCreateModal:d,openEditModal:h,openDeleteModal:f,closeDeleteModal:m,clearSelectedEvent:g}},GFe=()=>{const{activeTab:t,setActiveTab:e,isLoading:r,upcomingEvents:n,pastEvents:a,pendingEvents:i,fetchEvents:o,refreshTimestamp:l,forceRefresh:c}=HFe(),{formData:u,handleInputChange:d,resetFormData:h,setFormDataFromEvent:f}=O7(),{handleCreateEvent:m,handleUpdateEvent:g,handleDeleteEvent:y,handleApproveEvent:b,handleRejectEvent:w}=$Fe(u,{fetchEvents:o,forceRefresh:c}),{selectedEvent:j,isCreateModalOpen:N,setIsCreateModalOpen:S,isEditModalOpen:E,setIsEditModalOpen:C,openCreateModal:T,openEditModal:D}=qFe(),A=x.useCallback(async W=>{try{return await y(W,{fetchEvents:async()=>{await o()}})?(c(),!0):!1}catch{return ct.error("An unexpected error occurred during deletion"),!1}},[y,o,c]),R=t==="upcoming"?n:t==="past"?a:i,{selectedEvents:M,isDeletingMultiple:P,handleSelectEvent:U,handleSelectAll:I,handleDeleteSelected:O}=WFe({activeTab:t,fetchEvents:o,handleDeleteEvent:y}),V=x.useCallback(async W=>await b(W),[b]),G=x.useCallback(async(W,oe)=>await w(W,oe),[w]),B=()=>O(R),$=W=>I(W,R);return s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[s.jsx("h1",{className:"text-xl sm:text-2xl font-bold",children:"Event Management"}),s.jsx(UFe,{selectedEvents:M,isDeletingMultiple:P,handleDeleteSelected:B,openCreateModal:T})]}),s.jsx(MFe,{activeTab:t,setActiveTab:e,upcomingEvents:n,pastEvents:a,pendingEvents:i,isLoading:r,onEdit:W=>{D(W),f(W)},onDelete:A,onApprove:V,onReject:G,selectedEvents:M,onSelectEvent:U,onSelectAll:$,refreshTimestamp:l,config:{}},`events-container-${l}`),s.jsx(OFe,{isOpen:N,onClose:()=>{S(!1),h()},onSubmit:async()=>{await m()&&(S(!1),h())},formData:u,onChange:d}),s.jsx(zFe,{isOpen:E,onClose:()=>{C(!1),h()},onSubmit:async()=>{await g(j==null?void 0:j.id)&&(C(!1),h())},formData:u,onChange:d})]})},DN=t=>t.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-"),VFe=({open:t,onOpenChange:e,category:r,onSubmit:n,isSubmitting:a})=>{const[i,o]=x.useState(""),[l,c]=x.useState(""),[u,d]=x.useState("");x.useEffect(()=>{r?(o(r.name),c(r.slug),d(r.description||"")):(o(""),c(""),d(""))},[r,t]);const h=m=>{const g=m.target.value;o(g),(!l||l===DN(i))&&c(DN(g))},f=m=>{m.preventDefault(),i&&n({name:i,slug:l||DN(i),description:u})};return s.jsx(Tt,{open:t,onOpenChange:e,children:s.jsxs(Dt,{className:"max-h-[90vh] overflow-y-auto",children:[s.jsx(It,{children:s.jsx(Ot,{children:r?"Edit Category":"Add Category"})}),s.jsxs("form",{onSubmit:f,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"name",children:"Name *"}),s.jsx(Ne,{id:"name",value:i,onChange:h,required:!0,placeholder:"Category name"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"slug",children:"Slug *"}
1199),s.jsx(Ne,{id:"slug",value:l,onChange:m=>c(m.target.value),required:!0,placeholder:"category-slug"}),s.jsx("p",{className:"text-xs text-gray-500",children:"URL-friendly identifier (auto-generated from name, can be adjusted)."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"description",children:"Description"}),s.jsx(zt,{id:"description",value:u,onChange:m=>d(m.target.value),placeholder:"Brief description of the category",rows:3})]}),s.jsxs(Sr,{children:[s.jsx(Y,{type:"submit",disabled:a,className:"bg-purple-500 hover:bg-purple-600",children:r?"Update Category":"Add Category"}),s.jsx(Dee,{asChild:!0,children:s.jsx(Y,{type:"button",variant:"outline",children:"Cancel"})})]})]})]})})},KFe=({open:t,onOpenChange:e,onConfirm:r,isLoading:n})=>s.jsx(ai,{open:t,onOpenChange:e,children:s.jsxs(Oa,{className:"max-h-[90vh] overflow-y-auto",children:[s.jsxs(za,{children:[s.jsx(Ha,{children:"Delete Category?"}),s.jsx($a,{children:"Are you sure you want to delete this category? This action cannot be undone."})]}),s.jsxs(Ua,{children:[s.jsx(qa,{disabled:n,children:"Cancel"}),s.jsx(Wa,{onClick:r,disabled:n,className:"bg-destructive hover:bg-destructive/90",children:"Delete"})]})]})}),JFe=()=>{const[t,e]=x.useState(""),[r,n]=x.useState(""),[a,i]=x.useState(""),[o,l]=x.useState(null),[c,u]=x.useState(""),d=Su(),[h,f]=x.useState(!1),[m,g]=x.useState(!1),[y,b]=x.useState(null),{data:w,isLoading:j}=kx({queryKey:["admin","categories"],queryFn:Po.getCategories}),N=$l({mutationFn:Po.createCategory,onSuccess:()=>{d.invalidateQueries({queryKey:["admin","categories"]}),ct.success("Category created successfully"),C()},onError:U=>{ct.error("Error creating category"),console.error(U)}}),S=$l({mutationFn:U=>Po.updateCategory(U.id,{name:U.name,slug:U.slug,description:U.description}),onSuccess:()=>{d.invalidateQueries({queryKey:["admin","categories"]}),ct.success("Category updated successfully"),l(null),C()},onError:U=>{ct.error("Error updating category"),console.error(U)}}),E=$l({mutationFn:Po.deleteCategory,onSuccess:()=>{d.invalidateQueries({queryKey:["admin","categories"]}),ct.success("Category deleted successfully")},onError:U=>{ct.error("Error deleting category"),console.error(U)}}),C=()=>{e(""),n(""),i(""),l(null)},T=U=>{b(U),f(!0)},D=()=>{b(null),f(!0)},A=U=>{b(U),g(!0)},R=U=>{y?S.mutate({id:y.id,...U},{onSuccess:()=>f(!1)}):N.mutate(U,{onSuccess:()=>f(!1)})},M=()=>{y&&E.mutate(y.id,{onSuccess:()=>g(!1)})},P=w==null?void 0:w.filter(U=>U.name.toLowerCase().includes(c.toLowerCase())||U.slug.toLowerCase().includes(c.toLowerCase())||U.description&&U.description.toLowerCase().includes(c.toLowerCase()));return N.isPending||S.isPending,s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-xl sm:text-2xl font-bold",children:"Manage Business Categories"}),s.jsx("p",{className:"text-muted-foreground text-sm sm:text-base",children:"Add, edit, or delete the categories that businesses can be assigned to."})]}),s.jsx(Y,{className:"w-full sm:w-auto bg-blue-600 hover:bg-blue-700",onClick:D,children:"Add New Category"}),s.jsx(VFe,{open:h,onOpenChange:f,category:y,onSubmit:R,isSubmitting:N.isPending||S.isPending}),s.jsx(KFe,{open:m,onOpenChange:g,onConfirm:M,isLoading:E.isPending}),s.jsxs("div",{className:"rounded-md border",children:[s.jsxs("div",{className:"p-3 sm:p-4 bg-muted/40 flex flex-col sm:flex-row justify-between gap-3 items-stretch sm:items-center",children:[s.jsx("h2",{className:"text-lg sm:text-xl font-semibold whitespace-nowrap",children:"Categories List"}),s.jsx(Ne,{placeholder:"Search categories...",value:c,onChange:U=>u(U.target.value),className:"w-full sm:max-w-xs"})]}),j?s.jsx("div",{className:"flex justify-center items-center p-8 min-h-[200px] sm:min-h-[300px]",children:s.jsx(Mt,{className:"h-8 w-8 animate-spin text-purple-500"})}):s.jsx(s.Fragment,{children:(P==null?void 0:P.length)===0?s.jsx("div",{className:"text-center py-8 text-muted-foreground text-sm sm:text-base px-4",children:c?"No categories found for your search.":"No categories found. Add one to get started."}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"md:hidden divide-y divide-border",children:P==null?void 0:P.map(U=>s.jsx(De,{className:"rounded-none border-0 shadow-none",children:s.jsxs(Be,{className:"p-4 space-y-2",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium truncate",children:U.name}),s.jsx("p",{className:"text-muted-foreground text-sm truncate",children:U.slug})]}),s.jsxs("div",{className:"flex shrink-0 gap-1",children:[s.jsx(Y,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>T(U),title:"Edit",children:s.jsx(l1,{className:"h-4 w-4"})}),s.jsx(Y,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive/90 hover:bg-destructive/10",onClick:()=>A(U),disabled:E.isPending,title:"Delete",children:s.jsx(vr,{className:"h-4 w-4"})})]})]}),s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:U.description||s.jsx("span",{className:"italic",children:"No description"})})]})},U.id))}),s.jsx("div",{className:"hidden md:block overflow-x-auto",children:s.jsxs(Oi,{children:[s.jsx(zi,{children:s.jsxs(As,{children:[s.jsx(At,{className:"w-[300px]",children:"Name"}),s.jsx(At,{className:"w-[200px]",children:"Slug"}),s.jsx(At,{children:"Description"}),s.jsx(At,{className:"w-[120px] text-right",children:"Actions"})]})}),s.jsx(Ui,{children:P==null?void 0:P.map(U=>s.jsxs(As,{children:[s.jsx(Ct,{className:"font-medium",children:U.name}),s.jsx(Ct,{className:"text-gray-500 text-sm",children:U.slug}),s.jsx(Ct,{className:"max-w-md truncate",children:U.description||s.jsx("span",{className:"text-gray-400 italic",children:"No description"})}),s.jsx(Ct,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(Y,{variant:"ghost",size:"icon",onClick:()=>T(U),title:"Edit",children:s.jsx(l1,{className:"h-4 w-4"})}),s.jsx(Y,{variant:"ghost",size:"icon",onClick:()=>A(U),className:"text-destructive hover:text-destructive/90 hover:bg-destructive/10",disabled:E.isPending,title:"Delete",children:s.jsx(vr,{className:"h-4 w-4"})})]})})]},U.id))})]})})]})})]})]})};class YFe{constructor(){sr(this,"listeners",[])}subscribe(e){return this.listeners.push(e),()=>{this.listeners=this.listeners.filter(r=>r!==e)}}
1199emit(){this.listeners.forEach(e=>e())}}const UD=new YFe,ZFe=()=>{const{toast:t}=St(),[e,r]=x.useState([]),[n,a]=x.useState(!0),[i,o]=x.useState(null),[l,c]=x.useState("all"),[u,d]=x.useState("all"),[h,f]=x.useState(!1),[m,g]=x.useState(""),[y,b]=x.useState(""),[w,j]=x.useState({total:0,inReview:0,notApplicable:0,settled:0});x.useEffect(()=>{N(),S()},[]);const N=async()=>{try{a(!0);const P=await _y.getAllContacts();r(P)}catch(P){console.error("Error loading contacts:",P),t({title:"Error",description:"Failed to load contacts",variant:"destructive"})}finally{a(!1)}},S=async()=>{try{const P=await _y.getContactStats();j(P)}catch(P){console.error("Error loading contact stats:",P)}},E=async()=>{if(i)try{await _y.updateContact(i.id,{status:m,notes:y}),t({title:"Success",description:"Contact updated successfully"}),f(!1),N(),S(),UD.emit()}catch(P){console.error("Error updating contact:",P),t({title:"Error",description:"Failed to update contact",variant:"destructive"})}},C=async P=>{try{await _y.deleteContact(P),t({title:"Success",description:"Contact deleted successfully"}),N(),S(),UD.emit()}catch(U){console.error("Error deleting contact:",U),t({title:"Error",description:"Failed to delete contact",variant:"destructive"})}},T=P=>{o(P),g(P.status),b(P.notes||""),f(!0)},D=P=>{switch(P){case"in-review":return"warning";case"settled":return"success";case"not-applicable":return"secondary";default:return"default"}},A=P=>{const U=jS.find(I=>I.value===P);return(U==null?void 0:U.label)||P},R=P=>{const U=sN.find(I=>I.value===P);return(U==null?void 0:U.label)||P},M=e.filter(P=>{const U=l==="all"||P.status===l,I=u==="all"||P.contact_type===u;return U&&I});return n?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"text-lg",children:"Loading contacts..."})}):s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-xl sm:text-2xl md:text-3xl font-bold",children:"Contact Management"}),s.jsx("p",{className:"text-muted-foreground text-sm sm:text-base",children:"Manage and review contact form submissions"})]}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 sm:gap-4",children:[s.jsxs(De,{children:[s.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2 p-4 sm:p-6",children:[s.jsx(ut,{className:"text-xs sm:text-sm font-medium truncate",children:"Total"}),s.jsx(pw,{className:"h-4 w-4 text-muted-foreground shrink-0"})]}),s.jsx(Be,{className:"px-4 sm:px-6 pb-4 sm:pb-6 pt-0",children:s.jsx("div",{className:"text-lg sm:text-2xl font-bold",children:w.total})})]}),s.jsxs(De,{children:[s.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2 p-4 sm:p-6",children:[s.jsx(ut,{className:"text-xs sm:text-sm font-medium truncate",children:"In Review"}),s.jsx(Xs,{className:"h-4 w-4 text-muted-foreground shrink-0"})]}),s.jsx(Be,{className:"px-4 sm:px-6 pb-4 sm:pb-6 pt-0",children:s.jsx("div",{className:"text-lg sm:text-2xl font-bold text-yellow-600",children:w.inReview})})]}),s.jsxs(De,{children:[s.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2 p-4 sm:p-6",children:[s.jsx(ut,{className:"text-xs sm:text-sm font-medium truncate",children:"Settled"}),s.jsx(Br,{className:"h-4 w-4 text-muted-foreground shrink-0"})]}),s.jsx(Be,{className:"px-4 sm:px-6 pb-4 sm:pb-6 pt-0",children:s.jsx("div",{className:"text-lg sm:text-2xl font-bold text-green-600",children:w.settled})})]}),s.jsxs(De,{children:[s.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2 p-4 sm:p-6",children:[s.jsx(ut,{className:"text-xs sm:text-sm font-medium truncate",children:"N/A"}),s.jsx(ma,{className:"h-4 w-4 text-muted-foreground shrink-0"})]}),s.jsx(Be,{className:"px-4 sm:px-6 pb-4 sm:pb-6 pt-0",children:s.jsx("div",{className:"text-lg sm:text-2xl font-bold text-gray-600",children:w.notApplicable})})]})]}),s.jsxs(De,{children:[s.jsx(ot,{className:"p-4 sm:p-6",children:s.jsx(ut,{className:"text-lg sm:text-xl",children:"Filters"})}),s.jsx(Be,{className:"p-4 sm:p-6 pt-0",children:s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{children:"Status"}),s.jsxs(Wt,{value:l,onValueChange:c,children:[s.jsx(Ht,{children:s.jsx(qt,{placeholder:"Filter by status"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"all",children:"All Statuses"}),sN.map(P=>s.jsx(Ae,{value:P.value,children:P.label},P.value))]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{children:"Contact Type"}),s.jsxs(Wt,{value:u,onValueChange:d,children:[s.jsx(Ht,{children:s.jsx(qt,{placeholder:"Filter by type"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"all",children:"All Types"}),jS.map(P=>s.jsx(Ae,{value:P.value,children:P.label},P.value))]})]})]})]})})]}),s.jsxs(De,{children:[s.jsxs(ot,{className:"p-4 sm:p-6",children:[s.jsxs(ut,{className:"text-lg sm:text-xl",children:["Contacts (",M.length,")"]}),s.jsx(us,{children:"Review and manage contact form submissions"})]}),s.jsx(Be,{className:"p-4 sm:p-6 pt-0",children:M.length===0?s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No contacts found matching the current filters."}):s.jsx("div",{className:"space-y-4",children:M.map(P=>s.jsxs("div",{className:"border rounded-lg p-4 space-y-3",children:[s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{className:"space-y-1 min-w-0 flex-1",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("h3",{className:"font-medium break-words",children:P.name}),s.jsx(ke,{variant:D(P.status),className:"shrink-0",children:R(P.status)}),s.jsx(ke,{variant:"outline",className:"shrink-0",children:A(P.contact_type)})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-sm text-muted-foreground",children:[s.jsxs("span",{className:"flex items-center gap-1 truncate min-w-0",children:[s.jsx(fs,{className:"h-3 w-3 shrink-0"}),s.jsx("span",{className:"truncate",children:P.email})]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Br,{className:"h-3 w-3 shrink-0"}),new Date(P.created_at).toLocaleDateString()]})]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 shrink-0",children:[s.jsxs(Tt,{children:[s.jsx(Aw,{asChild:!0,children:s.jsxs(Y,{variant:"outline",size:"sm",className:"flex-1 sm:flex-initial",children:[s.jsx(Xs,{className:"h-4 w-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"View"})]})}),s.jsxs(Dt,{className:"max-w-[min(100vw-2rem,42rem)] max-h-[90vh] overflow-y-auto p-4 sm:p-6",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Contact Details"}),s.jsx(rr,{children:"Full details of the contact submission"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx(Z,{className:"text-sm font-medium",children:"Name"}),s.jsx("p",{className:"text-sm",children:P.name})]}),s.jsxs("div",{children:[s.jsx(Z,{className:"text-sm font-medium",children:"Email"}),s.jsx("p",{className:"text-sm",children:P.email})]}),s.jsxs("div",{children:[s.jsx(Z,{className:"text-sm font-medium",children:"Contact Type"}),s.jsx("p",{className:"text-sm",children:A(P.contact_type)})]}),s.jsxs("div",{children:[s.jsx(Z,{className:"text-sm font-medium",children:"Status"}),s.jsx("p",{className:"text-sm",children:R(P.status)})]})]}),s.jsxs("div",{children:[s.jsx(Z,{className:"text-sm font-medium",children:"Subject"}),s.jsx("p",{className:"text-sm",children:P.subject})]}),s.jsxs("div",{children:[s.jsx(Z,{className:"text-sm font-medium",children:"Message"}),s.jsx("p",{className:"text-sm whitespace-pre-wrap",children:P.message})]}),P.notes&&s.jsxs("div",{children:[s.jsx(Z,{className:"text-sm font-medium",children:"Admin Notes"}),s.jsx("p",{className:"text-sm whitespace-pre-wrap",children:P.notes})]})]})]})]}),s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>T(P),className:"flex-1 sm:flex-initial",children:[s.jsx(zs,{className:"h-4 w-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Update"})]}),s.jsxs(ai,{children:[s.jsx(rk,{asChild:!0,children:s.jsxs(Y,{variant:"outline",size:"sm",className:"flex-1 sm:flex-initial text-destructive hover:bg-destructive/10",children:[s.jsx(vr,{className:"h-4 w-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Delete"})]})}),s.jsxs(Oa,{className:"max-w-[min(100vw-2rem,28rem)] p-4 sm:p-6",children:[s.jsxs(za,{children:[s.jsx(Ha,{children:"Delete Contact"}),s.jsx($a,{children:"Are you sure you want to delete this contact? This action cannot be undone."})]}),s.jsxs(Ua,{children:[s.jsx(qa,{children:"Cancel"}),s.jsx(Wa,{onClick:()=>C(P.id),className:"bg-red-600 hover:bg-red-700",children:"Delete"})]})]})]})]})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-medium break-words",children:P.subject}),s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 break-words",children:P.message})]})]},P.id))})})]}),s.jsx(Tt,{open:h,onOpenChange:f,children:s.jsxs(Dt,{className:"max-w-[min(100vw-2rem,28rem)] p-4 sm:p-6",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Update Contact"}),s.jsx(rr,{children:"Update the status and add notes for this contact"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{children:"Status"}),s.jsxs(Wt,{value:m,onValueChange:g,children:[s.jsx(Ht,{children:s.jsx(qt,{placeholder:"Select status"})}),s.jsx($t,{children:sN.map(P=>s.jsx(Ae,{value:P.value,children:P.label},P.value))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{children:"Admin Notes"}),s.jsx(zt,{value:y,onChange:P=>b(P.target.value),placeholder:"Add any notes about this contact...",rows:4})]})]}),s.jsxs("div",{className:"flex flex-col-reverse sm:flex-row sm:justify-end gap-2",children:[s.jsx(Y,{variant:"outline",onClick:()=>f(!1),className:"w-full sm:w-auto",children:"Cancel"}),s.jsx(Y,{onClick:E,className:"w-full sm:w-auto",children:"Update Contact"})]})]})})]})},TN=({value:t,onChange:e,disabled:r=!1,label:n="Hero Image",placeholder:a="https://example.com/hero-image.jpg",error:i,imageType:o="main"})=>{const{toast:l}
1199=St(),c=x.useRef(null),[u,d]=x.useState(!1),[h,f]=x.useState(!1),m=()=>{switch(o){case"main":return{recommended:"800x600px or larger",description:"Main background image (landscape orientation recommended)"};case"overlay1":return{recommended:"400x300px or larger",description:"First overlay image (positioned on the right)"};case"overlay2":return{recommended:"400x300px or larger",description:"Second overlay image (positioned at bottom left)"};default:return{recommended:"800x600px or larger",description:"Hero section image"}}},g=async C=>{var T;try{if(d(!0),!C.type.startsWith("image/"))throw new Error("Please select an image file");if(C.size>10*1024*1024)throw new Error("Image size must be less than 10MB");const D=((T=C.name.split(".").pop())==null?void 0:T.toLowerCase())||"jpg",R=`hero-sections/${`hero-${o}-${Date.now()}-${Math.random().toString(36).substring(2)}.${D}`}`,{data:M,error:P}=await Q.storage.from("hero-images").upload(R,C,{cacheControl:"3600",upsert:!1});if(P)throw console.error("Supabase upload error:",P),new Error(P.message||"Failed to upload image");const{data:{publicUrl:U}}=Q.storage.from("hero-images").getPublicUrl(M.path);e(U),l({title:"Success",description:`${n} uploaded successfully`})}catch(D){console.error("Error uploading hero image:",D),l({title:"Upload Error",description:D.message||`Failed to upload ${n.toLowerCase()}`,variant:"destructive"})}finally{d(!1)}},y=C=>{var D;const T=(D=C.target.files)==null?void 0:D[0];T&&g(T)},b=C=>{C.preventDefault(),f(!1);const T=C.dataTransfer.files[0];T&&g(T)},w=C=>{C.preventDefault(),f(!0)},j=C=>{C.preventDefault(),f(!1)},N=()=>{e("")},S=C=>{e(C)},E=m();return s.jsxs("div",{className:"space-y-4",children:[s.jsx(Z,{className:i?"text-red-600":"",children:n}),s.jsxs(sn,{defaultValue:"upload",className:"w-full",children:[s.jsxs(Qs,{className:"grid w-full grid-cols-2",children:[s.jsxs(Gt,{value:"upload",className:"flex items-center gap-2",children:[s.jsx(vn,{className:"h-4 w-4"}),"Upload Image"]}),s.jsxs(Gt,{value:"url",className:"flex items-center gap-2",children:[s.jsx(dp,{className:"h-4 w-4"}),"Image URL"]})]}),s.jsxs(Rt,{value:"upload",className:"space-y-3",children:[s.jsx("div",{className:`border-2 border-dashed rounded-lg p-6 text-center transition-colors ${h?"border-chamber-blue bg-blue-50":i?"border-red-300 bg-red-50":"border-gray-300 hover:border-gray-400"} ${r?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,onDrop:b,onDragOver:w,onDragLeave:j,onClick:()=>{var C;return!r&&!u&&((C=c.current)==null?void 0:C.click())},children:u?s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[s.jsx(Mt,{className:"h-8 w-8 animate-spin text-chamber-blue"}),s.jsxs("p",{className:"text-sm text-gray-600",children:["Uploading ",n.toLowerCase(),"..."]})]}):t?s.jsxs("div",{className:"flex flex-col items-center gap-3",children:[s.jsxs("div",{className:"relative w-48 h-32 bg-gray-100 rounded overflow-hidden",children:[s.jsx("img",{src:t,alt:`${n} preview`,className:"w-full h-full object-cover",onError:C=>{C.currentTarget.style.display="none",C.currentTarget.nextElementSibling.style.display="flex"}}),s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-100 hidden",children:s.jsx(vi,{className:"h-8 w-8 text-gray-400"})}),s.jsx(Y,{type:"button",variant:"destructive",size:"sm",className:"absolute top-2 right-2 h-6 w-6 p-0",onClick:C=>{C.stopPropagation(),N()},children:s.jsx(Ir,{className:"h-3 w-3"})})]}),s.jsxs("div",{className:"text-center",children:[s.jsxs("p",{className:"text-sm font-medium text-gray-900",children:[n," Preview"]}),s.jsx("p",{className:"text-xs text-gray-500",children:"Click to change image"})]})]}):s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[s.jsx(vn,{className:"h-8 w-8 text-gray-400"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Click to upload or drag and drop"}),s.jsx("p",{className:"text-xs text-gray-500",children:"PNG, JPG, WebP up to 10MB"}),s.jsxs("p",{className:"text-xs text-gray-500 mt-1",children:["Recommended: ",E.recommended]}),s.jsx("p",{className:"text-xs text-gray-400 mt-1",children:E.description})]})]})}),s.jsx("input",{ref:c,type:"file",accept:"image/*",onChange:y,className:"hidden",disabled:r||u}),s.jsxs(Y,{type:"button",variant:"outline",onClick:()=>{var C;return(C=c.current)==null?void 0:C.click()},disabled:r||u,className:"w-full",children:[s.jsx(vn,{className:"h-4 w-4 mr-2"}),"Choose ",n]})]}),s.jsxs(Rt,{value:"url",className:"space-y-3",children:[s.jsx(Ne,{value:t,onChange:C=>S(C.target.value),placeholder:a,disabled:r,type:"url",className:i?"border-red-500":""}),s.jsx("p",{className:"text-xs text-gray-500",children:"Enter a direct URL to an image for your hero section"}),s.jsxs("p",{className:"text-xs text-gray-400",children:[E.description," - Recommended: ",E.recommended]})]})]}),i&&s.jsx("p",{className:"text-sm text-red-600",children:i})]})},HD={title:"",subtitle:"",description:"",primary_button_text:"Business Member",primary_button_url:"/auth/signup?type=business",secondary_button_text:"Residential Member",secondary_button_url:"/auth/signup?type=residential",directory_link_text:"Business Directory",directory_link_url:"/businesses",main_image_url:"",main_image_alt:"",overlay_image_1_url:"",overlay_image_1_alt:"",overlay_image_2_url:"",overlay_image_2_alt:""},XFe=()=>{St();const{data:t=[],isLoading:e}=rQ(),r=sQ(),n=nQ(),a=aQ(),i=iQ(),[o,l]=x.useState(!1),[c,u]=x.useState(!1),[d,h]=x.useState(null),[f,m]=x.useState(HD),g=(C,T)=>{m(D=>({...D,[C]:T}))},y=()=>{m(HD),h(null)},b=async()=>{try{await r.mutateAsync(f),l(!1),y()}catch(C){console.error("Error creating hero section:",C)}},w=async()=>
1199{if(d)try{await n.mutateAsync({id:d.id,data:f}),u(!1),y()}catch(C){console.error("Error updating hero section:",C)}},j=async C=>{try{await a.mutateAsync(C)}catch(T){console.error("Error deleting hero section:",T)}},N=async C=>{try{await i.mutateAsync(C)}catch(T){console.error("Error setting active hero section:",T)}},S=C=>{h(C),m({title:C.title||"",subtitle:C.subtitle||"",description:C.description||"",primary_button_text:C.primary_button_text||"",primary_button_url:C.primary_button_url||"",secondary_button_text:C.secondary_button_text||"",secondary_button_url:C.secondary_button_url||"",directory_link_text:C.directory_link_text||"",directory_link_url:C.directory_link_url||"",main_image_url:C.main_image_url||"",main_image_alt:C.main_image_alt||"",overlay_image_1_url:C.overlay_image_1_url||"",overlay_image_1_alt:C.overlay_image_1_alt||"",overlay_image_2_url:C.overlay_image_2_url||"",overlay_image_2_alt:C.overlay_image_2_alt||""}),u(!0)},E=()=>{y(),l(!0)};return e?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"text-lg",children:"Loading hero sections..."})}):s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-xl sm:text-2xl md:text-3xl font-bold",children:"Hero Section Management"}),s.jsx("p",{className:"text-muted-foreground text-sm sm:text-base",children:"Manage homepage hero section content and images"})]}),s.jsxs(Y,{onClick:E,className:"w-full sm:w-auto",children:[s.jsx(vs,{className:"h-4 w-4 mr-2"}),"Create Hero Section"]})]}),s.jsx("div",{className:"grid gap-4 sm:gap-6",children:t.length===0?s.jsx(De,{children:s.jsx(Be,{className:"text-center py-8 px-4",children:s.jsx("p",{className:"text-muted-foreground",children:"No hero sections found. Create your first one!"})})}):t.map(C=>s.jsxs(De,{className:C.is_active?"ring-2 ring-blue-500":"",children:[s.jsx(ot,{className:"p-4 sm:p-6",children:s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{className:"space-y-1 min-w-0",children:[s.jsxs(ut,{className:"flex flex-wrap items-center gap-2 text-base sm:text-lg break-words",children:[C.title,C.is_active&&s.jsx(ke,{variant:"default",className:"bg-green-600 shrink-0",children:"Active"})]}),s.jsx(us,{className:"line-clamp-2",children:C.subtitle})]}),s.jsxs("div",{className:"flex flex-wrap gap-2 shrink-0",children:[!C.is_active&&s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>N(C.id),disabled:i.isPending,className:"flex-1 sm:flex-initial",children:[s.jsx(Xs,{className:"h-4 w-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Set Active"})]}),s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>S(C),className:"flex-1 sm:flex-initial",children:[s.jsx(zs,{className:"h-4 w-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Edit"})]}),s.jsxs(ai,{children:[s.jsx(rk,{asChild:!0,children:s.jsxs(Y,{variant:"outline",size:"sm",className:"flex-1 sm:flex-initial",children:[s.jsx(vr,{className:"h-4 w-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Delete"})]})}),s.jsxs(Oa,{className:"max-w-[min(100vw-2rem,28rem)] p-4 sm:p-6",children:[s.jsxs(za,{children:[s.jsx(Ha,{children:"Delete Hero Section"}),s.jsx($a,{children:"Are you sure you want to delete this hero section? This action cannot be undone."})]}),s.jsxs(Ua,{children:[s.jsx(qa,{children:"Cancel"}),s.jsx(Wa,{onClick:()=>j(C.id),className:"bg-red-600 hover:bg-red-700",children:"Delete"})]})]})]})]})]})}),s.jsx(Be,{className:"p-4 pt-0 sm:p-6 sm:pt-0",children:s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-3 sm:line-clamp-none",children:C.description}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4",children:[C.main_image_url&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{className:"text-xs font-medium",children:"Main Image"}),s.jsx("div",{className:"relative aspect-video bg-gray-100 rounded-lg overflow-hidden",children:s.jsx("img",{src:C.main_image_url,alt:C.main_image_alt,className:"w-full h-full object-cover"})})]}),C.overlay_image_1_url&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{className:"text-xs font-medium",children:"Overlay Image 1"}),s.jsx("div",{className:"relative aspect-video bg-gray-100 rounded-lg overflow-hidden",children:s.jsx("img",{src:C.overlay_image_1_url,alt:C.overlay_image_1_alt,className:"w-full h-full object-cover"})})]}),C.overlay_image_2_url&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{className:"text-xs font-medium",children:"Overlay Image 2"}),s.jsx("div",{className:"relative aspect-video bg-gray-100 rounded-lg overflow-hidden",children:s.jsx("img",{src:C.overlay_image_2_url,alt:C.overlay_image_2_alt,className:"w-full h-full object-cover"})})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-x-2 gap-y-1 text-xs text-muted-foreground",children:[s.jsxs("span",{children:["Created: ",new Date(C.created_at).toLocaleDateString()]}),s.jsx("span",{children:"â¢"}),s.jsxs("span",{children:["Updated: ",new Date(C.updated_at).toLocaleDateString()]})]})]})})]},C.id))}),s.jsx(Tt,{open:o||c,onOpenChange:C=>{C||(l(!1),u(!1),y())},children:s.jsxs(Dt,{className:"max-w-[min(100vw-2rem,56rem)] max-h-[90vh] overflow-y-auto p-4 sm:p-6",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:c?"Edit Hero Section":"Create Hero Section"}),s.jsx(rr,{children:"Configure the hero section content, buttons, and images"})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-lg font-medium",children:"Basic Content"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"title",children:"Title *"}),s.jsx(Ne,{id:"title",value:f.title,onChange:C=>g("title",C.target.value),placeholder:"Valley Stream Chamber of Commerce"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"subtitle",children:"Subtitle"}),s.jsx(Ne,{id:"subtitle",value:f.subtitle,onChange:C=>g("subtitle",C.target.value),placeholder:"Welcome to the"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"description",children:"Description *"}),s.jsx(zt,{id:"description",value:f.description,onChange:C=>g("description",C.target.value),placeholder:"Our mission is to connect businesses...",rows:3})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-lg font-medium",children:"Action Buttons"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"primary_button_text",children:"Primary Button Text"}),s.jsx(Ne,{id:"primary_button_text",value:f.primary_button_text,onChange:C=>g("primary_button_text",C.target.value),placeholder:"Business Member"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"primary_button_url",children:"Primary Button URL"}),s.jsx(Ne,{id:"primary_button_url",value:f.primary_button_url,onChange:C=>g("primary_button_url",C.target.value),placeholder:"/auth/signup?type=business"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"secondary_button_text",children:"Secondary Button Text"}),s.jsx(Ne,{id:"secondary_button_text",value:f.secondary_button_text,onChange:C=>g("secondary_button_text",C.target.value),placeholder:"Residential Member"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"secondary_button_url",children:"Secondary Button URL"}),s.jsx(Ne,{id:"secondary_button_url",value:f.secondary_button_url,onChange:C=>g("secondary_button_url",C.target.value),placeholder:"/auth/signup?type=residential"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"directory_link_text",children:"Directory Link Text"}),s.jsx(Ne,{id:"directory_link_text",value:f.directory_link_text,onChange:C=>g("directory_link_text",C.target.value),placeholder:"Business Directory"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"directory_link_url",children:"Directory Link URL"}),s.jsx(Ne,{id:"directory_link_url",value:f.directory_link_url,onChange:C=>g("directory_link_url",C.target.value),placeholder:"/businesses"})]})]})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("h3",{className:"text-lg font-medium flex items-center gap-2",children:[s.jsx(vi,{className:"h-5 w-5"}),"Images"]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsx("div",{className:"space-y-4",children:s.jsx(TN,{value:f.main_image_url,onChange:C=>
1199g("main_image_url",C),label:"Main Background Image",placeholder:"/herosection.jpg",imageType:"main"})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"main_image_alt",children:"Main Image Alt Text"}),s.jsx(Ne,{id:"main_image_alt",value:f.main_image_alt,onChange:C=>g("main_image_alt",C.target.value),placeholder:"Local business owners working together"}),s.jsx("p",{className:"text-xs text-gray-500",children:"Describe the main image for screen readers and accessibility"})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsx("div",{className:"space-y-4",children:s.jsx(TN,{value:f.overlay_image_1_url,onChange:C=>g("overlay_image_1_url",C),label:"First Overlay Image",placeholder:"/herosection2.jpg",imageType:"overlay1"})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"overlay_image_1_alt",children:"First Overlay Image Alt Text"}),s.jsx(Ne,{id:"overlay_image_1_alt",value:f.overlay_image_1_alt,onChange:C=>g("overlay_image_1_alt",C.target.value),placeholder:"Local business with OPEN sign"}),s.jsx("p",{className:"text-xs text-gray-500",children:"Describe the first overlay image (positioned on the right side)"})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsx("div",{className:"space-y-4",children:s.jsx(TN,{value:f.overlay_image_2_url,onChange:C=>g("overlay_image_2_url",C),label:"Second Overlay Image",placeholder:"/herosection3.jpg",imageType:"overlay2"})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"overlay_image_2_alt",children:"Second Overlay Image Alt Text"}),s.jsx(Ne,{id:"overlay_image_2_alt",value:f.overlay_image_2_alt,onChange:C=>g("overlay_image_2_alt",C.target.value),placeholder:"Local business owner in greenhouse"}),s.jsx("p",{className:"text-xs text-gray-500",children:"Describe the second overlay image (positioned at bottom left)"})]})]})]})]})]}),s.jsxs("div",{className:"flex flex-col-reverse sm:flex-row sm:justify-end gap-2 pt-4 border-t",children:[s.jsxs(Y,{variant:"outline",className:"w-full sm:w-auto",onClick:()=>{l(!1),u(!1),y()},children:[s.jsx(Ir,{className:"h-4 w-4 mr-1"}),"Cancel"]}),s.jsxs(Y,{className:"w-full sm:w-auto",onClick:c?w:b,disabled:r.isPending||n.isPending,children:[s.jsx(hp,{className:"h-4 w-4 mr-1"}),c?"Update":"Create"]})]})]})})]})},QFe=()=>{const[t,e]=x.useState([]),[r,n]=x.useState(!0),[a,i]=x.useState(null),o=async()=>{try{n(!0),i(null);const d=await pi.getAllJobs();e(d)}catch(d){console.error("Error loading jobs:",d),i("Failed to load jobs")}finally{n(!1)}},l=async d=>{const h=await pi.createJob(d);return await o(),h},c=async d=>{const h=await pi.updateJob(d);return await o(),h},u=async d=>{await pi.deleteJob(d),await o()};return x.useEffect(()=>{o()},[]),{jobs:t,loading:r,error:a,refetch:o,createJob:l,updateJob:c,deleteJob:u}},eSe=({isOpen:t,onClose:e,onSuccess:r})=>{const[n,a]=x.useState({title:"",description:"",location:"",job_type:"",salary_range:"",business_name:"",business_logo:"",categories:[],featured:!1,featured_image:"",status:"active",expires_at:"",requirements:"",application_url:"",contact_email:""}),[i,o]=x.useState(!1),{toast:l}=St(),c=async d=>{if(d.preventDefault(),!n.title.trim()||!n.description.trim()||!n.location.trim()||!n.job_type||!n.business_name.trim()){l({title:"Error",description:"Please fill in all required fields",variant:"destructive"});return}try{o(!0);const h=m=>m?new Date(m).toISOString():void 0,f={title:n.title.trim(),description:n.description.trim(),location:n.location.trim(),job_type:n.job_type,salary_range:n.salary_range.trim()||void 0,business_name:n.business_name.trim(),business_logo:n.business_logo.trim()||void 0,categories:n.categories,featured:n.featured,featured_image:n.featured_image.trim()||void 0,status:n.status,expires_at:h(n.expires_at),requirements:n.requirements.trim()||void 0,application_url:n.application_url.trim()||void 0,contact_email:n.contact_email.trim()||void 0};await pi.createJob(f),l({title:"Success",description:"Job created successfully"}),r()}catch(h){console.error("Error creating job:",h),l({title:"Error",description:"Failed to create job",variant:"destructive"})}finally{o(!1)}},u=()=>{i||(a({title:"",description:"",location:"",job_type:"",salary_range:"",business_name:"",business_logo:"",categories:[],featured:!1,featured_image:"",status:"active",expires_at:"",requirements:"",application_url:"",contact_email:""}),e())};return s.jsx(Tt,{open:t,onOpenChange:u,children:s.jsx(Dt,{className:"sm:max-w-[700px] max-h-[90vh] overflow-y-auto",children:s.jsxs("form",{onSubmit:c,children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Add Job Listing"}),s.jsx(rr,{children:"Fill out the form below to add a new job listing."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"title",className:"text-right",children:"Job Title *"}),s.jsx(Ne,{id:"title",value:n.title,onChange:d=>
1199a(h=>({...h,title:d.target.value})),className:"col-span-3",placeholder:"e.g., Software Engineer",required:!0,disabled:i})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"business_name",className:"text-right",children:"Company Name *"}),s.jsx(Ne,{id:"business_name",value:n.business_name,onChange:d=>a(h=>({...h,business_name:d.target.value})),className:"col-span-3",placeholder:"e.g., Tech Corp",required:!0,disabled:i})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"location",className:"text-right",children:"Location *"}),s.jsx(Ne,{id:"location",value:n.location,onChange:d=>a(h=>({...h,location:d.target.value})),className:"col-span-3",placeholder:"e.g., New York, NY",required:!0,disabled:i})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"job_type",className:"text-right",children:"Job Type *"}),s.jsxs(Wt,{value:n.job_type,onValueChange:d=>a(h=>({...h,job_type:d})),children:[s.jsx(Ht,{className:"col-span-3",children:s.jsx(qt,{placeholder:"Select job type"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"full-time",children:"Full-time"}),s.jsx(Ae,{value:"part-time",children:"Part-time"}),s.jsx(Ae,{value:"contract",children:"Contract"}),s.jsx(Ae,{value:"temporary",children:"Temporary"}),s.jsx(Ae,{value:"internship",children:"Internship"})]})]})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"salary_range",className:"text-right",children:"Salary Range"}),s.jsx(Ne,{id:"salary_range",value:n.salary_range,onChange:d=>a(h=>({...h,salary_range:d.target.value})),className:"col-span-3",placeholder:"e.g., $50,000 - $70,000",disabled:i})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"description",className:"text-right pt-2",children:"Description *"}),s.jsx(zt,{id:"description",value:n.description,onChange:d=>a(h=>({...h,description:d.target.value})),className:"col-span-3",placeholder:"Detailed job description...",rows:4,required:!0,disabled:i})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"requirements",className:"text-right pt-2",children:"Requirements"}),s.jsx(zt,{id:"requirements",value:n.requirements,onChange:d=>a(h=>({...h,requirements:d.target.value})),className:"col-span-3",placeholder:"Job requirements and qualifications...",rows:3,disabled:i})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"application_url",className:"text-right",children:"Application URL"}),s.jsx(Ne,{id:"application_url",type:"url",value:n.application_url,onChange:d=>a(h=>({...h,application_url:d.target.value})),className:"col-span-3",placeholder:"https://example.com/apply",disabled:i})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"contact_email",className:"text-right",children:"Contact Email"}),s.jsx(Ne,{id:"contact_email",type:"email",value:n.contact_email,onChange:d=>a(h=>({...h,contact_email:d.target.value})),className:"col-span-3",placeholder:"[email protected]",disabled:i})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"business_logo",className:"text-right",children:"Company Logo URL"}),s.jsx(Ne,{id:"business_logo",type:"url",value:n.business_logo,onChange:d=>a(h=>({...h,business_logo:d.target.value})),className:"col-span-3",placeholder:"https://example.com/logo.png",disabled:i})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"featured_image",className:"text-right",children:"Featured Image URL"}),s.jsx(Ne,{id:"featured_image",type:"url",value:n.featured_image,onChange:d=>a(h=>({...h,featured_image:d.target.value})),className:"col-span-3",placeholder:"https://example.com/featured.jpg",disabled:i})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"expires_at",className:"text-right",children:"Expires At"}),s.jsx(Ne,{id:"expires_at",type:"datetime-local",value:n.expires_at,onChange:d=>
1199a(h=>({...h,expires_at:d.target.value})),className:"col-span-3",disabled:i})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"status",className:"text-right",children:"Status"}),s.jsxs(Wt,{value:n.status,onValueChange:d=>a(h=>({...h,status:d})),children:[s.jsx(Ht,{className:"col-span-3",children:s.jsx(qt,{})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"active",children:"Active"}),s.jsx(Ae,{value:"inactive",children:"Inactive"})]})]})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"featured",className:"text-right",children:"Featured"}),s.jsxs("div",{className:"col-span-3 flex items-center space-x-2",children:[s.jsx(ii,{id:"featured",checked:n.featured,onCheckedChange:d=>a(h=>({...h,featured:d})),disabled:i}),s.jsx(Z,{htmlFor:"featured",children:"Mark as featured job"})]})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",type:"button",onClick:u,disabled:i,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:i,children:i?"Creating...":"Add Job"})]})]})})})},tSe=({isOpen:t,job:e,onClose:r,onSuccess:n,updateJob:a})=>{const[i,o]=x.useState({title:"",description:"",location:"",job_type:"",salary_range:"",business_name:"",business_logo:"",categories:[],featured:!1,featured_image:"",status:"active",expires_at:"",requirements:"",application_url:"",contact_email:""}),[l,c]=x.useState(!1),{toast:u}=St();x.useEffect(()=>{if(e){const f=m=>m?new Date(m).toISOString().slice(0,16):"";o({title:e.title,description:e.description,location:e.location,job_type:e.job_type,salary_range:e.salary_range||"",business_name:e.business_name,business_logo:e.business_logo||"",categories:e.categories||[],featured:e.featured,featured_image:e.featured_image||"",status:e.status,expires_at:f(e.expires_at),requirements:e.requirements||"",application_url:e.application_url||"",contact_email:e.contact_email||""})}},[e]);const d=async f=>{if(f.preventDefault(),!i.title.trim()||!i.description.trim()||!i.location.trim()||!i.job_type||!i.business_name.trim()){u({title:"Error",description:"Please fill in all required fields",variant:"destructive"});return}try{c(!0);const m=y=>y?new Date(y).toISOString():void 0,g={id:e.id,title:i.title.trim(),description:i.description.trim(),location:i.location.trim(),job_type:i.job_type,salary_range:i.salary_range.trim()||void 0,business_name:i.business_name.trim(),business_logo:i.business_logo.trim()||void 0,categories:i.categories,featured:i.featured,featured_image:i.featured_image.trim()||void 0,status:i.status,expires_at:m(i.expires_at),requirements:i.requirements.trim()||void 0,application_url:i.application_url.trim()||void 0,contact_email:i.contact_email.trim()||void 0};await a(g),u({title:"Success",description:"Job updated successfully"}),n()}catch(m){console.error("Error updating job:",m),u({title:"Error",description:"Failed to update job",variant:"destructive"})}finally{c(!1)}},h=()=>{l||r()};return s.jsx(Tt,{open:t,onOpenChange:h,children:s.jsx(Dt,{className:"sm:max-w-[700px] max-h-[90vh] overflow-y-auto",children:s.jsxs("form",{onSubmit:d,children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Edit Job Listing"}),s.jsx(rr,{children:"Update the job listing details below."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"title",className:"text-right",children:"Job Title *"}),s.jsx(Ne,{id:"title",value:i.title,onChange:f=>o(m=>({...m,title:f.target.value})),className:"col-span-3",placeholder:"e.g., Software Engineer",required:!0,disabled:l})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"business_name",className:"text-right",children:"Company Name *"}),s.jsx(Ne,{id:"business_name",value:i.business_name,onChange:f=>o(m=>({...m,business_name:f.target.value})),className:"col-span-3",placeholder:"e.g., Tech Corp",required:!0,disabled:l})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"location",className:"text-right",children:"Location *"}),s.jsx(Ne,{id:"location",value:i.location,onChange:f=>o(m=>({...m,location:f.target.value})),className:"col-span-3",placeholder:"e.g., New York, NY",required:!0,disabled:l})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"job_type",className:"text-right",children:"Job Type *"}),s.jsxs(Wt,{value:i.job_type,onValueChange:f=>o(m=>({...m,job_type:f})),children:[s.jsx(Ht,{className:"col-span-3",children:s.jsx(qt,{})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"full-time",children:"Full-time"}),s.jsx(Ae,{value:"part-time",children:"Part-time"}),s.jsx(Ae,{value:"contract",children:"Contract"}),s.jsx(Ae,{value:"temporary",children:"Temporary"}),s.jsx(Ae,{value:"internship",children:"Internship"})]})]})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"salary_range",className:"text-right",children:"Salary Range"}),s.jsx(Ne,{id:"salary_range",value:i.salary_range,onChange:f=>o(m=>({...m,salary_range:f.target.value})),className:"col-span-3",placeholder:"e.g., $50,000 - $70,000",disabled:l})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"description",className:"text-right pt-2",children:"Description *"}),s.jsx(zt,{id:"description",value:i.description,onChange:f=>o(m=>({...m,description:f.target.value})),className:"col-span-3",placeholder:"Detailed job description...",rows:4,required:!0,disabled:l})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"requirements",className:"text-right pt-2",children:"Requirements"}),s.jsx(zt,{id:"requirements",value:i.requirements,onChange:f=>o(m=>({...m,requirements:f.target.value})),className:"col-span-3",placeholder:"Job requirements and qualifications...",rows:3,disabled:l})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"application_url",className:"text-right",children:"Application URL"}),s.jsx(Ne,{id:"application_url",type:"url",value:i.application_url,onChange:f=>o(m=>({...m,application_url:f.target.value})),className:"col-span-3",placeholder:"https://example.com/apply",disabled:l})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"contact_email",className:"text-right",children:"Contact Email"}),s.jsx(Ne,{id:"contact_email",type:"email",value:i.contact_email,onChange:f=>o(m=>({...m,contact_email:f.target.value})),className:"col-span-3",placeholder:"[email protected]",disabled:l})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"business_logo",className:"text-right",children:"Company Logo URL"}),s.jsx(Ne,{id:"business_logo",type:"url",value:i.business_logo,onChange:f=>o(m=>({...m,business_logo:f.target.value})),className:"col-span-3",placeholder:"https://example.com/logo.png",disabled:l})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"featured_image",className:"text-right",children:"Featured Image URL"}),s.jsx(Ne,{id:"featured_image",type:"url",value:i.featured_image,onChange:f=>o(m=>({...m,featured_image:f.target.value})),className:"col-span-3",placeholder:"https://example.com/featured.jpg",disabled:l})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"expires_at",className:"text-right",children:"Expires At"}),s.jsx(Ne,{id:"expires_at",type:"datetime-local",value:i.expires_at,onChange:f=>o(m=>({...m,expires_at:f.target.value})),className:"col-span-3",disabled:l})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"status",className:"text-right",children:"Status"}),s.jsxs(Wt,{value:i.status,onValueChange:f=>o(m=>({...m,status:f})),children:[s.jsx(Ht,{className:"col-span-3",children:s.jsx(qt,{})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"active",children:"Active"}),s.jsx(Ae,{value:"inactive",children:"Inactive"}),s.jsx(Ae,{value:"expired",children:"Expired"})]})]})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"featured",className:"text-right",children:"Featured"}),s.jsxs("div",{className:"col-span-3 flex items-center space-x-2",children:[s.jsx(ii,{id:"featured",checked:i.featured,onCheckedChange:f=>o(m=>({...m,featured:f})),disabled:l}),s.jsx(Z,{htmlFor:"featured",children:"Mark as featured job"})]})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",type:"button",onClick:h,disabled:l,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:l,children:l?"Updating...":"Update Job"})]})]})})})}
1199,rSe=({isOpen:t,onClose:e,job:r})=>{if(!r)return null;const n=l=>l.split("-").map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join(" "),a=l=>{switch(l){case"active":return s.jsx(ke,{className:"bg-green-100 text-green-800",children:"Active"});case"inactive":return s.jsx(ke,{className:"bg-gray-100 text-gray-800",children:"Inactive"});case"expired":return s.jsx(ke,{className:"bg-red-100 text-red-800",children:"Expired"});default:return s.jsx(ke,{className:"bg-gray-100 text-gray-800",children:l})}},i=l=>{switch(l){case"approved":return s.jsx(ke,{className:"bg-green-100 text-green-800",children:"Approved"});case"pending":return s.jsx(ke,{className:"bg-yellow-100 text-yellow-800",children:"Pending"});case"rejected":return s.jsx(ke,{className:"bg-red-100 text-red-800",children:"Rejected"});default:return s.jsx(ke,{className:"bg-gray-100 text-gray-800",children:"Unknown"})}},o=l=>{switch(l){case"full-time":return s.jsx(ke,{className:"bg-blue-100 text-blue-800",children:"Full-time"});case"part-time":return s.jsx(ke,{className:"bg-purple-100 text-purple-800",children:"Part-time"});case"contract":return s.jsx(ke,{className:"bg-orange-100 text-orange-800",children:"Contract"});case"temporary":return s.jsx(ke,{className:"bg-yellow-100 text-yellow-800",children:"Temporary"});case"internship":return s.jsx(ke,{className:"bg-green-100 text-green-800",children:"Internship"});default:return s.jsx(ke,{className:"bg-gray-100 text-gray-800",children:l})}};return s.jsx(Tt,{open:t,onOpenChange:e,children:s.jsxs(Dt,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Job Details"}),s.jsxs(rr,{children:['View detailed information for "',r.title,'" from ',r.business_name]})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:r.title}),s.jsx("p",{className:"text-lg text-gray-600 mt-1",children:r.business_name})]}),s.jsxs("div",{className:"flex flex-col gap-2",children:[a(r.status),i(r.approval_status)]})]})}),s.jsx(Be,{children:s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-gray-600",children:[s.jsx(_n,{className:"h-4 w-4"}),s.jsx("span",{children:r.location})]}),s.jsxs("div",{className:"flex items-center gap-2 text-gray-600",children:[s.jsx(ka,{className:"h-4 w-4"}),s.jsx("span",{children:n(r.job_type)})]}),r.salary_range&&s.jsxs("div",{className:"flex items-center gap-2 text-gray-600",children:[s.jsx(yu,{className:"h-4 w-4"}),s.jsx("span",{children:r.salary_range})]})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-gray-600",children:[s.jsx(o1,{className:"h-4 w-4"}),s.jsxs("span",{children:["Created: ",Cs(new Date(r.created_at),"PPP")]})]}),s.jsxs("div",{className:"flex items-center gap-2 text-gray-600",children:[s.jsx(rn,{className:"h-4 w-4"}),s.jsxs("span",{children:["Updated: ",Cs(new Date(r.updated_at),"PPP")]})]}),r.expires_at&&s.jsxs("div",{className:"flex items-center gap-2 text-gray-600",children:[s.jsx(Br,{className:"h-4 w-4"}),s.jsxs("span",{children:["Expires: ",Cs(new Date(r.expires_at),"PPP")]})]})]})]})})]}),s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs(ut,{className:"flex items-center gap-2",children:[s.jsx(ti,{className:"h-5 w-5"}),"Job Description"]})}),s.jsx(Be,{children:s.jsx("div",{className:"prose max-w-none",children:s.jsx("p",{className:"text-gray-700 whitespace-pre-wrap",children:r.description})})})]}),r.requirements&&s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs(ut,{className:"flex items-center gap-2",children:[s.jsx(ji,{className:"h-5 w-5"}),"Requirements"]})}),s.jsx(Be,{children:s.jsx("div",{className:"prose max-w-none",children:s.jsx("p",{className:"text-gray-700 whitespace-pre-wrap",children:r.requirements})})})]}),r.categories&&r.categories.length>0&&s.jsxs(De,{children:[s.jsx(ot,{children:s.jsx(ut,{children:"Categories"})}),s.jsx(Be,{children:s.jsx("div",{className:"flex flex-wrap gap-2",children:r.categories.map((l,c)=>s.jsx(ke,{variant:"outline",children:l},c))})})]}),s.jsxs(De,{children:[s.jsx(ot,{children:s.jsx(ut,{children:"Contact Information"})}),s.jsx(Be,{children:s.jsxs("div",{className:"space-y-3",children:[r.contact_email&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(fs,{className:"h-4 w-4 text-gray-600"}),s.jsx("span",{className:"text-gray-700",children:r.contact_email})]}),r.application_url&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(wx,{className:"h-4 w-4 text-gray-600"}),s.jsx("a",{href:r.application_url,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline",children:"Application URL"})]})]})})]}),s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs(ut,{className:"flex items-center gap-2",children:[s.jsx(ma,{className:"h-5 w-5"}),"Approval Information"]})}),s.jsx(Be,{children:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-medium text-gray-600",children:"Approval Status:"}),i(r.approval_status)]}),r.reviewed_by&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-medium text-gray-600",children:"Reviewed By:"}),s.jsx("span",{className:"text-sm text-gray-700",children:r.reviewed_by})]}),r.reviewed_at&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-medium text-gray-600",children:"Reviewed At:"}),s.jsx("span",{className:"text-sm text-gray-700",children:Cs(new Date(r.reviewed_at),"PPP")})]}),r.admin_notes&&s.jsxs("div",{className:"mt-4 p-3 bg-gray-50 rounded border",children:[s.jsx("span",{className:"text-sm font-medium text-gray-600 block mb-1",children:"Admin Notes:"}),s.jsx("p",{className:"text-sm text-gray-700",children:r.admin_notes})]})]})})]}),s.jsx("div",{className:"flex justify-center",children:o(r.job_type)})]}),s.jsx("div",{className:"flex justify-end pt-4 border-t",children:s.jsx(Y,{variant:"outline",onClick:e,children:"Close"})})]})})},sSe=({jobs:t,isLoading:e,searchQuery:r,sortField:n,sortDirection:a,onSort:i,onEdit:o,onDelete:l,onApprove:c,onReject:u,onView:d,onStatusChange:h})=>{const f=w=>{switch(w){case"active":return s.jsx(ke,{className:"bg-green-100 text-green-800",children:"Active"});case"inactive":return s.jsx(ke,{className:"bg-gray-100 text-gray-800",children:"Inactive"});case"expired":return s.jsx(ke,{className:"bg-red-100 text-red-800",children:"Expired"});default:return s.jsx(ke,{className:"bg-gray-100 text-gray-800",children:w})}},m=w=>{switch(w){case"approved":return s.jsx(ke,{className:"bg-green-100 text-green-800",children:"Approved"});
1199case"pending":return s.jsx(ke,{className:"bg-yellow-100 text-yellow-800",children:"Pending"});case"rejected":return s.jsx(ke,{className:"bg-red-100 text-red-800",children:"Rejected"});default:return s.jsx(ke,{className:"bg-gray-100 text-gray-800",children:"Unknown"})}},g=w=>{switch(w){case"full-time":return s.jsx(ke,{className:"bg-blue-100 text-blue-800",children:"Full-time"});case"part-time":return s.jsx(ke,{className:"bg-purple-100 text-purple-800",children:"Part-time"});case"contract":return s.jsx(ke,{className:"bg-orange-100 text-orange-800",children:"Contract"});case"temporary":return s.jsx(ke,{className:"bg-yellow-100 text-yellow-800",children:"Temporary"});case"internship":return s.jsx(ke,{className:"bg-green-100 text-green-800",children:"Internship"});default:return s.jsx(ke,{className:"bg-gray-100 text-gray-800",children:w})}},y=w=>new Date(w).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),b=w=>n!==w?null:a==="asc"?s.jsx(dC,{className:"inline ml-1 h-4 w-4"}):s.jsx(uC,{className:"inline ml-1 h-4 w-4"});return e?s.jsx("div",{className:"py-8 text-center text-gray-500",children:"Loading jobs..."}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Oi,{className:"min-w-[800px]",children:[s.jsx(zi,{children:s.jsxs(As,{children:[s.jsxs(At,{className:"cursor-pointer",onClick:()=>i("title"),children:["JOB TITLE ",b("title")]}),s.jsxs(At,{className:"cursor-pointer",onClick:()=>i("business_name"),children:["BUSINESS ",b("business_name")]}),s.jsxs(At,{className:"cursor-pointer",onClick:()=>i("job_type"),children:["TYPE ",b("job_type")]}),s.jsxs(At,{className:"cursor-pointer",onClick:()=>i("status"),children:["STATUS ",b("status")]}),s.jsxs(At,{className:"cursor-pointer",onClick:()=>i("approval_status"),children:["APPROVAL ",b("approval_status")]}),s.jsxs(At,{className:"cursor-pointer",onClick:()=>i("created_at"),children:["CREATED ",b("created_at")]}),s.jsx(At,{children:"ACTIONS"})]})}),s.jsx(Ui,{children:t.length>0?t.map(w=>s.jsxs(As,{className:w.approval_status!=="approved"?"opacity-75":"",children:[s.jsx(Ct,{children:s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-blue-600",children:w.title}),s.jsx("div",{className:"text-sm text-gray-500 line-clamp-2",children:w.description.length>100?`${w.description.substring(0,100)}...`:w.description}),w.salary_range&&s.jsx("div",{className:"text-sm text-gray-600 mt-1",children:w.salary_range})]})}),s.jsx(Ct,{children:s.jsx("div",{className:"font-medium text-gray-900",children:w.business_name})}),s.jsx(Ct,{children:g(w.job_type)}),s.jsx(Ct,{children:f(w.status)}),s.jsx(Ct,{children:m(w.approval_status)}),s.jsx(Ct,{children:y(w.created_at)}),s.jsx(Ct,{children:s.jsxs(tb,{children:[s.jsx(rb,{asChild:!0,children:s.jsxs(Y,{variant:"ghost",className:"h-8 w-8 p-0",children:[s.jsx("span",{className:"sr-only",children:"Open menu"}),s.jsx(mC,{className:"h-4 w-4"})]})}),s.jsxs(Ix,{align:"end",children:[s.jsxs(Gn,{onClick:()=>d(w),children:[s.jsx(Xs,{className:"mr-2 h-4 w-4"}),"View"]}),s.jsxs(Gn,{onClick:()=>o(w),children:[s.jsx(zs,{className:"mr-2 h-4 w-4"}),"Edit"]}),s.jsxs(Gn,{onClick:()=>h(w),children:[s.jsx(jd,{className:"mr-2 h-4 w-4"}),"Change Status"]}),w.approval_status==="pending"&&s.jsxs(s.Fragment,{children:[s.jsx(pd,{}),s.jsxs(Gn,{onClick:()=>c(w),children:[s.jsx(un,{className:"mr-2 h-4 w-4"}),"Approve"]}),s.jsxs(Gn,{onClick:()=>u(w),children:[s.jsx(Ir,{className:"mr-2 h-4 w-4"}),"Reject"]})]}),w.approval_status==="approved"&&s.jsxs(s.Fragment,{children:[s.jsx(pd,{}),s.jsxs(Gn,{onClick:()=>u(w),children:[s.jsx(Ir,{className:"mr-2 h-4 w-4"}),"Reject"]})]}),w.approval_status==="rejected"&&s.jsxs(s.Fragment,{children:[s.jsx(pd,{}),s.jsxs(Gn,{onClick:()=>c(w),children:[s.jsx(un,{className:"mr-2 h-4 w-4"}),"Approve"]})]}),s.jsx(pd,{}),s.jsxs(Gn,{onClick:()=>l(w.id,w.title),className:"text-red-600 focus:text-red-600",children:[s.jsx(vr,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})})]},w.id)):s.jsx(As,{children:s.jsx(Ct,{colSpan:7,className:"h-24 text-center",children:r?s.jsxs(s.Fragment,{children:["No jobs matching ",s.jsxs("span",{className:"font-medium",children:['"',r,'"']})]}):s.jsx(s.Fragment,{children:"No jobs found."})})})})]})})},nSe=({searchQuery:t,onSearchChange:e,statusFilter:r,onStatusFilterChange:n,approvalFilter:a,onApprovalFilterChange:i,typeFilter:o,onTypeFilterChange:l})=>s.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4 mb-4 sm:mb-6",children:[s.jsxs("div",{className:"relative flex-1 w-full min-w-0",children:[s.jsx(Uc,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),s.jsx(Ne,{placeholder:"Search jobs by title or business...",value:t,onChange:c=>e(c.target.value),className:"pl-10"})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs(Wt,{value:a,onValueChange:i,children:[s.jsx(Ht,{className:"w-full sm:w-[140px] min-w-0",children:s.jsx(qt,{placeholder:"Approval"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"all",children:"All Approval"}),s.jsx(Ae,{value:"pending",children:"Pending"}),s.jsx(Ae,{value:"approved",children:"Approved"}),s.jsx(Ae,{value:"rejected",children:"Rejected"})]})]}),s.jsxs(Wt,{value:r,onValueChange:n,children:[s.jsx(Ht,{className:"w-full sm:w-[120px] min-w-0",children:s.jsx(qt,{placeholder:"Status"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"all",children:"All Status"}),s.jsx(Ae,{value:"active",children:"Active"}),s.jsx(Ae,{value:"inactive",children:"Inactive"}),s.jsx(Ae,{value:"expired",children:"Expired"})]})]}),s.jsxs(Wt,{value:o,onValueChange:l,children:[s.jsx(Ht,{className:"w-full sm:w-[130px] min-w-0",children:s.jsx(qt,{placeholder:"Type"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"all",children:"All Types"}),s.jsx(Ae,{value:"full-time",children:"Full-time"}),s.jsx(Ae,{value:"part-time",children:"Part-time"}),s.jsx(Ae,{value:"contract",children:"Contract"}),s.jsx(Ae,{value:"temporary",children:"Temporary"}),s.jsx(Ae,{value:"internship",children:"Internship"})]})]})]})]}
1199),aSe=({isOpen:t,onClose:e,job:r,onUpdateStatus:n})=>{const[a,i]=x.useState(""),[o,l]=x.useState(""),[c,u]=x.useState(!1),d=async()=>{if(!(!r||!a)){u(!0);try{await n(r.id,a,o.trim()||void 0),e(),i(""),l("")}catch(f){console.error("Error updating job status:",f)}finally{u(!1)}}},h=()=>{e(),i(""),l("")};return s.jsx(Tt,{open:t,onOpenChange:h,children:s.jsxs(Dt,{children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Update Job Status"}),s.jsxs(rr,{children:['Change the status of "',r==null?void 0:r.title,'" from ',r==null?void 0:r.business_name]})]}),s.jsxs("div",{className:"space-y-4",children:[r&&s.jsxs("div",{className:"p-4 bg-gray-50 rounded",children:[s.jsx("h4",{className:"font-medium",children:r.title}),s.jsx("p",{className:"text-sm text-gray-600",children:r.business_name}),s.jsxs("p",{className:"text-sm text-gray-600",children:["Current status: ",r.status]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"status",children:"New Status"}),s.jsxs(Wt,{value:a,onValueChange:i,children:[s.jsx(Ht,{children:s.jsx(qt,{placeholder:"Select new status"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"active",children:"Active"}),s.jsx(Ae,{value:"inactive",children:"Inactive"}),s.jsx(Ae,{value:"expired",children:"Expired"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"notes",children:"Notes (Optional)"}),s.jsx(zt,{id:"notes",value:o,onChange:f=>l(f.target.value),placeholder:"Add any notes about this status change...",rows:3})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",onClick:h,disabled:c,children:"Cancel"}),s.jsx(Y,{onClick:d,disabled:c||!a,children:c?"Updating...":"Update Status"})]})]})})},iSe=()=>{const{user:t}=ts(),{jobs:e,loading:r,error:n,updateJob:a,deleteJob:i,refetch:o}=QFe(),[l,c]=x.useState(!1),[u,d]=x.useState(!1),[h,f]=x.useState(!1),[m,g]=x.useState(null),[y,b]=x.useState(null),[w,j]=x.useState(""),[N,S]=x.useState("all"),[E,C]=x.useState("all"),[T,D]=x.useState("all"),[A,R]=x.useState(1),[M,P]=x.useState("created_at"),[U,I]=x.useState("desc"),[O,V]=x.useState(!1),[G,B]=x.useState(null),[$,W]=x.useState(""),[oe,K]=x.useState(!1),[H,X]=x.useState(null),[me,ie]=x.useState("approve"),[ee,he]=x.useState(""),[ve,Ce]=x.useState(!1),[re,we]=x.useState(!1),[Ee,Me]=x.useState(null),{toast:ae}=St(),ze=10,tt=[...e.filter(pt=>{const ir=w===""||pt.title.toLowerCase().includes(w.toLowerCase())||pt.business_name.toLowerCase().includes(w.toLowerCase()),jr=N==="all"||pt.status===N,rs=E==="all"||pt.approval_status===E,zr=T==="all"||pt.job_type===T;return ir&&jr&&rs&&zr})].sort((pt,ir)=>{let jr=pt[M],rs=ir[M];return M==="created_at"?(jr=new Date(jr).getTime(),rs=new Date(rs).getTime()):typeof jr=="string"&&(jr=jr.toLowerCase(),rs=rs.toLowerCase()),U==="asc"?jr>rs?1:-1:jr<rs?1:-1}),Xe=tt.length,Ft=Math.ceil(Xe/ze),ce=(A-1)*ze,fe=tt.slice(ce,ce+ze),ge=async()=>{c(!1),await o()},Ge=async()=>{d(!1),g(null),await o()},Je=(pt,ir)=>{B(pt),W(ir),V(!0)},be=async()=>{if(G)try{await i(G),ae({title:"Success",description:"Job deleted successfully"}),await o()}catch(pt){console.error("Error deleting job:",pt),ae({title:"Error",description:"Failed to delete job",variant:"destructive"})}finally{V(!1),B(null),W("")}},Pe=pt=>{g(pt),d(!0)},qe=pt=>{b(pt),f(!0)},Qe=(pt,ir)=>{X(pt),ie(ir),he(""),K(!0)},We=async()=>{if(!(!H||!(t!=null&&t.id)))try{Ce(!0);const pt={id:H.id,approval_status:me==="approve"?"approved":"rejected",admin_notes:ee.trim()||void 0,reviewed_by:t.id};await pi.approveJob(pt),ae({title:"Success",description:`Job ${me==="approve"?"approved":"rejected"} successfully`}),await o()}catch(pt){console.error("Error approving job:",pt),ae({title:"Error",description:`Failed to ${me} job`,variant:"destructive"})}finally{Ce(!1),K(!1),X(null),he("")}},dt=pt=>{Me(pt),we(!0)},Bt=async(pt,ir,jr)=>{try{await a({id:pt,status:ir}),ae({title:"Success",description:"Job status updated successfully"}),await o()}catch(rs){throw console.error("Error updating job status:",rs),ae({title:"Error",description:"Failed to update job status",variant:"destructive"}),rs}},Lt=pt=>{pt===M?I(U==="asc"?"desc":"asc"):(P(pt),I("asc")),R(1)},Vt=pt=>{R(pt)};if(r)return s.jsx("div",{className:"flex items-center justify-center p-8",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-chamber-blue mx-auto mb-4"}),s.jsx("p",{children:"Loading jobs..."})]})});if(n)return s.jsx("div",{className:"flex items-center justify-center p-8",children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-red-600 mb-4",children:n}),s.jsx(Y,{onClick:()=>o(),children:"Try Again"})]})});const cr=pt=>{switch(pt){case"approved":return s.jsx(ke,{className:"bg-green-100 text-green-800 text-xs",children:"Approved"});
1199case"pending":return s.jsx(ke,{className:"bg-yellow-100 text-yellow-800 text-xs",children:"Pending"});case"rejected":return s.jsx(ke,{className:"bg-red-100 text-red-800 text-xs",children:"Rejected"});default:return s.jsx(ke,{variant:"secondary",className:"text-xs",children:pt||"Unknown"})}},wr=pt=>{const ir={"full-time":"bg-blue-100 text-blue-800","part-time":"bg-purple-100 text-purple-800",contract:"bg-orange-100 text-orange-800",temporary:"bg-yellow-100 text-yellow-800",internship:"bg-green-100 text-green-800"};return s.jsx(ke,{className:(ir[pt]||"bg-gray-100 text-gray-800")+" text-xs",children:pt})},Xt=pt=>new Date(pt).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"});return s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-gray-900",children:"Job Management"}),s.jsx("p",{className:"text-muted-foreground text-sm sm:text-base",children:"Manage job listings and approvals"})]}),s.jsxs(Y,{onClick:()=>c(!0),className:"w-full sm:w-auto shrink-0",children:[s.jsx(vs,{className:"h-4 w-4 mr-2"}),"Add Job"]})]}),s.jsx(nSe,{searchQuery:w,onSearchChange:j,statusFilter:N,onStatusFilterChange:S,approvalFilter:E,onApprovalFilterChange:C,typeFilter:T,onTypeFilterChange:D}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 sm:gap-4",children:[s.jsx(De,{children:s.jsx(Be,{className:"p-3 sm:p-4",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs sm:text-sm font-medium text-muted-foreground truncate",children:"Total"}),s.jsx("p",{className:"text-lg sm:text-2xl font-bold text-gray-900",children:e.length})]}),s.jsx(Ll,{className:"h-6 w-6 sm:h-8 sm:w-8 text-blue-600 shrink-0"})]})})}),s.jsx(De,{children:s.jsx(Be,{className:"p-3 sm:p-4",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs sm:text-sm font-medium text-muted-foreground truncate",children:"Pending"}),s.jsx("p",{className:"text-lg sm:text-2xl font-bold text-yellow-600",children:e.filter(pt=>pt.approval_status==="pending").length})]}),s.jsx(rn,{className:"h-6 w-6 sm:h-8 sm:w-8 text-yellow-600 shrink-0"})]})})}),s.jsx(De,{children:s.jsx(Be,{className:"p-3 sm:p-4",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs sm:text-sm font-medium text-muted-foreground truncate",children:"Approved"}),s.jsx("p",{className:"text-lg sm:text-2xl font-bold text-green-600",children:e.filter(pt=>pt.approval_status==="approved").length})]}),s.jsx(un,{className:"h-6 w-6 sm:h-8 sm:w-8 text-green-600 shrink-0"})]})})}),s.jsx(De,{children:s.jsx(Be,{className:"p-3 sm:p-4",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs sm:text-sm font-medium text-muted-foreground truncate",children:"Rejected"}),s.jsx("p",{className:"text-lg sm:text-2xl font-bold text-red-600",children:e.filter(pt=>pt.approval_status==="rejected").length})]}),s.jsx(Ir,{className:"h-6 w-6 sm:h-8 sm:w-8 text-red-600 shrink-0"})]})})})]}),s.jsxs(De,{children:[s.jsx(ot,{className:"p-4 sm:p-6",children:s.jsx(ut,{className:"text-lg sm:text-xl",children:"Jobs"})}),s.jsxs(Be,{className:"p-4 sm:p-6 pt-0",children:[s.jsx("div",{className:"md:hidden space-y-3",children:fe.length===0?s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:w||N!=="all"||E!=="all"||T!=="all"?"No jobs match your filters.":"No jobs found."}):fe.map(pt=>s.jsxs("div",{className:`border rounded-lg p-4 space-y-2 ${pt.approval_status!=="approved"?"opacity-90":""}`,children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium text-blue-600 line-clamp-2",children:pt.title}),s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:pt.business_name})]}),s.jsxs("div",{className:"flex flex-wrap gap-1 shrink-0 justify-end",children:[wr(pt.job_type),cr(pt.approval_status)]})]}),pt.salary_range&&s.jsx("p",{className:"text-sm text-muted-foreground",children:pt.salary_range}),s.jsx("p",{className:"text-xs text-muted-foreground",children:Xt(pt.created_at)}),s.jsxs("div",{className:"flex flex-wrap gap-1 pt-2",children:[s.jsxs(Y,{variant:"outline",size:"sm",className:"h-8",onClick:()=>qe(pt),children:[s.jsx(Xs,{className:"h-4 w-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"View"})]}),s.jsxs(Y,{variant:"outline",size:"sm",className:"h-8",onClick:()=>Pe(pt),children:[s.jsx(zs,{className:"h-4 w-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Edit"})]}),s.jsxs(Y,{variant:"outline",size:"sm",className:"h-8",onClick:()=>dt(pt),children:[s.jsx(jd,{className:"h-4 w-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Status"})]}),pt.approval_status==="pending"&&s.jsxs(s.Fragment,{children:[s.jsx(Y,{variant:"outline",size:"sm",className:"h-8 text-green-600 border-green-200",onClick:()=>Qe(pt,"approve"),children:s.jsx(un,{className:"h-4 w-4"})}),s.jsx(Y,{variant:"outline",size:"sm",className:"h-8 text-red-600 border-red-200",onClick:()=>Qe(pt,"reject"),children:s.jsx(Ir,{className:"h-4 w-4"})})]}),s.jsx(Y,{variant:"outline",size:"sm",className:"h-8 text-destructive hover:bg-destructive/10",onClick:()=>Je(pt.id,pt.title),children:s.jsx(vr,{className:"h-4 w-4"})})]})]},pt.id))}),s.jsx("div",{className:"hidden md:block",children:s.jsx(sSe,{jobs:fe,isLoading:r,searchQuery:w,sortField:M,sortDirection:U,onSort:Lt,onEdit:Pe,onDelete:Je,onApprove:pt=>Qe(pt,"approve"),onReject:pt=>Qe(pt,"reject"),onView:qe,onStatusChange:dt})}),Ft>1&&s.jsx("div",{className:"mt-4",children:s.jsx(kR,{currentPage:A,totalPages:Ft,onPageChange:Vt})})]})]}),s.jsx(eSe,{isOpen:l,onClose:()=>c(!1),onSuccess:ge}),m&&s.jsx(tSe,{isOpen:u,job:m,onClose:()=>{d(!1),g(null)},onSuccess:Ge,updateJob:a}),s.jsx(ai,{open:O,onOpenChange:V,children:s.jsxs(Oa,{className:"max-w-[min(100vw-2rem,28rem)] p-4 sm:p-6",children:[s.jsxs(za,{children:[s.jsx(Ha,{children:"Are you sure?"}),s.jsxs($a,{children:['This action cannot be undone. This will permanently delete the job "',$,'".']})]}),s.jsxs(Ua,{children:[s.jsx(qa,{children:"Cancel"}),s.jsx(Wa,{onClick:be,className:"bg-red-600 hover:bg-red-700",children:"Delete"})]})]})}),s.jsx(Tt,{open:oe,onOpenChange:K,children:s.jsxs(Dt,{className:"max-w-[min(100vw-2rem,28rem)] p-4 sm:p-6",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:me==="approve"?"Approve Job":"Reject Job"}),s.jsxs(rr,{children:[me==="approve"?"This job will be published and visible to job seekers.":"This job will be rejected and not published. Please provide a reason.",H&&H.approval_status!=="pending"&&s.jsxs("span",{className:"block mt-2 text-sm text-gray-600",children:["Current status: ",s.jsx("strong",{children:H.approval_status})]})]})]}),s.jsxs("div",{className:"space-y-4",children:[H&&s.jsxs("div",{className:"p-4 bg-gray-50 rounded",children:[s.jsx("h4",{className:"font-medium",children:H.title}),s.jsx("p",{className:"text-sm text-gray-600",children:H.business_name})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"admin_notes",children:me==="approve"?"
1199Notes (Optional)":"Rejection Reason *"}),s.jsx(zt,{id:"admin_notes",value:ee,onChange:pt=>he(pt.target.value),placeholder:me==="approve"?"Add any notes about this approval...":"Please provide a reason for rejection...",rows:3,required:me==="reject"}),H&&H.admin_notes&&me==="approve"&&s.jsxs("div",{className:"text-sm text-gray-600",children:[s.jsx("strong",{children:"Previous rejection reason:"})," ",H.admin_notes]})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",onClick:()=>K(!1),disabled:ve,children:"Cancel"}),s.jsx(Y,{onClick:We,disabled:ve||me==="reject"&&!ee.trim(),variant:me==="approve"?"default":"destructive",children:ve?"Processing...":me==="approve"?"Approve":"Reject"})]})]})}),s.jsx(aSe,{isOpen:re,onClose:()=>we(!1),job:Ee,onUpdateStatus:Bt}),s.jsx(rSe,{isOpen:h,onClose:()=>{f(!1),b(null)},job:y})]})};var z7={exports:{}};(function(t,e){(function(r,n){n()})(io,function(){function r(u,d){return typeof d>"u"?d={autoBom:!1}:typeof d!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),d={autoBom:!d}),d.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(u.type)?new Blob(["\uFEFF",u],{type:u.type}):u}function n(u,d,h){var f=new XMLHttpRequest;f.open("GET",u),f.responseType="blob",f.onload=function(){c(f.response,d,h)},f.onerror=function(){console.error("could not download file")},f.send()}function a(u){var d=new XMLHttpRequest;d.open("HEAD",u,!1);try{d.send()}catch{}return 200<=d.status&&299>=d.status}function i(u){try{u.dispatchEvent(new MouseEvent("click"))}catch{var d=document.createEvent("MouseEvents");
1199d.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),u.dispatchEvent(d)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof io=="object"&&io.global===io?io:void 0,l=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),c=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!l?function(u,d,h){var f=o.URL||o.webkitURL,m=document.createElement("a");d=d||u.name||"download",m.download=d,m.rel="noopener",typeof u=="string"?(m.href=u,m.origin===location.origin?i(m):a(m.href)?n(u,d,h):i(m,m.target="_blank")):(m.href=f.createObjectURL(u),setTimeout(function(){f.revokeObjectURL(m.href)},4e4),setTimeout(function(){i(m)},0))}:"msSaveOrOpenBlob"in navigator?function(u,d,h){if(d=d||u.name||"download",typeof u!="string")navigator.msSaveOrOpenBlob(r(u,h),d);else if(a(u))n(u,d,h);else{var f=document.createElement("a");f.href=u,f.target="_blank",setTimeout(function(){i(f)})}}:function(u,d,h,f){if(f=f||open("","_blank"),f&&(f.document.title=f.document.body.innerText="downloading..."),typeof u=="string")return n(u,d,h);var m=u.type==="application/octet-stream",g=/constructor/i.test(o.HTMLElement)||o.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||m&&g||l)&&typeof FileReader<"u"){var b=new FileReader;b.onloadend=function(){var N=b.result;N=y?N:N.replace(/^data:[^;]*;/,"data:attachment/file;"),f?f.location.href=N:location=N,f=null},b.readAsDataURL(u)}else{var w=o.URL||o.webkitURL,j=w.createObjectURL(u);f?f.location=j:location.href=j,f=null,setTimeout(function(){w.revokeObjectURL(j)},4e4)}});o.saveAs=c.saveAs=c,t.exports=c})})(z7);var df=z7.exports;const oSe=()=>{const{toast:t}=St(),[e,r]=x.useState(!1),[n,a]=x.useState(!1),[i,o]=x.useState(!1),[l,c]=x.useState(!1),[u,d]=x.useState(!1),[h,f]=x.useState(!1),[m,g]=x.useState(!1),y=async N=>{try{if(N==="members"){r(!0),t({title:"Generating PDF",description:"The members PDF is being generated and will download shortly."});const S=await Po.generateMembersPDF();df.saveAs(S,"chamber-members-report.pdf"),t({title:"PDF Generated",description:"Your members PDF has been generated successfully."})}else{a(!0),t({title:"Generating PDF",description:"The businesses PDF is being generated and will download shortly."});const S=await Po.generateBusinessesPDF();df.saveAs(S,"chamber-businesses-report.pdf"),t({title:"PDF Generated",description:"Your businesses PDF has been generated successfully."})}}catch(S){console.error(`Error generating ${N} PDF:`,S),t({title:"Error",description:`Failed to generate ${N} PDF. Please try again.`,variant:"destructive"})}finally{N==="members"?r(!1):a(!1)}},b=async N=>{try{if(N==="members"){o(!0),t({title:"Exporting Data",description:"Your members data export is being prepared."});const S=await Po.exportMembersData();df.saveAs(S,"chamber-members-data.csv"),t({title:"Data Exported",description:"Your members data has been exported successfully."})}else if(N==="businesses"){c(!0),t({title:"Exporting Data",description:"Your businesses data export is being prepared."});const S=await Po.exportBusinessesData();df.saveAs(S,"chamber-businesses-data.csv"),t({title:"Data Exported",description:"Your businesses data has been exported successfully."})}else if(N==="full-businesses"){d(!0),t({title:"Exporting Full Business Data",description:"Your complete businesses data export is being prepared."});const S=await Po.exportFullBusinessesData();df.saveAs(S,"chamber-full-businesses-data.csv"),t({title:"Full Business Data Exported",description:"Your complete businesses data has been exported successfully."})}else{f(!0),t({title:"Exporting Data",description:"Your residential users data export is being prepared."});const S=await Po.exportResidentialUsersData();df.saveAs(S,"chamber-residential-users-data.csv"),t({title:"Data Exported",description:"Your residential users data has been exported successfully."})}}catch(S){console.error(`Error exporting ${N} data:`,S),t({title:"Error",description:`Failed to export ${N} data. Please try again.`,variant:"destructive"})}finally{N==="members"?o(!1):N==="businesses"?c(!1):N==="full-businesses"?d(!1):f(!1)}},j=[{title:"Reports & Analytics",description:"Generate comprehensive reports for members and businesses",badge:"PDF Reports",badgeVariant:"secondary",tools:[{id:"members-pdf",title:"Members Report",description:"Generate a detailed PDF report of all members with contact details, roles, and membership status.",icon:Os,buttonText:"Generate PDF",loadingText:"Generating...",isLoading:e,action:()=>y("members"),color:"blue"},{id:"businesses-pdf",title:"Businesses Report",description:"Create a comprehensive PDF with all business listings, owner information, status, and categories.",icon:Ll,buttonText:"Generate PDF",loadingText:"Generating...",isLoading:n,action:()=>y("businesses"),color:"green"}]},{title:"Data Export",description:"Export data in CSV format for external analysis and backup",badge:"CSV Export",badgeVariant:"outline",tools:[{id:"members-csv",title:"Export Members Data",description:"Export all member data in CSV format for use in spreadsheets, external applications, or backup purposes.",icon:x2,buttonText:"Export CSV",loadingText:"Exporting...",isLoading:i,action:()=>b("members"),color:"purple"},{id:"businesses-csv",title:"Export Business Data",description:"Export business listings data in CSV format for data analysis, reporting, or integration with other systems (excludes internal fields).",icon:x2,buttonText:"Export CSV",loadingText:"Exporting...",isLoading:l,action:()=>b("businesses"),color:"orange"},{id:"residential-csv",title:"Export Residential Users Data",description:"Export all residential users (profiles with user_type = 'residential') in CSV format.",icon:x2,buttonText:"Export CSV",loadingText:"Exporting...",isLoading:h,action:()=>b("residential"),color:"purple"}]},{title:"System Management",description:"Critical system operations and data backup",badge:"Admin Only",badgeVariant:"destructive",tools:[{id:"full-businesses-csv",title:"Export Full Business Data",description:"Export complete business listings data in CSV format including all internal fields for administrative use.",icon:OV,buttonText:"Export Full CSV",loadingText:"Exporting...",isLoading:u,action:()=>b("full-businesses"),color:"red"},{id:"database-backup",title:"Database Backup",description:"Generate a complete backup of the database for disaster recovery, migration, or archival purposes.",icon:YV,buttonText:"Create Backup",loadingText:"Backing up...",isLoading:m,action:async()=>{try{g(!0),t({title:"Backup Started",description:"Database backup process has started."});const N=await Po.createDatabaseBackup(),S=new Date().toISOString().replace(/:/g,"-").substring(0,19);df.saveAs(N,`chamber-database-backup-${S}.json`),t({title:"Backup Complete",description:"Database backup has been completed successfully."})}catch(N){console.error("Error creating database backup:",N),t({title:"Error",description:"Failed to create database backup. Please try again.",variant:"destructive"})}finally{g(!1)}},color:"red"}]}];return s.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[s.jsx("div",{className:"space-y-3 sm:space-y-4",children:s.jsxs("div",{children:[s.jsx("h1",{className:"text-xl sm:text-2xl md:text-3xl font-bold tracking-tight",children:"Admin Tools"}),s.jsx("p",{className:"text-muted-foreground mt-2",children:"Comprehensive tools to manage, export, and backup your Chamber of Commerce platform data."})]})}),s.jsx("div",{className:"space-y-8",children:j.map((N,S)=>s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("h2",{className:"text-xl font-semibold tracking-tight",children:N.title}
1199),s.jsx(ke,{variant:N.badgeVariant,children:N.badge})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:N.description})]})}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:N.tools.map(E=>{const C=E.icon,T={blue:"border-blue-200 hover:border-blue-300 hover:shadow-blue-100",green:"border-green-200 hover:border-green-300 hover:shadow-green-100",purple:"border-purple-200 hover:border-purple-300 hover:shadow-purple-100",orange:"border-orange-200 hover:border-orange-300 hover:shadow-orange-100",red:"border-red-200 hover:border-red-300 hover:shadow-red-100"};return s.jsxs(De,{className:`transition-all duration-200 hover:shadow-md ${T[E.color]} h-full flex flex-col`,children:[s.jsx(ot,{className:"pb-3",children:s.jsxs(ut,{className:"flex items-center text-base",children:[s.jsx("div",{className:`p-2 rounded-lg mr-3 ${E.color==="blue"?"bg-blue-50 text-blue-600":E.color==="green"?"bg-green-50 text-green-600":E.color==="purple"?"bg-purple-50 text-purple-600":E.color==="orange"?"bg-orange-50 text-orange-600":"bg-red-50 text-red-600"}`,children:s.jsx(C,{className:"h-4 w-4"})}),E.title]})}),s.jsx(Be,{className:"flex-1 pb-4",children:s.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:E.description})}),s.jsx(co,{className:"pt-0",children:s.jsx(Y,{className:"w-full transition-all duration-200",onClick:E.action,disabled:E.isLoading,variant:"default",children:E.isLoading?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"}),E.loadingText]}):s.jsxs(s.Fragment,{children:[s.jsx(C,{className:"mr-2 h-4 w-4"}),E.buttonText]})})})]},E.id)})}),S<j.length-1&&s.jsx(yp,{className:"my-8"})]},N.title))})]})},kc=[{id:"monday",label:"Monday"},{id:"tuesday",label:"Tuesday"},{id:"wednesday",label:"Wednesday"},{id:"thursday",label:"Thursday"},{id:"friday",label:"Friday"},{id:"saturday",label:"Saturday"},{id:"sunday",label:"Sunday"}],Dv=[{value:"closed",label:"Closed"},{value:"24/7",label:"24 Hours (Always Open)"},{value:"00:00",label:"12:00 AM"},{value:"00:30",label:"12:30 AM"},{value:"01:00",label:"1:00 AM"},{value:"01:30",label:"1:30 AM"},{value:"02:00",label:"2:00 AM"},{value:"02:30",label:"2:30 AM"},{value:"03:00",label:"3:00 AM"},{value:"03:30",label:"3:30 AM"},{value:"04:00",label:"4:00 AM"},{value:"04:30",label:"4:30 AM"},{value:"05:00",label:"5:00 AM"},{value:"05:30",label:"5:30 AM"},{value:"06:00",label:"6:00 AM"},{value:"06:30",label:"6:30 AM"},{value:"07:00",label:"7:00 AM"},{value:"07:30",label:"7:30 AM"},{value:"08:00",label:"8:00 AM"},{value:"08:30",label:"8:30 AM"},{value:"09:00",label:"9:00 AM"},{value:"09:30",label:"9:30 AM"},{value:"10:00",label:"10:00 AM"},{value:"10:30",label:"10:30 AM"},{value:"11:00",label:"11:00 AM"},{value:"11:30",label:"11:30 AM"},{value:"12:00",label:"12:00 PM"},{value:"12:30",label:"12:30 PM"},{value:"13:00",label:"1:00 PM"},{value:"13:30",label:"1:30 PM"},{value:"14:00",label:"2:00 PM"},{value:"14:30",label:"2:30 PM"},{value:"15:00",label:"3:00 PM"},{value:"15:30",label:"3:30 PM"},{value:"16:00",label:"4:00 PM"},{value:"16:30",label:"4:30 PM"},{value:"17:00",label:"5:00 PM"},{value:"17:30",label:"5:30 PM"},{value:"18:00",label:"6:00 PM"},{value:"18:30",label:"6:30 PM"},{value:"19:00",label:"7:00 PM"},{value:"19:30",label:"7:30 PM"},{value:"20:00",label:"8:00 PM"},{value:"20:30",label:"8:30 PM"},{value:"21:00",label:"9:00 PM"},{value:"21:30",label:"9:30 PM"},{value:"22:00",label:"10:00 PM"},{value:"22:30",label:"10:30 PM"},{value:"23:00",label:"11:00 PM"},{value:"23:30",label:"11:30 PM"}],lSe=t=>{if(!t)return{monday:{open:"09:00",close:"17:00"},tuesday:{open:"09:00",close:"17:00"},wednesday:{open:"09:00",close:"17:00"},thursday:{open:"09:00",close:"17:00"},friday:{open:"09:00",close:"17:00"},saturday:{open:"closed",close:"closed"},sunday:{open:"closed",close:"closed"}};if(t.monday&&typeof t.monday=="object"&&t.monday.open&&t.monday.close)return t;const e={monday:{open:"09:00",close:"17:00"},tuesday:{open:"09:00",close:"17:00"},wednesday:{open:"09:00",close:"17:00"},thursday:{open:"09:00",close:"17:00"},friday:{open:"09:00",close:"17:00"},saturday:{open:"closed",close:"closed"},sunday:{open:"closed",close:"closed"}};return Object.keys(t).forEach(r=>
1199{if(typeof t[r]=="string"){const n=t[r];if(n==="Closed"||n==="closed")e[r]={open:"closed",close:"closed"};else if(n.includes(" - ")){const[a,i]=n.split(" - "),o=l=>{if(!l)return"09:00";const c=l.trim();if(c.toLowerCase().includes("am")||c.toLowerCase().includes("pm")){const u=c.replace(/[ap]m/i,"").trim(),[d,h="00"]=u.split(":");let f=parseInt(d);return c.toLowerCase().includes("pm")&&f!==12&&(f+=12),c.toLowerCase().includes("am")&&f===12&&(f=0),`${f.toString().padStart(2,"0")}:${h}`}return c};e[r]={open:o(a),close:o(i)}}}}),e},cSe=({value:t,onChange:e})=>{const[r,n]=x.useState(!1),[a,i]=x.useState(!1),o=lSe(t);Oe.useEffect(()=>{const f=kc.every(m=>{var g;return((g=o[m.id])==null?void 0:g.open)==="24/7"});i(f)},[o]);const l=(f,m,g)=>{if(r){const y={...o};kc.forEach(b=>{y[b.id]||(y[b.id]={open:"09:00",close:"17:00"}),g==="24/7"?y[b.id]={open:"24/7",close:"24/7"}:g==="closed"||y[b.id][m==="open"?"close":"open"]==="closed"?y[b.id]={open:"closed",close:"closed"}:y[b.id][m]=g}),e(y)}else{const y={...o};y[f]||(y[f]={open:"09:00",close:"17:00"}),g==="24/7"?y[f]={open:"24/7",close:"24/7"}:g==="closed"||y[f][m==="open"?"close":"open"]==="closed"?y[f]={open:"closed",close:"closed"}:y[f][m]=g,e(y)}},c=(f,m)=>{const g=o[f];return(g==null?void 0:g[m])||(m==="open"?"09:00":"17:00")},u=f=>{const m=o[f];return(m==null?void 0:m.open)==="closed"||!m},d=f=>{const m=o[f];return(m==null?void 0:m.open)==="24/7"},h=f=>{if(i(f),f){const m={...o};kc.forEach(g=>{m[g.id]={open:"24/7",close:"24/7"}}),e(m),n(!1)}else{const m={...o};kc.forEach(g=>{m[g.id]={open:"09:00",close:"17:00"}}),e(m)}};return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(rn,{className:"h-4 w-4 text-muted-foreground"}),s.jsx(Z,{className:"text-base",children:"Business Hours"})]}),s.jsx(De,{children:s.jsxs(Be,{className:"pt-6",children:[s.jsxs("div",{className:"space-y-3 mb-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ii,{id:"always-open",checked:a,onCheckedChange:h}),s.jsx(Z,{htmlFor:"always-open",children:"24/7 (Always Open)"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ii,{id:"same-hours",checked:r,onCheckedChange:n,disabled:a}),s.jsx(Z,{htmlFor:"same-hours",className:a?"text-gray-400":"",children:"Same hours for all days"})]})]}),a?s.jsxs("div",{className:"text-center py-8",children:[s.jsx("div",{className:"text-lg font-medium text-green-600",children:"ð Open 24 Hours Every Day"}),s.jsx("div",{className:"text-sm text-gray-500 mt-2",children:"Your business is set to be open 24/7"})]}):r?s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"all-open",children:"Opening Time"}),s.jsxs(Wt,{value:c(kc[0].id,"open"),onValueChange:f=>l(kc[0].id,"open",f),children:[s.jsx(Ht,{id:"all-open",children:s.jsx(qt,{placeholder:"Opening Time"})}),s.jsx($t,{children:Dv.map(f=>s.jsx(Ae,{value:f.value,children:f.label},f.value))})]})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"all-close",children:"Closing Time"}),s.jsxs(Wt,{value:c(kc[0].id,"close"),onValueChange:f=>l(kc[0].id,"close",f),disabled:c(kc[0].id,"open")==="closed"||d(kc[0].id),children:[s.jsx(Ht,{id:"all-close",children:s.jsx(qt,{placeholder:"Closing Time"})}),s.jsx($t,{children:Dv.filter(f=>f.value!=="closed"&&f.value!=="24/7").map(f=>s.jsx(Ae,{value:f.value,children:f.label},f.value))})]})]})]}):s.jsx("div",{className:"space-y-4",children:kc.map(f=>s.jsxs("div",{className:"grid grid-cols-3 gap-4 items-center",children:[s.jsx("div",{className:"font-medium",children:f.label}),s.jsx("div",{children:s.jsxs(Wt,{value:c(f.id,"open"),onValueChange:m=>l(f.id,"open",m),children:[s.jsx(Ht,{id:`${f.id}-open`,children:s.jsx(qt,{placeholder:"Opening Time"})}),s.jsx($t,{children:Dv.map(m=>s.jsx(Ae,{value:m.value,children:m.label},m.value))})]})}),s.jsx("div",{children:s.jsxs(Wt,{value:c(f.id,"close"),onValueChange:m=>l(f.id,"close",m),disabled:u(f.id)||d(f.id),children:[s.jsx(Ht,{id:`${f.id}-close`,children:s.jsx(qt,{placeholder:"Closing Time"})}),s.jsx($t,{children:Dv.filter(m=>m.value!=="closed"&&m.value!=="24/7").map(m=>s.jsx(Ae,{value:m.value,children:m.label},m.value))})]})})]},f.id))})]})})]})},uSe=()=>{const{toast:t}=St(),{refreshSettings:e}=mp(),[r,n]=x.useState(!0),[a,i]=x.useState(!1),[o,l]=x.useState(null),[c,u]=x.useState(null),d="G-6F58MGWST0",[h,f]=x.use
1199State(!0),[m,g]=x.useState(!0);x.useEffect(()=>{(async()=>{try{n(!0);const[S,E]=await Promise.all([Ch.getSiteSettings(),Ch.getSocialMediaSettings()]);l(S),u(E)}catch(S){console.error("Error loading settings:",S),t({title:"Error",description:"Failed to load settings. Please refresh the page.",variant:"destructive"})}finally{n(!1)}})()},[t]);const y=async()=>{if(o)try{i(!0);const N=await Ch.updateSiteSettings({site_title:o.site_title,city_name:o.city_name,site_logo:o.site_logo,maintenance_mode:o.maintenance_mode});l(N),await e(),t({title:"Settings saved",description:"Site settings have been updated successfully"})}catch(N){console.error("Error saving site settings:",N),t({title:"Error",description:"Failed to save site settings. Please try again.",variant:"destructive"})}finally{i(!1)}},b=async()=>{if(o)try{i(!0);const N=await Ch.updateSiteSettings({contact_email:o.contact_email,contact_phone:o.contact_phone,address_line1:o.address_line1,address_line2:o.address_line2,city:o.city,state:o.state,zip_code:o.zip_code,business_hours_json:o.business_hours_json});l(N),await e(),t({title:"Basic info saved",description:"Contact information has been updated successfully"})}catch(N){console.error("Error saving basic info:",N),t({title:"Error",description:"Failed to save contact information. Please try again.",variant:"destructive"})}finally{i(!1)}},w=()=>{t({title:"Analytics settings saved",description:"Your analytics preferences have been updated"})},j=async()=>{if(c)try{i(!0);const N=await Ch.updateSocialMediaSettings({facebook_url:c.facebook_url,twitter_url:c.twitter_url,linkedin_url:c.linkedin_url,instagram_url:c.instagram_url,youtube_url:c.youtube_url,tiktok_url:c.tiktok_url});u(N),t({title:"Social media links saved",description:"Your social media links have been updated"})}catch(N){console.error("Error saving social media settings:",N),t({title:"Error",description:"Failed to save social media links. Please try again.",variant:"destructive"})}finally{i(!1)}};return r?s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsx("h2",{className:"text-xl sm:text-2xl font-bold",children:"Admin Settings"}),s.jsx("div",{className:"flex items-center justify-center p-6 sm:p-8",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-chamber-blue mx-auto mb-2"}),s.jsx("p",{className:"text-muted-foreground text-sm sm:text-base",children:"Loading settings..."})]})})]}):s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl sm:text-2xl font-bold",children:"Admin Settings"}),s.jsx("p",{className:"text-muted-foreground text-sm mt-0.5",children:"Configure site, contact, social, and analytics"})]}),s.jsxs(sn,{defaultValue:"basic",children:[s.jsxs(Qs,{className:"mb-4 flex w-full flex-wrap h-auto gap-1 p-1",children:[s.jsx(Gt,{value:"basic",className:"flex-1 min-w-0 sm:flex-initial",children:"Basic Info"}),s.jsx(Gt,{value:"site",className:"flex-1 min-w-0 sm:flex-initial",children:"Site"}),s.jsx(Gt,{value:"social",className:"flex-1 min-w-0 sm:flex-initial",children:"Social"}),s.jsx(Gt,{value:"analytics",className:"flex-1 min-w-0 sm:flex-initial",children:"Analytics"})]}),s.jsx(Rt,{value:"basic",className:"space-y-4 mt-0",children:s.jsxs(De,{children:[s.jsxs(ot,{className:"p-4 sm:p-6",children:[s.jsx(ut,{className:"text-lg sm:text-xl",children:"Basic Contact Information"}),s.jsx(us,{className:"text-sm",children:"Configure your organization's contact details and business hours"})]}),s.jsxs(Be,{className:"space-y-4 p-4 sm:p-6 pt-0",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"contact-email",children:"Contact Email"}),s.jsx(Ne,{id:"contact-email",type:"email",value:(o==null?void 0:o.contact_email)||"",onChange:N=>l(S=>S?{...S,contact_email:N.target.value}:null)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"contact-phone",children:"Phone Number"}),s.jsx(Ne,{id:"contact-phone",value:(o==null?void 0:o.contact_phone)||"",onChange:N=>l(S=>S?{...S,contact_phone:N.target.value}:null)})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"address-line1",children:"Address Line 1"}),s.jsx(Ne,{id:"address-line1",value:(o==null?void 0:o.address_line1)||"",onChange:N=>l(S=>S?{...S,address_line1:N.target.value}:null)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"address-line2",children:"Address Line 2 (Optional)"}),s.jsx(Ne,{id:"address-line2",value:(o==null?void 0:o.address_line2)||"",onChange:N=>l(S=>S?{...S,address_line2:N.target.value}:null)})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"city",children:"City"}),s.jsx(Ne,{id:"city",value:(o==null?void 0:o.city)||"",onChange:N=>l(S=>S?{...S,city:N.target.value}:null)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"state",children:"State"}),s.jsx(Ne,{id:"state",value:(o==null?void 0:o.state)||"",onChange:N=>l(S=>S?{...S,state:N.target.value}:null)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"zip-code",children:"ZIP Co
1199de"}),s.jsx(Ne,{id:"zip-code",value:(o==null?void 0:o.zip_code)||"",onChange:N=>l(S=>S?{...S,zip_code:N.target.value}:null)})]})]}),s.jsx(cSe,{value:(o==null?void 0:o.business_hours_json)||(o==null?void 0:o.business_hours)||{monday:{open:"09:00",close:"17:00"},tuesday:{open:"09:00",close:"17:00"},wednesday:{open:"09:00",close:"17:00"},thursday:{open:"09:00",close:"17:00"},friday:{open:"09:00",close:"17:00"},saturday:{open:"closed",close:"closed"},sunday:{open:"closed",close:"closed"}},onChange:N=>l(S=>S?{...S,business_hours_json:N}:null)}),s.jsx(Y,{onClick:b,disabled:a,className:"w-full sm:w-auto",children:a?"Saving...":"Save Basic Information"})]})]})}),s.jsx(Rt,{value:"site",className:"space-y-4 mt-0",children:s.jsxs(De,{children:[s.jsxs(ot,{className:"p-4 sm:p-6",children:[s.jsx(ut,{className:"text-lg sm:text-xl",children:"General Site Settings"}),s.jsx(us,{className:"text-sm",children:"Configure your website's basic information"})]}),s.jsxs(Be,{className:"space-y-4 p-4 sm:p-6 pt-0",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"site-title",children:"Site Title"}),s.jsx(Ne,{id:"site-title",value:(o==null?void 0:o.site_title)||"",onChange:N=>l(S=>S?{...S,site_title:N.target.value}:null)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"city-name",children:"City Name"}),s.jsx(Ne,{id:"city-name",value:(o==null?void 0:o.city_name)||"",onChange:N=>l(S=>S?{...S,city_name:N.target.value}:null),placeholder:"e.g., Valley Stream"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"site-logo",children:"Logo URL"}),s.jsx(Ne,{id:"site-logo",value:(o==null?void 0:o.site_logo)||"",onChange:N=>l(S=>S?{...S,site_logo:N.target.value}:null)})]}),s.jsxs("div",{className:"flex items-center space-x-2 pt-2",children:[s.jsx(Wl,{id:"maintenance",checked:(o==null?void 0:o.maintenance_mode)||!1,onCheckedChange:N=>l(S=>S?{...S,maintenance_mode:N}:null)}),s.jsx(Z,{htmlFor:"maintenance",className:"text-sm",children:"Enable Maintenance Mode"})]}),s.jsx(Y,{onClick:y,disabled:a,className:"w-full sm:w-auto",children:a?"Saving...":"Save Site Settings"})]})]})}),s.jsx(Rt,{value:"analytics",className:"space-y-4 mt-0",children:s.jsxs(De,{children:[s.jsxs(ot,{className:"p-4 sm:p-6",children:[s.jsx(ut,{className:"text-lg sm:text-xl",children:"Analytics Settings"}),s.jsx(us,{className:"text-sm",children:"Configure analytics and tracking"})]}),s.jsxs(Be,{className:"space-y-4 p-4 sm:p-6 pt-0",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"ga-id",children:"Google Analytics ID"}),s.jsx(Ne,{id:"ga-id",placeholder:"Configure via VITE_GA4_MEASUREMENT_ID",value:d,readOnly:!0,className:"bg-muted min-w-0"}),s.jsx("p",{className:"text-sm text-muted-foreground break-words",children:`â
Analytics is configured and active (${d})`})]}),s.jsxs("div",{className:"flex items-center space-x-2 pt-2",children:[s.jsx(Wl,{id:"cookie-banner",checked:h,onCheckedChange:N=>f(N)}),s.jsx(Z,{htmlFor:"cookie-banner",className:"text-sm",children:"Enable Cookie Consent Banner"})]}),s.jsxs("div",{className:"flex items-center space-x-2 pt-2",children:[s.jsx(Wl,{id:"collect-data",checked:m,onCheckedChange:N=>g(N)}),s.jsx(Z,{htmlFor:"collect-data",className:"text-sm",children:"Collect Anonymous Usage Data"})]}),s.jsx(Y,{onClick:w,className:"w-full sm:w-auto",children:"Save Analytics Settings"})]})]})}),s.jsx(Rt,{value:"social",className:"space-y-4 mt-0",children:s.jsxs(De,{children:[s.jsxs(ot,{className:"p-4 sm:p-6",children:[s.jsx(ut,{className:"text-lg sm:text-xl",children:"Social Media Links"}),s.jsx(us,{className:"text-sm",children:"Set up your organization's social media profiles"})]}),s.jsxs(Be,{className:"space-y-4 p-4 sm:p-6 pt-0",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"facebook",children:"Facebook URL"}),s.jsx(Ne,{id:"facebook",value:(c==null?void 0:c.facebook_url)||"",onChange:N=>u(S=>S?{...S,facebook_url:N.target.value}:null),placeholder:"https://facebook.com/yourpage"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"twitter",children:"Twitter URL"}),s.jsx(Ne,{id:"twitter",value:(c==null?void 0:c.twitter_url)||"",onChange:N=>u(S=>S?{...S,twitter_url:N.target.value}:null),placeholder:"https://twitter.com/yourhandle"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"linkedin",children:"LinkedIn URL"}),s.jsx(Ne,{id:"linkedin",value:(c==null?void 0:c.linkedin_url)||"",onChange:N=>u(S=>S?{...S,linkedin_url:N.target.value}:null),placeholder:"https://linkedin.com/company/yourcompany"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"instagram",children:"Instagram URL"}),s.jsx(Ne,{id:"instagram",value:(c==null?void 0:c.instagram_url)||"",onChange:N=>u(S=>S?{...S,instagram_url:N.target.value}:null),placeholder:"https://instagram.com/yourhandle"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"youtube",children:"YouTube URL"}),s.jsx(Ne,{id:"youtube",value:(c==null?void 0:c.youtube_url)||"",onChange:N=>u(S=>S?{...S,youtube_url:N.target.value}:null),placeholder:"https://youtube.com/c/yourchannel"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"tiktok",children:"TikTok URL"}),s.jsx(Ne,{id:"tiktok",value:(c==null?void 0:c.tiktok_url)||"",onChange:N=>u(S=>S?{...S,tiktok_url:N.target.value}:null),placeholder:"https://tiktok.com/@yourhandle"})]})]}),s.jsx(Y,{onClick:j,disabled:a,className:"w-full sm:w-auto",children:a?"Saving...":"Save Social Media Links"})]})]})})]})]})};function $D({itemId:t,itemName:e,itemType:r,status:n,onApprove:a,onReject:i,adminNotes:o,reviewedBy:l,reviewedAt:c,className:u=""}){const{user:d}
1199=ts(),[h,f]=x.useState(!1),[m,g]=x.useState(!1),y=async()=>{if(d!=null&&d.id){g(!0);try{await a(t,d.id),ct.success(`${r==="business"?"Business":"Blog post"} approved successfully`)}catch{ct.error("Failed to approve item")}finally{g(!1)}}},b=async w=>{if(d!=null&&d.id){g(!0);try{await i(t,w,d.id),ct.success(`${r==="business"?"Business":"Blog post"} rejected`)}catch{ct.error("Failed to reject item")}finally{g(!1)}}};return n==="approved"||n==="rejected"||n==="published"?s.jsxs("div",{className:`space-y-2 ${u}`,children:[s.jsx("div",{className:"flex items-center gap-2",children:n==="approved"||n==="published"?s.jsxs("div",{className:"flex items-center gap-1 text-green-600",children:[s.jsx(un,{className:"h-4 w-4"}),s.jsx("span",{className:"text-sm font-medium",children:n==="published"?"Published":"Approved"})]}):s.jsxs("div",{className:"flex items-center gap-1 text-red-600",children:[s.jsx(Ir,{className:"h-4 w-4"}),s.jsx("span",{className:"text-sm font-medium",children:"Rejected"})]})}),o&&s.jsx("div",{className:"bg-gray-50 p-2 rounded text-sm",children:s.jsxs("div",{className:"flex items-start gap-1",children:[s.jsx(pw,{className:"h-3 w-3 mt-0.5 text-gray-500"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-gray-700",children:o}),c&&s.jsx("p",{className:"text-xs text-gray-500 mt-1",children:new Date(c).toLocaleDateString()})]})]})})]}):n==="pending"?s.jsxs("div",{className:`flex gap-2 ${u}`,children:[s.jsxs(Y,{size:"sm",variant:"outline",onClick:y,disabled:m,className:"text-green-600 border-green-600 hover:bg-green-50",children:[s.jsx(un,{className:"h-4 w-4 mr-1"}),"Approve"]}),s.jsxs(Y,{size:"sm",variant:"outline",onClick:()=>f(!0),disabled:m,className:"text-red-600 border-red-600 hover:bg-red-50",children:[s.jsx(Ir,{className:"h-4 w-4 mr-1"}),"Reject"]}),s.jsx(hx,{isOpen:h,onClose:()=>f(!1),onConfirm:b,title:`Reject ${r==="business"?"Business":"Blog Post"}`,description:"You are about to reject",itemName:e,isLoading:m})]}):null}const dSe=({isOpen:t,onClose:e,onSuccess:r})=>{const{toast:n}=St(),[a,i]=x.useState(""),[o,l]=x.useState(""),[c,u]=x.useState(""),[d,h]=x.useState(""),[f,m]=x.useState("draft"),[g,y]=x.useState(""),[b,w]=x.useState([]),[j,N]=x.useState(!1);x.useEffect(()=>{t&&(async()=>{try{const T=await sj();w(T)}catch(T){console.error("Error fetching categories:",T),n({title:"Error",description:"Failed to load categories",variant:"destructive"})}})()},[t,n]);const S=async C=>{if(C.preventDefault(),!a.trim()){n({title:"Error",description:"Title is required",variant:"destructive"});return}if(!g){n({title:"Error",description:"Please select a category",variant:"destructive"});return}N(!0);try{await X8({title:a.trim(),content:o.trim(),excerpt:c.trim()||o.trim().substring(0,200)+(o.length>200?"...":""),featured_image:d.trim(),status:f,category_ids:[g]}),n({title:"Success!",description:"Blog post created successfully"}),i(""),l(""),u(""),h(""),m("draft"),y(""),r(),e()}catch(T){console.error("Error creating post:",T),n({title:"Error",description:"Failed to create blog post. Please try again.",variant:"destructive"})}finally{N(!1)}},E=()=>{j||(i(""),l(""),u(""),h(""),m("draft"),y(""),e())};return s.jsx(Tt,{open:t,onOpenChange:E,children:s.jsx(Dt,{className:"sm:max-w-[700px] max-h-[90vh] overflow-y-auto",children:s.jsxs("form",{onSubmit:S,children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Create New Blog Post"}),s.jsx(rr,{children:"Fill out the form below to create a new blog post."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"title",className:"text-right",children:"Title"}),s.jsx(Ne,{id:"title",value:a,onChange:C=>i(C.target.value),className:"col-span-3",required:!0,disabled:j})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"excerpt",className:"text-right pt-2",children:"Excerpt"}),s.jsx(zt,{id:"excerpt",value:c,onChange:C=>u(C.target.value),className:"col-span-3",rows:3,placeholder:"Brief description of the post (optional - will auto-generate if empty)",disabled:j})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"category",className:"text-right",children:"Category"}),s.jsxs(Wt,{value:g,onValueChange:y,disabled:j,children:[s.jsx(Ht,{className:"col-span-3",children:s.jsx(qt,{placeholder:"Select a category"})}),s.jsx($t,{children:b.map(C=>s.jsx(Ae,{value:C.id,children:C.name},C.id))})]})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx("div",{className:"text-right pt-2",children:s.jsx(Z,{children:"Featured Image"})}),s.jsx("div",{className:"col-span-3",children:s.jsx(aj,{value:d,onChange:h,disabled:j,label:"",placeholder:"https://example.com/image.jpg"})})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"content",className:"text-right pt-2",children:"Content"}),s.jsx(zt,{id:"content",value:o,onChange:C=>l(C.target.value),className:"col-span-3",rows:8,placeholder:"Write your blog post content here...",disabled:j})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"status",className:"text-right",children:"Status"}),s.jsxs(Wt,{value:f,onValueChange:C=>m(C),disabled:j,children:[s.jsx(Ht,{className:"col-span-3",children:s.jsx(qt,{placeholder:"Select a status"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"draft",children:"Draft"}),s.jsx(Ae,{value:"pending",children:"Pending Approval"}),s.jsx(Ae,{value:"published",children:"Published"})]})]})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",type:"button",onClick:E,disabled:j,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:j,children:j?"Creating...":"Create Post"})]})]})})})},hSe=({isOpen:t,onClose:e,onSuccess:r,post:n})=>{const{toast:a}=St(),[i,o]=x.useState(""),[l,c]=x.useState(""),[u,d]=x.useState(""),[h,f]=x.use
1199State(""),[m,g]=x.useState("draft"),[y,b]=x.useState(""),[w,j]=x.useState([]),[N,S]=x.useState(!1);x.useEffect(()=>{t&&(async()=>{try{console.log("Loading categories...");const D=await sj();console.log("Categories loaded:",D),j(D)}catch(D){console.error("Error fetching categories:",D),a({title:"Error",description:"Failed to load categories",variant:"destructive"})}})()},[t,a]),x.useEffect(()=>{n&&t&&(console.log("Populating form with post data:",n),o(n.title),c(n.content),d(n.excerpt||""),f(n.featured_image||""),g(n.status))},[n,t]),x.useEffect(()=>{if(n&&w.length>0&&t&&(console.log("Setting selected category. Post categories:",n.categories,"Available categories:",w),b(""),n.categories&&n.categories.length>0)){const T=n.categories[0];console.log("Looking for category with name:",T);const D=w.find(A=>A.name===T);console.log("Found matching category:",D),D?(b(D.id),console.log("Selected category set to:",D.id)):console.warn("No matching category found for:",T)}},[n,w,t]),x.useEffect(()=>{t||(console.log("Modal closed, resetting form state"),o(""),c(""),d(""),f(""),g("draft"),b(""),j([]))},[t]);const E=async T=>{if(T.preventDefault(),!!n){if(!i.trim()){a({title:"Error",description:"Title is required",variant:"destructive"});return}if(!y){a({title:"Error",description:"Please select a category",variant:"destructive"});return}S(!0);try{await Ove({id:n.id,title:i.trim(),content:l.trim(),excerpt:u.trim()||l.trim().substring(0,200)+(l.length>200?"...":""),featured_image:h.trim(),status:m,category_ids:[y]}),a({title:"Success!",description:"Blog post updated successfully"}),r(),e()}catch(D){console.error("Error updating post:",D),a({title:"Error",description:"Failed to update blog post. Please try again.",variant:"destructive"})}finally{S(!1)}}},C=()=>{N||e()};return n?s.jsx(Tt,{open:t,onOpenChange:C,children:s.jsx(Dt,{className:"sm:max-w-[700px] max-h-[90vh] overflow-y-auto",children:s.jsxs("form",{onSubmit:E,children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Edit Blog Post"}),s.jsx(rr,{children:"Update the blog post details below."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"title",className:"text-right",children:"Title"}),s.jsx(Ne,{id:"title",value:i,onChange:T=>o(T.target.value),className:"col-span-3",required:!0,disabled:N})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"excerpt",className:"text-right pt-2",children:"Excerpt"}),s.jsx(zt,{id:"excerpt",value:u,onChange:T=>d(T.target.value),className:"col-span-3",rows:3,placeholder:"Brief description of the post (optional - will auto-generate if empty)",disabled:N})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"category",className:"text-right",children:"Category"}),s.jsxs(Wt,{value:y,onValueChange:b,disabled:N,children:[s.jsx(Ht,{className:"col-span-3",children:s.jsx(qt,{placeholder:"Select a category"})}),s.jsx($t,{children:w.map(T=>s.jsx(Ae,{value:T.id,children:T.name},T.id))})]})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx("div",{className:"text-right pt-2",children:s.jsx(Z,{children:"Featured Image"})}),s.jsx("div",{className:"col-span-3",children:s.jsx(aj,{value:h,onChange:f,disabled:N,label:"",placeholder:"https://example.com/image.jpg"})})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"content",className:"text-right pt-2",children:"Content"}),s.jsx(zt,{id:"content",value:l,onChange:T=>c(T.target.value),className:"col-span-3",rows:8,placeholder:"Write your blog post content here...",disabled:N})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"status",className:"text-right",children:"Status"}),s.jsxs(Wt,{value:m,onValueChange:T=>g(T),disabled:N,children:[s.jsx(Ht,{className:"col-span-3",children:s.jsx(qt,{placeholder:"Select a status"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"draft",children:"Draft"}),s.jsx(Ae,{value:"pending",children:"Pending Approval"}),s.jsx(Ae,{value:"published",children:"Published"})]})]})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",type:"button",onClick:C,disabled:N,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:N,children:N?"Updating...":"Update Post"})]})]})})}):null},mSe=({isOpen:t,onClose:e,post:r})=>{if(!r)return null;const n=()=>{r.status==="published"&&window.open(`/news/blog/${r.id}`,"_blank")};return s.jsx(Tt,{open:t,onOpenChange:e,children:s.jsxs(Dt,{className:"sm:max-w-[800px] max-h-[90vh] overflow-y-auto",children:[s.jsxs(It,{children:[s.jsxs("div",{className:"flex flex-col gap-3 mb-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ot,{className:"text-xl",children:r.title}),s.jsx(ke,{variant:r.status==="published"?"default":"secondary",children:r.status==="published"?"Published":"Draft"})]}),r.status==="published"&&s.jsx("div",{className:"flex justify-start",children:s.jsxs(Y,{variant:"outline",size:"sm",onClick:n,className:"flex items-center gap-2",children:[s.jsx(wx,{className:"h-4 w-4"}),"View Live"]})})]}),s.jsx(rr,{children:"Preview of the blog post content"})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-sm text-muted-foreground border-b pb-4",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(ma,{className:"h-4 w-4"}),s.jsx("span",{children:r.author_name||"Unknown Author"})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Br,{className:"h-4 w-4"}),s.jsx("span",{children:r.status==="published"&&r.publish_date?Cs(new Date(r.publish_date),"MMMM d, yyyy"):`Created ${Cs(new Date(r.created_at),"MMMM d, yyyy")}`})]}),r.categories&&r.categories.length>0&&s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(ji,{className:"h-4 w-4"}),s.jsx("div",{className:"flex gap-1",children:r.categories.map(a=>s.jsx(ke,{variant:"outline",className:"text-xs",children:a},a))})]})]}),r.featured_image&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("h3",{className:"font-medium",children:"Featured Image"}
1199),s.jsx("div",{className:"w-full max-h-64 rounded-lg border overflow-hidden",children:s.jsx("img",{src:r.featured_image,alt:r.title,className:"w-full h-full object-cover",onError:a=>{a.currentTarget.src="/placeholder.svg",a.currentTarget.className="w-16 h-16 opacity-50 mx-auto mt-12",a.currentTarget.style.objectFit="contain"}})})]}),r.excerpt&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("h3",{className:"font-medium",children:"Excerpt"}),s.jsx("p",{className:"text-muted-foreground italic border-l-4 border-muted pl-4",children:r.excerpt})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("h3",{className:"font-medium",children:"Content"}),s.jsx("div",{className:"prose prose-sm max-w-none border rounded-lg p-4 bg-muted/20",children:s.jsx(Xw,{remarkPlugins:[Qw],children:r.content||"No content available"})})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm border-t pt-4",children:[s.jsxs("div",{children:[s.jsx("span",{className:"font-medium",children:"Post ID:"})," ",r.id]}),s.jsxs("div",{children:[s.jsx("span",{className:"font-medium",children:"Slug:"})," ",r.slug]}),s.jsxs("div",{children:[s.jsx("span",{className:"font-medium",children:"Created:"})," ",Cs(new Date(r.created_at),"MMM d, yyyy HH:mm")]}),s.jsxs("div",{children:[s.jsx("span",{className:"font-medium",children:"Updated:"})," ",Cs(new Date(r.updated_at),"MMM d, yyyy HH:mm")]})]})]})]})})},fSe=()=>{const{toast:t}=St(),{user:e}=ts(),[r,n]=x.useState([]),[a,i]=x.useState([]),[o,l]=x.useState(!0),[c,u]=x.useState(!1),[d,h]=x.useState(null),[f,m]=x.useState("all"),[g,y]=x.useState("all"),[b,w]=x.useState(!1),[j,N]=x.useState(!1),[S,E]=x.useState(!1),[C,T]=x.useState(null);x.useEffect(()=>{(async()=>{l(!0);try{const[$,W]=await Promise.all([Pc(),sj()]);n($),i(W)}catch($){console.error("Error fetching data:",$),t({title:"Error",description:"Failed to fetch blog posts and categories",variant:"destructive"})}finally{l(!1)}})()},[t]);const D=()=>{(async()=>{try{const $=await Pc();n($)}catch($){console.error("Error fetching blog posts:",$)}})()},A=B=>{T(B),N(!0)},R=B=>{T(B),E(!0)},M=()=>{(async()=>{try{const $=await Pc();n($)}catch($){console.error("Error fetching blog posts:",$)}})()},P=async B=>{try{await Uve(B),n(r.filter($=>$.id!==B)),t({title:"Success",description:"Blog post deleted successfully"})}catch($){console.error("Error deleting blog post:",$),t({title:"Error",description:"Failed to delete blog post",variant:"destructive"})}u(!1),h(null)},U=()=>{d&&P(d)},I=async(B,$)=>{try{await qwe({id:B,reviewedBy:$});const W=await Pc();n(W)}catch(W){throw console.error("Error approving blog post:",W),W}},O=async(B,$,W)=>{try{await Wwe({id:B,adminNotes:$,reviewedBy:W});const oe=await Pc();n(oe)}catch(oe){throw console.error("Error rejecting blog post:",oe),oe}},V=r.filter(B=>{var oe;let $=!0;f==="published"?$=B.status==="published":f==="draft"?$=B.status==="draft":f==="pending"&&($=B.status==="pending");let W=!0;return g!=="all"&&(W=((oe=B.categories)==null?void 0:oe.some(K=>K===g))||!1),$&&W}),G=B=>{switch(B){case"published":return s.jsx(ke,{variant:"default",children:"Published"});case"pending":return s.jsx(ke,{variant:"secondary",className:"bg-yellow-100 text-yellow-800",children:"Pending Approval"});case"draft":default:return s.jsx(ke,{variant:"outline",children:"Draft"})}};return o?s.jsxs("div",{className:"flex items-center justify-center py-12",children:[s.jsx(Mt,{className:"h-8 w-8 animate-spin"}),s.jsx("span",{className:"ml-2",children:"Loading blog posts..."})]}):s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-xl sm:text-2xl font-bold",children:"Blog Management"}),s.jsx("p",{className:"text-muted-foreground",children:"Manage blog posts, news, and jobs"})]}),s.jsxs(Y,{className:"w-full sm:w-auto flex items-center justify-center gap-2",onClick:()=>w(!0),children:[s.jsx(vs,{className:"h-4 w-4"}),"Create New Post"]})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Yg,{className:"h-4 w-4 text-muted-foreground shrink-0"}),s.jsx("span",{className:"text-sm font-medium",children:"Filter by Category:"})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs(Wt,{value:g,onValueChange:y,children:[s.jsx(Ht,{className:"w-full sm:w-[200px]",children:s.jsx(qt,{placeholder:"All Categories"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"all",children:"All Categories"}),a.map(B=>s.jsx(Ae,{value:B.name,children:B.name},B.id))]})]}),g!=="all"&&s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>y("all"),className:"text-muted-foreground hover:text-foreground",children:"Clear Filter"})]})]}),s.jsxs(sn,{value:f,onValueChange:m,children:[s.jsxs(Qs,{className:"flex w-full flex-wrap h-auto gap-1 p-1",children:[s.jsxs(Gt,{value:"all",children:["All Posts (",r.filter(B=>{var $;return g==="all"||(($=B.categories)==null?void 0:$.some(W=>W===g))}).length,")"]}),s.jsxs(Gt,{value:"published",children:["Published (",r.filter(B=>{var $;return B.status==="published"&&(g==="all"||(($=B.categories)==null?void 0:$.some(W=>W===g)))}).length,")"]}),s.jsxs(Gt,{value:"pending",children:["Pending (",r.filter(B=>{var $;return B.status==="pending"&&(g==="all"||(($=B.categories)==null?void 0:$.some(W=>W===g)))}).length,")"]}),s.jsxs(Gt,{value:"draft",children:["Drafts (",r.filter(B=>{var $;return B.status==="draft"&&(g==="all"||(($=B.categories)==null?void 0:$.some(W=>W===g)))}).length,")"]})]}),s.jsx(Rt,{value:f,className:"space-y-4",children:s.jsxs(De,{children:[s.jsx(ot,{className:"p-4 sm:p-6",children:s.jsx(ut,{className:"text-lg sm:text-xl",children:"Blog Posts"})}),s.jsx(Be,{className:"p-4 pt-0 sm:p-6 sm:pt-0",children:V.length===0?s.jsx("div",{className:"text-center py-8",children:s.jsx("p",{className:"text-muted-foreground",children:"No posts found"})}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"md:hidden space-y-3",children:V.map(B=>s.jsx(De,{className:"overflow-hidden",children:s.jsxs(Be,{className:"p-4 space-y-3",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium line-clamp-2",children:B.title}),s.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:B.author_name||"Unknown"})]}),s.jsx("div",{className:"shrink-0",children:G(B.status)})]}),s.jsx("div",{className:"flex flex-wrap gap-1",children:(B.categories||[]).map($=>s.jsx(ke,{variant:"outline",className:"text-xs",children:$},$))}),s.jsx("p",{className:"text-xs text-muted-foreground",children:Cs(new Date(B.created_at),"MMM d, yyyy")}),s.jsxs("div",{className:"flex flex-wrap gap-1 pt-1",children:[s.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 shrink-0",onClick:()=>R(B),title:B.status==="published"?"View/Preview post":"Preview draft post",children:s.jsx(Xs,{className:"h-4 w-4"})}),s.jsx($D,{itemId:B.id,itemName:B.title,itemType:"blog",status:B.status,onApprove:I,onReject:O,adminNotes:B.admin_notes,reviewedBy:B.reviewed_by,reviewedAt:B.reviewed_at}),s.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 shrink-0",onClick:()=>A(B),title:"Edit post",children:s.jsx(zs,{className:"h-4 w-4"})}),s.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-destructive hover:text-destructive/90 shrink-0",onClick:()=>{h(B.id),u(!0)},title:"Delete post",children:s.jsx(vr,{className:"h-4 w-4"})})]})]})},B.id))}),s.jsx("div",{className:"hidden md:block overflow-x-auto",children:s.jsxs(Oi,{children:[s.jsx(zi,{children:s.jsxs(As,{children:[s.jsx(At,{children:"Title"}),s.jsx(At,{children:"Status"}),s.jsx(At,{children:"Author"}),s.jsx(At,{children:"Categories"}),s.jsx(At,{children:"Created"}),s.jsx(At,{className:"text-right",children:"Actions"})]})}),s.jsx(Ui,{children:V.map(B=>s.jsxs(As,{children:[s.jsx(Ct,{className:"font-medium",children:B.title}),s.jsx(Ct,{children:G(B.status)}),s.jsx(Ct,{children:B.author_name||"Unknown"}),s.jsx(Ct,{children:s.jsx("div",{className:"flex flex-wrap gap-1",children:(B.categories||[]).map($=>s.jsx(ke,{variant:"outline",className:"text-xs",children:$},$))})}),s.jsx(Ct,{children:Cs(new Date(B.created_at),"MMM d, yyyy")}),s.jsx(Ct,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-2 items-center",children:[s.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>R(B),title:B.status==="published"?"View/Preview post":"Preview draft post",children:s.jsx(Xs,{className:"h-4 w-4"})}),s.jsx($D,{itemId:B.id,itemName:B.title,itemType:"blog",status:B.status,onApprove:I,onReject:O,adminNotes:B.admin_notes,reviewedBy:B.reviewed_by,reviewedAt:B.reviewed_at}),s.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:()=>A(B),title:"Edit post",children:s.jsx(zs,{className:"h-4 w-4"})}),s.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-red-500 hover:text-red-600",onClick:()=>{h(B.id),u(!0)},title:"Delete post",children:s.jsx(vr,{className:"h-4 w-4"})})]})})]},B.id))})]})})]})})]})})]}),s.jsx(ai,{open:c,onOpenChange:u,children:s.jsxs(Oa,{children:[s.jsxs(za,{children:[s.jsx(Ha,{children:"Are you sure?"}),s.jsx($a,{children:"This action cannot be undone. This will permanently delete the blog post."})]}),s.jsxs(Ua,{children:[s.jsx(qa,{children:"Cancel"}),s.jsx(Wa,{onClick:U,className:"bg-red-600 hover:bg-red-700",children:"Delete"})]})]})}),s.jsx(dSe,{isOpen:b,onClose:()=>w(!1),onSuccess:D}),s.jsx(hSe,{isOpen:j,onClose:()=>N(!1),onSuccess:M,post:C}),s.jsx(mSe,{isOpen:S,onClose:()=>E(!1),post:C})]})},pSe=()=>{var b,w,j,N,S,E,C,T;const{id:t}=Dd(),{user:e}=ts(),[r,n]=x.useState(null),[a,i]=x.useState(!0),[o,l]=x.useState(!1),[c,u]=x.useState(!1),[d,h]=x.useState(!1);x.useEffect(()=>{(async()=>
1199{if(t){i(!0),console.log("Fetching business with ID for admin:",t);try{const A=await Jf(t);console.log("Fetched business for admin:",A),n(A),A||ct.error("Business not found")}catch(A){console.error("Error fetching business details:",A),ct.error("Failed to load business details")}finally{i(!1)}}})()},[t]);const f=async()=>{if(!(!r||!(e!=null&&e.id))){h(!0);try{const D=await f_({id:r.id,reviewedBy:e.id});D.success?(ct.success(`${r.name} has been approved!`),n(A=>A?{...A,status:"approved",admin_notes:null,reviewed_by:e.id,reviewed_at:new Date().toISOString()}:null),l(!1)):ct.error(D.error||"Failed to approve business")}catch{ct.error("Failed to approve business")}finally{h(!1)}}},m=async D=>{if(!(!r||!(e!=null&&e.id))){h(!0);try{const A=await m_({id:r.id,adminNotes:D,reviewedBy:e.id});A.success?(ct.success(`${r.name} has been rejected`),n(R=>R?{...R,status:"rejected",admin_notes:D,reviewed_by:e.id,reviewed_at:new Date().toISOString()}:null),u(!1)):ct.error(A.error||"Failed to reject business")}catch{ct.error("Failed to reject business")}finally{h(!1)}}},g=D=>{switch(D){case"approved":return s.jsx(ke,{className:"bg-green-100 text-green-800 border-green-200",children:"Approved"});case"pending":return s.jsx(ke,{className:"bg-yellow-100 text-yellow-800 border-yellow-200",children:"Pending"});case"rejected":return s.jsx(ke,{className:"bg-red-100 text-red-800 border-red-200",children:"Rejected"});default:return s.jsx(ke,{variant:"secondary",children:D})}},y=D=>!D.open||!D.close?"Not specified":D.open==="closed"||D.close==="closed"?"Closed":D.open==="24/7"||D.close==="24/7"?"24 Hours":iI(D.open,D.close);return a?s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container mx-auto px-4 flex flex-col items-center justify-center",children:[s.jsx(Mt,{className:"h-12 w-12 text-blue-600 animate-spin mb-4"}),s.jsx("h1",{className:"text-2xl font-bold",children:"Loading business details..."})]})}):r?s.jsxs("div",{className:"py-4 sm:py-6",children:[s.jsxs("div",{className:"container mx-auto px-3 sm:px-4",children:[s.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4 mb-4 sm:mb-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-4 min-w-0",children:[s.jsx(rt,{to:"/dashboard/admin/businesses",className:"shrink-0",children:s.jsxs(Y,{variant:"ghost",size:"sm",children:[s.jsx(pn,{className:"mr-2 h-4 w-4"}),"Back"]})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("h1",{className:"text-xl sm:text-2xl font-bold break-words",children:r.name}),s.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[g(r.status),r.featured&&s.jsx(ke,{variant:"outline",className:"bg-blue-50 text-blue-700 border-blue-200",children:"Featured"})]})]})]}),r.status==="pending"&&s.jsxs("div",{className:"flex flex-wrap gap-2 shrink-0",children:[s.jsxs(Y,{onClick:()=>l(!0),className:"bg-green-600 hover:bg-green-700",disabled:d,children:[s.jsx(un,{className:"w-4 h-4 mr-2"}),"Approve Business"]}),s.jsxs(Y,{onClick:()=>u(!0),variant:"destructive",disabled:d,children:[s.jsx(Ir,{className:"w-4 h-4 mr-2"}),"Reject Business"]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4 sm:gap-6 mb-6 sm:mb-8",children:[s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs(ut,{className:"flex items-center text-lg",children:[s.jsx(ma,{className:"mr-2 h-5 w-5"}),"Business Owner"]}
1199)}),s.jsxs(Be,{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-gray-500",children:"Registration Date"}),s.jsx("p",{className:"font-medium",children:new Date(r.createdAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-gray-500",children:"Last Updated"}),s.jsx("p",{className:"font-medium",children:new Date(r.updatedAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})})]})]})]}),s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs(ut,{className:"flex items-center text-lg",children:[s.jsx(wi,{className:"mr-2 h-5 w-5"}),"Contact Information"]})}),s.jsxs(Be,{className:"space-y-3",children:[r.phone&&r.phone.trim()!==""&&s.jsxs("div",{className:"flex items-center",children:[s.jsx(wi,{className:"mr-2 h-4 w-4 text-gray-400"}),s.jsx("span",{children:r.phone})]}),r.email&&r.email.trim()!==""&&s.jsxs("div",{className:"flex items-center",children:[s.jsx(fs,{className:"mr-2 h-4 w-4 text-gray-400"}),s.jsx("span",{children:r.email})]}),r.website&&r.website.trim()!==""&&s.jsxs("div",{className:"flex items-center",children:[s.jsx(Bc,{className:"mr-2 h-4 w-4 text-gray-400"}),s.jsx("a",{href:r.website,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline max-w-[200px] truncate block",title:r.website,children:r.website})]}),!((b=r.phone)!=null&&b.trim())&&!((w=r.email)!=null&&w.trim())&&!((j=r.website)!=null&&j.trim())&&s.jsx("p",{className:"text-gray-500 italic",children:"No contact information provided"})]})]}),s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs(ut,{className:"flex items-center text-lg",children:[s.jsx(_n,{className:"mr-2 h-5 w-5"}),r.business_type==="service_area"?"Service Area":"Business Location"]})}),s.jsx(Be,{children:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-gray-500 mb-1",children:"Business Type"}),s.jsx(ke,{variant:"outline",className:"capitalize",children:r.business_type==="service_area"?"Service Area":"Physical Location"})]}),r.business_type==="service_area"?s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-gray-500 mb-1",children:"Service Area Description"}),s.jsx("p",{className:"font-medium",children:((N=r.service_area)==null?void 0:N.description)||"Service area not specified"})]}),((S=r.service_area)==null?void 0:S.radiusMiles)&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-gray-500 mb-1",children:"Service Radius"}),s.jsxs("p",{className:"text-gray-600",children:[r.service_area.radiusMiles," miles"]})]})]}):s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"font-medium",children:r.location.address||"Address not provided"}),s.jsx("p",{className:"text-gray-600",children:r.location.city&&r.location.state&&r.location.zipCode?`${r.location.city}, ${r.location.state} ${r.location.zipCode}`:"City, state, and zip code not provided"})]})]})})]})]}),r.admin_notes&&s.jsxs(De,{className:"mb-6",children:[s.jsx(ot,{children:s.jsxs(ut,{className:"flex items-center text-lg",children:[s.jsx(ma,{className:"mr-2 h-5 w-5"}),"Admin Review Notes"]})}),s.jsx(Be,{children:s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"bg-gray-50 p-4 rounded-lg",children:s.jsx("p",{className:"text-gray-700",children:r.admin_notes})}),r.reviewed_at&&s.jsxs("div",{className:"text-sm text-gray-500",children:["Reviewed on ",new Date(r.reviewed_at).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})]})]})})]}),s.jsxs(sn,{defaultValue:"details",className:"w-full",children:[s.jsxs(Qs,{className:"grid w-full max-w-lg grid-cols-4",children:[s.jsx(Gt,{value:"details",children:"Details"}),s.jsx(Gt,{value:"categories",children:"Categories"}),s.jsx(Gt,{value:"tags",children:"Tags"}),s.jsx(Gt,{value:"hours",children:"Hours"})]}),s.jsx(Rt,{value:"details",className:"mt-6",children:s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs(De,{children:[s.jsx(ot,{children:s.jsx(ut,{children:"Business Description"})}),s.jsx(Be,{children:s.jsxs("div",{className:"space-y-4",children:[r.short_description&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-gray-500 mb-1",children:"Short Description"}),s.jsx("p",{className:"text-gray-700",children:r.short_description})]}),(r.business_description||r.description)&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-gray-500 mb-1",children:"Full Description"}),s.jsx("div",{className:"prose max-w-none",children:s.jsx("p",{className:"text-gray-700 leading-relaxed",children:r.business_description||r.description})})]}),!r.short_description&&!r.business_description&&!r.description&&s.jsx("p",{className:"text-gray-500 italic",children:"No description provided"})]})})]}),s.jsxs(De,{children:[s.jsx(ot,{children:s.jsx(ut,{children:"Business Images"})}),s.jsx(Be,{children:s.jsxs("div",{className:"space-y-4",children:[r.logo_url&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-gray-500 mb-2",children:"Logo"}),s.jsx("img",{src:r.logo_url,alt:`${r.name} logo`,className:"w-24 h-24 object-cover rounded-lg border"})]}),r.cover_image_url&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-gray-500 mb-2",children:"Cover Image"}),s.jsx("img",{src:r.cover_image_url,alt:`${r.name} cover`,className:"w-full h-48 object-cover rounded-lg border"})]}),r.gallery_urls&&r.gallery_urls.length>0&&s.jsxs("div",{children:[s.jsxs("p",{className:"text-sm text-gray-500 mb-2",children:["Gallery (",r.gallery_urls.length," images)"]}),s.jsx("div",{className:"grid grid-cols-2 gap-2",children:r.gallery_urls.slice(0,4).map((D,A)=>s.jsx("img",{src:D,alt:`${r.name} gallery ${A+1}`,className:"w-full h-24 object-cover rounded border"},A))}),r.gallery_urls.length>4&&s.jsxs("p",{className:"text-sm text-gray-500 mt-2",children:["+",r.gallery_urls.length-4," more images"]})]}),!r.logo_url&&!r.cover_image_url&&(!r.gallery_urls||r.gallery_urls.length===0)&&s.jsx("p",{className:"text-gray-500 italic",children:"No images uploaded"})]})})]})]})}),s.jsx(Rt,{value:"categories",className:"mt-6",children:s.jsxs(De,{children:[s.jsx(ot,{children:s.jsx(ut,{children:"Business Categories"})}),s.jsx(Be,{children:r.categories&&r.categories.length>0?s.jsx("div",{className:"flex flex-wrap gap-2",children:r.categories.map(D=>s.jsxs(ke,{variant:"outline",className:D.isPrimary?"bg-blue-50 text-blue-700 border-blue-200":"",children:[D.name,D.isPrimary&&" (Primary)"]},D.id))}):s.jsx("p",{className:"text-gray-500 italic",children:"No categories assigned"})})]})}),s.jsx(Rt,{value:"tags",className:"mt-6",children:s.jsxs(De,{children:[s.jsx(ot,{children:s.jsx(ut,{children:"Business Tags"})}),s.jsx(Be,{children:r.tags&&r.tags.length>0&&r.tags.some(D=>D&&D.trim()!=="")?s.jsx("div",{className:"flex flex-wrap gap-2",children:r.tags.filter(D=>D&&D.trim()!=="").map((D,A)=>s.jsx(ke,{variant:"secondary",className:"bg-gray-100 text-gray-700",children:D},A))}):s.jsx("p",{className:"text-gray-500 italic",children:"No tags assigned"})})]})}),s.jsx(Rt,{value:"hours",className:"mt-6",children:s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs(ut,{className:"flex items-center",children:[s.jsx(rn,{className:"mr-2 h-5 w-5"}),"Business Hours"]})}),s.jsx(Be,{children:r.business_hours_json?s.jsx("div",{className:"space-y-2",children:["monday","tuesday","wednesday","thursday","friday","saturday","
1199sunday"].map(D=>{const A=r.business_hours_json[D];return s.jsxs("div",{className:"flex justify-between items-center py-2 border-b border-gray-100 last:border-b-0",children:[s.jsxs("span",{className:"font-medium capitalize",children:[D==="monday"&&"Monday",D==="tuesday"&&"Tuesday",D==="wednesday"&&"Wednesday",D==="thursday"&&"Thursday",D==="friday"&&"Friday",D==="saturday"&&"Saturday",D==="sunday"&&"Sunday"]}),s.jsx("span",{className:"text-gray-600",children:A?y(A):"Not specified"})]},D)})}):s.jsx("p",{className:"text-gray-500 italic",children:"Business hours not provided"})})]})})]}),(((E=r.facebook_url)==null?void 0:E.trim())||((C=r.instagram_url)==null?void 0:C.trim())||((T=r.twitter_url)==null?void 0:T.trim()))&&s.jsxs(De,{className:"mt-6",children:[s.jsx(ot,{children:s.jsx(ut,{children:"Social Media"})}),s.jsx(Be,{children:s.jsxs("div",{className:"flex gap-4",children:[r.facebook_url&&r.facebook_url.trim()!==""&&s.jsxs("a",{href:r.facebook_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center text-blue-600 hover:text-blue-800",children:[s.jsx(Bc,{className:"mr-2 h-4 w-4"}),"Facebook"]}),r.instagram_url&&r.instagram_url.trim()!==""&&s.jsxs("a",{href:r.instagram_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center text-pink-600 hover:text-pink-800",children:[s.jsx(Bc,{className:"mr-2 h-4 w-4"}),"Instagram"]}),r.twitter_url&&r.twitter_url.trim()!==""&&s.jsxs("a",{href:r.twitter_url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center text-blue-400 hover:text-blue-600",children:[s.jsx(Bc,{className:"mr-2 h-4 w-4"}),"Twitter"]})]})})]})]}),s.jsx(Tt,{open:o,onOpenChange:l,children:s.jsxs(Dt,{children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Approve Business"}),s.jsxs(rr,{children:['Are you sure you want to approve "',r.name,'"? This will make the business visible to all users.']})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",onClick:()=>l(!1),disabled:d,children:"Cancel"}),s.jsx(Y,{onClick:f,className:"bg-green-600 hover:bg-green-700",disabled:d,children:d?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"}),"Approving..."]}):s.jsxs(s.Fragment,{children:[s.jsx(un,{className:"mr-2 h-4 w-4"}),"Approve Business"]})})]})]})}),s.jsx(hx,{isOpen:c,onClose:()=>u(!1),onConfirm:m,title:"Reject Business",description:"You are about to reject",itemName:r.name,isLoading:d})]}):s.jsx("div",{className:"py-12",children:s.jsxs("div",{className:"container mx-auto px-4 text-center",children:[s.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Business not found"}),s.jsx("p",{className:"mb-6",children:"The business you're looking for doesn't exist or has been removed."}),s.jsx(rt,{to:"/dashboard/admin/businesses",children:s.jsxs(Y,{children:[s.jsx(pn,{className:"mr-2 h-4 w-4"})," Back to Business Management"]})})]})})},gSe=({searchQuery:t,onSearchChange:e,statusFilter:r,onStatusFilterChange:n})=>s.jsxs("div",{className:"flex flex-col md:flex-row md:justify-between md:items-center gap-3 sm:gap-4",children:[s.jsx("h1",{className:"text-xl sm:text-2xl font-bold",children:"Resident Management"}),s.jsxs("div",{className:"flex flex-col md:flex-row gap-3 w-full md:w-auto",children:[s.jsxs("div",{className:"relative w-full md:w-64",children:[s.jsx(Uc,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400",size:18}),s.jsx(Ne,{type:"text",placeholder:"Search by name or email...",className:"pl-10",value:t,onChange:a=>e(a.target.value)})]}),s.jsxs(Wt,{value:r,onValueChange:n,children:[s.jsx(Ht,{className:"w-full md:w-[180px]",children:s.jsx(qt,{placeholder:"All Statuses"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"all",children:"All Statuses"}),s.jsx(Ae,{value:"approved",children:"Approved"}),s.jsx(Ae,{value:"pending",children:"Pending"}),s.jsx(Ae,{value:"rejected",children:"Rejected"})]})]})]})]}),xSe=({residents:t,isLoading:e,searchQuery:r,sortField:n,sortDirection:a,onSort:i,onOpenModal:o})=>{const l=h=>{switch(h){case"approved":return s.jsx(ke,{variant:"default",className:"bg-green-600",children:"Approved"});case"pending":return s.jsx(ke,{variant:"secondary",className:"bg-amber-100 text-amber-800",children:"Pending"});case"rejected":return s.jsx(ke,{variant:"destructive",children:"Rejected"});default:return s.jsx(ke,{variant:"outline",children:h})}},c=h=>h?new Date(h).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"â",u=h=>n!==h?null:a==="asc"?s.jsx(dC,{className:"inline ml-1 h-4 w-4"}):s.jsx(uC,{className:"inline ml-1 h-4 w-4"}),d=h=>h==="active"||h==="trialing"?s.jsx(ke,{variant:"default",className:"bg-green-600",children:"Paid"}):s.jsx(ke,{variant:"secondary",className:"bg-amber-100 text-amber-800",children:"Unpaid"});return e?s.jsx("div",{className:"py-8 text-center text-gray-500",children:"Loading residents..."}):s.jsxs(Oi,{className:"min-w-[700px]",children:[s.jsx(zi,{children:s.jsxs(As,{children:[s.jsxs(At,{className:"cursor-pointer",onClick:()=>i("name"),children:["NAME ",u("name")]}),s.jsxs(At,{className:"cursor-pointer",onClick:()=>i("email"),children:["EMAIL ",u("email")]}),s.jsxs(At,{className:"cursor-pointer",onClick:()=>i("status"),children:["STATUS ",u("status")]}),s.jsx(At,{children:"PAID"}),s.jsxs(At,{className:"cursor-pointer",onClick:()=>i("created_at"),children:["CREATED ",u("created_at")]}),s.jsx(At,{children:"REVIEWED"}),s.jsx(At,{children:"ACTIONS"})]})}),s.jsx(Ui,{children:t.length>0?t.map(h=>{const f=`${h.first_name} ${h.last_name}`.trim()||h.email;return s.jsxs(As,{children:[s.jsx(Ct,{children:s.jsx(rt,{to:`/dashboard/admin/residents/${h.id}`,className:"font-medium text-blue-600 hover:text-blue-800 hover:underline",children:f})}),s.jsx(Ct,{className:"text-muted-foreground",children:h.email}),s.jsx(Ct,{children:l(h.status)}),s.jsx(Ct,{children:d(h.membership_status)}),s.jsx(Ct,{children:c(h.created_at)}),s.jsx(Ct,{children:h.reviewed_at?c(h.reviewed_at):"â"}),s.jsx(Ct,{children:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Y,{variant:"link",className:"text-blue-600",onClick:()=>o(h),children:"Manage"}),s.jsx(Y,{variant:"link",size:"sm",className:"text-blue-600",asChild:!0,children:s.jsx(rt,{to:`/dashboard/admin/residents/${h.id}`,children:"View"})})]})})]}
1199,h.id)}):s.jsx(As,{children:s.jsx(Ct,{colSpan:7,className:"h-24 text-center",children:r?s.jsxs(s.Fragment,{children:['No residents matching "',r,'"']}):s.jsx(s.Fragment,{children:"No residents found."})})})})]})},ySe=({currentPage:t,totalPages:e,itemsPerPage:r,totalResidents:n,onPageChange:a,onItemsPerPageChange:i})=>{if(e<=1)return null;const o=()=>{t>1&&a(t-1)},l=()=>{t<e&&a(t+1)},c=()=>{const h=[1];if(e<=7){for(let f=2;f<=e;f++)h.push(f);return h}if(t<=4)return h.push(2,3,4,5,"ellipsis",e),h;if(t>=e-3){h.push("ellipsis");for(let f=e-4;f<=e;f++)h.push(f);return h}return h.push("ellipsis",t-1,t,t+1,"ellipsis",e),h},u=Math.min((t-1)*r+1,n),d=Math.min(t*r,n);return s.jsxs("div",{className:"flex flex-col space-y-4 mt-6",children:[s.jsxs("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[s.jsxs("div",{children:["Showing ",u,"-",d," of ",n," residents"]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("span",{children:"Items per page:"}),s.jsxs(Wt,{value:r.toString(),onValueChange:h=>i(Number(h)),children:[s.jsx(Ht,{className:"h-8 w-[70px]",children:s.jsx(qt,{placeholder:r.toString()})}),s.jsx($t,{children:[5,10,20,50,100].map(h=>s.jsx(Ae,{value:h.toString(),children:h},h))})]})]})]}),s.jsxs("div",{className:"flex items-center justify-center space-x-2",children:[s.jsxs(Y,{variant:"outline",size:"sm",onClick:o,disabled:t===1,children:[s.jsx(hC,{className:"h-4 w-4 mr-1"}),"Prev"]}),s.jsx("div",{className:"flex items-center space-x-1",children:c().map((h,f)=>h==="ellipsis"?s.jsx("span",{className:"px-2",children:"..."},`ellipsis-${f}`):s.jsx(Y,{variant:t===h?"default":"outline",size:"sm",onClick:()=>a(h),className:"min-w-[36px]",children:h},`page-${h}`))}),s.jsxs(Y,{variant:"outline",size:"sm",onClick:l,disabled:t===e,children:["Next",s.jsx(Ih,{className:"h-4 w-4 ml-1"})]})]})]})},bSe=({isOpen:t,onOpenChange:e,selectedResident:r,newStatus:n,onStatusChange:a,onUpdateStatus:i,isPending:o})=>{const[l,c]=x.useState(""),[u,d]=x.useState("");if(!r)return null;const h=`${r.first_name} ${r.last_name}`.trim()||r.email,f=()=>{if(n==="rejected"&&!l.trim()){d("Please provide a reason for rejection");return}i(l.trim()||void 0)},m=()=>{c(""),d(""),e(!1)},g=b=>{switch(b){case"approved":return s.jsx(Or,{className:"h-5 w-5 text-green-600"});case"rejected":return s.jsx(Ts,{className:"h-5 w-5 text-red-600"});case"pending":return s.jsx(Kg,{className:"h-5 w-5 text-amber-600"})}},y=b=>{switch(b){case"approved":return"Approved";case"rejected":return"Rejected";case"pending":return"Pending"}};return s.jsx(Tt,{open:t,onOpenChange:e,children:s.jsxs(Dt,{className:"sm:max-w-[500px] max-h-[90vh] overflow-y-auto",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Manage Resident Status"}),s.jsxs(rr,{children:["Update the approval status for ",s.jsx("span",{className:"font-bold",children:h}),". Approved residents appear in the public directory."]})]}),s.jsxs("div",{className:"grid gap-6 py-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm border p-3 rounded-md",children:[s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-muted-foreground",children:"Name"}),s.jsx("p",{children:h})]}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-muted-foreground",children:"Email"}),s.jsx("p",{className:"text-blue-600 truncate",children:r.email})]}),s.jsxs("div",{className:"col-span-2",children:[s.jsx("p",{className:"font-medium text-muted-foreground",children:"Current Status"}),s.jsxs("div",{className:"flex items-center mt-1",children:[g(r.status),s.jsx("span",{className:"ml-1",children:y(r.status)})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"resident-status",className:"text-sm font-medium",children:"Update Status"}),s.jsxs(Wt,{value:n,onValueChange:b=>{a(b),d("")},children:[s.jsx(Ht,{id:"resident-status",className:"w-full",children:s.jsx(qt,{placeholder:"Select status"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"approved",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx(Or,{className:"h-4 w-4 mr-2 text-green-600"}),"Approved"]})}),s.jsx(Ae,{value:"pending",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx(Kg,{className:"h-4 w-4 mr-2 text-amber-600"}),"Pending"]})}),s.jsx(Ae,{value:"rejected",children:s.jsxs("div",{className:"flex items-center",children:[s.jsx(Ts,{className:"h-4 w-4 mr-2 text-red-600"}),"Rejected"]})})]})]}),s.jsx("p",{className:"text-sm text-gray-500",children:n==="approved"?"Resident will be visible on the Residential Members directory.":n==="rejected"?"Resident will be hidden from the directory.":"Resident will remain hidden until approved."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Z,{htmlFor:"resident-admin-notes",className:"text-sm font-medium",children:["Admin Notes ",n==="rejected"&&s.jsx("span",{className:"text-red-500",children:"*"})]}),s.jsx(zt,{id:"resident-admin-notes",placeholder:n==="rejected"?"Please provide a reason for rejection.":"Optional notes about this status change.",value:l,onCh
1199ange:b=>{c(b.target.value),u&&d("")},className:"min-h-[80px]",disabled:o}),u&&s.jsx("p",{className:"text-sm text-red-600",children:u})]})]}),s.jsxs(Sr,{className:"mt-6",children:[s.jsx(Y,{variant:"outline",onClick:m,disabled:o,children:"Cancel"}),s.jsx(Y,{onClick:f,disabled:o||n===r.status,variant:n==="rejected"?"destructive":"default",children:o?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"}),"Updating..."]}):`${n==="approved"?"Approve":n==="rejected"?"Reject":"Update"} Resident`})]})]})})},vSe=()=>{const{toast:t}=St(),{user:e}=ts(),r=Su(),[n,a]=x.useState("all"),[i,o]=x.useState("created_at"),[l,c]=x.useState("desc"),[u,d]=x.useState(1),[h,f]=x.useState(10),[m,g]=x.useState(""),[y,b]=x.useState(!1),[w,j]=x.useState(null),[N,S]=x.useState("pending"),{data:E,isLoading:C,error:T}=kx({queryKey:["admin","residents",n,i,l,u,h,m],queryFn:()=>Pf.getResidents({status:n,page:u,limit:h,sortField:i,sortDirection:l,searchQuery:m})}),D=$l({mutationFn:async({id:P,status:U,adminNotes:I})=>{if(!(e!=null&&e.id))throw new Error("User not authenticated");if(U==="rejected"&&!(I!=null&&I.trim()))throw new Error("Admin notes required for rejection");return Pf.updateStatus(P,U,e.id,I)},onSuccess:()=>{t({title:"Resident updated",description:"The resident status has been updated."}),r.invalidateQueries({queryKey:["admin","residents"]}),b(!1),j(null)},onError:P=>{t({title:"Error updating resident",description:P instanceof Error?P.message:"Failed to update status",variant:"destructive"})}});x.useEffect(()=>{d(1)},[n,m,h]),x.useEffect(()=>{T&&t({title:"Error loading residents",description:"Failed to load resident data. Please try again.",variant:"destructive"})},[T,t]);const A=P=>{i===P?c(U=>U==="asc"?"desc":"asc"):(o(P),c("asc")),d(1)},R=P=>{j(P),S(P.status),b(!0)},M=P=>
1199{w&&D.mutate({id:w.id,status:N,adminNotes:P})};return{residents:(E==null?void 0:E.residents)??[],totalResidents:(E==null?void 0:E.total)??0,totalPages:Math.ceil(((E==null?void 0:E.total)??0)/h),isLoading:C,statusFilter:n,sortField:i,sortDirection:l,currentPage:u,itemsPerPage:h,searchQuery:m,isModalOpen:y,selectedResident:w,newStatus:N,updateStatusMutation:D,setStatusFilter:a,setCurrentPage:d,setItemsPerPage:f,setSearchQuery:g,handleSort:A,handleOpenModal:R,setIsModalOpen:b,setNewStatus:S,handleUpdateStatus:M}},wSe=()=>{const{residents:t,totalResidents:e,totalPages:r,isLoading:n,statusFilter:a,sortField:i,sortDirection:o,currentPage:l,itemsPerPage:c,searchQuery:u,isModalOpen:d,selectedResident:h,newStatus:f,updateStatusMutation:m,setStatusFilter:g,setCurrentPage:y,setItemsPerPage:b,setSearchQuery:w,handleSort:j,handleOpenModal:N,setIsModalOpen:S,setNewStatus:E,handleUpdateStatus:C}=vSe(),T=R=>{switch(R){case"approved":return s.jsx(ke,{variant:"default",className:"bg-green-600",children:"Approved"});case"pending":return s.jsx(ke,{variant:"secondary",className:"bg-amber-100 text-amber-800",children:"Pending"});case"rejected":return s.jsx(ke,{variant:"destructive",children:"Rejected"});default:return s.jsx(ke,{variant:"outline",children:R})}},D=R=>R?new Date(R).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"â",A=R=>R==="active"||R==="trialing"?s.jsx(ke,{variant:"default",className:"bg-green-600",children:"Paid"}):s.jsx(ke,{variant:"secondary",className:"bg-amber-100 text-amber-800",children:"Unpaid"});return s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsx(gSe,{searchQuery:u,onSearchChange:w,statusFilter:a,onStatusFilterChange:g}),n?s.jsx("div",{className:"py-8 text-center text-gray-500",children:"Loading residents..."}):t.length===0?s.jsx("div",{className:"py-8 text-center text-gray-500 rounded-lg border",children:u?s.jsxs(s.Fragment,{children:['No residents matching "',u,'"']}):s.jsx(s.Fragment,{children:"No residents found."})}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"md:hidden space-y-3",children:t.map(R=>{const M=`${R.first_name} ${R.last_name}`.trim()||R.email;return s.jsx(De,{className:"overflow-hidden",children:s.jsx(Be,{className:"p-4",children:s.jsxs("div",{className:"flex flex-col gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx(rt,{to:`/dashboard/admin/residents/${R.id}`,className:"font-medium text-blue-600 hover:underline truncate block",children:M}),s.jsx("div",{className:"text-sm text-gray-500 truncate mt-0.5",children:R.email})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[T(R.status),A(R.membership_status),s.jsxs("span",{className:"text-muted-foreground",children:["Joined ",D(R.created_at)]})]}),R.reviewed_at&&s.jsxs("div",{className:"text-xs text-muted-foreground",children:["Reviewed ",D(R.reviewed_at)]}),s.jsxs("div",{className:"flex gap-2 pt-1 border-t",children:[s.jsx(Y,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>N(R),children:"Manage"}),s.jsx(Y,{variant:"outline",size:"sm",className:"flex-1",asChild:!0,children:s.jsx(rt,{to:`/dashboard/admin/residents/${R.id}`,children:"View"})})]})]})})},R.id)})}),s.jsx("div",{className:"hidden md:block overflow-x-auto -mx-1 px-1 rounded-lg border",children:s.jsx(xSe,{residents:t,isLoading:!1,searchQuery:u,sortField:i,sortDirection:o,onSort:j,onOpenModal:N})}),r>1&&s.jsx(ySe,{currentPage:l,totalPages:r,itemsPerPage:c,totalResidents:e,onPageChange:y,onItemsPerPageChange:b})]}),s.jsx(bSe,{isOpen:d,onOpenChange:S,selectedResident:h,newStatus:f,onStatusChange:E,onUpdateStatus:C,isPending:m.isPending})]})},jSe=()=>{const{id:t}=Dd(),{user:e}=ts(),[r,n]=x.useState(null),[a,i]=x.useState(!0),[o,l]=x.useState(!1),[c,u]=x.useState(!1),[d,h]=x.useState(!1);x.useEffect(()=>{(async()=>{if(t){i(!0);try{const j=await Pf.getResidentById(t);n(j??null),j||ct.error("Resident not found")}catch(j){console.error(j),ct.error("Failed to load resident")}finally{i(!1)}}})()},[t]);const f=async()=>{if(!(!r||!(e!=null&&e.id))){h(!0);try{const w=await A9({id:r.id,reviewedBy:e.id});w.success?(ct.success(`${r.first_name} ${r.last_name} has been approved!`),n(j=>j?{...j,status:"approved",admin_notes:null,reviewed_by:e.id,reviewed_at:new Date().toISOString()}:null),l(!1)):ct.error(w.error||"Failed to approve resident")}catch{ct.error("Failed to approve resident")}finally{h(!1)}}},m=async w=>{if(!(!r||!(e!=null&&e.id))){h(!0);try{const j=await D9({id:r.id,adminNotes:w,reviewedBy:e.id});j.success?(ct.success("Resident has been rejected"),n(N=>N?{...N,status:"rejected",admin_notes:w,reviewed_by:e.id,reviewed_at:new Date().toISOString()}:null),u(!1)):ct.error(j.error||"Failed to reject resident")}catch{ct.error("Failed to reject resident")}finally{h(!1)}}},g=w=>{switch(w){case"approved":return s.jsx(ke,{className:"bg-green-100 text-green-800 border-green-200",children:"Approved"});
1199case"pending":return s.jsx(ke,{className:"bg-yellow-100 text-yellow-800 border-yellow-200",children:"Pending"});case"rejected":return s.jsx(ke,{className:"bg-red-100 text-red-800 border-red-200",children:"Rejected"});default:return s.jsx(ke,{variant:"secondary",children:w})}},y=w=>w?new Date(w).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}):"â";if(a)return s.jsxs("div",{className:"py-8 sm:py-12 flex flex-col items-center justify-center px-4",children:[s.jsx(Mt,{className:"h-10 w-10 sm:h-12 sm:w-12 text-blue-600 animate-spin mb-4"}),s.jsx("h1",{className:"text-lg sm:text-2xl font-bold",children:"Loading resident..."})]});if(!r)return s.jsxs("div",{className:"py-8 sm:py-12 text-center px-4",children:[s.jsx("h1",{className:"text-xl sm:text-2xl font-bold mb-4",children:"Resident not found"}),s.jsx("p",{className:"mb-6",children:"The resident you're looking for doesn't exist or has been removed."}),s.jsx(rt,{to:"/dashboard/admin/residents",children:s.jsxs(Y,{children:[s.jsx(pn,{className:"mr-2 h-4 w-4"})," Back to Resident Management"]})})]});const b=`${r.first_name} ${r.last_name}`.trim()||r.email;return s.jsxs("div",{className:"py-4 sm:py-6",children:[s.jsxs("div",{className:"container mx-auto px-3 sm:px-4",children:[s.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4 mb-4 sm:mb-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3 min-w-0",children:[s.jsx(rt,{to:"/dashboard/admin/residents",className:"shrink-0",children:s.jsxs(Y,{variant:"ghost",size:"sm",children:[s.jsx(pn,{className:"mr-2 h-4 w-4"}),"Back"]})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("h1",{className:"text-xl sm:text-2xl font-bold break-words",children:b}),s.jsx("div",{className:"flex items-center gap-2 mt-1",children:g(r.status)})]})]}),r.status==="pending"&&s.jsxs("div",{className:"flex flex-wrap gap-2 shrink-0",children:[s.jsxs(Y,{onClick:()=>l(!0),className:"bg-green-600 hover:bg-green-700",disabled:d,children:[s.jsx(un,{className:"w-4 h-4 mr-2"}),"Approve Resident"]}),s.jsxs(Y,{onClick:()=>u(!0),variant:"destructive",disabled:d,children:[s.jsx(Ir,{className:"w-4 h-4 mr-2"}),"Reject Resident"]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 sm:gap-6",children:[s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs(ut,{className:"flex items-center text-lg",children:[s.jsx(ma,{className:"mr-2 h-5 w-5"}),"Resident Information"]})}),s.jsxs(Be,{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-gray-500",children:"Name"}),s.jsx("p",{className:"font-medium",children:b})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-gray-500",children:"Email"}),s.jsxs("p",{className:"font-medium flex items-center gap-2",children:[s.jsx(fs,{className:"h-4 w-4"}),r.email]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-gray-500",children:"Status"}),s.jsx("div",{className:"mt-1",children:g(r.status)})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-gray-500",children:"Signed up"}),s.jsxs("p",{className:"font-medium flex items-center gap-2",children:[s.jsx(Br,{className:"h-4 w-4"}),y(r.created_at)]})]}),r.reviewed_at&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-gray-500",children:"Last reviewed"}),s.jsx("p",{className:"font-medium",children:y(r.reviewed_at)})]})]})]}),r.admin_notes&&s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs(ut,{className:"flex items-center text-lg",children:[s.jsx(ti,{className:"mr-2 h-5 w-5"}),"Admin Notes"]})}),s.jsx(Be,{children:s.jsx("div",{className:"bg-gray-50 p-4 rounded-lg",children:s.jsx("p",{className:"text-gray-700",children:r.admin_notes})})})]})]})]}),s.jsx(Tt,{open:o,onOpenChange:l,children:s.jsxs(Dt,{children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Approve Resident"}),s.jsxs(rr,{children:["Approve ",b,"? They will appear in the public Residential Members directory."]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",onClick:()=>l(!1),disabled:d,children:"Cancel"}),s.jsx(Y,{onClick:f,className:"bg-green-600 hover:bg-green-700",disabled:d,children:d?"Approving...":"Approve Resident"})]})]})}),s.jsx(hx,{isOpen:c,onClose:()=>u(!1),onConfirm:m,title:"Reject Resident",description:"This resident will not appear in the directory.",itemName:b,isLoading:d})]})};function fi(t){this.content=t}fi.prototype={constructor:fi,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,r){var n=r&&r!=t?this.remove(r):this,a=n.find(t),i=n.content.slice();return a==-1?i.push(r||t,e):(i[a+1]=e,r&&(i[a]=r)),new fi(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var r=this.content.slice();return r.splice(e,2),new fi(r)}
vendor: 8,511 bytes, line 1199
1199,addToStart:function(t,e){return new fi([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var r=this.remove(t).content.slice();return r.push(t,e),new fi(r)},addBefore:function(t,e,r){var n=this.remove(e),a=n.content.slice(),i=n.find(t);return a.splice(i==-1?a.length:i,0,e,r),new fi(a)},forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=fi.from(t),t.size?new fi(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=fi.from(t),t.size?new fi(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=fi.from(t);for(var r=0;r<t.content.length;r+=2)e=e.remove(t.content[r]);return e},toObject:function(){var t={};return this.forEach(function(e,r){t[e]=r}),t},get size(){return this.content.length>>1}};fi.from=function(t){if(t instanceof fi)return t;var e=[];if(t)for(var r in t)e.push(r,t[r]);return new fi(e)};function U7(t,e,r){for(let n=0;;n++){if(n==t.childCount||n==e.childCount)return t.childCount==e.childCount?null:r;let a=t.child(n),i=e.child(n);if(a==i){r+=a.nodeSize;continue}if(!a.sameMarkup(i))return r;if(a.isText&&a.text!=i.text){for(let o=0;a.text[o]==i.text[o];o++)r++;return r}if(a.content.size||i.content.size){let o=U7(a.content,i.content,r+1);if(o!=null)return o}r+=a.nodeSize}}function H7(t,e,r,n){for(let a=t.childCount,i=e.childCount;;){if(a==0||i==0)return a==i?null:{a:r,b:n};let o=t.child(--a),l=e.child(--i),c=o.nodeSize;if(o==l){r-=c,n-=c;continue}if(!o.sameMarkup(l))return{a:r,b:n};if(o.isText&&o.text!=l.text){let u=0,d=Math.min(o.text.length,l.text.length);for(;u<d&&o.text[o.text.length-u-1]==l.text[l.text.length-u-1];)u++,r--,n--;return{a:r,b:n}}if(o.content.size||l.content.size){let u=H7(o.content,l.content,r-1,n-1);if(u)return u}r-=c,n-=c}}class Nt{constructor(e,r){if(this.content=e,this.size=r||0,r==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,r,n,a=0,i){for(let o=0,l=0;l<r;o++){let c=this.content[o],u=l+c.nodeSize;if(u>e&&n(c,a+l,i||null,o)!==!1&&c.content.size){let d=l+1;c.nodesBetween(Math.max(0,e-d),Math.min(c.content.size,r-d),n,a+d)}l=u}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,r,n,a){let i="",o=!0;return this.nodesBetween(e,r,(l,c)=>{let u=l.isText?l.text.slice(Math.max(e,c)-c,r-c):l.isLeaf?a?typeof a=="function"?a(l):a:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&u||l.isTextblock)&&n&&(o?o=!1:i+=n),i+=u},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let r=this.lastChild,n=e.firstChild,a=this.content.slice(),i=0;for(r.isText&&r.sameMarkup(n)&&(a[a.length-1]=r.withText(r.text+n.text),i=1);i<e.content.length;i++)a.push(e.content[i]);return new Nt(a,this.size+e.size)}cut(e,r=this.size){if(e==0&&r==this.size)return this;let n=[],a=0;if(r>e)for(let i=0,o=0;o<r;i++){let l=this.content[i],c=o+l.nodeSize;c>e&&((o<e||c>r)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,r-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,r-o-1))),n.push(l),a+=l.nodeSize),o=c}return new Nt(n,a)}cutByIndex(e,r){return e==r?Nt.empty:e==0&&r==this.content.length?this:new Nt(this.content.slice(e,r))}replaceChild(e,r){let n=this.content[e];if(n==r)return this;let a=this.content.slice(),i=this.size+r.nodeSize-n.nodeSize;return a[e]=r,new Nt(a,i)}addToStart(e){return new Nt([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new Nt(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let r=0;r<this.content.length;r++)if(!this.content[r].eq(e.content[r]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let r=this.content[e];if(!r)throw new RangeError("Index "+e+" out of range for "+this);return r}maybeChild(e){return this.content[e]||null}forEach(e){for(let r=0,n=0;r<this.content.length;r++){let a=this.content[r];e(a,n,r),n+=a.nodeSize}}findDiffStart(e,r=0){return U7(this,e,r)}findDiffEnd(e,r=this.size,n=e.size){return H7(this,e,r,n)}findIndex(e){if(e==0)return Tv(0,e);if(e==this.size)return Tv(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,n=0;;r++){let a=this.child(r),i=n+a.nodeSize;if(i>=e)return i==e?Tv(r+1,i):Tv(r,n);n=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,r){if(!r)return Nt.empty;if(!Array.isArray(r))throw new RangeError("Invalid input for Fragment.fromJSON");return new Nt(r.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return Nt.empty;let r,n=0;for(let a=0;a<e.length;a++){let i=e[a];n+=i.nodeSize,a&&i.isText&&e[a-1].sameMarkup(i)?(r||(r=e.slice(0,a)),r[r.length-1]=i.withText(r[r.length-1].text+i.text)):r&&r.push(i)}return new Nt(r||e,n)}static from(e){if(!e)return Nt.empty;if(e instanceof Nt)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new Nt([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}Nt.empty=new Nt([],0);const MN={index:0,offset:0};function Tv(t,e){return MN.index=t,MN.offset=e,MN}function J1(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let r=Array.isArray(t);if(Array.isArray(e)!=r)return!1;if(r){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!J1(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!J1(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}let ln=class LS{constructor(e,r){this.type=e,this.attrs=r}addToSet(e){let r,n=!1;for(let a=0;a<e.length;a++){let i=e[a];if(this.eq(i))return e;if(this.type.excludes(i.type))r||(r=e.slice(0,a));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(r||(r=e.slice(0,a)),r.push(this),n=!0),r&&r.push(i)}}return r||(r=e.slice()),n||r.push(this),r}removeFromSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return e.slice(0,r).concat(e.slice(r+1));return e}isInSet(e){for(let r=0;r<e.length;r++)if(this.eq(e[r]))return!0;return!1}eq(e){return this==e||this.type==e.type&&J1(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[r.type];if(!n)throw new RangeError(`There is no mark type ${r.type} in this schema`);let a=n.create(r.attrs);return n.checkAttrs(a.attrs),a}static sameSet(e,r){if(e==r)return!0;if(e.length!=r.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(r[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return LS.none;if(e instanceof LS)return[e];let r=e.slice();return r.sort((n,a)=>n.type.rank-a.type.rank),r}};ln.none=[];class Y1 extends Error{}class ar{constructor(e,r,n){this.content=e,this.openStart=r,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,r){let n=W7(this.content,e+this.openStart,r);return n&&new ar(n,this.openStart,this.openEnd)}removeBetween(e,r){return new ar($7(this.content,e+this.openStart,r+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,r){if(!r)return ar.empty;let n=r.openStart||0,a=r.openEnd||0;if(typeof n!="number"||typeof a!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new ar(Nt.fromJSON(e,r.content),n,a)}static maxOpen(e,r=!0){let n=0,a=0;for(let i=e.firstChild;i&&!i.isLeaf&&(r||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=e.lastChild;i&&!i.isLeaf&&(r||!i.type.spec.isolating);i=i.lastChild)a++;return new ar(e,n,a)}}ar.empty=new ar(Nt.empty,0,0);function $7(t,e,r){let{index:n,offset:a}=t.findIndex(e),i=t.maybeChild(n),{index:o,offset:l}=t.findIndex(r);if(a==e||i.isText){if(l!=r&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(r))}if(n!=o)throw new RangeError("Removing non-flat range");
vendor: 5,029 bytes, line 1199
1199return t.replaceChild(n,i.copy($7(i.content,e-a-1,r-a-1)))}function W7(t,e,r,n){let{index:a,offset:i}=t.findIndex(e),o=t.maybeChild(a);if(i==e||o.isText)return n&&!n.canReplace(a,a,r)?null:t.cut(0,e).append(r).append(t.cut(e));let l=W7(o.content,e-i-1,r,o);return l&&t.replaceChild(a,o.copy(l))}function NSe(t,e,r){if(r.openStart>t.depth)throw new Y1("Inserted content deeper than insertion position");if(t.depth-r.openStart!=e.depth-r.openEnd)throw new Y1("Inconsistent open depths");return q7(t,e,r,0)}function q7(t,e,r,n){let a=t.index(n),i=t.node(n);if(a==e.index(n)&&n<t.depth-r.openStart){let o=q7(t,e,r,n+1);return i.copy(i.content.replaceChild(a,o))}else if(r.content.size)if(!r.openStart&&!r.openEnd&&t.depth==n&&e.depth==n){let o=t.parent,l=o.content;return If(o,l.cut(0,t.parentOffset).append(r.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=FSe(r,t);return If(i,V7(t,o,l,e,n))}else return If(i,Z1(t,e,n))}function G7(t,e){if(!e.type.compatibleContent(t.type))throw new Y1("Cannot join "+e.type.name+" onto "+t.type.name)}function IS(t,e,r){let n=t.node(r);return G7(n,e.node(r)),n}function Lf(t,e){let r=e.length-1;r>=0&&t.isText&&t.sameMarkup(e[r])?e[r]=t.withText(e[r].text+t.text):e.push(t)}function Wy(t,e,r,n){let a=(e||t).node(r),i=0,o=e?e.index(r):a.childCount;t&&(i=t.index(r),t.depth>r?i++:t.textOffset&&(Lf(t.nodeAfter,n),i++));for(let l=i;l<o;l++)Lf(a.child(l),n);e&&e.depth==r&&e.textOffset&&Lf(e.nodeBefore,n)}function If(t,e){return t.type.checkContent(e),t.copy(e)}function V7(t,e,r,n,a){let i=t.depth>a&&IS(t,e,a+1),o=n.depth>a&&IS(r,n,a+1),l=[];return Wy(null,t,a,l),i&&o&&e.index(a)==r.index(a)?(G7(i,o),Lf(If(i,V7(t,e,r,n,a+1)),l)):(i&&Lf(If(i,Z1(t,e,a+1)),l),Wy(e,r,a,l),o&&Lf(If(o,Z1(r,n,a+1)),l)),Wy(n,null,a,l),new Nt(l)}function Z1(t,e,r){let n=[];if(Wy(null,t,r,n),t.depth>r){let a=IS(t,e,r+1);Lf(If(a,Z1(t,e,r+1)),n)}return Wy(e,null,r,n),new Nt(n)}function FSe(t,e){let r=e.depth-t.openStart,a=e.node(r).copy(t.content);for(let i=r-1;i>=0;i--)a=e.node(i).copy(Nt.from(a));return{start:a.resolveNoCache(t.openStart+r),end:a.resolveNoCache(a.content.size-t.openEnd-r)}}class w0{constructor(e,r,n){this.pos=e,this.path=r,this.parentOffset=n,this.depth=r.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,r=this.index(this.depth);if(r==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],a=e.child(r);return n?e.child(r).cut(n):a}get nodeBefore(){let e=this.index(this.depth),r=this.pos-this.path[this.path.length-1];return r?this.parent.child(e).cut(0,r):e==0?null:this.parent.child(e-1)}posAtIndex(e,r){r=this.resolveDepth(r);let n=this.path[r*3],a=r==0?0:this.path[r*3-1]+1;for(let i=0;i<e;i++)a+=n.child(i).nodeSize;return a}marks(){let e=this.parent,r=this.index();if(e.content.size==0)return ln.none;if(this.textOffset)return e.child(r).marks;let n=e.maybeChild(r-1),a=e.maybeChild(r);if(!n){let l=n;n=a,a=l}let i=n.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!a||!i[o].isInSet(a.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let r=this.parent.maybeChild(this.index());if(!r||!r.isInline)return null;let n=r.marks,a=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!a||!n[i].isInSet(a.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let r=this.depth;r>0;r--)if(this.start(r)<=e&&this.end(r)>=e)return r;return 0}blockRange(e=this,r){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!r||r(this.node(n))))return new X1(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let r=1;r<=this.depth;r++)e+=(e?"/":"")+this.node(r).type.name+"_"+this.index(r-1);return e+":"+this.parentOffset}static resolve(e,r){if(!(r>=0&&r<=e.content.size))throw new RangeError("Position "+r+" out of range");let n=[],a=0,i=r;for(let o=e;;){let{index:l,offset:c}=o.content.findIndex(i),u=i-c;if(n.push(o,l,a+c),!u||(o=o.child(l),o.isText))break;i=u-1,a+=c+1}return new w0(r,n,i)}
vendor: 4,392 bytes, line 1199
1199static resolveCached(e,r){let n=WD.get(e);if(n)for(let i=0;i<n.elts.length;i++){let o=n.elts[i];if(o.pos==r)return o}else WD.set(e,n=new SSe);let a=n.elts[n.i]=w0.resolve(e,r);return n.i=(n.i+1)%CSe,a}}class SSe{constructor(){this.elts=[],this.i=0}}const CSe=12,WD=new WeakMap;class X1{constructor(e,r,n){this.$from=e,this.$to=r,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const kSe=Object.create(null);let Zh=class OS{constructor(e,r,n,a=ln.none){this.type=e,this.attrs=r,this.marks=a,this.content=n||Nt.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,r,n,a=0){this.content.nodesBetween(e,r,n,a,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,r,n,a){return this.content.textBetween(e,r,n,a)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,r,n){return this.type==e&&J1(this.attrs,r||e.defaultAttrs||kSe)&&ln.sameSet(this.marks,n||ln.none)}copy(e=null){return e==this.content?this:new OS(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new OS(this.type,this.attrs,this.content,e)}cut(e,r=this.content.size){return e==0&&r==this.content.size?this:this.copy(this.content.cut(e,r))}slice(e,r=this.content.size,n=!1){if(e==r)return ar.empty;let a=this.resolve(e),i=this.resolve(r),o=n?0:a.sharedDepth(r),l=a.start(o),u=a.node(o).content.cut(a.pos-l,i.pos-l);return new ar(u,a.depth-o,i.depth-o)}replace(e,r,n){return NSe(this.resolve(e),this.resolve(r),n)}nodeAt(e){for(let r=this;;){let{index:n,offset:a}=r.content.findIndex(e);if(r=r.maybeChild(n),!r)return null;if(a==e||r.isText)return r;e-=a+1}}childAfter(e){let{index:r,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(r),index:r,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:r,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(r),index:r,offset:n};let a=this.content.child(r-1);return{node:a,index:r-1,offset:n-a.nodeSize}}resolve(e){return w0.resolveCached(this,e)}resolveNoCache(e){return w0.resolve(this,e)}rangeHasMark(e,r,n){let a=!1;return r>e&&this.nodesBetween(e,r,i=>(n.isInSet(i.marks)&&(a=!0),!a)),a}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),K7(this.marks,e)}contentMatchAt(e){let r=this.type.contentMatch.matchFragment(this.content,0,e);if(!r)throw new Error("Called contentMatchAt on a node with invalid content");return r}canReplace(e,r,n=Nt.empty,a=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,a,i),l=o&&o.matchFragment(this.content,r);if(!l||!l.validEnd)return!1;for(let c=a;c<i;c++)if(!this.type.allowsMarks(n.child(c).marks))return!1;return!0}canReplaceWith(e,r,n,a){if(a&&!this.type.allowsMarks(a))return!1;let i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,r);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=ln.none;for(let r=0;r<this.marks.length;r++){let n=this.marks[r];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!ln.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(r=>r.type.name)}
1199`);this.content.forEach(r=>r.check())}toJSON(){let e={type:this.type.name};for(let r in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(r=>r.toJSON())),e}static fromJSON(e,r){if(!r)throw new RangeError("Invalid input for Node.fromJSON");let n;if(r.marks){if(!Array.isArray(r.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=r.marks.map(e.markFromJSON)}if(r.type=="text"){if(typeof r.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(r.text,n)}let a=Nt.fromJSON(e,r.content),i=e.nodeType(r.type).create(r.attrs,a,n);return i.type.checkAttrs(i.attrs),i}};Zh.prototype.text=void 0;class Q1 extends Zh{constructor(e,r,n,a){if(super(e,r,null,a),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):K7(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,r){return this.text.slice(e,r)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Q1(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Q1(this.type,this.attrs,e,this.marks)}cut(e=0,r=this.text.length){return e==0&&r==this.text.length?this:this.withText(this.text.slice(e,r))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function K7(t,e){for(let r=t.length-1;r>=0;r--)e=t[r].type.name+"("+e+")";return e}class sp{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,r){let n=new _Se(e,r);if(n.next==null)return sp.empty;let a=J7(n);n.next&&n.err("Unexpected trailing text");let i=RSe(PSe(a));return BSe(i,n),i}matchType(e){for(let r=0;r<this.next.length;r++)if(this.next[r].type==e)return this.next[r].next;return null}matchFragment(e,r=0,n=e.childCount){let a=this;for(let i=r;a&&i<n;i++)a=a.matchType(e.child(i).type);return a}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:r}=this.next[e];if(!(r.isText||r.hasRequiredAttrs()))return r}return null}compatible(e){for(let r=0;r<this.next.length;r++)for(let n=0;n<e.next.length;n++)if(this.next[r].type==e.next[n].type)return!0;return!1}fillBefore(e,r=!1,n=0){let a=[this];function i(o,l){let c=o.matchFragment(e,n);if(c&&(!r||c.validEnd))return Nt.from(l.map(u=>u.createAndFill()));for(let u=0;u<o.next.length;u++){let{type:d,next:h}=o.next[u];if(!(d.isText||d.hasRequiredAttrs())&&a.indexOf(h)==-1){a.push(h);let f=i(h,l.concat(d));if(f)return f}}return null}return i(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let r=this.computeWrapping(e);return this.wrapCache.push(e,r),r}computeWrapping(e){let r=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let a=n.shift(),i=a.match;if(i.matchType(e)){let o=[];for(let l=a;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:c}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in r)&&(!a.type||c.validEnd)&&(n.push({match:l.contentMatch,type:l,via:a}),r[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function r(n){e.push(n);for(let a=0;a<n.next.length;a++)e.indexOf(n.next[a].next)==-1&&r(n.next[a].next)}return r(this),e.map((n,a)=>{let i=a+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)i+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return i}).join(` 1200`)}}sp.empty=new sp(!0);class _Se{constructor(e,r){this.string=e,this.nodeTypes=r,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function J7(t){let e=[];do e.push(ESe(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function ESe(t){let e=[];do e.push(ASe(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function ASe(t){let e=MSe(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=DSe(t,e);else break;return e}function qD(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");
vendor: 4,733 bytes, line 1200
1200let e=Number(t.next);return t.pos++,e}function DSe(t,e){let r=qD(t),n=r;return t.eat(",")&&(t.next!="}"?n=qD(t):n=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:r,max:n,expr:e}}function TSe(t,e){let r=t.nodeTypes,n=r[e];if(n)return[n];let a=[];for(let i in r){let o=r[i];o.isInGroup(e)&&a.push(o)}return a.length==0&&t.err("No node type or group '"+e+"' found"),a}function MSe(t){if(t.eat("(")){let e=J7(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=TSe(t,t.next).map(r=>(t.inline==null?t.inline=r.isInline:t.inline!=r.isInline&&t.err("Mixing inline and block content"),{type:"name",value:r}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function PSe(t){let e=[[]];return a(i(t,0),r()),e;function r(){return e.push([])-1}function n(o,l,c){let u={term:c,to:l};return e[o].push(u),u}function a(o,l){o.forEach(c=>c.to=l)}function i(o,l){if(o.type=="choice")return o.exprs.reduce((c,u)=>c.concat(i(u,l)),[]);if(o.type=="seq")for(let c=0;;c++){let u=i(o.exprs[c],l);if(c==o.exprs.length-1)return u;a(u,l=r())}else if(o.type=="star"){let c=r();return n(l,c),a(i(o.expr,c),c),[n(c)]}else if(o.type=="plus"){let c=r();return a(i(o.expr,l),c),a(i(o.expr,c),c),[n(c)]}else{if(o.type=="opt")return[n(l)].concat(i(o.expr,l));if(o.type=="range"){let c=l;for(let u=0;u<o.min;u++){let d=r();a(i(o.expr,c),d),c=d}if(o.max==-1)a(i(o.expr,c),c);else for(let u=o.min;u<o.max;u++){let d=r();n(c,d),a(i(o.expr,c),d),c=d}return[n(c)]}else{if(o.type=="name")return[n(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Y7(t,e){return e-t}function GD(t,e){let r=[];return n(e),r.sort(Y7);function n(a){let i=t[a];if(i.length==1&&!i[0].term)return n(i[0].to);r.push(a);for(let o=0;o<i.length;o++){let{term:l,to:c}=i[o];!l&&r.indexOf(c)==-1&&n(c)}}}function RSe(t){let e=Object.create(null);return r(GD(t,0));function r(n){let a=[];n.forEach(o=>{t[o].forEach(({term:l,to:c})=>{if(!l)return;let u;for(let d=0;d<a.length;d++)a[d][0]==l&&(u=a[d][1]);GD(t,c).forEach(d=>{u||a.push([l,u=[]]),u.indexOf(d)==-1&&u.push(d)})})});let i=e[n.join(",")]=new sp(n.indexOf(t.length-1)>-1);for(let o=0;o<a.length;o++){let l=a[o][1].sort(Y7);i.next.push({type:a[o][0],next:e[l.join(",")]||r(l)})}return i}}function BSe(t,e){for(let r=0,n=[t];r<n.length;r++){let a=n[r],i=!a.validEnd,o=[];for(let l=0;l<a.next.length;l++){let{type:c,next:u}=a.next[l];o.push(c.name),i&&!(c.isText||c.hasRequiredAttrs())&&(i=!1),n.indexOf(u)==-1&&n.push(u)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Z7(t){let e=Object.create(null);for(let r in t){let n=t[r];if(!n.hasDefault)return null;e[r]=n.default}return e}function X7(t,e){let r=Object.create(null);for(let n in t){let a=e&&e[n];if(a===void 0){let i=t[n];if(i.hasDefault)a=i.default;else throw new RangeError("No value supplied for attribute "+n)}r[n]=a}return r}function Q7(t,e,r,n){for(let a in e)if(!(a in t))throw new RangeError(`Unsupported attribute ${a} for ${r} of type ${a}`);for(let a in t){let i=t[a];i.validate&&i.validate(e[a])}}function ez(t,e){let r=Object.create(null);if(e)for(let n in e)r[n]=new ISe(t,n,e[n]);return r}let VD=class tz{constructor(e,r,n){this.name=e,this.schema=r,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=ez(e,n.attrs),this.defaultAttrs=Z7(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==sp.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:X7(this.attrs,e)}create(e=null,r,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Zh(this,this.computeAttrs(e),Nt.from(r),ln.setFrom(n))}createChecked(e=null,r,n){return r=Nt.from(r),this.checkContent(r),new Zh(this,this.computeAttrs(e),r,ln.setFrom(n))}createAndFill(e=null,r,n){if(e=this.computeAttrs(e),r=Nt.from(r),r.size){let o=this.contentMatch.fillBefore(r);if(!o)return null;r=o.append(r)}let a=this.contentMatch.matchFragment(r),i=a&&a.fillBefore(Nt.empty,!0);return i?new Zh(this,e,r.append(i),ln.setFrom(n)):null}validContent(e){let r=this.contentMatch.matchFragment(e);
vendor: 9,579 bytes, lines 1200-1201
1200if(!r||!r.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Q7(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let r=0;r<e.length;r++)if(!this.allowsMarkType(e[r].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let r;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?r&&r.push(e[n]):r||(r=e.slice(0,n));return r?r.length?r:ln.none:e}static compile(e,r){let n=Object.create(null);e.forEach((i,o)=>n[i]=new tz(i,r,o));let a=r.spec.topNode||"doc";if(!n[a])throw new RangeError("Schema is missing its top node type ('"+a+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let i in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function LSe(t,e,r){let n=r.split("|");return a=>{let i=a===null?"null":typeof a;if(n.indexOf(i)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${t}, got ${i}`)}}class ISe{constructor(e,r,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?LSe(e,r,n.validate):n.validate}get isRequired(){return!this.hasDefault}}class dj{constructor(e,r,n,a){this.name=e,this.rank=r,this.schema=n,this.spec=a,this.attrs=ez(e,a.attrs),this.excluded=null;let i=Z7(this.attrs);this.instance=i?new ln(this,i):null}create(e=null){return!e&&this.instance?this.instance:new ln(this,X7(this.attrs,e))}static compile(e,r){let n=Object.create(null),a=0;return e.forEach((i,o)=>n[i]=new dj(i,a++,r,o)),n}removeFromSet(e){for(var r=0;r<e.length;r++)e[r].type==this&&(e=e.slice(0,r).concat(e.slice(r+1)),r--);return e}isInSet(e){for(let r=0;r<e.length;r++)if(e[r].type==this)return e[r]}checkAttrs(e){Q7(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class rz{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let r=this.spec={};for(let a in e)r[a]=e[a];r.nodes=fi.from(e.nodes),r.marks=fi.from(e.marks||{}),this.nodes=VD.compile(this.spec.nodes,this),this.marks=dj.compile(this.spec.marks,this);let n=Object.create(null);for(let a in this.nodes){if(a in this.marks)throw new RangeError(a+" can not be both a node and a mark");let i=this.nodes[a],o=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=n[o]||(n[o]=sp.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?KD(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let a in this.marks){let i=this.marks[a],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:KD(this,o.split(" "))}this.nodeFromJSON=a=>Zh.fromJSON(this,a),this.markFromJSON=a=>ln.fromJSON(this,a),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,r=null,n,a){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof VD){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(r,n,a)}text(e,r){let n=this.nodes.text;return new Q1(n,n.defaultAttrs,e,ln.setFrom(r))}mark(e,r){return typeof e=="string"&&(e=this.marks[e]),e.create(r)}nodeType(e){let r=this.nodes[e];if(!r)throw new RangeError("Unknown node type: "+e);return r}}function KD(t,e){let r=[];for(let n=0;n<e.length;n++){let a=e[n],i=t.marks[a],o=i;if(i)r.push(i);else for(let l in t.marks){let c=t.marks[l];(a=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(a)>-1)&&r.push(o=c)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return r}function OSe(t){return t.tag!=null}function zSe(t){return t.style!=null}class Xh{constructor(e,r){this.schema=e,this.rules=r,this.tags=[],this.styles=[];let n=this.matchedStyles=[];r.forEach(a=>{if(OSe(a))this.tags.push(a);else if(zSe(a)){let i=/[^=]*/.exec(a.style)[0];n.indexOf(i)<0&&n.push(i),this.styles.push(a)}}),this.normalizeLists=!this.tags.some(a=>{if(!/^(ul|ol)\b/.test(a.tag)||!a.node)return!1;let i=e.nodes[a.node];return i.contentMatch.matchType(i)})}parse(e,r={}){let n=new YD(this,r,!1);return n.addAll(e,ln.none,r.from,r.to),n.finish()}parseSlice(e,r={}){let n=new YD(this,r,!0);return n.addAll(e,ln.none,r.from,r.to),ar.maxOpen(n.finish())}matchTag(e,r,n){for(let a=n?this.tags.indexOf(n)+1:0;a<this.tags.length;a++){let i=this.tags[a];if($Se(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||r.matchesContext(i.context))){if(i.getAttrs){let o=i.getAttrs(e);if(o===!1)continue;i.attrs=o||void 0}return i}}}matchStyle(e,r,n,a){for(let i=a?this.styles.indexOf(a)+1:0;i<this.styles.length;i++){let o=this.styles[i],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!n.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=r))){if(o.getAttrs){let c=o.getAttrs(r);if(c===!1)continue;o.attrs=c||void 0}return o}}}static schemaRules(e){let r=[];function n(a){let i=a.priority==null?50:a.priority,o=0;for(;o<r.length;o++){let l=r[o];if((l.priority==null?50:l.priority)<i)break}r.splice(o,0,a)}for(let a in e.marks){let i=e.marks[a].spec.parseDOM;i&&i.forEach(o=>{n(o=ZD(o)),o.mark||o.ignore||o.clearMark||(o.mark=a)})}for(let a in e.nodes){let i=e.nodes[a].spec.parseDOM;i&&i.forEach(o=>{n(o=ZD(o)),o.node||o.ignore||o.mark||(o.node=a)})}return r}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Xh(e,Xh.schemaRules(e)))}}const sz={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},USe={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},nz={ol:!0,ul:!0},j0=1,zS=2,qy=4;function JD(t,e,r){return e!=null?(e?j0:0)|(e==="full"?zS:0):t&&t.whitespace=="pre"?j0|zS:r&~qy}class Mv{constructor(e,r,n,a,i,o){this.type=e,this.attrs=r,this.marks=n,this.solid=a,this.options=o,this.content=[],this.activeMarks=ln.none,this.match=i||(o&qy?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let r=this.type.contentMatch.fillBefore(Nt.from(e));if(r)this.match=this.type.contentMatch.matchFragment(r);else{let n=this.type.contentMatch,a;return(a=n.findWrapping(e.type))?(this.match=n,a):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&j0)){let n=this.content[this.content.length-1],a;if(n&&n.isText&&(a=/[ \t\r\n\u000c]+$/.exec(n.text))){let i=n;n.text.length==a[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-a[0].length))}}let r=Nt.from(this.content);return!e&&this.match&&(r=r.append(this.match.fillBefore(Nt.empty,!0))),this.type?this.type.create(this.attrs,r,this.marks):r}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!sz.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class YD{constructor(e,r,n){this.parser=e,this.options=r,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let a=r.topNode,i,o=JD(null,r.preserveWhitespace,0)|(n?qy:0);a?i=new Mv(a.type,a.attrs,ln.none,!0,r.topMatch||a.type.contentMatch,o):n?i=new Mv(null,null,ln.none,!0,null,o):i=new Mv(e.schema.topNodeType,null,ln.none,!0,null,o),this.nodes=[i],this.find=r.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,r){e.nodeType==3?this.addTextNode(e,r):e.nodeType==1&&this.addElement(e,r)}addTextNode(e,r){let n=e.nodeValue,a=this.top,i=a.options&zS?"full":this.localPreserveWS||(a.options&j0)>0,{schema:o}=this.parser;if(i==="full"||a.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(i)if(i==="full")n=n.replace(/\r\n?/g,` 1201`);else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=n.split(/\r?\n|\r/);for(let c=0;c<l.length;c++)c&&this.insertNode(o.linebreakReplacement.create(),r,!0),l[c]&&this.insertNode(o.text(l[c]),r,!/\S/.test(l[c]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let l=a.content[a.content.length-1],c=e.previousSibling;(!l||c&&c.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(n=n.slice(1))}n&&this.insertNode(o.text(n),r,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,r,n){let a=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;nz.hasOwnProperty(o)&&this.parser.normalizeLists&&HSe(e);let c=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,n));e:if(c?c.ignore:USe.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,r);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(e=c.skip);let u,d=this.needsBlock;if(sz.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),u=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,r);break e}
vendor: 4,920 bytes, lines 1201-1202
1201let h=c&&c.skip?r:this.readStyles(e,r);h&&this.addAll(e,h),u&&this.sync(i),this.needsBlock=d}else{let u=this.readStyles(e,r);u&&this.addElementByRule(e,c,u,c.consuming===!1?l:void 0)}this.localPreserveWS=a}leafFallback(e,r){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` 1202`),r)}ignoreFallback(e,r){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),r,!0)}readStyles(e,r){let n=e.style;if(n&&n.length)for(let a=0;a<this.parser.matchedStyles.length;a++){let i=this.parser.matchedStyles[a],o=n.getPropertyValue(i);if(o)for(let l=void 0;;){let c=this.parser.matchStyle(i,o,this,l);if(!c)break;if(c.ignore)return null;if(c.clearMark?r=r.filter(u=>!c.clearMark(u)):r=r.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)l=c;else break}}return r}addElementByRule(e,r,n,a){let i,o;if(r.node)if(o=this.parser.schema.nodes[r.node],o.isLeaf)this.insertNode(o.create(r.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let c=this.enter(o,r.attrs||null,n,r.preserveWhitespace);c&&(i=!0,n=c)}else{let c=this.parser.schema.marks[r.mark];n=n.concat(c.create(r.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(a)this.addElement(e,n,a);else if(r.getContent)this.findInside(e),r.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,n,!1));else{let c=e;typeof r.contentElement=="string"?c=e.querySelector(r.contentElement):typeof r.contentElement=="function"?c=r.contentElement(e):r.contentElement&&(c=r.contentElement),this.findAround(e,c,!0),this.addAll(c,n),this.findAround(e,c,!1)}i&&this.sync(l)&&this.open--}addAll(e,r,n,a){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,l=a==null?null:e.childNodes[a];o!=l;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,r);this.findAtPoint(e,i)}findPlace(e,r,n){let a,i;for(let o=this.open,l=0;o>=0;o--){let c=this.nodes[o],u=c.findWrapping(e);if(u&&(!a||a.length>u.length+l)&&(a=u,i=c,!u.length))break;if(c.solid){if(n)break;l+=2}}if(!a)return null;this.sync(i);for(let o=0;o<a.length;o++)r=this.enterInner(a[o],null,r,!1);return r}insertNode(e,r,n){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(r=this.enterInner(i,null,r))}let a=this.findPlace(e,r,n);if(a){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=ln.none;for(let l of a.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):XD(l.type,e.type))&&(o=l.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,r,n,a){let i=this.findPlace(e.create(r),n,!1);return i&&(i=this.enterInner(e,r,n,!0,a)),i}enterInner(e,r,n,a=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=JD(e,i,o.options);o.options&qy&&o.content.length==0&&(l|=qy);let c=ln.none;return n=n.filter(u=>(o.type?o.type.allowsMarkType(u.type):XD(u.type,e))?(c=u.addToSet(c),!1):!0),this.nodes.push(new Mv(e,r,c,a,null,l)),this.open++,n}closeExtra(e=!1){let r=this.nodes.length-1;if(r>this.open){for(;r>this.open;r--)this.nodes[r-1].content.push(this.nodes[r].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let r=this.open;r>=0;r--){if(this.nodes[r]==e)return this.open=r,!0;this.localPreserveWS&&(this.nodes[r].options|=j0)}return!1}get currentPos(){this.closeExtra();let e=0;for(let r=this.open;r>=0;r--){let n=this.nodes[r].content;for(let a=n.length-1;a>=0;a--)e+=n[a].nodeSize;r&&e++}return e}findAtPoint(e,r){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==r&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&e.nodeType==1&&e.contains(this.find[r].node)&&(this.find[r].pos=this.currentPos)}findAround(e,r,n){if(e!=r&&this.find)for(let a=0;a<this.find.length;a++)this.find[a].pos==null&&e.nodeType==1&&e.contains(this.find[a].node)&&r.compareDocumentPosition(this.find[a].node)&(n?2:4)&&(this.find[a].pos=this.currentPos)}findInText(e){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&(this.find[r].pos=this.currentPos-(e.nodeValue.length-this.find[r].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let r=e.split("/"),n=this.options.context,a=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(a?0:1),o=(l,c)=>{for(;l>=0;l--){let u=r[l];if(u==""){if(l==r.length-1||l==0)continue;for(;c>=i;c--)if(o(l-1,c))return!0;return!1}else{let d=c>0||c==0&&a?this.nodes[c].type:n&&c>=i?n.node(c-i).type:null;if(!d||d.name!=u&&!d.isInGroup(u))return!1;c--}}return!0};return o(r.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let r=e.depth;r>=0;r--){let n=e.node(r).contentMatchAt(e.indexAfter(r)).defaultType;
vendor: 8,892 bytes, line 1202
1202if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let r in this.parser.schema.nodes){let n=this.parser.schema.nodes[r];if(n.isTextblock&&n.defaultAttrs)return n}}}function HSe(t){for(let e=t.firstChild,r=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&nz.hasOwnProperty(n)&&r?(r.appendChild(e),e=r):n=="li"?r=e:n&&(r=null)}}function $Se(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function ZD(t){let e={};for(let r in t)e[r]=t[r];return e}function XD(t,e){let r=e.schema.nodes;for(let n in r){let a=r[n];if(!a.allowsMarkType(t))continue;let i=[],o=l=>{i.push(l);for(let c=0;c<l.edgeCount;c++){let{type:u,next:d}=l.edge(c);if(u==e||i.indexOf(d)<0&&o(d))return!0}};if(o(a.contentMatch))return!0}}class jp{constructor(e,r){this.nodes=e,this.marks=r}serializeFragment(e,r={},n){n||(n=PN(r).createDocumentFragment());let a=n,i=[];return e.forEach(o=>{if(i.length||o.marks.length){let l=0,c=0;for(;l<i.length&&c<o.marks.length;){let u=o.marks[c];if(!this.marks[u.type.name]){c++;continue}if(!u.eq(i[l][0])||u.type.spec.spanning===!1)break;l++,c++}for(;l<i.length;)a=i.pop()[1];for(;c<o.marks.length;){let u=o.marks[c++],d=this.serializeMark(u,o.isInline,r);d&&(i.push([u,a]),a.appendChild(d.dom),a=d.contentDOM||d.dom)}}a.appendChild(this.serializeNodeInner(o,r))}),n}serializeNodeInner(e,r){let{dom:n,contentDOM:a}=s1(PN(r),this.nodes[e.type.name](e),null,e.attrs);if(a){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,r,a)}return n}serializeNode(e,r={}){let n=this.serializeNodeInner(e,r);for(let a=e.marks.length-1;a>=0;a--){let i=this.serializeMark(e.marks[a],e.isInline,r);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,r,n={}){let a=this.marks[e.type.name];return a&&s1(PN(n),a(e,r),null,e.attrs)}static renderSpec(e,r,n=null,a){return s1(e,r,n,a)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new jp(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let r=QD(e.nodes);return r.text||(r.text=n=>n.text),r}static marksFromSchema(e){return QD(e.marks)}}function QD(t){let e={};for(let r in t){let n=t[r].spec.toDOM;n&&(e[r]=n)}return e}function PN(t){return t.document||window.document}const eT=new WeakMap;function WSe(t){let e=eT.get(t);return e===void 0&&eT.set(t,e=qSe(t)),e}function qSe(t){let e=null;function r(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let a=0;a<n.length;a++)r(n[a]);else for(let a in n)r(n[a])}return r(t),e}function s1(t,e,r,n){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let a=e[0],i;if(typeof a!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(i=WSe(n))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=a.indexOf(" ");o>0&&(r=a.slice(0,o),a=a.slice(o+1));let l,c=r?t.createElementNS(r,a):t.createElement(a),u=e[1],d=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){d=2;for(let h in u)if(u[h]!=null){let f=h.indexOf(" ");f>0?c.setAttributeNS(h.slice(0,f),h.slice(f+1),u[h]):h=="style"&&c.style?c.style.cssText=u[h]:c.setAttribute(h,u[h])}}for(let h=d;h<e.length;h++){let f=e[h];if(f===0){if(h<e.length-1||h>d)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:m,contentDOM:g}=s1(t,f,r,n);if(c.appendChild(m),g){if(l)throw new RangeError("Multiple content holes");l=g}}}return{dom:c,contentDOM:l}}const az=65535,iz=Math.pow(2,16);function GSe(t,e){return t+e*iz}function tT(t){return t&az}function VSe(t){return(t-(t&az))/iz}const oz=1,lz=2,n1=4,cz=8;class US{constructor(e,r,n){this.pos=e,this.delInfo=r,this.recover=n}get deleted(){return(this.delInfo&cz)>0}get deletedBefore(){return(this.delInfo&(oz|n1))>0}get deletedAfter(){return(this.delInfo&(lz|n1))>0}get deletedAcross(){return(this.delInfo&n1)>0}}class cl{constructor(e,r=!1){if(this.ranges=e,this.inverted=r,!e.length&&cl.empty)return cl.empty}recover(e){let r=0,n=tT(e);if(!this.inverted)for(let a=0;a<n;a++)r+=this.ranges[a*3+2]-this.ranges[a*3+1];return this.ranges[n*3]+r+VSe(e)}mapResult(e,r=1){return this._map(e,r,!1)}map(e,r=1){return this._map(e,r,!0)}_map(e,r,n){let a=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?a:0);if(c>e)break;let u=this.ranges[l+i],d=this.ranges[l+o],h=c+u;if(e<=h){let f=u?e==c?-1:e==h?1:r:r,m=c+a+(f<0?0:d);if(n)return m;let g=e==(r<0?c:h)?null:GSe(l/3,e-c),y=e==c?lz:e==h?oz:n1;return(r<0?e!=c:e!=h)&&(y|=cz),new US(m,y,g)}a+=d-u}return n?e+a:new US(e+a,0,null)}touches(e,r){let n=0,a=tT(r),i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?n:0);if(c>e)break;let u=this.ranges[l+i],d=c+u;if(e<=d&&l==a*3)return!0;n+=this.ranges[l+o]-u}return!1}forEach(e){let r=this.inverted?2:1,n=this.inverted?1:2;for(let a=0,i=0;a<this.ranges.length;a+=3){let o=this.ranges[a],l=o-(this.inverted?i:0),c=o+(this.inverted?0:i),u=this.ranges[a+r],d=this.ranges[a+n];e(l,l+u,c,c+d),i+=d-u}}invert(){return new cl(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?cl.empty:new cl(e<0?[0,-e,0]:[0,0,e])}}cl.empty=new cl([]);class N0{constructor(e,r,n=0,a=e?e.length:0){this.mirror=r,this.from=n,this.to=a,this._maps=e||[],this.ownData=!(e||r)}get maps(){return this._maps}slice(e=0,r=this.maps.length){return new N0(this._maps,this.mirror,e,r)}appendMap(e,r){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),r!=null&&this.setMirror(this._maps.length-1,r)}appendMapping(e){for(let r=0,n=this._maps.length;r<e._maps.length;r++){let a=e.getMirror(r);this.appendMap(e._maps[r],a!=null&&a<r?n+a:void 0)}}getMirror(e){if(this.mirror){for(let r=0;r<this.mirror.length;r++)if(this.mirror[r]==e)return this.mirror[r+(r%2?-1:1)]}}setMirror(e,r){this.mirror||(this.mirror=[]),this.mirror.push(e,r)}appendMappingInverted(e){for(let r=e.maps.length-1,n=this._maps.length+e._maps.length;r>=0;r--){let a=e.getMirror(r);this.appendMap(e._maps[r].invert(),a!=null&&a>r?n-a-1:void 0)}}invert(){let e=new N0;return e.appendMappingInverted(this),e}map(e,r=1){if(this.mirror)return this._map(e,r,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,r);return e}mapResult(e,r=1){return this._map(e,r,!1)}_map(e,r,n){let a=0;for(let i=this.from;i<this.to;i++){let o=this._maps[i],l=o.mapResult(e,r);if(l.recover!=null){let c=this.getMirror(i);if(c!=null&&c>i&&c<this.to){i=c,e=this._maps[c].recover(l.recover);continue}}a|=l.delInfo,e=l.pos}return n?e:new US(e,a,null)}}const RN=Object.create(null);class Gi{getMap(){return cl.empty}merge(e){return null}static fromJSON(e,r){if(!r||!r.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=RN[r.stepType];if(!n)throw new RangeError(`No step type ${r.stepType} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in RN)throw new RangeError("Duplicate use of step JSON ID "+e);return RN[e]=r,r.prototype.jsonID=e,r}}class Sa{constructor(e,r){this.doc=e,this.failed=r}static ok(e){return new Sa(e,null)}static fail(e){return new Sa(null,e)}static fromReplace(e,r,n,a){try{return Sa.ok(e.replace(r,n,a))}catch(i){if(i instanceof Y1)return Sa.fail(i.message);throw i}}}function v_(t,e,r){let n=[];for(let a=0;a<t.childCount;a++){let i=t.child(a);i.content.size&&(i=i.copy(v_(i.content,e,i))),i.isInline&&(i=e(i,r,a)),n.push(i)}return Nt.fromArray(n)}class $h extends Gi{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}apply(e){let r=e.slice(this.from,this.to),n=e.resolve(this.from),a=n.node(n.sharedDepth(this.to)),i=new ar(v_(r.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),a),r.openStart,r.openEnd);return Sa.fromReplace(e,this.from,this.to,i)}invert(){return new xu(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new $h(r.pos,n.pos,this.mark)}merge(e){return e instanceof $h&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new $h(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new $h(r.from,r.to,e.markFromJSON(r.mark))}}Gi.jsonID("addMark",$h);class xu extends Gi{constructor(e,r,n){super(),this.from=e,this.to=r,this.mark=n}
vendor: 6,507 bytes, line 1202
1202apply(e){let r=e.slice(this.from,this.to),n=new ar(v_(r.content,a=>a.mark(this.mark.removeFromSet(a.marks)),e),r.openStart,r.openEnd);return Sa.fromReplace(e,this.from,this.to,n)}invert(){return new $h(this.from,this.to,this.mark)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deleted&&n.deleted||r.pos>=n.pos?null:new xu(r.pos,n.pos,this.mark)}merge(e){return e instanceof xu&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new xu(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new xu(r.from,r.to,e.markFromJSON(r.mark))}}Gi.jsonID("removeMark",xu);class Wh extends Gi{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return Sa.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.addToSet(r.marks));return Sa.fromReplace(e,this.pos,this.pos+1,new ar(Nt.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);if(r){let n=this.mark.addToSet(r.marks);if(n.length==r.marks.length){for(let a=0;a<r.marks.length;a++)if(!r.marks[a].isInSet(n))return new Wh(this.pos,r.marks[a]);return new Wh(this.pos,this.mark)}}return new np(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new Wh(r.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Wh(r.pos,e.markFromJSON(r.mark))}}Gi.jsonID("addNodeMark",Wh);class np extends Gi{constructor(e,r){super(),this.pos=e,this.mark=r}apply(e){let r=e.nodeAt(this.pos);if(!r)return Sa.fail("No node at mark step's position");let n=r.type.create(r.attrs,null,this.mark.removeFromSet(r.marks));return Sa.fromReplace(e,this.pos,this.pos+1,new ar(Nt.from(n),0,r.isLeaf?0:1))}invert(e){let r=e.nodeAt(this.pos);return!r||!this.mark.isInSet(r.marks)?this:new Wh(this.pos,this.mark)}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new np(r.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new np(r.pos,e.markFromJSON(r.mark))}}Gi.jsonID("removeNodeMark",np);class ei extends Gi{constructor(e,r,n,a=!1){super(),this.from=e,this.to=r,this.slice=n,this.structure=a}apply(e){return this.structure&&HS(e,this.from,this.to)?Sa.fail("Structure replace would overwrite content"):Sa.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new cl([this.from,this.to-this.from,this.slice.size])}invert(e){return new ei(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return r.deletedAcross&&n.deletedAcross?null:new ei(r.pos,Math.max(r.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof ei)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let r=this.slice.size+e.slice.size==0?ar.empty:new ar(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new ei(this.from,this.to+(e.to-e.from),r,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let r=this.slice.size+e.slice.size==0?ar.empty:new ar(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new ei(e.from,this.to,r,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new ei(r.from,r.to,ar.fromJSON(e,r.slice),!!r.structure)}}Gi.jsonID("replace",ei);class si extends Gi{constructor(e,r,n,a,i,o,l=!1){super(),this.from=e,this.to=r,this.gapFrom=n,this.gapTo=a,this.slice=i,this.insert=o,this.structure=l}apply(e){if(this.structure&&(HS(e,this.from,this.gapFrom)||HS(e,this.gapTo,this.to)))return Sa.fail("Structure gap-replace would overwrite content");let r=e.slice(this.gapFrom,this.gapTo);if(r.openStart||r.openEnd)return Sa.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,r.content);return n?Sa.fromReplace(e,this.from,this.to,n):Sa.fail("Content does not fit in gap")}getMap(){return new cl([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let r=this.gapTo-this.gapFrom;return new si(this.from,this.from+this.slice.size+r,this.from+this.insert,this.from+this.insert+r,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let r=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),a=this.from==this.gapFrom?r.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return r.deletedAcross&&n.deletedAcross||a<r.pos||i>n.pos?null:new si(r.pos,n.pos,a,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,r){if(typeof r.from!="number"||typeof r.to!="number"||typeof r.gapFrom!="number"||typeof r.gapTo!="number"||typeof r.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new si(r.from,r.to,r.gapFrom,r.gapTo,ar.fromJSON(e,r.slice),r.insert,!!r.structure)}}Gi.jsonID("replaceAround",si);function HS(t,e,r){let n=t.resolve(e),a=r-e,i=n.depth;for(;a>0&&i>0&&n.indexAfter(i)==n.node(i).childCount;)i--,a--;if(a>0){let o=n.node(i).maybeChild(n.indexAfter(i));for(;a>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,a--}}return!1}function KSe(t,e,r,n){let a=[],i=[],o,l;t.doc.nodesBetween(e,r,(c,u,d)=>{if(!c.isInline)return;let h=c.marks;if(!n.isInSet(h)&&d.type.allowsMarkType(n.type)){let f=Math.max(u,e),m=Math.min(u+c.nodeSize,r),g=n.addToSet(h);for(let y=0;y<h.length;y++)h[y].isInSet(g)||(o&&o.to==f&&o.mark.eq(h[y])?o.to=m:a.push(o=new xu(f,m,h[y])));l&&l.to==f?l.to=m:i.push(l=new $h(f,m,n))}}),a.forEach(c=>
vendor: 5,649 bytes, lines 1202-1203
1202t.step(c)),i.forEach(c=>t.step(c))}function JSe(t,e,r,n){let a=[],i=0;t.doc.nodesBetween(e,r,(o,l)=>{if(!o.isInline)return;i++;let c=null;if(n instanceof dj){let u=o.marks,d;for(;d=n.isInSet(u);)(c||(c=[])).push(d),u=d.removeFromSet(u)}else n?n.isInSet(o.marks)&&(c=[n]):c=o.marks;if(c&&c.length){let u=Math.min(l+o.nodeSize,r);for(let d=0;d<c.length;d++){let h=c[d],f;for(let m=0;m<a.length;m++){let g=a[m];g.step==i-1&&h.eq(a[m].style)&&(f=g)}f?(f.to=u,f.step=i):a.push({style:h,from:Math.max(l,e),to:u,step:i})}}}),a.forEach(o=>t.step(new xu(o.from,o.to,o.style)))}function w_(t,e,r,n=r.contentMatch,a=!0){let i=t.doc.nodeAt(e),o=[],l=e+1;for(let c=0;c<i.childCount;c++){let u=i.child(c),d=l+u.nodeSize,h=n.matchType(u.type);if(!h)o.push(new ei(l,d,ar.empty));else{n=h;for(let f=0;f<u.marks.length;f++)r.allowsMarkType(u.marks[f].type)||t.step(new xu(l,d,u.marks[f]));if(a&&u.isText&&r.whitespace!="pre"){let f,m=/\r?\n|\r/g,g;for(;f=m.exec(u.text);)g||(g=new ar(Nt.from(r.schema.text(" ",r.allowedMarks(u.marks))),0,0)),o.push(new ei(l+f.index,l+f.index+f[0].length,g))}}l=d}if(!n.validEnd){let c=n.fillBefore(Nt.empty,!0);t.replace(l,l,new ar(c,0,0))}for(let c=o.length-1;c>=0;c--)t.step(o[c])}function YSe(t,e,r){return(e==0||t.canReplace(e,t.childCount))&&(r==t.childCount||t.canReplace(0,r))}function zx(t){let r=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth,a=0,i=0;;--n){let o=t.$from.node(n),l=t.$from.index(n)+a,c=t.$to.indexAfter(n)-i;if(n<t.depth&&o.canReplace(l,c,r))return n;if(n==0||o.type.spec.isolating||!YSe(o,l,c))break;l&&(a=1),c<o.childCount&&(i=1)}return null}function ZSe(t,e,r){let{$from:n,$to:a,depth:i}=e,o=n.before(i+1),l=a.after(i+1),c=o,u=l,d=Nt.empty,h=0;for(let g=i,y=!1;g>r;g--)y||n.index(g)>0?(y=!0,d=Nt.from(n.node(g).copy(d)),h++):c--;let f=Nt.empty,m=0;for(let g=i,y=!1;g>r;g--)y||a.after(g+1)<a.end(g)?(y=!0,f=Nt.from(a.node(g).copy(f)),m++):u++;t.step(new si(c,u,o,l,new ar(d.append(f),h,m),d.size-h,!0))}function j_(t,e,r=null,n=t){let a=XSe(t,e),i=a&&QSe(n,e);return i?a.map(rT).concat({type:e,attrs:r}).concat(i.map(rT)):null}function rT(t){return{type:t,attrs:null}}function XSe(t,e){let{parent:r,startIndex:n,endIndex:a}=t,i=r.contentMatchAt(n).findWrapping(e);if(!i)return null;let o=i.length?i[0]:e;return r.canReplaceWith(n,a,o)?i:null}function QSe(t,e){let{parent:r,startIndex:n,endIndex:a}=t,i=r.child(n),o=e.contentMatch.findWrapping(i.type);if(!o)return null;let c=(o.length?o[o.length-1]:e).contentMatch;for(let u=n;c&&u<a;u++)c=c.matchType(r.child(u).type);return!c||!c.validEnd?null:o}function eCe(t,e,r){let n=Nt.empty;for(let o=r.length-1;o>=0;o--){if(n.size){let l=r[o].type.contentMatch.matchFragment(n);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=Nt.from(r[o].type.create(r[o].attrs,n))}let a=e.start,i=e.end;t.step(new si(a,i,a,i,new ar(n,0,0),r.length,!0))}function tCe(t,e,r,n,a){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,r,(o,l)=>{let c=typeof a=="function"?a(o):a;if(o.isTextblock&&!o.hasMarkup(n,c)&&rCe(t.doc,t.mapping.slice(i).map(l),n)){let u=null;if(n.schema.linebreakReplacement){let m=n.whitespace=="pre",g=!!n.contentMatch.matchType(n.schema.linebreakReplacement);m&&!g?u=!1:!m&&g&&(u=!0)}u===!1&&dz(t,o,l,i),w_(t,t.mapping.slice(i).map(l,1),n,void 0,u===null);let d=t.mapping.slice(i),h=d.map(l,1),f=d.map(l+o.nodeSize,1);return t.step(new si(h,f,h+1,f-1,new ar(Nt.from(n.create(c,null,o.marks)),0,0),1,!0)),u===!0&&uz(t,o,l,i),!1}})}function uz(t,e,r,n){e.forEach((a,i)=>{if(a.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(a.text);){let c=t.mapping.slice(n).map(r+1+i+o.index);t.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function dz(t,e,r,n){e.forEach((a,i)=>{if(a.type==a.type.schema.linebreakReplacement){let o=t.mapping.slice(n).map(r+1+i);t.replaceWith(o,o+1,e.type.schema.text(` 1203`))}})}function rCe(t,e,r){let n=t.resolve(e),a=n.index();return n.parent.canReplaceWith(a,a+1,r)}function sCe(t,e,r,n,a){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");r||(r=i.type);let o=r.create(n,null,a||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,o);if(!r.validContent(i.content))throw new RangeError("Invalid content for node type "+r.name);t.step(new si(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new ar(Nt.from(o),0,0),1,!0))}function bd(t,e,r=1,n){let a=t.resolve(e),i=a.depth-r,o=n&&n[n.length-1]||a.parent;if(i<0||a.parent.type.spec.isolating||!a.parent.canReplace(a.index(),a.parent.childCount)||!o.type.validContent(a.parent.content.cutByIndex(a.index(),a.parent.childCount)))return!1;for(let u=a.depth-1,d=r-2;u>i;u--,d--){let h=a.node(u),f=a.index(u);if(h.type.spec.isolating)return!1;let m=h.content.cutByIndex(f,h.childCount),g=n&&n[d+1];g&&(m=m.replaceChild(0,g.type.create(g.attrs)));let y=n&&n[d]||h;if(!h.canReplace(f+1,h.childCount)||!y.type.validContent(m))return!1}let l=a.indexAfter(i),c=n&&n[0];return a.node(i).canReplaceWith(l,l,c?c.type:a.node(i+1).type)}function nCe(t,e,r=1,n){let a=t.doc.resolve(e),i=Nt.empty,o=Nt.empty;for(let l=a.depth,c=a.depth-r,u=r-1;l>c;l--,u--){i=Nt.from(a.node(l).copy(i));let d=n&&n[u];o=Nt.from(d?d.type.create(d.attrs,o):a.node(l).copy(o))}t.step(new ei(e,e,new ar(i.append(o),r,r),!0))}function gm(t,e){let r=t.resolve(e),n=r.index();return hz(r.nodeBefore,r.nodeAfter)&&r.parent.canReplace(n,n+1)}function aCe(t,e){e.content.size||t.type.compatibleContent(e.type);let r=t.contentMatchAt(t.childCount),{linebreakReplacement:n}=t.type.schema;for(let a=0;a<e.childCount;
vendor: 11,437 bytes, line 1203
1203a++){let i=e.child(a),o=i.type==n?t.type.schema.nodes.text:i.type;if(r=r.matchType(o),!r||!t.type.allowsMarks(i.marks))return!1}return r.validEnd}function hz(t,e){return!!(t&&e&&!t.isLeaf&&aCe(t,e))}function hj(t,e,r=-1){let n=t.resolve(e);for(let a=n.depth;;a--){let i,o,l=n.index(a);if(a==n.depth?(i=n.nodeBefore,o=n.nodeAfter):r>0?(i=n.node(a+1),l++,o=n.node(a).maybeChild(l)):(i=n.node(a).maybeChild(l-1),o=n.node(a+1)),i&&!i.isTextblock&&hz(i,o)&&n.node(a).canReplace(l,l+1))return e;if(a==0)break;e=r<0?n.before(a):n.after(a)}}function iCe(t,e,r){let n=null,{linebreakReplacement:a}=t.doc.type.schema,i=t.doc.resolve(e-r),o=i.node().type;if(a&&o.inlineContent){let d=o.whitespace=="pre",h=!!o.contentMatch.matchType(a);d&&!h?n=!1:!d&&h&&(n=!0)}let l=t.steps.length;if(n===!1){let d=t.doc.resolve(e+r);dz(t,d.node(),d.before(),l)}o.inlineContent&&w_(t,e+r-1,o,i.node().contentMatchAt(i.index()),n==null);let c=t.mapping.slice(l),u=c.map(e-r);if(t.step(new ei(u,c.map(e+r,-1),ar.empty,!0)),n===!0){let d=t.doc.resolve(u);uz(t,d.node(),d.before(),t.steps.length)}return t}function oCe(t,e,r){let n=t.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),r))return e;if(n.parentOffset==0)for(let a=n.depth-1;a>=0;a--){let i=n.index(a);if(n.node(a).canReplaceWith(i,i,r))return n.before(a+1);if(i>0)return null}if(n.parentOffset==n.parent.content.size)for(let a=n.depth-1;a>=0;a--){let i=n.indexAfter(a);if(n.node(a).canReplaceWith(i,i,r))return n.after(a+1);if(i<n.node(a).childCount)return null}return null}function mz(t,e,r){let n=t.resolve(e);if(!r.content.size)return e;let a=r.content;for(let i=0;i<r.openStart;i++)a=a.firstChild.content;for(let i=1;i<=(r.openStart==0&&r.size?2:1);i++)for(let o=n.depth;o>=0;o--){let l=o==n.depth?0:n.pos<=(n.start(o+1)+n.end(o+1))/2?-1:1,c=n.index(o)+(l>0?1:0),u=n.node(o),d=!1;if(i==1)d=u.canReplace(c,c,a);else{let h=u.contentMatchAt(c).findWrapping(a.firstChild.type);d=h&&u.canReplaceWith(c,c,h[0])}if(d)return l==0?n.pos:l<0?n.before(o+1):n.after(o+1)}return null}function mj(t,e,r=e,n=ar.empty){if(e==r&&!n.size)return null;let a=t.resolve(e),i=t.resolve(r);return fz(a,i,n)?new ei(e,r,n):new lCe(a,i,n).fit()}function fz(t,e,r){return!r.openStart&&!r.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),r.content)}class lCe{constructor(e,r,n){this.$from=e,this.$to=r,this.unplaced=n,this.frontier=[],this.placed=Nt.empty;for(let a=0;a<=e.depth;a++){let i=e.node(a);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(a))})}for(let a=e.depth;a>0;a--)this.placed=Nt.from(e.node(a).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),r=this.placed.size-this.depth-this.$from.depth,n=this.$from,a=this.close(e<0?this.$to:n.doc.resolve(e));if(!a)return null;let i=this.placed,o=n.depth,l=a.depth;for(;o&&l&&i.childCount==1;)i=i.firstChild.content,o--,l--;let c=new ar(i,o,l);return e>-1?new si(n.pos,e,this.$to.pos,this.$to.end(),c,r):c.size||n.pos!=this.$to.pos?new ei(n.pos,a.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let r=this.unplaced.content,n=0,a=this.unplaced.openEnd;n<e;n++){let i=r.firstChild;if(r.childCount>1&&(a=0),i.type.spec.isolating&&a<=n){e=n;break}r=i.content}for(let r=1;r<=2;r++)for(let n=r==1?e:this.unplaced.openStart;n>=0;n--){let a,i=null;n?(i=BN(this.unplaced.content,n-1).firstChild,a=i.content):a=this.unplaced.content;let o=a.firstChild;for(let l=this.depth;l>=0;l--){let{type:c,match:u}=this.frontier[l],d,h=null;if(r==1&&(o?u.matchType(o.type)||(h=u.fillBefore(Nt.from(o),!1)):i&&c.compatibleContent(i.type)))return{sliceDepth:n,frontierDepth:l,parent:i,inject:h};if(r==2&&o&&(d=u.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:l,parent:i,wrap:d};if(i&&u.matchType(i.type))break}}}openMore(){let{content:e,openStart:r,openEnd:n}=this.unplaced,a=BN(e,r);return!a.childCount||a.firstChild.isLeaf?!1:(this.unplaced=new ar(e,r+1,Math.max(n,a.size+r>=e.size-n?r+1:0)),!0)}dropNode(){let{content:e,openStart:r,openEnd:n}=this.unplaced,a=BN(e,r);if(a.childCount<=1&&r>0){let i=e.size-r<=r+a.size;this.unplaced=new ar(Ey(e,r-1,1),r-1,i?r-1:n)}else this.unplaced=new ar(Ey(e,r,1),r,n)}placeNodes({sliceDepth:e,frontierDepth:r,parent:n,inject:a,wrap:i}){for(;this.depth>r;)this.closeFrontierNode();if(i)for(let y=0;y<i.length;y++)this.openFrontierNode(i[y]);let o=this.unplaced,l=n?n.content:o.content,c=o.openStart-e,u=0,d=[],{match:h,type:f}=this.frontier[r];if(a){for(let y=0;y<a.childCount;y++)d.push(a.child(y));h=h.matchFragment(a)}let m=l.size+e-(o.content.size-o.openEnd);for(;u<l.childCount;){let y=l.child(u),b=h.matchType(y.type);if(!b)break;u++,(u>1||c==0||y.content.size)&&(h=b,d.push(pz(y.mark(f.allowedMarks(y.marks)),u==1?c:0,u==l.childCount?m:-1)))}let g=u==l.childCount;g||(m=-1),this.placed=Ay(this.placed,r,Nt.from(d)),this.frontier[r].match=h,g&&m<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let y=0,b=l;y<m;y++){let w=b.lastChild;this.frontier.push({type:w.type,match:w.contentMatchAt(w.childCount)}),b=w.content}this.unplaced=g?e==0?ar.empty:new ar(Ey(o.content,e-1,1),e-1,m<0?o.openEnd:e-1):new ar(Ey(o.content,e,u),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],r;if(!e.type.isTextblock||!LN(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(r=this.findCloseLevel(this.$to))&&r.depth==this.depth)return-1;let{depth:n}=this.$to,a=this.$to.after(n);for(;n>1&&a==this.$to.end(--n);)++a;return a}findCloseLevel(e){e:for(let r=Math.min(this.depth,e.depth);r>=0;r--){let{match:n,type:a}=this.frontier[r],i=r<e.depth&&e.end(r+1)==e.pos+(e.depth-(r+1)),o=LN(e,r,a,n,i);if(o){for(let l=r-1;l>=0;l--){let{match:c,type:u}=this.frontier[l],d=LN(e,l,u,c,!0);if(!d||d.childCount)continue e}return{depth:r,fit:o,move:i?e.doc.resolve(e.after(r+1)):e}}}}close(e){let r=this.findCloseLevel(e);if(!r)return null;for(;this.depth>r.depth;)this.closeFrontierNode();r.fit.childCount&&(this.placed=Ay(this.placed,r.depth,r.fit)),e=r.move;for(let n=r.depth+1;n<=e.depth;n++){let a=e.node(n),i=a.type.contentMatch.fillBefore(a.content,!0,e.index(n));this.openFrontierNode(a.type,a.attrs,i)}return e}openFrontierNode(e,r=null,n){let a=this.frontier[this.depth];a.match=a.match.matchType(e),this.placed=Ay(this.placed,this.depth,Nt.from(e.create(r,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let r=this.frontier.pop().match.fillBefore(Nt.empty,!0);r.childCount&&(this.placed=Ay(this.placed,this.frontier.length,r))}}function Ey(t,e,r){return e==0?t.cutByIndex(r,t.childCount):t.replaceChild(0,t.firstChild.copy(Ey(t.firstChild.content,e-1,r)))}function Ay(t,e,r){return e==0?t.append(r):t.replaceChild(t.childCount-1,t.lastChild.copy(Ay(t.lastChild.content,e-1,r)))}function BN(t,e){for(let r=0;r<e;r++)t=t.firstChild.content;return t}function pz(t,e,r){if(e<=0)return t;let n=t.content;return e>1&&(n=n.replaceChild(0,pz(n.firstChild,e-1,n.childCount==1?r-1:0))),e>0&&(n=t.type.contentMatch.fillBefore(n).append(n),r<=0&&(n=n.append(t.type.contentMatch.matchFragment(n).fillBefore(Nt.empty,!0)))),t.copy(n)}function LN(t,e,r,n,a){let i=t.node(e),o=a?t.indexAfter(e):t.index(e);if(o==i.childCount&&!r.compatibleContent(i.type))return null;let l=n.fillBefore(i.content,!0,o);return l&&!cCe(r,i.content,o)?l:null}function cCe(t,e,r){for(let n=r;n<e.childCount;n++)if(!t.allowsMarks(e.child(n).marks))return!0;return!1}function uCe(t){return t.spec.defining||t.spec.definingForContent}function dCe(t,e,r,n){if(!n.size)return t.deleteRange(e,r);let a=t.doc.resolve(e),i=t.doc.resolve(r);if(fz(a,i,n))return t.step(new ei(e,r,n));let o=xz(a,i);o[o.length-1]==0&&o.pop();let l=-(a.depth+1);o.unshift(l);for(let f=a.depth,m=a.pos-1;f>0;f--,m--){let g=a.node(f).type.spec;if(g.defining||g.definingAsContext||g.isolating)break;o.indexOf(f)>-1?l=f:a.before(f)==m&&o.splice(1,0,-f)}let c=o.indexOf(l),u=[],d=n.openStart;for(let f=n.content,m=0;;m++){let g=f.firstChild;if(u.push(g),m==n.openStart)break;f=g.content}for(let f=d-1;f>=0;f--){let m=u[f],g=uCe(m.type);if(g&&!m.sameMarkup(a.node(Math.abs(l)-1)))d=f;else if(g||!m.type.isTextblock)break}for(let f=n.openStart;f>=0;f--){let m=(f+d+1)%(n.openStart+1),g=u[m];if(g)for(let y=0;y<o.length;y++){let b=o[(y+c)%o.length],w=!0;b<0&&(w=!1,b=-b);let j=a.node(b-1),N=a.index(b-1);if(j.canReplaceWith(N,N,g.type,g.marks))return t.replace(a.before(b),w?i.after(b):r,new ar(gz(n.content,0,n.openStart,m),m,n.openEnd))}}let h=t.steps.length;for(let f=o.length-1;f>=0&&(t.replace(e,r,n),!(t.steps.length>h));f--){let m=o[f];m<0||(e=a.before(m),r=i.after(m))}}function gz(t,e,r,n,a){if(e<r){let i=t.firstChild;t=t.replaceChild(0,i.copy(gz(i.content,e+1,r,n,i)))}if(e>n){let i=a.contentMatchAt(0),o=i.fillBefore(t).append(t);t=o.append(i.matchFragment(o).fillBefore(Nt.empty,!0))}return t}function hCe(t,e,r,n){if(!n.isInline&&e==r&&t.doc.resolve(e).parent.content.size){let a=oCe(t.doc,e,n.type);a!=null&&(e=r=a)}t.replaceRange(e,r,new ar(Nt.from(n),0,0))}function mCe(t,e,r){let n=t.doc.resolve(e),a=t.doc.resolve(r),i=xz(n,a);for(let o=0;o<i.length;o++){let l=i[o],c=o==i.length-1;if(c&&l==0||n.node(l).type.contentMatch.validEnd)return t.delete(n.start(l),a.end(l));if(l>0&&(c||n.node(l-1).canReplace(n.index(l-1),a.indexAfter(l-1))))return t.delete(n.before(l),a.after(l))}for(let o=1;o<=n.depth&&o<=a.depth;o++)if(e-n.start(o)==n.depth-o&&r>n.end(o)&&a.end(o)-r!=a.depth-o&&n.start(o-1)==a.start(o-1)&&n.node(o-1).canReplace(n.index(o-1),a.index(o-1)))return t.delete(n.before(o),r);t.delete(e,r)}function xz(t,e){let r=[],n=Math.min(t.depth,e.depth);for(let a=n;a>=0;a--){let i=t.start(a);if(i<t.pos-(t.depth-a)||e.end(a)>e.pos+(e.depth-a)||t.node(a).type.spec.isolating||e.node(a).type.spec.isolating)break;(i==e.start(a)||a==t.depth&&a==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&a&&e.start(a-1)==i-1)&&r.push(a)}return r}class Mg extends Gi{constructor(e,r,n){super(),this.pos=e,this.attr=r,this.value=n}apply(e){let r=e.nodeAt(this.pos);if(!r)return Sa.fail("No node at attribute step's position");let n=Object.create(null);for(let i in r.attrs)n[i]=r.attrs[i];n[this.attr]=this.value;let a=r.type.create(n,null,r.marks);return Sa.fromReplace(e,this.pos,this.pos+1,new ar(Nt.from(a),0,r.isLeaf?0:1))}getMap(){return cl.empty}invert(e){return new Mg(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let r=e.mapResult(this.pos,1);return r.deletedAfter?null:new Mg(r.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,r){if(typeof r.pos!="number"||typeof r.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Mg(r.pos,r.attr,r.value)}}Gi.jsonID("attr",Mg);class F0 extends Gi{constructor(e,r){super(),this.attr=e,this.value=r}apply(e){let r=Object.create(null);for(let a in e.attrs)r[a]=e.attrs[a];r[this.attr]=this.value;let n=e.type.create(r,e.content,e.marks);return Sa.ok(n)}getMap(){return cl.empty}invert(e){return new F0(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,r){if(typeof r.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new F0(r.attr,r.value)}}Gi.jsonID("docAttr",F0);
vendor: 4,299 bytes, line 1203
1203let mx=class extends Error{};mx=function t(e){let r=Error.call(this,e);return r.__proto__=t.prototype,r};mx.prototype=Object.create(Error.prototype);mx.prototype.constructor=mx;mx.prototype.name="TransformError";class fCe{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new N0}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let r=this.maybeStep(e);if(r.failed)throw new mx(r.failed);return this}maybeStep(e){let r=e.apply(this.doc);return r.failed||this.addStep(e,r.doc),r}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,r=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let a=this.mapping.maps[n];n&&(e=a.map(e,1),r=a.map(r,-1)),a.forEach((i,o,l,c)=>{e=Math.min(e,l),r=Math.max(r,c)})}return e==1e9?null:{from:e,to:r}}addStep(e,r){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=r}replace(e,r=e,n=ar.empty){let a=mj(this.doc,e,r,n);return a&&this.step(a),this}replaceWith(e,r,n){return this.replace(e,r,new ar(Nt.from(n),0,0))}delete(e,r){return this.replace(e,r,ar.empty)}insert(e,r){return this.replaceWith(e,e,r)}replaceRange(e,r,n){return dCe(this,e,r,n),this}replaceRangeWith(e,r,n){return hCe(this,e,r,n),this}deleteRange(e,r){return mCe(this,e,r),this}lift(e,r){return ZSe(this,e,r),this}join(e,r=1){return iCe(this,e,r),this}wrap(e,r){return eCe(this,e,r),this}setBlockType(e,r=e,n,a=null){return tCe(this,e,r,n,a),this}setNodeMarkup(e,r,n=null,a){return sCe(this,e,r,n,a),this}setNodeAttribute(e,r,n){return this.step(new Mg(e,r,n)),this}setDocAttribute(e,r){return this.step(new F0(e,r)),this}addNodeMark(e,r){return this.step(new Wh(e,r)),this}removeNodeMark(e,r){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(r instanceof ln)r.isInSet(n.marks)&&this.step(new np(e,r));else{let a=n.marks,i,o=[];for(;i=r.isInSet(a);)o.push(new np(e,i)),a=i.removeFromSet(a);for(let l=o.length-1;l>=0;l--)this.step(o[l])}return this}split(e,r=1,n){return nCe(this,e,r,n),this}addMark(e,r,n){return KSe(this,e,r,n),this}removeMark(e,r,n){return JSe(this,e,r,n),this}clearIncompatible(e,r,n){return w_(this,e,r,n),this}}const IN=Object.create(null);class ms{constructor(e,r,n){this.$anchor=e,this.$head=r,this.ranges=n||[new pCe(e.min(r),e.max(r))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let r=0;r<e.length;r++)if(e[r].$from.pos!=e[r].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,r=ar.empty){let n=r.content.lastChild,a=null;for(let l=0;l<r.openEnd;l++)a=n,n=n.lastChild;let i=e.steps.length,o=this.ranges;for(let l=0;l<o.length;l++){let{$from:c,$to:u}=o[l],d=e.mapping.slice(i);e.replaceRange(d.map(c.pos),d.map(u.pos),l?ar.empty:r),l==0&&aT(e,i,(n?n.isInline:a&&a.isTextblock)?-1:1)}}replaceWith(e,r){let n=e.steps.length,a=this.ranges;for(let i=0;i<a.length;i++){let{$from:o,$to:l}=a[i],c=e.mapping.slice(n),u=c.map(o.pos),d=c.map(l.pos);i?e.deleteRange(u,d):(e.replaceRangeWith(u,d,r),aT(e,n,r.isInline?-1:1))}}static findFrom(e,r,n=!1){let a=e.parent.inlineContent?new Vr(e):yg(e.node(0),e.parent,e.pos,e.index(),r,n);if(a)return a;for(let i=e.depth-1;i>=0;i--){let o=r<0?yg(e.node(0),e.node(i),e.before(i+1),e.index(i),r,n):yg(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,r,n);if(o)return o}return null}static near(e,r=1){return this.findFrom(e,r)||this.findFrom(e,-r)||new pl(e.node(0))}static atStart(e){return yg(e,e,0,0,1)||new pl(e)}static atEnd(e){return yg(e,e,e.content.size,e.childCount,-1)||new pl(e)}static fromJSON(e,r){if(!r||!r.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=IN[r.type];if(!n)throw new RangeError(`No selection type ${r.type} defined`);return n.fromJSON(e,r)}static jsonID(e,r){if(e in IN)throw new RangeError("Duplicate use of selection JSON ID "+e);return IN[e]=r,r.prototype.jsonID=e,r}getBookmark(){return Vr.between(this.$anchor,this.$head).getBookmark()}}ms.prototype.visible=!0;class pCe{constructor(e,r){this.$from=e,this.$to=r}}let sT=!1;function nT(t){!sT&&!t.parent.inlineContent&&(sT=!0,console.warn("TextSelection endpoint not pointing into a
1203node with inline content ("+t.parent.type.name+")"))}class Vr extends ms{constructor(e,r=e){nT(e),nT(r),super(e,r)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,r){let n=e.resolve(r.map(this.head));if(!n.parent.inlineContent)return ms.near(n);let a=e.resolve(r.map(this.anchor));return new Vr(a.parent.inlineContent?a:n,n)}replace(e,r=ar.empty){if(super.replace(e,r),r==ar.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof Vr&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new fj(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,r){if(typeof r.anchor!="number"||typeof r.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Vr(e.resolve(r.anchor),e.resolve(r.head))}static create(e,r,n=r){let a=e.resolve(r);return new this(a,n==r?a:e.resolve(n))}static between(e,r,n){let a=e.pos-r.pos;if((!n||a)&&(n=a>=0?1:-1),!r.parent.inlineContent){let i=ms.findFrom(r,n,!0)||ms.findFrom(r,-n,!0);if(i)r=i.$head;else return ms.near(r,n)}return e.parent.inlineContent||(a==0?e=r:(e=(ms.findFrom(e,-n,!0)||ms.findFrom(e,n,!0)).$anchor,e.pos<r.pos!=a<0&&(e=r))),new Vr(e,r)}}ms.jsonID("text",Vr);class fj{constructor(e,r){this.anchor=e,this.head=r}map(e){return new fj(e.map(this.anchor),e.map(this.head))}resolve(e){return Vr.between(e.resolve(this.anchor),e.resolve(this.head))}}class _r extends ms{constructor(e){let r=e.nodeAfter,n=e.node(0).resolve(e.pos+r.nodeSize);super(e,n),this.node=r}map(e,r){let{deleted:n,pos:a}=r.mapResult(this.anchor),i=e.resolve(a);return n?ms.near(i):new _r(i)}content(){return new ar(Nt.from(this.node),0,0)}eq(e){return e instanceof _r&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new N_(this.anchor)}static fromJSON(e,r){if(typeof r.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new _r(e.resolve(r.anchor))}static create(e,r){return new _r(e.resolve(r))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}_r.prototype.visible=!1;ms.jsonID("node",_r);class N_{constructor(e){this.anchor=e}map(e){let{deleted:r,pos:n}=e.mapResult(this.anchor);return r?new fj(n,n):new N_(n)}resolve(e){let r=e.resolve(this.anchor),n=r.nodeAfter;return n&&_r.isSelectable(n)?new _r(r):ms.near(r)}}class pl extends ms{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,r=ar.empty){if(r==ar.empty){e.delete(0,e.doc.content.size);let n=ms.atStart(e.doc);n.eq(e.selection)||e.setSelection(n)}else super.replace(e,r)}toJSON(){return{type:"all"}}static fromJSON(e){return new pl(e)}map(e){return new pl(e)}eq(e){return e instanceof pl}getBookmark(){return gCe}}ms.jsonID("all",pl);const gCe={map(){return this},resolve(t){return new pl(t)}};function yg(t,e,r,n,a,i=!1){if(e.inlineContent)return Vr.create(t,r);for(let o=n-(a>0?0:1);a>0?o<e.childCount:o>=0;o+=a){let l=e.child(o);if(l.isAtom){if(!i&&_r.isSelectable(l))return _r.create(t,r-(a<0?l.nodeSize:0))}else{let c=yg(t,l,r+a,a<0?l.childCount:0,a,i);if(c)return c}r+=l.nodeSize*a}return null}function aT(t,e,r){let n=t.steps.length-1;if(n<e)return;let a=t.steps[n];if(!(a instanceof ei||a instanceof si))return;let i=t.mapping.maps[n],o;i.forEach((l,c,u,d)=>{o==null&&(o=d)}),t.setSelection(ms.near(t.doc.resolve(o),r))}const iT=1,Pv=2,oT=4;class xCe extends fCe{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|iT)&~Pv,this.storedMarks=null,this}get selectionSet(){return(this.updated&iT)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=Pv,this}ensureMarks(e){return ln.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Pv)>0}addStep(e,r){super.addStep(e,r),this.updated=this.updated&~Pv,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,r=!0){let n=this.selection;return r&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||ln.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,r,n){let a=this.doc.type.schema;if(r==null)return e?this.replaceSelectionWith(a.text(e),!0):this.deleteSelection();{if(n==null&&(n=r),!e)return this.deleteRange(r,n);let i=this.storedMarks;if(!i){let o=this.doc.resolve(r);i=n==r?o.marks():o.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(r,n,a.text(e,i)),!this.selection.empty&&this.selection.to==r+e.length&&this.setSelection(ms.near(this.selection.$to)),this}}setMeta(e,r){return this.meta[typeof e=="string"?e:e.key]=r,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=oT,this}get scrolledIntoView(){return(this.updated&oT)>0}}function lT(t,e){return!e||!t?t:t.bind(e)}class Dy{constructor(e,r,n){this.name=e,this.init=lT(r.init,n),this.apply=lT(r.apply,n)}}const yCe=[new Dy("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Dy("selection",{init(t,e){return t.selection||ms.atStart(e.doc)},apply(t){return t.selection}}),new Dy("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,r,n){return n.selection.$cursor?t.storedMarks:null}}),new Dy("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class ON{constructor(e,r){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=yCe.slice(),r&&r.forEach(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new Dy(n.key,n.spec.state,n))})}}class wg{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}
vendor: 4,191 bytes, line 1203
1203apply(e){return this.applyTransaction(e).state}filterTransaction(e,r=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=r){let a=this.config.plugins[n];if(a.spec.filterTransaction&&!a.spec.filterTransaction.call(a,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let r=[e],n=this.applyInner(e),a=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let l=this.config.plugins[o];if(l.spec.appendTransaction){let c=a?a[o].n:0,u=a?a[o].state:this,d=c<r.length&&l.spec.appendTransaction.call(l,c?r.slice(c):r,u,n);if(d&&n.filterTransaction(d,o)){if(d.setMeta("appendedTransaction",e),!a){a=[];for(let h=0;h<this.config.plugins.length;h++)a.push(h<o?{state:n,n:r.length}:{state:this,n:0})}r.push(d),n=n.applyInner(d),i=!0}a&&(a[o]={state:n,n:r.length})}}if(!i)return{state:n,transactions:r}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let r=new wg(this.config),n=this.config.fields;for(let a=0;a<n.length;a++){let i=n[a];r[i.name]=i.apply(e,this[i.name],this,r)}return r}get tr(){return new xCe(this)}static create(e){let r=new ON(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new wg(r);for(let a=0;a<r.fields.length;a++)n[r.fields[a].name]=r.fields[a].init(e,n);return n}reconfigure(e){let r=new ON(this.schema,e.plugins),n=r.fields,a=new wg(r);for(let i=0;i<n.length;i++){let o=n[i].name;a[o]=this.hasOwnProperty(o)?this[o]:n[i].init(e,a)}return a}toJSON(e){let r={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(r.storedMarks=this.storedMarks.map(n=>n.toJSON())),e&&typeof e=="object")for(let n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let a=e[n],i=a.spec.state;i&&i.toJSON&&(r[n]=i.toJSON.call(a,this[a.key]))}return r}static fromJSON(e,r,n){if(!r)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let a=new ON(e.schema,e.plugins),i=new wg(a);return a.fields.forEach(o=>{if(o.name=="doc")i.doc=Zh.fromJSON(e.schema,r.doc);else if(o.name=="selection")i.selection=ms.fromJSON(i.doc,r.selection);else if(o.name=="storedMarks")r.storedMarks&&(i.storedMarks=r.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let l in n){let c=n[l],u=c.spec.state;if(c.key==o.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(r,l)){i[o.name]=u.fromJSON.call(c,e,r[l],i);return}}i[o.name]=o.init(e,i)}}),i}}function yz(t,e,r){for(let n in t){let a=t[n];a instanceof Function?a=a.bind(e):n=="handleDOMEvents"&&(a=yz(a,e,{})),r[n]=a}return r}class fo{constructor(e){this.spec=e,this.props={},e.props&&yz(e.props,this,this.props),this.key=e.key?e.key.key:bz("plugin")}getState(e){return e[this.key]}}const zN=Object.create(null);function bz(t){return t in zN?t+"$"+ ++zN[t]:(zN[t]=0,t+"$")}class qc{constructor(e="key"){this.key=bz(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const gi=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},fx=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let $S=null;const ld=function(t,e,r){let n=$S||($S=document.createRange());return n.setEnd(t,r??t.nodeValue.length),n.setStart(t,e||0),n},bCe=function(){$S=null},ap=function(t,e,r,n){return r&&(cT(t,e,r,n,-1)||cT(t,e,r,n,1))},vCe=/^(img|br|input|textarea|hr)$/i;function cT(t,e,r,n,a){for(var i;;){if(t==r&&e==n)return!0;if(e==(a<0?0:Ol(t))){let o=t.parentNode;if(!o||o.nodeType!=1||cb(t)||vCe.test(t.nodeName)||t.contentEditable=="false")return!1;e=gi(t)+(a<0?0:1),t=o}else if(t.nodeType==1){let o=t.childNodes[e+(a<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((i=o.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)e+=a;else return!1;else t=o,e=a<0?Ol(t):0}else return!1}}function Ol(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function wCe(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Ol(t)}else if(t.parentNode&&!cb(t))e=gi(t),t=t.parentNode;else return null}}function jCe(t,e){for(;;
vendor: 4,347 bytes, line 1203
1203){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!cb(t))e=gi(t)+1,t=t.parentNode;else return null}}function NCe(t,e,r){for(let n=e==0,a=e==Ol(t);n||a;){if(t==r)return!0;let i=gi(t);if(t=t.parentNode,!t)return!1;n=n&&i==0,a=a&&i==Ol(t)}}function cb(t){let e;for(let r=t;r&&!(e=r.pmViewDesc);r=r.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const pj=function(t){return t.focusNode&&ap(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function gf(t,e){let r=document.createEvent("Event");return r.initEvent("keydown",!0,!0),r.keyCode=t,r.key=r.code=e,r}function FCe(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function SCe(t,e,r){if(t.caretPositionFromPoint)try{let n=t.caretPositionFromPoint(e,r);if(n)return{node:n.offsetNode,offset:Math.min(Ol(n.offsetNode),n.offset)}}catch{}if(t.caretRangeFromPoint){let n=t.caretRangeFromPoint(e,r);if(n)return{node:n.startContainer,offset:Math.min(Ol(n.startContainer),n.startOffset)}}}const ju=typeof navigator<"u"?navigator:null,uT=typeof document<"u"?document:null,xm=ju&&ju.userAgent||"",WS=/Edge\/(\d+)/.exec(xm),vz=/MSIE \d/.exec(xm),qS=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(xm),Bo=!!(vz||qS||WS),Qh=vz?document.documentMode:qS?+qS[1]:WS?+WS[1]:0,Gl=!Bo&&/gecko\/(\d+)/i.test(xm);Gl&&+(/Firefox\/(\d+)/.exec(xm)||[0,0])[1];const GS=!Bo&&/Chrome\/(\d+)/.exec(xm),bi=!!GS,wz=GS?+GS[1]:0,Hi=!Bo&&!!ju&&/Apple Computer/.test(ju.vendor),px=Hi&&(/Mobile\/\w+/.test(xm)||!!ju&&ju.maxTouchPoints>2),Bl=px||(ju?/Mac/.test(ju.platform):!1),jz=ju?/Win/.test(ju.platform):!1,xd=/Android \d/.test(xm),ub=!!uT&&"webkitFontSmoothing"in uT.documentElement.style,CCe=ub?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function kCe(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function ad(t,e){return typeof t=="number"?t:t[e]}function _Ce(t){let e=t.getBoundingClientRect(),r=e.width/t.offsetWidth||1,n=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*r,top:e.top,bottom:e.top+t.clientHeight*n}}function dT(t,e,r){let n=t.someProp("scrollThreshold")||0,a=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let o=r||t.dom;o;){if(o.nodeType!=1){o=fx(o);continue}let l=o,c=l==i.body,u=c?kCe(i):_Ce(l),d=0,h=0;if(e.top<u.top+ad(n,"top")?h=-(u.top-e.top+ad(a,"top")):e.bottom>u.bottom-ad(n,"bottom")&&(h=e.bottom-e.top>u.bottom-u.top?e.top+ad(a,"top")-u.top:e.bottom-u.bottom+ad(a,"bottom")),e.left<u.left+ad(n,"left")?d=-(u.left-e.left+ad(a,"left")):e.right>u.right-ad(n,"right")&&(d=e.right-u.right+ad(a,"right")),d||h)if(c)i.defaultView.scrollBy(d,h);else{let m=l.scrollLeft,g=l.scrollTop;h&&(l.scrollTop+=h),d&&(l.scrollLeft+=d);let y=l.scrollLeft-m,b=l.scrollTop-g;e={left:e.left-y,top:e.top-b,right:e.right-y,bottom:e.bottom-b}}let f=c?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(f))break;o=f=="absolute"?o.offsetParent:fx(o)}}function ECe(t){let e=t.dom.getBoundingClientRect(),r=Math.max(0,e.top),n,a;for(let i=(e.left+e.right)/2,o=r+1;o<Math.min(innerHeight,e.bottom);o+=5){let l=t.root.elementFromPoint(i,o);if(!l||l==t.dom||!t.dom.contains(l))continue;let c=l.getBoundingClientRect();if(c.top>=r-20){n=l,a=c.top;break}}return{refDOM:n,refTop:a,stack:Nz(t.dom)}}function Nz(t){let e=[],r=t.ownerDocument;for(let n=t;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),t!=r);n=fx(n));return e}function ACe({refDOM:t,refTop:e,stack:r}){let n=t?t.getBoundingClientRect().top:0;Fz(r,n==0?0:n-e)}function Fz(t,e){for(let r=0;r<t.length;r++){let{dom:n,top:a,left:i}=t[r];n.scrollTop!=a+e&&(n.scrollTop=a+e),n.scrollLeft!=i&&(n.scrollLeft=i)}}let ig=null;function DCe(t){if(t.setActive)return t.setActive();if(ig)return t.focus(ig);let e=Nz(t);t.focus(ig==null?{get preventScroll(){return ig={preventScroll:!0},!0}}:void 0),ig||(ig=!1,Fz(e,0))}function Sz(t,e){let r,n=2e8,a,i=0,o=e.top,l=e.top,c,u;for(let d=t.firstChild,h=0;d;d=d.nextSibling,h++){let f;if(d.nodeType==1)f=d.getClientRects();else if(d.nodeType==3)f=ld(d).getClientRects();else continue;for(let m=0;m<f.length;m++){let g=f[m];
vendor: 13,300 bytes, lines 1203-1204
1203if(g.top<=o&&g.bottom>=l){o=Math.max(g.bottom,o),l=Math.min(g.top,l);let y=g.left>e.left?g.left-e.left:g.right<e.left?e.left-g.right:0;if(y<n){r=d,n=y,a=y&&r.nodeType==3?{left:g.right<e.left?g.right:g.left,top:e.top}:e,d.nodeType==1&&y&&(i=h+(e.left>=(g.left+g.right)/2?1:0));continue}}else g.top>e.top&&!c&&g.left<=e.left&&g.right>=e.left&&(c=d,u={left:Math.max(g.left,Math.min(g.right,e.left)),top:g.top});!r&&(e.left>=g.right&&e.top>=g.top||e.left>=g.left&&e.top>=g.bottom)&&(i=h+1)}}return!r&&c&&(r=c,a=u,n=0),r&&r.nodeType==3?TCe(r,a):!r||n&&r.nodeType==1?{node:t,offset:i}:Sz(r,a)}function TCe(t,e){let r=t.nodeValue.length,n=document.createRange(),a;for(let i=0;i<r;i++){n.setEnd(t,i+1),n.setStart(t,i);let o=vh(n,1);if(o.top!=o.bottom&&F_(e,o)){a={node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)};break}}return n.detach(),a||{node:t,offset:0}}function F_(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function MCe(t,e){let r=t.parentNode;return r&&/^li$/i.test(r.nodeName)&&e.left<t.getBoundingClientRect().left?r:t}function PCe(t,e,r){let{node:n,offset:a}=Sz(e,r),i=-1;if(n.nodeType==1&&!n.firstChild){let o=n.getBoundingClientRect();i=o.left!=o.right&&r.left>(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(n,a,i)}function RCe(t,e,r,n){let a=-1;for(let i=e,o=!1;i!=t.dom;){let l=t.docView.nearestDesc(i,!0),c;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((c=l.dom.getBoundingClientRect()).width||c.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!o&&c.left>n.left||c.top>n.top?a=l.posBefore:(!o&&c.right<n.left||c.bottom<n.top)&&(a=l.posAfter),o=!0),!l.contentDOM&&a<0&&!l.node.isText))return(l.node.isBlock?n.top<(c.top+c.bottom)/2:n.left<(c.left+c.right)/2)?l.posBefore:l.posAfter;i=l.dom.parentNode}return a>-1?a:t.docView.posFromDOM(e,r,-1)}function Cz(t,e,r){let n=t.childNodes.length;if(n&&r.top<r.bottom)for(let a=Math.max(0,Math.min(n-1,Math.floor(n*(e.top-r.top)/(r.bottom-r.top))-2)),i=a;;){let o=t.childNodes[i];if(o.nodeType==1){let l=o.getClientRects();for(let c=0;c<l.length;c++){let u=l[c];if(F_(e,u))return Cz(o,e,u)}}if((i=(i+1)%n)==a)break}return t}function BCe(t,e){let r=t.dom.ownerDocument,n,a=0,i=SCe(r,e.left,e.top);i&&({node:n,offset:a}=i);let o=(t.root.elementFromPoint?t.root:r).elementFromPoint(e.left,e.top),l;if(!o||!t.dom.contains(o.nodeType!=1?o.parentNode:o)){let u=t.dom.getBoundingClientRect();if(!F_(e,u)||(o=Cz(t.dom,e,u),!o))return null}if(Hi)for(let u=o;n&&u;u=fx(u))u.draggable&&(n=void 0);if(o=MCe(o,e),n){if(Gl&&n.nodeType==1&&(a=Math.min(a,n.childNodes.length),a<n.childNodes.length)){let d=n.childNodes[a],h;d.nodeName=="IMG"&&(h=d.getBoundingClientRect()).right<=e.left&&h.bottom>e.top&&a++}let u;ub&&a&&n.nodeType==1&&(u=n.childNodes[a-1]).nodeType==1&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=e.top&&a--,n==t.dom&&a==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(a==0||n.nodeType!=1||n.childNodes[a-1].nodeName!="BR")&&(l=RCe(t,n,a,e))}l==null&&(l=PCe(t,o,e));let c=t.docView.nearestDesc(o,!0);return{pos:l,inside:c?c.posAtStart-c.border:-1}}function hT(t){return t.top<t.bottom||t.left<t.right}function vh(t,e){let r=t.getClientRects();if(r.length){let n=r[e<0?0:r.length-1];if(hT(n))return n}return Array.prototype.find.call(r,hT)||t.getBoundingClientRect()}const LCe=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function kz(t,e,r){let{node:n,offset:a,atom:i}=t.docView.domFromPos(e,r<0?-1:1),o=ub||Gl;if(n.nodeType==3)if(o&&(LCe.test(n.nodeValue)||(r<0?!a:a==n.nodeValue.length))){let c=vh(ld(n,a,a),r);if(Gl&&a&&/\s/.test(n.nodeValue[a-1])&&a<n.nodeValue.length){let u=vh(ld(n,a-1,a-1),-1);if(u.top==c.top){let d=vh(ld(n,a,a+1),-1);if(d.top!=c.top)return by(d,d.left<u.left)}}return c}else{let c=a,u=a,d=r<0?1:-1;return r<0&&!a?(u++,d=-1):r>=0&&a==n.nodeValue.length?(c--,d=1):r<0?c--:u++,by(vh(ld(n,c,u),d),d<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&a&&(r<0||a==Ol(n))){let c=n.childNodes[a-1];if(c.nodeType==1)return UN(c.getBoundingClientRect(),!1)}if(i==null&&a<Ol(n)){let c=n.childNodes[a];if(c.nodeType==1)return UN(c.getBoundingClientRect(),!0)}return UN(n.getBoundingClientRect(),r>=0)}if(i==null&&a&&(r<0||a==Ol(n))){let c=n.childNodes[a-1],u=c.nodeType==3?ld(c,Ol(c)-(o?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(u)return by(vh(u,1),!1)}if(i==null&&a<Ol(n)){let c=n.childNodes[a];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let u=c?c.nodeType==3?ld(c,0,o?0:1):c.nodeType==1?c:null:null;if(u)return by(vh(u,-1),!0)}return by(vh(n.nodeType==3?ld(n):n,-r),r>=0)}function by(t,e){if(t.width==0)return t;let r=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:r,right:r}}function UN(t,e){if(t.height==0)return t;let r=e?t.top:t.bottom;return{top:r,bottom:r,left:t.left,right:t.right}}function _z(t,e,r){let n=t.state,a=t.root.activeElement;n!=e&&t.updateState(e),a!=t.dom&&t.focus();try{return r()}finally{n!=e&&t.updateState(n),a!=t.dom&&a&&a.focus()}}function ICe(t,e,r){let n=e.selection,a=r=="up"?n.$from:n.$to;return _z(t,e,()=>{let{node:i}=t.docView.domFromPos(a.pos,r=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(i,!0);if(!l)break;if(l.node.isBlock){i=l.contentDOM||l.dom;break}i=l.dom.parentNode}let o=kz(t,a.pos,1);for(let l=i.firstChild;l;l=l.nextSibling){let c;if(l.nodeType==1)c=l.getClientRects();else if(l.nodeType==3)c=ld(l,0,l.nodeValue.length).getClientRects();else continue;for(let u=0;u<c.length;u++){let d=c[u];if(d.bottom>d.top+1&&(r=="up"?o.top-d.top>(d.bottom-o.top)*2:d.bottom-o.bottom>(o.bottom-d.top)*2))return!1}}return!0})}const OCe=/[\u0590-\u08ac]/;function zCe(t,e,r){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let a=n.parentOffset,i=!a,o=a==n.parent.content.size,l=t.domSelection();return l?!OCe.test(n.parent.textContent)||!l.modify?r=="left"||r=="backward"?i:o:_z(t,e,()=>{let{focusNode:c,focusOffset:u,anchorNode:d,anchorOffset:h}=t.domSelectionRange(),f=l.caretBidiLevel;l.modify("move",r,"character");let m=n.depth?t.docView.domAfterPos(n.before()):t.dom,{focusNode:g,focusOffset:y}=t.domSelectionRange(),b=g&&!m.contains(g.nodeType==1?g:g.parentNode)||c==g&&u==y;try{l.collapse(d,h),c&&(c!=d||u!=h)&&l.extend&&l.extend(c,u)}catch{}return f!=null&&(l.caretBidiLevel=f),b}):n.pos==n.start()||n.pos==n.end()}let mT=null,fT=null,pT=!1;function UCe(t,e,r){return mT==e&&fT==r?pT:(mT=e,fT=r,pT=r=="up"||r=="down"?ICe(t,e,r):zCe(t,e,r))}const Vl=0,gT=1,vf=2,Nu=3;class db{constructor(e,r,n,a){this.parent=e,this.children=r,this.dom=n,this.contentDOM=a,this.dirty=Vl,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,r,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let r=0;r<this.children.length;r++)e+=this.children[r].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let r=0,n=this.posAtStart;;r++){let a=this.children[r];if(a==e)return n;n+=a.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,r,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let i,o;if(e==this.contentDOM)i=e.childNodes[r-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((o=i.pmViewDesc)&&o.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(o)+o.size:this.posAtStart}else{let i,o;if(e==this.contentDOM)i=e.childNodes[r];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((o=i.pmViewDesc)&&o.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(o):this.posAtEnd}let a;if(e==this.dom&&this.contentDOM)a=r>gi(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))a=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(r==0)for(let i=e;;i=i.parentNode){if(i==this.dom){a=!1;break}if(i.previousSibling)break}if(a==null&&r==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){a=!0;break}if(i.nextSibling)break}}return a??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,r=!1){for(let n=!0,a=e;a;a=a.parentNode){let i=this.getDesc(a),o;if(i&&(!r||i.node))if(n&&(o=i.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))n=!1;else return i}}getDesc(e){let r=e.pmViewDesc;for(let n=r;n;n=n.parent)if(n==this)return r}posFromDOM(e,r,n){for(let a=e;a;a=a.parentNode){let i=this.getDesc(a);if(i)return i.localPosFromDOM(e,r,n)}return-1}descAt(e){for(let r=0,n=0;r<this.children.length;r++){let a=this.children[r],i=n+a.size;if(n==e&&i!=n){for(;!a.border&&a.children.length;)for(let o=0;o<a.children.length;o++){let l=a.children[o];if(l.size){a=l;break}}return a}if(e<i)return a.descAt(e-n-a.border);n=i}}domFromPos(e,r){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,a=0;for(let i=0;n<this.children.length;n++){let o=this.children[n],l=i+o.size;if(l>e||o instanceof Az){a=e-i;break}i=l}if(a)return this.children[n].domFromPos(a-this.children[n].border,r);for(let i;n&&!(i=this.children[n-1]).size&&i instanceof Ez&&i.side>=0;n--);if(r<=0){let i,o=!0;for(;i=n?this.children[n-1]:null,!(!i||i.dom.parentNode==this.contentDOM);n--,o=!1);return i&&r&&o&&!i.border&&!i.domAtom?i.domFromPos(i.size,r):{node:this.contentDOM,offset:i?gi(i.dom)+1:0}}else{let i,o=!0;for(;i=n<this.children.length?this.children[n]:null,!(!i||i.dom.parentNode==this.contentDOM);n++,o=!1);return i&&o&&!i.border&&!i.domAtom?i.domFromPos(0,r):{node:this.contentDOM,offset:i?gi(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,r,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:r,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let a=-1,i=-1;for(let o=n,l=0;;l++){let c=this.children[l],u=o+c.size;if(a==-1&&e<=u){let d=o+c.border;if(e>=d&&r<=u-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,r,d);e=o;for(let h=l;h>0;h--){let f=this.children[h-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){a=gi(f.dom)+1;break}e-=f.size}a==-1&&(a=0)}if(a>-1&&(u>r||l==this.children.length-1)){r=u;for(let d=l+1;d<this.children.length;d++){let h=this.children[d];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){i=gi(h.dom);break}r+=h.size}i==-1&&(i=this.contentDOM.childNodes.length);break}o=u}return{node:this.contentDOM,from:e,to:r,fromOffset:a,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let r=this.children[e<0?0:this.children.length-1];return r.size==0||r.emptyChildAt(e)}domAfterPos(e){let{node:r,offset:n}=this.domFromPos(e,0);if(r.nodeType!=1||n==r.childNodes.length)throw new RangeError("No node after pos "+e);return r.childNodes[n]}setSelection(e,r,n,a=!1){let i=Math.min(e,r),o=Math.max(e,r);for(let m=0,g=0;m<this.children.length;m++){let y=this.children[m],b=g+y.size;if(i>g&&o<b)return y.setSelection(e-g-y.border,r-g-y.border,n,a);g=b}let l=this.domFromPos(e,e?-1:1),c=r==e?l:this.domFromPos(r,r?-1:1),u=n.root.getSelection(),d=n.domSelectionRange(),h=!1;if((Gl||Hi)&&e==r){let{node:m,offset:g}=l;if(m.nodeType==3){if(h=!!(g&&m.nodeValue[g-1]==` 1204`),h&&g==m.nodeValue.length)for(let y=m,b;y;y=y.parentNode){if(b=y.nextSibling){b.nodeName=="BR"&&(l=c={node:b.parentNode,offset:gi(b)+1});break}let w=y.pmViewDesc;if(w&&w.node&&w.node.isBlock)break}}else{let y=m.childNodes[g-1];h=y&&(y.nodeName=="BR"||y.contentEditable=="false")}}if(Gl&&d.focusNode&&d.focusNode!=c.node&&d.focusNode.nodeType==1){let m=d.focusNode.childNodes[d.focusOffset];m&&m.contentEditable=="false"&&(a=!0)}if(!(a||h&&Hi)&&ap(l.node,l.offset,d.anchorNode,d.anchorOffset)&&ap(c.node,c.offset,d.focusNode,d.focusOffset))return;let f=!1;if((u.extend||e==r)&&!(h&&Gl)){u.collapse(l.node,l.offset);try{e!=r&&u.extend(c.node,c.offset),f=!0}catch{}}if(!f){if(e>r){let g=l;l=c,c=g}let m=document.createRange();m.setEnd(c.node,c.offset),m.setStart(l.node,l.offset),u.removeAllRanges(),u.addRange(m)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,r){for(let n=0,a=0;a<this.children.length;a++){let i=this.children[a],o=n+i.size;if(n==o?e<=o&&r>=n:e<o&&r>n){let l=n+i.border,c=o-i.border;if(e>=l&&r<=c){this.dirty=e==n||r==o?vf:gT,e==l&&r==c&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=Nu:i.markDirty(e-l,r-l);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?vf:Nu}n=o}this.dirty=vf}markParentsDirty(){let e=1;for(let r=this.parent;r;r=r.parent,e++){let n=e==1?vf:gT;r.dirty<n&&(r.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class Ez extends db{constructor(e,r,n,a){let i,o=r.type.toDOM;if(typeof o=="function"&&(o=o(n,()=>{if(!i)return a;
vendor: 4,672 bytes, line 1204
1204if(i.parent)return i.parent.posBeforeChild(i)})),!r.type.spec.raw){if(o.nodeType!=1){let l=document.createElement("span");l.appendChild(o),o=l}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=r,this.widget=r,i=this}matchesWidget(e){return this.dirty==Vl&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let r=this.widget.spec.stopEvent;return r?r(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class HCe extends db{constructor(e,r,n,a){super(e,[],r,null),this.textDOM=n,this.text=a}get size(){return this.text.length}localPosFromDOM(e,r){return e!=this.textDOM?this.posAtStart+(r?this.size:0):this.posAtStart+r}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class ip extends db{constructor(e,r,n,a,i){super(e,[],n,a),this.mark=r,this.spec=i}static create(e,r,n,a){let i=a.nodeViews[r.type.name],o=i&&i(r,a,n);return(!o||!o.dom)&&(o=jp.renderSpec(document,r.type.spec.toDOM(r,n),null,r.attrs)),new ip(e,r,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&Nu||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Nu&&this.mark.eq(e)}markDirty(e,r){if(super.markDirty(e,r),this.dirty!=Vl){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty<this.dirty&&(n.dirty=this.dirty),this.dirty=Vl}}slice(e,r,n){let a=ip.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;r<o&&(i=KS(i,r,o,n)),e>0&&(i=KS(i,0,e,n));for(let l=0;l<i.length;l++)i[l].parent=a;return a.children=i,a}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class em extends db{constructor(e,r,n,a,i,o,l,c,u){super(e,[],i,o),this.node=r,this.outerDeco=n,this.innerDeco=a,this.nodeDOM=l}static create(e,r,n,a,i,o){let l=i.nodeViews[r.type.name],c,u=l&&l(r,i,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},n,a),d=u&&u.dom,h=u&&u.contentDOM;if(r.isText){if(!d)d=document.createTextNode(r.text);else if(d.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else d||({dom:d,contentDOM:h}=jp.renderSpec(document,r.type.spec.toDOM(r),null,r.attrs));!h&&!r.isText&&d.nodeName!="BR"&&(d.hasAttribute("contenteditable")||(d.contentEditable="false"),r.type.spec.draggable&&(d.draggable=!0));let f=d;return d=Mz(d,n,r),u?c=new $Ce(e,r,n,a,d,h||null,f,u,i,o+1):r.isText?new gj(e,r,n,a,d,f,i):new em(e,r,n,a,d,h||null,f,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let r=this.children.length-1;r>=0;r--){let n=this.children[r];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>Nt.empty)}return e}matchesNode(e,r,n){return this.dirty==Vl&&e.eq(this.node)&&ew(r,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,r){let n=this.node.inlineContent,a=r,i=e.composing?this.localCompositionInfo(e,r):null,o=i&&i.pos>-1?i:null,l=i&&i.pos<0,c=new qCe(this,o&&o.node,e);KCe(this.node,this.innerDeco,(u,d,h)=>{u.spec.marks?c.syncToMarks(u.spec.marks,n,e,d):u.type.side>=0&&!h&&c.syncToMarks(d==this.node.childCount?ln.none:this.node.child(d).marks,n,e,d),c.placeWidget(u,e,a)},(u,d,h,f)=>{c.syncToMarks(u.marks,n,e,f);let m;c.findNodeMatch(u,d,h,f)||l&&e.state.selection.from>a&&e.state.selection.to<a+u.nodeSize&&(m=c.findIndexWithChild(i.node))>-1&&c.updateNodeAt(u,d,h,m,e)||c.updateNextNode(u,d,h,e,f,a)||c.addNode(u,d,h,e,a),a+=u.nodeSize}),c.syncToMarks([],n,e,0),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==vf)&&(o&&this.protectLocalComposition(e,o),Dz(this.contentDOM,this.children,e),px&&JCe(this.dom))}localCompositionInfo(e,r){let{from:n,to:a}=e.state.selection;if(!(e.state.selection instanceof Vr)||n<r||a>r+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let o=i.nodeValue,l=YCe(this.node.content,o,n-r,a-r);
vendor: 5,034 bytes, line 1204
1204return l<0?null:{node:i,pos:l,text:o}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:r,pos:n,text:a}){if(this.getDesc(r))return;let i=r;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new HCe(this,i,r,a);e.input.compositionNodes.push(o),this.children=KS(this.children,n,n+a.length,e,o)}update(e,r,n,a){return this.dirty==Nu||!e.sameMarkup(this.node)?!1:(this.updateInner(e,r,n,a),!0)}updateInner(e,r,n,a){this.updateOuterDeco(r),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(a,this.posAtStart),this.dirty=Vl}updateOuterDeco(e){if(ew(e,this.outerDeco))return;let r=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=Tz(this.dom,this.nodeDOM,VS(this.outerDeco,this.node,r),VS(e,this.node,r)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function xT(t,e,r,n,a){Mz(n,e,t);let i=new em(void 0,t,e,r,n,n,n,a,0);return i.contentDOM&&i.updateChildren(a,0),i}class gj extends em{constructor(e,r,n,a,i,o,l){super(e,r,n,a,i,null,o,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,r,n,a){return this.dirty==Nu||this.dirty!=Vl&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(r),(this.dirty!=Vl||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,a.trackWrites==this.nodeDOM&&(a.trackWrites=null)),this.node=e,this.dirty=Vl,!0)}inParent(){let e=this.parent.contentDOM;for(let r=this.nodeDOM;r;r=r.parentNode)if(r==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,r,n){return e==this.nodeDOM?this.posAtStart+Math.min(r,this.node.text.length):super.localPosFromDOM(e,r,n)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,r,n){let a=this.node.cut(e,r),i=document.createTextNode(a.text);return new gj(this.parent,a,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,r){super.markDirty(e,r),this.dom!=this.nodeDOM&&(e==0||r==this.nodeDOM.nodeValue.length)&&(this.dirty=Nu)}get domAtom(){return!1}isText(e){return this.node.text==e}}class Az extends db{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Vl&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class $Ce extends em{constructor(e,r,n,a,i,o,l,c,u,d){super(e,r,n,a,i,o,l,u,d),this.spec=c}update(e,r,n,a){if(this.dirty==Nu)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,r,n);return i&&this.updateInner(e,r,n,a),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,r,n,a)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,r,n,a){this.spec.setSelection?this.spec.setSelection(e,r,n.root):super.setSelection(e,r,n,a)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function Dz(t,e,r){let n=t.firstChild,a=!1;for(let i=0;i<e.length;i++){let o=e[i],l=o.dom;if(l.parentNode==t){for(;l!=n;)n=yT(n),a=!0;n=n.nextSibling}else a=!0,t.insertBefore(l,n);if(o instanceof ip){let c=n?n.previousSibling:t.lastChild;Dz(o.contentDOM,o.children,r),n=c?c.nextSibling:t.firstChild}}for(;n;)n=yT(n),a=!0;a&&r.trackWrites==t&&(r.trackWrites=null)}const Gy=function(t){t&&(this.nodeName=t)};Gy.prototype=Object.create(null);const wf=[new Gy];function VS(t,e,r){if(t.length==0)return wf;let n=r?wf[0]:new Gy,a=[n];for(let i=0;i<t.length;i++){let o=t[i].type.attrs;if(o){o.nodeName&&a.push(n=new Gy(o.nodeName));for(let l in o){let c=o[l];c!=null&&(r&&a.length==1&&a.push(n=new Gy(e.isInline?"span":"div")),l=="class"?n.class=(n.class?n.class+" ":"")+c:l=="style"?n.style=(n.style?n.style+";":"")+c:l!="nodeName"&&(n[l]=c))}}}return a}function Tz(t,e,r,n){if(r==wf&&n==wf)return e;let a=e;for(let i=0;i<n.length;i++){let o=n[i],l=r[i];if(i){let c;l&&l.nodeName==o.nodeName&&a!=t&&(c=a.parentNode)&&c.nodeName.toLowerCase()==o.nodeName||(c=document.createElement(o.nodeName),c.pmIsDeco=!0,c.appendChild(a),l=wf[0]),a=c}WCe(a,l||wf[0],o)}return a}function WCe(t,e,r){for(let n in e)n!="class"&&n!="style"&&n!="nodeName"&&!(n in r)&&t.removeAttribute(n);for(let n in r)n!="class"&&n!="style"&&n!="nodeName"&&r[n]!=e[n]&&t.setAttribute(n,r[n]);
vendor: 6,144 bytes, line 1204
1204if(e.class!=r.class){let n=e.class?e.class.split(" ").filter(Boolean):[],a=r.class?r.class.split(" ").filter(Boolean):[];for(let i=0;i<n.length;i++)a.indexOf(n[i])==-1&&t.classList.remove(n[i]);for(let i=0;i<a.length;i++)n.indexOf(a[i])==-1&&t.classList.add(a[i]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=r.style){if(e.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,a;for(;a=n.exec(e.style);)t.style.removeProperty(a[1])}r.style&&(t.style.cssText+=r.style)}}function Mz(t,e,r){return Tz(t,t,wf,VS(e,r,t.nodeType!=1))}function ew(t,e){if(t.length!=e.length)return!1;for(let r=0;r<t.length;r++)if(!t[r].type.eq(e[r].type))return!1;return!0}function yT(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class qCe{constructor(e,r,n){this.lock=r,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=GCe(e.node.content,e)}destroyBetween(e,r){if(e!=r){for(let n=e;n<r;n++)this.top.children[n].destroy();this.top.children.splice(e,r-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,r,n,a){let i=0,o=this.stack.length>>1,l=Math.min(o,e.length);for(;i<l&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=Vl,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let c=-1,u=this.top.children.length;a<this.preMatch.index&&(u=Math.min(this.index+3,u));for(let d=this.index;d<u;d++){let h=this.top.children[d];if(h.matchesMark(e[o])&&!this.isLocked(h.dom)){c=d;break}}if(c>-1)c>this.index&&(this.changed=!0,this.destroyBetween(this.index,c)),this.top=this.top.children[this.index];else{let d=ip.create(this.top,e[o],r,n);this.top.children.splice(this.index,0,d),this.top=d,this.changed=!0}this.index=0,o++}}findNodeMatch(e,r,n,a){let i=-1,o;if(a>=this.preMatch.index&&(o=this.preMatch.matches[a-this.preMatch.index]).parent==this.top&&o.matchesNode(e,r,n))i=this.top.children.indexOf(o,this.index);else for(let l=this.index,c=Math.min(this.top.children.length,l+5);l<c;l++){let u=this.top.children[l];if(u.matchesNode(e,r,n)&&!this.preMatch.matched.has(u)){i=l;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,r,n,a,i){let o=this.top.children[a];return o.dirty==Nu&&o.dom==o.contentDOM&&(o.dirty=vf),o.update(e,r,n,i)?(this.destroyBetween(this.index,a),this.index++,!0):!1}findIndexWithChild(e){for(;;){let r=e.parentNode;if(!r)return-1;if(r==this.top.contentDOM){let n=e.pmViewDesc;if(n){for(let a=this.index;a<this.top.children.length;a++)if(this.top.children[a]==n)return a}return-1}e=r}}updateNextNode(e,r,n,a,i,o){for(let l=this.index;l<this.top.children.length;l++){let c=this.top.children[l];if(c instanceof em){let u=this.preMatch.matched.get(c);if(u!=null&&u!=i)return!1;let d=c.dom,h,f=this.isLocked(d)&&!(e.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==e.text&&c.dirty!=Nu&&ew(r,c.outerDeco));if(!f&&c.update(e,r,n,a))return this.destroyBetween(this.index,l),c.dom!=d&&(this.changed=!0),this.index++,!0;if(!f&&(h=this.recreateWrapper(c,e,r,n,a,o)))return this.destroyBetween(this.index,l),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=vf,h.updateChildren(a,o+1),h.dirty=Vl),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,r,n,a,i,o){if(e.dirty||r.isAtom||!e.children.length||!e.node.content.eq(r.content)||!ew(n,e.outerDeco)||!a.eq(e.innerDeco))return null;let l=em.create(this.top,r,n,a,i,o);if(l.contentDOM){l.children=e.children,e.children=[];for(let c of l.children)c.parent=l}return e.destroy(),l}addNode(e,r,n,a,i){let o=em.create(this.top,e,r,n,a,i);o.contentDOM&&o.updateChildren(a,i+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,r,n){let a=this.index<this.top.children.length?this.top.children[this.index]:null;if(a&&a.matchesWidget(e)&&(e==a.widget||!a.widget.type.toDOM.parentNode))this.index++;else{let i=new Ez(this.top,e,r,n);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],r=this.top;for(;e instanceof ip;)r=e,e=r.children[r.children.length-1];(!e||!(e instanceof gj)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Hi||bi)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",r),this.addHackNode("BR",this.top))}addHackNode(e,r){if(r==this.top&&this.index<r.children.length&&r.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e=="IMG"&&(n.className="ProseMirror-separator",n.alt=""),e=="BR"&&(n.className="ProseMirror-trailingBreak");let a=new Az(this.top,[],n,null);r!=this.top?r.children.push(a):r.children.splice(this.index++,0,a),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function GCe(t,e){let r=e,n=r.children.length,a=t.childCount,i=new Map,o=[];e:for(;a>0;){let l;for(;;)if(n){let u=r.children[n-1];if(u instanceof ip)r=u,n=u.children.length;else{l=u,n--;break}}else{if(r==e)break e;n=r.parent.children.indexOf(r),r=r.parent}let c=l.node;if(c){if(c!=t.child(a-1))break;--a,i.set(l,a),o.push(l)}}return{index:a,matched:i,matches:o.reverse()}}function VCe(t,e){return t.type.side-e.type.side}function KCe(t,e,r,n){let a=e.locals(t),i=0;if(a.length==0){for(let u=0;u<t.childCount;u++){let d=t.child(u);n(d,a,e.forChild(i,d),u),i+=d.nodeSize}return}let o=0,l=[],c=null;for(let u=0;;){let d,h;for(;o<a.length&&a[o].to==i;){let b=a[o++];b.widget&&(d?(h||(h=[d])).push(b):d=b)}if(d)if(h){h.sort(VCe);for(let b=0;b<h.length;b++)r(h[b],u,!!c)}else r(d,u,!!c);let f,m;if(c)m=-1,f=c,c=null;else if(u<t.childCount)m=u,f=t.child(u++);else break;for(let b=0;b<l.length;b++)l[b].to<=i&&l.splice(b--,1);for(;o<a.length&&a[o].from<=i&&a[o].to>i;)l.push(a[o++]);let g=i+f.nodeSize;if(f.isText){let b=g;o<a.length&&a[o].from<b&&(b=a[o].from);for(let w=0;w<l.length;w++)l[w].to<b&&(b=l[w].to);b<g&&(c=f.cut(b-i),f=f.cut(0,b-i),g=b,m=-1)}else for(;o<a.length&&a[o].to<g;)o++;let y=f.isInline&&!f.isLeaf?l.filter(b=>
vendor: 9,620 bytes, line 1204
1204!b.inline):l.slice();n(f,y,e.forChild(i,f),m),i=g}}function JCe(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function YCe(t,e,r,n){for(let a=0,i=0;a<t.childCount&&i<=n;){let o=t.child(a++),l=i;if(i+=o.nodeSize,!o.isText)continue;let c=o.text;for(;a<t.childCount;){let u=t.child(a++);if(i+=u.nodeSize,!u.isText)break;c+=u.text}if(i>=r){if(i>=n&&c.slice(n-e.length-l,n-l)==e)return n-e.length;let u=l<n?c.lastIndexOf(e,n-l-1):-1;if(u>=0&&u+e.length+l>=r)return l+u;if(r==n&&c.length>=n+e.length-l&&c.slice(n-l,n-l+e.length)==e)return n}}return-1}function KS(t,e,r,n,a){let i=[];for(let o=0,l=0;o<t.length;o++){let c=t[o],u=l,d=l+=c.size;u>=r||d<=e?i.push(c):(u<e&&i.push(c.slice(0,e-u,n)),a&&(i.push(a),a=void 0),d>r&&i.push(c.slice(r-u,c.size,n)))}return i}function S_(t,e=null){let r=t.domSelectionRange(),n=t.state.doc;if(!r.focusNode)return null;let a=t.docView.nearestDesc(r.focusNode),i=a&&a.size==0,o=t.docView.posFromDOM(r.focusNode,r.focusOffset,1);if(o<0)return null;let l=n.resolve(o),c,u;if(pj(r)){for(c=o;a&&!a.node;)a=a.parent;let h=a.node;if(a&&h.isAtom&&_r.isSelectable(h)&&a.parent&&!(h.isInline&&NCe(r.focusNode,r.focusOffset,a.dom))){let f=a.posBefore;u=new _r(o==f?l:n.resolve(f))}}else{if(r instanceof t.dom.ownerDocument.defaultView.Selection&&r.rangeCount>1){let h=o,f=o;for(let m=0;m<r.rangeCount;m++){let g=r.getRangeAt(m);h=Math.min(h,t.docView.posFromDOM(g.startContainer,g.startOffset,1)),f=Math.max(f,t.docView.posFromDOM(g.endContainer,g.endOffset,-1))}if(h<0)return null;[c,o]=f==t.state.selection.anchor?[f,h]:[h,f],l=n.resolve(o)}else c=t.docView.posFromDOM(r.anchorNode,r.anchorOffset,1);if(c<0)return null}let d=n.resolve(c);if(!u){let h=e=="pointer"||t.state.selection.head<l.pos&&!i?1:-1;u=C_(t,d,l,h)}return u}function Pz(t){return t.editable?t.hasFocus():Bz(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function vd(t,e=!1){let r=t.state.selection;if(Rz(t,r),!!Pz(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&bi){let n=t.domSelectionRange(),a=t.domObserver.currentSelection;if(n.anchorNode&&a.anchorNode&&ap(n.anchorNode,n.anchorOffset,a.anchorNode,a.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)XCe(t);else{let{anchor:n,head:a}=r,i,o;bT&&!(r instanceof Vr)&&(r.$from.parent.inlineContent||(i=vT(t,r.from)),!r.empty&&!r.$from.parent.inlineContent&&(o=vT(t,r.to))),t.docView.setSelection(n,a,t,e),bT&&(i&&wT(i),o&&wT(o)),r.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&ZCe(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const bT=Hi||bi&&wz<63;function vT(t,e){let{node:r,offset:n}=t.docView.domFromPos(e,0),a=n<r.childNodes.length?r.childNodes[n]:null,i=n?r.childNodes[n-1]:null;if(Hi&&a&&a.contentEditable=="false")return HN(a);if((!a||a.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(a)return HN(a);if(i)return HN(i)}}function HN(t){return t.contentEditable="true",Hi&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function wT(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function ZCe(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let r=t.domSelectionRange(),n=r.anchorNode,a=r.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>{(r.anchorNode!=n||r.anchorOffset!=a)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!Pz(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function XCe(t){let e=t.domSelection();if(!e)return;let r=t.cursorWrapper.dom,n=r.nodeName=="IMG";n?e.collapse(r.parentNode,gi(r)+1):e.collapse(r,0),!n&&!t.state.selection.visible&&Bo&&Qh<=11&&(r.disabled=!0,r.disabled=!1)}function Rz(t,e){if(e instanceof _r){let r=t.docView.descAt(e.from);r!=t.lastSelectedViewDesc&&(jT(t),r&&r.selectNode(),t.lastSelectedViewDesc=r)}else jT(t)}function jT(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function C_(t,e,r,n){return t.someProp("createSelectionBetween",a=>a(t,e,r))||Vr.between(e,r,n)}function NT(t){return t.editable&&!t.hasFocus()?!1:Bz(t)}function Bz(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function QCe(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),r=t.domSelectionRange();return ap(e.node,e.offset,r.anchorNode,r.anchorOffset)}function JS(t,e){let{$anchor:r,$head:n}=t.selection,a=e>0?r.max(n):r.min(n),i=a.parent.inlineContent?a.depth?t.doc.resolve(e>0?a.after():a.before()):null:a;return i&&ms.findFrom(i,e)}function Nh(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function FT(t,e,r){let n=t.state.selection;if(n instanceof Vr)if(r.indexOf("s")>-1){let{$head:a}=n,i=a.textOffset?null:e<0?a.nodeBefore:a.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=t.state.doc.resolve(a.pos+i.nodeSize*(e<0?-1:1));return Nh(t,new Vr(n.$anchor,o))}else if(n.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let a=JS(t.state,e);return a&&a instanceof _r?Nh(t,a):!1}else if(!(Bl&&r.indexOf("m")>-1)){let a=n.$head,i=a.textOffset?null:e<0?a.nodeBefore:a.nodeAfter,o;if(!i||i.isText)return!1;let l=e<0?a.pos-i.nodeSize:a.pos;return i.isAtom||(o=t.docView.descAt(l))&&!o.contentDOM?_r.isSelectable(i)?Nh(t,new _r(e<0?t.state.doc.resolve(a.pos-i.nodeSize):a)):ub?Nh(t,new Vr(t.state.doc.resolve(e<0?l:l+i.nodeSize))):!1:!1}}else return!1;else{if(n instanceof _r&&n.node.isInline)return Nh(t,new Vr(e>0?n.$to:n.$from));{let a=JS(t.state,e);return a?Nh(t,a):!1}}}function tw(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Vy(t,e){let r=t.pmViewDesc;return r&&r.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function og(t,e){return e<0?eke(t):tke(t)}function eke(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let a,i,o=!1;for(Gl&&r.nodeType==1&&n<tw(r)&&Vy(r.childNodes[n],-1)&&(o=!0);;)if(n>0){if(r.nodeType!=1)break;{let l=r.childNodes[n-1];if(Vy(l,-1))a=r,i=--n;else if(l.nodeType==3)r=l,n=r.nodeValue.length;else break}}else{if(Lz(r))break;{let l=r.previousSibling;for(;l&&Vy(l,-1);)a=r.parentNode,i=gi(l),l=l.previousSibling;if(l)r=l,n=tw(r);else{if(r=r.parentNode,r==t.dom)break;n=0}}}o?YS(t,r,n):a&&YS(t,a,i)}function tke(t){let e=t.domSelectionRange(),r=e.focusNode,n=e.focusOffset;if(!r)return;let a=tw(r),i,o;for(;;)if(n<a){if(r.nodeType!=1)break;let l=r.childNodes[n];if(Vy(l,1))i=r,o=++n;else break}else{if(Lz(r))break;{let l=r.nextSibling;for(;l&&Vy(l,1);)i=l.parentNode,o=gi(l)+1,l=l.nextSibling;if(l)r=l,n=0,a=tw(r);else{if(r=r.parentNode,r==t.dom)break;n=a=0}}}i&&YS(t,i,o)}function Lz(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function rke(t,e){for(;t&&e==t.childNodes.length&&!cb(t);)e=gi(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let r=t.childNodes[e];if(r.nodeType==3)return r;if(r.nodeType==1&&r.contentEditable=="false")break;t=r,e=0}}function ske(t,e){for(;t&&!e&&!cb(t);)e=gi(t),t=t.parentNode;for(;t&&e;){let r=t.childNodes[e-1];if(r.nodeType==3)return r;if(r.nodeType==1&&r.contentEditable=="false")break;t=r,e=t.childNodes.length}}function YS(t,e,r){if(e.nodeType!=3){let i,o;(o=rke(e,r))?(e=o,r=0):(i=ske(e,r))&&(e=i,r=i.nodeValue.length)}let n=t.domSelection();if(!n)return;if(pj(n)){let i=document.createRange();i.setEnd(e,r),i.setStart(e,r),n.removeAllRanges(),n.addRange(i)}else n.extend&&n.extend(e,r);t.domObserver.setCurSelection();let{state:a}=t;setTimeout(()=>{t.state==a&&vd(t)},50)}function ST(t,e){let r=t.state.doc.resolve(e);if(!(bi||jz)&&r.parent.inlineContent){let a=t.coordsAtPos(e);if(e>r.start()){let i=t.coordsAtPos(e-1),o=(i.top+i.bottom)/2;if(o>a.top&&o<a.bottom&&Math.abs(i.left-a.left)>1)return i.left<a.left?"ltr":"rtl"}if(e<r.end()){let i=t.coordsAtPos(e+1),o=(i.top+i.bottom)/2;if(o>a.top&&o<a.bottom&&Math.abs(i.left-a.left)>1)return i.left>a.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function CT(t,e,r){let n=t.state.selection;if(n instanceof Vr&&!n.empty||r.indexOf("s")>-1||Bl&&r.indexOf("m")>-1)return!1;let{$from:a,$to:i}=n;if(!a.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=JS(t.state,e);if(o&&o instanceof _r)return Nh(t,o)}if(!a.parent.inlineContent){let o=e<0?a:i,l=n instanceof pl?ms.near(o,e):ms.findFrom(o,e);return l?Nh(t,l):!1}return!1}function kT(t,e){if(!(t.state.selection instanceof Vr))return!0;let{$head:r,$anchor:n,empty:a}=t.state.selection;if(!r.sameParent(n))return!0;if(!a)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!r.textOffset&&(e<0?r.nodeBefore:r.nodeAfter);if(i&&!i.isText){let o=t.state.tr;return e<0?o.delete(r.pos-i.nodeSize,r.pos):o.delete(r.pos,r.pos+i.nodeSize),t.dispatch(o),!0}return!1}function _T(t,e,r){t.domObserver.stop(),e.contentEditable=r,t.domObserver.start()}function nke(t){if(!Hi||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:r}=t.domSelectionRange();if(e&&e.nodeType==1&&r==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;_T(t,n,"true"),setTimeout(()=>_T(t,n,"false"),20)}return!1}function ake(t){let e="";
vendor: 4,166 bytes, lines 1204-1207
1204return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function ike(t,e){let r=e.keyCode,n=ake(e);if(r==8||Bl&&r==72&&n=="c")return kT(t,-1)||og(t,-1);if(r==46&&!e.shiftKey||Bl&&r==68&&n=="c")return kT(t,1)||og(t,1);if(r==13||r==27)return!0;if(r==37||Bl&&r==66&&n=="c"){let a=r==37?ST(t,t.state.selection.from)=="ltr"?-1:1:-1;return FT(t,a,n)||og(t,a)}else if(r==39||Bl&&r==70&&n=="c"){let a=r==39?ST(t,t.state.selection.from)=="ltr"?1:-1:1;return FT(t,a,n)||og(t,a)}else{if(r==38||Bl&&r==80&&n=="c")return CT(t,-1,n)||og(t,-1);if(r==40||Bl&&r==78&&n=="c")return nke(t)||CT(t,1,n)||og(t,1);if(n==(Bl?"m":"c")&&(r==66||r==73||r==89||r==90))return!0}return!1}function k_(t,e){t.someProp("transformCopied",m=>{e=m(e,t)});let r=[],{content:n,openStart:a,openEnd:i}=e;for(;a>1&&i>1&&n.childCount==1&&n.firstChild.childCount==1;){a--,i--;let m=n.firstChild;r.push(m.type.name,m.attrs!=m.type.defaultAttrs?m.attrs:null),n=m.content}let o=t.someProp("clipboardSerializer")||jp.fromSchema(t.state.schema),l=$z(),c=l.createElement("div");c.appendChild(o.serializeFragment(n,{document:l}));let u=c.firstChild,d,h=0;for(;u&&u.nodeType==1&&(d=Hz[u.nodeName.toLowerCase()]);){for(let m=d.length-1;m>=0;m--){let g=l.createElement(d[m]);for(;c.firstChild;)g.appendChild(c.firstChild);c.appendChild(g),h++}u=c.firstChild}u&&u.nodeType==1&&u.setAttribute("data-pm-slice",`${a} ${i}${h?` -${h}`:""} ${JSON.stringify(r)}`);let f=t.someProp("clipboardTextSerializer",m=>m(e,t))||e.content.textBetween(0,e.content.size,` 1205 1206`);return{dom:c,text:f,slice:e}}function Iz(t,e,r,n,a){let i=a.parent.type.spec.code,o,l;if(!r&&!e)return null;let c=!!e&&(n||i||!r);if(c){if(t.someProp("transformPastedText",f=>{e=f(e,i||n,t)}),i)return l=new ar(Nt.from(t.state.schema.text(e.replace(/\r\n?/g,` 1207`))),0,0),t.someProp("transformPasted",f=>{l=f(l,t,!0)}),l;let h=t.someProp("clipboardTextParser",f=>f(e,a,n,t));if(h)l=h;else{let f=a.marks(),{schema:m}=t.state,g=jp.fromSchema(m);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(y=>{let b=o.appendChild(document.createElement("p"));y&&b.appendChild(g.serializeNode(m.text(y,f)))})}}else t.someProp("transformPastedHTML",h=>{r=h(r,t)}),o=uke(r),ub&&dke(o);let u=o&&o.querySelector("[data-pm-slice]"),d=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(d&&d[3])for(let h=+d[3];h>0;h--){let f=o.firstChild;for(;f&&f.nodeType!=1;)f=f.nextSibling;if(!f)break;o=f}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||Xh.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||d),context:a,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!oke.test(f.parentNode.nodeName)?{ignore:!0}:null}})),d)l=hke(ET(l,+d[1],+d[2]),d[4]);else if(l=ar.maxOpen(lke(l.content,a),!0),l.openStart||l.openEnd){let h=0,f=0;for(let m=l.content.firstChild;h<l.openStart&&!m.type.spec.isolating;h++,m=m.firstChild);for(let m=l.content.lastChild;f<l.openEnd&&!m.type.spec.isolating;f++,m=m.lastChild);l=ET(l,h,f)}return t.someProp("transformPasted",h=>{l=h(l,t,c)}),l}const oke=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function lke(t,e){if(t.childCount<2)return t;for(let r=e.depth;r>=0;r--){let a=e.node(r).contentMatchAt(e.index(r)),i,o=[];if(t.forEach(l=>{if(!o)return;let c=a.findWrapping(l.type),u;if(!c)return o=null;if(u=o.length&&i.length&&zz(c,i,l,o[o.length-1],0))o[o.length-1]=u;else{o.length&&(o[o.length-1]=Uz(o[o.length-1],i.length));let d=Oz(l,c);o.push(d),a=a.matchType(d.type),i=c}}),o)return Nt.from(o)}return t}function Oz(t,e,r=0){for(let n=e.length-1;n>=r;n--)t=e[n].create(null,Nt.from(t));return t}function zz(t,e,r,n,a){if(a<t.length&&a<e.length&&t[a]==e[a]){let i=zz(t,e,r,n.lastChild,a+1);if(i)return n.copy(n.content.replaceChild(n.childCount-1,i));if(n.contentMatchAt(n.childCount).matchType(a==t.length-1?r.type:t[a+1]))return n.copy(n.content.append(Nt.from(Oz(r,t,a+1))))}}function Uz(t,e){if(e==0)return t;let r=t.content.replaceChild(t.childCount-1,Uz(t.lastChild,e-1)),n=t.contentMatchAt(t.childCount).fillBefore(Nt.empty,!0);return t.copy(r.append(n))}
vendor: 5,007 bytes, line 1207
1207function ZS(t,e,r,n,a,i){let o=e<0?t.firstChild:t.lastChild,l=o.content;return t.childCount>1&&(i=0),a<n-1&&(l=ZS(l,e,r,n,a+1,i)),a>=r&&(l=e<0?o.contentMatchAt(0).fillBefore(l,i<=a).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(Nt.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(l))}function ET(t,e,r){return e<t.openStart&&(t=new ar(ZS(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),r<t.openEnd&&(t=new ar(ZS(t.content,1,r,t.openEnd,0,0),t.openStart,r)),t}const Hz={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let AT=null;function $z(){return AT||(AT=document.implementation.createHTMLDocument("title"))}let $N=null;function cke(t){let e=window.trustedTypes;return e?($N||($N=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:r=>r})),$N.createHTML(t)):t}function uke(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let r=$z().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(t),a;if((a=n&&Hz[n[1].toLowerCase()])&&(t=a.map(i=>"<"+i+">").join("")+t+a.map(i=>"</"+i+">").reverse().join("")),r.innerHTML=cke(t),a)for(let i=0;i<a.length;i++)r=r.querySelector(a[i])||r;return r}function dke(t){let e=t.querySelectorAll(bi?"span:not([class]):not([style])":"span.Apple-converted-space");for(let r=0;r<e.length;r++){let n=e[r];n.childNodes.length==1&&n.textContent=="Â "&&n.parentNode&&n.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),n)}}function hke(t,e){if(!t.size)return t;let r=t.content.firstChild.type.schema,n;try{n=JSON.parse(e)}catch{return t}let{content:a,openStart:i,openEnd:o}=t;for(let l=n.length-2;l>=0;l-=2){let c=r.nodes[n[l]];if(!c||c.hasRequiredAttrs())break;a=Nt.from(c.create(n[l+1],a)),i++,o++}return new ar(a,i,o)}const uo={},ho={},mke={touchstart:!0,touchmove:!0};class fke{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function pke(t){for(let e in uo){let r=uo[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=n=>{xke(t,n)&&!__(t,n)&&(t.editable||!(n.type in ho))&&r(t,n)},mke[e]?{passive:!0}:void 0)}Hi&&t.dom.addEventListener("input",()=>null),XS(t)}function qh(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function gke(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function XS(t){t.someProp("handleDOMEvents",e=>{for(let r in e)t.input.eventHandlers[r]||t.dom.addEventListener(r,t.input.eventHandlers[r]=n=>__(t,n))})}function __(t,e){return t.someProp("handleDOMEvents",r=>{let n=r[e.type];return n?n(t,e)||e.defaultPrevented:!1})}function xke(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let r=e.target;r!=t.dom;r=r.parentNode)if(!r||r.nodeType==11||r.pmViewDesc&&r.pmViewDesc.stopEvent(e))return!1;return!0}function yke(t,e){!__(t,e)&&uo[e.type]&&(t.editable||!(e.type in ho))&&uo[e.type](t,e)}ho.keydown=(t,e)=>{let r=e;if(t.input.shiftKey=r.keyCode==16||r.shiftKey,!qz(t,r)&&(t.input.lastKeyCode=r.keyCode,t.input.lastKeyCodeTime=Date.now(),!(xd&&bi&&r.keyCode==13)))if(r.keyCode!=229&&t.domObserver.forceFlush(),px&&r.keyCode==13&&!r.ctrlKey&&!r.altKey&&!r.metaKey){let n=Date.now();t.input.lastIOSEnter=n,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==n&&(t.someProp("handleKeyDown",a=>a(t,gf(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",n=>n(t,r))||ike(t,r)?r.preventDefault():qh(t,"key")};ho.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};ho.keypress=(t,e)=>{let r=e;if(qz(t,r)||!r.charCode||r.ctrlKey&&!r.altKey||Bl&&r.metaKey)return;if(t.someProp("handleKeyPress",a=>a(t,r))){r.preventDefault();return}let n=t.state.selection;if(!(n instanceof Vr)||!n.$from.sameParent(n.$to)){let a=String.fromCharCode(r.charCode),i=()=>t.state.tr.insertText(a).scrollIntoView();!/[\r\n]/.test(a)&&!t.someProp("handleTextInput",o=>o(t,n.$from.pos,n.$to.pos,a,i))&&t.dispatch(i()),r.preventDefault()}};function xj(t){return{left:t.clientX,top:t.clientY}}function bke(t,e){let r=e.x-t.clientX,n=e.y-t.clientY;return r*r+n*n<100}function E_(t,e,r,n,a){if(n==-1)return!1;let i=t.state.doc.resolve(n);for(let o=i.depth+1;o>0;o--)if(t.someProp(e,l=>o>i.depth?l(t,r,i.nodeAfter,i.before(o),a,!0):l(t,r,i.node(o),i.before(o),a,!1)))return!0;return!1}
vendor: 5,741 bytes, line 1207
1207function Pg(t,e,r){if(t.focused||t.focus(),t.state.selection.eq(e))return;let n=t.state.tr.setSelection(e);n.setMeta("pointer",!0),t.dispatch(n)}function vke(t,e){if(e==-1)return!1;let r=t.state.doc.resolve(e),n=r.nodeAfter;return n&&n.isAtom&&_r.isSelectable(n)?(Pg(t,new _r(r)),!0):!1}function wke(t,e){if(e==-1)return!1;let r=t.state.selection,n,a;r instanceof _r&&(n=r.node);let i=t.state.doc.resolve(e);for(let o=i.depth+1;o>0;o--){let l=o>i.depth?i.nodeAfter:i.node(o);if(_r.isSelectable(l)){n&&r.$from.depth>0&&o>=r.$from.depth&&i.before(r.$from.depth+1)==r.$from.pos?a=i.before(r.$from.depth):a=i.before(o);break}}return a!=null?(Pg(t,_r.create(t.state.doc,a)),!0):!1}function jke(t,e,r,n,a){return E_(t,"handleClickOn",e,r,n)||t.someProp("handleClick",i=>i(t,e,n))||(a?wke(t,r):vke(t,r))}function Nke(t,e,r,n){return E_(t,"handleDoubleClickOn",e,r,n)||t.someProp("handleDoubleClick",a=>a(t,e,n))}function Fke(t,e,r,n){return E_(t,"handleTripleClickOn",e,r,n)||t.someProp("handleTripleClick",a=>a(t,e,n))||Ske(t,r,n)}function Ske(t,e,r){if(r.button!=0)return!1;let n=t.state.doc;if(e==-1)return n.inlineContent?(Pg(t,Vr.create(n,0,n.content.size)),!0):!1;let a=n.resolve(e);for(let i=a.depth+1;i>0;i--){let o=i>a.depth?a.nodeAfter:a.node(i),l=a.before(i);if(o.inlineContent)Pg(t,Vr.create(n,l+1,l+1+o.content.size));else if(_r.isSelectable(o))Pg(t,_r.create(n,l));else continue;return!0}}function A_(t){return rw(t)}const Wz=Bl?"metaKey":"ctrlKey";uo.mousedown=(t,e)=>{let r=e;t.input.shiftKey=r.shiftKey;let n=A_(t),a=Date.now(),i="singleClick";a-t.input.lastClick.time<500&&bke(r,t.input.lastClick)&&!r[Wz]&&t.input.lastClick.button==r.button&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.lastClick={time:a,x:r.clientX,y:r.clientY,type:i,button:r.button};let o=t.posAtCoords(xj(r));o&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new Cke(t,o,r,!!n)):(i=="doubleClick"?Nke:Fke)(t,o.pos,o.inside,r)?r.preventDefault():qh(t,"pointer"))};class Cke{constructor(e,r,n,a){this.view=e,this.pos=r,this.event=n,this.flushed=a,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[Wz],this.allowDefault=n.shiftKey;let i,o;if(r.inside>-1)i=e.state.doc.nodeAt(r.inside),o=r.inside;else{let d=e.state.doc.resolve(r.pos);i=d.parent,o=d.depth?d.before():0}const l=a?null:n.target,c=l?e.docView.nearestDesc(l,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:u}=e.state;(n.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||u instanceof _r&&u.from<=o&&u.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Gl&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),qh(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>vd(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let r=this.pos;this.view.state.doc!=this.startDoc&&(r=this.view.posAtCoords(xj(e))),this.updateAllowDefault(e),this.allowDefault||!r?qh(this.view,"pointer"):jke(this.view,r.pos,r.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Hi&&this.mightDrag&&!this.mightDrag.node.isAtom||bi&&!this.view.state.selection.visible&&Math.min(Math.abs(r.pos-this.view.state.selection.from),Math.abs(r.pos-this.view.state.selection.to))<=2)?(Pg(this.view,ms.near(this.view.state.doc.resolve(r.pos))),e.preventDefault()):qh(this.view,"pointer")}move(e){this.updateAllowDefault(e),qh(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}uo.touchstart=t=>{t.input.lastTouch=Date.now(),A_(t),qh(t,"pointer")};uo.touchmove=t=>{t.input.lastTouch=Date.now(),qh(t,"pointer")};uo.contextmenu=t=>A_(t);function qz(t,e){return t.composing?!0:Hi&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const kke=xd?5e3:-1;ho.compositionstart=ho.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,r=e.selection.$to;if(e.selection instanceof Vr&&(e.storedMarks||!r.textOffset&&r.parentOffset&&r.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)||bi&&jz&&_ke(t)))t.markCursor=t.state.storedMarks||r.marks(),rw(t,!0),t.markCursor=null;else if(rw(t,!e.selection.empty),Gl&&e.selection.empty&&r.parentOffset&&!r.textOffset&&r.nodeBefore.marks.length){let n=t.domSelectionRange();for(let a=n.focusNode,i=n.focusOffset;a&&a.nodeType==1&&i!=0;){let o=i<0?a.lastChild:a.childNodes[i-1];if(!o)break;if(o.nodeType==3){let l=t.domSelection();l&&l.collapse(o,o.nodeValue.length);break}else a=o,i=-1}}t.input.composing=!0}Gz(t,kke)};function _ke(t){let{focusNode:e,focusOffset:r}=t.domSelectionRange();if(!e||e.nodeType!=1||r>=e.childNodes.length)return!1;let n=e.childNodes[r];
vendor: 4,182 bytes, line 1207
1207return n.nodeType==1&&n.contentEditable=="false"}ho.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,Gz(t,20))};function Gz(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>rw(t),e))}function Vz(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=Ake());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function Eke(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let r=wCe(e.focusNode,e.focusOffset),n=jCe(e.focusNode,e.focusOffset);if(r&&n&&r!=n){let a=n.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(r==i||n==i)return i;if(!a||!a.isText(n.nodeValue))return n;if(t.input.compositionNode==n){let o=r.pmViewDesc;if(!(!o||!o.isText(r.nodeValue)))return n}}return r||n}function Ake(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function rw(t,e=!1){if(!(xd&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),Vz(t),e||t.docView&&t.docView.dirty){let r=S_(t),n=t.state.selection;return r&&!r.eq(n)?t.dispatch(t.state.tr.setSelection(r)):(t.markCursor||e)&&!n.$from.node(n.$from.sharedDepth(n.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function Dke(t,e){if(!t.dom.parentNode)return;let r=t.dom.parentNode.appendChild(document.createElement("div"));r.appendChild(e),r.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),a=document.createRange();a.selectNodeContents(e),t.dom.blur(),n.removeAllRanges(),n.addRange(a),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),t.focus()},50)}const S0=Bo&&Qh<15||px&&CCe<604;uo.copy=ho.cut=(t,e)=>{let r=e,n=t.state.selection,a=r.type=="cut";if(n.empty)return;let i=S0?null:r.clipboardData,o=n.content(),{dom:l,text:c}=k_(t,o);i?(r.preventDefault(),i.clearData(),i.setData("text/html",l.innerHTML),i.setData("text/plain",c)):Dke(t,l),a&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Tke(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function Mke(t,e){if(!t.dom.parentNode)return;let r=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,n=t.dom.parentNode.appendChild(document.createElement(r?"textarea":"div"));r||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let a=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),n.parentNode&&n.parentNode.removeChild(n),r?C0(t,n.value,null,a,e):C0(t,n.textContent,n.innerHTML,a,e)},50)}function C0(t,e,r,n,a){let i=Iz(t,e,r,n,t.state.selection.$from);if(t.someProp("handlePaste",c=>c(t,a,i||ar.empty)))return!0;if(!i)return!1;let o=Tke(i),l=o?t.state.tr.replaceSelectionWith(o,n):t.state.tr.replaceSelection(i);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function Kz(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let r=t.getData("text/uri-list");return r?r.replace(/\r?\n/g," "):""}ho.paste=(t,e)=>{let r=e;if(t.composing&&!xd)return;let n=S0?null:r.clipboardData,a=t.input.shiftKey&&t.input.lastKeyCode!=45;n&&C0(t,Kz(n),n.getData("text/html"),a,r)?r.preventDefault():Mke(t,r)};class Jz{constructor(e,r,n){this.slice=e,this.move=r,this.node=n}}const Pke=Bl?"altKey":"ctrlKey";function Yz(t,e){let r=t.someProp("dragCopies",n=>!n(e));return r??!e[Pke]}uo.dragstart=(t,e)=>{let r=e,n=t.input.mouseDown;if(n&&n.done(),!r.dataTransfer)return;let a=t.state.selection,i=a.empty?null:t.posAtCoords(xj(r)),o;if(!(i&&i.pos>=a.from&&i.pos<=(a instanceof _r?a.to-1:a.to))){if(n&&n.mightDrag)o=_r.create(t.state.doc,n.mightDrag.pos);else if(r.target&&r.target.nodeType==1){let h=t.docView.nearestDesc(r.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(o=_r.create(t.state.doc,h.posBefore))}}
vendor: 8,784 bytes, line 1207
1207let l=(o||t.state.selection).content(),{dom:c,text:u,slice:d}=k_(t,l);(!r.dataTransfer.files.length||!bi||wz>120)&&r.dataTransfer.clearData(),r.dataTransfer.setData(S0?"Text":"text/html",c.innerHTML),r.dataTransfer.effectAllowed="copyMove",S0||r.dataTransfer.setData("text/plain",u),t.dragging=new Jz(d,Yz(t,r),o)};uo.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};ho.dragover=ho.dragenter=(t,e)=>e.preventDefault();ho.drop=(t,e)=>{try{Rke(t,e,t.dragging)}finally{t.dragging=null}};function Rke(t,e,r){if(!e.dataTransfer)return;let n=t.posAtCoords(xj(e));if(!n)return;let a=t.state.doc.resolve(n.pos),i=r&&r.slice;i?t.someProp("transformPasted",m=>{i=m(i,t,!1)}):i=Iz(t,Kz(e.dataTransfer),S0?null:e.dataTransfer.getData("text/html"),!1,a);let o=!!(r&&Yz(t,e));if(t.someProp("handleDrop",m=>m(t,e,i||ar.empty,o))){e.preventDefault();return}if(!i)return;e.preventDefault();let l=i?mz(t.state.doc,a.pos,i):a.pos;l==null&&(l=a.pos);let c=t.state.tr;if(o){let{node:m}=r;m?m.replace(c):c.deleteSelection()}let u=c.mapping.map(l),d=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,h=c.doc;if(d?c.replaceRangeWith(u,u,i.content.firstChild):c.replaceRange(u,u,i),c.doc.eq(h))return;let f=c.doc.resolve(u);if(d&&_r.isSelectable(i.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(i.content.firstChild))c.setSelection(new _r(f));else{let m=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((g,y,b,w)=>m=w),c.setSelection(C_(t,f,c.doc.resolve(m)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))}uo.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&vd(t)},20))};uo.blur=(t,e)=>{let r=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),r.relatedTarget&&t.dom.contains(r.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};uo.beforeinput=(t,e)=>{if(bi&&xd&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,gf(8,"Backspace")))))return;let{$cursor:a}=t.state.selection;a&&a.pos>0&&t.dispatch(t.state.tr.delete(a.pos-1,a.pos).scrollIntoView())},50)}};for(let t in ho)uo[t]=ho[t];function k0(t,e){if(t==e)return!0;for(let r in t)if(t[r]!==e[r])return!1;for(let r in e)if(!(r in t))return!1;return!0}class sw{constructor(e,r){this.toDOM=e,this.spec=r||Of,this.side=this.spec.side||0}map(e,r,n,a){let{pos:i,deleted:o}=e.mapResult(r.from+a,this.side<0?-1:1);return o?null:new Ul(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof sw&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&k0(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class tm{constructor(e,r){this.attrs=e,this.spec=r||Of}map(e,r,n,a){let i=e.map(r.from+a,this.spec.inclusiveStart?-1:1)-n,o=e.map(r.to+a,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new Ul(i,o,this)}valid(e,r){return r.from<r.to}eq(e){return this==e||e instanceof tm&&k0(this.attrs,e.attrs)&&k0(this.spec,e.spec)}static is(e){return e.type instanceof tm}destroy(){}}class D_{constructor(e,r){this.attrs=e,this.spec=r||Of}map(e,r,n,a){let i=e.mapResult(r.from+a,1);if(i.deleted)return null;let o=e.mapResult(r.to+a,-1);return o.deleted||o.pos<=i.pos?null:new Ul(i.pos-n,o.pos-n,this)}valid(e,r){let{index:n,offset:a}=e.content.findIndex(r.from),i;return a==r.from&&!(i=e.child(n)).isText&&a+i.nodeSize==r.to}eq(e){return this==e||e instanceof D_&&k0(this.attrs,e.attrs)&&k0(this.spec,e.spec)}destroy(){}}class Ul{constructor(e,r,n){this.from=e,this.to=r,this.type=n}copy(e,r){return new Ul(e,r,this.type)}eq(e,r=0){return this.type.eq(e.type)&&this.from+r==e.from&&this.to+r==e.to}map(e,r,n){return this.type.map(e,this,r,n)}static widget(e,r,n){return new Ul(e,e,new sw(r,n))}static inline(e,r,n,a){return new Ul(e,r,new tm(n,a))}static node(e,r,n,a){return new Ul(e,r,new D_(n,a))}get spec(){return this.type.spec}get inline(){return this.type instanceof tm}get widget(){return this.type instanceof sw}}const bg=[],Of={};class Ba{constructor(e,r){this.local=e.length?e:bg,this.children=r.length?r:bg}static create(e,r){return r.length?nw(r,e,0,Of):Ri}find(e,r,n){let a=[];return this.findInner(e??0,r??1e9,a,0,n),a}findInner(e,r,n,a,i){for(let o=0;o<this.local.length;o++){let l=this.local[o];l.from<=r&&l.to>=e&&(!i||i(l.spec))&&n.push(l.copy(l.from+a,l.to+a))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<r&&this.children[o+1]>e){let l=this.children[o]+1;this.children[o+2].findInner(e-l,r-l,n,a+l,i)}}map(e,r,n){return this==Ri||e.maps.length==0?this:this.mapInner(e,r,0,0,n||Of)}mapInner(e,r,n,a,i){let o;for(let l=0;l<this.local.length;l++){let c=this.local[l].map(e,n,a);c&&c.type.valid(r,c)?(o||(o=[])).push(c):i.onRemove&&i.onRemove(this.local[l].spec)}return this.children.length?Bke(this.children,o||[],e,r,n,a,i):o?new Ba(o.sort(zf),bg):Ri}add(e,r){return r.length?this==Ri?Ba.create(e,r):this.addInner(e,r,0):this}addInner(e,r,n){let a,i=0;e.forEach((l,c)=>{let u=c+n,d;if(d=Xz(r,l,u)){for(a||(a=this.children.slice());i<a.length&&a[i]<c;)i+=3;a[i]==c?a[i+2]=a[i+2].addInner(l,d,u+1):a.splice(i,0,c,c+l.nodeSize,nw(d,l,u+1,Of)),i+=3}});let o=Zz(i?Qz(r):r,-n);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||o.splice(l--,1);return new Ba(o.length?this.local.concat(o).sort(zf):this.local,a||this.children)}remove(e){return e.length==0||this==Ri?this:this.removeInner(e,0)}removeInner(e,r){let n=this.children,a=this.local;for(let i=0;i<n.length;i+=3){let o,l=n[i]+r,c=n[i+1]+r;for(let d=0,h;d<e.length;d++)(h=e[d])&&h.from>l&&h.to<c&&(e[d]=null,(o||(o=[])).push(h));if(!o)continue;n==this.children&&(n=this.children.slice());let u=n[i+2].removeInner(o,l+1);u!=Ri?n[i+2]=u:(n.splice(i,3),i-=3)}if(a.length){for(let i=0,o;i<e.length;i++)if(o=e[i])for(let l=0;l<a.length;l++)a[l].eq(o,r)&&(a==this.local&&(a=this.local.slice()),a.splice(l--,1))}return n==this.children&&a==this.local?this:a.length||n.length?new Ba(a,n):Ri}forChild(e,r){if(this==Ri)return this;if(r.isLeaf)return Ba.empty;let n,a;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(n=this.children[l+2]);break}let i=e+1,o=i+r.content.size;for(let l=0;l<this.local.length;l++){let c=this.local[l];if(c.from<o&&c.to>i&&c.type instanceof tm){let u=Math.max(i,c.from)-i,d=Math.min(o,c.to)-i;u<d&&(a||(a=[])).push(c.copy(u,d))}}if(a){let l=new Ba(a.sort(zf),bg);return n?new _h([l,n]):l}return n||Ri}eq(e){if(this==e)return!0;if(!(e instanceof Ba)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let r=0;r<this.local.length;r++)if(!this.local[r].eq(e.local[r]))return!1;for(let r=0;r<this.children.length;r+=3)if(this.children[r]!=e.children[r]||this.children[r+1]!=e.children[r+1]||!this.children[r+2].eq(e.children[r+2]))return!1;return!0}locals(e){return T_(this.localsInner(e))}localsInner(e){if(this==Ri)return bg;if(e.inlineContent||!this.local.some(tm.is))return this.local;let r=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof tm||r.push(this.local[n]);return r}forEachSet(e){e(this)}}Ba.empty=new Ba([],[]);Ba.removeOverlap=T_;const Ri=Ba.empty;class _h{constructor(e){this.members=e}map(e,r){const n=this.members.map(a=>a.map(e,r,Of));return _h.from(n)}forChild(e,r){if(r.isLeaf)return Ba.empty;let n=[];for(let a=0;a<this.members.length;a++){let i=this.members[a].forChild(e,r);i!=Ri&&(i instanceof _h?n=n.concat(i.members):n.push(i))}return _h.from(n)}eq(e){if(!(e instanceof _h)||e.members.length!=this.members.length)return!1;for(let r=0;r<this.members.length;r++)if(!this.members[r].eq(e.members[r]))return!1;return!0}locals(e){let r,n=!0;for(let a=0;a<this.members.length;a++){let i=this.members[a].localsInner(e);if(i.length)if(!r)r=i;else{n&&(r=r.slice(),n=!1);for(let o=0;o<i.length;o++)r.push(i[o])}}return r?T_(n?r:r.sort(zf)):bg}static from(e){switch(e.length){case 0:return Ri;case 1:return e[0];default:return new _h(e.every(r=>r instanceof Ba)?e:e.reduce((r,n)=>r.concat(n instanceof Ba?n:n.members),[]))}}forEachSet(e){for(let r=0;r<this.members.length;r++)this.members[r].forEachSet(e)}}function Bke(t,e,r,n,a,i,o){let l=t.slice();for(let u=0,d=i;u<r.maps.length;u++){let h=0;r.maps[u].forEach((f,m,g,y)=>{let b=y-g-(m-f);for(let w=0;w<l.length;w+=3){let j=l[w+1];if(j<0||f>j+d-h)continue;let N=l[w]+d-h;m>=N?l[w+1]=f<=N?-2:-1:f>=d&&b&&(l[w]+=b,l[w+1]+=b)}h+=b}),d=r.maps[u].map(d,-1)}let c=!1;for(let u=0;u<l.length;u+=3)if(l[u+1]<0){if(l[u+1]==-2){c=!0,l[u+1]=-1;continue}let d=r.map(t[u]+i),h=d-a;if(h<0||h>
vendor: 9,860 bytes, line 1207
1207=n.content.size){c=!0;continue}let f=r.map(t[u+1]+i,-1),m=f-a,{index:g,offset:y}=n.content.findIndex(h),b=n.maybeChild(g);if(b&&y==h&&y+b.nodeSize==m){let w=l[u+2].mapInner(r,b,d+1,t[u]+i+1,o);w!=Ri?(l[u]=h,l[u+1]=m,l[u+2]=w):(l[u+1]=-2,c=!0)}else c=!0}if(c){let u=Lke(l,t,e,r,a,i,o),d=nw(u,n,0,o);e=d.local;for(let h=0;h<l.length;h+=3)l[h+1]<0&&(l.splice(h,3),h-=3);for(let h=0,f=0;h<d.children.length;h+=3){let m=d.children[h];for(;f<l.length&&l[f]<m;)f+=3;l.splice(f,0,d.children[h],d.children[h+1],d.children[h+2])}}return new Ba(e.sort(zf),l)}function Zz(t,e){if(!e||!t.length)return t;let r=[];for(let n=0;n<t.length;n++){let a=t[n];r.push(new Ul(a.from+e,a.to+e,a.type))}return r}function Lke(t,e,r,n,a,i,o){function l(c,u){for(let d=0;d<c.local.length;d++){let h=c.local[d].map(n,a,u);h?r.push(h):o.onRemove&&o.onRemove(c.local[d].spec)}for(let d=0;d<c.children.length;d+=3)l(c.children[d+2],c.children[d]+u+1)}for(let c=0;c<t.length;c+=3)t[c+1]==-1&&l(t[c+2],e[c]+i+1);return r}function Xz(t,e,r){if(e.isLeaf)return null;let n=r+e.nodeSize,a=null;for(let i=0,o;i<t.length;i++)(o=t[i])&&o.from>r&&o.to<n&&((a||(a=[])).push(o),t[i]=null);return a}function Qz(t){let e=[];for(let r=0;r<t.length;r++)t[r]!=null&&e.push(t[r]);return e}function nw(t,e,r,n){let a=[],i=!1;e.forEach((l,c)=>{let u=Xz(t,l,c+r);if(u){i=!0;let d=nw(u,l,r+c+1,n);d!=Ri&&a.push(c,c+l.nodeSize,d)}});let o=Zz(i?Qz(t):t,-r).sort(zf);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||(n.onRemove&&n.onRemove(o[l].spec),o.splice(l--,1));return o.length||a.length?new Ba(o,a):Ri}function zf(t,e){return t.from-e.from||t.to-e.to}function T_(t){let e=t;for(let r=0;r<e.length-1;r++){let n=e[r];if(n.from!=n.to)for(let a=r+1;a<e.length;a++){let i=e[a];if(i.from==n.from){i.to!=n.to&&(e==t&&(e=t.slice()),e[a]=i.copy(i.from,n.to),DT(e,a+1,i.copy(n.to,i.to)));continue}else{i.from<n.to&&(e==t&&(e=t.slice()),e[r]=n.copy(n.from,i.from),DT(e,a,n.copy(i.from,n.to)));break}}}return e}function DT(t,e,r){for(;e<t.length&&zf(r,t[e])>0;)e++;t.splice(e,0,r)}function WN(t){let e=[];return t.someProp("decorations",r=>{let n=r(t.state);n&&n!=Ri&&e.push(n)}),t.cursorWrapper&&e.push(Ba.create(t.state.doc,[t.cursorWrapper.deco])),_h.from(e)}const Ike={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},Oke=Bo&&Qh<=11;class zke{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class Uke{constructor(e,r){this.view=e,this.handleDOMChange=r,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new zke,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let a=0;a<n.length;a++)this.queue.push(n[a]);Bo&&Qh<=11&&n.some(a=>a.type=="childList"&&a.removedNodes.length||a.type=="characterData"&&a.oldValue.length>a.target.nodeValue.length)?this.flushSoon():Hi&&e.composing&&n.some(a=>a.type=="childList"&&a.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),Oke&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Ike)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let r=0;r<e.length;r++)this.queue.push(e[r]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(NT(this.view)){if(this.suppressingSelectionUpdates)return vd(this.view);if(Bo&&Qh<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&ap(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let r=new Set,n;for(let i=e.focusNode;i;i=fx(i))r.add(i);for(let i=e.anchorNode;i;i=fx(i))if(r.has(i)){n=i;break}let a=n&&this.view.docView.nearestDesc(n);if(a&&a.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let r=this.pendingRecords();r.length&&(this.queue=[]);let n=e.domSelectionRange(),a=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&NT(e)&&!this.ignoreSelectionChange(n),i=-1,o=-1,l=!1,c=[];if(e.editable)for(let d=0;d<r.length;d++){let h=this.registerMutation(r[d],c);h&&(i=i<0?h.from:Math.min(h.from,i),o=o<0?h.to:Math.max(h.to,o),h.typeOver&&(l=!0))}if(c.some(d=>d.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let d of c)if(d.nodeName=="BR"&&d.parentNode){let h=d.nextSibling;h&&h.nodeType==1&&h.contentEditable=="false"&&d.parentNode.removeChild(d)}}else if(Gl&&c.length){let d=c.filter(h=>h.nodeName=="BR");if(d.length==2){let[h,f]=d;h.parentNode&&h.parentNode.parentNode==f.parentNode?f.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let f of d){let m=f.parentNode;m&&m.nodeName=="LI"&&(!h||Wke(e,h)!=m)&&f.remove()}}}let u=null;i<0&&a&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&pj(n)&&(u=S_(e))&&u.eq(ms.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,vd(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||a)&&(i>-1&&(e.docView.markDirty(i,o),Hke(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,qke(e,c)),this.handleDOMChange(i,o,l,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||vd(e),this.currentSelection.set(n))}registerMutation(e,r){if(r.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(let d=0;d<e.addedNodes.length;d++){let h=e.addedNodes[d];r.push(h),h.nodeType==3&&(this.lastChangedTextNode=h)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let a=e.previousSibling,i=e.nextSibling;if(Bo&&Qh<=11&&e.addedNodes.length)for(let d=0;d<e.addedNodes.length;d++){let{previousSibling:h,nextSibling:f}=e.addedNodes[d];(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(a=h),(!f||Array.prototype.indexOf.call(e.addedNodes,f)<0)&&(i=f)}let o=a&&a.parentNode==e.target?gi(a)+1:0,l=n.localPosFromDOM(e.target,o,-1),c=i&&i.parentNode==e.target?gi(i):e.target.childNodes.length,u=n.localPosFromDOM(e.target,c,1);return{from:l,to:u}}else return e.type=="attributes"?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let TT=new WeakMap,MT=!1;function Hke(t){if(!TT.has(t)&&(TT.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=Gl,MT)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),MT=!0}}function PT(t,e){let r=e.startContainer,n=e.startOffset,a=e.endContainer,i=e.endOffset,o=t.domAtPos(t.state.selection.anchor);return ap(o.node,o.offset,a,i)&&([r,n,a,i]=[a,i,r,n]),{anchorNode:r,anchorOffset:n,focusNode:a,focusOffset:i}}function $ke(t,e){if(e.getComposedRanges){let a=e.getComposedRanges(t.root)[0];if(a)return PT(t,a)}let r;function n(a){a.preventDefault(),a.stopImmediatePropagation(),r=a.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0),r?PT(t,r):null}function Wke(t,e){for(let r=e.parentNode;r&&r!=t.dom;r=r.parentNode){let n=t.docView.nearestDesc(r,!0);if(n&&n.node.isBlock)return r}return null}function qke(t,e){var r;let{focusNode:n,focusOffset:a}=t.domSelectionRange();for(let i of e)if(((r=i.parentNode)===null||r===void 0?void 0:r.nodeName)=="TR"){let o=i.nextSibling;for(;o&&o.nodeName!="TD"&&o.nodeName!="TH";)o=o.nextSibling;if(o){let l=o;for(;;){let c=l.firstChild;if(!c||c.nodeType!=1||c.contentEditable=="false"||/^(BR|IMG)$/.test(c.nodeName))break;l=c}l.insertBefore(i,l.firstChild),n==i&&t.domSelection().collapse(i,a)}else i.parentNode.removeChild(i)}}function Gke(t,e,r){let{node:n,fromOffset:a,toOffset:i,from:o,to:l}=t.docView.parseRange(e,r),c=t.domSelectionRange(),u,d=c.anchorNode;
vendor: 4,461 bytes, line 1207
1207if(d&&t.dom.contains(d.nodeType==1?d:d.parentNode)&&(u=[{node:d,offset:c.anchorOffset}],pj(c)||u.push({node:c.focusNode,offset:c.focusOffset})),bi&&t.input.lastKeyCode===8)for(let b=i;b>a;b--){let w=n.childNodes[b-1],j=w.pmViewDesc;if(w.nodeName=="BR"&&!j){i=b;break}if(!j||j.size)break}let h=t.state.doc,f=t.someProp("domParser")||Xh.fromSchema(t.state.schema),m=h.resolve(o),g=null,y=f.parse(n,{topNode:m.parent,topMatch:m.parent.contentMatchAt(m.index()),topOpen:!0,from:a,to:i,preserveWhitespace:m.parent.type.whitespace=="pre"?"full":!0,findPositions:u,ruleFromNode:Vke,context:m});if(u&&u[0].pos!=null){let b=u[0].pos,w=u[1]&&u[1].pos;w==null&&(w=b),g={anchor:b+o,head:w+o}}return{doc:y,sel:g,from:o,to:l}}function Vke(t){let e=t.pmViewDesc;if(e)return e.parseRule();if(t.nodeName=="BR"&&t.parentNode){if(Hi&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let r=document.createElement("div");return r.appendChild(document.createElement("li")),{skip:r}}else if(t.parentNode.lastChild==t||Hi&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const Kke=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Jke(t,e,r,n,a){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let T=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,D=S_(t,T);if(D&&!t.state.selection.eq(D)){if(bi&&xd&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",R=>R(t,gf(13,"Enter"))))return;let A=t.state.tr.setSelection(D);T=="pointer"?A.setMeta("pointer",!0):T=="key"&&A.scrollIntoView(),i&&A.setMeta("composition",i),t.dispatch(A)}return}let o=t.state.doc.resolve(e),l=o.sharedDepth(r);e=o.before(l+1),r=t.state.doc.resolve(r).after(l+1);let c=t.state.selection,u=Gke(t,e,r),d=t.state.doc,h=d.slice(u.from,u.to),f,m;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(f=t.state.selection.to,m="end"):(f=t.state.selection.from,m="start"),t.input.lastKeyCode=null;let g=Xke(h.content,u.doc.content,u.from,f,m);if(g&&t.input.domChangeCount++,(px&&t.input.lastIOSEnter>Date.now()-225||xd)&&a.some(T=>T.nodeType==1&&!Kke.test(T.nodeName))&&(!g||g.endA>=g.endB)&&t.someProp("handleKeyDown",T=>T(t,gf(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!g)if(n&&c instanceof Vr&&!c.empty&&c.$head.sameParent(c.$anchor)&&!t.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))g={start:c.from,endA:c.to,endB:c.to};else{if(u.sel){let T=RT(t,t.state.doc,u.sel);if(T&&!T.eq(t.state.selection)){let D=t.state.tr.setSelection(T);i&&D.setMeta("composition",i),t.dispatch(D)}}return}t.state.selection.from<t.state.selection.to&&g.start==g.endB&&t.state.selection instanceof Vr&&(g.start>t.state.selection.from&&g.start<=t.state.selection.from+2&&t.state.selection.from>=u.from?g.start=t.state.selection.from:g.endA<t.state.selection.to&&g.endA>=t.state.selection.to-2&&t.state.selection.to<=u.to&&(g.endB+=t.state.selection.to-g.endA,g.endA=t.state.selection.to)),Bo&&Qh<=11&&g.endB==g.start+1&&g.endA==g.start&&g.start>u.from&&u.doc.textBetween(g.start-u.from-1,g.start-u.from+1)==" Â "&&(g.start--,g.endA--,g.endB--);let y=u.doc.resolveNoCache(g.start-u.from),b=u.doc.resolveNoCache(g.endB-u.from),w=d.resolve(g.start),j=y.sameParent(b)&&y.parent.inlineContent&&w.end()>=g.endA;if((px&&t.input.lastIOSEnter>Date.now()-225&&(!j||a.some(T=>T.nodeName=="DIV"||T.nodeName=="P"))||!j&&y.pos<u.doc.content.size&&(!y.sameParent(b)||!y.parent.inlineContent)&&y.pos<b.pos&&!/\S/.test(u.doc.textBetween(y.pos,b.pos,"","")))&&t.someProp("handleKeyDown",T=>T(t,gf(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>g.start&&Zke(d,g.start,g.endA,y,b)&&t.someProp("handleKeyDown",T=>T(t,gf(8,"Backspace")))){xd&&bi&&t.domObserver.suppressSelectionUpdates();return}bi&&g.endB==g.start&&(t.input.lastChromeDelete=Date.now()),xd&&!j&&y.start()!=b.start()&&b.parentOffset==0&&y.depth==b.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==g.endA&&(g.endB-=2,b=u.doc.resolveNoCache(g.endB-u.from),setTimeout(()=>{t.someProp("handleKeyDown",function(T){return T(t,gf(13,"Enter"))})},20));let N=g.start,S=g.endA,E=T=>{let D=T||t.state.tr.replace(N,S,u.doc.slice(g.start-u.from,g.endB-u.from));if(u.sel){let A=RT(t,D.doc,u.sel);
vendor: 20,918 bytes, lines 1207-1208
1207A&&!(bi&&t.composing&&A.empty&&(g.start!=g.endB||t.input.lastChromeDelete<Date.now()-100)&&(A.head==N||A.head==D.mapping.map(S)-1)||Bo&&A.empty&&A.head==N)&&D.setSelection(A)}return i&&D.setMeta("composition",i),D.scrollIntoView()},C;if(j)if(y.pos==b.pos){Bo&&Qh<=11&&y.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>vd(t),20));let T=E(t.state.tr.delete(N,S)),D=d.resolve(g.start).marksAcross(d.resolve(g.endA));D&&T.ensureMarks(D),t.dispatch(T)}else if(g.endA==g.endB&&(C=Yke(y.parent.content.cut(y.parentOffset,b.parentOffset),w.parent.content.cut(w.parentOffset,g.endA-w.start())))){let T=E(t.state.tr);C.type=="add"?T.addMark(N,S,C.mark):T.removeMark(N,S,C.mark),t.dispatch(T)}else if(y.parent.child(y.index()).isText&&y.index()==b.index()-(b.textOffset?0:1)){let T=y.parent.textBetween(y.parentOffset,b.parentOffset),D=()=>E(t.state.tr.insertText(T,N,S));t.someProp("handleTextInput",A=>A(t,N,S,T,D))||t.dispatch(D())}else t.dispatch(E());else t.dispatch(E())}function RT(t,e,r){return Math.max(r.anchor,r.head)>e.content.size?null:C_(t,e.resolve(r.anchor),e.resolve(r.head))}function Yke(t,e){let r=t.firstChild.marks,n=e.firstChild.marks,a=r,i=n,o,l,c;for(let d=0;d<n.length;d++)a=n[d].removeFromSet(a);for(let d=0;d<r.length;d++)i=r[d].removeFromSet(i);if(a.length==1&&i.length==0)l=a[0],o="add",c=d=>d.mark(l.addToSet(d.marks));else if(a.length==0&&i.length==1)l=i[0],o="remove",c=d=>d.mark(l.removeFromSet(d.marks));else return null;let u=[];for(let d=0;d<e.childCount;d++)u.push(c(e.child(d)));if(Nt.from(u).eq(t))return{mark:l,type:o}}function Zke(t,e,r,n,a){if(r-e<=a.pos-n.pos||qN(n,!0,!1)<a.pos)return!1;let i=t.resolve(e);if(!n.parent.isTextblock){let l=i.nodeAfter;return l!=null&&r==e+l.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let o=t.resolve(qN(i,!0,!0));return!o.parent.isTextblock||o.pos>r||qN(o,!0,!1)<r?!1:n.parent.content.cut(n.parentOffset).eq(o.parent.content)}function qN(t,e,r){let n=t.depth,a=e?t.end():t.pos;for(;n>0&&(e||t.indexAfter(n)==t.node(n).childCount);)n--,a++,e=!1;if(r){let i=t.node(n).maybeChild(t.indexAfter(n));for(;i&&!i.isLeaf;)i=i.firstChild,a++}return a}function Xke(t,e,r,n,a){let i=t.findDiffStart(e,r);if(i==null)return null;let{a:o,b:l}=t.findDiffEnd(e,r+t.size,r+e.size);if(a=="end"){let c=Math.max(0,i-Math.min(o,l));n-=o+c-i}if(o<i&&t.size<e.size){let c=n<=i&&n>=o?i-n:0;i-=c,i&&i<e.size&&BT(e.textBetween(i-1,i+1))&&(i+=c?1:-1),l=i+(l-o),o=i}else if(l<i){let c=n<=i&&n>=l?i-n:0;i-=c,i&&i<t.size&&BT(t.textBetween(i-1,i+1))&&(i+=c?1:-1),o=i+(o-l),l=i}return{start:i,endA:o,endB:l}}function BT(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),r=t.charCodeAt(1);return e>=56320&&e<=57343&&r>=55296&&r<=56319}class eU{constructor(e,r){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new fke,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=r,this.state=r.state,this.directPlugins=r.plugins||[],this.directPlugins.forEach(UT),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=OT(this),IT(this),this.nodeViews=zT(this),this.docView=xT(this.state.doc,LT(this),WN(this),this.dom,this),this.domObserver=new Uke(this,(n,a,i,o)=>Jke(this,n,a,i,o)),this.domObserver.start(),pke(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let r in e)this._props[r]=e[r];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&XS(this);let r=this._props;this._props=e,e.plugins&&(e.plugins.forEach(UT),this.directPlugins=e.plugins),this.updateStateInner(e.state,r)}setProps(e){let r={};for(let n in this._props)r[n]=this._props[n];r.state=this.state;for(let n in e)r[n]=e[n];this.update(r)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,r){var n;let a=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(Vz(this),o=!0),this.state=e;let l=a.plugins!=e.plugins||this._props.plugins!=r.plugins;if(l||this._props.plugins!=r.plugins||this._props.nodeViews!=r.nodeViews){let m=zT(this);e_e(m,this.nodeViews)&&(this.nodeViews=m,i=!0)}(l||r.handleDOMEvents!=this._props.handleDOMEvents)&&XS(this),this.editable=OT(this),IT(this);let c=WN(this),u=LT(this),d=a.plugins!=e.plugins&&!a.doc.eq(e.doc)?"reset":e.scrollToSelection>a.scrollToSelection?"to selection":"preserve",h=i||!this.docView.matchesNode(e.doc,u,c);(h||!e.selection.eq(a.selection))&&(o=!0);let f=d=="preserve"&&o&&this.dom.style.overflowAnchor==null&&ECe(this);if(o){this.domObserver.stop();let m=h&&(Bo||bi)&&!this.composing&&!a.selection.empty&&!e.selection.empty&&Qke(a.selection,e.selection);if(h){let g=bi?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Eke(this)),(i||!this.docView.update(e.doc,u,c,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=xT(e.doc,u,c,this.dom,this)),g&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(m=!0)}m||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&QCe(this))?vd(this,m):(Rz(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(a),!((n=this.dragging)===null||n===void 0)&&n.node&&!a.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,a),d=="reset"?this.dom.scrollTop=0:d=="to selection"?this.scrollToSelection():f&&ACe(f)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",r=>r(this)))if(this.state.selection instanceof _r){let r=this.docView.domAfterPos(this.state.selection.from);r.nodeType==1&&dT(this,r.getBoundingClientRect(),e)}else dT(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let r=0;r<this.directPlugins.length;r++){let n=this.directPlugins[r];n.spec.view&&this.pluginViews.push(n.spec.view(this))}for(let r=0;r<this.state.plugins.length;r++){let n=this.state.plugins[r];n.spec.view&&this.pluginViews.push(n.spec.view(this))}}else for(let r=0;r<this.pluginViews.length;r++){let n=this.pluginViews[r];n.update&&n.update(this,e)}}updateDraggedNode(e,r){let n=e.node,a=-1;if(this.state.doc.nodeAt(n.from)==n.node)a=n.from;else{let i=n.from+(this.state.doc.content.size-r.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==n.node&&(a=i)}this.dragging=new Jz(e.slice,e.move,a<0?void 0:_r.create(this.state.doc,a))}someProp(e,r){let n=this._props&&this._props[e],a;if(n!=null&&(a=r?r(n):n))return a;for(let o=0;o<this.directPlugins.length;o++){let l=this.directPlugins[o].props[e];if(l!=null&&(a=r?r(l):l))return a}let i=this.state.plugins;if(i)for(let o=0;o<i.length;o++){let l=i[o].props[e];if(l!=null&&(a=r?r(l):l))return a}}hasFocus(){if(Bo){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&DCe(this.dom),vd(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let r=this.dom.parentNode;r;r=r.parentNode)if(r.nodeType==9||r.nodeType==11&&r.host)return r.getSelection||(Object.getPrototypeOf(r).getSelection=()=>r.ownerDocument.getSelection()),this._root=r}return e||document}updateRoot(){this._root=null}posAtCoords(e){return BCe(this,e)}coordsAtPos(e,r=1){return kz(this,e,r)}domAtPos(e,r=0){return this.docView.domFromPos(e,r)}nodeDOM(e){let r=this.docView.descAt(e);return r?r.nodeDOM:null}posAtDOM(e,r,n=-1){let a=this.docView.posFromDOM(e,r,n);if(a==null)throw new RangeError("DOM position not inside the editor");return a}endOfTextblock(e,r){return UCe(this,r||this.state,e)}pasteHTML(e,r){return C0(this,"",e,!1,r||new ClipboardEvent("paste"))}pasteText(e,r){return C0(this,e,null,!0,r||new ClipboardEvent("paste"))}serializeForClipboard(e){return k_(this,e)}destroy(){this.docView&&(gke(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],WN(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,bCe())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return yke(this,e)}domSelectionRange(){let e=this.domSelection();return e?Hi&&this.root.nodeType===11&&FCe(this.dom.ownerDocument)==this.dom&&$ke(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}eU.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function LT(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",r=>{if(typeof r=="function"&&(r=r(t.state)),r)for(let n in r)n=="class"?e.class+=" "+r[n]:n=="style"?e.style=(e.style?e.style+";":"")+r[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(r[n]))}),e.translate||(e.translate="no"),[Ul.node(0,t.state.doc.content.size,e)]}function IT(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Ul.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function OT(t){return!t.someProp("editable",e=>e(t.state)===!1)}function Qke(t,e){let r=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(r)!=e.$anchor.start(r)}function zT(t){let e=Object.create(null);function r(n){for(let a in n)Object.prototype.hasOwnProperty.call(e,a)||(e[a]=n[a])}return t.someProp("nodeViews",r),t.someProp("markViews",r),e}function e_e(t,e){let r=0,n=0;for(let a in t){if(t[a]!=e[a])return!0;r++}for(let a in e)n++;return r!=n}function UT(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var cm={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},aw={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},t_e=typeof navigator<"u"&&/Mac/.test(navigator.platform),r_e=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var xi=0;xi<10;xi++)cm[48+xi]=cm[96+xi]=String(xi);for(var xi=1;xi<=24;xi++)cm[xi+111]="F"+xi;for(var xi=65;xi<=90;xi++)cm[xi]=String.fromCharCode(xi+32),aw[xi]=String.fromCharCode(xi);for(var GN in cm)aw.hasOwnProperty(GN)||(aw[GN]=cm[GN]);function s_e(t){var e=t_e&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||r_e&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",r=!e&&t.key||(t.shiftKey?aw:cm)[t.keyCode]||t.key||"Unidentified";return r=="Esc"&&(r="Escape"),r=="Del"&&(r="Delete"),r=="Left"&&(r="ArrowLeft"),r=="Up"&&(r="ArrowUp"),r=="Right"&&(r="ArrowRight"),r=="Down"&&(r="ArrowDown"),r}const n_e=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),a_e=typeof navigator<"u"&&/Win/.test(navigator.platform);function i_e(t){let e=t.split(/-(?!$)/),r=e[e.length-1];r=="Space"&&(r=" ");let n,a,i,o;for(let l=0;l<e.length-1;l++){let c=e[l];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))n=!0;else if(/^(c|ctrl|control)$/i.test(c))a=!0;else if(/^s(hift)?$/i.test(c))i=!0;else if(/^mod$/i.test(c))n_e?o=!0:a=!0;else throw new Error("Unrecognized modifier name: "+c)}return n&&(r="Alt-"+r),a&&(r="Ctrl-"+r),o&&(r="Meta-"+r),i&&(r="Shift-"+r),r}function o_e(t){let e=Object.create(null);for(let r in t)e[i_e(r)]=t[r];return e}function VN(t,e,r=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),r&&e.shiftKey&&(t="Shift-"+t),t}function l_e(t){return new fo({props:{handleKeyDown:tU(t)}})}function tU(t){let e=o_e(t);return function(r,n){let a=s_e(n),i,o=e[VN(a,n)];if(o&&o(r.state,r.dispatch,r))return!0;if(a.length==1&&a!=" "){if(n.shiftKey){let l=e[VN(a,n,!1)];if(l&&l(r.state,r.dispatch,r))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(a_e&&n.ctrlKey&&n.altKey)&&(i=cm[n.keyCode])&&i!=a){let l=e[VN(i,n)];if(l&&l(r.state,r.dispatch,r))return!0}}return!1}}const M_=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function rU(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("backward",t):r.parentOffset>0)?null:r}const sU=(t,e,r)=>{let n=rU(t,r);if(!n)return!1;let a=P_(n);if(!a){let o=n.blockRange(),l=o&&zx(o);return l==null?!1:(e&&e(t.tr.lift(o,l).scrollIntoView()),!0)}let i=a.nodeBefore;if(hU(t,a,e,-1))return!0;if(n.parent.content.size==0&&(gx(i,"end")||_r.isSelectable(i)))for(let o=n.depth;;o--){let l=mj(t.doc,n.before(o),n.after(o),ar.empty);if(l&&l.slice.size<l.to-l.from){if(e){let c=t.tr.step(l);c.setSelection(gx(i,"end")?ms.findFrom(c.doc.resolve(c.mapping.map(a.pos,-1)),-1):_r.create(c.doc,a.pos-i.nodeSize)),e(c.scrollIntoView())}return!0}if(o==1||n.node(o-1).childCount>1)break}return i.isAtom&&a.depth==n.depth-1?(e&&e(t.tr.delete(a.pos-i.nodeSize,a.pos).scrollIntoView()),!0):!1},c_e=(t,e,r)=>{let n=rU(t,r);if(!n)return!1;let a=P_(n);return a?nU(t,a,e):!1},u_e=(t,e,r)=>{let n=iU(t,r);if(!n)return!1;let a=R_(n);return a?nU(t,a,e):!1};function nU(t,e,r){let n=e.nodeBefore,a=n,i=e.pos-1;for(;!a.isTextblock;i--){if(a.type.spec.isolating)return!1;let d=a.lastChild;if(!d)return!1;a=d}let o=e.nodeAfter,l=o,c=e.pos+1;for(;!l.isTextblock;c++){if(l.type.spec.isolating)return!1;let d=l.firstChild;if(!d)return!1;l=d}let u=mj(t.doc,i,c,ar.empty);if(!u||u.from!=i||u instanceof ei&&u.slice.size>=c-i)return!1;if(r){let d=t.tr.step(u);d.setSelection(Vr.create(d.doc,i)),r(d.scrollIntoView())}return!0}function gx(t,e,r=!1){for(let n=t;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(r&&n.childCount!=1)return!1}return!1}const aU=(t,e,r)=>{let{$head:n,empty:a}=t.selection,i=n;if(!a)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("backward",t):n.parentOffset>0)return!1;i=P_(n)}let o=i&&i.nodeBefore;return!o||!_r.isSelectable(o)?!1:(e&&e(t.tr.setSelection(_r.create(t.doc,i.pos-o.nodeSize)).scrollIntoView()),!0)};function P_(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function iU(t,e){let{$cursor:r}=t.selection;return!r||(e?!e.endOfTextblock("forward",t):r.parentOffset<r.parent.content.size)?null:r}const oU=(t,e,r)=>{let n=iU(t,r);if(!n)return!1;let a=R_(n);if(!a)return!1;let i=a.nodeAfter;if(hU(t,a,e,1))return!0;if(n.parent.content.size==0&&(gx(i,"start")||_r.isSelectable(i))){let o=mj(t.doc,n.before(),n.after(),ar.empty);if(o&&o.slice.size<o.to-o.from){if(e){let l=t.tr.step(o);l.setSelection(gx(i,"start")?ms.findFrom(l.doc.resolve(l.mapping.map(a.pos)),1):_r.create(l.doc,l.mapping.map(a.pos))),e(l.scrollIntoView())}return!0}}return i.isAtom&&a.depth==n.depth-1?(e&&e(t.tr.delete(a.pos,a.pos+i.nodeSize).scrollIntoView()),!0):!1},lU=(t,e,r)=>{let{$head:n,empty:a}=t.selection,i=n;if(!a)return!1;if(n.parent.isTextblock){if(r?!r.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)return!1;i=R_(n)}let o=i&&i.nodeAfter;return!o||!_r.isSelectable(o)?!1:(e&&e(t.tr.setSelection(_r.create(t.doc,i.pos)).scrollIntoView()),!0)};function R_(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let r=t.node(e);if(t.index(e)+1<r.childCount)return t.doc.resolve(t.after(e+1));if(r.type.spec.isolating)break}return null}const d_e=(t,e)=>{let r=t.selection,n=r instanceof _r,a;if(n){if(r.node.isTextblock||!gm(t.doc,r.from))return!1;a=r.from}else if(a=hj(t.doc,r.from,-1),a==null)return!1;if(e){let i=t.tr.join(a);n&&i.setSelection(_r.create(i.doc,a-t.doc.resolve(a).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},h_e=(t,e)=>{let r=t.selection,n;if(r instanceof _r){if(r.node.isTextblock||!gm(t.doc,r.to))return!1;n=r.to}else if(n=hj(t.doc,r.to,1),n==null)return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0},m_e=(t,e)=>{let{$from:r,$to:n}=t.selection,a=r.blockRange(n),i=a&&zx(a);return i==null?!1:(e&&e(t.tr.lift(a,i).scrollIntoView()),!0)},cU=(t,e)=>{let{$head:r,$anchor:n}=t.selection;return!r.parent.type.spec.code||!r.sameParent(n)?!1:(e&&e(t.tr.insertText(` 1208`).scrollIntoView()),!0)};function B_(t){for(let e=0;e<t.edgeCount;e++){let{type:r}=t.edge(e);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}const f_e=(t,e)=>{let{$head:r,$anchor:n}=t.selection;if(!r.parent.type.spec.code||!r.sameParent(n))return!1;let a=r.node(-1),i=r.indexAfter(-1),o=B_(a.contentMatchAt(i));if(!o||!a.canReplaceWith(i,i,o))return!1;if(e){let l=r.after(),c=t.tr.replaceWith(l,l,o.createAndFill());c.setSelection(ms.near(c.doc.resolve(l),1)),e(c.scrollIntoView())}return!0},uU=(t,e)=>{let r=t.selection,{$from:n,$to:a}=r;if(r instanceof pl||n.parent.inlineContent||a.parent.inlineContent)return!1;let i=B_(a.parent.contentMatchAt(a.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let o=(!n.parentOffset&&a.index()<a.parent.childCount?n:a).pos,l=t.tr.insert(o,i.createAndFill());l.setSelection(Vr.create(l.doc,o+1)),e(l.scrollIntoView())}return!0},dU=(t,e)=>{let{$cursor:r}=t.selection;if(!r||r.parent.content.size)return!1;if(r.depth>1&&r.after()!=r.end(-1)){let i=r.before();if(bd(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let n=r.blockRange(),a=n&&zx(n);return a==null?!1:(e&&e(t.tr.lift(n,a).scrollIntoView()),!0)};function p_e(t){return(e,r)=>{let{$from:n,$to:a}=e.selection;if(e.selection instanceof _r&&e.selection.node.isBlock)return!n.parentOffset||!bd(e.doc,n.pos)?!1:(r&&r(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let i=[],o,l,c=!1,u=!1;for(let m=n.depth;;m--)if(n.node(m).isBlock){c=n.end(m)==n.pos+(n.depth-m),u=n.start(m)==n.pos-(n.depth-m),l=B_(n.node(m-1).contentMatchAt(n.indexAfter(m-1))),i.unshift(c&&l?{type:l}:null),o=m;break}else{if(m==1)return!1;i.unshift(null)}let d=e.tr;(e.selection instanceof Vr||e.selection instanceof pl)&&d.deleteSelection();let h=d.mapping.map(n.pos),f=bd(d.doc,h,i.length,i);if(f||(i[0]=l?{type:l}:null,f=bd(d.doc,h,i.length,i)),!f)return!1;if(d.split(h,i.length,i),!c&&u&&n.node(o).type!=l){let m=d.mapping.map(n.before(o)),g=d.doc.resolve(m);l&&n.node(o-1).canReplaceWith(g.index(),g.index()+1,l)&&d.setNodeMarkup(d.mapping.map(n.before(o)),l)}return r&&r(d.scrollIntoView()),!0}}const g_e=p_e(),x_e=(t,e)=>{let{$from:r,to:n}=t.selection,a,i=r.sharedDepth(n);return i==0?!1:(a=r.before(i),e&&e(t.tr.setSelection(_r.create(t.doc,a))),!0)};function y_e(t,e,r){let n=e.nodeBefore,a=e.nodeAfter,i=e.index();return!n||!a||!n.type.compatibleContent(a.type)?!1:!n.content.size&&e.parent.canReplace(i-1,i)?(r&&r(t.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(a.isTextblock||gm(t.doc,e.pos))?!1:(r&&r(t.tr.join(e.pos).scrollIntoView()),!0)}function hU(t,e,r,n){let a=e.nodeBefore,i=e.nodeAfter,o,l,c=a.type.spec.isolating||i.type.spec.isolating;if(!c&&y_e(t,e,r))return!0;let u=!c&&e.parent.canReplace(e.index(),e.index()+1);if(u&&(o=(l=a.contentMatchAt(a.childCount)).findWrapping(i.type))&&l.matchType(o[0]||i.type).validEnd){if(r){let m=e.pos+i.nodeSize,g=Nt.empty;for(let w=o.length-1;w>=0;w--)g=Nt.from(o[w].create(null,g));g=Nt.from(a.copy(g));let y=t.tr.step(new si(e.pos-1,m,e.pos,m,new ar(g,1,0),o.length,!0)),b=y.doc.resolve(m+2*o.length);b.nodeAfter&&b.nodeAfter.type==a.type&&gm(y.doc,b.pos)&&y.join(b.pos),r(y.scrollIntoView())}return!0}let d=i.type.spec.isolating||n>0&&c?null:ms.findFrom(e,1),h=d&&d.$from.blockRange(d.$to),f=h&&zx(h);if(f!=null&&f>=e.depth)return r&&r(t.tr.lift(h,f).scrollIntoView()),!0;if(u&&gx(i,"start",!0)&&gx(a,"end")){let m=a,g=[];for(;g.push(m),!m.isTextblock;)m=m.lastChild;let y=i,b=1;for(;!y.isTextblock;y=y.firstChild)b++;
vendor: 4,244 bytes, line 1208
1208if(m.canReplace(m.childCount,m.childCount,y.content)){if(r){let w=Nt.empty;for(let N=g.length-1;N>=0;N--)w=Nt.from(g[N].copy(w));let j=t.tr.step(new si(e.pos-g.length,e.pos+i.nodeSize,e.pos+b,e.pos+i.nodeSize-b,new ar(w,g.length,0),0,!0));r(j.scrollIntoView())}return!0}}return!1}function mU(t){return function(e,r){let n=e.selection,a=t<0?n.$from:n.$to,i=a.depth;for(;a.node(i).isInline;){if(!i)return!1;i--}return a.node(i).isTextblock?(r&&r(e.tr.setSelection(Vr.create(e.doc,t<0?a.start(i):a.end(i)))),!0):!1}}const b_e=mU(-1),v_e=mU(1);function w_e(t,e=null){return function(r,n){let{$from:a,$to:i}=r.selection,o=a.blockRange(i),l=o&&j_(o,t,e);return l?(n&&n(r.tr.wrap(o,l).scrollIntoView()),!0):!1}}function HT(t,e=null){return function(r,n){let a=!1;for(let i=0;i<r.selection.ranges.length&&!a;i++){let{$from:{pos:o},$to:{pos:l}}=r.selection.ranges[i];r.doc.nodesBetween(o,l,(c,u)=>{if(a)return!1;if(!(!c.isTextblock||c.hasMarkup(t,e)))if(c.type==t)a=!0;else{let d=r.doc.resolve(u),h=d.index();a=d.parent.canReplaceWith(h,h+1,t)}})}if(!a)return!1;if(n){let i=r.tr;for(let o=0;o<r.selection.ranges.length;o++){let{$from:{pos:l},$to:{pos:c}}=r.selection.ranges[o];i.setBlockType(l,c,t,e)}n(i.scrollIntoView())}return!0}}function L_(...t){return function(e,r,n){for(let a=0;a<t.length;a++)if(t[a](e,r,n))return!0;return!1}}L_(M_,sU,aU);L_(M_,oU,lU);L_(cU,uU,dU,g_e);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function j_e(t,e=null){return function(r,n){let{$from:a,$to:i}=r.selection,o=a.blockRange(i);if(!o)return!1;let l=n?r.tr:null;return N_e(l,o,t,e)?(n&&n(l.scrollIntoView()),!0):!1}}function N_e(t,e,r,n=null){let a=!1,i=e,o=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(r)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let c=o.resolve(e.start-2);i=new X1(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new X1(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),a=!0}let l=j_(i,r,n,e);return l?(t&&F_e(t,e,l,a,r),!0):!1}function F_e(t,e,r,n,a){let i=Nt.empty;for(let d=r.length-1;d>=0;d--)i=Nt.from(r[d].type.create(r[d].attrs,i));t.step(new si(e.start-(n?2:0),e.end,e.start,e.end,new ar(i,0,0),r.length,!0));let o=0;for(let d=0;d<r.length;d++)r[d].type==a&&(o=d+1);let l=r.length-o,c=e.start+r.length-(n?2:0),u=e.parent;for(let d=e.startIndex,h=e.endIndex,f=!0;d<h;d++,f=!1)!f&&bd(t.doc,c,l)&&(t.split(c,l),c+=2*l),c+=u.child(d).nodeSize;return t}function S_e(t){return function(e,r){let{$from:n,$to:a}=e.selection,i=n.blockRange(a,o=>o.childCount>0&&o.firstChild.type==t);return i?r?n.node(i.depth-1).type==t?C_e(e,r,t,i):k_e(e,r,i):!0:!1}}function C_e(t,e,r,n){let a=t.tr,i=n.end,o=n.$to.end(n.depth);i<o&&(a.step(new si(i-1,o,i,o,new ar(Nt.from(r.create(null,n.parent.copy())),1,0),1,!0)),n=new X1(a.doc.resolve(n.$from.pos),a.doc.resolve(o),n.depth));const l=zx(n);if(l==null)return!1;a.lift(n,l);let c=a.doc.resolve(a.mapping.map(i,-1)-1);return gm(a.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&a.join(c.pos),e(a.scrollIntoView()),!0}function k_e(t,e,r){let n=t.tr,a=r.parent;for(let m=r.end,g=r.endIndex-1,y=r.startIndex;g>y;g--)m-=a.child(g).nodeSize,n.delete(m-1,m+1);let i=n.doc.resolve(r.start),o=i.nodeAfter;if(n.mapping.map(r.end)!=r.start+i.nodeAfter.nodeSize)return!1;let l=r.startIndex==0,c=r.endIndex==a.childCount,u=i.node(-1),d=i.index(-1);if(!u.canReplace(d+(l?0:1),d+1,o.content.append(c?Nt.empty:Nt.from(a))))return!1;let h=i.pos,f=h+o.nodeSize;return n.step(new si(h-(l?1:0),f+(c?1:0),h+1,f-1,new ar((l?Nt.empty:Nt.from(a.copy(Nt.empty))).append(c?Nt.empty:Nt.from(a.copy(Nt.empty))),l?0:1,c?0:1),l?0:1)),e(n.scrollIntoView()),!0}function __e(t){return function(e,r){let{$from:n,$to:a}=e.selection,i=n.blockRange(a,u=>u.childCount>0&&u.firstChild.type==t);if(!i)return!1;let o=i.startIndex;if(o==0)return!1;let l=i.parent,c=l.child(o-1);if(c.type!=t)return!1;if(r){let u=c.lastChild&&c.lastChild.type==l.type,d=Nt.from(u?t.create():null),h=new ar(Nt.from(t.create(null,Nt.from(l.type.create(null,d)))),u?3:1,0),f=i.start,m=i.end;r(e.tr.step(new si(f-(u?3:1),m,f,m,h,1,!0)).scrollIntoView())}return!0}}function yj(t){const{state:e,transaction:r}=t;let{selection:n}=r,{doc:a}=r,{storedMarks:i}=r;
vendor: 57,153 bytes, lines 1208-1287
1208return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return n},get doc(){return a},get tr(){return n=r.selection,a=r.doc,i=r.storedMarks,r}}}class bj{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:r,state:n}=this,{view:a}=r,{tr:i}=n,o=this.buildProps(i);return Object.fromEntries(Object.entries(e).map(([l,c])=>[l,(...d)=>{const h=c(...d)(o);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(i),h}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,r=!0){const{rawCommands:n,editor:a,state:i}=this,{view:o}=a,l=[],c=!!e,u=e||i.tr,d=()=>(!c&&r&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(u),l.every(f=>f===!0)),h={...Object.fromEntries(Object.entries(n).map(([f,m])=>[f,(...y)=>{const b=this.buildProps(u,r),w=m(...y)(b);return l.push(w),h}])),run:d};return h}createCan(e){const{rawCommands:r,state:n}=this,a=!1,i=e||n.tr,o=this.buildProps(i,a);return{...Object.fromEntries(Object.entries(r).map(([c,u])=>[c,(...d)=>u(...d)({...o,dispatch:void 0})])),chain:()=>this.createChain(i,a)}}buildProps(e,r=!0){const{rawCommands:n,editor:a,state:i}=this,{view:o}=a,l={tr:e,editor:a,view:o,state:yj({state:i,transaction:e}),dispatch:r?()=>{}:void 0,chain:()=>this.createChain(e,r),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(n).map(([c,u])=>[c,(...d)=>u(...d)(l)]))}};return l}}class E_e{constructor(){this.callbacks={}}on(e,r){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(r),this}emit(e,...r){const n=this.callbacks[e];return n&&n.forEach(a=>a.apply(this,r)),this}off(e,r){const n=this.callbacks[e];return n&&(r?this.callbacks[e]=n.filter(a=>a!==r):delete this.callbacks[e]),this}once(e,r){const n=(...a)=>{this.off(e,n),r.apply(this,a)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}}function pr(t,e,r){return t.config[e]===void 0&&t.parent?pr(t.parent,e,r):typeof t.config[e]=="function"?t.config[e].bind({...r,parent:t.parent?pr(t.parent,e,r):null}):t.config[e]}function vj(t){const e=t.filter(a=>a.type==="extension"),r=t.filter(a=>a.type==="node"),n=t.filter(a=>a.type==="mark");return{baseExtensions:e,nodeExtensions:r,markExtensions:n}}function fU(t){const e=[],{nodeExtensions:r,markExtensions:n}=vj(t),a=[...r,...n],i={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return t.forEach(o=>{const l={name:o.name,options:o.options,storage:o.storage,extensions:a},c=pr(o,"addGlobalAttributes",l);if(!c)return;c().forEach(d=>{d.types.forEach(h=>{Object.entries(d.attributes).forEach(([f,m])=>{e.push({type:h,name:f,attribute:{...i,...m}})})})})}),a.forEach(o=>{const l={name:o.name,options:o.options,storage:o.storage},c=pr(o,"addAttributes",l);if(!c)return;const u=c();Object.entries(u).forEach(([d,h])=>{const f={...i,...h};typeof(f==null?void 0:f.default)=="function"&&(f.default=f.default()),f!=null&&f.isRequired&&(f==null?void 0:f.default)===void 0&&delete f.default,e.push({type:o.name,name:d,attribute:f})})}),e}function oi(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}function Ni(...t){return t.filter(e=>!!e).reduce((e,r)=>{const n={...e};return Object.entries(r).forEach(([a,i])=>{if(!n[a]){n[a]=i;return}if(a==="class"){const l=i?String(i).split(" "):[],c=n[a]?n[a].split(" "):[],u=l.filter(d=>!c.includes(d));n[a]=[...c,...u].join(" ")}else if(a==="style"){const l=i?i.split(";").map(d=>d.trim()).filter(Boolean):[],c=n[a]?n[a].split(";").map(d=>d.trim()).filter(Boolean):[],u=new Map;c.forEach(d=>{const[h,f]=d.split(":").map(m=>m.trim());u.set(h,f)}),l.forEach(d=>{const[h,f]=d.split(":").map(m=>m.trim());u.set(h,f)}),n[a]=Array.from(u.entries()).map(([d,h])=>`${d}: ${h}`).join("; ")}else n[a]=i}),n},{})}function QS(t,e){return e.filter(r=>r.type===t.type.name).filter(r=>r.attribute.rendered).map(r=>r.attribute.renderHTML?r.attribute.renderHTML(t.attrs)||{}:{[r.name]:t.attrs[r.name]}).reduce((r,n)=>Ni(r,n),{})}function pU(t){return typeof t=="function"}function xs(t,e=void 0,...r){return pU(t)?e?t.bind(e)(...r):t(...r):t}function A_e(t={}){return Object.keys(t).length===0&&t.constructor===Object}function D_e(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function $T(t,e){return"style"in t?t:{...t,getAttrs:r=>{const n=t.getAttrs?t.getAttrs(r):t.attrs;if(n===!1)return!1;const a=e.reduce((i,o)=>{const l=o.attribute.parseHTML?o.attribute.parseHTML(r):D_e(r.getAttribute(o.name));return l==null?i:{...i,[o.name]:l}},{});return{...n,...a}}}}function WT(t){return Object.fromEntries(Object.entries(t).filter(([e,r])=>e==="attrs"&&A_e(r)?!1:r!=null))}function T_e(t,e){var r;const n=fU(t),{nodeExtensions:a,markExtensions:i}=vj(t),o=(r=a.find(u=>pr(u,"topNode")))===null||r===void 0?void 0:r.name,l=Object.fromEntries(a.map(u=>{const d=n.filter(w=>w.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:e},f=t.reduce((w,j)=>{const N=pr(j,"extendNodeSchema",h);return{...w,...N?N(u):{}}},{}),m=WT({...f,content:xs(pr(u,"content",h)),marks:xs(pr(u,"marks",h)),group:xs(pr(u,"group",h)),inline:xs(pr(u,"inline",h)),atom:xs(pr(u,"atom",h)),selectable:xs(pr(u,"selectable",h)),draggable:xs(pr(u,"draggable",h)),code:xs(pr(u,"code",h)),whitespace:xs(pr(u,"whitespace",h)),linebreakReplacement:xs(pr(u,"linebreakReplacement",h)),defining:xs(pr(u,"defining",h)),isolating:xs(pr(u,"isolating",h)),attrs:Object.fromEntries(d.map(w=>{var j;return[w.name,{default:(j=w==null?void 0:w.attribute)===null||j===void 0?void 0:j.default}]}))}),g=xs(pr(u,"parseHTML",h));g&&(m.parseDOM=g.map(w=>$T(w,d)));const y=pr(u,"renderHTML",h);y&&(m.toDOM=w=>y({node:w,HTMLAttributes:QS(w,d)}));const b=pr(u,"renderText",h);return b&&(m.toText=b),[u.name,m]})),c=Object.fromEntries(i.map(u=>{const d=n.filter(b=>b.type===u.name),h={name:u.name,options:u.options,storage:u.storage,editor:e},f=t.reduce((b,w)=>{const j=pr(w,"extendMarkSchema",h);return{...b,...j?j(u):{}}},{}),m=WT({...f,inclusive:xs(pr(u,"inclusive",h)),excludes:xs(pr(u,"excludes",h)),group:xs(pr(u,"group",h)),spanning:xs(pr(u,"spanning",h)),code:xs(pr(u,"code",h)),attrs:Object.fromEntries(d.map(b=>{var w;return[b.name,{default:(w=b==null?void 0:b.attribute)===null||w===void 0?void 0:w.default}]}))}),g=xs(pr(u,"parseHTML",h));g&&(m.parseDOM=g.map(b=>$T(b,d)));const y=pr(u,"renderHTML",h);return y&&(m.toDOM=b=>y({mark:b,HTMLAttributes:QS(b,d)})),[u.name,m]}));return new rz({topNode:o,nodes:l,marks:c})}function KN(t,e){return e.nodes[t]||e.marks[t]||null}function qT(t,e){return Array.isArray(e)?e.some(r=>(typeof r=="string"?r:r.name)===t.name):e}function I_(t,e){const r=jp.fromSchema(e).serializeFragment(t),a=document.implementation.createHTMLDocument().createElement("div");return a.appendChild(r),a.innerHTML}const M_e=(t,e=500)=>{let r="";const n=t.parentOffset;return t.parent.nodesBetween(Math.max(0,n-e),n,(a,i,o,l)=>{var c,u;const d=((u=(c=a.type.spec).toText)===null||u===void 0?void 0:u.call(c,{node:a,pos:i,parent:o,index:l}))||a.textContent||"%leaf%";r+=a.isAtom&&!a.isText?d:d.slice(0,Math.max(0,n-i))}),r};function O_(t){return Object.prototype.toString.call(t)==="[object RegExp]"}class wj{constructor(e){this.find=e.find,this.handler=e.handler}}const P_e=(t,e)=>{if(O_(e))return e.exec(t);const r=e(t);if(!r)return null;const n=[r.text];return n.index=r.index,n.input=t,n.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),n.push(r.replaceWith)),n};function Rv(t){var e;const{editor:r,from:n,to:a,text:i,rules:o,plugin:l}=t,{view:c}=r;if(c.composing)return!1;const u=c.state.doc.resolve(n);if(u.parent.type.spec.code||!((e=u.nodeBefore||u.nodeAfter)===null||e===void 0)&&e.marks.find(f=>f.type.spec.code))return!1;let d=!1;const h=M_e(u)+i;return o.forEach(f=>{if(d)return;const m=P_e(h,f.find);if(!m)return;const g=c.state.tr,y=yj({state:c.state,transaction:g}),b={from:n-(m[0].length-i.length),to:a},{commands:w,chain:j,can:N}=new bj({editor:r,state:y});f.handler({state:y,range:b,match:m,commands:w,chain:j,can:N})===null||!g.steps.length||(g.setMeta(l,{transform:g,from:n,to:a,text:i}),c.dispatch(g),d=!0)}),d}function R_e(t){const{editor:e,rules:r}=t,n=new fo({state:{init(){return null},apply(a,i,o){const l=a.getMeta(n);if(l)return l;const c=a.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:d}=c;typeof d=="string"?d=d:d=I_(Nt.from(d),o.schema);const{from:h}=c,f=h+d.length;Rv({editor:e,from:h,to:f,text:d,rules:r,plugin:n})}),a.selectionSet||a.docChanged?null:i}},props:{handleTextInput(a,i,o,l){return Rv({editor:e,from:i,to:o,text:l,rules:r,plugin:n})},handleDOMEvents:{compositionend:a=>(setTimeout(()=>{const{$cursor:i}=a.state.selection;i&&Rv({editor:e,from:i.pos,to:i.pos,text:"",rules:r,plugin:n})}),!1)},handleKeyDown(a,i){if(i.key!=="Enter")return!1;const{$cursor:o}=a.state.selection;return o?Rv({editor:e,from:o.pos,to:o.pos,text:` 1209`,rules:r,plugin:n}):!1}},isInputRules:!0});return n}function B_e(t){return Object.prototype.toString.call(t).slice(8,-1)}function Bv(t){return B_e(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function jj(t,e){const r={...t};return Bv(t)&&Bv(e)&&Object.keys(e).forEach(n=>{Bv(e[n])&&Bv(t[n])?r[n]=jj(t[n],e[n]):r[n]=e[n]}),r}class Ed{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=xs(pr(this,"addOptions",{name:this.name}))),this.storage=xs(pr(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Ed(e)}configure(e={}){const r=this.extend({...this.config,addOptions:()=>jj(this.options,e)});return r.name=this.name,r.parent=this.parent,r}extend(e={}){const r=new Ed(e);return r.parent=this,this.child=r,r.name=e.name?e.name:r.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${r.name}".`),r.options=xs(pr(r,"addOptions",{name:r.name})),r.storage=xs(pr(r,"addStorage",{name:r.name,options:r.options})),r}static handleExit({editor:e,mark:r}){const{tr:n}=e.state,a=e.state.selection.$from;if(a.pos===a.end()){const o=a.marks();if(!!!o.find(u=>(u==null?void 0:u.type.name)===r.name))return!1;const c=o.find(u=>(u==null?void 0:u.type.name)===r.name);return c&&n.removeStoredMark(c),n.insertText(" ",a.pos),e.view.dispatch(n),!0}return!1}}function L_e(t){return typeof t=="number"}class I_e{constructor(e){this.find=e.find,this.handler=e.handler}}const O_e=(t,e,r)=>{if(O_(e))return[...t.matchAll(e)];const n=e(t,r);return n?n.map(a=>{const i=[a.text];return i.index=a.index,i.input=t,i.data=a.data,a.replaceWith&&(a.text.includes(a.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(a.replaceWith)),i}):[]};function z_e(t){const{editor:e,state:r,from:n,to:a,rule:i,pasteEvent:o,dropEvent:l}=t,{commands:c,chain:u,can:d}=new bj({editor:e,state:r}),h=[];return r.doc.nodesBetween(n,a,(m,g)=>{if(!m.isTextblock||m.type.spec.code)return;const y=Math.max(n,g),b=Math.min(a,g+m.content.size),w=m.textBetween(y-g,b-g,void 0,"");O_e(w,i.find,o).forEach(N=>{if(N.index===void 0)return;const S=y+N.index+1,E=S+N[0].length,C={from:r.tr.mapping.map(S),to:r.tr.mapping.map(E)},T=i.handler({state:r,range:C,match:N,commands:c,chain:u,can:d,pasteEvent:o,dropEvent:l});h.push(T)})}),h.every(m=>m!==null)}let Lv=null;const U_e=t=>{var e;const r=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=r.clipboardData)===null||e===void 0||e.setData("text/html",t),r};function H_e(t){const{editor:e,rules:r}=t;let n=null,a=!1,i=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const c=({state:d,from:h,to:f,rule:m,pasteEvt:g})=>{const y=d.tr,b=yj({state:d,transaction:y});if(!(!z_e({editor:e,state:b,from:Math.max(h-1,0),to:f.b-1,rule:m,pasteEvent:g,dropEvent:l})||!y.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,y}};return r.map(d=>new fo({view(h){const f=g=>{var y;n=!((y=h.dom.parentElement)===null||y===void 0)&&y.contains(g.target)?h.dom.parentElement:null,n&&(Lv=e)},m=()=>{Lv&&(Lv=null)};return window.addEventListener("dragstart",f),window.addEventListener("dragend",m),{destroy(){window.removeEventListener("dragstart",f),window.removeEventListener("dragend",m)}}},props:{handleDOMEvents:{drop:(h,f)=>{if(i=n===h.dom.parentElement,l=f,!i){const m=Lv;m!=null&&m.isEditable&&setTimeout(()=>{const g=m.state.selection;g&&m.commands.deleteRange({from:g.from,to:g.to})},10)}return!1},paste:(h,f)=>{var m;const g=(m=f.clipboardData)===null||m===void 0?void 0:m.getData("text/html");return o=f,a=!!(g!=null&&g.includes("data-pm-slice")),!1}}},appendTransaction:(h,f,m)=>{const g=h[0],y=g.getMeta("uiEvent")==="paste"&&!a,b=g.getMeta("uiEvent")==="drop"&&!i,w=g.getMeta("applyPasteRules"),j=!!w;if(!y&&!b&&!j)return;if(j){let{text:E}=w;typeof E=="string"?E=E:E=I_(Nt.from(E),m.schema);const{from:C}=w,T=C+E.length,D=U_e(E);return c({rule:d,state:m,from:C,to:{b:T},pasteEvt:D})}const N=f.doc.content.findDiffStart(m.doc.content),S=f.doc.content.findDiffEnd(m.doc.content);if(!(!L_e(N)||!S||N===S.b))return c({rule:d,state:m,from:N,to:S,pasteEvt:o})}}))}function $_e(t){const e=t.filter((r,n)=>t.indexOf(r)!==n);return Array.from(new Set(e))}class jg{constructor(e,r){this.splittableMarks=[],this.editor=r,this.extensions=jg.resolve(e),this.schema=T_e(this.extensions,r),this.setupExtensions()}static resolve(e){const r=jg.sort(jg.flatten(e)),n=$_e(r.map(a=>a.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(a=>`'${a}'`).join(", ")}]. This can lead to issues.`),r}static flatten(e){return e.map(r=>{const n={name:r.name,options:r.options,storage:r.storage},a=pr(r,"addExtensions",n);return a?[r,...this.flatten(a())]:r}).flat(10)}static sort(e){return e.sort((n,a)=>{const i=pr(n,"priority")||100,o=pr(a,"priority")||100;return i>o?-1:i<o?1:0})}get commands(){return this.extensions.reduce((e,r)=>{const n={name:r.name,options:r.options,storage:r.storage,editor:this.editor,type:KN(r.name,this.schema)},a=pr(r,"addCommands",n);return a?{...e,...a()}:e},{})}get plugins(){const{editor:e}=this,r=jg.sort([...this.extensions].reverse()),n=[],a=[],i=r.map(o=>{const l={name:o.name,options:o.options,storage:o.storage,editor:e,type:KN(o.name,this.schema)},c=[],u=pr(o,"addKeyboardShortcuts",l);let d={};if(o.type==="mark"&&pr(o,"exitable",l)&&(d.ArrowRight=()=>Ed.handleExit({editor:e,mark:o})),u){const y=Object.fromEntries(Object.entries(u()).map(([b,w])=>[b,()=>w({editor:e})]));d={...d,...y}}const h=l_e(d);c.push(h);const f=pr(o,"addInputRules",l);qT(o,e.options.enableInputRules)&&f&&n.push(...f());const m=pr(o,"addPasteRules",l);qT(o,e.options.enablePasteRules)&&m&&a.push(...m());const g=pr(o,"addProseMirrorPlugins",l);if(g){const y=g();c.push(...y)}return c}).flat();return[R_e({editor:e,rules:n}),...H_e({editor:e,rules:a}),...i]}get attributes(){return fU(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:r}=vj(this.extensions);return Object.fromEntries(r.filter(n=>!!pr(n,"addNodeView")).map(n=>{const a=this.attributes.filter(c=>c.type===n.name),i={name:n.name,options:n.options,storage:n.storage,editor:e,type:oi(n.name,this.schema)},o=pr(n,"addNodeView",i);if(!o)return[];const l=(c,u,d,h,f)=>{const m=QS(c,a);return o()({node:c,view:u,getPos:d,decorations:h,innerDecorations:f,editor:e,extension:n,HTMLAttributes:m})};return[n.name,l]}))}setupExtensions(){this.extensions.forEach(e=>{var r;this.editor.extensionStorage[e.name]=e.storage;const n={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:KN(e.name,this.schema)};e.type==="mark"&&(!((r=xs(pr(e,"keepOnSplit",n)))!==null&&r!==void 0)||r)&&this.splittableMarks.push(e.name);const a=pr(e,"onBeforeCreate",n),i=pr(e,"onCreate",n),o=pr(e,"onUpdate",n),l=pr(e,"onSelectionUpdate",n),c=pr(e,"onTransaction",n),u=pr(e,"onFocus",n),d=pr(e,"onBlur",n),h=pr(e,"onDestroy",n);a&&this.editor.on("beforeCreate",a),i&&this.editor.on("create",i),o&&this.editor.on("update",o),l&&this.editor.on("selectionUpdate",l),c&&this.editor.on("transaction",c),u&&this.editor.on("focus",u),d&&this.editor.on("blur",d),h&&this.editor.on("destroy",h)})}}class $i{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=xs(pr(this,"addOptions",{name:this.name}))),this.storage=xs(pr(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new $i(e)}configure(e={}){const r=this.extend({...this.config,addOptions:()=>jj(this.options,e)});return r.name=this.name,r.parent=this.parent,r}extend(e={}){const r=new $i({...this.config,...e});return r.parent=this,this.child=r,r.name=e.name?e.name:r.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${r.name}".`),r.options=xs(pr(r,"addOptions",{name:r.name})),r.storage=xs(pr(r,"addStorage",{name:r.name,options:r.options})),r}}function gU(t,e,r){const{from:n,to:a}=e,{blockSeparator:i=` 1210 1211`,textSerializers:o={}}=r||{};let l="";return t.nodesBetween(n,a,(c,u,d,h)=>{var f;c.isBlock&&u>n&&(l+=i);const m=o==null?void 0:o[c.type.name];if(m)return d&&(l+=m({node:c,pos:u,parent:d,index:h,range:e})),!1;c.isText&&(l+=(f=c==null?void 0:c.text)===null||f===void 0?void 0:f.slice(Math.max(n,u)-u,a-u))}),l}function xU(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,r])=>[e,r.spec.toText]))}const W_e=$i.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new fo({key:new qc("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:r}=t,{doc:n,selection:a}=e,{ranges:i}=a,o=Math.min(...i.map(d=>d.$from.pos)),l=Math.max(...i.map(d=>d.$to.pos)),c=xU(r);return gU(n,{from:o,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),q_e=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var r;t.isDestroyed||(e.dom.blur(),(r=window==null?void 0:window.getSelection())===null||r===void 0||r.removeAllRanges())}),!0),G_e=(t=!1)=>({commands:e})=>e.setContent("",t),V_e=()=>({state:t,tr:e,dispatch:r})=>{const{selection:n}=e,{ranges:a}=n;return r&&a.forEach(({$from:i,$to:o})=>{t.doc.nodesBetween(i.pos,o.pos,(l,c)=>{if(l.type.isText)return;const{doc:u,mapping:d}=e,h=u.resolve(d.map(c)),f=u.resolve(d.map(c+l.nodeSize)),m=h.blockRange(f);if(!m)return;const g=zx(m);if(l.type.isTextblock){const{defaultType:y}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(m.start,y)}(g||g===0)&&e.lift(m,g)})}),!0},K_e=t=>e=>t(e),J_e=()=>({state:t,dispatch:e})=>uU(t,e),Y_e=(t,e)=>({editor:r,tr:n})=>{const{state:a}=r,i=a.doc.slice(t.from,t.to);n.deleteRange(t.from,t.to);const o=n.mapping.map(e);return n.insert(o,i.content),n.setSelection(new Vr(n.doc.resolve(Math.max(o-1,0)))),!0},Z_e=()=>({tr:t,dispatch:e})=>{const{selection:r}=t,n=r.$anchor.node();if(n.content.size>0)return!1;const a=t.selection.$anchor;for(let i=a.depth;i>0;i-=1)if(a.node(i).type===n.type){if(e){const l=a.before(i),c=a.after(i);t.delete(l,c).scrollIntoView()}return!0}return!1},X_e=t=>({tr:e,state:r,dispatch:n})=>{const a=oi(t,r.schema),i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===a){if(n){const c=i.before(o),u=i.after(o);e.delete(c,u).scrollIntoView()}return!0}return!1},Q_e=t=>({tr:e,dispatch:r})=>{const{from:n,to:a}=t;return r&&e.delete(n,a),!0},e4e=()=>({state:t,dispatch:e})=>M_(t,e),t4e=()=>({commands:t})=>t.keyboardShortcut("Enter"),r4e=()=>({state:t,dispatch:e})=>f_e(t,e);function iw(t,e,r={strict:!0}){const n=Object.keys(e);return n.length?n.every(a=>r.strict?e[a]===t[a]:O_(e[a])?e[a].test(t[a]):e[a]===t[a]):!0}function yU(t,e,r={}){return t.find(n=>n.type===e&&iw(Object.fromEntries(Object.keys(r).map(a=>[a,n.attrs[a]])),r))}function GT(t,e,r={}){return!!yU(t,e,r)}function z_(t,e,r){var n;if(!t||!e)return;let a=t.parent.childAfter(t.parentOffset);if((!a.node||!a.node.marks.some(d=>d.type===e))&&(a=t.parent.childBefore(t.parentOffset)),!a.node||!a.node.marks.some(d=>d.type===e)||(r=r||((n=a.node.marks[0])===null||n===void 0?void 0:n.attrs),!yU([...a.node.marks],e,r)))return;let o=a.index,l=t.start()+a.offset,c=o+1,u=l+a.node.nodeSize;for(;o>0&>([...t.parent.child(o-1).marks],e,r);)o-=1,l-=t.parent.child(o).nodeSize;for(;c<t.parent.childCount&>([...t.parent.child(c).marks],e,r);)u+=t.parent.child(c).nodeSize,c+=1;return{from:l,to:u}}function ym(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}const s4e=(t,e={})=>({tr:r,state:n,dispatch:a})=>{const i=ym(t,n.schema),{doc:o,selection:l}=r,{$from:c,from:u,to:d}=l;if(a){const h=z_(c,i,e);if(h&&h.from<=u&&h.to>=d){const f=Vr.create(o,h.from,h.to);r.setSelection(f)}}return!0},n4e=t=>e=>{const r=typeof t=="function"?t(e):t;for(let n=0;n<r.length;n+=1)if(r[n](e))return!0;return!1};function bU(t){return t instanceof Vr}function jf(t=0,e=0,r=0){return Math.min(Math.max(t,e),r)}function vU(t,e=null){if(!e)return null;const r=ms.atStart(t),n=ms.atEnd(t);if(e==="start"||e===!0)return r;if(e==="end")return n;const a=r.from,i=n.to;return e==="all"?Vr.create(t,jf(0,a,i),jf(t.content.size,a,i)):Vr.create(t,jf(e,a,i),jf(e,a,i))}function VT(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function ow(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function a4e(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}const i4e=(t=null,e={})=>({editor:r,view:n,tr:a,dispatch:i})=>{e={scrollIntoView:!0,...e};const o=()=>{(ow()||VT())&&n.dom.focus(),requestAnimationFrame(()=>{r.isDestroyed||(n.focus(),a4e()&&!ow()&&!VT()&&n.dom.focus({preventScroll:!0}))})};if(n.hasFocus()&&t===null||t===!1)return!0;if(i&&t===null&&!bU(r.state.selection))return o(),!0;const l=vU(a.doc,t)||r.state.selection,c=r.state.selection.eq(l);return i&&(c||a.setSelection(l),c&&a.storedMarks&&a.setStoredMarks(a.storedMarks),o()),!0},o4e=(t,e)=>r=>t.every((n,a)=>e(n,{...r,index:a})),l4e=(t,e)=>({tr:r,commands:n})=>n.insertContentAt({from:r.selection.from,to:r.selection.to},t,e),wU=t=>{const e=t.childNodes;for(let r=e.length-1;r>=0;r-=1){const n=e[r];n.nodeType===3&&n.nodeValue&&/^(\n\s\s|\n)$/.test(n.nodeValue)?t.removeChild(n):n.nodeType===1&&wU(n)}return t};function Iv(t){const e=`<body>${t}</body>`,r=new window.DOMParser().parseFromString(e,"text/html").body;return wU(r)}function _0(t,e,r){if(t instanceof Zh||t instanceof Nt)return t;r={slice:!0,parseOptions:{},...r};const n=typeof t=="object"&&t!==null,a=typeof t=="string";if(n)try{if(Array.isArray(t)&&t.length>0)return Nt.fromArray(t.map(l=>e.nodeFromJSON(l)));const o=e.nodeFromJSON(t);return r.errorOnInvalidContent&&o.check(),o}catch(i){if(r.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),_0("",e,r)}if(a){if(r.errorOnInvalidContent){let o=!1,l="";const c=new rz({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(o=!0,l=typeof u=="string"?u:u.outerHTML,null)}]}})});if(r.slice?Xh.fromSchema(c).parseSlice(Iv(t),r.parseOptions):Xh.fromSchema(c).parse(Iv(t),r.parseOptions),r.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const i=Xh.fromSchema(e);return r.slice?i.parseSlice(Iv(t),r.parseOptions).content:i.parse(Iv(t),r.parseOptions)}return _0("",e,r)}function c4e(t,e,r){const n=t.steps.length-1;if(n<e)return;const a=t.steps[n];if(!(a instanceof ei||a instanceof si))return;const i=t.mapping.maps[n];let o=0;i.forEach((l,c,u,d)=>{o===0&&(o=d)}),t.setSelection(ms.near(t.doc.resolve(o),r))}const u4e=t=>!("type"in t),d4e=(t,e,r)=>({tr:n,dispatch:a,editor:i})=>{var o;if(a){r={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...r};let l;const c=b=>{i.emit("contentError",{editor:i,error:b,disableCollaboration:()=>{i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...r.parseOptions};if(!r.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{_0(e,i.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(b){c(b)}try{l=_0(e,i.schema,{parseOptions:u,errorOnInvalidContent:(o=r.errorOnInvalidContent)!==null&&o!==void 0?o:i.options.enableContentCheck})}catch(b){return c(b),!1}let{from:d,to:h}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},f=!0,m=!0;if((u4e(l)?l:[l]).forEach(b=>{b.check(),f=f?b.isText&&b.marks.length===0:!1,m=m?b.isBlock:!1}),d===h&&m){const{parent:b}=n.doc.resolve(d);b.isTextblock&&!b.type.spec.code&&!b.childCount&&(d-=1,h+=1)}let y;if(f){if(Array.isArray(e))y=e.map(b=>b.text||"").join("");else if(e instanceof Nt){let b="";e.forEach(w=>{w.text&&(b+=w.text)}),y=b}else typeof e=="object"&&e&&e.text?y=e.text:y=e;n.insertText(y,d,h)}else y=l,n.replaceWith(d,h,y);r.updateSelection&&c4e(n,n.steps.length-1,-1),r.applyInputRules&&n.setMeta("applyInputRules",{from:d,text:y}),r.applyPasteRules&&n.setMeta("applyPasteRules",{from:d,text:y})}return!0},h4e=()=>({state:t,dispatch:e})=>d_e(t,e),m4e=()=>({state:t,dispatch:e})=>h_e(t,e),f4e=()=>({state:t,dispatch:e})=>sU(t,e),p4e=()=>({state:t,dispatch:e})=>oU(t,e),g4e=()=>({state:t,dispatch:e,tr:r})=>{try{const n=hj(t.doc,t.selection.$from.pos,-1);return n==null?!1:(r.join(n,2),e&&e(r),!0)}catch{return!1}},x4e=()=>({state:t,dispatch:e,tr:r})=>{try{const n=hj(t.doc,t.selection.$from.pos,1);return n==null?!1:(r.join(n,2),e&&e(r),!0)}catch{return!1}},y4e=()=>({state:t,dispatch:e})=>c_e(t,e),b4e=()=>({state:t,dispatch:e})=>u_e(t,e);function jU(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function v4e(t){const e=t.split(/-(?!$)/);let r=e[e.length-1];r==="Space"&&(r=" ");let n,a,i,o;for(let l=0;l<e.length-1;l+=1){const c=e[l];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))n=!0;else if(/^(c|ctrl|control)$/i.test(c))a=!0;else if(/^s(hift)?$/i.test(c))i=!0;else if(/^mod$/i.test(c))ow()||jU()?o=!0:a=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return n&&(r=`Alt-${r}`),a&&(r=`Ctrl-${r}`),o&&(r=`Meta-${r}`),i&&(r=`Shift-${r}`),r}const w4e=t=>({editor:e,view:r,tr:n,dispatch:a})=>{const i=v4e(t).split(/-(?!$)/),o=i.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{r.someProp("handleKeyDown",u=>u(r,l))});return c==null||c.steps.forEach(u=>{const d=u.map(n.mapping);d&&a&&n.maybeStep(d)}),!0};function E0(t,e,r={}){const{from:n,to:a,empty:i}=t.selection,o=e?oi(e,t.schema):null,l=[];t.doc.nodesBetween(n,a,(h,f)=>{if(h.isText)return;const m=Math.max(n,f),g=Math.min(a,f+h.nodeSize);l.push({node:h,from:m,to:g})});const c=a-n,u=l.filter(h=>o?o.name===h.node.type.name:!0).filter(h=>iw(h.node.attrs,r,{strict:!1}));return i?!!u.length:u.reduce((h,f)=>h+f.to-f.from,0)>=c}const j4e=(t,e={})=>({state:r,dispatch:n})=>{const a=oi(t,r.schema);return E0(r,a,e)?m_e(r,n):!1},N4e=()=>({state:t,dispatch:e})=>dU(t,e),F4e=t=>({state:e,dispatch:r})=>{const n=oi(t,e.schema);return S_e(n)(e,r)},S4e=()=>({state:t,dispatch:e})=>cU(t,e);function Nj(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function KT(t,e){const r=typeof e=="string"?[e]:e;return Object.keys(t).reduce((n,a)=>(r.includes(a)||(n[a]=t[a]),n),{})}const C4e=(t,e)=>({tr:r,state:n,dispatch:a})=>{let i=null,o=null;const l=Nj(typeof t=="string"?t:t.name,n.schema);return l?(l==="node"&&(i=oi(t,n.schema)),l==="mark"&&(o=ym(t,n.schema)),a&&r.selection.ranges.forEach(c=>{n.doc.nodesBetween(c.$from.pos,c.$to.pos,(u,d)=>{i&&i===u.type&&r.setNodeMarkup(d,void 0,KT(u.attrs,e)),o&&u.marks.length&&u.marks.forEach(h=>{o===h.type&&r.addMark(d,d+u.nodeSize,o.create(KT(h.attrs,e)))})})}),!0):!1},k4e=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),_4e=()=>({tr:t,dispatch:e})=>{if(e){const r=new pl(t.doc);t.setSelection(r)}return!0},E4e=()=>({state:t,dispatch:e})=>aU(t,e),A4e=()=>({state:t,dispatch:e})=>lU(t,e),D4e=()=>({state:t,dispatch:e})=>x_e(t,e),T4e=()=>({state:t,dispatch:e})=>v_e(t,e),M4e=()=>({state:t,dispatch:e})=>b_e(t,e);function eC(t,e,r={},n={}){return _0(t,e,{slice:!1,parseOptions:r,errorOnInvalidContent:n.errorOnInvalidContent})}const P4e=(t,e=!1,r={},n={})=>({editor:a,tr:i,dispatch:o,commands:l})=>{var c,u;const{doc:d}=i;if(r.preserveWhitespace!=="full"){const h=eC(t,a.schema,r,{errorOnInvalidContent:(c=n.errorOnInvalidContent)!==null&&c!==void 0?c:a.options.enableContentCheck});return o&&i.replaceWith(0,d.content.size,h).setMeta("preventUpdate",!e),!0}return o&&i.setMeta("preventUpdate",!e),l.insertContentAt({from:0,to:d.content.size},t,{parseOptions:r,errorOnInvalidContent:(u=n.errorOnInvalidContent)!==null&&u!==void 0?u:a.options.enableContentCheck})};function NU(t,e){const r=ym(e,t.schema),{from:n,to:a,empty:i}=t.selection,o=[];i?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(n,a,c=>{o.push(...c.marks)});const l=o.find(c=>c.type.name===r.name);return l?{...l.attrs}:{}}function R4e(t){for(let e=0;e<t.edgeCount;e+=1){const{type:r}=t.edge(e);if(r.isTextblock&&!r.hasRequiredAttrs())return r}return null}function B4e(t,e){for(let r=t.depth;r>0;r-=1){const n=t.node(r);if(e(n))return{pos:r>0?t.before(r):0,start:t.start(r),depth:r,node:n}}}function U_(t){return e=>B4e(e.$from,t)}function L4e(t,e){const r={from:0,to:t.content.size};return gU(t,r,e)}function I4e(t,e){const r=oi(e,t.schema),{from:n,to:a}=t.selection,i=[];t.doc.nodesBetween(n,a,l=>{i.push(l)});const o=i.reverse().find(l=>l.type.name===r.name);return o?{...o.attrs}:{}}function O4e(t,e){const r=Nj(typeof e=="string"?e:e.name,t.schema);return r==="node"?I4e(t,e):r==="mark"?NU(t,e):{}}function FU(t,e,r){const n=[];return t===e?r.resolve(t).marks().forEach(a=>{const i=r.resolve(t),o=z_(i,a.type);o&&n.push({mark:a,...o})}):r.nodesBetween(t,e,(a,i)=>{!a||(a==null?void 0:a.nodeSize)===void 0||n.push(...a.marks.map(o=>({from:i,to:i+a.nodeSize,mark:o})))}),n}function a1(t,e,r){return Object.fromEntries(Object.entries(r).filter(([n])=>{const a=t.find(i=>i.type===e&&i.name===n);return a?a.attribute.keepOnSplit:!1}))}function tC(t,e,r={}){const{empty:n,ranges:a}=t.selection,i=e?ym(e,t.schema):null;if(n)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>i?i.name===h.type.name:!0).find(h=>iw(h.attrs,r,{strict:!1}));let o=0;const l=[];if(a.forEach(({$from:h,$to:f})=>{const m=h.pos,g=f.pos;t.doc.nodesBetween(m,g,(y,b)=>{if(!y.isText&&!y.marks.length)return;const w=Math.max(m,b),j=Math.min(g,b+y.nodeSize),N=j-w;o+=N,l.push(...y.marks.map(S=>({mark:S,from:w,to:j})))})}),o===0)return!1;const c=l.filter(h=>i?i.name===h.mark.type.name:!0).filter(h=>iw(h.mark.attrs,r,{strict:!1})).reduce((h,f)=>h+f.to-f.from,0),u=l.filter(h=>i?h.mark.type!==i&&h.mark.type.excludes(i):!0).reduce((h,f)=>h+f.to-f.from,0);return(c>0?c+u:c)>=o}function z4e(t,e,r={}){if(!e)return E0(t,null,r)||tC(t,null,r);const n=Nj(e,t.schema);return n==="node"?E0(t,e,r):n==="mark"?tC(t,e,r):!1}function JT(t,e){const{nodeExtensions:r}=vj(e),n=r.find(o=>o.name===t);if(!n)return!1;const a={name:n.name,options:n.options,storage:n.storage},i=xs(pr(n,"group",a));return typeof i!="string"?!1:i.split(" ").includes("list")}function H_(t,{checkChildren:e=!0,ignoreWhitespace:r=!1}={}){var n;if(r){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((n=t.text)!==null&&n!==void 0?n:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let a=!0;return t.content.forEach(i=>{a!==!1&&(H_(i,{ignoreWhitespace:r,checkChildren:e})||(a=!1))}),a}return!1}function U4e(t){return t instanceof _r}function H4e(t,e,r){var n;const{selection:a}=e;let i=null;if(bU(a)&&(i=a.$cursor),i){const l=(n=t.storedMarks)!==null&&n!==void 0?n:i.marks();return!!r.isInSet(l)||!l.some(c=>c.type.excludes(r))}const{ranges:o}=a;return o.some(({$from:l,$to:c})=>{let u=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(r):!1;return t.doc.nodesBetween(l.pos,c.pos,(d,h,f)=>{if(u)return!1;if(d.isInline){const m=!f||f.type.allowsMarkType(r),g=!!r.isInSet(d.marks)||!d.marks.some(y=>y.type.excludes(r));u=m&&g}return!u}),u})}const $4e=(t,e={})=>({tr:r,state:n,dispatch:a})=>{const{selection:i}=r,{empty:o,ranges:l}=i,c=ym(t,n.schema);if(a)if(o){const u=NU(n,c);r.addStoredMark(c.create({...u,...e}))}else l.forEach(u=>{const d=u.$from.pos,h=u.$to.pos;n.doc.nodesBetween(d,h,(f,m)=>{const g=Math.max(m,d),y=Math.min(m+f.nodeSize,h);f.marks.find(w=>w.type===c)?f.marks.forEach(w=>{c===w.type&&r.addMark(g,y,c.create({...w.attrs,...e}))}):r.addMark(g,y,c.create(e))})});return H4e(n,r,c)},W4e=(t,e)=>({tr:r})=>(r.setMeta(t,e),!0),q4e=(t,e={})=>({state:r,dispatch:n,chain:a})=>{const i=oi(t,r.schema);let o;return r.selection.$anchor.sameParent(r.selection.$head)&&(o=r.selection.$anchor.parent.attrs),i.isTextblock?a().command(({commands:l})=>HT(i,{...o,...e})(r)?!0:l.clearNodes()).command(({state:l})=>HT(i,{...o,...e})(l,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},G4e=t=>({tr:e,dispatch:r})=>{if(r){const{doc:n}=e,a=jf(t,0,n.content.size),i=_r.create(n,a);e.setSelection(i)}return!0},V4e=t=>({tr:e,dispatch:r})=>{if(r){const{doc:n}=e,{from:a,to:i}=typeof t=="number"?{from:t,to:t}:t,o=Vr.atStart(n).from,l=Vr.atEnd(n).to,c=jf(a,o,l),u=jf(i,o,l),d=Vr.create(n,c,u);e.setSelection(d)}return!0},K4e=t=>({state:e,dispatch:r})=>{const n=oi(t,e.schema);return __e(n)(e,r)};function YT(t,e){const r=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(r){const n=r.filter(a=>e==null?void 0:e.includes(a.type.name));t.tr.ensureMarks(n)}}const J4e=({keepMarks:t=!0}={})=>({tr:e,state:r,dispatch:n,editor:a})=>{const{selection:i,doc:o}=e,{$from:l,$to:c}=i,u=a.extensionManager.attributes,d=a1(u,l.node().type.name,l.node().attrs);if(i instanceof _r&&i.node.isBlock)return!l.parentOffset||!bd(o,l.pos)?!1:(n&&(t&&YT(r,a.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const h=c.parentOffset===c.parent.content.size,f=l.depth===0?void 0:R4e(l.node(-1).contentMatchAt(l.indexAfter(-1)));let m=h&&f?[{type:f,attrs:d}]:void 0,g=bd(e.doc,e.mapping.map(l.pos),1,m);if(!m&&!g&&bd(e.doc,e.mapping.map(l.pos),1,f?[{type:f}]:void 0)&&(g=!0,m=f?[{type:f,attrs:d}]:void 0),n){if(g&&(i instanceof Vr&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,m),f&&!h&&!l.parentOffset&&l.parent.type!==f)){const y=e.mapping.map(l.before()),b=e.doc.resolve(y);l.node(-1).canReplaceWith(b.index(),b.index()+1,f)&&e.setNodeMarkup(e.mapping.map(l.before()),f)}t&&YT(r,a.extensionManager.splittableMarks),e.scrollIntoView()}return g},Y4e=(t,e={})=>({tr:r,state:n,dispatch:a,editor:i})=>{var o;const l=oi(t,n.schema),{$from:c,$to:u}=n.selection,d=n.selection.node;if(d&&d.isBlock||c.depth<2||!c.sameParent(u))return!1;const h=c.node(-1);if(h.type!==l)return!1;const f=i.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==l||c.index(-2)!==c.node(-2).childCount-1)return!1;if(a){let w=Nt.empty;const j=c.index(-1)?1:c.index(-2)?2:3;for(let D=c.depth-j;D>=c.depth-3;D-=1)w=Nt.from(c.node(D).copy(w));const N=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,S={...a1(f,c.node().type.name,c.node().attrs),...e},E=((o=l.contentMatch.defaultType)===null||o===void 0?void 0:o.createAndFill(S))||void 0;w=w.append(Nt.from(l.createAndFill(null,E)||void 0));const C=c.before(c.depth-(j-1));r.replace(C,c.after(-N),new ar(w,4-j,0));let T=-1;r.doc.nodesBetween(C,r.doc.content.size,(D,A)=>{if(T>-1)return!1;D.isTextblock&&D.content.size===0&&(T=A+1)}),T>-1&&r.setSelection(Vr.near(r.doc.resolve(T))),r.scrollIntoView()}return!0}const m=u.pos===c.end()?h.contentMatchAt(0).defaultType:null,g={...a1(f,h.type.name,h.attrs),...e},y={...a1(f,c.node().type.name,c.node().attrs),...e};r.delete(c.pos,u.pos);const b=m?[{type:l,attrs:g},{type:m,attrs:y}]:[{type:l,attrs:g}];if(!bd(r.doc,c.pos,2))return!1;if(a){const{selection:w,storedMarks:j}=n,{splittableMarks:N}=i.extensionManager,S=j||w.$to.parentOffset&&w.$from.marks();if(r.split(c.pos,2,b).scrollIntoView(),!S||!a)return!0;const E=S.filter(C=>N.includes(C.type.name));r.ensureMarks(E)}return!0},JN=(t,e)=>{const r=U_(o=>o.type===e)(t.selection);if(!r)return!0;const n=t.doc.resolve(Math.max(0,r.pos-1)).before(r.depth);if(n===void 0)return!0;const a=t.doc.nodeAt(n);return r.node.type===(a==null?void 0:a.type)&&gm(t.doc,r.pos)&&t.join(r.pos),!0},YN=(t,e)=>{const r=U_(o=>o.type===e)(t.selection);if(!r)return!0;const n=t.doc.resolve(r.start).after(r.depth);if(n===void 0)return!0;const a=t.doc.nodeAt(n);return r.node.type===(a==null?void 0:a.type)&&gm(t.doc,n)&&t.join(n),!0},Z4e=(t,e,r,n={})=>({editor:a,tr:i,state:o,dispatch:l,chain:c,commands:u,can:d})=>{const{extensions:h,splittableMarks:f}=a.extensionManager,m=oi(t,o.schema),g=oi(e,o.schema),{selection:y,storedMarks:b}=o,{$from:w,$to:j}=y,N=w.blockRange(j),S=b||y.$to.parentOffset&&y.$from.marks();if(!N)return!1;const E=U_(C=>JT(C.type.name,h))(y);if(N.depth>=1&&E&&N.depth-E.depth<=1){if(E.node.type===m)return u.liftListItem(g);if(JT(E.node.type.name,h)&&m.validContent(E.node.content)&&l)return c().command(()=>(i.setNodeMarkup(E.pos,m),!0)).command(()=>JN(i,m)).command(()=>YN(i,m)).run()}return!r||!S||!l?c().command(()=>d().wrapInList(m,n)?!0:u.clearNodes()).wrapInList(m,n).command(()=>JN(i,m)).command(()=>YN(i,m)).run():c().command(()=>{const C=d().wrapInList(m,n),T=S.filter(D=>f.includes(D.type.name));return i.ensureMarks(T),C?!0:u.clearNodes()}).wrapInList(m,n).command(()=>JN(i,m)).command(()=>YN(i,m)).run()},X4e=(t,e={},r={})=>({state:n,commands:a})=>{const{extendEmptyMarkRange:i=!1}=r,o=ym(t,n.schema);return tC(n,o,e)?a.unsetMark(o,{extendEmptyMarkRange:i}):a.setMark(o,e)},Q4e=(t,e,r={})=>({state:n,commands:a})=>{const i=oi(t,n.schema),o=oi(e,n.schema),l=E0(n,i,r);let c;return n.selection.$anchor.sameParent(n.selection.$head)&&(c=n.selection.$anchor.parent.attrs),l?a.setNode(o,c):a.setNode(i,{...c,...r})},eEe=(t,e={})=>({state:r,commands:n})=>{const a=oi(t,r.schema);return E0(r,a,e)?n.lift(a):n.wrapIn(a,e)},tEe=()=>({state:t,dispatch:e})=>{const r=t.plugins;for(let n=0;n<r.length;n+=1){const a=r[n];let i;if(a.spec.isInputRules&&(i=a.getState(t))){if(e){const o=t.tr,l=i.transform;for(let c=l.steps.length-1;c>=0;c-=1)o.step(l.steps[c].invert(l.docs[c]));if(i.text){const c=o.doc.resolve(i.from).marks();o.replaceWith(i.from,i.to,t.schema.text(i.text,c))}else o.delete(i.from,i.to)}return!0}}return!1},rEe=()=>({tr:t,dispatch:e})=>{const{selection:r}=t,{empty:n,ranges:a}=r;return n||e&&a.forEach(i=>{t.removeMark(i.$from.pos,i.$to.pos)}),!0},sEe=(t,e={})=>({tr:r,state:n,dispatch:a})=>{var i;const{extendEmptyMarkRange:o=!1}=e,{selection:l}=r,c=ym(t,n.schema),{$from:u,empty:d,ranges:h}=l;if(!a)return!0;if(d&&o){let{from:f,to:m}=l;const g=(i=u.marks().find(b=>b.type===c))===null||i===void 0?void 0:i.attrs,y=z_(u,c,g);y&&(f=y.from,m=y.to),r.removeMark(f,m,c)}else h.forEach(f=>{r.removeMark(f.$from.pos,f.$to.pos,c)});return r.removeStoredMark(c),!0},nEe=(t,e={})=>({tr:r,state:n,dispatch:a})=>{let i=null,o=null;const l=Nj(typeof t=="string"?t:t.name,n.schema);return l?(l==="node"&&(i=oi(t,n.schema)),l==="mark"&&(o=ym(t,n.schema)),a&&r.selection.ranges.forEach(c=>{const u=c.$from.pos,d=c.$to.pos;let h,f,m,g;r.selection.empty?n.doc.nodesBetween(u,d,(y,b)=>{i&&i===y.type&&(m=Math.max(b,u),g=Math.min(b+y.nodeSize,d),h=b,f=y)}):n.doc.nodesBetween(u,d,(y,b)=>{b<u&&i&&i===y.type&&(m=Math.max(b,u),g=Math.min(b+y.nodeSize,d),h=b,f=y),b>=u&&b<=d&&(i&&i===y.type&&r.setNodeMarkup(b,void 0,{...y.attrs,...e}),o&&y.marks.length&&y.marks.forEach(w=>{if(o===w.type){const j=Math.max(b,u),N=Math.min(b+y.nodeSize,d);r.addMark(j,N,o.create({...w.attrs,...e}))}}))}),f&&(h!==void 0&&r.setNodeMarkup(h,void 0,{...f.attrs,...e}),o&&f.marks.length&&f.marks.forEach(y=>{o===y.type&&r.addMark(m,g,o.create({...y.attrs,...e}))}))}),!0):!1},aEe=(t,e={})=>({state:r,dispatch:n})=>{const a=oi(t,r.schema);return w_e(a,e)(r,n)},iEe=(t,e={})=>({state:r,dispatch:n})=>{const a=oi(t,r.schema);return j_e(a,e)(r,n)};var oEe=Object.freeze({__proto__:null,blur:q_e,clearContent:G_e,clearNodes:V_e,command:K_e,createParagraphNear:J_e,cut:Y_e,deleteCurrentNode:Z_e,deleteNode:X_e,deleteRange:Q_e,deleteSelection:e4e,enter:t4e,exitCode:r4e,extendMarkRange:s4e,first:n4e,focus:i4e,forEach:o4e,insertContent:l4e,insertContentAt:d4e,joinBackward:f4e,joinDown:m4e,joinForward:p4e,joinItemBackward:g4e,joinItemForward:x4e,joinTextblockBackward:y4e,joinTextblockForward:b4e,joinUp:h4e,keyboardShortcut:w4e,lift:j4e,liftEmptyBlock:N4e,liftListItem:F4e,newlineInCode:S4e,resetAttributes:C4e,scrollIntoView:k4e,selectAll:_4e,selectNodeBackward:E4e,selectNodeForward:A4e,selectParentNode:D4e,selectTextblockEnd:T4e,selectTextblockStart:M4e,setContent:P4e,setMark:$4e,setMeta:W4e,setNode:q4e,setNodeSelection:G4e,setTextSelection:V4e,sinkListItem:K4e,splitBlock:J4e,splitListItem:Y4e,toggleList:Z4e,toggleMark:X4e,toggleNode:Q4e,toggleWrap:eEe,undoInputRule:tEe,unsetAllMarks:rEe,unsetMark:sEe,updateAttributes:nEe,wrapIn:aEe,wrapInList:iEe});const lEe=$i.create({name:"commands",addCommands(){return{...oEe}}}),cEe=$i.create({name:"drop",addProseMirrorPlugins(){return[new fo({key:new qc("tiptapDrop"),props:{handleDrop:(t,e,r,n)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:r,moved:n})}}})]}}),uEe=$i.create({name:"editable",addProseMirrorPlugins(){return[new fo({key:new qc("editable"),props:{editable:()=>this.editor.options.editable}})]}}),dEe=new qc("focusEvents"),hEe=$i.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new fo({key:dEe,props:{handleDOMEvents:{focus:(e,r)=>{t.isFocused=!0;const n=t.state.tr.setMeta("focus",{event:r}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,r)=>{t.isFocused=!1;const n=t.state.tr.setMeta("blur",{event:r}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}}),mEe=$i.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:c,doc:u}=l,{empty:d,$anchor:h}=c,{pos:f,parent:m}=h,g=h.parent.isTextblock&&f>0?l.doc.resolve(f-1):h,y=g.parent.type.spec.isolating,b=h.pos-h.parentOffset,w=y&&g.parent.childCount===1?b===h.pos:ms.atStart(u).from===f;return!d||!m.type.isTextblock||m.textContent.length||!w||w&&h.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},a={...n},i={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return ow()||jU()?i:a},addProseMirrorPlugins(){return[new fo({key:new qc("clearDocument"),appendTransaction:(t,e,r)=>{if(t.some(y=>y.getMeta("composition")))return;const n=t.some(y=>y.docChanged)&&!e.doc.eq(r.doc),a=t.some(y=>y.getMeta("preventClearDocument"));if(!n||a)return;const{empty:i,from:o,to:l}=e.selection,c=ms.atStart(e.doc).from,u=ms.atEnd(e.doc).to;if(i||!(o===c&&l===u)||!H_(r.doc))return;const f=r.tr,m=yj({state:r,transaction:f}),{commands:g}=new bj({editor:this.editor,state:m});if(g.clearNodes(),!!f.steps.length)return f}})]}}),fEe=$i.create({name:"paste",addProseMirrorPlugins(){return[new fo({key:new qc("tiptapPaste"),props:{handlePaste:(t,e,r)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:r})}}})]}}),pEe=$i.create({name:"tabindex",addProseMirrorPlugins(){return[new fo({key:new qc("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});class xf{get name(){return this.node.type.name}constructor(e,r,n=!1,a=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=r,this.currentNode=a}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!==null&&e!==void 0?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let r=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You canât set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}r=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:r,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),r=this.resolvedPos.doc.resolve(e);return new xf(r,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new xf(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new xf(e,this.editor)}get children(){const e=[];return this.node.content.forEach((r,n)=>{const a=r.isBlock&&!r.isTextblock,i=r.isAtom&&!r.isText,o=this.pos+n+(i?0:1);if(o<0||o>this.resolvedPos.doc.nodeSize-2)return;const l=this.resolvedPos.doc.resolve(o);if(!a&&l.depth<=this.depth)return;const c=new xf(l,this.editor,a,a?r:null);a&&(c.actualDepth=this.depth+1),e.push(new xf(l,this.editor,a,a?r:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,r={}){let n=null,a=this.parent;for(;a&&!n;){if(a.node.type.name===e)if(Object.keys(r).length>0){const i=a.node.attrs,o=Object.keys(r);for(let l=0;l<o.length;l+=1){const c=o[l];if(i[c]!==r[c])break}}else n=a;a=a.parent}return n}querySelector(e,r={}){return this.querySelectorAll(e,r,!0)[0]||null}querySelectorAll(e,r={},n=!1){let a=[];if(!this.children||this.children.length===0)return a;const i=Object.keys(r);return this.children.forEach(o=>{n&&a.length>0||(o.node.type.name===e&&i.every(c=>r[c]===o.node.attrs[c])&&a.push(o),!(n&&a.length>0)&&(a=a.concat(o.querySelectorAll(e,r,n))))}),a}setAttribute(e){const{tr:r}=this.editor.state;r.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(r)}}const gEe=`.ProseMirror { 1212 position: relative; 1213} 1214 1215.ProseMirror { 1216 word-wrap: break-word; 1217 white-space: pre-wrap; 1218 white-space: break-spaces; 1219 -webkit-font-variant-ligatures: none; 1220 font-variant-ligatures: none; 1221 font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ 1222} 1223 1224.ProseMirror [contenteditable="false"] { 1225 white-space: normal; 1226} 1227 1228.ProseMirror [contenteditable="false"] [contenteditable="true"] { 1229 white-space: pre-wrap; 1230} 1231 1232.ProseMirror pre { 1233 white-space: pre-wrap; 1234} 1235 1236img.ProseMirror-separator { 1237 display: inline !important; 1238 border: none !important; 1239 margin: 0 !important; 1240 width: 0 !important; 1241 height: 0 !important; 1242} 1243 1244.ProseMirror-gapcursor { 1245 display: none; 1246 pointer-events: none; 1247 position: absolute; 1248 margin: 0; 1249} 1250 1251.ProseMirror-gapcursor:after { 1252 content: ""; 1253 display: block; 1254 position: absolute; 1255 top: -2px; 1256 width: 20px; 1257 border-top: 1px solid black; 1258 animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; 1259} 1260 1261@keyframes ProseMirror-cursor-blink { 1262 to { 1263 visibility: hidden; 1264 } 1265} 1266 1267.ProseMirror-hideselection *::selection { 1268 background: transparent; 1269} 1270 1271.ProseMirror-hideselection *::-moz-selection { 1272 background: transparent; 1273} 1274 1275.ProseMirror-hideselection * { 1276 caret-color: transparent; 1277} 1278 1279.ProseMirror-focused .ProseMirror-gapcursor { 1280 display: block; 1281} 1282 1283.tippy-box[data-animation=fade][data-state=hidden] { 1284 opacity: 0 1285}`;function xEe(t,e,r){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const a=document.createElement("style");return e&&a.setAttribute("nonce",e),a.setAttribute("data-tiptap-style",""),a.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(a),a}class yEe extends E_e{constructor(e={}){super(),this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.options={element:document.createElement("div"),content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.createView(),this.injectCSS(),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:n,moved:a})=>this.options.onDrop(r,n,a)),this.on("paste",({event:r,slice:n})=>this.options.onPaste(r,n)),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&document&&(this.css=xEe(gEe,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.view||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(e,r=!0){this.setOptions({editable:e}),r&&this.emit("update",{editor:this,transaction:this.state.tr})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get state(){return this.view.state}registerPlugin(e,r){const n=pU(r)?r(e,[...this.state.plugins]):[...this.state.plugins,e],a=this.state.reconfigure({plugins:n});return this.view.updateState(a),a}unregisterPlugin(e){if(this.isDestroyed)return;const r=this.state.plugins;let n=r;if([].concat(e).forEach(i=>{const o=typeof i=="string"?`${i}$`:i.key;n=n.filter(l=>!l.key.startsWith(o))}),r.length===n.length)return;const a=this.state.reconfigure({plugins:n});return this.view.updateState(a),a}createExtensionManager(){var e,r;const a=[...this.options.enableCoreExtensions?[uEe,W_e.configure({blockSeparator:(r=(e=this.options.coreExtensionOptions)===null||e===void 0?void 0:e.clipboardTextSerializer)===null||r===void 0?void 0:r.blockSeparator}),lEe,hEe,mEe,pEe,cEe,fEe].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i==null?void 0:i.type));this.extensionManager=new jg(a,this)}createCommandManager(){this.commandManager=new bj({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createView(){var e;let r;try{r=eC(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(o){if(!(o instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(o.message))throw o;this.emit("contentError",{editor:this,error:o,disableCollaboration:()=>{this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(l=>l.name!=="collaboration"),this.createExtensionManager()}}),r=eC(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}const n=vU(r,this.options.autofocus);this.view=new eU(this.options.element,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:wg.create({doc:r,selection:n||void 0})});const a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.createNodeViews(),this.prependClass();const i=this.view.dom;i.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;const r=this.capturedTransaction;return this.capturedTransaction=null,r}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(o=>{var l;return(l=this.capturedTransaction)===null||l===void 0?void 0:l.step(o)});return}const r=this.state.apply(e),n=!this.state.selection.eq(r.selection);this.emit("beforeTransaction",{editor:this,transaction:e,nextState:r}),this.view.updateState(r),this.emit("transaction",{editor:this,transaction:e}),n&&this.emit("selectionUpdate",{editor:this,transaction:e});const a=e.getMeta("focus"),i=e.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:e}),i&&this.emit("blur",{editor:this,event:i.event,transaction:e}),!(!e.docChanged||e.getMeta("preventUpdate"))&&this.emit("update",{editor:this,transaction:e})}getAttributes(e){return O4e(this.state,e)}isActive(e,r){const n=typeof e=="string"?e:null,a=typeof e=="string"?r:e;return z4e(this.state,n,a)}getJSON(){return this.state.doc.toJSON()}getHTML(){return I_(this.state.doc.content,this.schema)}getText(e){const{blockSeparator:r=` 1286 1287`,textSerializers:n={}}=e||{};return L4e(this.state.doc,{blockSeparator:r,textSerializers:{...xU(this.schema),...n}})}get isEmpty(){return H_(this.state.doc)}getCharacterCount(){return console.warn('[tiptap warn]: "editor.getCharacterCount()" is deprecated. Please use "editor.storage.characterCount.characters()" instead.'),this.state.doc.
1287content.size-2}destroy(){if(this.emit("destroy"),this.view){const e=this.view.dom;e&&e.editor&&delete e.editor,this.view.destroy()}this.removeAllListeners()}get isDestroyed(){var e;return!(!((e=this.view)===null||e===void 0)&&e.docView)}$node(e,r){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelector(e,r))||null}$nodes(e,r){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelectorAll(e,r))||null}$pos(e){const r=this.state.doc.resolve(e);return new xf(r,this)}get $doc(){return this.$pos(0)}}function xx(t){return new wj({find:t.find,handler:({state:e,range:r,match:n})=>{const a=xs(t.getAttributes,void 0,n);if(a===!1||a===null)return null;const{tr:i}=e,o=n[n.length-1],l=n[0];if(o){const c=l.search(/\S/),u=r.from+l.indexOf(o),d=u+o.length;if(FU(r.from,r.to,e.doc).filter(m=>m.mark.type.excluded.find(y=>y===t.type&&y!==m.mark.type)).filter(m=>m.to>u).length)return null;d<r.to&&i.delete(d,r.to),u>r.from&&i.delete(r.from+c,u);const f=r.from+c+o.length;i.addMark(r.from+c,f,t.type.create(a||{})),i.removeStoredMark(t.type)}}})}function SU(t){return new wj({find:t.find,handler:({state:e,range:r,match:n})=>{const a=xs(t.getAttributes,void 0,n)||{},{tr:i}=e,o=r.from;let l=r.to;const c=t.type.create(a);if(n[1]){const u=n[0].lastIndexOf(n[1]);let d=o+u;d>l?d=l:l=d+n[1].length;const h=n[0][n[0].length-1];i.insertText(h,o+n[0].length-1),i.replaceWith(d,l,c)}else if(n[0]){const u=t.type.isInline?o:o-1;i.insert(u,t.type.create(a)).delete(i.mapping.map(o),i.mapping.map(l))}i.scrollIntoView()}})}function rC(t){return new wj({find:t.find,handler:({state:e,range:r,match:n})=>{const a=e.doc.resolve(r.from),i=xs(t.getAttributes,void 0,n)||{};if(!a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t.type))return null;e.tr.delete(r.from,r.to).setBlockType(r.from,r.from,t.type,i)}})}function A0(t){return new wj({find:t.find,handler:({state:e,range:r,match:n,chain:a})=>{const i=xs(t.getAttributes,void 0,n)||{},o=e.tr.delete(r.from,r.to),c=o.doc.resolve(r.from).blockRange(),u=c&&j_(c,t.type,i);if(!u)return null;if(o.wrap(c,u),t.keepMarks&&t.editor){const{selection:h,storedMarks:f}=e,{splittableMarks:m}=t.editor.extensionManager,g=f||h.$to.parentOffset&&h.$from.marks();if(g){const y=g.filter(b=>m.includes(b.type.name));o.ensureMarks(y)}}if(t.keepAttributes){const h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";a().updateAttributes(h,i).run()}const d=o.doc.resolve(r.from-1).nodeBefore;d&&d.type===t.type&&gm(o.doc,r.from-1)&&(!t.joinPredicate||t.joinPredicate(n,d))&&o.join(r.from-1)}})}let Xl=class sC{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=xs(pr(this,"addOptions",{name:this.name}))),this.storage=xs(pr(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new sC(e)}configure(e={}){const r=this.extend({...this.config,addOptions:()=>jj(this.options,e)});return r.name=this.name,r.parent=this.parent,r}extend(e={}){const r=new sC(e);return r.parent=this,this.child=r,r.name=e.name?e.name:r.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${r.name}".`),r.options=xs(pr(r,"addOptions",{name:r.name})),r.storage=xs(pr(r,"addStorage",{name:r.name,options:r.options})),r}};function yx(t){return new I_e({find:t.find,handler:({state:e,range:r,match:n,pasteEvent:a})=>{const i=xs(t.getAttributes,void 0,n,a);if(i===!1||i===null)return null;const{tr:o}=e,l=n[n.length-1],c=n[0];let u=r.to;if(l){const d=c.search(/\S/),h=r.from+c.indexOf(l),f=h+l.length;if(FU(r.from,r.to,e.doc).filter(g=>g.mark.type.excluded.find(b=>b===t.type&&b!==g.mark.type)).filter(g=>g.to>h).length)return null;f<r.to&&o.delete(f,r.to),h>r.from&&o.delete(r.from+d,h),u=r.from+d+l.length,o.addMark(r.from+d,u,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}function bEe(t,e){const{selection:r}=t,{$from:n}=r;if(r instanceof _r){const i=n.index();return n.parent.canReplaceWith(i,i+1,e)}let a=n.depth;for(;a>=0;){const i=n.index(a);if(n.node(a).contentMatchAt(i).matchType(e))return!0;a-=1}return!1}function vEe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var CU={exports:{}},ZN={};/** 1288 * @license React 1289 * use-sync-external-store-shim.production.min.js 1290 * 1291 * Copyright (c) Facebook, Inc. and its affiliates. 1292 * 1293 * This source code is licensed under the MIT license found in the 1294 * LICENSE file in the root directory of this source tree. 1295 */var ZT;function wEe(){if(ZT)return ZN;ZT=1;var t=Oe;function e(h,f){return h===f&&(h!==0||1/h===1/f)||h!==h&&f!==f}var r=typeof Object.is=="function"?Object.is:e,n=t.useState,a=t.useEffect,i=t.useLayoutEffect,o=t.useDebugValue;function l(h,f){var m=f(),g=n({inst:{value:m,getSnapshot:f}}),y=g[0].inst,b=g[1];return i(function(){y.value=m,y.getSnapshot=f,c(y)&&b({inst:y})},[h,m,f]),a(function(){return c(y)&&b({inst:y}),h(function(){c(y)&&b({inst:y})})},[h]),o(m),m}function c(h){var f=h.getSnapshot;h=h.value;try{var m=f();return!r(h,m)}catch{return!0}}function u(h,f){return f()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:l;return ZN.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:d,ZN}CU.exports=wEe();var $_=CU.exports;const jEe=(...t)=>e=>{t.forEach(r=>{typeof r=="function"?r(e):r&&(r.current=e)})},NEe=({contentComponent:t})=>{const e=$_.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return Oe.createElement(Oe.Fragment,null,Object.values(e))};function FEe(){const t=new Set;let e={};return{subscribe(r){return t.add(r),()=>{t.delete(r)}},getSnapshot(){return e},getServerSnapshot(){return e}
1295,setRenderer(r,n){e={...e,[r]:cw.createPortal(n.reactElement,n.element,r)},t.forEach(a=>a())},removeRenderer(r){const n={...e};delete n[r],e=n,t.forEach(a=>a())}}}class SEe extends Oe.Component{constructor(e){var r;super(e),this.editorContentRef=Oe.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!(!((r=e.editor)===null||r===void 0)&&r.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){const e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){if(e.contentComponent)return;const r=this.editorContentRef.current;r.append(...e.options.element.childNodes),e.setOptions({element:r}),e.contentComponent=FEe(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(n=>n.hasContentComponentInitialized?n:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){const e=this.props.editor;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null,!e.options.element.firstChild))return;const r=document.createElement("div");r.append(...e.options.element.childNodes),e.setOptions({element:r})}render(){const{editor:e,innerRef:r,...n}=this.props;return Oe.createElement(Oe.Fragment,null,Oe.createElement("div",{ref:jEe(r,this.editorContentRef),...n}),(e==null?void 0:e.contentComponent)&&Oe.createElement(NEe,{contentComponent:e.contentComponent}))}}const CEe=x.forwardRef((t,e)=>{const r=Oe.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return Oe.createElement(SEe,{key:r,innerRef:e,...t})}),kEe=Oe.memo(CEe);var _Ee=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,a,i;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(a=n;a--!==0;)if(!t(e[a],r[a]))return!1;return!0}if(e instanceof Map&&r instanceof Map){if(e.size!==r.size)return!1;for(a of e.entries())if(!r.has(a[0]))return!1;for(a of e.entries())if(!t(a[1],r.get(a[0])))return!1;return!0}if(e instanceof Set&&r instanceof Set){if(e.size!==r.size)return!1;for(a of e.entries())if(!r.has(a[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(r)){if(n=e.length,n!=r.length)return!1;for(a=n;a--!==0;)if(e[a]!==r[a])return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(i=Object.keys(e),n=i.length,n!==Object.keys(r).length)return!1;for(a=n;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[a]))return!1;for(a=n;a--!==0;){var o=i[a];if(!(o==="_owner"&&e.$$typeof)&&!t(e[o],r[o]))return!1}return!0}return e!==e&&r!==r},EEe=vEe(_Ee),kU={exports:{}},XN={};/** 1296 * @license React 1297 * use-sync-external-store-shim/with-selector.production.min.js 1298 * 1299 * Copyright (c) Facebook, Inc. and its affiliates. 1300 * 1301 * This source code is licensed under the MIT license found in the 1302 * LICENSE file in the root directory of this source tree. 1303 */var XT;function AEe(){if(XT)return XN;XT=1;var t=Oe,e=$_;function r(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var n=typeof Object.is=="function"?Object.is:r,a=e.useSyncExternalStore,i=t.useRef,o=t.useEffect,l=t.useMemo,c=t.useDebugValue;return XN.useSyncExternalStoreWithSelector=function(u,d,h,f,m){var g=i(null);if(g.current===null){var y={hasValue:!1,value:null};g.current=y}else y=g.current;g=l(function(){function w(C){if(!j){if(j=!0,N=C,C=f(C),m!==void 0&&y.hasValue){var T=y.value;if(m(T,C))return S=T}return S=C}if(T=S,n(N,C))return T;var D=f(C);return m!==void 0&&m(T,D)?T:(N=C,S=D)}var j=!1,N,S,E=h===void 0?null:h;return[function(){return w(d())},E===null?void 0:function(){return w(E())}]},[d,h,f,m]);var b=a(u,g[0],g[1]);return o(function(){y.hasValue=!0,y.value=b},[b]),c(b),b},XN}kU.exports=AEe();var DEe=kU.exports;const TEe=typeof window<"u"?x.useLayoutEffect:x.useEffect;class MEe{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0}
1303,this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){const r=()=>{this.transactionNumber+=1,this.subscribers.forEach(a=>a())},n=this.editor;return n.on("transaction",r),()=>{n.off("transaction",r)}}}}function PEe(t){var e;const[r]=x.useState(()=>new MEe(t.editor)),n=DEe.useSyncExternalStoreWithSelector(r.subscribe,r.getSnapshot,r.getServerSnapshot,t.selector,(e=t.equalityFn)!==null&&e!==void 0?e:EEe);return TEe(()=>r.watch(t.editor),[t.editor,r]),x.useDebugValue(n),n}const REe=!1,nC=typeof window>"u",BEe=nC||!!(typeof window<"u"&&window.next);class W_{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(r=>r())}getInitialEditor(){return this.options.current.immediatelyRender===void 0?nC||BEe?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const e={...this.options.current,onBeforeCreate:(...n)=>{var a,i;return(i=(a=this.options.current).onBeforeCreate)===null||i===void 0?void 0:i.call(a,...n)},onBlur:(...n)=>{var a,i;return(i=(a=this.options.current).onBlur)===null||i===void 0?void 0:i.call(a,...n)},onCreate:(...n)=>{var a,i;return(i=(a=this.options.current).onCreate)===null||i===void 0?void 0:i.call(a,...n)},onDestroy:(...n)=>{var a,i;return(i=(a=this.options.current).onDestroy)===null||i===void 0?void 0:i.call(a,...n)},onFocus:(...n)=>{var a,i;return(i=(a=this.options.current).onFocus)===null||i===void 0?void 0:i.call(a,...n)},onSelectionUpdate:(...n)=>{var a,i;return(i=(a=this.options.current).onSelectionUpdate)===null||i===void 0?void 0:i.call(a,...n)},onTransaction:(...n)=>{var a,i;return(i=(a=this.options.current).onTransaction)===null||i===void 0?void 0:i.call(a,...n)},onUpdate:(...n)=>{var a,i;return(i=(a=this.options.current).onUpdate)===null||i===void 0?void 0:i.call(a,...n)},onContentError:(...n)=>{var a,i;return(i=(a=this.options.current).onContentError)===null||i===void 0?void 0:i.call(a,...n)},onDrop:(...n)=>{var a,i;return(i=(a=this.options.current).onDrop)===null||i===void 0?void 0:i.call(a,...n)},onPaste:(...n)=>{var a,i;return(i=(a=this.options.current).onPaste)===null||i===void 0?void 0:i.call(a,...n)}};return new yEe(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,r){return Object.keys(e).every(n=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)?!0:n==="extensions"&&e.extensions&&r.extensions?e.extensions.length!==r.extensions.length?!1:e.extensions.every((a,i)=>{var o;return a===((o=r.extensions)===null||o===void 0?void 0:o[i])}):e[n]===r[n])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?W_.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}
1303):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((n,a)=>n===e[a]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,r=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){r&&r.setOptions(this.options.current);return}r&&!r.isDestroyed&&(r.destroy(),this.instanceId===e&&this.setEditor(null))},1)}}function LEe(t={},e=[]){const r=x.useRef(t);r.current=t;const[n]=x.useState(()=>new W_(r)),a=$_.useSyncExternalStore(n.subscribe,n.getEditor,n.getServerSnapshot);return x.useDebugValue(a),x.useEffect(n.onRender(e)),PEe({editor:a,selector:({transactionNumber:i})=>t.shouldRerenderOnTransaction===!1?null:t.immediatelyRender&&i===0?0:i+1}),a}const IEe=x.createContext({editor:null});IEe.Consumer;const OEe=x.createContext({onDragStart:void 0}),zEe=()=>x.useContext(OEe);Oe.forwardRef((t,e)=>{const{onDragStart:r}=zEe(),n=t.as||"div";return Oe.createElement(n,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:r,style:{whiteSpace:"normal",...t.style}})});const UEe=/^\s*>\s$/,HEe=Xl.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return["blockquote",Ni(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[A0({find:UEe,type:this.type})]}}),$Ee=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,WEe=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,qEe=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,GEe=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,VEe=Ed.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return["strong",Ni(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[xx({find:$Ee,type:this.type}),xx({find:qEe,type:this.type})]},addPasteRules(){return[yx({find:WEe,type:this.type}),yx({find:GEe,type:this.type})]}}),KEe="listItem",QT="textStyle",eM=/^\s*([-+*])\s$/,JEe=Xl.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",Ni(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(KEe,this.editor.getAttributes(QT)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}}
vendor: 12,557 bytes, lines 1303-1307
1303,addInputRules(){let t=A0({find:eM,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=A0({find:eM,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(QT),editor:this.editor})),[t]}}),YEe=/(^|[^`])`([^`]+)`(?!`)/,ZEe=/(^|[^`])`([^`]+)`(?!`)/g,XEe=Ed.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",Ni(this.options.HTMLAttributes,t),0]},addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[xx({find:YEe,type:this.type})]},addPasteRules(){return[yx({find:ZEe,type:this.type})]}}),QEe=/^```([a-z]+)?[\s\n]$/,e5e=/^~~~([a-z]+)?[\s\n]$/,t5e=Xl.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:r}=this.options,i=[...((e=t.firstElementChild)===null||e===void 0?void 0:e.classList)||[]].filter(o=>o.startsWith(r)).map(o=>o.replace(r,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",Ni(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,r=e.pos===1;return!t||e.parent.type.name!==this.name?!1:r||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:r}=e,{$from:n,empty:a}=r;if(!a||n.parent.type!==this.type)return!1;const i=n.parentOffset===n.parent.nodeSize-2,o=n.parent.textContent.endsWith(` 1304 1305`);return!i||!o?!1:t.chain().command(({tr:l})=>(l.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:r,doc:n}=e,{$from:a,empty:i}=r;if(!i||a.parent.type!==this.type||!(a.parentOffset===a.parent.nodeSize-2))return!1;const l=a.after();return l===void 0?!1:n.nodeAt(l)?t.commands.command(({tr:u})=>(u.setSelection(ms.near(n.resolve(l))),!0)):t.commands.exitCode()}}},addInputRules(){return[rC({find:QEe,type:this.type,getAttributes:t=>({language:t[1]})}),rC({find:e5e,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new fo({key:new qc("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const r=e.clipboardData.getData("text/plain"),n=e.clipboardData.getData("vscode-editor-data"),a=n?JSON.parse(n):void 0,i=a==null?void 0:a.mode;if(!r||!i)return!1;const{tr:o,schema:l}=t.state,c=l.text(r.replace(/\r\n?/g,` 1306`));return o.replaceSelectionWith(this.type.create({language:i},c)),o.selection.$from.parent.type!==this.type&&o.setSelection(Vr.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}),r5e=Xl.create({name:"doc",topNode:!0,content:"block+"});function s5e(t={}){return new fo({view(e){return new n5e(e,t)}})}class n5e{constructor(e,r){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=r.width)!==null&&n!==void 0?n:1,this.color=r.color===!1?void 0:r.color||"black",this.class=r.class,this.handlers=["dragover","dragend","drop","dragleave"].map(a=>{let i=o=>{this[a](o)};return e.dom.addEventListener(a,i),{name:a,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:r})=>this.editorView.dom.removeEventListener(e,r))}update(e,r){this.cursorPos!=null&&r.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),r=!e.parent.inlineContent,n,a=this.editorView.dom,i=a.getBoundingClientRect(),o=i.width/a.offsetWidth,l=i.height/a.offsetHeight;if(r){let h=e.nodeBefore,f=e.nodeAfter;if(h||f){let m=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(m){let g=m.getBoundingClientRect(),y=h?g.bottom:g.top;h&&f&&(y=(y+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let b=this.width/2*l;n={left:g.left,right:g.right,top:y-b,bottom:y+b}}}}if(!n){let h=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*o;n={left:h.left-f,right:h.left+f,top:h.top,bottom:h.bottom}}let c=this.editorView.dom.offsetParent;this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",r),this.element.classList.toggle("prosemirror-dropcursor-inline",!r);let u,d;if(!c||c==document.body&&getComputedStyle(c).position=="static")u=-pageXOffset,d=-pageYOffset;else{let h=c.getBoundingClientRect(),f=h.width/c.offsetWidth,m=h.height/c.offsetHeight;u=h.left-c.scrollLeft*f,d=h.top-c.scrollTop*m}this.element.style.left=(n.left-u)/o+"px",this.element.style.top=(n.top-d)/l+"px",this.element.style.width=(n.right-n.left)/o+"px",this.element.style.height=(n.bottom-n.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let r=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=r&&r.inside>=0&&this.editorView.state.doc.nodeAt(r.inside),a=n&&n.type.spec.disableDropCursor,i=typeof a=="function"?a(this.editorView,r,e):a;if(r&&!i){let o=r.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=mz(this.editorView.state.doc,o,this.editorView.dragging.slice);l!=null&&(o=l)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}const a5e=$i.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[s5e(this.options)]}});class Kn extends ms{constructor(e){super(e,e)}map(e,r){let n=e.resolve(r.map(this.head));return Kn.valid(n)?new Kn(n):ms.near(n)}content(){return ar.empty}eq(e){return e instanceof Kn&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,r){if(typeof r.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Kn(e.resolve(r.pos))}getBookmark(){return new q_(this.anchor)}static valid(e){let r=e.parent;if(r.inlineContent||!i5e(e)||!o5e(e))return!1;let n=r.type.spec.allowGapCursor;if(n!=null)return n;let a=r.contentMatchAt(e.index()).defaultType;return a&&a.isTextblock}static findGapCursorFrom(e,r,n=!1){e:for(;;){if(!n&&Kn.valid(e))return e;let a=e.pos,i=null;for(let o=e.depth;;o--){let l=e.node(o);if(r>0?e.indexAfter(o)<l.childCount:e.index(o)>0){i=l.child(r>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;a+=r;let c=e.doc.resolve(a);if(Kn.valid(c))return c}for(;;){let o=r>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!_r.isSelectable(i)){e=e.doc.resolve(a+i.nodeSize*r),n=!1;continue e}break}i=o,a+=r;let l=e.doc.resolve(a);if(Kn.valid(l))return l}return null}}}Kn.prototype.visible=!1;Kn.findFrom=Kn.findGapCursorFrom;ms.jsonID("gapcursor",Kn);class q_{constructor(e){this.pos=e}map(e){return new q_(e.map(this.pos))}resolve(e){let r=e.resolve(this.pos);return Kn.valid(r)?new Kn(r):ms.near(r)}}function _U(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function i5e(t){for(let e=t.depth;e>=0;e--){let r=t.index(e),n=t.node(e);if(r==0){if(n.type.spec.isolating)return!0;continue}for(let a=n.child(r-1);;a=a.lastChild){if(a.childCount==0&&!a.inlineContent||_U(a.type))return!0;if(a.inlineContent)return!1}}return!0}function o5e(t){for(let e=t.depth;e>=0;e--){let r=t.indexAfter(e),n=t.node(e);if(r==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let a=n.child(r);;a=a.firstChild){if(a.childCount==0&&!a.inlineContent||_U(a.type))return!0;if(a.inlineContent)return!1}}return!0}function l5e(){return new fo({props:{decorations:h5e,createSelectionBetween(t,e,r){return e.pos==r.pos&&Kn.valid(r)?new Kn(r):null},handleClick:u5e,handleKeyDown:c5e,handleDOMEvents:{beforeinput:d5e}}})}const c5e=tU({ArrowLeft:Ov("horiz",-1),ArrowRight:Ov("horiz",1),ArrowUp:Ov("vert",-1),ArrowDown:Ov("vert",1)});function Ov(t,e){const r=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,a,i){let o=n.selection,l=e>0?o.$to:o.$from,c=o.empty;if(o instanceof Vr){if(!i.endOfTextblock(r)||l.depth==0)return!1;c=!1,l=n.doc.resolve(e>0?l.after():l.before())}let u=Kn.findGapCursorFrom(l,e,c);return u?(a&&a(n.tr.setSelection(new Kn(u))),!0):!1}}function u5e(t,e,r){if(!t||!t.editable)return!1;let n=t.state.doc.resolve(e);if(!Kn.valid(n))return!1;let a=t.posAtCoords({left:r.clientX,top:r.clientY});return a&&a.inside>-1&&_r.isSelectable(t.state.doc.nodeAt(a.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Kn(n))),!0)}function d5e(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Kn))return!1;let{$from:r}=t.state.selection,n=r.parent.contentMatchAt(r.index()).findWrapping(t.state.schema.nodes.text);if(!n)return!1;let a=Nt.empty;for(let o=n.length-1;o>=0;o--)a=Nt.from(n[o].createAndFill(null,a));let i=t.state.tr.replace(r.pos,r.pos,new ar(a,0,0));return i.setSelection(Vr.near(i.doc.resolve(r.pos+1))),t.dispatch(i),!1}function h5e(t){if(!(t.selection instanceof Kn))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",Ba.create(t.doc,[Ul.widget(t.selection.head,e,{key:"gapcursor"})])}const m5e=$i.create({name:"gapCursor",addProseMirrorPlugins(){return[l5e()]},extendNodeSchema(t){var e;const r={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=xs(pr(t,"allowGapCursor",r)))!==null&&e!==void 0?e:null}}}),f5e=Xl.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",Ni(this.options.HTMLAttributes,t)]},renderText(){return` 1307`},addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:r,editor:n})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:a,storedMarks:i}=r;if(a.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:l}=n.extensionManager,c=i||a.$to.parentOffset&&a.$from.marks();return e().insertContent({type:this.name}).command(({tr:u,dispatch:d})=>{if(d&&c&&o){const h=c.filter(f=>l.includes(f.type.name));u.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),p5e=Xl.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,Ni(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>rC({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}}
1307)\\s$`),type:this.type,getAttributes:{level:t}}))}});var lw=200,ni=function(){};ni.prototype.append=function(e){return e.length?(e=ni.from(e),!this.length&&e||e.length<lw&&this.leafAppend(e)||this.length<lw&&e.leafPrepend(this)||this.appendInner(e)):this};ni.prototype.prepend=function(e){return e.length?ni.from(e).append(this):this};ni.prototype.appendInner=function(e){return new g5e(this,e)};ni.prototype.slice=function(e,r){return e===void 0&&(e=0),r===void 0&&(r=this.length),e>=r?ni.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,r))};ni.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};ni.prototype.forEach=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length),r<=n?this.forEachInner(e,r,n,0):this.forEachInvertedInner(e,r,n,0)};ni.prototype.map=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=this.length);var a=[];return this.forEach(function(i,o){return a.push(e(i,o))},r,n),a};ni.from=function(e){return e instanceof ni?e:e&&e.length?new EU(e):ni.empty};var EU=function(t){function e(n){t.call(this),this.values=n}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(a,i){return a==0&&i==this.length?this:new e(this.values.slice(a,i))},e.prototype.getInner=function(a){return this.values[a]},e.prototype.forEachInner=function(a,i,o,l){for(var c=i;c<o;c++)if(a(this.values[c],l+c)===!1)return!1},e.prototype.forEachInvertedInner=function(a,i,o,l){for(var c=i-1;c>=o;c--)if(a(this.values[c],l+c)===!1)return!1},e.prototype.leafAppend=function(a){if(this.length+a.length<=lw)return new e(this.values.concat(a.flatten()))},e.prototype.leafPrepend=function(a){if(this.length+a.length<=lw)return new e(a.flatten().concat(this.values))},r.length.get=function(){return this.values.length},r.depth.get=function(){return 0},Object.defineProperties(e.prototype,r),e}(ni);ni.empty=new EU([]);var g5e=function(t){function e(r,n){t.call(this),this.left=r,this.right=n,this.length=r.length+n.length,this.depth=Math.max(r.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,a,i,o){var l=this.left.length;if(a<l&&this.left.forEachInner(n,a,Math.min(i,l),o)===!1||i>l&&this.right.forEachInner(n,Math.max(a-l,0),Math.min(this.length,i)-l,o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(n,a,i,o){var l=this.left.length;if(a>l&&this.right.forEachInvertedInner(n,a-l,Math.max(i,l)-l,o+l)===!1||i<l&&this.left.forEachInvertedInner(n,Math.min(a,l),i,o)===!1)return!1},e.prototype.sliceInner=function(n,a){if(n==0&&a==this.length)return this;var i=this.left.length;return a<=i?this.left.slice(n,a):n>=i?this.right.slice(n-i,a-i):this.left.slice(n,i).append(this.right.slice(0,a-i))},e.prototype.leafAppend=function(n){var a=this.right.leafAppend(n);if(a)return new e(this.left,a)},e.prototype.leafPrepend=function(n){var a=this.left.leafPrepend(n);if(a)return new e(a,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e}(ni);const x5e=500;class Rc{constructor(e,r){this.items=e,this.eventCount=r}popEvent(e,r){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let a,i;r&&(a=this.remapping(n,this.items.length),i=a.maps.length);let o=e.tr,l,c,u=[],d=[];return this.items.forEach((h,f)=>{if(!h.step){a||(a=this.remapping(n,f+1),i=a.maps.length),i--,d.push(h);return}if(a){d.push(new du(h.map));let m=h.step.map(a.slice(i)),g;m&&o.maybeStep(m).doc&&(g=o.mapping.maps[o.mapping.maps.length-1],u.push(new du(g,void 0,void 0,u.length+d.length))),i--,g&&a.appendMap(g,i)}else o.maybeStep(h.step);if(h.selection)return l=a?h.selection.map(a.slice(i)):h.selection,c=new Rc(this.items.slice(0,n).append(d.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:l}}addTransform(e,r,n,a){let i=[],o=this.eventCount,l=this.items,c=!a&&l.length?l.get(l.length-1):null;for(let d=0;d<e.steps.length;d++){let h=e.steps[d].invert(e.docs[d]),f=new du(e.mapping.maps[d],h,r),m;(m=c&&c.merge(f))&&(f=m,d?i.pop():l=l.slice(0,l.length-1)),i.push(f),r&&(o++,r=void 0),a||(c=f)}let u=o-n.depth;return u>b5e&&(l=y5e(l,u),o-=u),new Rc(l.append(i),o)}remapping(e,r){let n=new N0;
vendor: 1,479 bytes, line 1307
1307return this.items.forEach((a,i)=>{let o=a.mirrorOffset!=null&&i-a.mirrorOffset>=e?n.maps.length-a.mirrorOffset:void 0;n.appendMap(a.map,o)},e,r),n}addMaps(e){return this.eventCount==0?this:new Rc(this.items.append(e.map(r=>new du(r))),this.eventCount)}rebased(e,r){if(!this.eventCount)return this;let n=[],a=Math.max(0,this.items.length-r),i=e.mapping,o=e.steps.length,l=this.eventCount;this.items.forEach(f=>{f.selection&&l--},a);let c=r;this.items.forEach(f=>{let m=i.getMirror(--c);if(m==null)return;o=Math.min(o,m);let g=i.maps[m];if(f.step){let y=e.steps[m].invert(e.docs[m]),b=f.selection&&f.selection.map(i.slice(c+1,m));b&&l++,n.push(new du(g,y,b))}else n.push(new du(g))},a);let u=[];for(let f=r;f<o;f++)u.push(new du(i.maps[f]));let d=this.items.slice(0,a).append(u).append(n),h=new Rc(d,l);return h.emptyItemCount()>x5e&&(h=h.compress(this.items.length-n.length)),h}emptyItemCount(){let e=0;return this.items.forEach(r=>{r.step||e++}),e}compress(e=this.items.length){let r=this.remapping(0,e),n=r.maps.length,a=[],i=0;return this.items.forEach((o,l)=>{if(l>=e)a.push(o),o.selection&&i++;else if(o.step){let c=o.step.map(r.slice(n)),u=c&&c.getMap();if(n--,u&&r.appendMap(u,n),c){let d=o.selection&&o.selection.map(r.slice(n));d&&i++;let h=new du(u.invert(),c,d),f,m=a.length-1;(f=a.length&&a[m].merge(h))?a[m]=f:a.push(h)}}else o.map&&n--},this.items.length,0),new Rc(ni.from(a.reverse()),i)}}Rc.empty=new Rc(ni.empty,0);function y5e(t,e){let r;return t.forEach((n,a)=>
vendor: 11,448 bytes, line 1307
1307{if(n.selection&&e--==0)return r=a,!1}),t.slice(r)}class du{constructor(e,r,n,a){this.map=e,this.step=r,this.selection=n,this.mirrorOffset=a}merge(e){if(this.step&&e.step&&!e.selection){let r=e.step.merge(this.step);if(r)return new du(r.getMap().invert(),r,this.selection)}}}class Fh{constructor(e,r,n,a,i){this.done=e,this.undone=r,this.prevRanges=n,this.prevTime=a,this.prevComposition=i}}const b5e=20;function v5e(t,e,r,n){let a=r.getMeta(Uf),i;if(a)return a.historyState;r.getMeta(N5e)&&(t=new Fh(t.done,t.undone,null,0,-1));let o=r.getMeta("appendedTransaction");if(r.steps.length==0)return t;if(o&&o.getMeta(Uf))return o.getMeta(Uf).redo?new Fh(t.done.addTransform(r,void 0,n,i1(e)),t.undone,tM(r.mapping.maps),t.prevTime,t.prevComposition):new Fh(t.done,t.undone.addTransform(r,void 0,n,i1(e)),null,t.prevTime,t.prevComposition);if(r.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=r.getMeta("composition"),c=t.prevTime==0||!o&&t.prevComposition!=l&&(t.prevTime<(r.time||0)-n.newGroupDelay||!w5e(r,t.prevRanges)),u=o?QN(t.prevRanges,r.mapping):tM(r.mapping.maps);return new Fh(t.done.addTransform(r,c?e.selection.getBookmark():void 0,n,i1(e)),Rc.empty,u,r.time,l??t.prevComposition)}else return(i=r.getMeta("rebased"))?new Fh(t.done.rebased(r,i),t.undone.rebased(r,i),QN(t.prevRanges,r.mapping),t.prevTime,t.prevComposition):new Fh(t.done.addMaps(r.mapping.maps),t.undone.addMaps(r.mapping.maps),QN(t.prevRanges,r.mapping),t.prevTime,t.prevComposition)}function w5e(t,e){if(!e)return!1;if(!t.docChanged)return!0;let r=!1;return t.mapping.maps[0].forEach((n,a)=>{for(let i=0;i<e.length;i+=2)n<=e[i+1]&&a>=e[i]&&(r=!0)}),r}function tM(t){let e=[];for(let r=t.length-1;r>=0&&e.length==0;r--)t[r].forEach((n,a,i,o)=>e.push(i,o));return e}function QN(t,e){if(!t)return null;let r=[];for(let n=0;n<t.length;n+=2){let a=e.map(t[n],1),i=e.map(t[n+1],-1);a<=i&&r.push(a,i)}return r}function j5e(t,e,r){let n=i1(e),a=Uf.get(e).spec.config,i=(r?t.undone:t.done).popEvent(e,n);if(!i)return null;let o=i.selection.resolve(i.transform.doc),l=(r?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),a,n),c=new Fh(r?l:i.remaining,r?i.remaining:l,null,0,-1);return i.transform.setSelection(o).setMeta(Uf,{redo:r,historyState:c})}let eF=!1,rM=null;function i1(t){let e=t.plugins;if(rM!=e){eF=!1,rM=e;for(let r=0;r<e.length;r++)if(e[r].spec.historyPreserveItems){eF=!0;break}}return eF}const Uf=new qc("history"),N5e=new qc("closeHistory");function F5e(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new fo({key:Uf,state:{init(){return new Fh(Rc.empty,Rc.empty,null,0,-1)},apply(e,r,n){return v5e(r,n,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,r){let n=r.inputType,a=n=="historyUndo"?DU:n=="historyRedo"?TU:null;return!a||!e.editable?!1:(r.preventDefault(),a(e.state,e.dispatch))}}}})}function AU(t,e){return(r,n)=>{let a=Uf.getState(r);if(!a||(t?a.undone:a.done).eventCount==0)return!1;if(n){let i=j5e(a,r,t);i&&n(e?i.scrollIntoView():i)}return!0}}const DU=AU(!1,!0),TU=AU(!0,!0),S5e=$i.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>DU(t,e),redo:()=>({state:t,dispatch:e})=>TU(t,e)}},addProseMirrorPlugins(){return[F5e(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Ñ":()=>this.editor.commands.undo(),"Shift-Mod-Ñ":()=>this.editor.commands.redo()}}}),C5e=Xl.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{}}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",Ni(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!bEe(e,e.schema.nodes[this.name]))return!1;const{selection:r}=e,{$from:n,$to:a}=r,i=t();return n.parentOffset===0?i.insertContentAt({from:Math.max(n.pos-1,0),to:a.pos},{type:this.name}):U4e(r)?i.insertContentAt(a.pos,{type:this.name}):i.insertContent({type:this.name}),i.command(({tr:o,dispatch:l})=>{var c;if(l){const{$to:u}=o.selection,d=u.end();if(u.nodeAfter)u.nodeAfter.isTextblock?o.setSelection(Vr.create(o.doc,u.pos+1)):u.nodeAfter.isBlock?o.setSelection(_r.create(o.doc,u.pos)):o.setSelection(Vr.create(o.doc,u.pos));else{const h=(c=u.parent.type.contentMatch.defaultType)===null||c===void 0?void 0:c.create();h&&(o.insert(d,h),o.setSelection(Vr.create(o.doc,d+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[SU({find:/^(?:---|â-|___\s|\*\*\*\s)$/,type:this.type})]}}),k5e=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,_5e=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,E5e=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,A5e=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,D5e=Ed.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",Ni(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[xx({find:k5e,type:this.type}),xx({find:E5e,type:this.type})]},addPasteRules(){return[yx({find:_5e,type:this.type}),yx({find:A5e,type:this.type})]}}),T5e=Xl.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",Ni(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),M5e="listItem",sM="textStyle",nM=/^(\d+)\.\s$/,P5e=Xl.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...r}=t;return e===1?["ol",Ni(this.options.HTMLAttributes,r),0]:["ol",Ni(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(M5e,this.editor.getAttributes(sM)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=A0({find:nM,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,r)=>r.childCount+r.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=A0({find:nM,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(sM)}),joinPredicate:(e,r)=>r.childCount+r.attrs.start===+e[1],editor:this.editor})),[t]}}),R5e=Xl.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",Ni(this.options.HTMLAttributes,t),0]},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),B5e=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,L5e=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,I5e=Ed.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",Ni(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[xx({find:B5e,type:this.type})]},addPasteRules(){return[yx({find:L5e,type:this.type})]}}),O5e=Xl.create({name:"text",group:"inline"}),z5e=$i.create({name:"starterKit",addExtensions(){const t=[];return this.options.bold!==!1&&t.push(VEe.configure(this.options.bold)),this.options.blockquote!==!1&&t.push(HEe.configure(this.options.blockquote)),this.options.bulletList!==!1&&t.push(JEe.configure(this.options.bulletList)),this.options.code!==!1&&t.push(XEe.configure(this.options.code)),this.options.codeBlock!==!1&&t.push(t5e.configure(this.options.codeBlock)),this.options.document!==!1&&t.push(r5e.configure(this.options.document)),this.options.dropcursor!==!1&&t.push(a5e.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&t.push(m5e.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&t.push(f5e.configure(this.options.hardBreak)),this.options.heading!==!1&&t.push(p5e.configure(this.options.heading)),this.options.history!==!1&&t.push(S5e.configure(this.options.history)),this.options.horizontalRule!==!1&&t.push(C5e.configure(this.options.horizontalRule)),this.options.italic!==!1&&t.push(D5e.configure(this.options.italic)),this.options.listItem!==!1&&t.push(T5e.configure(this.options.listItem)),this.options.orderedList!==!1&&t.push(P5e.configure(this.options.orderedList)),this.options.paragraph!==!1&&t.push(R5e.configure(this.options.paragraph)),this.options.strike!==!1&&t.push(I5e.configure(this.options.strike)),this.options.text!==!1&&t.push(O5e.configure(this.options.text)),t}}),U5e=$i.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,r=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(r)}},addProseMirrorPlugins(){let t=!1;return[new fo({key:new qc("characterCount"),appendTransaction:(e,r,n)=>{if(t)return;const a=this.options.limit;if(a==null||a===0){t=!0;return}const i=this.storage.characters({node:n.doc});if(i>a){const o=i-a,l=0,c=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${a} characters. Content was automatically trimmed.`);const u=n.tr.deleteRange(l,c);return t=!0,u}t=!0},filterTransaction:(e,r)=>{const n=this.options.limit;if(!e.docChanged||n===0||n===null||n===void 0)return!0;const a=this.storage.characters({node:r.doc}),i=this.storage.characters({node:e.doc});if(i<=n||a>n&&i>n&&i<=a)return!0;
1307if(a>n&&i>n&&i>a||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,c=i-n,u=l-c,d=l;return e.deleteRange(u,d),!(this.storage.characters({node:e.doc})>n)}})]}}),H5e=Ed.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",Ni(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),$5e=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,W5e=Xl.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",Ni(this.options.HTMLAttributes,t)]},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[SU({find:$5e,type:this.type,getAttributes:t=>{const[,,e,r,n]=t;return{src:r,alt:e,title:n}}})]}}),q5e=({isOpen:t,onClose:e,onInsert:r})=>{const{toast:n}=St(),a=x.useRef(null),[i,o]=x.useState(!1),[l,c]=x.useState(!1),[u,d]=x.useState(""),[h,f]=x.useState(""),[m,g]=x.useState(""),y=async D=>{try{if(o(!0),!D.type.startsWith("image/"))throw new Error("Please select an image file");if(D.size>5*1024*1024)throw new Error("Image size must be less than 5MB");const A=D.name.split(".").pop(),M=`newsletters/${`${Date.now()}-${Math.random().toString(36).substring(2)}.${A}`}`,{data:P,error:U}=await Q.storage.from("newsletter-images").upload(M,D,{cacheControl:"3600",upsert:!1});if(U)throw U;const{data:{publicUrl:I}}=Q.storage.from("newsletter-images").getPublicUrl(M);g(I),d(I),n({title:"Success",description:"Image uploaded successfully"})}catch(A){console.error("Error uploading image:",A),n({title:"Upload Error",description:A.message||"Failed to upload image",variant:"destructive"})}finally{o(!1)}},b=D=>{var R;const A=(R=D.target.files)==null?void 0:R[0];A&&y(A)},w=D=>{D.preventDefault(),c(!1);const A=D.dataTransfer.files[0];A&&y(A)},j=D=>{D.preventDefault(),c(!0)},N=D=>{D.preventDefault(),c(!1)},S=()=>{u&&u.startsWith("http")&&g(u)},E=()=>{u&&(r(u,h||""),C())},C=()=>{d(""),f(""),g(""),o(!1),e()},T=u&&u.startsWith("http");return s.jsx(Tt,{open:t,onOpenChange:C,children:s.jsxs(Dt,{className:"sm:max-w-[600px]",children:[s.jsxs(It,{children:[s.jsxs(Ot,{className:"flex items-center gap-2",children:[s.jsx(vi,{className:"h-5 w-5"}),"Insert Image"]}),s.jsx(rr,{children:"Upload an image or provide a URL to insert into your newsletter"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs(sn,{defaultValue:"upload",className:"w-full",children:[s.jsxs(Qs,{className:"grid w-full grid-cols-2",children:[s.jsxs(Gt,{value:"upload",className:"flex items-center gap-2",children:[s.jsx(vn,{className:"h-4 w-4"}),"Upload Image"]}),s.jsxs(Gt,{value:"url",className:"flex items-center gap-2",children:[s.jsx(dp,{className:"h-4 w-4"}),"Image URL"]})]}),s.jsxs(Rt,{value:"upload",className:"space-y-4",children:[s.jsx("div",{className:`border-2 border-dashed rounded-lg p-6 text-center transition-colors ${l?"border-primary bg-primary/5":"border-muted-foreground/25 hover:border-muted-foreground/50"}`,onDrop:w,onDragOver:j,onDragLeave:N,onClick:()=>{var D;return!i&&((D=a.current)==null?void 0:D.click())},children:i?s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[s.jsx(Mt,{className:"h-8 w-8 animate-spin text-primary"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Uploading image..."})]}):s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[s.jsx(vn,{className:"h-8 w-8 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Click to upload or drag and drop"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"PNG, JPG, GIF up to 5MB"})]})]})}),s.jsx("input",{ref:a,type:"file",accept:"image/*",onChange:b,className:"hidden",disabled:i}),s.jsxs(Y,{type:"button",variant:"outline",onClick:()=>{var D;return(D=a.current)==null?void 0:D.click()},disabled:i,className:"w-full",children:[s.jsx(vn,{className:"h-4 w-4 mr-2"}),"Choose File"]})]}),s.jsx(Rt,{value:"url",className:"space-y-4",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"image-url",children:"Image URL"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ne,{id:"image-url",value:u,onChange:D=>d(D.target.value),placeholder:"https://example.com/image.jpg",type:"url",className:"flex-1 break-all text-sm",style:{wordBreak:"break-all",overflowWrap:"break-word"}}),s.jsx(Y,{type:"button",variant:"outline",onClick:S,disabled:!T,className:"flex-shrink-0",children:"Preview"})]})]})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"alt-text",children:"Alt Text (Optional)"}),s.jsx(Ne,{id:"alt-text",value:h,onChange:D=>f(D.target.value),placeholder:"Describe the image for accessibility"})]}),m&&s.jsx("div",{className:"border rounded-lg p-4 bg-muted/20",children:s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsxs("div",{className:"relative w-20 h-20 bg-muted rounded overflow-hidden flex-shrink-0",children:[s.jsx("img",{src:m,alt:"Preview",className:"w-full h-full object-cover",onError:D=>{D.currentTarget.style.display="none",D.currentTarget.nextElementSibling.style.display="flex"}}),s.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-muted hidden",children:s.jsx(vi,{className:"h-6 w-6 text-muted-foreground"})})]}),s.jsxs("div",{className:"flex-1 min-w-0 max-w-xs",children:[s.jsx("p",{className:"text-sm font-medium",children:"Image Preview"}),s.jsx("p",{className:"text-xs text-muted-foreground break-all",style:{wordBreak:"break-all",overflowWrap:"break-word",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden"},title:m,children:m})]}),s.jsx(Y,{type:"button",variant:"ghost",size:"sm",onClick:()=>{g(""),d("")},className:"flex-shrink-0 self-start mt-1",children:s.jsx(Ir,{className:"h-4 w-4"})})]})})]}),s.jsxs(Sr,{children:[s.jsx(Y,{type:"button",variant:"outline",onClick:C,children:"Cancel"}),s.jsxs(Y,{type:"button",onClick:E,disabled:!u||i,className:"bg-blue-600 hover:bg-blue-700",children:[s.jsx(un,{className:"h-4 w-4 mr-2"}),"Insert Image"]})]})]})})};class G5e extends Oe.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,r){console.warn("Editor error caught:",e.message),setTimeout(()=>{this.setState({hasError:!1})},100)}render(){return this.state.hasError?this.props.fallback||s.jsx("div",{className:"border rounded-md p-4 text-center text-muted-foreground",children:"Editor temporarily unavailable. Please refresh the page."}):this.props.children}}const MU=({value:t,onChange:e,placeholder:r="Start writing...",disabled:n=!1,className:a=""})=>{var m,g,y;const[i,o]=x.useState(!1),l=LEe({extensions:[z5e,U5e,H5e,W5e.configure({HTMLAttributes:{class:"max-w-full h-auto rounded-lg"}})],content:t,onUpdate:({editor:b})=>{var w,j,N;try{e(b.getHTML())}catch(S){if(S instanceof Error&&((w=S.message)!=null&&w.includes("Grammarly")||(j=S.message)!=null&&j.includes("_tag")||(N=S.message)!=null&&N.includes("Cannot read properties"))){console.warn("Grammarly-related update error suppressed:",S.message);return}else throw S}},editable:!n,immediatelyRender:!1});x.useEffect(()=>{l&&t!==l.getHTML()&&l.commands.setContent(t)},[l,t]);const c=(b,w)=>{try{l==null||l.chain().focus().setImage({src:b,alt:w}).run()}catch(j){console.warn("Image insertion error suppressed:",j)}},u=b=>{b.preventDefault(),b.stopPropagation()},d=b=>{b.preventDefault(),b.stopPropagation()},h=async b=>{b.preventDefault(),b.stopPropagation();const j=Array.from(b.dataTransfer.files).filter(S=>S.type.startsWith("image/"));if(j.length===0)return;const N=j[0];try{if(N.size>5*1024*1024){console.warn("Image file too large (max 5MB)");return}const S=N.name.split(".").pop(),C=`newsletters/${`${Date.now()}-${Math.random().toString(36).substring(2)}.${S}`}`,{data:T,error:D}=await Q.storage.from("newsletter-images").upload(C,N,{cacheControl:"3600",upsert:!1});if(D)throw D;const{data:{publicUrl:A}}=Q.storage.from("newsletter-images").getPublicUrl(C);l==null||l.chain().focus().setImage({src:A,alt:N.name}).run()}catch(S){console.error("Error uploading dropped image:",S)}};if(x.useEffect(()=>{if(!l)return;const b=N=>{var S,E,C;if((S=N.message)!=null&&S.includes("Grammarly")||(E=N.message)!=null&&E.includes("_tag")||(C=N.message)!=null&&C.includes("Cannot read properties"))return console.warn("Grammarly error intercepted and suppressed:",N.message),N.preventDefault(),N.stopPropagation(),!1},w=N=>{var S,E,C,T,D,A;if((E=(S=N.reason)==null?void 0:S.message)!=null&&E.includes("Grammarly")||(T=(C=N.reason)==null?void 0:C.message)!=null&&T.includes("_tag")||(A=(D=N.reason)==null?void 0:D.message)!=null&&A.includes("Cannot read properties"))return console.warn("Grammarly promise rejection intercepted:",N.reason.message),N.preventDefault(),!1};window.addEventListener("error",b),window.addEventListener("unhandledrejection",w);const j=console.error;return console.error=(...N)=>{const S=N.join(" ");if(S.includes("Grammarly")||S.includes("_tag")||S.includes("Cannot read properties")){console.warn("Grammarly error suppressed from console.error:",S);return}j.apply(console,N)},()=>{window.removeEventListener("error",b),window.removeEventListener("unhandledrejection",w),console.error=j}},[l]),!l)return null;const f=({onClick:b,isActive:w=!1,disabled:j=!1,children:N})=>{const S=()=>{var E,C,T;try{b()}catch(D){if(D instanceof Error&&((E=D.message)!=null&&E.includes("Grammarly")||(C=D.message)!=null&&C.includes("_tag")||(T=D.message)!=null&&T.includes("Cannot read properties"))){console.warn("Grammarly-related error suppressed:",D.message);return}else throw D}};return s.jsx(Y,{type:"button",variant:w?"default":"ghost",size:"sm",onClick:S,disabled:j||n,className:"h-8 w-8 p-0",children:N})};return s.jsxs(G5e,{children:[s.jsxs("div",{className:`border rounded-md ${a}`,"data-gramm":"false","data-gramm_editor":"false","data-enable-grammarly":"false",children:[s.jsxs("div",{className:"border-b p-2 flex flex-wrap gap-1",children:[s.jsxs("div",{className:"flex gap-1",children:[s.jsx(f,{onClick:()=>l.chain().focus().toggleBold().run(),isActive:l==null?void 0:l.isActive("bold"),children:s.jsx(PV,{className:"h-4 w-4"})}),s.jsx(f,{onClick:()=>l.chain().focus().toggleItalic().run(),isActive:l==null?void 0:l.isActive("italic"),children:s.jsx(HV,{className:"h-4 w-4"})}),s.jsx(f,{onClick:()=>l.chain().focus().toggleUnderline().run(),isActive:l==null?void 0:l.isActive("underline"),children:s.jsx(QV,{className:"h-4 w-4"})})]}),s.jsx(yp,{orientation:"vertical",className:"h-6"}),s.jsx("div",{className:"flex gap-1",children:s.jsx(f,{onClick:()=>o(!0),isActive:!1,children:s.jsx(vi,{className:"h-4 w-4"})})})]}),s.jsx("div",{className:"p-4",onDragOver:u,onDragLeave:d,onDrop:h,children:s.jsx(kEe,{editor:l,className:`prose prose-sm max-w-none focus:outline-none prose-headings:font-semibold prose-headings:text-gray-900 prose-p:text-gray-700 prose-p:leading-relaxed prose-strong:font-semibold prose-strong:text-gray-900 prose-em:italic prose-blockquote:border-l-4 prose-blockquote:border-gray-300 prose-blockquote:pl-4 prose-blockquote:italic prose-ul:list-disc prose-ol:list-decimal prose-li:text-gray-700 prose-code:bg-gray-100 prose-code:px-1 prose-code:py-0.5 prose-code:rounded prose-code:text-sm prose-code:font-mono prose-pre:bg-gray-100 prose-pre:p-4 prose-pre:rounded prose-pre:overflow-x-auto prose-img:max-w-full prose-img:h-auto prose-img:rounded-lg ${n?"opacity-50 cursor-not-allowed":""}`,"data-gramm":"false","data-gramm_editor":"false","data-enable-grammarly":"false",spellCheck:"false"})}),s.jsxs("div",{className:"border-t px-4 py-2 text-xs text-muted-foreground",children:[((y=(g=(m=l==null?void 0:l.storage)==null?void 0:m.characterCount)==null?void 0:g.characters)==null?void 0:y.call(g))||0," characters"]})]}),s.jsx(q5e,{isOpen:i,onClose:()=>o(!1),onInsert:c})]})},aM=({isOpen:t,onClose:e,onSuccess:r,onSubmit:n,editingContent:a})=>{const[i,o]=x.useState({title:"",content:""}),[l,c]=x.useState(!1),{toast:u}=St(),d=!!a;x.useEffect(()=>{o(a?{title:a.title||"",content:a.content||""}:{title:"",content:""})},[a,t]);const h=async g=>{var y,b;if(g.preventDefault(),!((y=i.title)!=null&&y.trim())||!((b=i.content)!=null&&b.trim())){u({title:"Error",description:"Title and main content are required fields",variant:"destructive"});return}c(!0);try{await n(i),u({title:"Success",description:`Content ${d?"updated":"created"} successfully`}),r()}catch(w){console.error("Error saving content:",w),u({title:"Error",description:`Failed to ${d?"update":"create"} content`,variant:"destructive"})}finally{c(!1)}},f=(g,y)=>{o(b=>({...b,[g]:y}))},m=()=>{l||(o({title:"",content:""}),e())};return s.jsx(Tt,{open:t,onOpenChange:m,children:s.jsx(Dt,{className:"sm:max-w-[700px] max-h-[90vh] overflow-y-auto",children:s.jsxs("form",{onSubmit:h,children:[s.jsxs(It,{children:[s.jsx(Ot,{children:d?"Edit About Us Content":"Add About Us Content"}),s.jsxs(rr,{children:["Fill out the form below to ",d?"update the":"create new"," About Us content. The content will be displayed as rich text on the About Us page."]})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"title",className:"text-right",children:"Title *"}),s.jsx(Ne,{id:"title",value:i.title,onChange:g=>f("title",g.target.value),className:"col-span-3",placeholder:"e.g., About Our Chamber",required:!0,disabled:l})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"content",className:"text-right pt-2",children:"Main Content *"}),s.jsx("div",{className:"col-span-3",children:s.jsx(MU,{value:i.content,onChange:g=>f("content",g),placeholder:"Enter the main about us content. This will be displayed as rich text with proper formatting on the About Us page...",disabled:l,className:"min-h-[300px]"},(a==null?void 0:a.id)||"new")})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",type:"button",onClick:m,disabled:l,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:l,children:l?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"w-4 h-4 mr-2 animate-spin"}),d?"Updating...":"Creating..."]}):d?"Update Content":"Add Content"})]})]})})})},V5e=()=>{const[t,e]=x.useState([]),[r,n]=x.useState(!0),[a,i]=x.useState(!1),[o,l]=x.useState(!1),[c,u]=x.useState(null),[d,h]=x.useState(null),{toast:f}=St();x.useEffect(()=>{m()},[]);const m=async()=>{try{n(!0);const C=await dg.getAllContent();e(C)}catch(C){console.error("Error fetching content:",C),f({title:"Error",description:"Failed to load content",variant:"destructive"})}finally{n(!1)}},g=C=>{u(C),l(!0)},y=()=>{i(!0)},b=async C=>{try{const T=await dg.createContent(C);if(!(T!=null&&T.success))throw new Error((T==null?void 0:T.error)||"Failed to create content");await m()}catch(T){throw console.error("Error creating content:",T),T}},w=async C=>
1307{if(c)try{const T=await dg.updateContent(c.id,C);if(!(T!=null&&T.success))throw new Error((T==null?void 0:T.error)||"Failed to update content");await m()}catch(T){throw console.error("Error updating content:",T),T}},j=()=>{i(!1),f({title:"Success",description:"Content created successfully"})},N=()=>{l(!1),u(null),f({title:"Success",description:"Content updated successfully"})},S=async C=>{try{const T=await dg.setActiveContent(C);T.success?(f({title:"Success",description:"Content set as active"}),await m()):f({title:"Error",description:T.error||"Failed to set content as active",variant:"destructive"})}catch(T){console.error("Error setting active content:",T),f({title:"Error",description:"Failed to set content as active",variant:"destructive"})}},E=async C=>{try{const T=await dg.deleteContent(C);T.success?(f({title:"Success",description:"Content deleted successfully"}),h(null),await m()):f({title:"Error",description:T.error||"Failed to delete content",variant:"destructive"})}catch(T){console.error("Error deleting content:",T),f({title:"Error",description:"Failed to delete content",variant:"destructive"})}};return r?s.jsx("div",{className:"flex items-center justify-center p-8",children:s.jsx(Mt,{className:"h-8 w-8 animate-spin"})}):s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-xl sm:text-2xl font-bold",children:"About Us Management"}),s.jsx("p",{className:"text-muted-foreground text-sm sm:text-base",children:"Manage your organization's about us content"})]}),s.jsxs(Y,{onClick:y,className:"w-full sm:w-auto bg-chamber-blue hover:bg-blue-700",children:[s.jsx(vs,{className:"w-4 h-4 mr-2"}),"Create New Content"]})]}),s.jsx("div",{className:"space-y-4",children:t.length===0?s.jsx(De,{children:s.jsx(Be,{className:"p-6 sm:p-8 text-center",children:s.jsx("p",{className:"text-muted-foreground",children:"No content found. Create your first About Us content."})})}):t.map(C=>s.jsxs(De,{children:[s.jsx(ot,{className:"p-4 sm:p-6",children:s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:justify-between sm:items-start",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs(ut,{className:"flex flex-wrap items-center gap-2 text-base sm:text-lg",children:[s.jsx("span",{className:"break-words",children:C.title}),C.is_active&&s.jsx(ke,{className:"bg-green-500 text-white shrink-0",children:"Active"})]}),s.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:["Last updated: ",new Date(C.updated_at).toLocaleDateString()]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2 shrink-0",children:[s.jsxs(Y,{size:"sm",variant:"outline",onClick:()=>g(C),title:"Edit",children:[s.jsx(zs,{className:"w-4 h-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Edit"})]}),!C.is_active&&s.jsx(Y,{size:"sm",onClick:()=>S(C.id),className:"bg-green-600 hover:bg-green-700 text-white",children:"Set Active"}),s.jsxs(Y,{size:"sm",variant:"destructive",onClick:()=>h(C.id),title:"Delete",children:[s.jsx(vr,{className:"w-4 h-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Delete"})]})]})]})}),s.jsx(Be,{className:"p-4 pt-0 sm:p-6 sm:pt-0",children:s.jsx("div",{className:"text-muted-foreground line-clamp-3 prose prose-sm max-w-none break-words",dangerouslySetInnerHTML:{__html:C.content}})})]},C.id))}),s.jsx(aM,{isOpen:a,onClose:()=>i(!1),onSuccess:j,onSubmit:b}),s.jsx(aM,{isOpen:o,onClose:()=>{l(!1),u(null)},onSuccess:N,onSubmit:w,editingContent:c}),s.jsx(Tt,{open:!!d,onOpenChange:()=>h(null),children:s.jsxs(Dt,{className:"max-w-[min(100vw-2rem,28rem)] p-4 sm:p-6",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Delete Content"}),s.jsx(rr,{children:"Are you sure you want to delete this content? This action cannot be undone."})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",onClick:()=>h(null),children:"Cancel"}),s.jsx(Y,{variant:"destructive",onClick:()=>d&&E(d),children:"Delete"})]})]})})]})},K5e=()=>{const[t,e]=x.useState([]),[r,n]=x.useState(!0),[a,i]=x.useState(!1),[o,l]=x.useState(null),[c,u]=x.useState(!1),[d,h]=x.useState(null),[f,m]=x.useState(!1),[g,y]=x.useState(!1),[b,w]=x.useState({title:"Terms and Conditions",content:"",version:"1.0"}),[j,N]=x.useState({title:"Terms and Conditions",content:"",version:"1.0"});x.useEffect(()=>{S()},[]);const S=async()=>{try{n(!0);const U=await Kh.getAllTerms();e(U)}catch(U){console.error("Error fetching terms:",U),ct.error("Failed to load terms and conditions")}finally{n(!1)}},E=()=>JSON.stringify(b)!==JSON.stringify(j),C=U=>{if(a&&E()){y(!0);return}l(U);const I={title:U.title,content:U.content,version:U.version};w(I),N(I),i(!0)},T=()=>{if(a&&E()){y(!0);return}l(null);const U={title:"Terms and Conditions",content:"",version:"1.0"};w(U),N(U),i(!0)},D=()=>
1307{if(E()){y(!0);return}i(!1),l(null),w({title:"Terms and Conditions",content:"",version:"1.0"}),N({title:"Terms and Conditions",content:"",version:"1.0"})},A=()=>{i(!1),l(null),w({title:"Terms and Conditions",content:"",version:"1.0"}),N({title:"Terms and Conditions",content:"",version:"1.0"}),y(!1)},R=async()=>{if(!b.title.trim()||!b.content.trim()||!b.version.trim()){ct.error("Please fill in all required fields");return}m(!0);try{o?(await Kh.updateTerms(o.id,b),ct.success("Terms and conditions updated successfully")):(await Kh.createTerms(b),ct.success("Terms and conditions created successfully")),await S(),i(!1),l(null),w({title:"Terms and Conditions",content:"",version:"1.0"}),N({title:"Terms and Conditions",content:"",version:"1.0"})}catch(U){console.error("Error saving terms:",U),ct.error("Failed to save terms and conditions")}finally{m(!1)}},M=U=>{h(U),u(!0)},P=U=>new Date(U).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"});return r?s.jsx("div",{className:"flex items-center justify-center p-8",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-chamber-blue mx-auto mb-4"}),s.jsx("p",{className:"text-muted-foreground",children:"Loading terms and conditions..."})]})}):s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-xl sm:text-2xl font-bold",children:"Terms & Conditions Management"}),s.jsx("p",{className:"text-muted-foreground",children:"Manage the terms and conditions that users must accept during signup"})]}),!a&&s.jsxs(Y,{onClick:T,className:"w-full sm:w-auto bg-chamber-blue hover:bg-chamber-blue-dark",children:[s.jsx(vs,{className:"w-4 h-4 mr-2"}),"Create New Version"]})]}),a?s.jsxs(De,{children:[s.jsx(ot,{className:"p-4 sm:p-6",children:s.jsx(ut,{className:"text-lg sm:text-xl",children:o?"Edit Terms & Conditions":"Create New Terms & Conditions"})}),s.jsxs(Be,{className:"space-y-4 p-4 sm:p-6 pt-0",children:[s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"title",children:"Title"}),s.jsx(Ne,{id:"title",value:b.title,onChange:U=>w({...b,title:U.target.value}),placeholder:"Terms and Conditions"})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"version",children:"Version"}),s.jsx(Ne,{id:"version",value:b.version,onChange:U=>w({...b,version:U.target.value}),placeholder:"1.0"})]})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"content",children:"Content"}),s.jsx(zt,{id:"content",value:b.content,onChange:U=>w({...b,content:U.target.value}),placeholder:"Enter the terms and conditions content...",className:"min-h-[240px] sm:min-h-[400px]"})]}),s.jsxs("div",{className:"flex flex-wrap gap-2 pt-4",children:[s.jsx(Y,{onClick:R,disabled:f,className:"w-full sm:w-auto bg-chamber-blue hover:bg-chamber-blue-dark",children:f?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Saving..."]}):s.jsxs(s.Fragment,{children:[s.jsx(hp,{className:"w-4 h-4 mr-2"}),"Save & Activate"]})}),s.jsxs(Y,{variant:"outline",onClick:D,disabled:f,children:[s.jsx(Ir,{className:"w-4 h-4 mr-2"}),"Cancel"]})]})]})]}):s.jsx("div",{className:"space-y-4",children:t.length===0?s.jsx(De,{children:s.jsxs(Be,{className:"text-center py-8",children:[s.jsx("p",{className:"text-muted-foreground mb-4",children:"No terms and conditions found"}),s.jsxs(Y,{onClick:T,className:"bg-chamber-blue hover:bg-chamber-blue-dark",children:[s.jsx(vs,{className:"w-4 h-4 mr-2"}),"Create First Version"]})]})}):t.map(U=>s.jsx(De,{children:s.jsx(Be,{className:"p-4 sm:p-6",children:s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-2",children:[s.jsx("h3",{className:"text-base sm:text-lg font-semibold break-words",children:U.title}),s.jsx(ke,{variant:U.is_active?"default":"secondary",className:"shrink-0",children:U.is_active?"Active":"Inactive"}),s.jsxs(ke,{variant:"outline",className:"shrink-0",children:["v",U.version]})]}),s.jsxs("p",{className:"text-sm text-muted-foreground mb-1",children:["Created: ",P(U.created_at)]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Last updated: ",P(U.updated_at)]})]}),s.jsxs("div",{className:"flex gap-2 shrink-0",children:[s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>M(U),className:"flex-1 sm:flex-initial",children:[s.jsx(Xs,{className:"w-4 h-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Preview"})]}),s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>C(U),className:"flex-1 sm:flex-initial",children:[s.jsx(zs,{className:"w-4 h-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Edit"})]})]})]})})},U.id))}),s.jsx(Tt,{open:c,onOpenChange:u,children:s.jsxs(Dt,{className:"max-w-[min(100vw-2rem,56rem)] max-h-[90vh] h-full flex flex-col p-4 sm:p-6",children:[s.jsxs(It,{className:"flex-shrink-0",children:[s.jsxs(Ot,{children:[d==null?void 0:d.title," (v",d==null?void 0:d.version,")"]}),s.jsx(rr,{children:"Preview of terms and conditions"})]}),s.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:s.jsx(rx,{className:"h-full pr-4",children:s.jsx("div",{className:"prose prose-sm max-w-none",children:s.jsx("div",{className:"whitespace-pre-wrap text-sm leading-relaxed",children:d==null?void 0:d.content})})})}),s.jsx(Sr,{className:"flex-shrink-0 pt-4 border-t",children:s.jsx(Y,{variant:"outline",onClick:()=>u(!1),children:"Close"})})]})}),s.jsx(ai,{open:g,onOpenChange:y,children:s.jsxs(Oa,{children:[s.jsxs(za,{children:[s.jsx(Ha,{children:"Unsaved Changes"}),s.jsx($a,{children:"You have unsaved changes. Are you sure you want to discard them?"})]}),s.jsxs(Ua,{children:[s.jsx(qa,{children:"Keep Editing"}),s.jsx(Wa,{onClick:A,children:"Discard Changes"})]})]})})]})},J5e=()=>{const[t,e]=x.useState([]),[r,n]=x.useState([]),[a,i]=x.useState(!0),[o,l]=x.useState(null),[c,u]=x.useState(!1),[d,h]=x.useState(!1),[f,m]=x.useState(!1),[g,y]=x.useState("all"),[b,w]=x.useState({status:"pending",admin_notes:""});x.useEffect(()=>{j()},[]),x.useEffect(()=>{n(g==="all"?t:t.filter(A=>A.status===g))},[t,g]);const j=async()=>{i(!0);try{const A=await d0.getAllRequests();A.success&&A.data?e(A.data):ct.error(A.error||"Failed to fetch requests")}catch(A){console.error("Error fetching requests:",A),ct.error("Failed to fetch requests")}finally{i(!1)}},N=A=>{l(A),w({status:A.status,admin_notes:A.admin_notes||""}),u(!0)},S=A=>{l(A),h(!0)},E=async()=>
1307{if(o){m(!0);try{const A=await d0.updateRequest(o.id,b);A.success?(ct.success("Request updated successfully"),u(!1),j()):ct.error(A.error||"Failed to update request")}catch(A){console.error("Error updating request:",A),ct.error("Failed to update request")}finally{m(!1)}}},C=A=>{const R={pending:{color:"bg-yellow-100 text-yellow-800",label:"Pending"},in_progress:{color:"bg-blue-100 text-blue-800",label:"In Progress"},approved:{color:"bg-green-100 text-green-800",label:"Approved"},completed:{color:"bg-purple-100 text-purple-800",label:"Completed"},cancelled:{color:"bg-red-100 text-red-800",label:"Cancelled"},archived:{color:"bg-gray-100 text-gray-800",label:"Archived"}},M=R[A]||R.pending;return s.jsx(ke,{className:`${M.color} border-0`,children:M.label})},T=A=>{try{return Cs(new Date(A),"MMM dd, yyyy")}catch{return A}},D=A=>{try{const[R,M]=A.split(":"),P=new Date;return P.setHours(parseInt(R),parseInt(M)),Cs(P,"h:mm a")}catch{return A}};return a?s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsx("h1",{className:"text-xl sm:text-2xl font-bold",children:"Ribbon Cutting Requests"}),s.jsx("div",{className:"text-center py-8",children:"Loading..."})]}):s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[s.jsxs("h1",{className:"text-xl sm:text-2xl font-bold flex items-center gap-2 flex-wrap",children:[s.jsx(zl,{className:"h-6 w-6 text-chamber-blue shrink-0"}),"Ribbon Cutting Requests"]}),s.jsx("div",{className:"w-full sm:w-auto",children:s.jsxs(Wt,{value:g,onValueChange:y,children:[s.jsx(Ht,{className:"w-full sm:w-48",children:s.jsx(qt,{placeholder:"Filter by status"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"all",children:"All Requests"}),s.jsx(Ae,{value:"pending",children:"Pending"}),s.jsx(Ae,{value:"in_progress",children:"In Progress"}),s.jsx(Ae,{value:"approved",children:"Approved"}),s.jsx(Ae,{value:"completed",children:"Completed"}),s.jsx(Ae,{value:"cancelled",children:"Cancelled"}),s.jsx(Ae,{value:"archived",children:"Archived"})]})]})})]}),r.length===0?s.jsx(De,{children:s.jsxs(Be,{className:"text-center py-8",children:[s.jsx(zl,{className:"h-12 w-12 text-gray-400 mx-auto mb-4"}),s.jsx("p",{className:"text-gray-500",children:"No ribbon cutting requests found"})]})}):s.jsx("div",{className:"grid gap-4 sm:gap-6",children:r.map(A=>s.jsxs(De,{className:"overflow-hidden",children:[s.jsx(ot,{className:"p-4 sm:p-6",children:s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:justify-between sm:items-start",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs(ut,{className:"flex items-center gap-2 text-base sm:text-lg truncate",children:[s.jsx(zl,{className:"h-4 w-4 sm:h-5 sm:w-5 text-chamber-blue shrink-0"}),s.jsx("span",{className:"truncate",children:A.business_name})]}),s.jsxs("p",{className:"text-sm text-muted-foreground mt-1 truncate",children:["Contact: ",A.contact_person]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 shrink-0",children:[C(A.status),s.jsxs("div",{className:"flex gap-1 sm:gap-2",children:[s.jsxs(Y,{size:"sm",variant:"outline",className:"flex-1 sm:flex-initial",onClick:()=>S(A),children:[s.jsx(Xs,{className:"h-4 w-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"View"})]}),s.jsxs(Y,{size:"sm",className:"flex-1 sm:flex-initial",onClick:()=>N(A),children:[s.jsx(zs,{className:"h-4 w-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Update"})]})]})]})]})}),s.jsxs(Be,{className:"p-4 pt-0 sm:p-6 sm:pt-0",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-4 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(fs,{className:"h-4 w-4 text-gray-400"}),s.jsx("span",{children:A.email})]}),A.phone&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(wi,{className:"h-4 w-4 text-gray-400"}),s.jsx("span",{children:A.phone})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(_n,{className:"h-4 w-4 text-gray-400"}),s.jsx("span",{className:"truncate",children:A.business_address})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(rn,{className:"h-4 w-4 text-gray-400"}),s.jsxs("span",{children:["Submitted ",T(A.created_at)]})]})]}),A.preferred_date&&s.jsxs("div",{className:"mt-4 p-3 bg-muted/50 rounded-lg",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm",children:[s.jsx(Br,{className:"h-4 w-4 text-chamber-blue"}),s.jsx("span",{className:"font-medium",children:"Preferred:"}),s.jsx("span",{children:T(A.preferred_date)}),A.preferred_time&&s.jsxs("span",{children:["at ",D(A.preferred_time)]})]}),A.alternative_date&&s.jsxs("div",{className:"flex items-center gap-2 text-sm mt-1",children:[s.jsx(Br,{className:"h-4 w-4 text-gray-400"}),s.jsx("span",{className:"font-medium",children:"Alternative:"}),s.jsx("span",{children:T(A.alternative_date)}),A.alternative_time&&s.jsxs("span",{children:["at ",D(A.alternative_time)]})]})]})]})]},A.id))}),s.jsx(Tt,{open:c,onOpenChange:u,children:s.jsxs(Dt,{className:"max-w-[min(100vw-2rem,28rem)] sm:max-w-md",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Update Request"}),s.jsxs(rr,{children:["Update the status and add admin notes for ",o==null?void 0:o.business_name]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"status",children:"Status"}),s.jsxs(Wt,{value:b.status,onValueChange:A=>w(R=>({...R,status:A})),children:[s.jsx(Ht,{children:s.jsx(qt,{placeholder:"Select status"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"pending",children:"Pending"}),s.jsx(Ae,{value:"in_progress",children:"In Progress"}),s.jsx(Ae,{value:"approved",children:"Approved"}),s.jsx(Ae,{value:"completed",children:"Completed"}),s.jsx(Ae,{value:"cancelled",children:"Cancelled"}),s.jsx(Ae,{value:"archived",children:"Archived"})]})]})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"admin_notes",children:"Admin Notes"}),s.jsx(zt,{id:"admin_notes",value:b.admin_notes,onChange:A=>w(R=>({...R,admin_notes:A.target.value})),placeholder:"Add notes about this request...",rows:3})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",onClick:()=>u(!1),disabled:f,children:"Cancel"}),s.jsx(Y,{onClick:E,disabled:f,className:"bg-chamber-blue hover:bg-chamber-blue-dark",children:f?"Updating...":"Update Request"})]})]})}),s.jsx(Tt,{open:d,onOpenChange:h,children:s.jsxs(Dt,{className:"max-w-[min(100vw-2rem,42rem)] max-h-[85vh] overflow-y-auto p-4 sm:p-6",children:[s.jsxs(It,{children:[s.jsxs(Ot,{className:"flex items-center gap-2",children:[s.jsx(zl,{className:"h-5 w-5 text-chamber-blue"}),o==null?void 0:o.business_name]}),s.jsx(rr,{children:"Ribbon cutting request details"})]}),o&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx(Z,{className:"text-sm font-medium",children:"Contact Person"}),s.jsx("p",{className:"text-sm break-words overflow-hidden",children:o.contact_person})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx(Z,{className:"text-sm font-medium",children:"Status"}),s.jsx("div",{className:"mt-1",children:C(o.status)})]})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx(Z,{className:"text-sm font-medium",children:"Email"}),s.jsx("p",{className:"text-sm break-words overflow-hidden",children:o.email})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx(Z,{className:"text-sm font-medium",children:"Phone"}),s.jsx("p",{className:"text-sm break-words overflow-hidden",children:o.phone||"Not provided"})]})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx(Z,{className:"text-sm font-medium",children:"Business Address"}),s.jsx("p",{className:"text-sm break-words overflow-hidden",children:o.business_address})]}),o.preferred_date&&s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx(Z,{className:"text-sm font-medium",children:"Preferred Date"}),s.jsx("p",{className:"text-sm break-words overflow-hidden",children:T(o.preferred_date)})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx(Z,{className:"text-sm font-medium",children:"Preferred Time"}),s.jsx("p",{className:"text-sm break-words overflow-hidden",children:o.preferred_time?D(o.preferred_time):"Not specified"})]})]}),o.alternative_date&&s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx(Z,{className:"text-sm font-medium",children:"Alternative Date"}),s.jsx("p",{className:"text-sm break-words overflow-hidden",children:T(o.alternative_date)})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx(Z,{className:"text-sm font-medium",children:"Alternative Time"}),s.jsx("p",{className:"text-sm break-words overflow-hidden",children:o.alternative_time?D(o.alternative_time):"Not specified"})]})]}),o.expected_attendees&&s.jsxs("div",{className:"min-w-0",children:[s.jsx(Z,{className:"text-sm font-medium",children:"Expected Attendees"}),s.jsx("p",{className:"text-sm break-words overflow-hidden",children:o.expected_attendees})]}),o.event_description&&s.jsxs("div",{className:"min-w-0",children:[s.jsx(Z,{className:"text-sm font-medium",children:"Event Description"}),s.jsx("p",{className:"text-sm whitespace-pre-wrap break-words overflow-hidden",children:o.event_description})]}),o.special_requirements&&s.jsxs("div",{className:"min-w-0",children:[s.jsx(Z,{className:"text-sm font-medium",children:"Special Requirements"}),s.jsx("p",{className:"text-sm whitespace-pre-wrap break-words overflow-hidden",children:o.special_requirements})]}),o.admin_notes&&s.jsxs("div",{className:"min-w-0",children:[s.jsx(Z,{className:"text-sm font-medium",children:"Admin Notes"}),s.jsx("p",{className:"text-sm whitespace-pre-wrap break-words overflow-hidden bg-gray-50 p-3 rounded",children:o.admin_notes})]}),s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 text-xs text-muted-foreground",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx(Z,{className:"text-xs font-medium",children:"Created"}),s.jsx("p",{className:"break-words overflow-hidden",children:T(o.created_at)})]}),s.jsxs("div",{className:"min-w-0",children:[s.jsx(Z,{className:"text-xs font-medium",children:"Last Updated"}),s.jsx("p",{className:"break-words overflow-hidden",children:T(o.updated_at)})]})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",onClick:()=>h(!1),children:"Close"}),s.jsxs(Y,{onClick:()=>{h(!1),o&&N(o)},className:"bg-chamber-blue hover:bg-chamber-blue-dark",children:[s.jsx(zs,{className:"h-4 w-4 mr-1"}),"Update Request"]})]})]})})]})},Y5e=({isOpen:t,onClose:e,onSuccess:r})=>{const[n,a]=x.useState({name:"",description:"",amount:"",application_deadline:"",is_active:!0,eligibility_requirements:[""],selection_criteria:[""]}),[i,o]=x.useState(!1),{toast:l}
1307=St(),c=async w=>{if(w.preventDefault(),!n.name.trim()||!n.description.trim()||!n.amount.trim()){l({title:"Error",description:"Please fill in all required fields (Name, Description, and Amount)",variant:"destructive"});return}try{o(!0);const j={name:n.name.trim(),description:n.description.trim(),amount:n.amount.trim(),application_deadline:n.application_deadline.trim(),is_active:n.is_active,eligibility_requirements:n.eligibility_requirements.filter(N=>N.trim()),selection_criteria:n.selection_criteria.filter(N=>N.trim())};await g0.createScholarship(j),l({title:"Success",description:"Scholarship created successfully"}),r()}catch(j){console.error("Error creating scholarship:",j),l({title:"Error",description:"Failed to create scholarship",variant:"destructive"})}finally{o(!1)}},u=()=>{a(w=>({...w,eligibility_requirements:[...w.eligibility_requirements,""]}))},d=w=>{a(j=>({...j,eligibility_requirements:j.eligibility_requirements.filter((N,S)=>S!==w)}))},h=(w,j)=>{a(N=>({...N,eligibility_requirements:N.eligibility_requirements.map((S,E)=>E===w?j:S)}))},f=()=>{a(w=>({...w,selection_criteria:[...w.selection_criteria,""]}))},m=w=>{a(j=>({...j,selection_criteria:j.selection_criteria.filter((N,S)=>S!==w)}))},g=(w,j)=>{a(N=>({...N,selection_criteria:N.selection_criteria.map((S,E)=>E===w?j:S)}))},y=()=>{i||(a({name:"",description:"",amount:"",application_deadline:"",is_active:!0,eligibility_requirements:[""],selection_criteria:[""]}),e())},b=x.useCallback(w=>{a(j=>({...j,is_active:w}))},[]);return s.jsx(Tt,{open:t,onOpenChange:y,children:s.jsx(Dt,{className:"sm:max-w-[700px] max-h-[90vh] overflow-y-auto",children:s.jsxs("form",{onSubmit:c,children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Create New Scholarship"}),s.jsx(rr,{children:"Fill out the form below to create a new scholarship program."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"name",className:"text-right",children:"Scholarship Name *"}),s.jsx(Ne,{id:"name",value:n.name,onChange:w=>a(j=>({...j,name:w.target.value})),className:"col-span-3",placeholder:"e.g., Chamber Excellence Scholarship",required:!0,disabled:i})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"amount",className:"text-right",children:"Award Amount *"}),s.jsx(Ne,{id:"amount",value:n.amount,onChange:w=>a(j=>({...j,amount:w.target.value})),className:"col-span-3",placeholder:"e.g., $2,500",required:!0,disabled:i})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"description",className:"text-right pt-2",children:"Description *"}),s.jsx(zt,{id:"description",value:n.description,onChange:w=>a(j=>({...j,description:w.target.value})),className:"col-span-3",placeholder:"Describe the scholarship purpose and goals...",rows:3,required:!0,disabled:i})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"deadline",className:"text-right",children:"Application Deadline"}),s.jsx(Ne,{id:"deadline",type:"date",value:n.application_deadline,onChange:w=>a(j=>({...j,application_deadline:w.target.value})),className:"col-span-3",disabled:i})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx("div",{className:"text-right pt-2",children:s.jsx(Z,{children:"Eligibility Requirements"})}),s.jsxs("div",{className:"col-span-3 space-y-2",children:[s.jsx("div",{className:"flex justify-end mb-2",children:s.jsxs(Y,{type:"button",variant:"outline",size:"sm",onClick:u,disabled:i,children:[s.jsx(vs,{className:"w-4 h-4 mr-2"}),"Add Requirement"]})}),n.eligibility_requirements.map((w,j)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ne,{value:w,onChange:N=>h(j,N.target.value),placeholder:"Enter eligibility requirement...",className:"flex-1",disabled:i}),n.eligibility_requirements.length>1&&s.jsx(Y,{type:"button",variant:"outline",size:"sm",onClick:()=>d(j),disabled:i,children:s.jsx(vr,{className:"w-4 h-4"})})]},j))]})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx("div",{className:"text-right pt-2",children:s.jsx(Z,{children:"Selection Criteria"})}),s.jsxs("div",{className:"col-span-3 space-y-2",children:[s.jsx("div",{className:"flex justify-end mb-2",children:s.jsxs(Y,{type:"button",variant:"outline",size:"sm",onClick:f,disabled:i,children:[s.jsx(vs,{className:"w-4 h-4 mr-2"}),"Add Criteria"]})}),n.selection_criteria.map((w,j)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ne,{value:w,onChange:N=>g(j,N.target.value),placeholder:"Enter selection criteria...",className:"flex-1",disabled:i}),n.selection_criteria.length>1&&s.jsx(Y,{type:"button",variant:"outline",size:"sm",onClick:()=>m(j),disabled:i,children:s.jsx(vr,{className:"w-4 h-4"})})]},j))]})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"is_active",className:"text-right",children:"Status"}),s.jsxs("div",{className:"col-span-3 flex items-center space-x-2",children:[s.jsx(ii,{id:"is_active",checked:n.is_active,onCheckedChange:b,disabled:i}),s.jsx(Z,{htmlFor:"is_active",children:"Active Scholarship"})]})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",type:"button",onClick:y,disabled:i,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:i,children:i?"Creating...":"Create Scholarship"})]})]})})})},Z5e=({isOpen:t,scholarship:e,onClose:r,onSuccess:n})=>{const[a,i]=x.useState({name:"",description:"",amount:"",application_deadline:"",is_active:!0,eligibility_requirements:[""],selection_criteria:[""]}),[o,l]=x.useState(!1),{toast:c}=St();x.useEffect(()=>{if(e){let j=e.application_deadline;if(!e.application_deadline)j="";else try{const N=new Date(e.application_deadline);isNaN(N.getTime())?j="":j=N.toISOString().split("T")[0]}catch{j=""}i({name:e.name||"",description:e.description||"",amount:String(e.amount||""),application_deadline:j,is_active:e.is_active,eligibility_requirements:e.eligibility_requirements.length>0?e.eligibility_requirements:[""],selection_criteria:e.selection_criteria.length>0?e.selection_criteria:[""]})}},[e]);const u=async j=>{if(j.preventDefault(),!a.name.trim()||!a.description.trim()||!a.amount.trim()){c({title:"Error",description:"Please fill in all required fields (Name, Description, and Amount)",variant:"destructive"});return}try{l(!0);const N={name:a.name.trim(),description:a.description.trim(),amount:a.amount.trim(),application_deadline:a.application_deadline.trim(),is_active:a.is_active,eligibility_requirements:a.eligibility_requirements.filter(S=>S.trim()),selection_criteria:a.selection_criteria.filter(S=>S.trim())};await g0.updateScholarship(e.id,N),c({title:"Success",description:"Scholarship updated successfully"}),n()}catch(N){console.error("Error updating scholarship:",N),c({title:"Error",description:"Failed to update scholarship",variant:"destructive"})}finally{l(!1)}},d=()=>{i(j=>({...j,eligibility_requirements:[...j.eligibility_requirements,""]}))},h=j=>{i(N=>({...N,eligibility_requirements:N.eligibility_requirements.filter((S,E)=>E!==j)}))},f=(j,N)=>{i(S=>({...S,eligibility_requirements:S.eligibility_requirements.map((E,C)=>C===j?N:E)}))},m=()=>{i(j=>({...j,selection_criteria:[...j.selection_criteria,""]}))},g=j=>{i(N=>({...N,selection_criteria:N.selection_criteria.filter((S,E)=>E!==j)}))},y=(j,N)=>{i(S=>({...S,selection_criteria:S.selection_criteria.map((E,C)=>C===j?N:E)}))},b=()=>{o||(i({name:"",description:"",amount:"",application_deadline:"",is_active:!0,eligibility_requirements:[""],selection_criteria:[""]}),r())},w=x.useCallback(j=>{i(N=>({...N,is_active:j}))},[]);return s.jsx(Tt,{open:t,onOpenChange:b,children:s.jsx(Dt,{className:"sm:max-w-[700px] max-h-[90vh] overflow-y-auto",children:s.jsxs("form",{onSubmit:u,children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Edit Scholarship"}),s.jsx(rr,{children:"Update the scholarship details below."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"name",className:"text-right",children:"Scholarship Name *"}),s.jsx(Ne,{id:"name",value:a.name,onChange:j=>i(N=>({...N,name:j.target.value})),className:"col-span-3",placeholder:"e.g., Chamber Excellence Scholarship",required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"amount",className:"text-right",children:"Award Amount *"}),s.jsx(Ne,{id:"amount",value:a.amount,onChange:j=>i(N=>({...N,amount:j.target.value})),className:"col-span-3",placeholder:"e.g., $2,500",required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"description",className:"text-right pt-2",children:"Description *"}),s.jsx(zt,{id:"description",value:a.description,onChange:j=>i(N=>({...N,description:j.target.value})),className:"col-span-3",placeholder:"Describe the scholarship purpose and goals...",rows:3,required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"deadline",className:"text-right",children:"Application Deadline"}),s.jsx(Ne,{id:"deadline",type:"date",value:a.application_deadline,onChange:j=>i(N=>({...N,application_deadline:j.target.value})),className:"col-span-3",disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx("div",{className:"text-right pt-2",children:s.jsx(Z,{children:"Eligibility Requirements"})}),s.jsxs("div",{className:"col-span-3 space-y-2",children:[s.jsx("div",{className:"flex justify-end mb-2",children:s.jsxs(Y,{type:"button",variant:"outline",size:"sm",onClick:d,disabled:o,children:[s.jsx(vs,{className:"w-4 h-4 mr-2"}),"Add Requirement"]})}),a.eligibility_requirements.map((j,N)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ne,{value:j,onChange:S=>f(N,S.target.value),placeholder:"Enter eligibility requirement...",className:"flex-1",disabled:o}),a.eligibility_requirements.length>1&&s.jsx(Y,{type:"button",variant:"outline",size:"sm",onClick:()=>h(N),disabled:o,children:s.jsx(vr,{className:"w-4 h-4"})})]},N))]})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx("div",{className:"text-right pt-2",children:s.jsx(Z,{children:"Selection Criteria"})}),s.jsxs("div",{className:"col-span-3 space-y-2",children:[s.jsx("div",{className:"flex justify-end mb-2",children:s.jsxs(Y,{type:"button",variant:"outline",size:"sm",onClick:m,disabled:o,children:[s.jsx(vs,{className:"w-4 h-4 mr-2"}),"Add Criteria"]})}),a.selection_criteria.map((j,N)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ne,{value:j,onChange:S=>y(N,S.target.value),placeholder:"Enter selection criteria...",className:"flex-1",disabled:o}),a.selection_criteria.length>1&&s.jsx(Y,{type:"button",variant:"outline",size:"sm",onClick:()=>g(N),disabled:o,children:s.jsx(vr,{className:"w-4 h-4"})})]},N))]})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"is_active",className:"text-right",children:"Status"}),s.jsxs("div",{className:"col-span-3 flex items-center space-x-2",children:[s.jsx(ii,{id:"is_active",checked:a.is_active,onCheckedChange:w,disabled:o}),s.jsx(Z,{htmlFor:"is_active",children:"Active Scholarship"})]})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",type:"button",onClick:b,disabled:o,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:o,children:o?"Updating...":"Update Scholarship"})]})]})})})},PU=({value:t,onChange:e,disabled:r=!1,label:n="Profile Image",placeholder:a="https://example.com/profile-image.jpg",error:i})=>{const{toast:o}=St(),l=x.useRef(null),[c,u]=x.useState(!1),[d,h]=x.useState(!1),f=async N=>{var S;try{if(u(!0),!N.type.startsWith("image/"))throw new Error("Please select an image file");if(N.size>5*1024*1024)throw new Error("Image size must be less than 5MB");const E=((S=N.name.split(".").pop())==null?void 0:S.toLowerCase())||"jpg",T=`scholarships/${`scholarship-${Date.now()}-${Math.random().toString(36).substring(2)}.${E}`}`,{data:D,error:A}=await Q.storage.from("deal-images").upload(T,N,{cacheControl:"3600",upsert:!1});if(A)throw console.error("Supabase upload error:",A),new Error(A.message||"Failed to upload image");const{data:{publicUrl:R}}=Q.storage.from("deal-images").getPublicUrl(D.path);e(R),o({title:"Success",description:"Profile image uploaded successfully"})}catch(E){console.error("Error uploading profile image:",E),o({title:"Upload Error",description:E.message||"Failed to upload profile image",variant:"destructive"})}finally{u(!1)}},m=N=>{var E;const S=(E=N.target.files)==null?void 0:E[0];S&&f(S)},g=N=>{N.preventDefault(),h(!1);const S=N.dataTransfer.files[0];S&&f(S)},y=N=>{N.preventDefault(),h(!0)},b=N=>{N.preventDefault(),h(!1)},w=()=>{e("")},j=N=>{e(N)};return s.jsxs("div",{className:"space-y-4",children:[s.jsx(Z,{className:i?"text-red-600":"",children:n}),s.jsxs(sn,{defaultValue:"upload",className:"w-full",children:[s.jsxs(Qs,{className:"grid w-full grid-cols-2",children:[s.jsxs(Gt,{value:"upload",className:"flex items-center gap-2",children:[s.jsx(vn,{className:"h-4 w-4"}),"Upload"]}),s.jsxs(Gt,{value:"url",className:"flex items-center gap-2",children:[s.jsx(dp,{className:"h-4 w-4"}),"URL"]})]}),s.jsxs(Rt,{value:"upload",className:"space-y-3",children:[t&&s.jsxs("div",{className:"relative",children:[s.jsx("img",{src:t,alt:"Profile preview",className:"w-full h-48 object-cover rounded-lg border"}),s.jsx(Y,{type:"button",variant:"destructive",size:"sm",onClick:w,className:"absolute top-2 right-2",disabled:r,children:s.jsx(Ir,{className:"h-4 w-4"})})]}),s.jsx("div",{className:`border-2 border-dashed rounded-lg p-6 text-center transition-colors ${d?"border-blue-500 bg-blue-50":"border-gray-300"}`,onDrop:g,onDragOver:y,onDragLeave:b,children:c?s.jsxs("div",{className:"flex items-center justify-center gap-2",children:[s.jsx(Mt,{className:"h-6 w-6 animate-spin"}),s.jsx("span",{children:"Uploading..."})]}):s.jsxs("div",{children:[s.jsx(vi,{className:"h-12 w-12 mx-auto text-gray-400 mb-4"}),s.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Drag and drop an image here, or click to browse"}),s.jsx("p",{className:"text-xs text-gray-500",children:"Supports JPG, PNG, GIF. Max 5MB."})]})}),s.jsx("input",{ref:l,type:"file",accept:"image/*",onChange:m,className:"hidden",disabled:r||c}),s.jsxs(Y,{type:"button",variant:"outline",onClick:()=>{var N;return(N=l.current)==null?void 0:N.click()},disabled:r||c,className:"w-full",children:[s.jsx(vn,{className:"h-4 w-4 mr-2"}),"Choose Profile Image"]})]}),s.jsxs(Rt,{value:"url",className:"space-y-3",children:[s.jsx(Ne,{value:t,onChange:N=>j(N.target.value),placeholder:a,disabled:r,type:"url",className:i?"border-red-500":""}),s.jsx("p",{className:"text-xs text-gray-500",children:"Enter a direct URL to an image for the profile"})]})]}),i&&s.jsx("p",{className:"text-sm text-red-600",children:i})]})},X5e=({isOpen:t,scholarships:e,onClose:r,onSuccess:n})=>{const[a,i]=x.useState({name:"",school:"",graduation_year:new Date().getFullYear(),scholarship_id:"",bio:"",image_url:"",future_goals:"",is_featured:!1,achievements:[""]}),[o,l]=x.useState(!1),{toast:c}=St(),u=async y=>{if(y.preventDefault(),!a.name.trim()||!a.school.trim()||!a.scholarship_id){c({title:"Error",description:"Please fill in all required fields",variant:"destructive"});return}try{l(!0);const b=e.find(j=>j.id===a.scholarship_id);if(!b)throw new Error("Selected scholarship not found");const w={name:a.name.trim(),school:a.school.trim(),graduation_year:a.graduation_year,scholarship_id:a.scholarship_id,scholarship_name:b.name,amount:b.amount,bio:a.bio.trim()||void 0,image_url:a.image_url.trim()||void 0,future_goals:a.future_goals.trim()||void 0,is_featured:a.is_featured,achievements:a.achievements.filter(j=>j.trim())};await x0.createWinner(w),c({title:"Success",description:"Scholarship winner created successfully"}),n()}catch(b){console.error("Error creating winner:",b),c({title:"Error",description:"Failed to create scholarship winner",variant:"destructive"})}finally{l(!1)}},d=()=>{i(y=>({...y,achievements:[...y.achievements,""]}))},h=y=>{i(b=>({...b,achievements:b.achievements.filter((w,j)=>j!==y)}))},f=(y,b)=>{i(w=>({...w,achievements:w.achievements.map((j,N)=>N===y?b:j)}))},m=()=>{o||(i({name:"",school:"",graduation_year:new Date().getFullYear(),scholarship_id:"",bio:"",image_url:"",future_goals:"",is
1307_featured:!1,achievements:[""]}),r())},g=x.useCallback(y=>{i(b=>({...b,is_featured:y}))},[]);return s.jsx(Tt,{open:t,onOpenChange:m,children:s.jsx(Dt,{className:"sm:max-w-[700px] max-h-[90vh] overflow-y-auto",children:s.jsxs("form",{onSubmit:u,children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Add Scholarship Winner"}),s.jsx(rr,{children:"Fill out the form below to add a new scholarship winner."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"name",className:"text-right",children:"Student Name *"}),s.jsx(Ne,{id:"name",value:a.name,onChange:y=>i(b=>({...b,name:y.target.value})),className:"col-span-3",placeholder:"e.g., Sarah Johnson",required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"school",className:"text-right",children:"School *"}),s.jsx(Ne,{id:"school",value:a.school,onChange:y=>i(b=>({...b,school:y.target.value})),className:"col-span-3",placeholder:"e.g., Valley Stream Central High School",required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"graduation_year",className:"text-right",children:"Graduation Year *"}),s.jsx(Ne,{id:"graduation_year",type:"number",value:a.graduation_year,onChange:y=>i(b=>({...b,graduation_year:parseInt(y.target.value)})),className:"col-span-3",min:"2020",max:"2030",required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"scholarship",className:"text-right",children:"Scholarship *"}),s.jsxs(Wt,{value:a.scholarship_id,onValueChange:y=>i(b=>({...b,scholarship_id:y})),disabled:o,children:[s.jsx(Ht,{className:"col-span-3",children:s.jsx(qt,{placeholder:"Select scholarship"})}),s.jsx($t,{children:e.map(y=>s.jsxs(Ae,{value:y.id,children:[y.name," (",y.amount,")"]},y.id))})]})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"bio",className:"text-right pt-2",children:"Biography"}),s.jsx(zt,{id:"bio",value:a.bio,onChange:y=>i(b=>({...b,bio:y.target.value})),className:"col-span-3",placeholder:"Tell us about this student's accomplishments and background...",rows:3,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"future_goals",className:"text-right pt-2",children:"Future Goals"}),s.jsx(zt,{id:"future_goals",value:a.future_goals,onChange:y=>i(b=>({...b,future_goals:y.target.value})),className:"col-span-3",placeholder:"What are their plans for the future?",rows:2,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx("div",{className:"text-right pt-2",children:s.jsx(Z,{children:"Profile Image"})}),s.jsx("div",{className:"col-span-3",children:s.jsx(PU,{value:a.image_url,onChange:y=>i(b=>({...b,image_url:y})),disabled:o,label:"",placeholder:"https://example.com/profile-image.jpg"})})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx("div",{className:"text-right pt-2",children:s.jsx(Z,{children:"Achievements"})}),s.jsxs("div",{className:"col-span-3 space-y-2",children:[s.jsx("div",{className:"flex justify-end mb-2",children:s.jsxs(Y,{type:"button",variant:"outline",size:"sm",onClick:d,disabled:o,children:[s.jsx(vs,{className:"w-4 h-4 mr-2"}),"Add Achievement"]})}),a.achievements.map((y,b)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ne,{value:y,onChange:w=>f(b,w.target.value),placeholder:"Enter achievement...",className:"flex-1",disabled:o}),a.achievements.length>1&&s.jsx(Y,{type:"button",variant:"outline",size:"sm",onClick:()=>h(b),disabled:o,children:s.jsx(vr,{className:"w-4 h-4"})})]},b))]})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"is_featured",className:"text-right",children:"Status"}),s.jsxs("div",{className:"col-span-3 flex items-center space-x-2",children:[s.jsx(ii,{id:"is_featured",checked:a.is_featured,onCheckedChange:g,disabled:o}),s.jsx(Z,{htmlFor:"is_featured",children:"Featured Winner"})]})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",type:"button",onClick:m,disabled:o,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:o,children:o?"Creating...":"Add Winner"})]})]})})})},Q5e=({isOpen:t,winner:e,scholarships:r,onClose:n,onSuccess:a})=>{const[i,o]=x.useState({name:"",school:"",graduation_year:new Date().getFullYear(),scholarship_id:"",bio:"",image_url:"",future_goals:"",is_featured:!1,achievements:[""]}),[l,c]=x.useState(!1),{toast:u}=St();x.useEffect(()=>{e&&o({name:e.name,school:e.school,graduation_year:e.graduation_year,scholarship_id:e.scholarship_id,bio:e.bio||"",image_url:e.image_url||"",future_goals:e.future_goals||"",is_featured:e.is_featured,achievements:e.achievements.length>0?e.achievements:[""]})},[e]);const d=async b=>{if(b.preventDefault(),!i.name.trim()||!i.school.trim()||!i.scholarship_id){u({title:"Error",description:"Please fill in all required fields",variant:"destructive"});return}try{c(!0);const w=r.find(N=>N.id===i.scholarship_id);if(!w)throw new Error("Selected scholarship not found");const j={name:i.name.trim(),school:i.school.trim(),graduation_year:i.graduation_year,scholarship_id:i.scholarship_id,scholarship_name:w.name,amount:w.amount,bio:i.bio.trim()||void 0,image_url:i.image_url.trim()||void 0,future_goals:i.future_goals.trim()||void 0,is_featured:i.is_featured,achievements:i.achievements.filter(N=>N.trim())};await x0.updateWinner(e.id,j),u({title:"Success",description:"Scholarship winner updated successfully"}),a()}catch(w){console.error("Error updating winner:",w),u({title:"Error",description:"Failed to update scholarship winner",variant:"destructive"})}finally{c(!1)}},h=()=>{o(b=>({...b,achievements:[...b.achievements,""]}))},f=b=>{o(w=>({...w,achievements:w.achievements.filter((j,N)=>N!==b)}))},m=(b,w)=>{o(j=>({...j,achievements:j.achievements.map((N,S)=>S===b?w:N)}))},g=()=>{l||n()},y=x.useCallback(b=>{o(w=>({...w,is_featured:b}))},[]);return s.jsx(Tt,{open:t,onOpenChange:g,children:s.jsx(Dt,{className:"sm:max-w-[700px] max-h-[90vh] overflow-y-auto",children:s.jsxs("form",{onSubmit:d,children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Edit Scholarship Winner"}),s.jsx(rr,{children:"Update the scholarship winner details below."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"name",className:"text-right",children:"Student Name *"}),s.jsx(Ne,{id:"name",value:i.name,onChange:b=>o(w=>({...w,name:b.target.value})),className:"col-span-3",placeholder:"e.g., Sarah Johnson",required:!0,disabled:l})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"school",className:"text-right",children:"School *"}),s.jsx(Ne,{id:"school",value:i.school,onChange:b=>o(w=>({...w,school:b.target.value})),className:"col-span-3",placeholder:"e.g., Valley Stream Central High School",required:!0,disabled:l})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"graduation_year",className:"text-right",children:"Graduation Year *"}),s.jsx(Ne,{id:"graduation_year",type:"number",value:i.graduation_year,onChange:b=>o(w=>({...w,graduation_year:parseInt(b.target.value)})),className:"col-span-3",min:"2020",max:"2030",required:!0,disabled:l})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"scholarship",className:"text-right",children:"Scholarship *"}),s.jsxs(Wt,{value:i.scholarship_id,onValueChange:b=>o(w=>({...w,scholarship_id:b})),disabled:l,children:[s.jsx(Ht,{className:"col-span-3",children:s.jsx(qt,{placeholder:"Select scholarship"})}),s.jsx($t,{children:r.map(b=>s.jsxs(Ae,{value:b.id,children:[b.name," (",b.amount,")"]},b.id))})]})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"bio",className:"text-right pt-2",children:"Biography"}),s.jsx(zt,{id:"bio",value:i.bio,onChange:b=>o(w=>({...w,bio:b.target.value})),className:"col-span-3",placeholder:"Tell us about this student's accomplishments and background...",rows:3,disabled:l})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"future_goals",className:"text-right pt-2",children:"Future Goals"}),s.jsx(zt,{id:"future_goals",value:i.future_goals,onChange:b=>o(w=>({...w,future_goals:b.target.value})),className:"col-span-3",placeholder:"What are their plans for the future?",rows:2,disabled:l})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx("div",{className:"text-right pt-2",children:s.jsx(Z,{children:"Profile Image"})}),s.jsx("div",{className:"col-span-3",children:s.jsx(PU,{value:i.image_url,onChange:b=>o(w=>({...w,image_url:b})),disabled:l,label:"",placeholder:"https://example.com/profile-image.jpg"})})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx("div",{className:"text-right pt-2",children:s.jsx(Z,{children:"Achievements"})}),s.jsxs("div",{className:"col-span-3 space-y-2",children:[s.jsx("div",{className:"flex justify-end mb-2",children:s.jsxs(Y,{type:"button",variant:"outline",size:"sm",onClick:h,disabled:l,children:[s.jsx(vs,{className:"w-4 h-4 mr-2"}),"Add Achievement"]})}),i.achievements.map((b,w)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ne,{value:b,onChange:j=>m(w,j.target.value),placeholder:"Enter achievement...",className:"flex-1",disabled:l}),i.achievements.length>1&&s.jsx(Y,{type:"button",variant:"outline",size:"sm",onClick:()=>f(w),disabled:l,children:s.jsx(vr,{className:"w-4 h-4"})})]},w))]})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"is_featured",className:"text-right",children:"Status"}),s.jsxs("div",{className:"col-span-3 flex items-center space-x-2",children:[s.jsx(ii,{id:"is_featured",checked:i.is_featured,onCheckedChange:y,disabled:l}),s.jsx(Z,{htmlFor:"is_featured",children:"Featured Winner"})]})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",type:"button",onClick:g,disabled:l,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:l,children:l?"Updating...":"Update Winner"})]})]})})})},eAe=({isOpen:t,onClose:e,onSuccess:r})=>
1307{const[n,a]=x.useState({name:"",school:"",email:"",phone:"",office_hours:"",is_active:!0}),[i,o]=x.useState(!1),{toast:l}=St(),c=async h=>{if(h.preventDefault(),!n.name.trim()||!n.school.trim()||!n.email.trim()){l({title:"Error",description:"Please fill in all required fields",variant:"destructive"});return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(n.email.trim())){l({title:"Error",description:"Please enter a valid email address",variant:"destructive"});return}try{o(!0);const m={name:n.name.trim(),school:n.school.trim(),email:n.email.trim(),phone:n.phone.trim()||void 0,office_hours:n.office_hours.trim()||void 0,is_active:n.is_active};await y0.createCounselor(m),l({title:"Success",description:"Guidance counselor created successfully"}),r()}catch(m){console.error("Error creating counselor:",m),l({title:"Error",description:"Failed to create guidance counselor",variant:"destructive"})}finally{o(!1)}},u=()=>{i||(a({name:"",school:"",email:"",phone:"",office_hours:"",is_active:!0}),e())},d=x.useCallback(h=>{a(f=>({...f,is_active:h}))},[]);return s.jsx(Tt,{open:t,onOpenChange:u,children:s.jsx(Dt,{className:"sm:max-w-[600px] max-h-[90vh] overflow-y-auto",children:s.jsxs("form",{onSubmit:c,children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Add Guidance Counselor"}),s.jsx(rr,{children:"Fill out the form below to add a new guidance counselor."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"name",className:"text-right",children:"Counselor Name *"}),s.jsx(Ne,{id:"name",value:n.name,onChange:h=>a(f=>({...f,name:h.target.value})),className:"col-span-3",placeholder:"e.g., Ms. Jennifer Martinez",required:!0,disabled:i})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"school",className:"text-right",children:"School *"}),s.jsx(Ne,{id:"school",value:n.school,onChange:h=>a(f=>({...f,school:h.target.value})),className:"col-span-3",placeholder:"e.g., Valley Stream Central High School",required:!0,disabled:i})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"email",className:"text-right",children:"Email Address *"}),s.jsx(Ne,{id:"email",type:"email",value:n.email,onChange:h=>a(f=>({...f,email:h.target.value})),className:"col-span-3",placeholder:"e.g., [email protected]",required:!0,disabled:i})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"phone",className:"text-right",children:"Phone Number"}),s.jsx(Ne,{id:"phone",value:n.phone,onChange:h=>a(f=>({...f,phone:h.target.value})),className:"col-span-3",placeholder:"e.g., (516) 555-0123",disabled:i})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"office_hours",className:"text-right pt-2",children:"Office Hours"}),s.jsx(zt,{id:"office_hours",value:n.office_hours,onChange:h=>a(f=>({...f,office_hours:h.target.value})),className:"col-span-3",placeholder:"e.g., Monday-Friday: 8:00 AM - 3:30 PM",rows:2,disabled:i})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"is_active",className:"text-right",children:"Status"}),s.jsxs("div",{className:"col-span-3 flex items-center space-x-2",children:[s.jsx(ii,{id:"is_active",checked:n.is_active,onCheckedChange:d,disabled:i}),s.jsx(Z,{htmlFor:"is_active",children:"Active Counselor"})]})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",type:"button",onClick:u,disabled:i,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:i,children:i?"Creating...":"Add Counselor"})]})]})})})},tAe=({isOpen:t,counselor:e,onClose:r,onSuccess:n})=>{const[a,i]=x.useState({name:"",school:"",email:"",phone:"",office_hours:"",is_active:!0}),[o,l]=x.useState(!1),{toast:c}=St();x.useEffect(()=>{e&&i({name:e.name,school:e.school,email:e.email,phone:e.phone||"",office_hours:e.office_hours||"",is_active:e.is_active})},[e]);const u=async f=>{if(f.preventDefault(),!a.name.trim()||!a.school.trim()||!a.email.trim()){c({title:"Error",description:"Please fill in all required fields",variant:"destructive"});return}if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a.email.trim())){c({title:"Error",description:"Please enter a valid email address",variant:"destructive"});return}try{l(!0);const g={name:a.name.trim(),school:a.school.trim(),email:a.email.trim(),phone:a.phone.trim()||void 0,office_hours:a.office_hours.trim()||void 0,is_active:a.is_active};await y0.updateCounselor(e.id,g),c({title:"Success",description:"Guidance counselor updated successfully"}),n()}catch(g){console.error("Error updating counselor:",g),c({title:"Error",description:"Failed to update guidance counselor",variant:"destructive"})}finally{l(!1)}},d=()=>{o||r()},h=x.useCallback(f=>{i(m=>({...m,is_active:f}))},[]);return s.jsx(Tt,{open:t,onOpenChange:d,children:s.jsx(Dt,{className:"sm:max-w-[600px] max-h-[90vh] overflow-y-auto",children:s.jsxs("form",{onSubmit:u,children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Edit Guidance Counselor"}),s.jsx(rr,{children:"Update the guidance counselor details below."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"name",className:"text-right",children:"Counselor Name *"}),s.jsx(Ne,{id:"name",value:a.name,onChange:f=>i(m=>({...m,name:f.target.value})),className:"col-span-3",placeholder:"e.g., Ms. Jennifer Martinez",required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"school",className:"text-right",children:"School *"}),s.jsx(Ne,{id:"school",value:a.school,onChange:f=>i(m=>({...m,school:f.target.value})),className:"col-span-3",placeholder:"e.g., Valley Stream Central High School",required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"email",className:"text-right",children:"Email Address *"}),s.jsx(Ne,{id:"email",type:"email",value:a.email,onChange:f=>i(m=>({...m,email:f.target.value})),className:"col-span-3",placeholder:"e.g., [email protected]",required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"phone",className:"text-right",children:"Phone Number"}
1307),s.jsx(Ne,{id:"phone",value:a.phone,onChange:f=>i(m=>({...m,phone:f.target.value})),className:"col-span-3",placeholder:"e.g., (516) 555-0123",disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"office_hours",className:"text-right pt-2",children:"Office Hours"}),s.jsx(zt,{id:"office_hours",value:a.office_hours,onChange:f=>i(m=>({...m,office_hours:f.target.value})),className:"col-span-3",placeholder:"e.g., Monday-Friday: 8:00 AM - 3:30 PM",rows:2,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"is_active",className:"text-right",children:"Status"}),s.jsxs("div",{className:"col-span-3 flex items-center space-x-2",children:[s.jsx(ii,{id:"is_active",checked:a.is_active,onCheckedChange:h,disabled:o}),s.jsx(Z,{htmlFor:"is_active",children:"Active Counselor"})]})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",type:"button",onClick:d,disabled:o,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:o,children:o?"Updating...":"Update Counselor"})]})]})})})},rAe=()=>{const{siteSettings:t,refreshSettings:e}=mp(),{toast:r}=St(),[n,a]=x.useState((t==null?void 0:t.paypal_button_text)||"Donate via PayPal"),[i,o]=x.useState((t==null?void 0:t.paypal_button_url)||"https://www.paypal.com/donate"),[l,c]=x.useState(!1);Oe.useEffect(()=>{t&&(a(t.paypal_button_text||"Donate via PayPal"),o(t.paypal_button_url||"https://www.paypal.com/donate"))},[t]);const u=async()=>{try{c(!0),await Ch.updateSiteSettings({paypal_button_text:n,paypal_button_url:i}),await e(),r({title:"Success",description:"PayPal button settings updated successfully"})}catch(h){console.error("Error updating PayPal button settings:",h),r({title:"Error",description:"Failed to update PayPal button settings",variant:"destructive"})}finally{c(!1)}},d=()=>{i&&window.open(i,"_blank")};return s.jsxs(De,{children:[s.jsx(ot,{children:s.jsx(ut,{className:"flex items-center gap-2",children:"PayPal Donation Button Settings"})}),s.jsxs(Be,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"button-text",children:"Button Text"}),s.jsx(Ne,{id:"button-text",value:n,onChange:h=>a(h.target.value),placeholder:"Donate via PayPal"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"button-url",children:"PayPal Donation URL"}),s.jsx(Ne,{id:"button-url",value:i,onChange:h=>o(h.target.value),placeholder:"https://www.paypal.com/donate",type:"url"}),s.jsxs("p",{className:"text-sm text-gray-600",children:["Enter your PayPal donation link. You can create one at"," ",s.jsx("a",{href:"https://www.paypal.com/donate/buttons",target:"_blank",rel:"noopener noreferrer",className:"text-chamber-blue hover:underline",children:"PayPal Donation Buttons"})]})]}),s.jsxs("div",{className:"flex gap-2 pt-4",children:[s.jsxs(Y,{onClick:u,disabled:l,className:"flex items-center gap-2",children:[s.jsx(hp,{className:"w-4 h-4"}),l?"Saving...":"Save Settings"]}),s.jsxs(Y,{variant:"outline",onClick:d,disabled:!i,className:"flex items-center gap-2",children:[s.jsx(wx,{className:"w-4 h-4"}),"Test Button"]})]}),s.jsxs("div",{className:"pt-4 border-t",children:[s.jsx(Z,{className:"text-sm font-medium",children:"Preview:"}),s.jsx("div",{className:"mt-2",children:s.jsx(Y,{onClick:d,disabled:!i,className:"bg-[#0070ba] hover:bg-[#005ea6] text-white",children:n})})]})]})]})},sAe=()=>{const[t,e]=x.useState([]),[r,n]=x.useState([]),[a,i]=x.useState([]),[o,l]=x.useState(!0),[c,u]=x.useState("scholarships"),[d,h]=x.useState(!1),[f,m]=x.useState(!1),[g,y]=x.useState(!1),[b,w]=x.useState(!1),[j,N]=x.useState(!1),[S,E]=x.useState(!1),[C,T]=x.useState(!1),[D,A]=x.useState("scholarship"),[R,M]=x.useState(null),[P,U]=x.useState(""),[I,O]=x.useState(null),[V,G]=x.useState(null),[B,$]=x.useState(null),{toast:W}=St();x.useEffect(()=>{oe()},[]);const oe=async()=>{try{l(!0);const[X,me,ie]=await Promise.all([g0.getAllScholarships(),x0.getAllWinners(),y0.getAllCounselors()]);e(X),n(me),i(ie)}catch(X){console.error("Error loading scholarship data:",X),W({title:"Error",description:"Failed to load scholarship data",variant:"destructive"})}finally{l(!1)}},K=(X,me,ie)=>{A(X),M(me),U(ie),T(!0)},H=async()=>
1307{if(R)try{switch(D){case"scholarship":await g0.deleteScholarship(R),W({title:"Success",description:"Scholarship deleted successfully"});break;case"winner":await x0.deleteWinner(R),W({title:"Success",description:"Scholarship winner deleted successfully"});break;case"counselor":await y0.deleteCounselor(R),W({title:"Success",description:"Guidance counselor deleted successfully"});break}oe()}catch(X){console.error(`Error deleting ${D}:`,X),W({title:"Error",description:`Failed to delete ${D}`,variant:"destructive"})}finally{T(!1),M(null),U("")}};return o?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx(U1,{size:"lg",text:"Loading scholarship data..."})}):s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsx("h1",{className:"text-xl sm:text-2xl md:text-3xl font-bold",children:"Scholarship Management"})}),s.jsxs(sn,{value:c,onValueChange:u,className:"space-y-4 sm:space-y-6",children:[s.jsxs(Qs,{className:"flex w-full flex-wrap sm:grid sm:grid-cols-4 gap-1 p-1 h-auto",children:[s.jsxs(Gt,{value:"scholarships",className:"flex items-center gap-2",children:[s.jsx(Jy,{className:"w-4 h-4"}),"Scholarships (",t.length,")"]}),s.jsxs(Gt,{value:"winners",className:"flex items-center gap-2",children:[s.jsx(Os,{className:"w-4 h-4"}),"Winners (",r.length,")"]}),s.jsxs(Gt,{value:"counselors",className:"flex items-center gap-2",children:[s.jsx(RV,{className:"w-4 h-4"}),"Counselors (",a.length,")"]}),s.jsxs(Gt,{value:"settings",className:"flex items-center gap-2",children:[s.jsx(jd,{className:"w-4 h-4"}),"Settings"]})]}),s.jsxs(Rt,{value:"scholarships",className:"space-y-4 sm:space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[s.jsx("h2",{className:"text-lg sm:text-xl font-semibold",children:"Scholarship Programs"}),s.jsxs(Y,{className:"w-full sm:w-auto",onClick:()=>h(!0),children:[s.jsx(vs,{className:"w-4 h-4 mr-2"}),"Add Scholarship"]})]}),s.jsx("div",{className:"grid gap-4 sm:gap-6",children:t.map(X=>s.jsxs(De,{className:"overflow-hidden",children:[s.jsx(ot,{className:"p-4 sm:p-6",children:s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs(ut,{className:"flex flex-wrap items-center gap-2 text-base sm:text-lg min-w-0",children:[s.jsx("span",{className:"truncate",children:X.name}),s.jsx(ke,{variant:X.is_active?"default":"secondary",className:"shrink-0",children:X.is_active?"Active":"Inactive"})]}),s.jsxs("div",{className:"flex gap-2 shrink-0",children:[s.jsx(Y,{variant:"outline",size:"sm",onClick:()=>{O(X),m(!0)},children:s.jsx(zs,{className:"w-4 h-4"})}),s.jsx(Y,{variant:"outline",size:"sm",onClick:()=>K("scholarship",X.id,X.name),children:s.jsx(vr,{className:"w-4 h-4"})})]})]})}),s.jsx(Be,{className:"p-4 pt-0 sm:p-6 sm:pt-0",children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:["Amount: ",s.jsx("span",{className:"font-semibold text-chamber-gold",children:X.amount})]}),s.jsxs("p",{className:"text-sm text-muted-foreground mb-2",children:["Deadline: ",X.application_deadline]}),s.jsx("p",{className:"text-sm break-words",children:X.description})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium mb-1",children:"Eligibility Requirements:"}),s.jsx("ul",{className:"text-sm text-gray-600 list-disc list-inside",children:X.eligibility_requirements.map((me,ie)=>s.jsx("li",{children:me},ie))})]})]})})]},X.id))})]}),s.jsxs(Rt,{value:"winners",className:"space-y-4 sm:space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[s.jsx("h2",{className:"text-lg sm:text-xl font-semibold",children:"Scholarship Winners"}),s.jsxs(Y,{className:"w-full sm:w-auto",onClick:()=>y(!0),children:[s.jsx(vs,{className:"w-4 h-4 mr-2"}),"Add Winner"]})]}),s.jsx("div",{className:"grid gap-4 sm:gap-6",children:r.map(X=>s.jsxs(De,{className:"overflow-hidden",children:[s.jsx(ot,{className:"p-4 sm:p-6",children:s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs(ut,{className:"flex flex-wrap items-center gap-2 text-base sm:text-lg min-w-0",children:[s.jsx("span",{className:"truncate",children:X.name}),X.is_featured&&s.jsx(ke,{variant:"default",className:"shrink-0",children:"Featured"})]}),s.jsxs("div",{className:"flex gap-2 shrink-0",children:[s.jsx(Y,{variant:"outline",size:"sm",onClick:()=>{G(X),w(!0)},children:s.jsx(zs,{className:"w-4 h-4"})}),s.jsx(Y,{variant:"outline",size:"sm",onClick:()=>K("winner",X.id,X.name),children:s.jsx(vr,{className:"w-4 h-4"})})]})]})}),s.jsx(Be,{className:"p-4 pt-0 sm:p-6 sm:pt-0",children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("p",{className:"text-sm",children:[s.jsx("span",{className:"font-medium",children:"School:"})," ",X.school]}),s.jsxs("p",{className:"text-sm",children:[s.jsx("span",{className:"font-medium",children:"Graduation Year:"})," ",X.graduation_year]}),s.jsxs("p",{className:"text-sm break-words",children:[s.jsx("span",{className:"font-medium",children:"Scholarship:"})," ",X.scholarship_name," (",X.amount,")"]}),X.bio&&s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:X.bio})]})})]},X.id))})]}
1307),s.jsxs(Rt,{value:"counselors",className:"space-y-4 sm:space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[s.jsx("h2",{className:"text-lg sm:text-xl font-semibold",children:"Guidance Counselors"}),s.jsxs(Y,{className:"w-full sm:w-auto",onClick:()=>N(!0),children:[s.jsx(vs,{className:"w-4 h-4 mr-2"}),"Add Counselor"]})]}),s.jsx("div",{className:"grid gap-4 sm:gap-6",children:a.map(X=>s.jsxs(De,{className:"overflow-hidden",children:[s.jsx(ot,{className:"p-4 sm:p-6",children:s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs(ut,{className:"flex flex-wrap items-center gap-2 text-base sm:text-lg min-w-0",children:[s.jsx("span",{className:"truncate",children:X.name}),s.jsx(ke,{variant:X.is_active?"default":"secondary",className:"shrink-0",children:X.is_active?"Active":"Inactive"})]}),s.jsxs("div",{className:"flex gap-2 shrink-0",children:[s.jsx(Y,{variant:"outline",size:"sm",onClick:()=>{$(X),E(!0)},children:s.jsx(zs,{className:"w-4 h-4"})}),s.jsx(Y,{variant:"outline",size:"sm",onClick:()=>K("counselor",X.id,X.name),children:s.jsx(vr,{className:"w-4 h-4"})})]})]})}),s.jsx(Be,{className:"p-4 pt-0 sm:p-6 sm:pt-0",children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("p",{className:"text-sm break-words",children:[s.jsx("span",{className:"font-medium",children:"School:"})," ",X.school]}),s.jsxs("p",{className:"text-sm break-words",children:[s.jsx("span",{className:"font-medium",children:"Email:"})," ",X.email]}),X.phone&&s.jsxs("p",{className:"text-sm",children:[s.jsx("span",{className:"font-medium",children:"Phone:"})," ",X.phone]}),X.office_hours&&s.jsxs("p",{className:"text-sm break-words",children:[s.jsx("span",{className:"font-medium",children:"Office Hours:"})," ",X.office_hours]})]})})]},X.id))})]}),s.jsxs(Rt,{value:"settings",className:"space-y-4 sm:space-y-6",children:[s.jsx("div",{className:"flex justify-between items-center",children:s.jsx("h2",{className:"text-lg sm:text-xl font-semibold",children:"Scholarship Settings"})}),s.jsx(rAe,{})]})]}),s.jsx(ai,{open:C,onOpenChange:T,children:s.jsxs(Oa,{children:[s.jsxs(za,{children:[s.jsx(Ha,{children:"Are you sure?"}),s.jsxs($a,{children:["This action cannot be undone. This will permanently delete the ",D,' "',P,'".',D==="scholarship"&&" This will also delete all associated winners."]})]}),s.jsxs(Ua,{children:[s.jsx(qa,{children:"Cancel"}),s.jsx(Wa,{onClick:H,className:"bg-red-600 hover:bg-red-700",children:"Delete"})]})]})}),d&&s.jsx(Y5e,{isOpen:d,onClose:()=>h(!1),onSuccess:()=>{h(!1),oe()}}),f&&I&&s.jsx(Z5e,{isOpen:f,scholarship:I,onClose:()=>{m(!1),O(null)},onSuccess:()=>{m(!1),O(null),oe()}}
1307),g&&s.jsx(X5e,{isOpen:g,scholarships:t,onClose:()=>y(!1),onSuccess:()=>{y(!1),oe()}}),b&&V&&s.jsx(Q5e,{isOpen:b,winner:V,scholarships:t,onClose:()=>{w(!1),G(null)},onSuccess:()=>{w(!1),G(null),oe()}}),j&&s.jsx(eAe,{isOpen:j,onClose:()=>N(!1),onSuccess:()=>{N(!1),oe()}}),S&&B&&s.jsx(tAe,{isOpen:S,counselor:B,onClose:()=>{E(!1),$(null)},onSuccess:()=>{E(!1),$(null),oe()}})]})},nAe=()=>{const[t,e]=x.useState([]),[r,n]=x.useState(!0),[a,i]=x.useState(null),o=async()=>{try{n(!0),i(null);const h=await kh.getAllBoardMembers();e(h)}catch(h){console.error("Error loading board members:",h),i("Failed to load board members")}finally{n(!1)}},l=async h=>{const f=await kh.createBoardMember(h);return await o(),f},c=async h=>{const f=await kh.updateBoardMember(h);return await o(),f},u=async h=>{await kh.deleteBoardMember(h),await o()},d=async h=>{await kh.reorderBoardMembers(h),await o()};return x.useEffect(()=>{o()},[]),{members:t,loading:r,error:a,refetch:o,createMember:l,updateMember:c,deleteMember:u,reorderMembers:d}},RU=({value:t,onChange:e,disabled:r=!1,label:n="Profile Image",placeholder:a="https://example.com/profile-image.jpg",error:i})=>{const{toast:o}=St(),l=x.useRef(null),[c,u]=x.useState(!1),[d,h]=x.useState(!1),f=async N=>{var S;try{if(u(!0),!N.type.startsWith("image/"))throw new Error("Please select an image file");if(N.size>5*1024*1024)throw new Error("Image size must be less than 5MB");const E=((S=N.name.split(".").pop())==null?void 0:S.toLowerCase())||"jpg",T=`board/${`board-${Date.now()}-${Math.random().toString(36).substring(2)}.${E}`}`,{data:D,error:A}=await Q.storage.from("deal-images").upload(T,N,{cacheControl:"3600",upsert:!1});if(A)throw console.error("Supabase upload error:",A),new Error(A.message||"Failed to upload image");const{data:{publicUrl:R}}=Q.storage.from("deal-images").getPublicUrl(D.path);e(R),o({title:"Success",description:"Profile image uploaded successfully"})}catch(E){console.error("Error uploading profile image:",E),o({title:"Upload Error",description:E.message||"Failed to upload profile image",variant:"destructive"})}finally{u(!1)}},m=N=>{var E;const S=(E=N.target.files)==null?void 0:E[0];S&&f(S)},g=N=>{N.preventDefault(),h(!1);const S=N.dataTransfer.files[0];S&&f(S)},y=N=>{N.preventDefault(),h(!0)},b=N=>{N.preventDefault(),h(!1)},w=()=>{e("")},j=N=>{e(N)};return s.jsxs("div",{className:"space-y-4",children:[s.jsx(Z,{className:i?"text-red-600":"",children:n}),s.jsxs(sn,{defaultValue:"upload",className:"w-full",children:[s.jsxs(Qs,{className:"grid w-full grid-cols-2",children:[s.jsxs(Gt,{value:"upload",className:"flex items-center gap-2",children:[s.jsx(vn,{className:"h-4 w-4"}),"Upload"]}),s.jsxs(Gt,{value:"url",className:"flex items-center gap-2",children:[s.jsx(dp,{className:"h-4 w-4"}),"URL"]})]}),s.jsxs(Rt,{value:"upload",className:"space-y-3",children:[t&&s.jsxs("div",{className:"relative",children:[s.jsx("img",{src:t,alt:"Profile preview",className:"w-full h-48 object-cover rounded-lg border"}),s.jsx(Y,{type:"button",variant:"destructive",size:"sm",onClick:w,className:"absolute top-2 right-2",disabled:r,children:s.jsx(Ir,{className:"h-4 w-4"})})]}),s.jsx("div",{className:`border-2 border-dashed rounded-lg p-6 text-center transition-colors ${d?"border-blue-500 bg-blue-50":"border-gray-300"}`,onDrop:g,onDragOver:y,onDragLeave:b,children:c?s.jsxs("div",{className:"flex items-center justify-center gap-2",children:[s.jsx(Mt,{className:"h-6 w-6 animate-spin"}),s.jsx("span",{children:"Uploading..."})]}):s.jsxs("div",{children:[s.jsx(vi,{className:"h-12 w-12 mx-auto text-gray-400 mb-4"}),s.jsx("p",{className:"text-sm text-gray-600 mb-2",children:"Drag and drop an image here, or click to browse"}),s.jsx("p",{className:"text-xs text-gray-500",children:"Supports JPG, PNG, GIF. Max 5MB."})]})}),s.jsx("input",{ref:l,type:"file",accept:"image/*",onChange:m,className:"hidden",disabled:r||c}),s.jsxs(Y,{type:"button",variant:"outline",onClick:()=>{var N;return(N=l.current)==null?void 0:N.click()},disabled:r||c,className:"w-full",children:[s.jsx(vn,{className:"h-4 w-4 mr-2"}),"Choose Profile Image"]})]}),s.jsxs(Rt,{value:"url",className:"space-y-3",children:[s.jsx(Ne,{value:t,onChange:N=>j(N.target.value),placeholder:a,disabled:r,type:"url",className:i?"border-red-500":""}),s.jsx("p",{className:"text-xs text-gray-500",children:"Enter a direct URL to an image for the profile"})]})]}),i&&s.jsx("p",{className:"text-sm text-red-600",children:i})]})},aAe=({isOpen:t,onClose:e,onSuccess:r})=>{const[n,a]=x.useState({name:"",title:"",bio:"",image_url:"",display_order:0}),[i,o]=x.useState(!1),{toast:l}
1307=St(),c=async d=>{if(d.preventDefault(),!n.name.trim()||!n.title.trim()){l({title:"Error",description:"Please fill in all required fields",variant:"destructive"});return}try{o(!0);const h={name:n.name.trim(),title:n.title.trim(),bio:n.bio.trim()||void 0,image_url:n.image_url.trim()||void 0,display_order:n.display_order};await kh.createBoardMember(h),l({title:"Success",description:"Board member created successfully"}),r()}catch(h){console.error("Error creating board member:",h),l({title:"Error",description:"Failed to create board member",variant:"destructive"})}finally{o(!1)}},u=()=>{i||(a({name:"",title:"",bio:"",image_url:"",display_order:0}),e())};return s.jsx(Tt,{open:t,onOpenChange:u,children:s.jsx(Dt,{className:"sm:max-w-[600px] max-h-[90vh] overflow-y-auto",children:s.jsxs("form",{onSubmit:c,children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Add Board Member"}),s.jsx(rr,{children:"Fill out the form below to add a new board member."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"name",className:"text-right",children:"Member Name *"}),s.jsx(Ne,{id:"name",value:n.name,onChange:d=>a(h=>({...h,name:d.target.value})),className:"col-span-3",placeholder:"e.g., Jennifer Reynolds",required:!0,disabled:i})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"title",className:"text-right",children:"Title *"}),s.jsx(Ne,{id:"title",value:n.title,onChange:d=>a(h=>({...h,title:d.target.value})),className:"col-span-3",placeholder:"e.g., Board Chair",required:!0,disabled:i})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"bio",className:"text-right pt-2",children:"Bio"}),s.jsx(zt,{id:"bio",value:n.bio,onChange:d=>a(h=>({...h,bio:d.target.value})),className:"col-span-3",placeholder:"Brief biography of the board member...",rows:4,disabled:i})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx("div",{className:"text-right pt-2",children:s.jsx(Z,{children:"Profile Image"})}),s.jsx("div",{className:"col-span-3",children:s.jsx(RU,{value:n.image_url,onChange:d=>a(h=>({...h,image_url:d})),disabled:i,label:"",placeholder:"https://example.com/profile-image.jpg"})})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"display_order",className:"text-right",children:"Display Order"}),s.jsx(Ne,{id:"display_order",type:"number",value:n.display_order,onChange:d=>a(h=>({...h,display_order:parseInt(d.target.value)||0})),className:"col-span-3",placeholder:"0",min:"0",disabled:i})]}),n.image_url&&s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{className:"text-right pt-2",children:"Image Preview"}),s.jsx("div",{className:"col-span-3",children:s.jsx("img",{src:n.image_url,alt:"Preview",className:"w-32 h-32 object-cover rounded-lg",onError:d=>{d.currentTarget.style.display="none"}})})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",type:"button",onClick:u,disabled:i,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:i,children:i?"Creating...":"Add Member"})]})]})})})},iAe=({isOpen:t,member:e,onClose:r,onSuccess:n})=>{const[a,i]=x.useState({name:"",title:"",bio:"",image_url:"",display_order:0,is_active:!0}),[o,l]=x.useState(!1),{toast:c}=St();x.useEffect(()=>{e&&i({name:e.name,title:e.title,bio:e.bio||"",image_url:e.image_url||"",display_order:e.display_order,is_active:e.is_active})},[e]);const u=async h=>{if(h.preventDefault(),!a.name.trim()||!a.title.trim()){c({title:"Error",description:"Please fill in all required fields",variant:"destructive"});return}try{l(!0);const f={id:e.id,name:a.name.trim(),title:a.title.trim(),bio:a.bio.trim()||void 0,image_url:a.image_url.trim()||void 0,display_order:a.display_order};await kh.updateBoardMember(f),c({title:"Success",description:"Board member updated successfully"}),n()}catch(f){console.error("Error updating board member:",f),c({title:"Error",description:"Failed to update board member",variant:"destructive"})}finally{l(!1)}},d=()=>{o||r()};return s.jsx(Tt,{open:t,onOpenChange:d,children:s.jsx(Dt,{className:"sm:max-w-[600px] max-h-[90vh] overflow-y-auto",children:s.jsxs("form",{onSubmit:u,children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Edit Board Member"}),s.jsx(rr,{children:"Update the board member details below."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"name",className:"text-right",children:"Member Name *"}),s.jsx(Ne,{id:"name",value:a.name,onChange:h=>i(f=>({...f,name:h.target.value})),className:"col-span-3",placeholder:"e.g., Jennifer Reynolds",required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"title",className:"text-right",children:"Title *"}),s.jsx(Ne,{id:"title",value:a.title,onChange:h=>i(f=>({...f,title:h.target.value})),className:"col-span-3",placeholder:"e.g., Board Chair",required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"bio",className:"text-right pt-2",children:"Bio"}),s.jsx(zt,{id:"bio",value:a.bio,onChange:h=>i(f=>({...f,bio:h.target.value})),className:"col-span-3",placeholder:"Brief biography of the board member...",rows:4,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx("div",{className:"text-right pt-2",children:s.jsx(Z,{children:"Profile Image"})}),s.jsx("div",{className:"col-span-3",children:s.jsx(RU,{value:a.image_url,onChange:h=>i(f=>({...f,image_url:h})),disabled:o,label:"",placeholder:"https://example.com/profile-image.jpg"})})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"display_order",className:"text-right",children:"Display Order"}),s.jsx(Ne,{id:"display_order",type:"number",value:a.display_order,onChange:h=>i(f=>
1307({...f,display_order:parseInt(h.target.value)||0})),className:"col-span-3",placeholder:"0",min:"0",disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"is_active",className:"text-right",children:"Status"}),s.jsxs("div",{className:"col-span-3 flex items-center space-x-2",children:[s.jsx(ii,{id:"is_active",checked:a.is_active,onCheckedChange:h=>i(f=>({...f,is_active:h})),disabled:o}),s.jsx(Z,{htmlFor:"is_active",children:"Active Member"})]})]}),a.image_url&&s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{className:"text-right pt-2",children:"Image Preview"}),s.jsx("div",{className:"col-span-3",children:s.jsx("img",{src:a.image_url,alt:"Preview",className:"w-32 h-32 object-cover rounded-lg",onError:h=>{h.currentTarget.style.display="none"}})})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",type:"button",onClick:d,disabled:o,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:o,children:o?"Updating...":"Update Member"})]})]})})})},oAe=()=>{const{members:t,loading:e,error:r,deleteMember:n,refetch:a}=nAe(),[i,o]=x.useState(!1),[l,c]=x.useState(!1),[u,d]=x.useState(null),[h,f]=x.useState(!1),[m,g]=x.useState(null),[y,b]=x.useState(""),[w,j]=x.useState([]),[N,S]=x.useState(!0),[E,C]=x.useState(null),[T,D]=x.useState(!1),[A,R]=x.useState(!1),[M,P]=x.useState(!1),[U,I]=x.useState(null),[O,V]=x.useState({title:"",content:""}),{toast:G}=St();x.useEffect(()=>{B()},[]);const B=async()=>{try{S(!0);const re=await hg.getAllDescriptions();j(re)}catch(re){console.error("Error fetching descriptions:",re),G({title:"Error",description:"Failed to load board descriptions",variant:"destructive"})}finally{S(!1)}},$=async()=>{o(!1)},W=async()=>{c(!1),d(null)},oe=(re,we)=>{g(re),b(we),f(!0)},K=async()=>{if(m)try{await n(m),G({title:"Success",description:"Board member deleted successfully"})}catch(re){console.error("Error deleting board member:",re),G({title:"Error",description:"Failed to delete board member",variant:"destructive"})}finally{f(!1),g(null),b("")}},H=re=>{d(re),c(!0)},X=re=>{C(re.id),V({title:re.title,content:re.content})},me=()=>{D(!0),V({title:"",content:""})},ie=async()=>{if(!O.title||!O.content){G({title:"Error",description:"Title and content are required",variant:"destructive"});return}R(!0);try{let re;T?re=await hg.createDescription(O):E&&(re=await hg.updateDescription(E,O)),re!=null&&re.success?(G({title:"Success",description:T?"Description created successfully":"Description updated successfully"}),C(null),D(!1),await B()):G({title:"Error",description:(re==null?void 0:re.error)||"Failed to save description",variant:"destructive"})}catch(re){console.error("Error saving description:",re),G({title:"Error",description:"Failed to save description",variant:"destructive"})}finally{R(!1)}},ee=()=>{C(null),D(!1),V({title:"",content:""})},he=async re=>{try{const we=await hg.setActiveDescription(re);we.success?(G({title:"Success",description:"Description set as active"}),await B()):G({title:"Error",description:we.error||"Failed to set description as active",variant:"destructive"})}catch(we){console.error("Error setting active description:",we),G({title:"Error",description:"Failed to set description as active",variant:"destructive"})}},ve=re=>{I(re),P(!0)},Ce=async()=>{if(U)try{const re=await hg.deleteDescription(U);re.success?(G({title:"Success",description:"Description deleted successfully"}),P(!1),I(null),await B()):G({title:"Error",description:re.error||"Failed to delete description",variant:"destructive"})}catch(re){console.error("Error deleting description:",re),G({title:"Error",description:"Failed to delete description",variant:"destructive"})}};return e?s.jsx("div",{className:"flex items-center justify-center p-8",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-chamber-blue mx-auto mb-4"}),s.jsx("p",{children:"Loading board members..."})]})}):r?s.jsx("div",{className:"flex items-center justify-center p-8",children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-red-600 mb-4",children:r}),s.jsx(Y,{onClick:()=>a(),children:"Try Again"})]})}
1307):s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-gray-900",children:"Board Management"}),s.jsx("p",{className:"text-muted-foreground text-sm sm:text-base",children:"Manage board of directors members and page content"})]}),s.jsxs(Y,{onClick:()=>o(!0),className:"w-full sm:w-auto",children:[s.jsx(vs,{className:"h-4 w-4 mr-2"}),"Add Member"]})]}),s.jsxs(De,{children:[s.jsx(ot,{className:"p-4 sm:p-6",children:s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs(ut,{className:"flex items-center gap-2 text-lg sm:text-xl",children:[s.jsx(ti,{className:"h-5 w-5 shrink-0"}),"Board Page Description"]}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Manage the description text that appears on the Board of Directors page"})]}),s.jsxs(Y,{onClick:me,variant:"outline",size:"sm",className:"w-full sm:w-auto shrink-0",children:[s.jsx(vs,{className:"h-4 w-4 mr-2"}),"Create New Description"]})]})}),s.jsxs(Be,{className:"p-4 sm:p-6 pt-0",children:[(T||E)&&s.jsxs("div",{className:"space-y-4 mb-6 p-4 border rounded-lg bg-muted/30",children:[s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"desc-title",children:"Title *"}),s.jsx(Ne,{id:"desc-title",value:O.title,onChange:re=>V({...O,title:re.target.value}),placeholder:"About Our Board"})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"desc-content",children:"Content *"}),s.jsx(zt,{id:"desc-content",value:O.content,onChange:re=>V({...O,content:re.target.value}),placeholder:"Description of the board...",rows:6})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(Y,{onClick:ie,disabled:A,className:"w-full sm:w-auto",children:A?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-4 h-4 mr-2 animate-spin rounded-full border-2 border-white border-t-transparent"}),"Saving..."]}):s.jsxs(s.Fragment,{children:[s.jsx(hp,{className:"w-4 h-4 mr-2"}),"Save"]})}),s.jsxs(Y,{variant:"outline",onClick:ee,className:"w-full sm:w-auto",children:[s.jsx(Ir,{className:"w-4 h-4 mr-2"}),"Cancel"]})]})]}),N?s.jsxs("div",{className:"flex items-center justify-center py-8",children:[s.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-chamber-blue"}),s.jsx("span",{className:"ml-2 text-sm",children:"Loading descriptions..."})]}):w.length===0?s.jsxs("div",{className:"text-center py-8 text-muted-foreground px-4",children:[s.jsx(ti,{className:"h-12 w-12 mx-auto mb-4 text-muted-foreground/50"}),s.jsx("p",{children:"No board descriptions found. Create your first description."})]}):s.jsx("div",{className:"space-y-4",children:w.map(re=>s.jsxs("div",{className:"border rounded-lg p-4",children:[s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:justify-between sm:items-start mb-2",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("h3",{className:"font-semibold flex flex-wrap items-center gap-2 break-words",children:[re.title,re.is_active&&s.jsx(ke,{className:"bg-green-500 text-white shrink-0",children:"Active"})]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Last updated: ",new Date(re.updated_at).toLocaleDateString()]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2 shrink-0",children:[s.jsxs(Y,{size:"sm",variant:"outline",onClick:()=>X(re),title:"Edit",children:[s.jsx(zs,{className:"w-4 h-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Edit"})]}),!re.is_active&&s.jsx(Y,{size:"sm",onClick:()=>he(re.id),className:"bg-green-600 hover:bg-green-700 text-white",children:"Set Active"}),s.jsxs(Y,{size:"sm",variant:"destructive",onClick:()=>ve(re.id),title:"Delete",children:[s.jsx(vr,{className:"w-4 h-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Delete"})]})]})]}),s.jsx("p",{className:"text-muted-foreground text-sm line-clamp-3 break-words",children:re.content})]},re.id))})]})]}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 sm:gap-6",children:t.map(re=>s.jsx(De,{className:`${re.is_active?"":"opacity-50"} overflow-hidden`,children:s.jsx(Be,{className:"p-4 sm:p-6",children:s.jsxs("div",{className:"flex items-start gap-3 sm:gap-4",children:[s.jsx("div",{className:"flex-shrink-0",children:re.image_url?s.jsx("img",{src:re.image_url,alt:re.name,className:"w-14 h-14 sm:w-16 sm:h-16 rounded-full object-cover"}):s.jsx("div",{className:"w-14 h-14 sm:w-16 sm:h-16 bg-muted rounded-full flex items-center justify-center",children:s.jsx(Yy,{className:"h-7 w-7 sm:h-8 sm:w-8 text-muted-foreground"})})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"text-base sm:text-lg font-semibold text-gray-900 truncate",children:re.name}),s.jsx("p",{className:"text-sm font-medium text-chamber-blue mb-1 sm:mb-2 truncate",children:re.title}),re.bio&&s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-3",children:re.bio}),s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 mt-3 sm:mt-4",children:[s.jsxs("span",{className:"text-xs text-muted-foreground",children:["Order: ",re.display_order]}),s.jsxs("div",{className:"flex gap-1 sm:gap-2",children:[s.jsxs(Y,{size:"sm",variant:"outline",onClick:()=>
1307H(re),title:"Edit",className:"h-8 w-8 p-0 sm:h-auto sm:w-auto sm:px-3",children:[s.jsx(zs,{className:"h-3 w-3 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Edit"})]}),s.jsxs(Y,{size:"sm",variant:"outline",onClick:()=>oe(re.id,re.name),className:"text-destructive hover:bg-destructive/10 h-8 w-8 p-0 sm:h-auto sm:w-auto sm:px-3",title:"Delete",children:[s.jsx(vr,{className:"h-3 w-3 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Delete"})]})]})]})]})]})})},re.id))}),t.length===0&&s.jsxs("div",{className:"text-center py-12 px-4",children:[s.jsx(Yy,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No board members"}),s.jsx("p",{className:"text-muted-foreground mb-4",children:"Get started by adding your first board member."}),s.jsxs(Y,{onClick:()=>o(!0),className:"w-full sm:w-auto",children:[s.jsx(vs,{className:"h-4 w-4 mr-2"}),"Add Member"]})]}),s.jsx(aAe,{isOpen:i,onClose:()=>o(!1),onSuccess:$}),u&&s.jsx(iAe,{isOpen:l,member:u,onClose:()=>{c(!1),d(null)},onSuccess:W}),s.jsx(ai,{open:h,onOpenChange:f,children:s.jsxs(Oa,{className:"max-w-[min(100vw-2rem,28rem)] p-4 sm:p-6",children:[s.jsxs(za,{children:[s.jsx(Ha,{children:"Are you sure?"}),s.jsxs($a,{children:['This action cannot be undone. This will permanently delete the board member "',y,'".']})]}),s.jsxs(Ua,{children:[s.jsx(qa,{children:"Cancel"}),s.jsx(Wa,{onClick:K,className:"bg-red-600 hover:bg-red-700",children:"Delete"})]})]})}),s.jsx(ai,{open:M,onOpenChange:P,children:s.jsxs(Oa,{className:"max-w-[min(100vw-2rem,28rem)] p-4 sm:p-6",children:[s.jsxs(za,{children:[s.jsx(Ha,{children:"Delete Description"}),s.jsx($a,{children:"Are you sure you want to delete this board description? This action cannot be undone."})]}),s.jsxs(Ua,{children:[s.jsx(qa,{children:"Cancel"}),s.jsx(Wa,{onClick:Ce,className:"bg-red-600 hover:bg-red-700",children:"Delete"})]})]})})]})},lAe=({isOpen:t,onClose:e,onSuccess:r,onSubmit:n})=>{const[a,i]=x.useState({name:"",description:"",meeting_schedule:"",chair_name:"",chair_email:"",max_members:10}),[o,l]=x.useState(!1),{toast:c}=St(),u=async f=>{if(f.preventDefault(),!a.name.trim()||!a.description.trim()||!a.meeting_schedule.trim()){c({title:"Error",description:"Please fill in all required fields",variant:"destructive"});return}l(!0);try{await n(a),c({title:"Success",description:"Committee created successfully"}),r()}catch(m){console.error("Error creating committee:",m),c({title:"Error",description:"Failed to create committee",variant:"destructive"})}finally{l(!1)}},d=(f,m)=>{i(g=>({...g,[f]:m}))},h=()=>{o||(i({name:"",description:"",meeting_schedule:"",chair_name:"",chair_email:"",max_members:10}),e())};return s.jsx(Tt,{open:t,onOpenChange:h,children:s.jsx(Dt,{className:"sm:max-w-[700px] max-h-[90vh] overflow-y-auto",children:s.jsxs("form",{onSubmit:u,children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Add Committee"}),s.jsx(rr,{children:"Fill out the form below to add a new committee."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"name",className:"text-right",children:"Committee Name *"}),s.jsx(Ne,{id:"name",value:a.name,onChange:f=>d("name",f.target.value),className:"col-span-3",placeholder:"e.g., Marketing Committee",required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"description",className:"text-right pt-2",children:"Description *"}),s.jsx(zt,{id:"description",value:a.description,onChange:f=>d("description",f.target.value),className:"col-span-3",placeholder:"Committee purpose and responsibilities...",rows:3,required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"meeting_schedule",className:"text-right",children:"Meeting Schedule *"}),s.jsx(Ne,{id:"meeting_schedule",value:a.meeting_schedule,onChange:f=>d("meeting_schedule",f.target.value),className:"col-span-3",placeholder:"e.g., First Tuesday of each month, 8:30 AM",required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"chair_name",className:"text-right",children:"Chair Name"}),s.jsx(Ne,{id:"chair_name",value:a.chair_name,onChange:f=>d("chair_name",f.target.value),className:"col-span-3",placeholder:"e.g., John Smith",disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"chair_email",className:"text-right",children:"Chair Email"}),s.jsx(Ne,{id:"chair_email",type:"email",value:a.chair_email,onChange:f=>d("chair_email",f.target.value),className:"col-span-3",placeholder:"[email protected]",disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"max_members",className:"text-right",children:"Maximum Members"}),s.jsx(Ne,{id:"max_members",type:"number",min:"1",max:"50",value:a.max_members,onChange:f=>d("max_members",parseInt(f.target.value)||10),className:"col-span-3",disabled:o})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",type:"button",onClick:h,disabled:o,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:o,children:o?"Creating...":"Add Committee"})]})]})})})},cAe=({isOpen:t,committee:e,onClose:r,onSubmit:n})=>{if(!e)return null;const[a,i]=x.useState({name:e.name,description:e.description,meeting_schedule:e.meeting_schedule,chair_name:e.chair_name||"",chair_email:e.chair_email||"",max_members:e.max_members,is_active:e.is_active}),[o,l]=x.useState(!1),c=async d=>{d.preventDefault(),l(!0);try{await n(a)}catch(h){console.error("Error updating committee:",h)}finally{l(!1)}},u=(d,h)=>{i(f=>({...f,[d]:h}))};return s.jsx(Tt,{open:t,onOpenChange:r,children:s.jsx(Dt,{className:"sm:max-w-[700px] max-h-[90vh] overflow-y-auto",children:s.jsxs("form",{onSubmit:c,children:[s.jsxs(It,{children:[s.jsxs(Ot,{className:"flex items-center gap-2",children:[s.jsx(zs,{className:"h-5 w-5"}),"Edit Committee"]}),s.jsx(rr,{children:"Update the committee information below."})]}),s.jsxs("div",{className:"grid gap-4 py-4",children:[s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"name",className:"text-right",children:"Committee Name *"}),s.jsx(Ne,{id:"name",value:a.name,onChange:d=>u("name",d.target.value),className:"col-span-3",placeholder:"e.g., Marketing Committee",required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-start gap-4",children:[s.jsx(Z,{htmlFor:"description",className:"text-right pt-2",children:"Description *"}),s.jsx(zt,{id:"description",value:a.description,onChange:d=>u("description",d.target.value),className:"col-span-3",placeholder:"Committee purpose and responsibilities...",rows:3,required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"meeting_schedule",className:"text-right",children:"Meeting Schedule *"}),s.jsx(Ne,{id:"meeting_schedule",value:a.meeting_schedule,onChange:d=>u("meeting_schedule",d.target.value),className:"col-span-3",placeholder:"e.g., First Tuesday of each month, 8:30 AM",required:!0,disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"chair_name",className:"text-right",children:"Chair Name"}),s.jsx(Ne,{id:"chair_name",value:a.chair_name,onChange:d=>u("chair_name",d.target.value),className:"col-span-3",placeholder:"e.g., John Smith",disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"chair_email",className:"text-right",children:"Chair Email"}),s.jsx(Ne,{id:"chair_email",type:"email",value:a.chair_email,onChange:d=>u("chair_email",d.target.value),className:"col-span-3",placeholder:"[email protected]",disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"max_members",className:"text-right",children:"Maximum Members"}),s.jsx(Ne,{id:"max_members",type:"number",min:"1",max:"50",value:a.max_members,onChange:d=>u("max_members",parseInt(d.target.value)||10),className:"col-span-3",disabled:o})]}),s.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[s.jsx(Z,{htmlFor:"is_active",className:"text-right",children:"Status"}),s.jsxs("div",{className:"col-span-3 flex items-center space-x-2",children:[s.jsx(ii,{id:"is_active",checked:a.is_active,onCheckedChange:d=>u("is_active",d),disabled:o}),s.jsx(Z,{htmlFor:"is_active",children:"Active Committee"})]})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",type:"button",onClick:r,disabled:o,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:o,children:o?"Updating...":"Update Committee"})]})]})})})};
1307function uAe({onApprove:t,onReject:e,approveText:r="Approve",rejectText:n="Reject",className:a=""}){const{user:i}=ts(),[o,l]=x.useState(!1),[c,u]=x.useState(!1),d=async()=>{if(i!=null&&i.id){u(!0);try{await t(),ct.success("Application approved successfully")}catch{ct.error("Failed to approve application")}finally{u(!1)}}},h=async f=>{if(i!=null&&i.id){u(!0);try{await e(f),ct.success("Application rejected")}catch{ct.error("Failed to reject application")}finally{u(!1)}}};return s.jsxs("div",{className:`flex gap-2 ${a}`,children:[s.jsxs(Y,{size:"sm",variant:"outline",onClick:d,disabled:c,className:"text-green-600 border-green-600 hover:bg-green-50",children:[s.jsx(un,{className:"h-4 w-4 mr-1"}),r]}),s.jsxs(Y,{size:"sm",variant:"outline",onClick:()=>l(!0),disabled:c,className:"text-red-600 border-red-600 hover:bg-red-50",children:[s.jsx(Ir,{className:"h-4 w-4 mr-1"}),n]}),s.jsx(hx,{isOpen:o,onClose:()=>l(!1),onConfirm:h,title:"Reject Committee Application",description:"You are about to reject this committee application",itemName:"application",isLoading:c})]})}const dAe=({isOpen:t,onClose:e,application:r,onApprove:n,onReject:a})=>{var l,c;if(!r)return null;const i=u=>{switch(u){case"pending":return s.jsx(Ts,{className:"h-4 w-4 text-yellow-600"});case"approved":return s.jsx(Or,{className:"h-4 w-4 text-green-600"});case"rejected":return s.jsx(Hl,{className:"h-4 w-4 text-red-600"});default:return s.jsx(rn,{className:"h-4 w-4 text-gray-600"})}},o=u=>{const d={pending:"bg-yellow-100 text-yellow-800 border-yellow-200",approved:"bg-green-100 text-green-800 border-green-200",rejected:"bg-red-100 text-red-800 border-red-200"};return d[u]||d.pending};return s.jsx(Tt,{open:t,onOpenChange:e,children:s.jsxs(Dt,{className:"max-w-4xl max-h-[90vh] overflow-y-auto",children:[s.jsxs(It,{children:[s.jsxs(Ot,{className:"flex items-center gap-2",children:[s.jsx(ma,{className:"h-5 w-5"}),"Committee Application Details"]}),s.jsxs(rr,{children:['View detailed information for "',r.applicant_name,'" applying to ',(l=r.committee)==null?void 0:l.name]})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:r.applicant_name}),s.jsxs("p",{className:"text-lg text-gray-600 mt-1",children:["Applied to: ",(c=r.committee)==null?void 0:c.name]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[i(r.status),s.jsx(ke,{className:`${o(r.status)} border`,children:r.status})]})]})}),s.jsx(Be,{children:s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-gray-600",children:[s.jsx(fs,{className:"h-4 w-4"}),s.jsx("span",{children:r.applicant_email})]}),r.phone&&s.jsxs("div",{className:"flex items-center gap-2 text-gray-600",children:[s.jsx(wi,{className:"h-4 w-4"}),s.jsx("span",{children:r.phone})]})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-gray-600",children:[s.jsx(Br,{className:"h-4 w-4"}),s.jsxs("span",{children:["Applied: ",Cs(new Date(r.created_at),"PPP")]})]}),s.jsxs("div",{className:"flex items-center gap-2 text-gray-600",children:[s.jsx(rn,{className:"h-4 w-4"}),s.jsxs("span",{children:["Updated: ",Cs(new Date(r.updated_at),"PPP")]})]})]})]})})]}),s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs(ut,{className:"flex items-center gap-2",children:[s.jsx(ti,{className:"h-5 w-5"}),"Application Details"]})}),s.jsxs(Be,{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Motivation"}),s.jsx("p",{className:"text-gray-700 bg-gray-50 p-3 rounded border",children:r.motivation})]}),r.experience&&s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Relevant Experience"}),s.jsx("p",{className:"text-gray-700 bg-gray-50 p-3 rounded border",children:r.experience})]}),r.availability&&s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Availability"}),s.jsx("p",{className:"text-gray-700 bg-gray-50 p-3 rounded border",children:r.availability})]})]})]}),r.reviewed_at&&s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs(ut,{className:"flex items-center gap-2",children:[s.jsx(ma,{className:"h-5 w-5"}),"Review Information"]})}),s.jsx(Be,{children:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-medium text-gray-600",children:"Reviewed On:"}),s.jsx("span",{className:"text-sm text-gray-700",children:Cs(new Date(r.reviewed_at),"PPP")})]}),r.reviewed_by&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-sm font-medium text-gray-600",children:"Reviewed By:"}),s.jsx("span",{className:"text-sm text-gray-700",children:r.reviewed_by})]}),r.admin_notes&&s.jsxs("div",{className:"mt-4 p-3 bg-yellow-50 border border-yellow-200 rounded",children:[s.jsx("span",{className:"text-sm font-medium text-gray-600 block mb-1",children:"Admin Notes:"}),s.jsx("p",{className:"text-sm text-gray-700",children:r.admin_notes})]})]})})]}),r.status==="pending"&&s.jsxs(De,{children:[s.jsx(ot,{children:s.jsx(ut,{children:"Review Actions"})}),s.jsx(Be,{children:s.jsx(uAe,{onApprove:n,onReject:a,approveText:"Ap
1307prove Application",rejectText:"Reject Application"})})]})]}),s.jsx("div",{className:"flex justify-end pt-4 border-t",children:s.jsx(Y,{variant:"outline",onClick:e,children:"Close"})})]})})},BU=({open:t,onOpenChange:e,title:r,description:n,onConfirm:a,loading:i=!1})=>s.jsx(ai,{open:t,onOpenChange:e,children:s.jsxs(Oa,{className:"max-w-[min(100vw-2rem,28rem)] p-4 sm:p-6",children:[s.jsxs(za,{children:[s.jsx(Ha,{children:r}),s.jsx($a,{children:n})]}),s.jsxs(Ua,{children:[s.jsx(qa,{disabled:i,children:"Cancel"}),s.jsx(Wa,{onClick:a,disabled:i,className:"bg-red-600 hover:bg-red-700",children:i?"Deleting...":"Delete"})]})]})}),hAe=({isOpen:t,committeeId:e,committeeName:r,currentMemberUserIds:n,maxMembers:a,currentCount:i,onClose:o,onAdded:l})=>{const[c,u]=x.useState(""),[d,h]=x.useState("resident_business"),[f,m]=x.useState([]),[g,y]=x.useState(0),[b,w]=x.useState(!1),[j,N]=x.useState(null),[S,E]=x.useState("member"),[C,T]=x.useState(!1),[D,A]=x.useState(null),R=x.useCallback(async()=>{w(!0),A(null);try{const U=d==="resident_business"?void 0:d==="resident"?"resident":"business_owner",{members:I,total:O}=await Rf.getMembers({searchQuery:c.trim()||void 0,role:U,limit:50,page:1}),V=new Set(n),G=$=>($.role==="resident"||$.role==="business_owner")&&!V.has($.id),B=d==="resident_business"?I.filter(G):I.filter($=>!V.has($.id));m(B),y(O)}catch(U){console.error("Error loading members:",U),A("Failed to load members."),m([]),y(0)}finally{w(!1)}},[c,d,n]);x.useEffect(()=>{t&&R()},[t,R]);const M=async U=>{if(U.preventDefault(),!!j){T(!0),A(null);try{await Za.addMember(e,j.id,S),l(),o()}catch(I){console.error("Error adding member:",I),A(I instanceof Error?I.message:"Failed to add member.")}finally{T(!1)}}},P=i>=a;return s.jsx(Tt,{open:t,onOpenChange:U=>!U&&o(),children:s.jsxs(Dt,{className:"sm:max-w-[560px] max-h-[90vh] overflow-y-auto",children:[s.jsxs(It,{children:[s.jsxs(Ot,{className:"flex items-center gap-2",children:[s.jsx(vC,{className:"h-5 w-5"}),"Add member to ",r]}),s.jsx(rr,{children:"Search for a resident or business owner to add to this committee. Members must have an account."})]}),P&&s.jsxs("div",{className:"rounded-md bg-amber-50 border border-amber-200 text-amber-800 text-sm p-3",children:["This committee has reached its maximum size (",a," members). Remove a member first to add someone new."]}),!P&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid gap-4 py-2",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(Uc,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-gray-500"}),s.jsx(Ne,{placeholder:"Search by name or email",className:"pl-9",value:c,onChange:U=>u(U.target.value),onKeyDown:U=>U.key==="Enter"&&(U.preventDefault(),R())})]}),s.jsxs(Wt,{value:d,onValueChange:h,children:[s.jsx(Ht,{className:"w-full sm:w-[180px]",children:s.jsx(qt,{placeholder:"Type"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"resident_business",children:"Resident or Business"}),s.jsx(Ae,{value:"resident",children:"Resident only"}),s.jsx(Ae,{value:"business_owner",children:"Business owner only"})]})]}),s.jsx(Y,{type:"button",variant:"secondary",onClick:R,disabled:b,children:b?s.jsx(Mt,{className:"h-4 w-4 animate-spin"}):"Search"})]}),D&&s.jsx("div",{className:"rounded-md bg-red-50 border border-red-200 text-red-800 text-sm p-3",children:D}),s.jsx("div",{className:"border rounded-md max-h-[240px] overflow-y-auto",children:b?s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Mt,{className:"h-6 w-6 animate-spin text-chamber-blue"})}):f.length===0?s.jsx("div",{className:"text-center py-6 text-gray-500 text-sm",children:c||d!=="resident_business"?"No matching members found, or they are already on this committee.":"Search by name or email to find members to add."}):s.jsx("ul",{className:"divide-y",children:f.map(U=>{const I=(j==null?void 0:j.id)===U.id,O=[U.firstName,U.lastName].filter(Boolean).join(" ")||U.email;return s.jsx("li",{children:s.jsxs("button",{type:"button",onClick:()=>N(U),className:`w-full flex items-center gap-3 px-3 py-2.5 text-left hover:bg-gray-50 ${I?"bg-chamber-blue-light border-l-2 border-chamber-blue":""}`,children:[U.role==="business_owner"?s.jsx(up,{className:"h-4 w-4 text-gray-500 shrink-0"}):s.jsx(ma,{className:"h-4 w-4 text-gray-500 shrink-0"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"font-medium text-gray-900 truncate",children:O}),s.jsx("div",{className:"text-sm text-gray-500 truncate",children:U.email})]}),s.jsx("span",{className:"text-xs text-gray-400 capitalize shrink-0",children:U.role==="business_owner"?"Business":"Resident"})]})},U.id)})})}),j&&s.jsxs("div",{className:"space-y-2 pt-2 border-t",children:[s.jsx(Z,{children:"Role for this committee"}),s.jsxs(Wt,{value:S,onValueChange:U=>E(U),children:[s.jsx(Ht,{children:s.jsx(qt,{})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"member",children:"Member"}),s.jsx(Ae,{value:"secretary",children:"Secretary"}),s.jsx(Ae,{value:"vice_chair",children:"Vice Chair"}),s.jsx(Ae,{value:"chair",children:"Chair"})]})]})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{type:"button",variant:"outline",onClick:o,children:"Cancel"}),s.jsxs(Y,{type:"submit",onClick:M,disabled:!j||C,children:[C?s.jsx(Mt,{className:"h-4 w-4 animate-spin mr-2"}):null,"Add to committee"]})]})]})]})})},mAe=({committees:t})=>{var A;
1307const[e,r]=x.useState([]),[n,a]=x.useState(!1),[i,o]=x.useState(""),[l,c]=x.useState({open:!1,member:null}),[u,d]=x.useState(!1),[h,f]=x.useState(null),[m,g]=x.useState(null),[y,b]=x.useState(!1),{toast:w}=St();x.useEffect(()=>{i?j(i):r([])},[i]);const j=async R=>{try{a(!0);const M=await Za.getCommitteeMembers(R);r(M)}catch(M){console.error("Error loading committee members:",M),w({title:"Error",description:"Failed to load committee members.",variant:"destructive"})}finally{a(!1)}},N=async(R,M)=>{f(R);try{await Za.updateMemberRole(R,M),await j(i),w({title:"Role Updated",description:"The member's role has been updated successfully."})}catch(P){console.error("Error updating member role:",P),w({title:"Error",description:"Failed to update member role. Please try again.",variant:"destructive"})}finally{f(null)}},S=async()=>{if(l.member)try{await Za.deleteMember(l.member.id),await j(i),w({title:"Member Deleted",description:"The committee member has been deleted successfully."}),c({open:!1,member:null})}catch(R){console.error("Error deleting member:",R),w({title:"Error",description:"Failed to delete committee member. Please try again.",variant:"destructive"})}},E=R=>{g(R)},C=R=>{R.preventDefault()},T=async R=>{if(!m||m===R||y){g(null);return}const M=e.findIndex(O=>O.id===m),P=e.findIndex(O=>O.id===R);if(M===-1||P===-1){g(null);return}const U=[...e],[I]=U.splice(M,1);U.splice(P,0,I),r(U),g(null),b(!0);try{await Za.reorderCommitteeMembers(U.map(O=>O.id)),w({title:"Order updated",description:"Committee member display order has been saved."})}catch(O){console.error("Error reordering committee members:",O),w({title:"Error",description:"Failed to save new member order. Reverting list.",variant:"destructive"}),await j(i)}finally{b(!1)}},D=t.find(R=>R.id===i);return s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex items-center gap-4",children:s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{className:"text-sm font-medium mb-2 block",children:"Select Committee"}),s.jsxs(Wt,{value:i,onValueChange:o,children:[s.jsx(Ht,{children:s.jsx(qt,{placeholder:"Choose a committee to view members"})}),s.jsx($t,{children:t.map(R=>s.jsx(Ae,{value:R.id,children:R.name},R.id))})]})]})}),i&&s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2",children:[s.jsxs("div",{children:[s.jsxs(ut,{className:"flex items-center gap-2",children:[s.jsx(Os,{className:"h-5 w-5"}),D==null?void 0:D.name," Members (",e.length,")"]}),D&&s.jsxs("p",{className:"text-sm text-gray-600 mt-1",children:["Max Members: ",D.max_members]})]}),D&&s.jsxs(Y,{type:"button",onClick:()=>d(!0),disabled:e.length>=D.max_members,children:[s.jsx(vC,{className:"h-4 w-4 mr-2"}),"Add member"]})]})}),s.jsx(Be,{children:n?s.jsxs("div",{className:"flex justify-center items-center py-12",children:[s.jsx(Mt,{className:"h-8 w-8 animate-spin text-chamber-blue"}),s.jsx("span",{className:"ml-2 text-lg",children:"Loading members..."})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Oi,{className:"min-w-[600px]",children:[s.jsx(zi,{children:s.jsxs(As,{children:[s.jsx(At,{className:"w-[44px]"}),s.jsx(At,{children:"Member"}),s.jsx(At,{children:"Role"}),s.jsx(At,{children:"Contact"}),s.jsx(At,{children:"Joined Date"}),s.jsx(At,{children:"Actions"})]})}),s.jsx(Ui,{children:e.map(R=>s.jsxs(As,{draggable:!y,onDragStart:()=>E(R.id),onDragOver:C,onDrop:()=>T(R.id),className:m===R.id?"opacity-60":void 0,children:[s.jsx(Ct,{className:"text-muted-foreground cursor-grab active:cursor-grabbing",children:s.jsx(t6,{className:"h-4 w-4"})}),s.jsx(Ct,{children:s.jsx("div",{className:"font-medium",children:R.member_name})}),s.jsx(Ct,{children:s.jsxs(Wt,{value:R.role,onValueChange:M=>N(R.id,M),disabled:h===R.id||y,children:[s.jsx(Ht,{className:"w-32",children:s.jsx(qt,{})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"member",children:"Member"}),s.jsx(Ae,{value:"secretary",children:"Secretary"}),s.jsx(Ae,{value:"vice_chair",children:"Vice Chair"}),s.jsx(Ae,{value:"chair",children:"Chair"})]})]})}),s.jsx(Ct,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(fs,{className:"h-3 w-3"}),s.jsx("span",{className:"text-sm",children:R.member_email})]})}),s.jsx(Ct,{children:s.jsx("div",{className:"text-sm",children:new Date(R.joined_at).toLocaleDateString()})}),s.jsx(Ct,{children:s.jsx(Y,{variant:"outline",size:"sm",onClick:()=>c({open:!0,member:R}),disabled:y,className:"text-red-600 hover:text-red-700 hover:bg-red-50",children:s.jsx(vr,{className:"h-4 w-4"})})})]},R.id))})]})}),e.length===0&&s.jsx("div",{className:"text-center py-8 text-gray-500",children:"No members found for this committee."})]})})]}),s.jsx(BU,{open:l.open,onOpenChange:R=>c({...l,open:R}),title:"Delete Committee Member",description:`Are you sure you want to delete ${(A=l.member)==null?void 0:A.member_name} from this committee? This action cannot be undone.`,onConfirm:S,loading:!1}),D&&s.jsx(hAe,{isOpen:u,committeeId:i,committeeName:D.name,currentMemberUserIds:e.map(R=>
1307R.user_id),maxMembers:D.max_members,currentCount:e.length,onClose:()=>d(!1),onAdded:()=>{j(i),w({title:"Member added",description:"The member has been added to the committee."})}})]})},fAe=()=>{const[t,e]=x.useState([]),[r,n]=x.useState([]),[a,i]=x.useState(!0),[o,l]=x.useState(!1),[c,u]=x.useState(null),[d,h]=x.useState(null),[f,m]=x.useState({open:!1,type:"committee",id:"",title:"",description:""}),[g,y]=x.useState(!1),{toast:b}=St();x.useEffect(()=>{w()},[]);const w=async()=>{try{i(!0);const[M,P]=await Promise.all([Za.getAllForAdmin(),Za.getApplications()]);e(M),n(P)}catch(M){console.error("Error loading committee data:",M)}finally{i(!1)}},j=async M=>{try{await Za.create(M),await w()}catch(P){throw console.error("Error creating committee:",P),P}},N=()=>{l(!1),b({title:"Committee Created",description:"The committee has been created successfully."})},S=async(M,P)=>{try{await Za.update(M,P),await w(),u(null),b({title:"Committee Updated",description:"The committee has been updated successfully."})}catch(U){console.error("Error updating committee:",U),b({title:"Error",description:"Failed to update committee. Please try again.",variant:"destructive"})}},E=(M,P,U)=>{m({open:!0,type:M,id:P,title:`Delete ${M==="committee"?"Committee":"Application"}`,description:`Are you sure you want to delete ${M==="committee"?`the committee "${U}"`:"this application"}? This action cannot be undone.`})},C=async()=>{y(!0);try{f.type==="committee"?(await Za.delete(f.id),b({title:"Committee Deleted",description:"The committee has been deleted successfully."})):(await Za.deleteApplication(f.id),b({title:"Application Deleted",description:"The application has been deleted successfully."})),await w(),m({...f,open:!1})}catch(M){console.error("Error deleting:",M),b({title:"Error",description:`Failed to delete ${f.type}. Please try again.`,variant:"destructive"})}finally{y(!1)}},T=async(M,P)=>{try{await Za.approveApplication(M,P),await w(),b({title:"Application Approved",description:"The application has been approved successfully."})}catch(U){console.error("Error approving application:",U),b({title:"Error",description:"Failed to approve application. Please try again.",variant:"destructive"})}},D=async(M,P)=>{try{await Za.rejectApplication(M,P),await w(),b({title:"Application Rejected",description:"The application has been rejected."})}catch(U){console.error("Error rejecting application:",U),b({title:"Error",description:"Failed to reject application. Please try again.",variant:"destructive"})}},A=M=>{const P={pending:"bg-yellow-100 text-yellow-800",approved:"bg-green-100 text-green-800",rejected:"bg-red-100 text-red-800"};return P[M]||P.pending},R=r.filter(M=>M.status==="pending");return a?s.jsx("div",{className:"flex justify-center p-8",children:"Loading..."}):s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3",children:[s.jsx("h1",{className:"text-xl sm:text-2xl font-bold",children:"Committee Management"}),s.jsxs(Y,{onClick:()=>l(!0),className:"w-full sm:w-auto",children:[s.jsx(vs,{className:"h-4 w-4 mr-2"}),"Create Committee"]})]}),s.jsxs(sn,{defaultValue:"committees",className:"space-y-4",children:[s.jsxs(Qs,{className:"flex w-full flex-wrap h-auto gap-1 p-1",children:[s.jsxs(Gt,{value:"committees",className:"flex-1 min-w-0 sm:flex-initial",children:["Committees (",t.length,")"]}),s.jsx(Gt,{value:"members",children:"Members"}),s.jsxs(Gt,{value:"applications",className:"w-full sm:w-auto mt-1 sm:mt-0",children:["Applications (",r.length,")",R.length>0&&s.jsxs(ke,{className:"ml-2 bg-yellow-500",children:[R.length," pending"]})]})]}),s.jsx(Rt,{value:"committees",className:"space-y-4",children:s.jsx("div",{className:"grid gap-4",children:t.map(M=>s.jsxs(De,{children:[s.jsx(ot,{className:"p-4 sm:p-6",children:s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:justify-between sm:items-start",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs(ut,{className:"flex flex-wrap items-center gap-2 text-base sm:text-lg",children:[s.jsx("span",{className:"break-words",children:M.name}),!M.is_active&&s.jsx(ke,{variant:"secondary",className:"shrink-0",children:"Inactive"})]}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1 line-clamp-2 sm:line-clamp-none",children:M.description})]}),s.jsxs("div",{className:"flex gap-2 shrink-0",children:[s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>u(M),title:"Edit",children:[s.jsx(zs,{className:"h-4 w-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Edit"})]}),s.jsxs(Y,{variant:"outline",size:"sm",onClick:()=>E("committee",M.id,M.name),title:"Delete",children:[s.jsx(vr,{className:"h-4 w-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Delete"})]})]})]})}),s.jsx(Be,{className:"p-4 pt-0 sm:p-6 sm:pt-0",children:s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 sm:gap-4 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Br,{className:"h-4 w-4 text-muted-foreground shrink-0"}),s.jsx("span",{className:"break-words",children:M.meeting_schedule})]}),M.chair_name&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Os,{className:"h-4 w-4 text-muted-foreground shrink-0"}),s.jsxs("span",{className:"break-words",children:["Chair: ",M.chair_name]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Os,{className:"h-4 w-4 text-muted-foreground shrink-0"}),s.jsxs("span",{children:["Max Members: ",M.max_members]})]}),M.chair_email&&s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(fs,{className:"h-4 w-4 text-muted-foreground shrink-0"}),s.jsx("span",{className:"truncate",children:M.chair_email})]})]})})]},M.id))})}),s.jsx(Rt,{value:"members",className:"space-y-4",children:s.jsx(mAe,{committees:t})}),s.jsx(Rt,{value:"applications",className:"space-y-4",children:s.jsxs(De,{children:[s.jsx(ot,{className:"p-4 sm:p-6",children:s.jsx(ut,{className:"text-lg sm:text-xl",children:"Committee Applications"})}),s.jsx(Be,{className:"p-4 sm:p-6 pt-0",children:r.length===0?s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No applications foun
1307d."}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"md:hidden space-y-3",children:r.map(M=>{var P;return s.jsxs("div",{className:"border rounded-lg p-4 space-y-2 hover:bg-muted/30",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium truncate",children:M.applicant_name}),s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:(P=M.committee)==null?void 0:P.name})]}),s.jsx(ke,{className:A(M.status)+" shrink-0",children:M.status})]}),s.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:M.motivation}),s.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[s.jsxs("span",{className:"flex items-center gap-1 truncate",children:[s.jsx(fs,{className:"h-3 w-3 shrink-0"}),M.applicant_email]}),M.phone&&s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(wi,{className:"h-3 w-3 shrink-0"}),M.phone]}),s.jsx("span",{children:new Date(M.created_at).toLocaleDateString()})]}),s.jsxs("div",{className:"flex gap-2 pt-2",children:[s.jsxs(Y,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>h(M),children:[s.jsx(Xs,{className:"h-4 w-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"View"})]}),s.jsxs(Y,{variant:"outline",size:"sm",className:"flex-1 text-destructive hover:bg-destructive/10",onClick:()=>E("application",M.id,M.applicant_name),children:[s.jsx(vr,{className:"h-4 w-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Delete"})]})]})]},M.id)})}),s.jsx("div",{className:"hidden md:block overflow-x-auto",children:s.jsxs(Oi,{children:[s.jsx(zi,{children:s.jsxs(As,{children:[s.jsx(At,{children:"Applicant"}),s.jsx(At,{children:"Committee"}),s.jsx(At,{children:"Contact"}),s.jsx(At,{children:"Applied Date"}),s.jsx(At,{children:"Status"}),s.jsx(At,{children:"Actions"})]})}),s.jsx(Ui,{children:r.map(M=>{var P;return s.jsxs(As,{children:[s.jsx(Ct,{children:s.jsxs("div",{children:[s.jsx("div",{className:"font-medium",children:M.applicant_name}),s.jsx("div",{className:"text-sm text-muted-foreground truncate max-w-[200px]",children:M.motivation})]})}),s.jsx(Ct,{children:s.jsx("div",{className:"font-medium",children:(P=M.committee)==null?void 0:P.name})}),s.jsx(Ct,{children:s.jsxs("div",{className:"text-sm",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(fs,{className:"h-3 w-3"}),M.applicant_email]}),M.phone&&s.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[s.jsx(wi,{className:"h-3 w-3"}),M.phone]})]})}),s.jsx(Ct,{children:s.jsx("div",{className:"text-sm",children:new Date(M.created_at).toLocaleDateString()})}),s.jsx(Ct,{children:s.jsx(ke,{className:A(M.status),children:M.status})}),s.jsx(Ct,{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Y,{variant:"outline",size:"sm",onClick:()=>h(M),children:s.jsx(Xs,{className:"h-4 w-4"})}),s.jsx(Y,{variant:"outline",size:"sm",onClick:()=>E("application",M.id,M.applicant_name),children:s.jsx(vr,{className:"h-4 w-4"})})]})})]},M.id)})})]})})]})})]})})]}),s.jsx(lAe,{isOpen:o,onClose:()=>l(!1),onSuccess:N,onSubmit:j}),s.jsx(cAe,{isOpen:!!c,committee:c,onClose:()=>u(null),onSubmit:M=>c?S(c.id,M):Promise.resolve()}),s.jsx(dAe,{isOpen:!!d,application:d,onClose:()=>h(null),onApprove:async M=>{d&&(await T(d.id,M),h(null))},onReject:async M=>{d&&(await D(d.id,M),h(null))}}),s.jsx(BU,{open:f.open,onOpenChange:M=>m({...f,open:M}),title:f.title,description:f.description,onConfirm:C,loading:g})]})},pAe=({deals:t,isLoading:e,searchQuery:r,sortField:n,sortDirection:a,onSort:i,onDelete:o,onApprove:l,onReject:c,onStatusChange:u,onViewDeal:d})=>{const h=g=>{if(g.approval_status==="pending")return s.jsxs(ke,{variant:"secondary",className:"bg-yellow-100 text-yellow-800",children:[s.jsx(rn,{size:12,className:"mr-1"}),"Pending"]});if(g.approval_status==="approved"){if(!g.is_active)return s.jsx(ke,{variant:"secondary",className:"bg-gray-100 text-gray-800",children:"Inactive"});const y=new Date;return new Date(g.valid_until)<y?s.jsx(ke,{variant:"secondary",className:"bg-red-100 text-red-800",children:"Expired"}):s.jsxs(ke,{variant:"default",className:"bg-green-100 text-green-800",children:[s.jsx(un,{size:12,className:"mr-1"}),"Active"]})}else if(g.approval_status==="rejected")return s.jsxs(ke,{variant:"destructive",children:[s.jsx(Ir,{size:12,className:"mr-1"}),"Rejected"]});return null},f=g=>new Date(g).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),m=g=>
1307n===g?a==="asc"?"â":"â":s.jsx(DV,{className:"h-4 w-4"});return e?s.jsx("div",{className:"flex items-center justify-center p-8",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-chamber-blue mx-auto mb-4"}),s.jsx("p",{children:"Loading deals..."})]})}):t.length===0?s.jsxs("div",{className:"text-center py-12",children:[s.jsx("div",{className:"mx-auto w-24 h-24 bg-gray-100 rounded-full flex items-center justify-center mb-4",children:s.jsx(Xs,{className:"h-12 w-12 text-gray-400"})}),s.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"No deals found"}),s.jsx("p",{className:"text-gray-600",children:r?"Try adjusting your search criteria":"No deals have been submitted yet"})]}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs(Oi,{className:"min-w-[900px]",children:[s.jsx(zi,{children:s.jsxs(As,{children:[s.jsx(At,{children:s.jsxs(Y,{variant:"ghost",onClick:()=>i("title"),className:"h-8 flex items-center gap-1 p-0 font-semibold",children:["Deal Title",m("title")]})}),s.jsx(At,{children:s.jsxs(Y,{variant:"ghost",onClick:()=>i("business_name"),className:"h-8 flex items-center gap-1 p-0 font-semibold",children:["Business",m("business_name")]})}),s.jsx(At,{children:s.jsxs(Y,{variant:"ghost",onClick:()=>i("deal_type"),className:"h-8 flex items-center gap-1 p-0 font-semibold",children:["Type",m("deal_type")]})}),s.jsx(At,{children:s.jsxs(Y,{variant:"ghost",onClick:()=>i("approval_status"),className:"h-8 flex items-center gap-1 p-0 font-semibold",children:["Approval Status",m("approval_status")]})}),s.jsx(At,{children:s.jsxs(Y,{variant:"ghost",onClick:()=>i("created_at"),className:"h-8 flex items-center gap-1 p-0 font-semibold",children:["Created",m("created_at")]})}),s.jsx(At,{children:"Valid Until"}),s.jsx(At,{className:"text-right",children:"Actions"})]})}),s.jsx(Ui,{children:t.map(g=>{var y;return s.jsxs(As,{children:[s.jsx(Ct,{children:s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-gray-900",children:g.title}),s.jsx("div",{className:"text-sm text-gray-500 line-clamp-1",children:g.description}),s.jsx("div",{className:"text-sm font-medium text-chamber-blue",children:g.deal_value})]})}),s.jsx(Ct,{children:s.jsx("div",{className:"text-sm",children:s.jsx("div",{className:"font-medium text-gray-900",children:(y=g.business)==null?void 0:y.business_name})})}),s.jsx(Ct,{children:s.jsx(ke,{variant:"outline",className:"capitalize",children:g.deal_type})}),s.jsx(Ct,{children:h(g)}),s.jsx(Ct,{children:f(g.created_at)}),s.jsx(Ct,{children:f(g.valid_until)}),s.jsx(Ct,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end space-x-2",children:[s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>d(g),className:"text-chamber-blue hover:text-chamber-blue-dark",title:"View full details",children:s.jsx(Xs,{size:16})}),g.approval_status==="pending"&&s.jsxs(s.Fragment,{children:[s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>l(g),className:"text-green-600 hover:text-green-700",children:s.jsx(un,{size:16})}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>c(g),className:"text-red-600 hover:text-red-700",children:s.jsx(Ir,{size:16})})]}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>u(g),children:s.jsx(jd,{size:16})}),s.jsx(Y,{variant:"ghost",size:"sm",onClick:()=>o(g.id,g.title),className:"text-red-600 hover:text-red-700",children:s.jsx(vr,{size:16})})]})})]},g.id)})})]})})},gAe=({searchQuery:t,onSearchChange:e,statusFilter:r,onStatusFilterChange:n,approvalFilter:a,onApprovalFilterChange:i,typeFilter:o,onTypeFilterChange:l})=>{const c=()=>{e(""),n("all"),i("all"),l("all")},u=t||r!=="all"||a!=="all"||o!=="all";return s.jsx(De,{children:s.jsx(Be,{className:"p-3 sm:p-4",children:s.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 sm:gap-4 items-stretch sm:items-center",children:[s.jsxs("div",{className:"relative flex-1 min-w-0",children:[s.jsx(Uc,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),s.jsx(Ne,{placeholder:"Search deals by title or business name...",value:t,onChange:d=>e(d.target.value),className:"pl-10"})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs(Wt,{value:a,onValueChange:i,children:[s.jsx(Ht,{className:"w-full sm:w-32 min-w-0",children:s.jsx(qt,{placeholder:"Status"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"all",children:"All Status"}),s.jsx(Ae,{value:"pending",children:"Pending"}),s.jsx(Ae,{value:"approved",children:"Approved"}),s.jsx(Ae,{value:"rejected",children:"Rejected"})]})]}),s.jsxs(Wt,{value:r,onValueChange:n,children:[s.jsx(Ht,{className:"w-full sm:w-32 min-w-0",children:s.jsx(qt,{placeholder:"Active"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"all",children:"All Active"}),s.jsx(Ae,{value:"active",children:"Active"}),s.jsx(Ae,{value:"inactive",children:"Inactive"})]})]}),s.jsxs(Wt,{value:o,onValueChange:l,children:[s.jsx(Ht,{className:"w-full sm:w-32 min-w-0",children:s.jsx(qt,{placeholder:"Type"})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"all",children:"All Types"}),s.jsx(Ae,{value:"discount",children:"Discount"}),s.jsx(Ae,{value:"freebie",children:"Freebie"}),s.jsx(Ae,{value:"service",children:"Service"}),s.jsx(Ae,{value:"product",children:"Product"})]})]}),u&&s.jsxs(Y,{variant:"outline",size:"sm",onClick:c,className:"flex items-center gap-2",children:[s.jsx(Yg,{className:"h-4 w-4"}),"Clear"]})]})]})})})}
1307,xAe=({isOpen:t,onClose:e,deal:r,onUpdateStatus:n})=>{const[a,i]=x.useState((r==null?void 0:r.is_active)??!1),[o,l]=x.useState(""),[c,u]=x.useState(!1),d=async()=>{if(r)try{u(!0),await n(r.id,a,o.trim()||void 0),e(),l("")}catch(f){console.error("Error updating deal status:",f)}finally{u(!1)}},h=()=>{r&&i(r.is_active),l(""),e()};return r?s.jsx(Tt,{open:t,onOpenChange:h,children:s.jsxs(Dt,{className:"max-w-md",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Update Deal Status"}),s.jsxs(rr,{children:['Change the active status of "',r.title,'"']})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(Z,{className:"text-sm font-medium",children:"Current Status"}),s.jsx("div",{className:"mt-1",children:r.is_active?s.jsxs(ke,{variant:"default",className:"bg-green-100 text-green-800",children:[s.jsx(un,{className:"h-3 w-3 mr-1"}),"Active"]}):s.jsxs(ke,{variant:"secondary",className:"bg-gray-100 text-gray-800",children:[s.jsx(Ir,{className:"h-3 w-3 mr-1"}),"Inactive"]})})]}),s.jsxs("div",{children:[s.jsx(Z,{className:"text-sm font-medium",children:"New Status"}),s.jsxs("div",{className:"mt-2 space-y-2",children:[s.jsxs("label",{className:"flex items-center space-x-2",children:[s.jsx("input",{type:"radio",name:"status",value:"active",checked:a===!0,onChange:()=>i(!0),className:"text-chamber-blue"}),s.jsx("span",{className:"text-sm",children:"Active"})]}),s.jsxs("label",{className:"flex items-center space-x-2",children:[s.jsx("input",{type:"radio",name:"status",value:"inactive",checked:a===!1,onChange:()=>i(!1),className:"text-chamber-blue"}),s.jsx("span",{className:"text-sm",children:"Inactive"})]})]})]}),s.jsxs("div",{children:[s.jsx(Z,{htmlFor:"notes",className:"text-sm font-medium",children:"Notes (Optional)"}),s.jsx(zt,{id:"notes",value:o,onChange:f=>l(f.target.value),placeholder:"Add any notes about this status change...",rows:3,className:"mt-1"})]}),r.approval_status!=="approved"&&s.jsxs("div",{className:"flex items-start space-x-2 p-3 bg-yellow-50 border border-yellow-200 rounded-md",children:[s.jsx(Ts,{className:"h-4 w-4 text-yellow-600 mt-0.5 flex-shrink-0"}),s.jsxs("div",{className:"text-sm text-yellow-800",children:[s.jsx("p",{className:"font-medium",children:"Note:"}),s.jsx("p",{children:"This deal is not yet approved. Status changes will only affect approved deals."})]})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",onClick:h,disabled:c,children:"Cancel"}),s.jsx(Y,{onClick:d,disabled:c||a===r.is_active,children:c?"Updating...":"Update Status"})]})]})}):null},yAe=({open:t,onOpenChange:e,deal:r,onSaved:n})=>{var w;const{toast:a}=St(),[i,o]=x.useState("view"),[l,c]=x.useState(!1),[u,d]=x.useState("pending"),[h,f]=x.useState(!0),[m,g]=x.useState("");x.useEffect(()=>{r&&t&&(d(r.approval_status),f(r.is_active),g(r.admin_notes||""),o("view"))},[r,t]);const y=j=>new Date(j).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),b=async j=>{if(r)try{c(!0);const N=await yi.adminUpdateDeal(r.id,{...j,approval_status:u,admin_notes:m.trim()||void 0,is_active:h});n(N),a({title:"Deal updated",description:"Changes saved successfully."}),o("view")}catch(N){console.error(N),a({title:"Error",description:"Could not save deal changes.",variant:"destructive"})}finally{c(!1)}};return r?s.jsx(Tt,{open:t,onOpenChange:e,children:s.jsxs(Dt,{className:"max-w-[min(100vw-2rem,40rem)] max-h-[90vh] flex flex-col p-0 gap-0",children:[s.jsx(It,{className:"p-4 sm:p-6 pb-0 shrink-0",children:s.jsx(Ot,{className:"flex flex-wrap items-center gap-2 pr-8",children:i==="view"?s.jsxs(s.Fragment,{children:[s.jsx(Xs,{className:"h-5 w-5"}),"Deal details"]}):s.jsxs(s.Fragment,{children:[s.jsx(l1,{className:"h-5 w-5"}),"Edit deal"]})})}),i==="view"?s.jsxs(s.Fragment,{children:[s.jsx(rx,{className:"flex-1 min-h-0 px-4 sm:px-6",children:s.jsxs("div",{className:"space-y-4 pb-4 pr-3",children:[r.image_url&&s.jsx("div",{className:"rounded-lg overflow-hidden border bg-muted",children:s.jsx("img",{src:r.image_url,alt:"",className:"w-full max-h-48 object-contain object-center"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-lg text-gray-900",children:r.title}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:(w=r.business)==null?void 0:w.business_name})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(ke,{variant:"outline",className:"capitalize",children:r.deal_type}),s.jsxs(ke,{variant:"secondary",children:[s.jsx(ji,{className:"h-3 w-3 mr-1"}),r.deal_value]}),s.jsx(ke,{variant:r.approval_status==="approved"?"default":r.approval_status==="rejected"?"destructive":"secondary",children:r.approval_status}),s.jsx(ke,{variant:r.is_active?"default":"outline",children:r.is_active?"Active":"Inactive"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[s.jsxs("div",{children:[s.jsxs("p",{className:"text-muted-foreground flex items-center gap-1",children:[s.jsx(Br,{className:"h-3.5 w-3.5"})," Valid from"]}),s.jsx("p",{className:"font-medium",children:y(r.valid_from)})]}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-muted-foreground flex items-center gap-1",children:[s.jsx(Br,{className:"h-3.5 w-3.5"})," Valid until"]}),s.jsx("p",{className:"font-medium",children:y(r.valid_until)})]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-gray-900 mb-1",children:"Description"}),s.jsx("p",{className:"text-sm text-gray-700 whitespace-pre-wrap",children:r.description||"â"})]}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-sm font-medium text-gray-900 mb-1 flex items-center gap-1",children:[s.jsx(Io,{className:"h-3.5 w-3.5"})," Redemption code"]}),s.jsx("p",{className:"text-sm font-mono text-chamber-blue",children:r.redemption_code||"None (no code required)"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-gray-900 mb-1",children:"Terms & conditions"}),s.jsx("p",{className:"text-sm text-gray-700 whitespace-pre-wrap",children:r.terms_and_conditions||"â"})]}),r.admin_notes&&s.jsxs("div",{className:"rounded-md bg-muted/80 p-3 text-sm",children:[s.jsx("p",{className:"font-medium mb-1",children:"Admin notes"}),s.jsx("p",{className:"text-muted-foreground whitespace-pre-wrap",children:r.admin_notes})]})]})}),s.jsxs("div",{className:"flex flex-col-reverse sm:flex-row gap-2 p-4 sm:p-6 pt-2 border-t shrink-0",children:[s.jsx(Y,{variant:"outline",onClick:()=>e(!1),children:"Close"}),s.jsxs(Y,{className:"bg-chamber-blue hover:bg-chamber-blue-dark",onClick:()=>o("edit"),children:[s.jsx(l1,{className:"h-4 w-4 mr-2"}),"Edit deal"]})]})]}):s.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto px-4 sm:px-6 pb-4",children:s.jsx(i_,{initialData:r,onSubmit:b,onCancel:()=>o("view"),isLoading:l,submitLabel:"Save changes",renderBeforeSubmit:()=>s.jsxs("div",{className:"border-t pt-4 space-y-4",children:[s.jsx("h3",{className:"text-sm font-semibold text-gray-900",children:"Admin controls"}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{children:"Approval status"}),s.jsxs(Wt,{value:u,onValueChange:j=>d(j),children:[s.jsx(Ht,{children:s.jsx(qt,{})}),s.jsxs($t,{children:[s.jsx(Ae,{value:"pending",children:"Pending"}),s.jsx(Ae,{value:"approved",children:"Approved"}),s.jsx(Ae,{value:"rejected",children:"Rejected"})]})]})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Wl,{id:"admin-deal-active",checked:h,onCheckedChange:j=>
1307f(j===!0)}),s.jsx(Z,{htmlFor:"admin-deal-active",className:"cursor-pointer font-normal",children:"Deal is active (visible when approved)"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"admin-deal-notes",children:"Admin notes"}),s.jsx(zt,{id:"admin-deal-notes",value:m,onChange:j=>g(j.target.value),rows:3,placeholder:"Internal notes (visible to admins)"})]})]})},r.id)})]})}):null},bAe=()=>{var Qe;const[t,e]=x.useState([]),[r,n]=x.useState(!0),[a,i]=x.useState(null),[o,l]=x.useState(""),[c,u]=x.useState("all"),[d,h]=x.useState("all"),[f,m]=x.useState("all"),[g,y]=x.useState(1),[b,w]=x.useState("created_at"),[j,N]=x.useState("desc"),[S,E]=x.useState(!1),[C,T]=x.useState(null),[D,A]=x.useState(""),[R,M]=x.useState(!1),[P,U]=x.useState(null),[I,O]=x.useState("approve"),[V,G]=x.useState(""),[B,$]=x.useState(!1),[W,oe]=x.useState(!1),[K,H]=x.useState(null),[X,me]=x.useState(!1),[ie,ee]=x.useState(null),{toast:he}=St(),ve=10,Ce=async()=>{try{n(!0),i(null);const We=await yi.getAllDealsForAdmin();e(We)}catch(We){console.error("Error fetching deals:",We),i("Failed to load deals. Please try again.")}finally{n(!1)}};x.useEffect(()=>{Ce()},[]);const we=[...t.filter(We=>{var cr,wr;const dt=o===""||We.title.toLowerCase().includes(o.toLowerCase())||((wr=(cr=We.business)==null?void 0:cr.business_name)==null?void 0:wr.toLowerCase().includes(o.toLowerCase())),Bt=c==="all"||We.is_active===(c==="active"),Lt=d==="all"||We.approval_status===d,Vt=f==="all"||We.deal_type===f;return dt&&Bt&&Lt&&Vt})].sort((We,dt)=>{var Vt,cr,wr,Xt;let Bt=We[b],Lt=dt[b];return b==="created_at"?(Bt=new Date(Bt).getTime(),Lt=new Date(Lt).getTime()):b==="business_name"?(Bt=((cr=(Vt=We.business)==null?void 0:Vt.business_name)==null?void 0:cr.toLowerCase())||"",Lt=((Xt=(wr=dt.business)==null?void 0:wr.business_name)==null?void 0:Xt.toLowerCase())||""):typeof Bt=="string"&&(Bt=Bt.toLowerCase(),Lt=Lt.toLowerCase()),j==="asc"?Bt>Lt?1:-1:Bt<Lt?1:-1}),Ee=we.length,Me=Math.ceil(Ee/ve),ae=(g-1)*ve,ze=we.slice(ae,ae+ve),mt=(We,dt)=>{T(We),A(dt),E(!0)},tt=async()=>{if(C)try{await yi.deleteDeal(C),e(t.filter(We=>We.id!==C)),he({title:"Success",description:"Deal deleted successfully"})}catch(We){console.error("Error deleting deal:",We),he({title:"Error",description:"Failed to delete deal",variant:"destructive"})}finally{E(!1),T(null),A("")}},Xe=(We,dt)=>{U(We),O(dt),G(""),M(!0)},Ft=async()=>{if(P)try{$(!0);const We=I==="approve"?"approved":"rejected",dt=await yi.reviewDeal(P.id,We,V.trim()||void 0);e(t.map(Bt=>Bt.id===P.id?dt:Bt)),he({title:"Success",description:`Deal ${I==="approve"?"approved":"rejected"} successfully`})}catch(We){console.error("Error approving deal:",We),he({title:"Error",description:`Failed to ${I} deal`,variant:"destructive"})}finally{$(!1),M(!1),U(null),G("")}},ce=We=>{H(We),oe(!0)},fe=We=>{ee(We),me(!0)},ge=We=>{e(dt=>dt.map(Bt=>Bt.id===We.id?We:Bt)),ee(We)},Ge=async(We,dt,Bt)=>{try{const Lt=await yi.toggleDealStatus(We,dt);e(t.map(Vt=>Vt.id===We?Lt:Vt)),he({title:"Success",description:"Deal status updated successfully"})}catch(Lt){throw console.error("Error updating deal status:",Lt),he({title:"Error",description:"Failed to update deal status",variant:"destructive"}),Lt}},Je=We=>{We===b?N(j==="asc"?"desc":"asc"):(w(We),N("asc")),y(1)},be=We=>{y(We)};if(r)return s.jsx("div",{className:"flex items-center justify-center p-8",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-chamber-blue mx-auto mb-4"}),s.jsx("p",{children:"Loading deals..."})]})});if(a)return s.jsx("div",{className:"flex items-center justify-center p-8",children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-red-600 mb-4",children:a}),s.jsx(Y,{onClick:()=>Ce(),children:"Try Again"})]})});const Pe=We=>{if(We.approval_status==="pending")return s.jsx(ke,{className:"bg-yellow-100 text-yellow-800 text-xs",children:"Pending"});if(We.approval_status==="rejected")return s.jsx(ke,{variant:"destructive",className:"text-xs",children:"Rejected"});if(!We.is_active)return s.jsx(ke,{className:"bg-gray-100 text-gray-800 text-xs",children:"Inactive"});const dt=new Date;return new Date(We.valid_until)<dt?s.jsx(ke,{className:"bg-red-100 text-red-800 text-xs",children:"Expired"}):s.jsx(ke,{className:"bg-green-100 text-green-800 text-xs",children:"Active"})},qe=We=>new Date(We).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});
1307return s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-gray-900",children:"Deals Management"}),s.jsx("p",{className:"text-muted-foreground text-sm sm:text-base",children:"Manage deals and approvals"})]})}),s.jsx(gAe,{searchQuery:o,onSearchChange:l,statusFilter:c,onStatusFilterChange:u,approvalFilter:d,onApprovalFilterChange:h,typeFilter:f,onTypeFilterChange:m}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 sm:gap-4",children:[s.jsx(De,{children:s.jsx(Be,{className:"p-3 sm:p-4",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs sm:text-sm font-medium text-muted-foreground truncate",children:"Total"}),s.jsx("p",{className:"text-lg sm:text-2xl font-bold text-gray-900",children:t.length})]}),s.jsx(ji,{className:"h-6 w-6 sm:h-8 sm:w-8 text-blue-600 shrink-0"})]})})}),s.jsx(De,{children:s.jsx(Be,{className:"p-3 sm:p-4",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs sm:text-sm font-medium text-muted-foreground truncate",children:"Pending"}),s.jsx("p",{className:"text-lg sm:text-2xl font-bold text-yellow-600",children:t.filter(We=>We.approval_status==="pending").length})]}),s.jsx(rn,{className:"h-6 w-6 sm:h-8 sm:w-8 text-yellow-600 shrink-0"})]})})}),s.jsx(De,{children:s.jsx(Be,{className:"p-3 sm:p-4",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs sm:text-sm font-medium text-muted-foreground truncate",children:"Approved"}),s.jsx("p",{className:"text-lg sm:text-2xl font-bold text-green-600",children:t.filter(We=>We.approval_status==="approved").length})]}),s.jsx(un,{className:"h-6 w-6 sm:h-8 sm:w-8 text-green-600 shrink-0"})]})})}),s.jsx(De,{children:s.jsx(Be,{className:"p-3 sm:p-4",children:s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs sm:text-sm font-medium text-muted-foreground truncate",children:"Rejected"}),s.jsx("p",{className:"text-lg sm:text-2xl font-bold text-red-600",children:t.filter(We=>We.approval_status==="rejected").length})]}),s.jsx(Ir,{className:"h-6 w-6 sm:h-8 sm:w-8 text-red-600 shrink-0"})]})})})]}),s.jsxs(De,{children:[s.jsx(ot,{className:"p-4 sm:p-6",children:s.jsx(ut,{className:"text-lg sm:text-xl",children:"Deals"})}),s.jsxs(Be,{className:"p-4 sm:p-6 pt-0",children:[s.jsx("div",{className:"md:hidden space-y-3",children:ze.length===0?s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:o||c!=="all"||d!=="all"||f!=="all"?"No deals match your filters.":"No deals found."}):ze.map(We=>{var dt;return s.jsxs("div",{className:"border rounded-lg p-4 space-y-2",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium line-clamp-2",children:We.title}),s.jsx("p",{className:"text-sm text-muted-foreground truncate",children:(dt=We.business)==null?void 0:dt.business_name})]}),s.jsxs("div",{className:"flex flex-wrap gap-1 shrink-0 justify-end",children:[s.jsx(ke,{variant:"outline",className:"text-xs capitalize",children:We.deal_type}),Pe(We)]})]}),We.deal_value&&s.jsx("p",{className:"text-sm font-medium text-chamber-blue",children:We.deal_value}),s.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1 text-xs text-muted-foreground",children:[s.jsxs("span",{children:["Created: ",qe(We.created_at)]}),s.jsxs("span",{children:["Valid: ",qe(We.valid_until)]})]}),s.jsxs("div",{className:"flex flex-wrap gap-1 pt-2",children:[We.approval_status==="pending"&&s.jsxs(s.Fragment,{children:[s.jsx(Y,{variant:"outline",size:"sm",className:"h-8 text-green-600 border-green-200",onClick:()=>Xe(We,"approve"),children:s.jsx(un,{className:"h-4 w-4"})}),s.jsx(Y,{variant:"outline",size:"sm",className:"h-8 text-red-600 border-red-200",onClick:()=>Xe(We,"reject"),children:s.jsx(Ir,{className:"h-4 w-4"})})]}),s.jsxs(Y,{variant:"outline",size:"sm",className:"h-8",onClick:()=>fe(We),children:[s.jsx(Xs,{className:"h-4 w-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Details"})]}),s.jsxs(Y,{variant:"outline",size:"sm",className:"h-8",onClick:()=>
1307ce(We),children:[s.jsx(jd,{className:"h-4 w-4 sm:mr-1"}),s.jsx("span",{className:"hidden sm:inline",children:"Status"})]}),s.jsx(Y,{variant:"outline",size:"sm",className:"h-8 text-destructive hover:bg-destructive/10",onClick:()=>mt(We.id,We.title),children:s.jsx(vr,{className:"h-4 w-4"})})]})]},We.id)})}),s.jsx("div",{className:"hidden md:block overflow-x-auto",children:s.jsx(pAe,{deals:ze,isLoading:r,searchQuery:o,sortField:b,sortDirection:j,onSort:Je,onDelete:mt,onApprove:We=>Xe(We,"approve"),onReject:We=>Xe(We,"reject"),onStatusChange:ce,onViewDeal:fe})}),Me>1&&s.jsx("div",{className:"mt-4",children:s.jsx(kR,{currentPage:g,totalPages:Me,onPageChange:be})})]})]}),s.jsx(ai,{open:S,onOpenChange:E,children:s.jsxs(Oa,{className:"max-w-[min(100vw-2rem,28rem)] p-4 sm:p-6",children:[s.jsxs(za,{children:[s.jsx(Ha,{children:"Are you sure?"}),s.jsxs($a,{children:['This action cannot be undone. This will permanently delete the deal "',D,'".']})]}),s.jsxs(Ua,{children:[s.jsx(qa,{children:"Cancel"}),s.jsx(Wa,{onClick:tt,className:"bg-red-600 hover:bg-red-700",children:"Delete"})]})]})}),s.jsx(Tt,{open:R,onOpenChange:M,children:s.jsxs(Dt,{className:"max-w-[min(100vw-2rem,28rem)] p-4 sm:p-6",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:I==="approve"?"Approve Deal":"Reject Deal"}),s.jsxs(rr,{children:[I==="approve"?"This deal will be published and visible to chamber members.":"This deal will be rejected and not published. Please provide a reason.",P&&P.approval_status!=="pending"&&s.jsxs("span",{className:"block mt-2 text-sm text-gray-600",children:["Current status: ",s.jsx("strong",{children:P.approval_status})]})]})]}),s.jsxs("div",{className:"space-y-4",children:[P&&s.jsxs("div",{className:"p-4 bg-gray-50 rounded space-y-3 text-left",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium",children:P.title}),s.jsx("p",{className:"text-sm text-gray-600",children:(Qe=P.business)==null?void 0:Qe.business_name}),P.deal_value&&s.jsx("p",{className:"text-sm font-medium text-chamber-blue mt-1",children:P.deal_value})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-1",children:"Description"}),s.jsx("p",{className:"text-sm text-gray-800 whitespace-pre-wrap max-h-40 overflow-y-auto",children:P.description||"â"})]}),P.redemption_code&&s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-1",children:"Redemption code"}),s.jsx("p",{className:"text-sm font-mono text-chamber-blue",children:P.redemption_code})]}),P.terms_and_conditions&&s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide mb-1",children:"Terms"}),s.jsx("p",{className:"text-sm text-gray-700 whitespace-pre-wrap max-h-32 overflow-y-auto",children:P.terms_and_conditions})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"admin_notes",children:I==="approve"?"Notes (Optional)":"Rejection Reason *"}),s.jsx(zt,{id:"admin_notes",value:V,onChange:We=>G(We.target.value),placeholder:I==="approve"?"Add any notes about this approval...":"Please provide a reason for rejection...",rows:3,required:I==="reject"}),P&&P.admin_notes&&I==="approve"&&s.jsxs("div",{className:"text-sm text-gray-600",children:[s.jsx("strong",{children:"Previous rejection reason:"})," ",P.admin_notes]})]})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",onClick:()=>M(!1),disabled:B,children:"Cancel"}),s.jsx(Y,{onClick:Ft,disabled:B||I==="reject"&&!V.trim(),variant:I==="approve"?"default":"destructive",children:B?"Processing...":I==="approve"?"Approve":"Reject"})]})]})}),s.jsx(xAe,{isOpen:W,onClose:()=>oe(!1),deal:K,onUpdateStatus:Ge}),s.jsx(yAe,{open:X,onOpenChange:We=>{me(We),We||ee(null)},deal:ie,onSaved:ge})]})},vAe=()=>{const[t,e]=x.useState([]),[r,n]=x.useState({totalReferrals:0,totalPointsAwarded:0,totalDiscountGiven:0,activeReferrals:0}),[a,i]=x.useState(!0),[o,l]=x.useState(""),[c,u]=x.useState(null),{toast:d}=St();x.useEffect(()=>{h()},[]);const h=async()=>{try{i(!0);const{data:y,error:b}=await Q.from("referrals").select("*").order("created_at",{ascending:!1});if(b)throw b;e(y||[]);const w=(y==null?void 0:y.length)||0,j=(y==null?void 0:y.reduce((E,C)=>E+C.points_awarded,0))||0,N=(y==null?void 0:y.reduce((E,C)=>E+C.discount_percentage,0))||0,S=(y==null?void 0:y.filter(E=>E.status==="active").length)||0;n({totalReferrals:w,totalPointsAwarded:j,totalDiscountGiven:N,activeReferrals:S})}catch(y){console.error("Error fetching referrals:",y),d({title:"Error",description:"Failed to fetch referrals",variant:"destructive"})}finally{i(!1)}},f=async(y,b)=>{try{const{error:w}=await Q.from("referrals").update({status:b,updated_at:new Date().toISOString()}).eq("id",y);if(w)throw w;d({title:"Success",description:"Referral status updated successfully"}),h()}catch(w){console.error("Error updating referral status:",w),d({title:"Error",description:"Failed to update referral status",variant:"destructive"})}},m=t.filter(y=>y.referrer_name.toLowerCase().includes(o.toLowerCase())||y.referrer_email.toLowerCase().includes(o.toLowerCase())||y.referred_name.toLowerCase().includes(o.toLowerCase())||y.referred_email.toLowerCase().includes(o.toLowerCase())),g=y=>{switch(y){case"active":return"bg-green-100 text-green-800";
1307case"inactive":return"bg-gray-100 text-gray-800";case"expired":return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}};return a?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-chamber-blue"})}):s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-xl sm:text-2xl font-bold",children:"Referral Management"}),s.jsx("p",{className:"text-muted-foreground text-sm sm:text-base",children:"Manage user referrals and track referral performance"})]}),s.jsxs("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-3 sm:gap-6",children:[s.jsxs(De,{children:[s.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2 p-4 sm:p-6",children:[s.jsx(ut,{className:"text-xs sm:text-sm font-medium truncate",children:"Total Referrals"}),s.jsx(Os,{className:"h-4 w-4 text-muted-foreground shrink-0"})]}),s.jsxs(Be,{className:"px-4 sm:px-6 pb-4 sm:pb-6 pt-0",children:[s.jsx("div",{className:"text-lg sm:text-2xl font-bold",children:r.totalReferrals}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"All time"})]})]}),s.jsxs(De,{children:[s.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2 p-4 sm:p-6",children:[s.jsx(ut,{className:"text-xs sm:text-sm font-medium truncate",children:"Active"}),s.jsx(XV,{className:"h-4 w-4 text-muted-foreground shrink-0"})]}),s.jsxs(Be,{className:"px-4 sm:px-6 pb-4 sm:pb-6 pt-0",children:[s.jsx("div",{className:"text-lg sm:text-2xl font-bold",children:r.activeReferrals}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Currently active"})]})]}),s.jsxs(De,{children:[s.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2 p-4 sm:p-6",children:[s.jsx(ut,{className:"text-xs sm:text-sm font-medium truncate",children:"Points"}),s.jsx(Io,{className:"h-4 w-4 text-muted-foreground shrink-0"})]}),s.jsxs(Be,{className:"px-4 sm:px-6 pb-4 sm:pb-6 pt-0",children:[s.jsx("div",{className:"text-lg sm:text-2xl font-bold",children:r.totalPointsAwarded}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Total given"})]})]}),s.jsxs(De,{children:[s.jsxs(ot,{className:"flex flex-row items-center justify-between space-y-0 pb-2 p-4 sm:p-6",children:[s.jsx(ut,{className:"text-xs sm:text-sm font-medium truncate",children:"Discount"}),s.jsx(Io,{className:"h-4 w-4 text-muted-foreground shrink-0"})]}),s.jsxs(Be,{className:"px-4 sm:px-6 pb-4 sm:pb-6 pt-0",children:[s.jsxs("div",{className:"text-lg sm:text-2xl font-bold",children:[r.totalDiscountGiven,"%"]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Cumulative"})]})]})]}),s.jsxs(De,{children:[s.jsx(ot,{className:"p-4 sm:p-6",children:s.jsx(ut,{className:"text-lg sm:text-xl",children:"Search Referrals"})}),s.jsx(Be,{className:"p-4 sm:p-6 pt-0",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Uc,{className:"h-4 w-4 text-muted-foreground shrink-0"}),s.jsx(Ne,{placeholder:"Search by name or email...",value:o,onChange:y=>l(y.target.value),className:"flex-1 min-w-0"})]})})]}),s.jsxs(De,{children:[s.jsxs(ot,{className:"p-4 sm:p-6",children:[s.jsxs(ut,{className:"text-lg sm:text-xl",children:["Referrals (",m.length,")"]}),s.jsx(us,{children:"All referral relationships and their current status"})]}),s.jsx(Be,{className:"p-4 sm:p-6 pt-0",children:m.length===0?s.jsxs("div",{className:"text-center py-8",children:[s.jsx(Os,{className:"h-12 w-12 text-muted-foreground mx-auto mb-4"}),s.jsx("p",{className:"text-muted-foreground",children:"No referrals found"})]}):s.jsx("div",{className:"space-y-4",children:m.map(y=>s.jsx("div",{className:"border rounded-lg p-4",children:s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("p",{className:"font-medium text-sm break-words",children:[s.jsx("span",{className:"text-blue-600",children:y.referrer_name}),s.jsx("span",{className:"text-muted-foreground mx-1 sm:mx-2",children:"â"}),s.jsx("span",{className:"text-green-600",children:y.referred_name})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 mt-1 text-xs text-muted-foreground",children:[s.jsx(ke,{className:g(y.status)+" shrink-0",children:y.status}),s.jsxs("span",{children:[y.points_awarded," pt",y.points_awarded!==1?"s":""]}),s.jsxs("span",{children:[y.discount_percentage,"% off"]}),s.jsx("span",{children:new Date(y.created_at).toLocaleDateString()})]}),c===y.id&&s.jsx("div",{className:"mt-3 pt-3 border-t bg-muted/30 rounded p-3",children:s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 text-sm",children:[s.jsxs("div",{children:[s.jsx(Z,{className:"font-medium text-xs",children:"Referrer"}),s.jsx("p",{className:"text-muted-foreground break-words",children:y.referrer_name}),s.jsx("p",{className:"text-muted-foreground break-all",children:y.referrer_email})]}),s.jsxs("div",{children:[s.jsx(Z,{className:"font-medium text-xs",children:"Referred"}),s.jsx("p",{className:"text-muted-foreground break-words",children:y.referred_name}),s.jsx("p",{className:"text-muted-foreground break-all",children:y.referred_email})]})]})})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2 shrink-0",children:[s.jsx(Y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 sm:h-9 sm:px-3",onClick:()=>u(c===y.id?null:y.id),title:c===y.id?"Hide details":"Show details",children:c===y.id?s.jsx(Py,{className:"h-4 w-4"}):s.jsx(Xs,{className:"h-4 w-4"})}),y.status==="active"&&s.jsx(Y,{variant:"outline",size:"sm",onClick:()=>f(y.id,"inactive"),children:"Deactivate"}),y.status==="inactive"&&s.jsx(Y,{variant:"outline",size:"sm",onClick:()=>f(y.id,"active"),children:"Activate"})]})]})},y.id))})})]})]})};class Ty{static async subscribe(e,r,n="website"){const a=e.toLowerCase().trim(),{data:i,error:o}=await Q.from("newsletter_subscribers").select("*").eq("email",a).maybeSingle();if(o)throw new Error(`Failed to check existing subscription: ${o.message}`);if(i){if(i.status==="active")return i;{const{data:u,error:d}=await Q.from("newsletter_subscribers").update({status:"active",name:r||i.name,unsubscribed_at:null}).eq("id",i.id).select().single();if(d)throw new Error(`Failed to reactivate subscription: ${d.message}`);return u}}const{data:l,error:c}=await Q.from("newsletter_subscribers").insert({email:a,name:r||null,status:"active",source:n}).select().single();if(c)throw new Error(`Failed to create subscription: ${c.message}`);return l}static async unsubscribe(e){const r=e.toLowerCase().trim(),{error:n}=await Q.from("newsletter_subscribers").update({status:"unsubscribed",unsubscribed_at:new Date().toISOString()}).eq("email",r);if(n)throw new Error(`Failed to unsubscribe: ${n.message}`);return!0}static async deleteSubscriber(e){const r=e.toLowerCase().trim(),{error:n}=await Q.from("newsletter_subscribers").delete().eq("email",r);if(n)throw new Error(`Failed to delete subscriber: ${n.message}`);return!0}static async deleteSubscriberById(e){const{error:r}=await Q.from("newsletter_subscribers").delete().eq("id",e);if(r)throw new Error(`Failed to delete subscriber: ${r.message}`);return!0}static async getActiveSubscribers(){const{data:e,error:r}=await Q.from("newsletter_subscribers").select("*").eq("status","active").order("created_at",{ascending:!1});if(r)throw new Error(`Failed to fetch subscribers: ${r.message}`);return e||[]}static async getSubscriberByEmail(e){const r=e.toLowerCase().trim(),{data:n,error:a}=await Q.from("newsletter_subscribers").select("*").eq("email",r).maybeSingle();if(a)throw new Error(`Failed to fetch subscriber: ${a.message}`);return n||null}static async getSubscriptionStats(){const e=new Date,r=new Date(e.getTime()-30*24*60*60*1e3),[n,a,i,o]=await Promise.all([Q.from("newsletter_subscribers").select("id",{count:"exact",head:!0}),Q.from("newsletter_subscribers").select("id",{count:"exact",head:!0}).eq("status","active"),Q.from("newsletter_subscribers").select("id",{count:"exact",head:!0}).eq("status","unsubscribed"),Q.from("newsletter_subscribers").select("id",{count:"exact",head:!0}).gte("created_at",r.toISOString())]);return{total:n.count||0,active:a.count||0,unsubscribed:i.count||0,recentSubscriptions:o.count||0}}static async sendTestEmail(e,r,n,a){try{const{error:i}=await Q.functions.invoke("send-newsletter-email",{body:{type:"test",to:e,subject:r,content:n,htmlContent:a}});if(i)throw new Error(`Failed to send test email: ${i.message}`);return!0}catch(i){throw console.error("Test email error:",i),i}}static async sendNewsletterToAll(e,r,n){try{const{data:a,error:i}=await Q.functions.invoke("send-newsletter-email",{body:{type:"newsletter",subject:e,content:r,htmlContent:n}});if(i)throw new Error(`Failed to send newsletter: ${i.message}`);return a||{success:!1,sentCount:0,errors:["Unknown error"]}}catch(a){return console.error("Newsletter send error:",a),{success:!1,sentCount:0,errors:[a.message]}}}static createUnsubscribeLink(e){const r=window.location.origin,n=encodeURIComponent(e);return`${r}/newsletter/unsubscribe?email=${n}`}static isValidEmail(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}}const wAe=()=>{const[t,e]=x.useState(!1),[r,n]=x.useState(!1),[a,i]=x.useState(!1),[o,l]=x.useState(""),[c,u]=x.useState(""),[d,h]=x.useState(""),[f,m]=x.useState(""),[g,y]=x.useState([]),[b,w]=x.useState([]),[j,N]=x.useState(""),[S,E]=x.useState(!1),[C,T]=x.useState(!1),[D,A]=x.useState(null),[R,M]=x.useState({total:0,active:0,unsubscribed:0,recentSubscriptions:0}),{toast:P}=St(),U=ee=>{const he=document.createElement("div");return he.innerHTML=ee,he.textContent||he.innerText||""},I=ee=>{h(ee),m(ee)};x.useEffect(()=>{O(),V()},[]),x.useEffect(()=>{if(j.trim()==="")w(g);else{const ee=g.filter(he=>he.email.toLowerCase().includes(j.toLowerCase())||he.name&&he.name.toLowerCase().includes(j.toLowerCase()));w(ee)}},[g,j]);const O=async()=>{try{e(!0);const ee=await Ty.getSubscriptionStats();M(ee)}catch(ee){console.error("Failed to load subscription stats:",ee),P({title:"Error",description:"Failed to load subscription statistics",variant:"destructive"})}finally{e(!1)}},V=async()=>{try{n(!0);const{data:ee,error:he}=await Q.from("newsletter_subscribers").select("*").order("created_at",{ascending:!1});if(he)throw he;y(ee||[])}catch(ee){console.error("Failed to load subscribers:",ee),P({title:"Error",description:`Failed to load subscribers: ${ee.message}`,variant:"destructive"})}finally{n(!1)}},G=async()=>
1307{if(!o||!c||!d){P({title:"Missing Information",description:"Please provide test email, subject, and content",variant:"destructive"});return}try{i(!0);const ee=U(d);await Ty.sendTestEmail(o,c,ee,d),P({title:"Test Email Sent",description:`Test email sent successfully to ${o}`})}catch(ee){console.error("Failed to send test email:",ee),P({title:"Send Failed",description:ee.message||"Failed to send test email",variant:"destructive"})}finally{i(!1)}},B=()=>{if(!c||!d){P({title:"Missing Information",description:"Please provide subject and content for the newsletter",variant:"destructive"});return}E(!0)},$=async()=>{try{i(!0),E(!1);const ee=U(d),he=await Ty.sendNewsletterToAll(c,ee,d);he.success?(P({title:"Newsletter Sent!",description:`Newsletter sent to ${he.sentCount} subscribers`}),u(""),h(""),m("")):P({title:"Send Failed",description:`Only ${he.sentCount} emails sent. Errors: ${he.errors.length}`,variant:"destructive"})}catch(ee){console.error("Failed to send newsletter:",ee),P({title:"Send Failed",description:ee.message||"Failed to send newsletter",variant:"destructive"})}finally{i(!1)}},W=()=>{const he=`<p>Dear {name},</p> 1308 1309<p>Welcome to this month's <strong>Valley Stream Chamber of Commerce Newsletter</strong>!</p> 1310 1311<h3>ð° CHAMBER NEWS</h3> 1312<ul> 1313<li>New member spotlight: <em>[Business Name]</em></li> 1314<li>Upcoming networking event on <strong>[Date]</strong></li> 1315<li>Economic development updates</li> 1316</ul> 1317 1318<h3>ðï¸ UPCOMING EVENTS</h3> 1319<ul> 1320<li>Monthly mixer - <strong>[Date & Location]</strong></li> 1321<li>Business workshop series</li> 1322<li>Community volunteer opportunities</li> 1323</ul> 1324 1325<h3>ð¼ MEMBER BENEFITS</h3> 1326<ul> 1327<li>Exclusive advertising opportunities</li> 1328<li>Business directory listings</li> 1329<li>Networking events and workshops</li> 1330</ul> 1331 1332<h3>ð MEMBER ACHIEVEMENTS</h3> 1333<ul> 1334<li>Congratulations to <strong>[Member]</strong> for <em>[Achievement]</em></li> 1335<li>Ribbon cutting ceremony for <strong>[Business]</strong></li> 1336<li>Community awards and recognition</li> 1337</ul> 1338 1339<p>We appreciate your continued support of local business!</p> 1340 1341<p>Best regards,<br> 1342<strong>Valley Stream Chamber of Commerce Team</strong></p> 1343 1344<hr> 1345<p><em>Newsletter sent on ${new Date().toLocaleDateString()}</em></p>`;h(he),m(he),u("Valley Stream Chamber Newsletter - "+new Date().toLocaleDateString("en-US",{month:"long",year:"numeric"}))},oe=async ee=>{try{await navigator.clipboard.writeText(ee),P({title:"Copied!",description:"Email address copied to clipboard"})}catch{P({title:"Copy Failed",description:"Failed to copy to clipboard",variant:"destructive"})}},K=async(ee=!1)=>{const he=ee?b.filter(Ce=>Ce.status==="active").map(Ce=>Ce.email):b.map(Ce=>Ce.email),ve=he.join(", ");try{await navigator.clipboard.writeText(ve),P({title:"Copied!",description:`${he.length} email addresses copied to clipboard`})}catch{P({title:"Copy Failed",description:"Failed to copy emails to clipboard",variant:"destructive"})}},H=()=>{const ee=[["Email","Name","Status","Source","Created At","Unsubscribed At"].join(","),...b.map(re=>[re.email,re.name||"",re.status,re.source||"",new Date(re.created_at).toLocaleDateString(),re.unsubscribed_at?new Date(re.unsubscribed_at).toLocaleDateString():""].join(","))].join(` 1346`),he=new Blob([ee],{type:"text/csv"}),ve=window.URL.createObjectURL(he),Ce=document.createElement("a");Ce.href=ve,Ce.download=`newsletter-subscribers-${new Date().toISOString().split("T")[0]}.csv`,document.body.appendChild(Ce),Ce.click(),document.body.removeChild(Ce),window.URL.revokeObjectURL(ve),P({title:"Export Complete",description:`${b.length} subscribers exported to CSV`})},X=async()=>{await Promise.all([O(),V()])},me=ee=>{A(ee),T(!0)},ie=async()=>{if(D)try{e(!0),await Ty.deleteSubscriberById(D.id),P({title:"Subscriber Deleted",description:`Successfully deleted ${D.email} from the newsletter`}),await X(),T(!1),A(null)}catch(ee){console.error("Failed to delete subscriber:",ee),P({title:"Delete Failed",description:ee.message||"Failed to delete subscriber",variant:"destructive"})}finally{e(!1)}};return s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-gray-900",children:"Newsletter Management"}),s.jsx("p",{className:"text-muted-foreground text-sm sm:text-base",children:"Create and send newsletters to
1346subscribers"})]}),s.jsxs(Y,{onClick:X,variant:"outline",size:"sm",className:"w-full sm:w-auto",children:[s.jsx(Pl,{className:"h-4 w-4 mr-2"}),"Refresh Data"]})]}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 sm:gap-4",children:[s.jsx(De,{children:s.jsx(Be,{className:"p-3 sm:p-4",children:s.jsxs("div",{className:"flex items-center space-x-2 min-w-0",children:[s.jsx(Os,{className:"h-4 w-4 sm:h-5 sm:w-5 text-blue-500 shrink-0"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground truncate",children:"Total"}),s.jsx("p",{className:"text-lg sm:text-2xl font-bold",children:t?"...":R.total})]})]})})}),s.jsx(De,{children:s.jsx(Be,{className:"p-3 sm:p-4",children:s.jsxs("div",{className:"flex items-center space-x-2 min-w-0",children:[s.jsx(o6,{className:"h-4 w-4 sm:h-5 sm:w-5 text-green-500 shrink-0"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground truncate",children:"Active"}),s.jsx("p",{className:"text-lg sm:text-2xl font-bold text-green-600",children:t?"...":R.active})]})]})})}),s.jsx(De,{children:s.jsx(Be,{className:"p-3 sm:p-4",children:s.jsxs("div",{className:"flex items-center space-x-2 min-w-0",children:[s.jsx(eK,{className:"h-4 w-4 sm:h-5 sm:w-5 text-red-500 shrink-0"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground truncate",children:"Unsubscribed"}),s.jsx("p",{className:"text-lg sm:text-2xl font-bold text-red-600",children:t?"...":R.unsubscribed})]})]})})}),s.jsx(De,{children:s.jsx(Be,{className:"p-3 sm:p-4",children:s.jsxs("div",{className:"flex items-center space-x-2 min-w-0",children:[s.jsx(vs,{className:"h-4 w-4 sm:h-5 sm:w-5 text-purple-500 shrink-0"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground truncate",children:"Last 30 Days"}),s.jsx("p",{className:"text-lg sm:text-2xl font-bold text-purple-600",children:t?"...":R.recentSubscriptions})]})]})})})]}),s.jsxs(sn,{defaultValue:"subscribers",className:"space-y-4",children:[s.jsxs(Qs,{className:"flex w-full flex-wrap h-auto gap-1 p-1",children:[s.jsxs(Gt,{value:"subscribers",className:"flex items-center gap-2",children:[s.jsx(Os,{className:"h-4 w-4"}),"Subscribers"]}
1346),s.jsxs(Gt,{value:"compose",className:"flex items-center gap-2",children:[s.jsx(ti,{className:"h-4 w-4"}),"Compose Newsletter"]}),s.jsxs(Gt,{value:"test",className:"flex items-center gap-2",children:[s.jsx(Xs,{className:"h-4 w-4"}),"Test Email"]})]}),s.jsx(Rt,{value:"subscribers",className:"space-y-4",children:s.jsxs(De,{children:[s.jsx(ot,{className:"p-4 sm:p-6",children:s.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs(ut,{className:"flex items-center gap-2 text-lg sm:text-xl",children:[s.jsx(Os,{className:"h-5 w-5 shrink-0"}),"Newsletter Subscribers"]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs(Y,{onClick:()=>K(!0),variant:"outline",size:"sm",className:"flex-1 sm:flex-initial min-w-0",children:[s.jsx(tv,{className:"h-4 w-4 sm:mr-2 shrink-0"}),s.jsx("span",{className:"hidden sm:inline",children:"Copy Active"})]}),s.jsxs(Y,{onClick:()=>K(!1),variant:"outline",size:"sm",className:"flex-1 sm:flex-initial min-w-0",children:[s.jsx(tv,{className:"h-4 w-4 sm:mr-2 shrink-0"}),s.jsx("span",{className:"hidden sm:inline",children:"Copy All"})]}),s.jsxs(Y,{onClick:H,variant:"outline",size:"sm",className:"flex-1 sm:flex-initial min-w-0",children:[s.jsx(e6,{className:"h-4 w-4 sm:mr-2 shrink-0"}),s.jsx("span",{className:"hidden sm:inline",children:"Export CSV"})]})]})]})}),s.jsxs(Be,{className:"space-y-4 p-4 sm:p-6 pt-0",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3",children:[s.jsxs("div",{className:"relative flex-1 w-full",children:[s.jsx(Uc,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground h-4 w-4"}),s.jsx(Ne,{placeholder:"Search by email or name...",value:j,onChange:ee=>N(ee.target.value),className:"pl-10"})]}),s.jsxs(ke,{variant:"outline",className:"w-fit shrink-0",children:[b.length," of ",g.length]})]}),s.jsx("div",{className:"md:hidden border rounded-lg divide-y overflow-hidden",children:r?s.jsxs("div",{className:"p-6 text-center text-muted-foreground",children:[s.jsx(Pl,{className:"h-6 w-6 animate-spin mx-auto mb-2"}),"Loading subscribers..."]}):b.length===0?s.jsxs("div",{className:"p-6 text-center text-muted-foreground text-sm",children:["No subscribers found.",g.length>0&&s.jsxs("div",{className:"mt-1",children:["Total in database: ",g.length]})]}):s.jsx("div",{className:"max-h-96 overflow-y-auto",children:b.map(ee=>s.jsx("div",{className:"p-4 hover:bg-muted/30",children:s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium text-sm truncate",children:ee.email}),s.jsx("p",{className:"text-muted-foreground text-xs truncate",children:ee.name||"â"}),s.jsxs("div",{className:"flex flex-wrap items-center gap-1 mt-1",children:[s.jsx(ke,{variant:ee.status==="active"?"default":"secondary",className:ee.status==="active"?"bg-green-100 text-green-800 text-xs":"text-xs",children:ee.status}),s.jsx("span",{className:"text-xs text-muted-foreground",children:new Date(ee.created_at).toLocaleDateString()})]})]}),s.jsxs("div",{className:"flex gap-1 shrink-0",children:[s.jsx(Y,{onClick:()=>oe(ee.email),variant:"ghost",size:"sm",className:"h-8 w-8 p-0",title:"Copy",children:s.jsx(tv,{className:"h-4 w-4"})}),s.jsx(Y,{onClick:()=>me(ee),variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-destructive hover:bg-destructive/10",title:"Delete",children:s.jsx(vr,{className:"h-4 w-4"})})]})]})},ee.id))})}),s.jsxs("div",{className:"hidden md:block border rounded-lg overflow-hidden",children:[s.jsx("div",{className:"bg-muted/50 px-4 py-3 border-b",children:s.jsxs("div",{className:"grid grid-cols-[2fr_1fr_1fr_1fr_1fr_auto] gap-4 text-sm font-medium text-muted-foreground",children:[s.jsx("div",{children:"Email"}),s.jsx("div",{children:"Name"}),s.jsx("div",{children:"Status"}),s.jsx("div",{children:"Source"}),s.jsx("div",{children:"Subscribed"}),s.jsx("div",{children:"Actions"})]})}),s.jsx("div",{className:"max-h-96 overflow-y-auto",children:r?s.jsxs("div",{className:"p-8 text-center text-muted-foreground",children:[s.jsx(Pl,{className:"h-6 w-6 animate-spin mx-auto mb-2"}),"Loading subscribers..."]}):b.length===0?s.jsxs("div",{className:"p-8 text-center text-muted-foreground",children:[j?"No subscribers found matching your search.":"No subscribers found.",s.jsxs("div",{className:"mt-2 text-sm",children:["Total subscribers in database: ",g.length]})]}):b.map(ee=>s.jsx("div",{className:"px-4 py-3 border-b hover:bg-muted/30",children:s.jsxs("div",{className:"grid grid-cols-[2fr_1fr_1fr_1fr_1fr_auto] gap-4 items-center text-sm",children:[s.jsx("div",{className:"font-medium truncate",children:ee.email}),s.jsx("div",{className:"text-muted-foreground truncate",children:ee.name||"-"}),s.jsx("div",{children:s.jsx(ke,{variant:ee.status==="active"?"default":"secondary",className:ee.status==="active"?"bg-green-100 text-green-800":"",children:ee.status})}),s.jsx("div",{className:"text-muted-foreground truncate",children:ee.source||"-"}),s.jsx("div",{className:"text-muted-foreground",children:new Date(ee.created_at).toLocaleDateString()}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Y,{onClick:()=>oe(ee.email),variant:"ghost",size:"sm",className:"h-8 w-8 p-0",title:"Copy email",children:s.jsx(tv,{className:"h-4 w-4"})}),s.jsx(Y,{onClick:()=>me(ee),variant:"ghost",size:"sm",className:"h-8 w-8 p-0 text-destructive hover:bg-destructive/10",title:"Delete subscriber",children:s.jsx(vr,{className:"h-4 w-4"})})]})]})},ee.id))})]}),b.length>0&&s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 text-sm text-muted-foreground bg-muted/30 p-3 rounded-lg",children:[s.jsxs("div",{children:["Active: ",b.filter(ee=>ee.status==="active").length," · Unsubscribed: ",b.filter(ee=>ee.status==="unsubscribed").length]}),s.jsxs(Y,{onClick:()=>K(!0),variant:"outline",size:"sm",disabled:b.filter(ee=>ee.status==="active").length===0,className:"w-full sm:w-auto",children:["Copy ",b.filter(ee=>ee.status==="active").length," Active Emails"]}
1346)]})]})]})}),s.jsx(Rt,{value:"compose",className:"space-y-4",children:s.jsxs(De,{children:[s.jsx(ot,{className:"p-4 sm:p-6",children:s.jsxs(ut,{className:"flex items-center gap-2 text-lg sm:text-xl",children:[s.jsx(fs,{className:"h-5 w-5 shrink-0"}),"Compose Newsletter"]})}),s.jsxs(Be,{className:"space-y-4 p-4 sm:p-6 pt-0",children:[s.jsx("div",{className:"flex justify-end",children:s.jsxs(Y,{onClick:W,variant:"outline",size:"sm",className:"w-full sm:w-auto",children:[s.jsx(vs,{className:"h-4 w-4 mr-2"}),"Generate Sample Content"]})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"newsletter-subject",children:"Subject Line"}),s.jsx(Ne,{id:"newsletter-subject",value:c,onChange:ee=>u(ee.target.value),placeholder:"Enter newsletter subject..."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"newsletter-content",children:"Newsletter Content"}),s.jsx(MU,{value:d,onChange:I,placeholder:"Write your newsletter content here... You can use {name} to personalize with subscriber names.",className:"min-h-[200px] sm:min-h-[300px]"}),s.jsxs("p",{className:"text-xs text-gray-500",children:["Tip: Use ","{name}"," in your content to personalize emails with subscriber names. Rich text formatting will be preserved in the email."]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"newsletter-html",children:"HTML Content (Auto-generated)"}),s.jsx(zt,{id:"newsletter-html",value:f,onChange:ee=>m(ee.target.value),placeholder:"HTML content is automatically generated from the rich text editor above...",rows:8,readOnly:!0,className:"bg-gray-50"}),s.jsx("p",{className:"text-xs text-gray-500",children:"HTML content is automatically generated from the rich text editor above. You can manually edit it if needed."})]}),s.jsx(yp,{}),s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[s.jsxs("div",{className:"text-sm text-muted-foreground",children:[s.jsxs(ke,{variant:"outline",className:"mr-2",children:[s.jsx(Os,{className:"h-3 w-3 mr-1"}),R.active," active recipients"]}),s.jsx("span",{className:"block sm:inline mt-1 sm:mt-0",children:"Newsletter will be sent to all active subscribers"})]}),s.jsx(Y,{onClick:B,disabled:a||!c||!d,className:"w-full sm:w-auto bg-blue-600 hover:bg-blue-700",children:a?s.jsxs(s.Fragment,{children:[s.jsx(Pl,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):s.jsxs(s.Fragment,{children:[s.jsx(y2,{className:"mr-2 h-4 w-4"}),"Send Newsletter"]})})]})]})]})}),s.jsx(Rt,{value:"test",className:"space-y-4",children:s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs(ut,{className:"flex items-center gap-2",children:[s.jsx(Xs,{className:"h-5 w-5"}),"Send Test Email"]})}),s.jsxs(Be,{className:"space-y-4",children:[s.jsx("p",{className:"text-gray-600",children:"Send a test email to verify your newsletter content and formatting before sending to all subscribers."}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"test-email",children:"Test Email Address"}),s.jsx(Ne,{id:"test-email",type:"email",value:o,onChange:ee=>l(ee.target.value),placeholder:"Enter your email address for testing..."})]}),s.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[s.jsx("p",{className:"text-sm text-gray-600 mb-2",children:s.jsx("strong",{children:"Test will use current content:"})}),s.jsxs("p",{className:"text-sm",children:[s.jsx("strong",{children:"Subject:"})," ",c||"No subject set"]}),s.jsxs("p",{className:"text-sm",children:[s.jsx("strong",{children:"Content preview:"})," ",d?d.substring(0,100)+"...":"No content set"]})]}),s.jsx(Y,{onClick:G,disabled:a||!o||!c||!d,variant:"outline",className:"w-full",children:a?s.jsxs(s.Fragment,{children:[s.jsx(Pl,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending Test..."]}):s.jsxs(s.Fragment,{children:[s.jsx(fs,{className:"mr-2 h-4 w-4"}),"Send Test Email"]})})]})]})})]}),s.jsx(Tt,{open:S,onOpenChange:E,children:s.jsxs(Dt,{className:"max-w-[min(100vw-2rem,600px)] p-4 sm:p-6",children:[s.jsxs(It,{children:[s.jsxs(Ot,{className:"flex items-center gap-2",children:[s.jsx(y2,{className:"h-5 w-5 text-blue-600"}),"Confirm Newsletter Send"]}),s.jsx(rr,{children:"Please review the newsletter details before sending to all active subscribers."})]}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[s.jsx("h4",{className:"font-semibold text-gray-900 mb-2",children:"Newsletter Details"}),s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"font-medium text-gray-700",children:"Subject:"}),s.jsx("p",{className:"text-gray-900",children:c})]}),s.jsxs("div",{children:[s.jsx("span",{className:"font-medium text-gray-700",children:"Recipients:"}),s.jsx("div",{className:"flex items-center gap-2 mt-1",children:s.jsxs(ke,{variant:"outline",className:"bg-green-100 text-green-800",children:[s.jsx(Os,{className:"h-3 w-3 mr-1"}),R.active," active subscribers"]}
1346)})]}),s.jsxs("div",{children:[s.jsx("span",{className:"font-medium text-gray-700",children:"Content Preview:"}),s.jsx("div",{className:"mt-1 p-3 bg-white border rounded text-xs text-gray-600 max-h-32 overflow-y-auto",children:s.jsx("div",{dangerouslySetInnerHTML:{__html:d.substring(0,200)+(d.length>200?"...":"")}})})]})]})]}),s.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:"text-yellow-600 mt-0.5",children:s.jsx("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 20 20",children:s.jsx("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.725-1.36 3.49 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),s.jsxs("div",{className:"text-sm text-yellow-800",children:[s.jsx("p",{className:"font-medium",children:"Important:"}),s.jsxs("p",{children:["This action cannot be undone. The newsletter will be sent to all ",R.active," active subscribers immediately."]})]})]})})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",onClick:()=>E(!1),disabled:a,children:"Cancel"}),s.jsx(Y,{onClick:$,disabled:a,className:"bg-blue-600 hover:bg-blue-700",children:a?s.jsxs(s.Fragment,{children:[s.jsx(Pl,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending..."]}):s.jsxs(s.Fragment,{children:[s.jsx(y2,{className:"mr-2 h-4 w-4"}),"Send Newsletter"]})})]})]})}),s.jsx(Tt,{open:C,onOpenChange:T,children:s.jsxs(Dt,{className:"max-w-[min(100vw-2rem,500px)] p-4 sm:p-6",children:[s.jsxs(It,{children:[s.jsxs(Ot,{className:"flex items-center gap-2",children:[s.jsx(vr,{className:"h-5 w-5 text-red-600"}),"Delete Subscriber"]}),s.jsx(rr,{children:"Are you sure you want to permanently delete this subscriber? This action cannot be undone."})]}),D&&s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[s.jsx("h4",{className:"font-semibold text-gray-900 mb-2",children:"Subscriber Details"}),s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"font-medium text-gray-700",children:"Email:"}),s.jsx("p",{className:"text-gray-900",children:D.email})]}),s.jsxs("div",{children:[s.jsx("span",{className:"font-medium text-gray-700",children:"Name:"}),s.jsx("p",{className:"text-gray-900",children:D.name||"Not provided"})]}),s.jsxs("div",{children:[s.jsx("span",{className:"font-medium text-gray-700",children:"Status:"}),s.jsx(ke,{variant:D.status==="active"?"default":"secondary",className:D.status==="active"?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800",children:D.status})]}),s.jsxs("div",{children:[s.jsx("span",{className:"font-medium text-gray-700",children:"Subscribed:"}),s.jsx("p",{className:"text-gray-900",children:new Date(D.created_at).toLocaleDateString()})]})]})]}),s.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx("div",{className:"text-red-600 mt-0.5",children:s.jsx("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 20 20",children:s.jsx("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.725-1.36 3.49 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),s.jsxs("div",{className:"text-sm text-red-800",children:[s.jsx("p",{className:"font-medium",children:"Warning:"}),s.jsx("p",{children:"This will permanently remove the subscriber from the database. They will no longer receive newsletters and cannot be restored."})]})]})})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",onClick:()=>{T(!1),A(null)},disabled:t,children:"Cancel"}),s.jsx(Y,{onClick:ie,disabled:t,className:"bg-red-600 hover:bg-red-700",children:t?s.jsxs(s.Fragment,{children:[s.jsx(Pl,{className:"mr-2 h-4 w-4 animate-spin"}),"Deleting..."]}):s.jsxs(s.Fragment,{children:[s.jsx(vr,{className:"mr-2 h-4 w-4"}),"Delete Subscriber"]})})]})]})})]})},jAe=()=>s.jsx(wAe,{}),NAe=()=>{const[t]=Td(),e=ks(),[r,n]=x.useState(!1),[a,i]=x.useState(!1),[o,l]=x.useState(null),{toast:c}=St(),u=t.get("email");x.useEffect(()=>{u||l("No email address provided in the unsubscribe link.")},[u]);const d=async()=>
1346{if(u){n(!0),l(null);try{await Ty.unsubscribe(u),i(!0),c({title:"Successfully Unsubscribed",description:"You have been unsubscribed from our newsletter."})}catch(f){console.error("Unsubscribe error:",f),l(f.message||"Failed to unsubscribe. Please try again."),c({title:"Unsubscribe Failed",description:f.message||"Failed to unsubscribe. Please try again.",variant:"destructive"})}finally{n(!1)}}},h=()=>{e("/")};return o?s.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8",children:s.jsx(De,{className:"max-w-md w-full",children:s.jsx(Be,{className:"pt-6",children:s.jsxs("div",{className:"text-center space-y-4",children:[s.jsx(Hl,{className:"h-16 w-16 text-red-500 mx-auto"}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Unsubscribe Error"}),s.jsx("p",{className:"text-gray-600 mt-2",children:o})]}),s.jsxs(Y,{onClick:h,className:"mt-4",children:[s.jsx(pn,{className:"mr-2 h-4 w-4"}),"Return to Homepage"]})]})})})}):a?s.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8",children:s.jsx(De,{className:"max-w-md w-full",children:s.jsx(Be,{className:"pt-6",children:s.jsxs("div",{className:"text-center space-y-4",children:[s.jsx(Or,{className:"h-16 w-16 text-green-500 mx-auto"}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Successfully Unsubscribed"}),s.jsx("p",{className:"text-gray-600 mt-2",children:"You have been unsubscribed from our newsletter. We're sorry to see you go!"}),s.jsxs("p",{className:"text-sm text-gray-500 mt-2",children:["Email: ",u]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(Y,{onClick:h,className:"w-full",children:[s.jsx(pn,{className:"mr-2 h-4 w-4"}),"Return to Homepage"]}),s.jsx("p",{className:"text-xs text-gray-500",children:"You can always resubscribe by visiting our newsletter page."})]})]})})})}):s.jsx("div",{className:"min-h-screen bg-gray-50 flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8",children:s.jsxs(De,{className:"max-w-md w-full",children:[s.jsx(ot,{children:s.jsxs(ut,{className:"text-center flex items-center justify-center gap-2",children:[s.jsx(fs,{className:"h-5 w-5"}),"Unsubscribe from Newsletter"]})}),s.jsxs(Be,{className:"space-y-6",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-gray-600",children:"Are you sure you want to unsubscribe from our newsletter?"}),s.jsxs("p",{className:"text-sm text-gray-500 mt-2",children:["Email: ",u]})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx(Y,{onClick:d,disabled:r,variant:"destructive",className:"w-full",children:r?"Unsubscribing...":"Yes, Unsubscribe Me"}),s.jsxs(Y,{onClick:h,variant:"outline",className:"w-full",children:[s.jsx(pn,{className:"mr-2 h-4 w-4"}),"Cancel & Return Home"]})]}),s.jsx("div",{className:"text-center",children:s.jsx("p",{className:"text-xs text-gray-500",children:"You'll no longer receive our monthly newsletter with chamber news, member updates, and community events."})})]})]})})},FAe=()=>{const{toast:t}=St(),[e,r]=x.useState(""),[n,a]=x.useState(""),[i,o]=x.useState(!1),[l,c]=x.useState(!1),[u,d]=x.useState(null),[h,f]=x.useState(null),[m,g]=x.useState(!1),[y,b]=x.useState(!1),[w,j]=x.useState([]),[N,S]=x.useState(!0),[E,C]=x.useState(!1),[T,D]=x.useState("stripe-management"),A=async()=>{if(!e||!n){t({title:"Missing Information",description:"Please enter both old and new price IDs.",variant:"destructive"});return}try{o(!0);const O=await Po.dryRunPriceUpdate(e,n);d(O),g(!0),t({title:"Dry Run Complete",description:`Found ${O.subscriptions.length} subscriptions that would be updated.`})}catch(O){console.error("Error during dry run:",O),t({title:"Dry Run Failed",description:O instanceof Error?O.message:"Failed to perform dry run.",variant:"destructive"})}finally{o(!1)}},R=async()=>{if(!e||!n){t({title:"Missing Information",description:"Please enter both old and new price IDs.",variant:"destructive"});return}try{c(!0);const O=await Po.updatePriceIds(e,n);f(O),b(!0),t({title:"Update Complete",description:`Successfully updated ${O.summary.success} subscriptions.`})}catch(O){console.error("Error during update:",O),t({title:"Update Failed",description:O instanceof Error?O.message:"Failed to update price IDs.",variant:"destructive"})}finally{c(!1)}},M=()=>{r(""),a(""),d(null),f(null),g(!1),b(!1)};x.useEffect(()=>{P()},[]);const P=async()=>{try{S(!0);const O=await Ro.getAllPricing();j(O)}catch(O){console.error("Error loading pricing data:",O),t({title:"Error",description:"Failed to load pricing data.",variant:"destructive"})}finally{S(!1)}},U=(O,V)=>{j(G=>G.map(B=>B.id===O?{...B,amount:parseFloat(V)||0}:B))},I=async()=>{try{C(!0);for(const O of w)if(O.price_type==="business_additional"){const{error:V}=await Q.functions.invoke("create-stripe-price",{body:{amountInDollars:O.amount,pricingRowId:O.id}});if(V)throw new Error(`Failed to update Additional Business price in Stripe: ${V.message}`)}else await Po.updatePricing(O.id,{amount:O.amount,updated_at:new Date().toISOString()});Ro.clearCache(),t({title:"Success",description:"Pricing has been updated successfully."}),await P()}catch(O){console.error("Error saving pricing changes:",O),t({title:"Error",description:"Failed to save pricing changes.",variant:"destructive"})}finally{C(!1)}};
1346return s.jsxs("div",{className:"space-y-4 sm:space-y-6 md:space-y-8",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-xl sm:text-2xl md:text-3xl font-bold tracking-tight",children:"Price Management"}),s.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"Manage pricing for subscriptions and update Stripe price IDs across all subscriptions."})]}),s.jsxs(sn,{value:T,onValueChange:D,children:[s.jsxs(Qs,{className:"mb-4 sm:mb-6 flex w-full flex-wrap h-auto gap-1 p-1",children:[s.jsxs(Gt,{value:"pricing-settings",className:"flex items-center gap-2 flex-1 sm:flex-initial",children:[s.jsx(jd,{className:"h-4 w-4"}),s.jsx("span",{className:"hidden sm:inline",children:"Pricing Settings"}),s.jsx("span",{className:"sm:hidden",children:"Pricing"})]}),s.jsxs(Gt,{value:"stripe-management",className:"flex items-center gap-2 flex-1 sm:flex-initial",children:[s.jsx(Ii,{className:"h-4 w-4"}),s.jsx("span",{className:"hidden sm:inline",children:"Stripe Management"}),s.jsx("span",{className:"sm:hidden",children:"Stripe"})]})]}),s.jsx(Rt,{value:"pricing-settings",children:s.jsxs(De,{children:[s.jsxs(ot,{className:"p-4 sm:p-6",children:[s.jsxs(ut,{className:"flex items-center gap-2 text-lg sm:text-xl",children:[s.jsx(yu,{className:"h-5 w-5 shrink-0"}),"Subscription Pricing"]}),s.jsx(us,{className:"text-sm",children:"Update the base pricing for all subscription types. These prices are used throughout the application and for prorated calculations."})]}),s.jsx(Be,{className:"space-y-4 sm:space-y-6 p-4 sm:p-6 pt-0",children:N?s.jsxs("div",{className:"flex items-center justify-center py-8",children:[s.jsx(Mt,{className:"h-6 w-6 animate-spin mr-2"}),s.jsx("span",{className:"text-sm",children:"Loading pricing data..."})]}):s.jsx("div",{className:"space-y-4",children:w.map(O=>s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 p-4 border rounded-lg",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h4",{className:"font-medium break-words",children:O.display_name}),s.jsx("p",{className:"text-sm text-muted-foreground break-words",children:O.description}),s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Type: ",O.price_type]})]}),s.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[s.jsx("span",{className:"text-sm",children:"$"}),s.jsx(Ne,{type:"number",step:"0.01",min:"0",value:O.amount,onChange:V=>U(O.id,V.target.value),className:"w-24 sm:w-28 text-right"})]})]},O.id))})}),s.jsx(co,{className:"p-4 sm:p-6 pt-0",children:s.jsx(Y,{onClick:I,disabled:E||N,className:"w-full",children:E?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving Changes..."]}):s.jsxs(s.Fragment,{children:[s.jsx(hp,{className:"mr-2 h-4 w-4"}),"Save Pricing Changes"]})})})]})}),s.jsxs(Rt,{value:"stripe-management",children:[s.jsxs(De,{children:[s.jsxs(ot,{className:"p-4 sm:p-6",children:[s.jsxs(ut,{className:"flex items-center gap-2 text-lg sm:text-xl",children:[s.jsx(Ii,{className:"h-5 w-5 shrink-0"}),"Update Price IDs"]}),s.jsx(us,{className:"text-sm",children:"Enter the old and new price IDs to update all matching subscriptions. Always run a dry run first to preview changes."})]}),s.jsxs(Be,{className:"space-y-4 sm:space-y-6 p-4 sm:p-6 pt-0",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 sm:gap-6",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"oldPriceId",children:"Old Price ID"}),s.jsx(Ne,{id:"oldPriceId",placeholder:"price_1ABC123...",value:e,onChange:O=>r(O.target.value)}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"The current price ID to be replaced"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"newPriceId",children:"New Price ID"}),s.jsx(Ne,{id:"newPriceId",placeholder:"price_1XYZ789...",value:n,onChange:O=>a(O.target.value)}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"The new price ID to replace with"})]})]}),s.jsxs(da,{children:[s.jsx(yd,{className:"h-4 w-4"}),s.jsxs(ha,{children:[s.jsx("strong",{children:"Important:"})," This operation will update ALL subscriptions using the old price ID. Always run a dry run first to preview the changes. This action cannot be easily undone."]})]})]}),s.jsxs(co,{className:"flex flex-col sm:flex-row gap-2 sm:gap-4 p-4 sm:p-6 pt-0",children:[s.jsx(Y,{onClick:A,disabled:i||!e||!n,variant:"outline",className:"w-full sm:w-auto",children:i?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"}),"Running Dry Run..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Xs,{className:"mr-2 h-4 w-4"}),"Dry Run"]})}),s.jsx(Y,{onClick:R,disabled:l||!e||!n,variant:"default",className:"w-full sm:w-auto",children:l?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"}),"Updating..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Pl,{className:"mr-2 h-4 w-4"}
1346),"Update Price IDs"]})}),s.jsx(Y,{onClick:M,variant:"ghost",className:"w-full sm:w-auto",children:"Reset"})]})]}),s.jsx(Tt,{open:m,onOpenChange:g,children:s.jsxs(Dt,{className:"max-w-[min(100vw-2rem,56rem)] max-h-[85vh] overflow-y-auto p-4 sm:p-6",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Dry Run Results"}),s.jsxs(rr,{children:["Preview of subscriptions that would be updated from ",e," to ",n]})]}),u&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 sm:gap-4",children:[s.jsx(De,{children:s.jsx(Be,{className:"p-3 sm:p-4",children:s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(Os,{className:"h-4 w-4 text-blue-600 shrink-0"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-xs sm:text-sm font-medium truncate",children:"Total"}),s.jsx("p",{className:"text-lg sm:text-2xl font-bold",children:u.subscriptions.length})]})]})})}),s.jsx(De,{children:s.jsx(Be,{className:"p-4",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(yu,{className:"h-4 w-4 text-green-600"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Old Price ID"}),s.jsx("p",{className:"text-sm font-mono",children:e})]})]})})}),s.jsx(De,{children:s.jsx(Be,{className:"p-4",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(yu,{className:"h-4 w-4 text-purple-600"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"New Price ID"}),s.jsx("p",{className:"text-sm font-mono",children:n})]})]})})}),s.jsx(De,{children:s.jsx(Be,{className:"p-4",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Br,{className:"h-4 w-4 text-orange-600"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Status Breakdown"}),s.jsx("p",{className:"text-xs",children:Object.entries(u.statusBreakdown).map(([O,V])=>`${O}: ${V}`).join(", ")})]})]})})})]}),s.jsxs("div",{className:"border rounded-lg overflow-x-auto",children:[s.jsxs(Oi,{className:"min-w-[500px]",children:[s.jsx(zi,{children:s.jsxs(As,{children:[s.jsx(At,{children:"Subscription ID"}),s.jsx(At,{children:"Customer"}),s.jsx(At,{children:"Status"}),s.jsx(At,{children:"Current Period End"}),s.jsx(At,{children:"Items"})]})}),s.jsx(Ui,{children:u.subscriptions.slice(0,10).map(O=>{var V,G;return s.jsxs(As,{children:[s.jsx(Ct,{className:"font-mono text-sm",children:O.id}),s.jsx(Ct,{children:s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:((V=O.customerInfo)==null?void 0:V.name)||"Unknown"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:((G=O.customerInfo)==null?void 0:G.email)||"No email"})]})}),s.jsx(Ct,{children:s.jsx(ke,{variant:O.status==="active"?"default":"secondary",children:O.status})}),s.jsx(Ct,{children:new Date(O.currentPeriodEnd).toLocaleDateString()}),s.jsx(Ct,{children:s.jsx("div",{className:"space-y-1",children:O.items.map(B=>s.jsxs("div",{className:"text-sm",children:[s.jsx("p",{className:"font-mono",children:B.priceId}),s.jsx("p",{className:"text-muted-foreground",children:B.priceName})]},B.id))})})]},O.id)})})]}),u.subscriptions.length>10&&s.jsxs("div",{className:"p-4 text-center text-sm text-muted-foreground",children:["... and ",u.subscriptions.length-10," more subscriptions"]})]})]}),s.jsxs(Sr,{className:"flex-col-reverse sm:flex-row gap-2",children:[s.jsx(Y,{onClick:()=>g(!1),variant:"outline",className:"w-full sm:w-auto",children:"Close"}),s.jsx(Y,{onClick:R,disabled:l,className:"w-full sm:w-auto",children:l?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"mr-2 h-4 w-4 animate-spin"}),"Updating..."]}):"Proceed with Update"})]})]})}),s.jsx(Tt,{open:y,onOpenChange:b,children:s.jsxs(Dt,{className:"max-w-[min(100vw-2rem,56rem)] max-h-[85vh] overflow-y-auto p-4 sm:p-6",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Update Results"}),s.jsxs(rr,{children:["Results of updating price IDs from ",e," to ",n]})]}),h&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 sm:gap-4",children:[s.jsx(De,{children:s.jsx(Be,{className:"p-3 sm:p-4",children:s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(Or,{className:"h-4 w-4 text-green-600 shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Successful"}),s.jsx("p",{className:"text-2xl font-bold text-green-600",children:h.summary.success})]})]})})}),s.jsx(De,{children:s.jsx(Be,{className:"p-4",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Hl,{className:"h-4 w-4 text-red-600"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Errors"}),s.jsx("p",{className:"text-2xl font-bold text-red-600",children:h.summary.errors})]})]})})}),s.jsx(De,{children:s.jsx(Be,{className:"p-4",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(yd,{className:"h-4 w-4 text-yellow-600"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Skipped"}),s.jsx("p",{className:"text-2xl font-bold text-yellow-600",children:h.summary.skipped})]})]})})}),s.jsx(De,{children:s.jsx(Be,{className:"p-4",children:s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Os,{className:"h-4 w-4 text-blue-600"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:"Total"}),s.jsx("p",{className:"text-2xl font-bold",children:h.summary.total})]})]})})})]}),s.jsxs("div",{className:"border rounded-lg overflow-x-auto",children:[s.jsxs(Oi,{className:"min-w-[400px]",children:[s.jsx(zi,{children:s.jsxs(As,{children:[s.jsx(At,{children:"Subscription ID"}),s.jsx(At,{children:"Status"}),s.jsx(At,{children:"Message"})]})}),s.jsx(Ui,{children:h.results.slice(0,20).map((O,V)=>s.jsxs(As,{children:[s.jsx(Ct,{className:"font-mono text-sm",children:O.subscriptionId}),s.jsx(Ct,{children:O.success?s.jsxs(ke,{variant:"default",className:"bg-green-100 text-green-800",children:[s.jsx(Or,{className:"h-3 w-3 mr-1"}),"Success"]}):O.skipped?s.jsxs(ke,{variant:"secondary",children:[s.jsx(yd,{className:"h-3 w-3 mr-1"}),"Skipped"]}):s.jsxs(ke,{variant:"destructive",children:[s.jsx(Hl,{className:"h-3 w-3 mr-1"}),"Error"]})}),s.jsx(Ct,{className:"text-sm",children:O.message})]},O.subscriptionId||V))})]}),h.results.length>20&&s.jsxs("div",{className:"p-4 text-center text-sm text-muted-foreground",children:["... and ",h.results.length-20," more results"]})]})]}),s.jsx(Sr,{children:s.jsx(Y,{onClick:()=>b(!1),className:"w-full sm:w-auto",children:"Close"})})]})})]})]})]})},SAe=()=>s.jsx(FAe,{}),CAe=["Building","Users","Globe","Badge","Check","ArrowRight","Building2","Briefcase","Calendar","Wrench","Settings","FileText"],iM=({isOpen:t,onClose:e,onSuccess:r,onSubmit:n,editingCategory:a})=>{var b,w;const[i,o]=x.useState(!1),[l,c]=x.useState({category_name:"",category_icon:"Building",display_order:0,benefits:[],is_active:!0}),[u,d]=x.useState(""),{toast:h}=St();x.useEffect(()=>{c(a?{category_name:a.category_name,category_icon:a.category_icon,display_order:a.display_order,benefits:[...a.benefits],is_active:a.is_active}:{category_name:"",category_icon:"Building",display_order:0,benefits:[],is_active:!0}),d("")},[a,t]);const f=async j=>{if(j.preventDefault(),!l.category_name.trim()){h({title:"Validation Error",description:"Category name is required",variant:"destructive"});return}if(l.benefits.length===0){h({title:"Validation Error",description:"At least one benefit is required",variant:"destructive"});return}o(!0);try{await n(l),r(),e()}catch(N){h({title:"Error",description:N.message||"Failed to save category",variant:"destructive"})}finally{o(!1)}},m=()=>{u.trim()&&(c(j=>
1346({...j,benefits:[...j.benefits||[],u.trim()]})),d(""))},g=j=>{c(N=>{var S;return{...N,benefits:((S=N.benefits)==null?void 0:S.filter((E,C)=>C!==j))||[]}})},y=(j,N)=>{c(S=>{var E;return{...S,benefits:((E=S.benefits)==null?void 0:E.map((C,T)=>T===j?N:C))||[]}})};return s.jsx(Tt,{open:t,onOpenChange:e,children:s.jsxs(Dt,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:a?"Edit Category":"Add New Category"}),s.jsx(rr,{children:a?"Update the category details and benefits":"Create a new membership benefits category"})]}),s.jsxs("form",{onSubmit:f,className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"category_name",children:"Category Name *"}),s.jsx(Ne,{id:"category_name",value:l.category_name,onChange:j=>c(N=>({...N,category_name:j.target.value})),placeholder:"e.g., Business Development",required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"category_icon",children:"Icon"}),s.jsx("select",{id:"category_icon",value:l.category_icon,onChange:j=>c(N=>({...N,category_icon:j.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-chamber-blue focus:border-transparent",children:CAe.map(j=>s.jsx("option",{value:j,children:j},j))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"display_order",children:"Display Order"}),s.jsx(Ne,{id:"display_order",type:"number",value:l.display_order,onChange:j=>c(N=>({...N,display_order:parseInt(j.target.value)||0})),min:"0",placeholder:"0"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{children:"Benefits *"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ne,{value:u,onChange:j=>d(j.target.value),placeholder:"Add a benefit...",onKeyPress:j=>j.key==="Enter"&&(j.preventDefault(),m())}),s.jsx(Y,{type:"button",onClick:m,size:"sm",children:s.jsx(vs,{className:"w-4 h-4"})})]}),s.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:(b=l.benefits)==null?void 0:b.map((j,N)=>s.jsxs("div",{className:"flex items-center gap-2 p-2 bg-gray-50 rounded-md",children:[s.jsx(t6,{className:"w-4 h-4 text-gray-400"}),s.jsx(Ne,{value:j,onChange:S=>y(N,S.target.value),className:"flex-1"}),s.jsx(Y,{type:"button",variant:"ghost",size:"sm",onClick:()=>g(N),className:"text-red-500 hover:text-red-700",children:s.jsx(Ir,{className:"w-4 h-4"})})]},N))}),((w=l.benefits)==null?void 0:w.length)===0&&s.jsx("p",{className:"text-sm text-gray-500 italic",children:"No benefits added yet"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ii,{id:"is_active",checked:l.is_active,onCheckedChange:j=>c(N=>({...N,is_active:j}))}),s.jsx(Z,{htmlFor:"is_active",children:"Active"})]}),s.jsxs(Sr,{children:[s.jsx(Y,{type:"button",variant:"outline",onClick:e,disabled:i,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:i,children:i?"Saving...":a?"Update Category":"Create Category"})]})]})]})})},oM=({isOpen:t,onClose:e,onSuccess:r,onSubmit:n,editingTestimonial:a})=>{const[i,o]=x.useState(!1),[l,c]=x.useState({quote:"",author_name:"",author_business:"",display_order:0,is_active:!0}),{toast:u}=St();x.useEffect(()=>{c(a?{quote:a.quote,author_name:a.author_name,author_business:a.author_business,display_order:a.display_order,is_active:a.is_active}:{quote:"",author_name:"",author_business:"",display_order:0,is_active:!0})},[a,t]);const d=async h=>{var f,m,g;if(h.preventDefault(),!((f=l.quote)!=null&&f.trim())){u({title:"Validation Error",description:"Quote is required",variant:"destructive"});return}if(!((m=l.author_name)!=null&&m.trim())){u({title:"Validation Error",description:"Author name is required",variant:"destructive"});return}if(!((g=l.author_business)!=null&&g.trim())){u({title:"Validation Error",description:"Author business is required",variant:"destructive"});return}o(!0);try{await n(l),r(),e()}catch(y){u({title:"Error",description:y.message||"Failed to save testimonial",variant:"destructive"})}finally{o(!1)}};return s.jsx(Tt,{open:t,onOpenChange:e,children:s.jsxs(Dt,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:a?"Edit Testimonial":"Add New Testimonial"}),s.jsx(rr,{children:a?"Update the testimonial details":"Create a new member testimonial"})]}),s.jsxs("form",{onSubmit:d,className:"space-y-6",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"quote",children:"Quote *"}),s.jsx(zt,{id:"quote",value:l.quote,onChange:h=>c(f=>({...f,quote:h.target.value})),placeholder:"Enter the testimonial quote...",rows:4,required:!0})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"author_name",children:"Author Name *"}),s.jsx(Ne,{id:"author_name",value:l.author_name,onChange:h=>c(f=>({...f,author_name:h.target.value})),placeholder:"e.g., John Smith",required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"author_business",children:"Business N
1346ame *"}),s.jsx(Ne,{id:"author_business",value:l.author_business,onChange:h=>c(f=>({...f,author_business:h.target.value})),placeholder:"e.g., Smith & Co.",required:!0})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"display_order",children:"Display Order"}),s.jsx(Ne,{id:"display_order",type:"number",value:l.display_order,onChange:h=>c(f=>({...f,display_order:parseInt(h.target.value)||0})),min:"0",placeholder:"0"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ii,{id:"is_active",checked:l.is_active,onCheckedChange:h=>c(f=>({...f,is_active:h}))}),s.jsx(Z,{htmlFor:"is_active",children:"Active"})]}),s.jsxs(Sr,{children:[s.jsx(Y,{type:"button",variant:"outline",onClick:e,disabled:i,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:i,children:i?"Saving...":a?"Update Testimonial":"Create Testimonial"})]})]})]})})},lM=({isOpen:t,onClose:e,onSuccess:r,onSubmit:n,editingFAQ:a})=>{const[i,o]=x.useState(!1),[l,c]=x.useState({question:"",answer:"",display_order:0,is_active:!0}),{toast:u}=St();x.useEffect(()=>{c(a?{question:a.question,answer:a.answer,display_order:a.display_order,is_active:a.is_active}:{question:"",answer:"",display_order:0,is_active:!0})},[a,t]);const d=async h=>{var f,m;if(h.preventDefault(),!((f=l.question)!=null&&f.trim())){u({title:"Validation Error",description:"Question is required",variant:"destructive"});return}if(!((m=l.answer)!=null&&m.trim())){u({title:"Validation Error",description:"Answer is required",variant:"destructive"});return}o(!0);try{await n(l),r(),e()}catch(g){u({title:"Error",description:g.message||"Failed to save FAQ",variant:"destructive"})}finally{o(!1)}};return s.jsx(Tt,{open:t,onOpenChange:e,children:s.jsxs(Dt,{className:"max-w-2xl max-h-[90vh] overflow-y-auto",children:[s.jsxs(It,{children:[s.jsx(Ot,{children:a?"Edit FAQ":"Add New FAQ"}),s.jsx(rr,{children:a?"Update the FAQ details":"Create a new frequently asked question"})]}),s.jsxs("form",{onSubmit:d,className:"space-y-6",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"question",children:"Question *"}),s.jsx(zt,{id:"question",value:l.question,onChange:h=>c(f=>({...f,question:h.target.value})),placeholder:"Enter the question...",rows:2,required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"answer",children:"Answer *"}),s.jsx(zt,{id:"answer",value:l.answer,onChange:h=>c(f=>({...f,answer:h.target.value})),placeholder:"Enter the answer...",rows:4,required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(Z,{htmlFor:"display_order",children:"Display Order"}),s.jsx(Ne,{id:"display_order",type:"number",value:l.display_order,onChange:h=>c(f=>({...f,display_order:parseInt(h.target.value)||0})),min:"0",placeholder:"0"})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(ii,{id:"is_active",checked:l.is_active,onCheckedChange:h=>c(f=>({...f,is_active:h}))}),s.jsx(Z,{htmlFor:"is_active",children:"Active"})]}),s.jsxs(Sr,{children:[s.jsx(Y,{type:"button",variant:"outline",onClick:e,disabled:i,children:"Cancel"}),s.jsx(Y,{type:"submit",disabled:i,children:i?"Saving...":a?"Update FAQ":"Create FAQ"})]})]})]})})},kAe=()=>{const[t,e]=x.useState([]),[r,n]=x.useState(!1),[a,i]=x.useState(!1),[o,l]=x.useState(null),[c,u]=x.useState(null),[d,h]=x.useState([]),[f,m]=x.useState(!1),[g,y]=x.useState(!1),[b,w]=x.useState(null),[j,N]=x.useState(null),[S,E]=x.useState([]),[C,T]=x.useState(!1),[D,A]=x.useState(!1),[R,M]=x.useState(null),[P,U]=x.useState(null),[I,O]=x.useState(!0),{toast:V}=St();x.useEffect(()=>{G()},[]);const G=async()=>{try{O(!0);const[fe,ge,Ge]=await Promise.all([mg.getAllCategories(!0),fg.getAllTestimonials(!0),pg.getAllFAQs(!0)]);e(fe),h(ge),E(Ge)}catch(fe){console.error("Error fetching data:",fe),V({title:"Error",description:"Failed to load membership content",variant:"destructive"})}finally{O(!1)}},B=fe=>{l(fe),i(!0)},$=()=>{n(!0)},W=fe=>{w(fe),y(!0)},oe=()=>{m(!0)},K=fe=>{M(fe),A(!0)},H=()=>{T(!0)},X=async fe=>{try{const ge=await mg.createCategory(fe);if(!(ge!=null&&ge.success))throw new Error((ge==null?void 0:ge.error)||"Failed to create category");await G()}catch(ge){throw console.error("Error creating category:",ge),ge}},me=async fe=>{if(o)try{const ge=await mg.updateCategory(o.id,fe);if(!(ge!=null&&ge.success))throw new Error((ge==null?void 0:ge.error)||"Failed to update category");await G()}catch(ge){throw console.error("Error updating category:",ge),ge}},ie=async fe=>{try{const ge=await fg.createTestimonial(fe);if(!(ge!=null&&ge.success))throw new Error((ge==null?void 0:ge.error)||"Failed to create testimonial");await G()}catch(ge){throw console.error("Error creating testimonial:",ge),ge}},ee=async fe=>{if(b)try{const ge=await fg.updateTestimonial(b.id,fe);if(!(ge!=null&&ge.success))throw new Error((ge==null?void 0:ge.error)||"Failed to update testimonial");await G()}catch(ge){throw console.error("Error updating testimonial:",ge),ge}},he=async fe=>{try{const ge=await pg.createFAQ(fe);if(!(ge!=null&&ge.success))throw new Error((ge==null?void 0:ge.error)||"Failed to create FAQ");await G()}catch(ge){throw console.error("Error creating FAQ:",ge),ge}},ve=async fe=>{if(R)try{const ge=await pg.updateFAQ(R.id,fe);if(!(ge!=null&&ge.success))throw new Error((ge==null?void 0:ge.error)||"Failed to update FAQ");await G()}catch(ge){throw console.error("Error updating FAQ:",ge),ge}},Ce=()=>{n(!1),V({title:"Success",description:"Category created successfully"})},re=()=>{i(!1),l(null),V({title:"Success",description:"Category updated successfully"})},we=()=>{m(!1),V({title:"Success",description:"Testimonial created successfully"})},Ee=()=>{y(!1),w(null),V({title:"Success",description:"Testimonial updated successfully"})},Me=()=>{T(!1),V({title:"Success",description:"FAQ created successfully"})},ae=()=>{A(!1),M(null),V({title:"Success",description:"FAQ updated successfully"})},ze=async fe=>{try{const ge=await mg.toggleCategoryStatus(fe.id);ge.success?(V({title:"Success",description:`Category ${fe.is_active?"deactivated":"activated"} successfully`}),await G()):V({title:"Error",description:ge.error||"Failed to toggle category status",variant:"destructive"})}catch(ge){console.error("Error toggling category status:",ge),V({title:"Error",description:"Failed to toggle category status",variant:"destructive"})}},mt=async fe=>{try{const ge=await fg.toggleTestimonialStatus(fe.id);ge.success?(V({title:"Success",description:`Testimonial ${fe.is_active?"deactivated":"activated"} successfully`}),await G()):V({title:"Error",description:ge.error||"Failed to toggle testimonial status",variant:"destructive"})}catch(ge){console.error("Error toggling testimonial status:",ge),V({title:"Error",description:"Failed to toggle testimonial status",variant:"destructive"})}},tt=async fe=>{try{const ge=await pg.toggleFAQStatus(fe.id);ge.success?(V({title:"Success",description:`FAQ ${fe.is_active?"deactivated":"activated"} successfully`}),await G()):V({title:"Error",description:ge.error||"Failed to toggle FAQ status",variant:"destructive"})}catch(ge){console.error("Error toggling FAQ status:",ge),V({title:"Error",description:"Failed to toggle FAQ status",variant:"destructive"})}},Xe=async fe=>{try{const ge=await mg.deleteCategory(fe);ge.success?(V({title:"Success",description:"Category deleted successfully"}),u(null),await G()):V({title:"Error",description:ge.error||"Failed to delete category",variant:"destructive"})}catch(ge){console.error("Error deleting category:",ge),V({title:"Error",description:"Failed to delete category",variant:"destructive"})}},Ft=async fe=>{try{const ge=await fg.deleteTestimonial(fe);ge.success?(V({title:"Success",description:"Testimonial deleted successfully"}),N(null),await G()):V({title:"Error",description:ge.error||"Failed to delete testimonial",variant:"destructive"})}catch(ge){console.error("Error deleting testimonial:",ge),V({title:"Error",description:"Failed to delete testimonial",variant:"destructive"})}},ce=async fe=>{try{const ge=await pg.deleteFAQ(fe);ge.success?(V({title:"Success",description:"FAQ deleted successfully"}),U(null),await G()):V({title:"Error",description:ge.error||"Failed to delete FAQ",variant:"destructive"})}catch(ge){console.error("Error deleting FAQ:",ge),V({title:"Error",description:"Failed to delete FAQ",variant:"destructive"})}};return I?s.jsx("div",{className:"flex items-center justify-center p-8",children:s.jsx(Mt,{className:"h-8 w-8 animate-spin"})}
1346):s.jsxs("div",{className:"space-y-4 sm:space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-xl sm:text-2xl font-bold",children:"Membership Content Management"}),s.jsx("p",{className:"text-gray-600",children:"Manage membership benefits, testimonials, and FAQs"})]}),s.jsxs(sn,{defaultValue:"benefits",className:"w-full",children:[s.jsxs(Qs,{className:"grid w-full grid-cols-3",children:[s.jsxs(Gt,{value:"benefits",className:"flex items-center gap-2",children:[s.jsx(ka,{className:"w-4 h-4"}),"Benefits Categories"]}),s.jsxs(Gt,{value:"testimonials",className:"flex items-center gap-2",children:[s.jsx(uE,{className:"w-4 h-4"}),"Testimonials"]}),s.jsxs(Gt,{value:"faqs",className:"flex items-center gap-2",children:[s.jsx(Kg,{className:"w-4 h-4"}),"FAQs"]})]}),s.jsxs(Rt,{value:"benefits",className:"space-y-6",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-semibold",children:"Benefits Categories"}),s.jsx("p",{className:"text-gray-600",children:"Manage membership benefit categories and their content"})]}),s.jsxs(Y,{onClick:$,className:"bg-chamber-blue hover:bg-blue-700",children:[s.jsx(vs,{className:"w-4 h-4 mr-2"}),"Add Category"]})]}),s.jsx("div",{className:"space-y-4",children:t.length===0?s.jsx(De,{children:s.jsx(Be,{className:"p-8 text-center",children:s.jsx("p",{className:"text-gray-500",children:"No categories found. Create your first benef
1346it category."})})}):t.sort((fe,ge)=>fe.display_order-ge.display_order).map(fe=>s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"flex items-center gap-3 mb-2",children:s.jsxs(ut,{className:"flex items-center gap-2",children:[fe.category_name,fe.is_active?s.jsx(ke,{className:"bg-green-500 text-white",children:"Active"}):s.jsx(ke,{variant:"secondary",children:"Inactive"})]})}),s.jsxs("p",{className:"text-sm text-gray-500",children:["Order: ",fe.display_order," ⢠Last updated: ",new Date(fe.updated_at).toLocaleDateString()]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Y,{size:"sm",variant:"outline",onClick:()=>B(fe),children:s.jsx(zs,{className:"w-4 h-4"})}),s.jsx(Y,{size:"sm",variant:"outline",onClick:()=>ze(fe),children:fe.is_active?s.jsx(Py,{className:"w-4 h-4"}):s.jsx(Xs,{className:"w-4 h-4"})}),s.jsx(Y,{size:"sm",variant:"destructive",onClick:()=>u(fe.id),children:s.jsx(vr,{className:"w-4 h-4"})})]})]})}),s.jsx(Be,{children:s.jsxs("div",{className:"mb-4",children:[s.jsxs("h4",{className:"font-medium mb-2",children:["Benefits (",fe.benefits.length,")"]}),s.jsxs("ul",{className:"space-y-1",children:[fe.benefits.slice(0,3).map((ge,Ge)=>s.jsxs("li",{className:"text-sm text-gray-700 flex items-start",children:[s.jsx("span",{className:"text-green-600 mr-2",children:"â¢"}),ge]},Ge)),fe.benefits.length>3&&s.jsxs("li",{className:"text-sm text-gray-500 italic",children:["And ",fe.benefits.length-3," more benefits..."]})]})]})})]},fe.id))})]}),s.jsxs(Rt,{value:"testimonials",className:"space-y-6",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-semibold",children:"Testimonials"}),s.jsx("p",{className:"text-gray-600",children:"Manage member testimonials displayed on the benefits page"})]}),s.jsxs(Y,{onClick:oe,className:"bg-chamber-blue hover:bg-blue-700",children:[s.jsx(vs,{className:"w-4 h-4 mr-2"}),"Add Testimonial"]})]}),s.jsx("div",{className:"space-y-4",children:d.length===0?s.jsx(De,{children:s.jsx(Be,{className:"p-8 text-center",children:s.jsx("p",{className:"text-gray-500",children:"No testimonials found. Create your first member testimonial."})})}):d.sort((fe,ge)=>fe.display_order-ge.display_order).map(fe=>s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[s.jsx(uE,{className:"w-5 h-5 text-chamber-blue"}),s.jsxs(ut,{className:"flex items-center gap-2",children:[fe.author_name,fe.is_active?s.jsx(ke,{className:"bg-green-500 text-white",children:"Active"}):s.jsx(ke,{variant:"secondary",children:"Inactive"})]})]}),s.jsx("p",{className:"text-sm text-gray-600 mb-2",children:fe.author_business}),s.jsxs("p",{className:"text-sm text-gray-500",children:["Order: ",fe.display_order," ⢠Last updated: ",new Date(fe.updated_at).toLocaleDateString()]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Y,{size:"sm",variant:"outline",onClick:()=>W(fe),children:s.jsx(zs,{className:"w-4 h-4"})}),s.jsx(Y,{size:"sm",variant:"outline",onClick:()=>mt(fe),children:fe.is_active?s.jsx(Py,{className:"w-4 h-4"}):s.jsx(Xs,{className:"w-4 h-4"})}),s.jsx(Y,{size:"sm",variant:"destructive",onClick:()=>N(fe.id),children:s.jsx(vr,{className:"w-4 h-4"})})]})]})}),s.jsx(Be,{children:s.jsxs("blockquote",{className:"text-gray-700 italic border-l-4 border-chamber-blue pl-4",children:['"',fe.quote,'"']})})]},fe.id))})]}),s.jsxs(Rt,{value:"faqs",className:"space-y-6",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-semibold",children:"Frequently Asked Questions"}),s.jsx("p",{className:"text-gray-600",children:"Manage FAQs displayed on the membership benefits page"})]}),s.jsxs(Y,{onClick:H,className:"bg-chamber-blue hover:bg-blue-700",children:[s.jsx(vs,{className:"w-4 h-4 mr-2"}),"Add FAQ"]})]}),s.jsx("div",{className:"space-y-4",children:S.length===0?s.jsx(De,{children:s.jsx(Be,{className:"p-8 text-center",children:s.jsx("p",{className:"text-gray-500",children:"No FAQs foun
1346d. Create your first frequently asked question."})})}):S.sort((fe,ge)=>fe.display_order-ge.display_order).map(fe=>s.jsxs(De,{children:[s.jsx(ot,{children:s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[s.jsx(Kg,{className:"w-5 h-5 text-chamber-blue"}),s.jsx(ut,{className:"flex items-center gap-2",children:fe.is_active?s.jsx(ke,{className:"bg-green-500 text-white",children:"Active"}):s.jsx(ke,{variant:"secondary",children:"Inactive"})})]}),s.jsxs("p",{className:"text-sm text-gray-500 mb-2",children:["Order: ",fe.display_order," ⢠Last updated: ",new Date(fe.updated_at).toLocaleDateString()]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Y,{size:"sm",variant:"outline",onClick:()=>K(fe),children:s.jsx(zs,{className:"w-4 h-4"})}),s.jsx(Y,{size:"sm",variant:"outline",onClick:()=>tt(fe),children:fe.is_active?s.jsx(Py,{className:"w-4 h-4"}):s.jsx(Xs,{className:"w-4 h-4"})}),s.jsx(Y,{size:"sm",variant:"destructive",onClick:()=>U(fe.id),children:s.jsx(vr,{className:"w-4 h-4"})})]})]})}),s.jsx(Be,{children:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold text-gray-900 mb-1",children:"Question:"}),s.jsx("p",{className:"text-gray-700",children:fe.question})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold text-gray-900 mb-1",children:"Answer:"}),s.jsx("p",{className:"text-gray-700",children:fe.answer})]})]})})]},fe.id))})]})]}),s.jsx(iM,{isOpen:r,onClose:()=>n(!1),onSuccess:Ce,onSubmit:X}),s.jsx(iM,{isOpen:a,onClose:()=>{i(!1),l(null)},onSuccess:re,onSubmit:me,editingCategory:o}),s.jsx(oM,{isOpen:f,onClose:()=>m(!1),onSuccess:we,onSubmit:ie}),s.jsx(oM,{isOpen:g,onClose:()=>{y(!1),w(null)},onSuccess:Ee,onSubmit:ee,editingTestimonial:b}),s.jsx(lM,{isOpen:C,onClose:()=>T(!1),onSuccess:Me,onSubmit:he}),s.jsx(lM,{isOpen:D,onClose:()=>{A(!1),M(null)},onSuccess:ae,onSubmit:ve,editingFAQ:R}),s.jsx(Tt,{open:!!c,onOpenChange:()=>u(null),children:s.jsxs(Dt,{children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Delete Category"}),s.jsx(rr,{children:"Are you sure you want to delete this benefits category? This action cannot be undone."})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",onClick:()=>u(null),children:"Cancel"}),s.jsx(Y,{variant:"destructive",onClick:()=>c&&Xe(c),children:"Delete"})]})]})}),s.jsx(Tt,{open:!!j,onOpenChange:()=>N(null),children:s.jsxs(Dt,{children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Delete Testimonial"}),s.jsx(rr,{children:"Are you sure you want to delete this testimonial? This action cannot be undone."})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",onClick:()=>N(null),children:"Cancel"}),s.jsx(Y,{variant:"destructive",onClick:()=>j&&Ft(j),children:"Delete"})]})]})}),s.jsx(Tt,{open:!!P,onOpenChange:()=>U(null),children:s.jsxs(Dt,{children:[s.jsxs(It,{children:[s.jsx(Ot,{children:"Delete FAQ"}),s.jsx(rr,{children:"Are you sure you want to delete this FAQ? This action cannot be undone."})]}),s.jsxs(Sr,{children:[s.jsx(Y,{variant:"outline",onClick:()=>U(null),children:"Cancel"}),s.jsx(Y,{variant:"destructive",onClick:()=>P&&ce(P),children:"Delete"})]})]})})]})},_Ae=()=>s.jsx(kAe,{}),nl=({children:t})=>{const{isAuthenticated:e,isLoading:r}=ts(),n=Wi();return r?s.jsx("div",{className:"flex items-center justify-center min-h-screen",children:s.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-chamber-blue"})}):e?s.jsx(s.Fragment,{children:t}):s.jsx(Tf,{to:"/auth/login",state:{from:n},replace:!0})},vy=({children:t,redirectTo:e="/dashboard"})=>{const{isAuthenticated:r,isLoading:n}=ts();return n?s.jsx("div",{className:"flex items-center justify-center min-h-screen",children:s.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-chamber-blue"})}):r?s.jsx(Tf,{to:e,replace:!0}):s.jsx(s.Fragment,{children:t})},EAe=({children:t})=>{const{isAuthenticated:e,isLoading:r}=ts(),{isAdmin:n,isLoading:a}=bP(),i=Wi();return r||a?s.jsx("div",{className:"flex items-center justify-center min-h-screen",children:s.jsx("div",{className:"animate-spin rounded-full h-32 w-32 border-b-2 border-chamber-blue"})}):e?n?s.jsx(s.Fragment,{children:t}):s.jsx(Tf,{to:"/dashboard",replace:!0}):s.jsx(Tf,{to:"/auth/login",state:{from:i},replace:!0})},AAe=({reloadMembershipStatus:t})=>{const{isAuthenticated:e,membershipStatus:r,membershipStatusLoading:n,residentialApprovalStatus:a,signOut:i,userType:o}=ts(),[l,c]=x.useState(!1),u=ks(),d=a==="approved";x.useEffect(()=>{c(!!(e&&!n&&o==="residential"&&r!=="active"&&!d))},[e,r,n,o,d]);const h=r==="active"||d||o!=="residential",f=async()=>{await i(),u("/")};return s.jsx(Tt,{open:l,onOpenChange:h?c:void 0,children:s.jsxs(Dt,{hideCloseButton:!h,children:[e&&!n&&o==="residential"&&r!=="active"&&!d&&s.jsx("div",{className:"absolute right-4 top-4 z-10",children:s.jsxs(Y,{variant:"outline",onClick:f,className:"text-red-500 flex items-center gap-2",children:[s.jsx(xC,{size:16}),"Logout"]})}),s.jsx(Q8,{reloadMembershipStatus:t})]})})},DAe=({reloadBusinessSubscriptionStatus:t})=>
1346{const[e,r]=x.useState(null),[n,a]=x.useState(!0),[i,o]=x.useState(!1),[l,c]=x.useState([]),[u,d]=x.useState([]),[h,f]=x.useState(""),[m,g]=x.useState(null),[y,b]=x.useState(null),[w,j]=x.useState(!1),[N,S]=x.useState("subscription"),[E,C]=x.useState(null),[T,D]=x.useState(null),{toast:A}=St();x.useEffect(()=>{M(),P(),U(),I(),R()},[]);const R=async()=>{try{const W=await Ro.getBusinessPricing();D(W)}catch(W){console.error("Error loading pricing info:",W),D(Ro.calculateProratedPricing(125))}},M=async()=>{try{a(!0);const W=await Bi.getBusinessSubscription();r(W)}catch(W){console.error("Error loading business subscription:",W),C("Failed to load subscription data")}finally{a(!1)}},P=async()=>{try{const W=await Bi.getUserBusinessesForSubscription();c(W),W.length>0&&!h&&f(W[0].id)}catch(W){console.error("Error loading businesses:",W)}},U=async()=>{try{const W=await Bi.getUserBusinessesWithActiveSubscription();d(W)}catch(W){console.error("Error loading active businesses:",W)}},I=()=>{new URLSearchParams(window.location.search).get("subscription")==="success"&&(A({title:"Subscription Successful!",description:"Your business subscription has been activated."}),window.history.replaceState({},document.title,window.location.pathname))},O=async()=>{if(!h){A({title:"No Business Selected",description:"Please select a business to subscribe.",variant:"destructive"});return}if(h.trim()===""||h==="undefined"||h==="null"){A({title:"Invalid Business Selection",description:"Please refresh the page and try again.",variant:"destructive"});return}if(n||l.length===0){A({title:"Loading Business Data",description:"Please wait for your business data to load before subscribing.",variant:"destructive"});return}try{o(!0),C(null),console.log("Creating business subscription for business ID:",h);const{url:W}=await Bi.createBusinessSubscriptionSession(h);window.location.href=W}catch(W){console.error("Error creating business subscription:",W),C(W.message||"Failed to create subscription session"),A({title:"Subscription Error",description:W.message||"Failed to create subscription session. Please try again.",variant:"destructive"})}finally{o(!1)}},V=async()=>{try{const{url:W}=await Bi.createBusinessPortalSession();window.location.href=W}catch(W){console.error("Error creating portal session:",W),A({title:"Error",description:"Failed to open subscription management. Please try again.",variant:"destructive"})}},G=W=>{b(W),j(!0)},B=async()=>{if(y)try{g(y.id),j(!1),await Bi.cancelBusinessSubscription(y.id),A({title:"Subscription Canceled",description:"Your business subscription will be canceled at the end of the current billing period.",variant:"default"}),await U(),await M(),t&&await t()}catch(W){console.error("Error canceling business subscription:",W),A({title:"Cancellation Failed",description:W.message||"Failed to cancel business subscription. Please try again.",variant:"destructive"})}finally{g(null),b(null)}},$=W=>{switch(W){case"active":return s.jsxs(ke,{variant:"default",className:"bg-green-500 hover:bg-green-600",children:[s.jsx(Or,{className:"w-3 h-3 mr-1"}),"Active"]});case"canceled":return s.jsxs(ke,{variant:"outline",className:"border-orange-500 text-orange-600",children:[s.jsx(Br,{className:"w-3 h-3 mr-1"}),"Canceling at Period End"]});case"past_due":return s.jsxs(ke,{variant:"destructive",children:[s.jsx(Ts,{className:"w-3 h-3 mr-1"}),"Payment Failed"]});default:return s.jsxs(ke,{variant:"outline",children:[s.jsx(Ir,{className:"w-3 h-3 mr-1"}),"Inactive"]})}};return n?s.jsx(De,{children:s.jsx(Be,{className:"flex items-center justify-center py-8",children:s.jsx(Mt,{className:"h-8 w-8 animate-spin"})})}):s.jsxs(De,{children:[s.jsxs(ot,{children:[s.jsxs(ut,{className:"flex items-center gap-2",children:[s.jsx(up,{className:"h-5 w-5 text-blue-500"}),"Business Subscription"]}),s.jsx(us,{children:"Subscribe to activate your business listing and access premium features with prorated pricing based on the calendar year."})]}),s.jsx(Be,{className:"space-y-6",children:s.jsxs(sn,{value:N,onValueChange:S,children:[s.jsxs(Qs,{className:"mb-4",children:[s.jsx(Gt,{value:"subscription",children:"Current Subscription"}),s.jsx(Gt,{value:"benefits",children:"Business Benefits"})]}),s.jsxs(Rt,{value:"subscription",className:"space-y-6",children:[E&&s.jsxs(da,{variant:"destructive",children:[s.jsx(Ts,{className:"h-4 w-4"}),s.jsx(ha,{children:E})]}),s.jsxs("div",{className:"p-4 bg-gray-50 border rounded-lg",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"font-medium text-lg",children:"Business Subscription Status"}),s.jsx("p",{className:"text-sm text-gray-600",children:(e==null?void 0:e.status)==="active"?`Active subscription for ${e.business_name}`:"You currently don't have an active business subscription"})]}),$(e==null?void 0:e.status)]}),(e==null?void 0:e.status)==="active"&&s.jsxs("div",{className:"text-sm text-gray-600",children:[s.jsxs("p",{children:["Business: ",e.business_name]}),s.jsxs("p",{children:["Renews: ",new Date(e.current_period_end).toLocaleDateString()]}),e.canceled_at&&s.jsxs("p",{className:"text-orange-600",children:["Cancels: ",new Date(e.current_period_end).toLocaleDateString()]})]})]}),u.length>0&&s.jsxs("div",{className:"space-y-4",children:[s.jsx("h4",{className:"font-medium text-sm text-gray-700",children:"Your Active Business Subscriptions"}),u.map(W=>{const oe=W.business_cancel_at_period_end,K=H=>H?new Date(H).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):"N/A";return s.jsx("div",{className:`p-4 border rounded-lg ${oe?"bg-orange-50 border-orange-200":"bg-green-50 border-green-200"}`,children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h5",{className:"font-medium",children:W.business_name}),s.jsx("p",{className:"text-sm text-gray-600",children:oe?`Subscription ends: ${K(W.business_subscription_expires_at)}`:`Next billing: ${K(W.business_subscription_expires_at)}`}),oe&&s.jsx("p",{className:"text-xs text-orange-600 mt-1",children:"Your subscription will not renew and will end on the date above."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ke,{variant:oe?"outline":"default",className:oe?"border-orange-500 text-orange-600":"bg-green-500 hover:bg-green-600",children:oe?s.jsxs(s.Fragment,{children:[s.jsx(Br,{className:"w-3 h-3 mr-1"}
1346),"Canceling at Period End"]}):s.jsxs(s.Fragment,{children:[s.jsx(Or,{className:"w-3 h-3 mr-1"}),"Active"]})}),!oe&&!W.is_outside_payment&&s.jsx(Y,{variant:"outline",size:"sm",onClick:()=>G(W),disabled:m===W.id,className:"border-red-200 text-red-600 hover:bg-red-50 hover:border-red-300",children:m===W.id?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"h-3 w-3 animate-spin mr-1"}),"Canceling..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Ir,{className:"h-3 w-3 mr-1"}),"Cancel"]})})]})]})},W.id)})]}),(e==null?void 0:e.status)!=="active"&&l.length>0&&s.jsxs("div",{className:"border-t pt-4",children:[s.jsxs("div",{className:"mb-4",children:[s.jsx("label",{className:"block text-sm font-medium mb-2",children:"Select Business to Subscribe"}),s.jsx("select",{value:h,onChange:W=>f(W.target.value),className:"w-full p-2 border rounded-md",children:l.map(W=>s.jsx("option",{value:W.id,children:W.business_name},W.id))})]}),T&&s.jsx("div",{className:"border rounded-lg p-4 bg-blue-50 mb-4",children:s.jsxs("div",{className:"text-center",children:[s.jsxs("div",{className:"text-2xl font-bold text-blue-900 mb-1",children:["$",T.isFullYear?T.fullYearPrice:T.proratedPrice]}),s.jsx("div",{className:"text-sm text-blue-700 mb-3",children:T.isFullYear?"Annual business subscription":`Prorated for ${T.daysRemaining} days remaining`}),!T.isFullYear&&s.jsxs("div",{className:"text-xs text-blue-600 mb-3",children:["Full year: $",T.fullYearPrice," ⢠Prorated: $",T.proratedPrice," ⢠Save: $",Math.round((T.fullYearPrice-T.proratedPrice)*100)/100]}),s.jsx("div",{className:"text-xs text-blue-600",children:T.isFullYear?"Full year business listing and premium features":`Until Dec 31, ${new Date().getFullYear()} ⢠Renews at ${T.fullYearPrice}/year`})]})}),s.jsx(Y,{onClick:O,disabled:i||!h||n||l.length===0||h.trim()==="",className:"w-full bg-chamber-blue hover:bg-chamber-blue-dark",size:"lg",children:i?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"h-4 w-4 animate-spin mr-2"}),"Processing..."]}):n?s.jsxs(s.Fragment,{children:[s.jsx(Mt,{className:"h-4 w-4 animate-spin mr-2"}),"Loading Business Data..."]}):s.jsxs(s.Fragment,{children:[s.jsx(Ii,{className:"h-4 w-4 mr-2"}),"Subscribe Now"]})})]}),(e==null?void 0:e.status)==="active"&&s.jsx("div",{className:"border-t pt-4",children:s.jsxs(Y,{onClick:V,variant:"outline",size:"lg",className:"w-full",children:[s.jsx(Ii,{className:"h-4 w-4 mr-2"}),"Manage Subscription"]})}),l.length===0&&(e==null?void 0:e.status)!=="active"&&s.jsxs(da,{children:[s.jsx(Ts,{className:"h-4 w-4"}),s.jsx(ha,{children:"You need to create a business first before subscribing. Go to the Businesses tab to add your business."})]})]}),s.jsxs(Rt,{value:"benefits",className:"space-y-4",children:[s.jsxs("div",{className:"grid gap-4",children:[s.jsxs("div",{className:"p-4 border rounded-lg",children:[s.jsx("h4",{className:"font-medium mb-2",children:"â Business Directory Listing"}),s.jsx("p",{className:"text-sm text-gray-600",children:"Your business will be visible in our public directory"})]}),s.jsxs("div",{className:"p-4 border rounded-lg",children:[s.jsx("h4",{className:"font-medium mb-2",children:"â Premium Business Profile"}),s.jsx("p",{className:"text-sm text-gray-600",children:"Enhanced profile with gallery, hours, and contact information"})]}),s.jsxs("div",{className:"p-4 border rounded-lg",children:[s.jsx("h4",{className:"font-medium mb-2",children:"â Event Creation"}),s.jsx("p",{className:"text-sm text-gray-600",children:"Create and promote your business events"})]}),s.jsxs("div",{className:"p-4 border rounded-lg",children:[s.jsx("h4",{className:"font-medium mb-2",children:"â Customer Reviews"}),s.jsx("p",{className:"text-sm text-gray-600",children:"Collect and display customer reviews"})]})]}),T&&s.jsxs("div",{className:"p-4 bg-blue-50 rounded-lg mt-4",children:[s.jsx("h4",{className:"font-medium text-blue-800",children:"Prorated Pricing"}),s.jsxs("p",{className:"text-sm text-blue-700 mt-1",children:["Our business subscription pricing is prorated based on the calendar year. If you subscribe mid-year, you'll only pay for the remaining days of the current year. On January 1st, all subscriptions renew at the full annual rate of $",T.fullYearPrice,"."]}),s.jsxs("div",{className:"mt-2 text-xs text-blue-600",children:["Current pricing: $",T.isFullYear?T.fullYearPrice:T.proratedPrice," for ",T.is
1346FullYear?"full year":`${T.daysRemaining} days remaining in ${new Date().getFullYear()}`]})]})]})]})}),s.jsx(xR,{isOpen:w,onClose:()=>j(!1),onConfirm:B,businessName:(y==null?void 0:y.business_name)||"",isLoading:m===(y==null?void 0:y.id),expirationDate:y==null?void 0:y.business_subscription_expires_at})]})},TAe=({reloadBusinessSubscriptionStatus:t})=>{const{isAuthenticated:e,businessSubscriptionStatus:r,businessSubscriptionStatusLoading:n,shouldShowBusinessSubscriptionModal:a,businessSubscriptionModalLoading:i,signOut:o,userType:l}=ts(),[c,u]=x.useState(!1),d=ks();x.useEffect(()=>{const g=sessionStorage.getItem("hideBusinessSubscriptionModal");u(!!(e&&!i&&l==="business"&&a&&!g))},[e,a,i,l]);const h=!a||l!=="business",f=async()=>{await o(),d("/")},m=()=>{sessionStorage.setItem("hideBusinessSubscriptionModal","true"),u(!1)};return s.jsx(Tt,{open:c,onOpenChange:h?u:void 0,children:s.jsxs(Dt,{hideCloseButton:!h,className:"max-h-[90vh] overflow-y-auto",children:[e&&!i&&l==="business"&&a&&s.jsx("div",{className:"absolute right-4 top-4 z-10 flex items-center gap-2",children:s.jsxs(Y,{variant:"outline",onClick:f,className:"text-red-500 flex items-center gap-2",children:[s.jsx(xC,{size:16}),"Logout"]})}),s.jsx(DAe,{reloadBusinessSubscriptionStatus:t}),e&&!i&&l==="business"&&a&&s.jsx("div",{className:"mt-4 flex justify-end",children:s.jsx(Y,{variant:"secondary",onClick:m,children:"Pay Later"})})]})})},MAe=new wZ({defaultOptions:{queries:{refetchOnWindowFocus:!1,refetchOnReconnect:!1,staleTime:5*60*1e3,gcTime:10*60*1e3,retry:1,refetchOnMount:!1}}}),PAe=()=>{const{reloadMembershipStatus:t,reloadBusinessSubscriptionStatus:e,userType:r,shouldShowBusinessSubscriptionModal:n,businessSubscriptionModalLoading:a}=ts();return s.jsxs(s.Fragment,{children:[r==="residential"&&s.jsx(AAe,{reloadMembershipStatus:t}),r==="business"&&!a&&n&&s.jsx(TAe,{reloadBusinessSubscriptionStatus:e})]})},RAe=()=>s.jsx(jZ,{client:MAe,children:s.jsx(WX,{children:s.jsx(qX,{children:s.jsxs(RX,{children:[s.jsx(U1e,{}),s.jsx(H1e,{}),s.jsx(L1e,{}),s.jsx(I1e,{}),s.jsx(B1e,{}),s.jsx(PAe,{}),s.jsxs(ZY,{children:[s.jsx(OK,{}),s.jsx(xJ,{}),s.jsxs("div",{className:"flex flex-col min-h-screen",children:[s.jsx("main",{className:"flex-grow",children:s.jsxs(kX,{children:[s.jsx(Pt,{path:"/",element:s.jsx(xre,{})}),s.jsx(Pt,{path:"/auth/login",element:s.jsx(vy,{children:s.jsx(jre,{})})}),s.jsx(Pt,{path:"/auth/signup",element:s.jsx(vy,{children:s.jsx(Nre,{})})}),s.jsx(Pt,{path:"/auth/signup/business",element:s.jsx(vy,{children:s.jsx(mae,{})})}),s.jsx(Pt,{path:"/auth/signup/residential",element:s.jsx(vy,{children:s.jsx(gae,{})})}),s.jsx(Pt,{path:"/auth/forgot-password",element:s.jsx(vy,{children:s.jsx(yae,{})})}),s.jsx(Pt,{path:"/auth/reset-password",element:s.jsx(vae,{})}),s.jsx(Pt,{path:"/auth/callback",element:s.jsx(wae,{})}),s.jsx(Pt,{path:"/auth/verify-email",element:s.jsx(fwe,{})}),s.jsx(Pt,{path:"/auth/verify-otp",element:s.jsx(gwe,{})}),s.jsx(Pt,{path:"/auth/verify-email-update-otp",element:s.jsx(ywe,{})}),s.jsx(Pt,{path:"/about",element:s.jsx(Fwe,{})}),s.jsx(Pt,{path:"/about/board",element:s.jsx(kwe,{})}),s.jsx(Pt,{path:"/about/committees",element:s.jsx(Ewe,{})}),s.jsx(Pt,{path:"/about/memorial",element:s.jsx(Dwe,{})}),s.jsx(Pt,{path:"/membership/benefits",element:s.jsx(Rwe,{})}),s.jsx(Pt,{path:"/membership/referral",element:s.jsx(Bwe,{})}),s.jsx(Pt,{path:"/businesses",element:s.jsx(Tae,{})}),s.jsx(Pt,{path:"/businesses/new",element:s.jsx(nl,{children:s.jsx(Rde,{})})}),s.jsx(Pt,{path:"/businesses/:id",element:s.jsx(Iae,{})}),s.jsx(Pt,{path:"/businesses/:id/edit",element:s.jsx(nl,{children:s.jsx(Kae,{})})}),s.jsx(Pt,{path:"/businesses/insider-deals",element:s.jsx(Ode,{})}),s.jsx(Pt,{path:"/businesses/insider-deals/:id",element:s.jsx(qde,{})}),s.jsx(Pt,{path:"/businesses/ribbon-cutting",element:s.jsx(Phe,{})}),s.jsx(Pt,{path:"/events",element:s.jsx(Ohe,{})}),s.jsx(Pt,{path:"/events/:id",element:s.jsx(I0e,{})}),s.jsx(Pt,{path:"/events/submit",element:s.jsx(z0e,{})}),s.jsx(Pt,{path:"/contact",element:s.jsx(mwe,{})}),s.jsx(Pt,{path:"/residential",element:s.jsx(jwe,{})}),s.jsxs(Pt,{path:"/dashboard",element:s.jsx(nl,{children:s.jsx(Sc,{})}),children:[s.jsx(Pt,{index:!0,element:s.jsx(u1e,{})}),s.jsxs(Pt,{path:"admin",element:s.jsx(EAe,{children:s.jsx($we,{})}),children:[s.jsx(Pt,{path:"dashboard",element:s.jsx(Gwe,{})}),s.jsx(Pt,{path:"members",element:s.jsx(Ywe,{})}),s.jsx(Pt,{path:"businesses",element:s.jsx(DFe,{})}),s.jsx(Pt,{path:"businesses/:id",element:s.jsx(pSe,{})}),s.jsx(Pt,{path:"residents",element:s.jsx(wSe,{})}),s.jsx(Pt,{path:"residents/:id",element:s.jsx(jSe,{})}),s.jsx(Pt,{path:"events",element:s.jsx(GFe,{})}),s.jsx(Pt,{path:"categories",element:s.jsx(JFe,{})}),s.jsx(Pt,{path:"ribbon-cutting",element:s.jsx(J5e,{})}),s.jsx(Pt,{path:"scholarships",element:s.jsx(sAe,{})}),s.jsx(Pt,{path:"blog",element:s.jsx(fSe,{})}),s.jsx(Pt,{path:"newsletter",element:s.jsx(jAe,{})}),s.jsx(Pt,{path:"contacts",element:s.jsx(ZFe,{})}),s.jsx(Pt,{path:"hero-section",element:s.jsx(XFe,{})}),s.jsx(Pt,{path:"terms",element:s.jsx(K5e,{})}),s.jsx(Pt,{path:"about-us",element:s.jsx(V5e,{})}),s.jsx(Pt,{path:"membership-benefits",element:s.jsx(_Ae,{})}),s.jsx(Pt,{path:"board",element:s.jsx(oAe,{})}),s.jsx(Pt,{path:"committees",element:s.jsx(fAe,{})}),s.jsx(Pt,{path:"jobs",element:s.jsx(iSe,{})}),s.jsx(Pt,{path:"price-management",element:s.jsx(SAe,{})}),s.jsx(Pt,{path:"tools",element:s.jsx(oSe,{})}),s.jsx(Pt,{path:"settings",element:s.jsx(uSe,{})}),s.jsx(Pt,{path:"deals",element:s.jsx(bAe,{})}),s.jsx(Pt,{path:"referrals",element:s.jsx(vAe,{})})]})]}),s.jsx(Pt,{path:"/dashboard/inbox",element:s.jsx(nl,{children:s.jsx(Sc,{})})}),s.jsx(Pt,{path:"/dashboard/businesses",element:s.jsx(nl,{children:s.jsx(Sc,{})})}),s.jsx(Pt,{path:"/dashboard/jobs",element:s.jsx(nl,{children:s.jsx(Sc,{})})}),s.jsx(Pt,{path:"/dashboard/advertising",element:s.jsx(nl,{children:s.jsx(Sc,{})})}),s.jsx(Pt,{path:"/dashboard/membership",element:s.jsx(nl,{children:s.jsx(Sc,{})})}),s.jsx(Pt,{path:"/dashboard/profile",element:s.jsx(nl,{children:s.jsx(Sc,{})})}),s.jsx(Pt,{path:"/dashboard/blog",element:s.jsx(nl,{children:s.jsx(Sc,{})})}),s.jsx(Pt,{path:"/dashboard/events",element:s.jsx(nl,{children:s.jsx(Sc,{})})}),s.jsx(Pt,{path:"/dashboard/deals",element:s.jsx(nl,{children:s.jsx(Sc,{})})}),s.jsx(Pt,{path:"/dashboard/deals/create",element:s.jsx(nl,{children:s.jsx(Sc,{})})}),s.jsx(Pt,{path:"/news/blog",element:s.jsx(W1e,{})}),s.jsx(Pt,{path:"/news/blog/:id",element:s.jsx(d3,{})}),s.jsx(Pt,{path:"/news/tutorials",element:s.jsx(swe,{})}),s.jsx(Pt,{path:"/news/tutorials/:id",element:s.jsx(d3,{})}),s.jsx(Pt,{path:"/news/whats-new",element:s.jsx(q1e,{})}),s.jsx(Pt,{path:"/news/latest",element:s.jsx(G1e,{})}),s.jsx(Pt,{path:"/news/:id",element:s.jsx(V1e,{})}),s.jsx(Pt,{path:"/news/jobs",element:s.jsx(twe,{})}),s.jsx(Pt,{path:"/news/jobs/:id",element:s.jsx(rwe,{})}),s.jsx(Pt,{path:"/newsletter",element:s.jsx(iwe,{})}),s.jsx(Pt,{path:"/newsletter/unsubscribe",element:s.jsx(NAe,{})}),s.jsx(Pt,{path:"/scholarships",element:s.jsx(hwe,{})}),s.jsx(Pt,{path:"*",element:s.jsx(d1e,{})})]})}),s.jsx(z1e,{})]})]})]})})})});console.log("ð Starting Valley Stream Chamber application...");const BAe=HX();BAe?console.log("ð Google Analytics initialized"):console.warn("â ï¸ Google Analytics not initialized");const LU=document.getElementById("root");LU?console.log("â
Root element found, mounting React app..."):console.error("â Root element not found!");try{tF.createRoot(LU).render(s.jsx(RAe,{}
1346)),console.log("â
React app mounted successfully")}catch(t){console.error("â Error mounting React app:",t)}export{Ys as _,Q as s};
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.