PageSourceSearch

https://perdurable.ai/assets/SupportPage-D9NUWsDD.js

js perdurable.ai collected 2026-10-05 14:38:51 UTC 48,370 bytes, 9 lines download raw bytes

vendor: 4,130 bytes, lines 1-6
1import{X as Wt,r,fK as zt,fL as xt,an as Xt,fM as Yt,fN as Gt,fO as Zt,fP as ee,fQ as Qt,fR as Jt,fS as en,fT as tn,fU as nn,fV as rn,fW as an,j as a,a0 as re,aR as sn,i as on,m as M,bE as ln,B as A,bm as Ie,q as F,n as q,o as V,Y as we,s as Ze,eF as cn,u as un,b as dn,a as fn,ak as Qe,p as oe,O as mn,bq as pn,Q as hn,M as vn,d as he,bD as gn,aP as xn}from"./index-DqY_NHYi.js";import{P as Je}from"./PageMeta-ClqDwLLu.js";import{H as bn,C as $n,A as yn,V as En}from"./ChatSupportPanel-Ckb9rOg-.js";import{T as Nn,a as Cn,b as et,c as le,d as wn,e as ce}from"./table-PZo2TPRg.js";import{R as tt}from"./refresh-cw-BxU-CnU5.js";import{C as jn}from"./circle-dot-BkkvO9Yj.js";import{C as nt}from"./circle-check-DuqOlx-f.js";import"./mediapipe-vendor-DrNr8NRr.js";import"./alert-REPg3363.js";import"./download-DOIXvj3r.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Sn=Wt("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"}]]);function O(){return O=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var s in t)({}).hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},O.apply(null,arguments)}var rt=1,Pn=.9,Rn=.8,kn=.17,je=.1,Se=.999,Dn=.9999,Tn=.99,On=/[\\\/_+.#"@\[\(\{&]/,An=/[\\\/_+.#"@\[\(\{&]/g,In=/[\s-]/,bt=/[\s-]/g;function _e(e,n,t,s,o,l,i){if(l===n.length)return o===e.length?rt:Tn;var c=`${o},${l}`;if(i[c]!==void 0)return i[c];for(var m=s.charAt(l),f=t.indexOf(m,o),u=0,p,v,x,$;f>=0;)p=_e(e,n,t,s,f+1,l+1,i),p>u&&(f===o?p*=rt:On.test(e.charAt(f-1))?(p*=Rn,x=e.slice(o,f-1).match(An),x&&o>0&&(p*=Math.pow(Se,x.length))):In.test(e.charAt(f-1))?(p*=Pn,$=e.slice(o,f-1).match(bt),$&&o>0&&(p*=Math.pow(Se,$.length))):(p*=kn,o>0&&(p*=Math.pow(Se,f-o))),e.charAt(f)!==n.charAt(l)&&(p*=Dn)),(p<je&&t.charAt(f-1)===s.charAt(l+1)||s.charAt(l+1)===s.charAt(l)&&t.charAt(f-1)!==s.charAt(l))&&(v=_e(e,n,t,s,f+1,l+2,i),v*je>p&&(p=v*je)),p>u&&(u=p),f=t.indexOf(m,f+1);return i[c]=u,u}function at(e){return e.toLowerCase().replace(bt," ")}function _n(e,n,t){return e=t&&t.length>0?`${e+" "+t.join(" ")}`:e,_e(e,n,at(e),at(n),0,0,{})}function ne(e,n,{checkForDefaultPrevented:t=!0}={}){return function(o){if(e==null||e(o),t===!1||!o.defaultPrevented)return n==null?void 0:n(o)}}function Mn(e,n){typeof e=="function"?e(n):e!=null&&(e.current=n)}function $t(...e){return n=>e.forEach(t=>Mn(t,n))}function fe(...e){return r.useCallback($t(...e),e)}function Ln(e,n=[]){let t=[];function s(l,i){const c=r.createContext(i),m=t.length;t=[...t,i];function f(p){const{scope:v,children:x,...$}=p,h=(v==null?void 0:v[e][m])||c,b=r.useMemo(()=>$,Object.values($));return r.createElement(h.Provider,{value:b},x)}function u(p,v){const x=(v==null?void 0:v[e][m])||c,$=r.useContext(x);if($)return $;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${l}\``)}return f.displayName=l+"Provider",[f,u]}const o=()=>{const l=t.map(i=>r.createContext(i));return function(c){const m=(c==null?void 0:c[e])||l;return r.useMemo(()=>({[`__scope${e}`]:{...c,[e]:m}}),[c,m])}};return o.scopeName=e,[s,Fn(o,...n)]}function Fn(...e){const n=e[0];if(e.length===1)return n;const t=()=>{const s=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(l){const i=s.reduce((c,{useScope:m,scopeName:f})=>{const p=m(l)[`__scope${f}`];return{...c,...p}},{});return r.useMemo(()=>({[`__scope${n.scopeName}`]:i}),[i])}};return t.scopeName=n.scopeName,t}const Me=globalThis!=null&&globalThis.document?r.useLayoutEffect:()=>{},Un=zt.useId||(()=>{});let Bn=0;function Pe(e){const[n,t]=r.useState(Un());return Me(()=>{e||t(s=>s??String(Bn++))},[e]),e||(n?`radix-${n}`:"")}function z(e){const n=r.useRef(e);return r.useEffect(()=>{n.current=e}),r.useMemo(()=>(...t)=>{var s;return(s=n.current)===null||s===void 0?void 0:s.call(n,...t)},[])}function Kn({prop:e,defaultProp:n,onChange:t=()=>{}}){const[s,o]=Hn({defaultProp:n,onChange:t}
6),l=e!==void 0,i=l?e:s,c=z(t),m=r.useCallback(f=>{if(l){const p=typeof f=="function"?f(e):f;p!==e&&c(p)}else o(f)},[l,e,o,c]);return[i,m]}function Hn({defaultProp:e,onChange:n}){const t=r.useState(e),[s]=t,o=r.useRef(s),l=z(n);return r.useEffect(()=>{o.current!==s&&(l(s),o.current=s)},[s,o,l]),t}const He=r.forwardRef((e,n)=>{const{children:t,...s}=e,o=r.Children.toArray(t),l=o.find(Vn);if(l){const i=l.props.children,c=o.map(m=>m===l?r.Children.count(i)>1?r.Children.only(null):r.isValidElement(i)?i.props.children:null:m);return r.createElement(Le,O({},s,{ref:n}),r.isValidElement(i)?r.cloneElement(i,void 0,c):null)}return r.createElement(Le,O({},s,{ref:n}),t)});He.displayName="Slot";const Le=r.forwardRef((e,n)=>{const{children:t,...s}=e;return r.isValidElement(t)?r.cloneElement(t,{...Wn(s,t.props),ref:n?$t(n,t.ref):t.ref}):r.Children.count(t)>1?r.Children.only(null):null});Le.displayName="SlotClone";const qn=({children:e})=>r.createElement(r.Fragment,null,e);function Vn(e){return r.isValidElement(e)&&e.type===qn}function Wn(e,n){const t={...n};for(const s in n){const o=e[s],l=n[s];/^on[A-Z]/.test(s)?o&&l?t[s]=(...c)=>{l(...c),o(...c)}:o&&(t[s]=o):s==="style"?t[s]={...o,...l}:s==="className"&&(t[s]=[o,l].filter(Boolean).join(" "))}return{...e,...t}}const zn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],L=zn.reduce((e,n)=>{const t=r.forwardRef((s,o)=>{const{asChild:l,...i}=s,c=l?He:n;return r.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),r.createElement(c,O({},i,{ref:o}))});return t.displayName=`Primitive.${n}`,{...e,[n]:t}},{});function Xn(e,n){e&&xt.flushSync(()=>e.dispatchEvent(n))}function Yn(e,n=globalThis==null?void 0:globalThis.document){const t=z(e);r.useEffect(()=>{const s=o=>{o.key==="Escape"&&t(o)};return n.addEventListener("keydown",s),()=>n.removeEventListener("keydown",s)},[t,n])}const Fe="dismissableLayer.update",Gn="dismissableLayer.pointerDownOutside",Zn="dismissableLayer.focusOutside";let st;const Qn=r.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Jn=r.forwardRef((e,n)=>{var t;const{disableOutsidePointerEvents:s=!1,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:i,onInteractOutside:c,onDismiss:m,...f}=e,u=r.useContext(Qn),[p,v]=r.useState(null),x=(t=p==null?void 0:p.ownerDocument)!==null&&t!==void 0?t:globalThis==null?void 0:globalThis.document,[,$]=r.useState({}),h=fe(n,j=>v(j)),b=Array.from(u.layers),[N]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),D=b.indexOf(N),w=p?b.indexOf(p):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,C=w>=D,R=er(j=>{const U=j.target,Z=[...u.branches].some(K=>K.contains(U));!C||Z||(l==null||l(j),c==null||c(j),j.defaultPrevented||m==null||m())},x),k=tr(j=>{const U=j.target;[...u.branches].some(K=>K.contains(U))||(i==null||i(j),c==null||c(j),j.defaultPrevented||m==null||m())},x);return Yn(j=>{w===u.layers.size-1&&(o==null||o(j),!j.defaultPrevented&&m&&(j.preventDefault(),m()))},x),r.useEffect(()=>{if(p)return s&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(st=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(p)),u.layers.add(p),ot(),()=>{s&&u.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=st)}},[p,x,s,u]),r.useEffect(()=>()=>{p&&(u.layers.delete(p),u.layersWithOutsidePointerEventsDisabled.delete(p),ot())},[p,u]),r.useEffect(()=>{const j=()=>$({});return document.addEventListener(Fe,j),()=>document.removeEventListener(Fe,j)},[]),r.createElement(L.div,O({},f,{ref:h,style:{pointerEvents:S?C?"auto":"none":void 0,...e.style},onFocusCapture:ne(e.onFocusCapture,k.onFocusCapture),onBlurCapture:ne(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:ne(e.onPointerDownCapture,R.onPointerDownCapture)}))});function er(e,n=globalThis==null?void 0:globalThis.document){const t=z(e),s=r.useRef(!1),o=r.useRef(()=>{});return r.useEffect(()=>{const l=c=>{if(c.target&&!s.current){let f=function(){yt(Gn,t,m,{discrete:!0})};const m={originalEvent:c};c.pointerType==="touch"?(n.removeEventListener("click",o.current),o.current=f,n.addEventListener("click",o.current,{once:!0})):f()}else n.removeEventListener("click",o.current);s.current=!1},i=window.setTimeout(()=>{n.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(i),n.removeEventListener("pointerdown",l),n.removeEventListener("click",o.current)}},[n,t]),{onPointerDownCapture:()=>s.current=!0}}function tr(e,n=globalThis==null?void 0:globalThis.document){const t=z(e),s=r.useRef(!1);return r.useEffect(()=>{const o=l=>{l.target&&!s.current&&yt(Zn,t,{originalEvent:l},{discrete:!1})};return n.addEventListener("focusin",o),()=>n.removeEventListener("focusin",o)},[n,t]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function ot(){const e=new CustomEvent(Fe);document.dispatchEvent(e)}function yt(e,n,t,{discrete:s}){const o=t.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:t});n&&o.addEventListener(e,n,{once:!0}),s?Xn(o,l):o.dispatchEvent(l)}const Re="focusScope.autoFocusOnMount",ke="focusScope.autoFocusOnUnmount",lt={bubbles:!1,cancelable:!0}
vendor: 8,298 bytes, lines 6-9
6,nr=r.forwardRef((e,n)=>{const{loop:t=!1,trapped:s=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...i}=e,[c,m]=r.useState(null),f=z(o),u=z(l),p=r.useRef(null),v=fe(n,h=>m(h)),x=r.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;r.useEffect(()=>{if(s){let h=function(w){if(x.paused||!c)return;const S=w.target;c.contains(S)?p.current=S:B(p.current,{select:!0})},b=function(w){if(x.paused||!c)return;const S=w.relatedTarget;S!==null&&(c.contains(S)||B(p.current,{select:!0}))},N=function(w){if(document.activeElement===document.body)for(const C of w)C.removedNodes.length>0&&B(c)};document.addEventListener("focusin",h),document.addEventListener("focusout",b);const D=new MutationObserver(N);return c&&D.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",h),document.removeEventListener("focusout",b),D.disconnect()}}},[s,c,x.paused]),r.useEffect(()=>{if(c){it.add(x);const h=document.activeElement;if(!c.contains(h)){const N=new CustomEvent(Re,lt);c.addEventListener(Re,f),c.dispatchEvent(N),N.defaultPrevented||(rr(cr(Et(c)),{select:!0}),document.activeElement===h&&B(c))}return()=>{c.removeEventListener(Re,f),setTimeout(()=>{const N=new CustomEvent(ke,lt);c.addEventListener(ke,u),c.dispatchEvent(N),N.defaultPrevented||B(h??document.body,{select:!0}),c.removeEventListener(ke,u),it.remove(x)},0)}}},[c,f,u,x]);const $=r.useCallback(h=>{if(!t&&!s||x.paused)return;const b=h.key==="Tab"&&!h.altKey&&!h.ctrlKey&&!h.metaKey,N=document.activeElement;if(b&&N){const D=h.currentTarget,[w,S]=ar(D);w&&S?!h.shiftKey&&N===S?(h.preventDefault(),t&&B(w,{select:!0})):h.shiftKey&&N===w&&(h.preventDefault(),t&&B(S,{select:!0})):N===D&&h.preventDefault()}},[t,s,x.paused]);return r.createElement(L.div,O({tabIndex:-1},i,{ref:v,onKeyDown:$}))});function rr(e,{select:n=!1}={}){const t=document.activeElement;for(const s of e)if(B(s,{select:n}),document.activeElement!==t)return}function ar(e){const n=Et(e),t=ct(n,e),s=ct(n.reverse(),e);return[t,s]}function Et(e){const n=[],t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const o=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||o?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)n.push(t.currentNode);return n}function ct(e,n){for(const t of e)if(!sr(t,{upTo:n}))return t}function sr(e,{upTo:n}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(n!==void 0&&e===n)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function or(e){return e instanceof HTMLInputElement&&"select"in e}function B(e,{select:n=!1}={}){if(e&&e.focus){const t=document.activeElement;e.focus({preventScroll:!0}),e!==t&&or(e)&&n&&e.select()}}const it=lr();function lr(){let e=[];return{add(n){const t=e[0];n!==t&&(t==null||t.pause()),e=ut(e,n),e.unshift(n)},remove(n){var t;e=ut(e,n),(t=e[0])===null||t===void 0||t.resume()}}}function ut(e,n){const t=[...e],s=t.indexOf(n);return s!==-1&&t.splice(s,1),t}function cr(e){return e.filter(n=>n.tagName!=="A")}const ir=r.forwardRef((e,n)=>{var t;const{container:s=globalThis==null||(t=globalThis.document)===null||t===void 0?void 0:t.body,...o}=e;return s?Xt.createPortal(r.createElement(L.div,O({},o,{ref:n})),s):null});function ur(e,n){return r.useReducer((t,s)=>{const o=n[t][s];return o??t},e)}const be=e=>{const{present:n,children:t}=e,s=dr(n),o=typeof t=="function"?t({present:s.isPresent}):r.Children.only(t),l=fe(s.ref,o.ref);return typeof t=="function"||s.isPresent?r.cloneElement(o,{ref:l}):null};be.displayName="Presence";function dr(e){const[n,t]=r.useState(),s=r.useRef({}),o=r.useRef(e),l=r.useRef("none"),i=e?"mounted":"unmounted",[c,m]=ur(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return r.useEffect(()=>{const f=ve(s.current);l.current=c==="mounted"?f:"none"},[c]),Me(()=>{const f=s.current,u=o.current;if(u!==e){const v=l.current,x=ve(f);e?m("MOUNT"):x==="none"||(f==null?void 0:f.display)==="none"?m("UNMOUNT"):m(u&&v!==x?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,m]),Me(()=>{if(n){const f=p=>{const x=ve(s.current).includes(p.animationName);p.target===n&&x&&xt.flushSync(()=>m("ANIMATION_END"))},u=p=>{p.target===n&&(l.current=ve(s.current))};return n.addEventListener("animationstart",u),n.addEventListener("animationcancel",f),n.addEventListener("animationend",f),()=>{n.removeEventListener("animationstart",u),n.removeEventListener("animationcancel",f),n.removeEventListener("animationend",f)}}else m("ANIMATION_END")},[n,m]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:r.useCallback(f=>{f&&(s.current=getComputedStyle(f)),t(f)},[])}}function ve(e){return(e==null?void 0:e.animationName)||"none"}let De=0;function fr(){r.useEffect(()=>{var e,n;const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=t[0])!==null&&e!==void 0?e:dt()),document.body.insertAdjacentElement("beforeend",(n=t[1])!==null&&n!==void 0?n:dt()),De++,()=>{De===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(s=>s.remove()),De--}},[])}function dt(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var Nt=Yt(),Te=function(){},$e=r.forwardRef(function(e,n){var t=r.useRef(null),s=r.useState({onScrollCapture:Te,onWheelCapture:Te,onTouchMoveCapture:Te}),o=s[0],l=s[1],i=e.forwardProps,c=e.children,m=e.className,f=e.removeScrollBar,u=e.enabled,p=e.shards,v=e.sideCar,x=e.noIsolation,$=e.inert,h=e.allowPinchZoom,b=e.as,N=b===void 0?"div":b,D=Gt(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),w=v,S=Zt([t,n]),C=ee(ee({},D),o);return r.createElement(r.Fragment,null,u&&r.createElement(w,{sideCar:Nt,removeScrollBar:f,shards:p,noIsolation:x,inert:$,setCallbacks:l,allowPinchZoom:!!h,lockRef:t}),i?r.cloneElement(r.Children.only(c),ee(ee({},C),{ref:S})):r.createElement(N,ee({},C,{className:m,ref:S}),c))});$e.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};$e.classNames={fullWidth:Qt,zeroRight:Jt};var Ue=!1;if(typeof window<"u")try{var ge=Object.defineProperty({},"passive",{get:function(){return Ue=!0,!0}});window.addEventListener("test",ge,ge),window.removeEventListener("test",ge,ge)}catch{Ue=!1}var Q=Ue?{passive:!1}:!1,mr=function(e){return e.tagName==="TEXTAREA"},Ct=function(e,n){var t=window.getComputedStyle(e);return t[n]!=="hidden"&&!(t.overflowY===t.overflowX&&!mr(e)&&t[n]==="visible")},pr=function(e){return Ct(e,"overflowY")},hr=function(e){return Ct(e,"overflowX")},ft=function(e,n){var t=n;do{typeof ShadowRoot<"u"&&t instanceof ShadowRoot&&(t=t.host);var s=wt(e,t);if(s){var o=jt(e,t),l=o[1],i=o[2];if(l>i)return!0}t=t.parentNode}while(t&&t!==document.body);return!1},vr=function(e){var n=e.scrollTop,t=e.scrollHeight,s=e.clientHeight;return[n,t,s]},gr=function(e){var n=e.scrollLeft,t=e.scrollWidth,s=e.clientWidth;return[n,t,s]},wt=function(e,n){return e==="v"?pr(n):hr(n)},jt=function(e,n){return e==="v"?vr(n):gr(n)},xr=function(e,n){return e==="h"&&n==="rtl"?-1:1},br=function(e,n,t,s,o){var l=xr(e,window.getComputedStyle(n).direction),i=l*s,c=t.target,m=n.contains(c),f=!1,u=i>0,p=0,v=0;do{var x=jt(e,c),$=x[0],h=x[1],b=x[2],N=h-b-l*$;($||N)&&wt(e,c)&&(p+=N,v+=$),c=c.parentNode}while(!m&&c!==document.body||m&&(n.contains(c)||n===c));return(u&&(p===0||!o)||!u&&(v===0||!o))&&(f=!0),f},xe=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},mt=function(e){return[e.deltaX,e.deltaY]},pt=function(e){return e&&"current"in e?e.current:e},$r=function(e,n){return e[0]===n[0]&&e[1]===n[1]},yr=function(e){return`
7  .block-interactivity-`.concat(e,` {pointer-events: none;}
8  .allow-interactivity-`).concat(e,` {pointer-events: all;}
9`)},Er=0,J=[];function Nr(e){var n=r.useRef([]),t=r.useRef([0,0]),s=r.useRef(),o=r.useState(Er++)[0],l=r.useState(function(){return en()})[0],i=r.useRef(e);r.useEffect(function(){i.current=e},[e]),r.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));
9var h=tn([e.lockRef.current],(e.shards||[]).map(pt),!0).filter(Boolean);return h.forEach(function(b){return b.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),h.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=r.useCallback(function(h,b){if("touches"in h&&h.touches.length===2)return!i.current.allowPinchZoom;var N=xe(h),D=t.current,w="deltaX"in h?h.deltaX:D[0]-N[0],S="deltaY"in h?h.deltaY:D[1]-N[1],C,R=h.target,k=Math.abs(w)>Math.abs(S)?"h":"v";if("touches"in h&&k==="h"&&R.type==="range")return!1;var j=ft(k,R);if(!j)return!0;if(j?C=k:(C=k==="v"?"h":"v",j=ft(k,R)),!j)return!1;if(!s.current&&"changedTouches"in h&&(w||S)&&(s.current=C),!C)return!0;var U=s.current||C;return br(U,b,h,U==="h"?w:S,!0)},[]),m=r.useCallback(function(h){var b=h;if(!(!J.length||J[J.length-1]!==l)){var N="deltaY"in b?mt(b):xe(b),D=n.current.filter(function(C){return C.name===b.type&&C.target===b.target&&$r(C.delta,N)})[0];if(D&&D.should){b.cancelable&&b.preventDefault();return}if(!D){var w=(i.current.shards||[]).map(pt).filter(Boolean).filter(function(C){return C.contains(b.target)}),S=w.length>0?c(b,w[0]):!i.current.noIsolation;S&&b.cancelable&&b.preventDefault()}}},[]),f=r.useCallback(function(h,b,N,D){var w={name:h,delta:b,target:N,should:D};n.current.push(w),setTimeout(function(){n.current=n.current.filter(function(S){return S!==w})},1)},[]),u=r.useCallback(function(h){t.current=xe(h),s.current=void 0},[]),p=r.useCallback(function(h){f(h.type,mt(h),h.target,c(h,e.lockRef.current))},[]),v=r.useCallback(function(h){f(h.type,xe(h),h.target,c(h,e.lockRef.current))},[]);r.useEffect(function(){return J.push(l),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:v}),document.addEventListener("wheel",m,Q),document.addEventListener("touchmove",m,Q),document.addEventListener("touchstart",u,Q),function(){J=J.filter(function(h){return h!==l}),document.removeEventListener("wheel",m,Q),document.removeEventListener("touchmove",m,Q),document.removeEventListener("touchstart",u,Q)}},[]);var x=e.removeScrollBar,$=e.inert;return r.createElement(r.Fragment,null,$?r.createElement(l,{styles:yr(o)}):null,x?r.createElement(nn,{gapMode:"margin"}):null)}const Cr=rn(Nt,Nr);var St=r.forwardRef(function(e,n){return r.createElement($e,ee({},e,{ref:n,sideCar:Cr}))});St.classNames=$e.classNames;const Pt="Dialog",[Rt,ma]=Ln(Pt),[wr,G]=Rt(Pt),jr=e=>{const{__scopeDialog:n,children:t,open:s,defaultOpen:o,onOpenChange:l,modal:i=!0}=e,c=r.useRef(null),m=r.useRef(null),[f=!1,u]=Kn({prop:s,defaultProp:o,onChange:l});return r.createElement(wr,{scope:n,triggerRef:c,contentRef:m,contentId:Pe(),titleId:Pe(),descriptionId:Pe(),open:f,onOpenChange:u,onOpenToggle:r.useCallback(()=>u(p=>!p),[u]),modal:i},t)},kt="DialogPortal",[Sr,Dt]=Rt(kt,{forceMount:void 0}),Pr=e=>{const{__scopeDialog:n,forceMount:t,children:s,container:o}=e,l=G(kt,n);return r.createElement(Sr,{scope:n,forceMount:t},r.Children.map(s,i=>r.createElement(be,{present:t||l.open},r.createElement(ir,{asChild:!0,container:o},i))))},Be="DialogOverlay",Rr=r.forwardRef((e,n)=>{const t=Dt(Be,e.__scopeDialog),{forceMount:s=t.forceMount,...o}=e,l=G(Be,e.__scopeDialog);return l.modal?r.createElement(be,{present:s||l.open},r.createElement(kr,O({},o,{ref:n}))):null}),kr=r.forwardRef((e,n)=>{const{__scopeDialog:t,...s}=e,o=G(Be,t);return r.createElement(St,{as:He,allowPinchZoom:!0,shards:[o.contentRef]},r.createElement(L.div,O({"data-state":Ot(o.open)},s,{ref:n,style:{pointerEvents:"auto",...s.style}})))}),ue="DialogContent",Dr=r.forwardRef((e,n)=>{const t=Dt(ue,e.__scopeDialog),{forceMount:s=t.forceMount,...o}=e,l=G(ue,e.__scopeDialog);return r.createElement(be,{present:s||l.open},l.modal?r.createElement(Tr,O({},o,{ref:n})):r.createElement(Or,O({},o,{ref:n})))}),Tr=r.forwardRef((e,n)=>{const t=G(ue,e.__scopeDialog),s=r.useRef(null),o=fe(n,t.contentRef,s);return r.useEffect(()=>{const l=s.current;if(l)return an(l)},[]),r.createElement(Tt,O({},e,{ref:o,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ne(e.onCloseAutoFocus,l=>{var i;l.preventDefault(),(i=t.triggerRef.current)===null||i===void 0||i.focus()}),onPointerDownOutside:ne(e.onPointerDownOutside,l=>{const i=l.detail.originalEvent,c=i.button===0&&i.ctrlKey===!0;(i.button===2||c)&&l.preventDefault()}),onFocusOutside:ne(e.onFocusOutside,l=>l.preventDefault())}))}
vendor: 11,534 bytes, line 9
9),Or=r.forwardRef((e,n)=>{const t=G(ue,e.__scopeDialog),s=r.useRef(!1),o=r.useRef(!1);return r.createElement(Tt,O({},e,{ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var i;if((i=e.onCloseAutoFocus)===null||i===void 0||i.call(e,l),!l.defaultPrevented){var c;s.current||(c=t.triggerRef.current)===null||c===void 0||c.focus(),l.preventDefault()}s.current=!1,o.current=!1},onInteractOutside:l=>{var i,c;(i=e.onInteractOutside)===null||i===void 0||i.call(e,l),l.defaultPrevented||(s.current=!0,l.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const m=l.target;((c=t.triggerRef.current)===null||c===void 0?void 0:c.contains(m))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&o.current&&l.preventDefault()}}))}),Tt=r.forwardRef((e,n)=>{const{__scopeDialog:t,trapFocus:s,onOpenAutoFocus:o,onCloseAutoFocus:l,...i}=e,c=G(ue,t),m=r.useRef(null),f=fe(n,m);return fr(),r.createElement(r.Fragment,null,r.createElement(nr,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:o,onUnmountAutoFocus:l},r.createElement(Jn,O({role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Ot(c.open)},i,{ref:f,onDismiss:()=>c.onOpenChange(!1)}))),!1)});function Ot(e){return e?"open":"closed"}const Ar=jr,Ir=Pr,_r=Rr,Mr=Dr;var ie='[cmdk-group=""]',Oe='[cmdk-group-items=""]',Lr='[cmdk-group-heading=""]',qe='[cmdk-item=""]',ht=`${qe}:not([aria-disabled="true"])`,Ke="cmdk-item-select",W="data-value",Fr=(e,n,t)=>_n(e,n,t),At=r.createContext(void 0),me=()=>r.useContext(At),It=r.createContext(void 0),Ve=()=>r.useContext(It),_t=r.createContext(void 0),Mt=r.forwardRef((e,n)=>{let t=te(()=>{var d,y;return{search:"",value:(y=(d=e.value)!=null?d:e.defaultValue)!=null?y:"",filtered:{count:0,items:new Map,groups:new Set}}}),s=te(()=>new Set),o=te(()=>new Map),l=te(()=>new Map),i=te(()=>new Set),c=Lt(e),{label:m,children:f,value:u,onValueChange:p,filter:v,shouldFilter:x,loop:$,disablePointerSelection:h=!1,vimBindings:b=!0,...N}=e,D=r.useId(),w=r.useId(),S=r.useId(),C=r.useRef(null),R=Gr();X(()=>{if(u!==void 0){let d=u.trim();t.current.value=d,k.emit()}},[u]),X(()=>{R(6,We)},[]);let k=r.useMemo(()=>({subscribe:d=>(i.current.add(d),()=>i.current.delete(d)),snapshot:()=>t.current,setState:(d,y,E)=>{var g,P,T;if(!Object.is(t.current[d],y)){if(t.current[d]=y,d==="search")Ee(),Z(),R(1,K);else if(d==="value"&&(E||R(5,We),((g=c.current)==null?void 0:g.value)!==void 0)){let _=y??"";(T=(P=c.current).onValueChange)==null||T.call(P,_);return}k.emit()}},emit:()=>{i.current.forEach(d=>d())}}),[]),j=r.useMemo(()=>({value:(d,y,E)=>{var g;y!==((g=l.current.get(d))==null?void 0:g.value)&&(l.current.set(d,{value:y,keywords:E}),t.current.filtered.items.set(d,U(y,E)),R(2,()=>{Z(),k.emit()}))},item:(d,y)=>(s.current.add(d),y&&(o.current.has(y)?o.current.get(y).add(d):o.current.set(y,new Set([d]))),R(3,()=>{Ee(),Z(),t.current.value||K(),k.emit()}),()=>{l.current.delete(d),s.current.delete(d),t.current.filtered.items.delete(d);let E=ae();R(4,()=>{Ee(),(E==null?void 0:E.getAttribute("id"))===d&&K(),k.emit()})}),group:d=>(o.current.has(d)||o.current.set(d,new Set),()=>{l.current.delete(d),o.current.delete(d)}),filter:()=>c.current.shouldFilter,label:m||e["aria-label"],disablePointerSelection:h,listId:D,inputId:S,labelId:w,listInnerRef:C}),[]);function U(d,y){var E,g;let P=(g=(E=c.current)==null?void 0:E.filter)!=null?g:Fr;return d?P(d,t.current.search,y):0}function Z(){if(!t.current.search||c.current.shouldFilter===!1)return;let d=t.current.filtered.items,y=[];t.current.filtered.groups.forEach(g=>{let P=o.current.get(g),T=0;P.forEach(_=>{let H=d.get(_);T=Math.max(H,T)}),y.push([g,T])});let E=C.current;se().sort((g,P)=>{var T,_;let H=g.getAttribute("id"),pe=P.getAttribute("id");return((T=d.get(pe))!=null?T:0)-((_=d.get(H))!=null?_:0)}).forEach(g=>{let P=g.closest(Oe);P?P.appendChild(g.parentElement===P?g:g.closest(`${Oe} > *`)):E.appendChild(g.parentElement===E?g:g.closest(`${Oe} > *`))}),y.sort((g,P)=>P[1]-g[1]).forEach(g=>{let P=C.current.querySelector(`${ie}[${W}="${encodeURIComponent(g[0])}"]`);P==null||P.parentElement.appendChild(P)})}function K(){let d=se().find(E=>E.getAttribute("aria-disabled")!=="true"),y=d==null?void 0:d.getAttribute(W);k.setState("value",y||void 0)}function Ee(){var d,y,E,g;if(!t.current.search||c.current.shouldFilter===!1){t.current.filtered.count=s.current.size;return}t.current.filtered.groups=new Set;let P=0;for(let T of s.current){let _=(y=(d=l.current.get(T))==null?void 0:d.value)!=null?y:"",H=(g=(E=l.current.get(T))==null?void 0:E.keywords)!=null?g:[],pe=U(_,H);t.current.filtered.items.set(T,pe),pe>0&&P++}for(let[T,_]of o.current)for(let H of _)if(t.current.filtered.items.get(H)>0){t.current.filtered.groups.add(T);break}t.current.filtered.count=P}function We(){var d,y,E;let g=ae();g&&(((d=g.parentElement)==null?void 0:d.firstChild)===g&&((E=(y=g.closest(ie))==null?void 0:y.querySelector(Lr))==null||E.scrollIntoView({block:"nearest"})),g.scrollIntoView({block:"nearest"}))}function ae(){var d;return(d=C.current)==null?void 0:d.querySelector(`${qe}[aria-selected="true"]`)}function se(){var d;return Array.from((d=C.current)==null?void 0:d.querySelectorAll(ht))}function Ne(d){let y=se()[d];y&&k.setState("value",y.getAttribute(W))}function Ce(d){var y;let E=ae(),g=se(),P=g.findIndex(_=>_===E),T=g[P+d];(y=c.current)!=null&&y.loop&&(T=P+d<0?g[g.length-1]:P+d===g.length?g[0]:g[P+d]),T&&k.setState("value",T.getAttribute(W))}function ze(d){let y=ae(),E=y==null?void 0:y.closest(ie),g;for(;E&&!g;)E=d>0?Xr(E,ie):Yr(E,ie),g=E==null?void 0:E.querySelector(ht);g?k.setState("value",g.getAttribute(W)):Ce(d)}let Xe=()=>Ne(se().length-1),Ye=d=>{d.preventDefault(),d.metaKey?Xe():d.altKey?ze(1):Ce(1)},Ge=d=>{d.preventDefault(),d.metaKey?Ne(0):d.altKey?ze(-1):Ce(-1)};return r.createElement(L.div,{ref:n,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:d=>{var y;if((y=N.onKeyDown)==null||y.call(N,d),!d.defaultPrevented)switch(d.key){case"n":case"j":{b&&d.ctrlKey&&Ye(d);break}case"ArrowDown":{Ye(d);break}case"p":case"k":{b&&d.ctrlKey&&Ge(d);break}case"ArrowUp":{Ge(d);break}case"Home":{d.preventDefault(),Ne(0);break}case"End":{d.preventDefault(),Xe();break}case"Enter":if(!d.nativeEvent.isComposing&&d.keyCode!==229){d.preventDefault();let E=ae();if(E){let g=new Event(Ke);E.dispatchEvent(g)}}}}},r.createElement("label",{"cmdk-label":"",htmlFor:j.inputId,id:j.labelId,style:Qr},m),ye(e,d=>r.createElement(It.Provider,{value:k},r.createElement(At.Provider,{value:j},d))))}),Ur=r.forwardRef((e,n)=>{var t,s;let o=r.useId(),l=r.useRef(null),i=r.useContext(_t),c=me(),m=Lt(e),f=(s=(t=m.current)==null?void 0:t.forceMount)!=null?s:i==null?void 0:i.forceMount;X(()=>{if(!f)return c.item(o,i==null?void 0:i.id)},[f]);let u=Ft(o,l,[e.value,e.children,l],e.keywords),p=Ve(),v=Y(R=>R.value&&R.value===u.current),x=Y(R=>f||c.filter()===!1?!0:R.search?R.filtered.items.get(o)>0:!0);r.useEffect(()=>{let R=l.current;if(!(!R||e.disabled))return R.addEventListener(Ke,$),()=>R.removeEventListener(Ke,$)},[x,e.onSelect,e.disabled]);function $(){var R,k;h(),(k=(R=m.current).onSelect)==null||k.call(R,u.current)}function h(){p.setState("value",u.current,!0)}if(!x)return null;let{disabled:b,value:N,onSelect:D,forceMount:w,keywords:S,...C}=e;return r.createElement(L.div,{ref:de([l,n]),...C,id:o,"cmdk-item":"",role:"option","aria-disabled":!!b,"aria-selected":!!v,"data-disabled":!!b,"data-selected":!!v,onPointerMove:b||c.disablePointerSelection?void 0:h,onClick:b?void 0:$},e.children)}),Br=r.forwardRef((e,n)=>{let{heading:t,children:s,forceMount:o,...l}=e,i=r.useId(),c=r.useRef(null),m=r.useRef(null),f=r.useId(),u=me(),p=Y(x=>o||u.filter()===!1?!0:x.search?x.filtered.groups.has(i):!0);X(()=>u.group(i),[]),Ft(i,c,[e.value,e.heading,m]);let v=r.useMemo(()=>({id:i,forceMount:o}),[o]);return r.createElement(L.div,{ref:de([c,n]),...l,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},t&&r.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:f},t),ye(e,x=>r.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":t?f:void 0},r.createElement(_t.Provider,{value:v},x))))}),Kr=r.forwardRef((e,n)=>{let{alwaysRender:t,...s}=e,o=r.useRef(null),l=Y(i=>!i.search);return!t&&!l?null:r.createElement(L.div,{ref:de([o,n]),...s,"cmdk-separator":"",role:"separator"})}),Hr=r.forwardRef((e,n)=>{let{onValueChange:t,...s}=e,o=e.value!=null,l=Ve(),i=Y(u=>u.search),c=Y(u=>u.value),m=me(),f=r.useMemo(()=>{var u;let p=(u=m.listInnerRef.current)==null?void 0:u.querySelector(`${qe}[${W}="${encodeURIComponent(c)}"]`);return p==null?void 0:p.getAttribute("id")},[]);return r.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),r.createElement(L.input,{ref:n,...s,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,"aria-activedescendant":f,id:m.inputId,type:"text",value:o?e.value:i,onChange:u=>{o||l.setState("search",u.target.value),t==null||t(u.target.value)}})}),qr=r.forwardRef((e,n)=>{let{children:t,label:s="Suggestions",...o}=e,l=r.useRef(null),i=r.useRef(null),c=me();return r.useEffect(()=>{if(i.current&&l.current){let m=i.current,f=l.current,u,p=new ResizeObserver(()=>{u=requestAnimationFrame(()=>{let v=m.offsetHeight;f.style.setProperty("--cmdk-list-height",v.toFixed(1)+"px")})});return p.observe(m),()=>{cancelAnimationFrame(u),p.unobserve(m)}}},[]),r.createElement(L.div,{ref:de([l,n]),...o,"cmdk-list":"",role:"listbox","aria-label":s,id:c.listId},ye(e,m=>r.createElement("div",{ref:de([i,c.listInnerRef]),"cmdk-list-sizer":""},m)))}),Vr=r.forwardRef((e,n)=>{let{open:t,onOpenChange:s,overlayClassName:o,contentClassName:l,container:i,...c}=e;return r.createElement(Ar,{open:t,onOpenChange:s},r.createElement(Ir,{container:i},r.createElement(_r,{"cmdk-overlay":"",className:o}),r.createElement(Mr,{"aria-label":e.label,"cmdk-dialog":"",className:l},r.createElement(Mt,{ref:n,...c}))))}),Wr=r.forwardRef((e,n)=>Y(t=>t.filtered.count===0)?r.createElement(L.div,{ref:n,...e,"cmdk-empty":"",role:"presentation"}):null),zr=r.forwardRef((e,n)=>{let{progress:t,children:s,label:o="Loading...",...l}=e;return r.createElement(L.div,{ref:n,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":t,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},ye(e,i=>r.createElement("div",{"aria-hidden":!0},i)))}),I=Object.assign(Mt,{List:qr,Item:Ur,Input:Hr,Group:Br,Separator:Kr,Dialog:Vr,Empty:Wr,Loading:zr});function Xr(e,n){let t=e.nextElementSibling;for(;t;){if(t.matches(n))return t;t=t.nextElementSibling}}function Yr(e,n){let t=e.previousElementSibling;for(;t;){if(t.matches(n))return t;t=t.previousElementSibling}}function Lt(e){let n=r.useRef(e);return X(()=>{n.current=e}),n}var X=typeof window>"u"?r.useEffect:r.useLayoutEffect;function te(e){let n=r.useRef();return n.current===void 0&&(n.current=e()),n}function de(e){return n=>{e.forEach(t=>{typeof t=="function"?t(n):t!=null&&(t.current=n)})}}function Y(e){let n=Ve(),t=()=>e(n.snapshot());return r.useSyncExternalStore(n.subscribe,t,t)}function Ft(e,n,t,s=[]){let o=r.useRef(),l=me();return X(()=>{var i;let c=(()=>{var f;for(let u of t){if(typeof u=="string")return u.trim();if(typeof u=="object"&&"current"in u)return u.current?(f=u.current.textContent)==null?void 0:f.trim():o.current}})(),m=s.map(f=>f.trim());l.value(e,c,m),(i=n.current)==null||i.setAttribute(W,c),o.current=c}),o}var Gr=()=>{let[e,n]=r.useState(),t=te(()=>new Map);return X(()=>{t.current.forEach(s=>
9s()),t.current=new Map},[e]),(s,o)=>{t.current.set(s,o),n({})}};function Zr(e){let n=e.type;return typeof n=="function"?n(e.props):"render"in n?n.render(e.props):e}function ye({asChild:e,children:n},t){return e&&r.isValidElement(n)?r.cloneElement(Zr(n),{ref:n.ref},t(n.props.children)):t(n)}var Qr={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Ut=r.forwardRef(({className:e,...n},t)=>a.jsx(I,{ref:t,className:re("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...n}));Ut.displayName=I.displayName;const Bt=r.forwardRef(({className:e,...n},t)=>a.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[a.jsx(sn,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),a.jsx(I.Input,{ref:t,className:re("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...n})]}));Bt.displayName=I.Input.displayName;const Kt=r.forwardRef(({className:e,...n},t)=>a.jsx(I.List,{ref:t,className:re("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...n}));Kt.displayName=I.List.displayName;const Ht=r.forwardRef((e,n)=>a.jsx(I.Empty,{ref:n,className:"py-6 text-center text-sm",...e}));Ht.displayName=I.Empty.displayName;const qt=r.forwardRef(({className:e,...n},t)=>a.jsx(I.Group,{ref:t,className:re("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...n}));qt.displayName=I.Group.displayName;const Jr=r.forwardRef(({className:e,...n},t)=>a.jsx(I.Separator,{ref:t,className:re("-mx-1 h-px bg-border",e),...n}));Jr.displayName=I.Separator.displayName;const Vt=r.forwardRef(({className:e,...n},t)=>a.jsx(I.Item,{ref:t,className:re("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50",e),...n}));Vt.displayName=I.Item.displayName;const vt="https://api.perdurable.ai",gt={open:{label:"Open",color:"bg-blue-100 text-blue-800",icon:a.jsx(jn,{className:"h-3 w-3"})},in_progress:{label:"In Progress",color:"bg-yellow-100 text-yellow-800",icon:a.jsx(Ze,{className:"h-3 w-3"})},waiting_customer:{label:"Waiting",color:"bg-orange-100 text-orange-800",icon:a.jsx(Ze,{className:"h-3 w-3"})},resolved:{label:"Resolved",color:"bg-green-100 text-green-800",icon:a.jsx(nt,{className:"h-3 w-3"})},closed:{label:"Closed",color:"bg-gray-100 text-gray-800",icon:a.jsx(nt,{className:"h-3 w-3"})}},Ae={low:{label:"Low",color:"bg-slate-100 text-slate-700"},medium:{label:"Medium",color:"bg-blue-100 text-blue-700"},high:{label:"High",color:"bg-orange-100 text-orange-700"},urgent:{label:"Urgent",color:"bg-red-100 text-red-700"}};function ea(e){const n=new Date(e),s=new Date().getTime()-n.getTime(),o=Math.floor(s/6e4),l=Math.floor(o/60),i=Math.floor(l/24);return i>0?`${i}d ago`:l>0?`${l}h ago`:o>0?`${o}m ago`:"Just now"}const ta=()=>{const[e,n]=r.useState(null),[t,s]=r.useState(!0),[o,l]=r.useState(null),i=async()=>{s(!0),l(null);try{const u=await cn.getHelpdeskDashboard("ai-help-desk");n(u)}catch(u){console.error("Failed to fetch helpdesk dashboard:",u),l("Failed to load dashboard data. Please try again.")}finally{s(!1)}};if(r.useEffect(()=>{i()},[]),t)return a.jsxs("div",{className:"flex items-center justify-center py-12",children:[a.jsx(on,{className:"h-6 w-6 animate-spin text-muted-foreground"}),a.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading dashboard..."})]});if(o)return a.jsxs(M,{className:"p-6",children:[a.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[a.jsx(ln,{className:"h-5 w-5"}),a.jsx("p",{children:o})]}),a.jsxs(A,{variant:"outline",className:"mt-4",onClick:i,children:[a.jsx(tt,{className:"h-4 w-4 mr-2"}),"Retry"]})]});if(!e)return null;const{summary:c,priority_counts:m,recent_tickets:f}=e;return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Ticket snapshot for AI Help Desk channel"}),a.jsxs("div",{className:"flex gap-2",children:[a.jsxs(A,{variant:"outline",size:"sm",onClick:i,children:[a.jsx(tt,{className:"h-4 w-4 mr-2"}),"Refresh"]}),a.jsx(A,{variant:"outline",size:"sm",asChild:!0,children:a.jsxs("a",{href:`${vt}/admins/helpdesk-dashboard`,target:"_blank",rel:"noopener noreferrer",children:[a.jsx(Ie,{className:"h-4 w-4 mr-2"}),"Open Admin Dashboard"]})})]})]}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[a.jsx(M,{children:a.jsxs(F,{className:"p-4",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Pending"}),a.jsx("p",{className:"text-2xl font-bold text-blue-600",children:c.pending}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[c.open," open + ",c.in_progress," in progress"]})]})}),a.jsx(M,{children:a.jsxs(F,{className:"p-4",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Solved"}),a.jsx("p",{className:"text-2xl font-bold text-green-600",children:c.solved}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[c.resolved," resolved + ",c.closed," closed"]})]})}),a.jsx(M,{children:a.jsxs(F,{className:"p-4",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Escalated"}),a.jsx("p",{className:"text-2xl font-bold text-orange-600",children:c.waiting_customer}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"waiting on customer"})]})}),a.jsx(M,{children:a.jsxs(F,{className:"p-4",children:[a.jsx("p",{className:"text-sm text-muted-foreground",children:"Total"}),a.jsx("p",{className:"text-2xl font-bold",children:c.total}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"all tickets"})]})})]}),a.jsxs(M,{children:[a.jsx(q,{className:"pb-3",children:a.jsx(V,{className:"text-sm font-medium",children:"Priority Breakdown"})}),a.jsx(F,{children:a.jsx("div",{className:"flex gap-4 flex-wrap",children:Object.entries(m).map(([u,p])=>{const v=Ae[u];return a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(we,{className:(v==null?void 0:v.color)||"",variant:"secondary",children:(v==null?void 0:v.label)||u}),a.jsx("span",{className:"text-sm font-medium",children:p})]},u)})})})]}),a.jsxs(M,{children:[a.jsx(q,{className:"pb-3",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(V,{className:"text-sm font-medium",children:"Recent Tickets"}),a.jsx(A,{variant:"link",size:"sm",asChild:!0,className:"text-xs",children:a.jsxs("a",{href:`${vt}/admins/helpdesk-dashboard`,target:"_blank",rel:"noopener noreferrer",children:["View all in Admin",a.jsx(Ie,{className:"h-3 w-3 ml-1"})]})})]})}),a.jsx(F,{children:f.length===0?a.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No tickets found for this channel."}):a.jsxs(Nn,{children:[a.jsx(Cn,{children:a.jsxs(et,{children:[a.jsx(le,{children:"Subject"}),a.jsx(le,{children:"Status"}),a.jsx(le,{children:"Priority"}),a.jsx(le,{children:"Assigned To"}),a.jsx(le,{children:"Created"})]})}),a.jsx(wn,{children:f.map(u=>{const p=gt[u.status]||gt.open,v=Ae[u.priority]||Ae.medium;return a.jsxs(et,{children:[a.jsx(ce,{children:a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium truncate max-w-[200px]",children:u.subject}),a.jsx("p",{className:"text-xs text-muted-foreground",children:u.user_name})]})}),a.jsx(ce,{children:a.jsxs(we,{className:`${p.color} gap-1`,variant:"secondary",children:[p.icon,p.label]})}),a.jsx(ce,{children:a.jsx(we,{className:v.color,variant:"secondary",children:v.label})}),a.jsx(ce,{children:u.assigned_to?a.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[a.jsx(Sn,{className:"h-4 w-4 text-muted-foreground"}),a.jsx("span",{className:"truncate max-w-[100px]",children:u.assigned_to})]}):a.jsx("span",{className:"text-xs text-muted-foreground",children:"Unassigned"})}),a.jsx(ce,{children:a.jsx("span",{className:"text-xs text-muted-foreground",children:ea(u.created_at)})})]},u.id)})})]})})]})]})},na=[{titleKey:"supportPage.quickSearchTopics.downloadInstall",slug:"download-install-signin"},{titleKey:"supportPage.quickSearchTopics.startCamera",slug:"start-camera"},{titleKey:"supportPage.quickSearchTopics.useAi",slug:"use-ai"},{titleKey:"supportPage.quickSearchTopics.emailCompose",slug:"email-compose"},{titleKey:"supportPage.quickSearchTopics.cameraTroubleshooting",slug:"camera-troubleshooting"}],pa=()=>{const{t:e}=un("pages"),[n,t]=dn(),s=n.get("channel"),[o,l]=r.useState(s),[i,c]=r.useState(""),m=fn(),u=na.map($=>({title:e($.titleKey),slug:$.slug})).filter($=>$.title.toLowerCase().includes(i.toLowerCase())),p=$=>{m(`/docs/using-perdurable-ai?article=${$}`)},v=$=>{l($),t($?{channel:$}:{})},x=()=>{switch(o){case"virtual-assistant":return a.jsx(En,{});case"ai-help-desk":return a.jsxs("div",{className:"space-y-6",children:[a.jsx(ta,{}),a.jsx(yn,{})]});case"smart-support-chat":return a.jsx($n,{});case"email-support":return a.jsxs(M,{children:[a.jsxs(q,{children:[a.jsx(V,{children:e("supportPage.emailSupportTitle")}),a.jsx(oe,{children:e("supportPage.emailSupportDesc")})]}),a.jsxs(F,{children:[a.jsxs("p",{className:"text-muted-foreground mb-4",children:[e("supportPage.emailSupportBody")," ",a.jsx("a",{href:"mailto:[email protected]",className:"text-primary underline",children:"[email protected]"})]}),a.jsxs(A,{variant:"outline",onClick:()=>v(null),children:[a.jsx(Qe,{className:"mr-2 h-4 w-4"}),e("supportPage.backToSupportCenter")]})]})]});default:return null}};return o?a.jsxs("div",{className:"container mx-auto p-4 space-y-6",children:[a.jsx(Je,{titleKey:"support"}),a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs(A,{variant:"ghost",size:"sm",onClick:()=>v(null),children:[a.jsx(Qe,{className:"mr-2 h-4 w-4"}),e("supportPage.back")]}),a.jsx("div",{className:"flex flex-col",children:a.jsxs("h2",{className:"text-2xl font-bold tracking-tight",children:[o==="virtual-assistant"&&e("supportPage.virtualAssistant"),o==="ai-help-desk"&&e("supportPage.aiHelpDesk"),o==="smart-support-chat"&&e("supportPage.smartSupp
9ortChat"),o==="email-support"&&e("supportPage.emailSupport")]})})]}),x()]}):a.jsxs("div",{className:"container mx-auto p-4 space-y-6",children:[a.jsx(Je,{titleKey:"support"}),a.jsxs("div",{className:"flex flex-col space-y-2",children:[a.jsx("h2",{className:"text-3xl font-bold tracking-tight",children:e("supportPage.title")}),a.jsx("p",{className:"text-muted-foreground",children:e("supportPage.subtitle")})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs(M,{className:"col-span-1 md:col-span-2",children:[a.jsxs(q,{children:[a.jsx(V,{children:e("supportPage.quickSearch")}),a.jsx(oe,{children:e("supportPage.quickSearchDesc")})]}),a.jsx(F,{children:a.jsxs(Ut,{className:"rounded-lg border shadow-md",children:[a.jsx(Bt,{placeholder:e("supportPage.searchPlaceholder"),value:i,onValueChange:c}),a.jsxs(Kt,{children:[a.jsx(Ht,{children:e("supportPage.noResults")}),a.jsx(qt,{heading:e("supportPage.suggestions"),children:u.map($=>a.jsxs(Vt,{onSelect:()=>p($.slug),className:"cursor-pointer",children:[a.jsx(mn,{className:"mr-2 h-4 w-4"}),$.title,a.jsx(Ie,{className:"ml-auto h-3 w-3 text-muted-foreground"})]},$.slug))})]})]})})]}),a.jsxs(M,{className:"col-span-1",children:[a.jsxs(q,{children:[a.jsx(V,{children:e("supportPage.contactSupport")}),a.jsx(oe,{children:e("supportPage.contactSupportDesc")})]}),a.jsxs(F,{className:"grid gap-4",children:[a.jsxs(A,{size:"lg",className:"w-full justify-start",onClick:()=>v("virtual-assistant"),children:[a.jsx(bn,{className:"mr-2 h-5 w-5"}),e("supportPage.virtualAssistant")]}),a.jsxs(A,{size:"lg",variant:"outline",className:"w-full justify-start",onClick:()=>v("ai-help-desk"),children:[a.jsx(pn,{className:"mr-2 h-5 w-5"}),e("supportPage.aiHelpDesk")]}),a.jsxs(A,{size:"lg",variant:"secondary",className:"w-full justify-start",onClick:()=>v("smart-support-chat"),children:[a.jsx(hn,{className:"mr-2 h-5 w-5"}),e("supportPage.smartSupportChat")]}),a.jsxs(A,{size:"lg",variant:"outline",className:"w-full justify-start",onClick:()=>v("email-support"),children:[a.jsx(vn,{className:"mr-2 h-5 w-5"}),e("supportPage.emailSupportTime")]})]})]}),a.jsxs(M,{className:"col-span-1",children:[a.jsxs(q,{children:[a.jsx(V,{children:e("supportPage.additionalResources")}),a.jsx(oe,{children:e("supportPage.additionalResourcesDesc")})]}),a.jsxs(F,{className:"grid gap-4",children:[a.jsx(A,{size:"lg",variant:"secondary",className:"w-full justify-start",asChild:!0,children:a.jsxs(he,{to:"/docs",children:[a.jsx(gn,{className:"mr-2 h-5 w-5"}),"Documentation"]})}),a.jsx(A,{size:"lg",variant:"outline",className:"w-full justify-start",asChild:!0,children:a.jsxs(he,{to:"/community-forum",children:[a.jsx(xn,{className:"mr-2 h-5 w-5"}),"Community Forum"]})}),a.jsxs("div",{className:"p-4 rounded-lg bg-muted",children:[a.jsx("h4",{className:"font-medium mb-2",children:e("supportPage.needPrioritySupport")}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:e("supportPage.prioritySupportDesc")}),a.jsx(A,{variant:"default",className:"w-full",asChild:!0,children:a.jsx(he,{to:"/upgrade",children:e("supportPage.viewPremiumPlans")})})]})]})]}),a.jsxs(M,{className:"col-span-1 md:col-span-2",children:[a.jsxs(q,{children:[a.jsx(V,{children:e("supportPage.faq")}),a.jsx(oe,{children:e("supportPage.faqDesc")})]}),a.jsx(F,{children:a.jsxs("div",{className:"grid gap-4",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("h3",{className:"font-medium",children:e("supportPage.howStartGestures")}),a.jsx("p",{className:"text-muted-foreground text-sm",children:e("supportPage.howStartGesturesAnswer")})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h3",{className:"font-medium",children:e("supportPage.howInstallExtension")}),a.jsx("p",{className:"text-muted-foreground text-sm",children:e("supportPage.howInstallExtensionAnswer")})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h3",{className:"font-medium",children:e("supportPage.howComposeEmails")}),a.jsx("p",{className:"text-muted-foreground text-sm",children:e("supportPage.howComposeEmailsAnswer")})]}),a.jsx("div",{className:"flex justify-end",children:a.jsx(A,{variant:"link",className:"px-0",asChild:!0,children:a.jsx(he,{to:"/documentation",children:e("supportPage.viewAllFaqs")})})})]})})]})]})]})};export{pa as default};

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.