@xenon-device-management/xenon 2.8.2 → 2.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/package.json +1 -1
- package/lib/public/assets/{AnnotationOverlay-BqBip3BK.js → AnnotationOverlay-DZrFxYPZ.js} +1 -1
- package/lib/public/assets/{ApiKeyGate-DUvekoqc.js → ApiKeyGate-DkyW0B7G.js} +1 -1
- package/lib/public/assets/{BugReportButton-BG0CrInp.js → BugReportButton-TyYrNWYM.js} +1 -1
- package/lib/public/assets/{DeviceMosaicView-B0SnOzKM.js → DeviceMosaicView-DY__bWHx.js} +2 -2
- package/lib/public/assets/{EmptyState-Dq-Bq8TT.js → EmptyState-CfkN-nUG.js} +1 -1
- package/lib/public/assets/{FieldGroup-BIgXTGgC.js → FieldGroup-DQu6Zo15.js} +1 -1
- package/lib/public/assets/{FilterMenu-CeJOFd6_.js → FilterMenu-BT_Q7-4t.js} +1 -1
- package/lib/public/assets/{Menu-B4H6_Xk9.js → Menu-DfwEC8pG.js} +1 -1
- package/lib/public/assets/{Modal-DJG1w3KG.js → Modal-DXyaClqh.js} +1 -1
- package/lib/public/assets/{RecordingPage-CuzbuRlh.js → RecordingPage-j7H4_iT1.js} +1 -1
- package/lib/public/assets/{RecordingsPage-CW2IMjO4.js → RecordingsPage-ST7B99o1.js} +1 -1
- package/lib/public/assets/{SegmentedControl-DhQ3uYdc.js → SegmentedControl-DaqYH9BW.js} +1 -1
- package/lib/public/assets/{SettingCard-C5Gmj98i.js → SettingCard-CWTz_r_8.js} +1 -1
- package/lib/public/assets/{Table-D-WtrnfJ.js → Table-BDO5qlOf.js} +1 -1
- package/lib/public/assets/{activity-CvT65tfF.js → activity-CGdR3Ff6.js} +1 -1
- package/lib/public/assets/{ai-settings-DuCpE_dA.js → ai-settings-C8I0KSUg.js} +1 -1
- package/lib/public/assets/{api-keys-DEIUB9Bz.js → api-keys-BhbZQpGV.js} +1 -1
- package/lib/public/assets/{apps-B0z6NLY9.js → apps-DaBl9nMx.js} +1 -1
- package/lib/public/assets/{arrow-left-CCUPd12W.js → arrow-left-WRIrign1.js} +1 -1
- package/lib/public/assets/{arrow-right-CrLsc2tN.js → arrow-right-BuIztKwL.js} +1 -1
- package/lib/public/assets/{arrow-up-right-CiQmHVQo.js → arrow-up-right-Cz072oos.js} +1 -1
- package/lib/public/assets/{auth-shell-CHgiSQ9B.js → auth-shell-BS884uL2.js} +2 -2
- package/lib/public/assets/{builds-page-BvxRnAet.js → builds-page-B05iZMmN.js} +1 -1
- package/lib/public/assets/{button-pgE9Zb7y.js → button-DjeIU-Ty.js} +1 -1
- package/lib/public/assets/{calendar-CNJBqo5s.js → calendar-DUF9u2PF.js} +1 -1
- package/lib/public/assets/{check-BOAfxviA.js → check-DUR92DEE.js} +1 -1
- package/lib/public/assets/{chevron-left-DAYay1pY.js → chevron-left-CRvlIuad.js} +1 -1
- package/lib/public/assets/{chevron-right-B0FDOdzU.js → chevron-right-iRDZ5v7C.js} +1 -1
- package/lib/public/assets/{circle-check-DOIAC8XC.js → circle-check-CqDvbZtW.js} +1 -1
- package/lib/public/assets/{circle-x-z8FaSlcA.js → circle-x-CsYtRLC8.js} +1 -1
- package/lib/public/assets/{clock-BtaZSeEx.js → clock-DB9ihtTE.js} +1 -1
- package/lib/public/assets/{copy-D60KmcdV.js → copy-BufiyibK.js} +1 -1
- package/lib/public/assets/{device-explorer-Cph43t8H.js → device-explorer-BapnPGYt.js} +1 -1
- package/lib/public/assets/{download-s-xM4AGY.js → download-D14AYHRg.js} +1 -1
- package/lib/public/assets/{forgot-password-CKw6RVHP.js → forgot-password-2PqpH7ph.js} +1 -1
- package/lib/public/assets/{funnel-BvgEGRdQ.js → funnel-CgV-CZex.js} +1 -1
- package/lib/public/assets/{index-BB9sO7Nt.js → index-BE8OC-Wj.js} +1 -1
- package/lib/public/assets/{index-BpIf5nE2.js → index-CXxjosDd.js} +2 -2
- package/lib/public/assets/{input-CPS4hChq.js → input-DPn63eF4.js} +1 -1
- package/lib/public/assets/{keycodes-D5ZobFRW.js → keycodes-BYgvJDTE.js} +1 -1
- package/lib/public/assets/{layers-CrAsrOG4.js → layers-DJZQUOez.js} +1 -1
- package/lib/public/assets/{list-checks-BnEjyKfv.js → list-checks-YM2_VNMv.js} +1 -1
- package/lib/public/assets/{lock-Dm0hfbuM.js → lock-Cy-A3o47.js} +1 -1
- package/lib/public/assets/{login-DdlbwQwy.js → login-CRZ2J7Up.js} +1 -1
- package/lib/public/assets/{maintenance-settings-kocnslUP.js → maintenance-settings-4HkUk10V.js} +1 -1
- package/lib/public/assets/{monitor-CGU-u9zq.js → monitor-Cyvro78e.js} +1 -1
- package/lib/public/assets/{mouse-pointer-2-CWu4a7Ez.js → mouse-pointer-2-26YTYUOD.js} +1 -1
- package/lib/public/assets/{network-TV7kV1jl.js → network-D-W1VWM_.js} +1 -1
- package/lib/public/assets/{overview-C3pWhCtz.js → overview-pVmHrKhk.js} +1 -1
- package/lib/public/assets/{page-header-DCNc9cYT.js → page-header-DsTokPlH.js} +1 -1
- package/lib/public/assets/{plus-C6Uuyu5Z.js → plus-OjIdQkG_.js} +1 -1
- package/lib/public/assets/{profile-page-CjUENuCw.js → profile-page-D0jy_p5L.js} +1 -1
- package/lib/public/assets/{reset-password-rpbIm1Go.js → reset-password-DptmkgSN.js} +1 -1
- package/lib/public/assets/{runbook-page-BGkOmIkY.js → runbook-page-9QcpCPUo.js} +1 -1
- package/lib/public/assets/{select-6Q8XgEfq.js → select-CHKzkHre.js} +1 -1
- package/lib/public/assets/{selector-detail-page-BPIr14Yp.js → selector-detail-page-P5zDXMZC.js} +1 -1
- package/lib/public/assets/{selector-health-DhZ490H5.js → selector-health-Buz4eRW1.js} +1 -1
- package/lib/public/assets/{selector-health-page-Vycvp0ED.js → selector-health-page-BHZfbxGg.js} +1 -1
- package/lib/public/assets/{session-detail-page-D2rvJIgL.js → session-detail-page-JHU-GKSX.js} +1 -1
- package/lib/public/assets/{settings-bF2S7k19.js → settings-CRTRggHW.js} +1 -1
- package/lib/public/assets/stat-tile-Be2twadZ.js +8 -0
- package/lib/public/assets/{tablet-1Gmx6FV4.js → tablet-C7QkOkHs.js} +1 -1
- package/lib/public/assets/{teams-DHBNN_a7.js → teams-CwVhnDoL.js} +1 -1
- package/lib/public/assets/{trash-2-D3idPlqv.js → trash-2-yjlULOrf.js} +1 -1
- package/lib/public/assets/{upload-HOW_42FA.js → upload-BcrYG7kK.js} +1 -1
- package/lib/public/assets/{use-password-reset-mode-CVPBPGSb.js → use-password-reset-mode-BhRH2TTL.js} +1 -1
- package/lib/public/assets/{users-BnKiArxK.js → users-BSZL_J7x.js} +1 -1
- package/lib/public/assets/{users-DjGgZFe_.js → users-D3jRTB5K.js} +1 -1
- package/lib/public/assets/{video-off-CuipXFJK.js → video-off-BwbiJtmA.js} +1 -1
- package/lib/public/assets/{webhook-settings-7_s2Zky-.js → webhook-settings-CTIdd7DN.js} +1 -1
- package/lib/public/assets/{zap-Gl0D1sD4.js → zap-CZK3Cbup.js} +1 -1
- package/lib/public/index.html +1 -1
- package/lib/src/app/routers/dashboard.js +6 -0
- package/lib/src/app/routers/sessionInsights.js +23 -1
- package/lib/src/device-managers/ios/IOSStreamService.js +8 -0
- package/lib/src/device-managers/ios/IOSTunnels.js +44 -4
- package/lib/test/unit/ios-stream-port-leases.spec.js +26 -0
- package/lib/test/unit/ios-tunnels.spec.js +24 -0
- package/lib/test/unit/session-list-insights.spec.js +57 -0
- package/package.json +1 -1
- package/lib/public/assets/stat-tile-DOrnbGTr.js +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as c,j as f,a0 as ze,v as Ze}from"./index-BpIf5nE2.js";import{u as de,a as k,P,b as oe,c as qe,d as Z,e as _,f as Qe,g as Je,D as et,h as tt}from"./index-BB9sO7Nt.js";var q="focusScope.autoFocusOnMount",Q="focusScope.autoFocusOnUnmount",fe={bubbles:!1,cancelable:!0},nt="FocusScope",Se=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...s}=e,[i,d]=c.useState(null),l=de(o),h=de(a),v=c.useRef(null),p=k(t,u=>d(u)),g=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let u=function(b){if(g.paused||!i)return;const C=b.target;i.contains(C)?v.current=C:D(v.current,{select:!0})},m=function(b){if(g.paused||!i)return;const C=b.relatedTarget;C!==null&&(i.contains(C)||D(v.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const S of b)S.removedNodes.length>0&&D(i)};document.addEventListener("focusin",u),document.addEventListener("focusout",m);const E=new MutationObserver(y);return i&&E.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",u),document.removeEventListener("focusout",m),E.disconnect()}}},[r,i,g.paused]),c.useEffect(()=>{if(i){me.add(g);const u=document.activeElement;if(!i.contains(u)){const y=new CustomEvent(q,fe);i.addEventListener(q,l),i.dispatchEvent(y),y.defaultPrevented||(rt(ut(we(i)),{select:!0}),document.activeElement===u&&D(i))}return()=>{i.removeEventListener(q,l),setTimeout(()=>{const y=new CustomEvent(Q,fe);i.addEventListener(Q,h),i.dispatchEvent(y),y.defaultPrevented||D(u??document.body,{select:!0}),i.removeEventListener(Q,h),me.remove(g)},0)}}},[i,l,h,g]);const w=c.useCallback(u=>{if(!n&&!r||g.paused)return;const m=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,y=document.activeElement;if(m&&y){const E=u.currentTarget,[b,C]=ot(E);b&&C?!u.shiftKey&&y===C?(u.preventDefault(),n&&D(b,{select:!0})):u.shiftKey&&y===b&&(u.preventDefault(),n&&D(C,{select:!0})):y===E&&u.preventDefault()}},[n,r,g.paused]);return f.jsx(P.div,{tabIndex:-1,...s,ref:p,onKeyDown:w})});Se.displayName=nt;function rt(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(D(r,{select:t}),document.activeElement!==n)return}function ot(e){const t=we(e),n=ve(t,e),r=ve(t.reverse(),e);return[n,r]}function we(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ve(e,t){for(const n of e)if(!at(n,{upTo:t}))return n}function at(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function it(e){return e instanceof HTMLInputElement&&"select"in e}function D(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&it(e)&&t&&e.select()}}var me=ct();function ct(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=he(e,t),e.unshift(t)},remove(t){var n;e=he(e,t),(n=e[0])==null||n.resume()}}}function he(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ut(e){return e.filter(t=>t.tagName!=="A")}var st="Portal",Ne=c.forwardRef((e,t)=>{var i;const{container:n,...r}=e,[o,a]=c.useState(!1);oe(()=>a(!0),[]);const s=n||o&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return s?ze.createPortal(f.jsx(P.div,{...r,ref:t}),s):null});Ne.displayName=st;function lt(e,t){return c.useReducer((n,r)=>t[n][r]??n,e)}var X=e=>{const{present:t,children:n}=e,r=dt(t),o=typeof n=="function"?n({present:r.isPresent}):c.Children.only(n),a=k(r.ref,ft(o));return typeof n=="function"||r.isPresent?c.cloneElement(o,{ref:a}):null};X.displayName="Presence";function dt(e){const[t,n]=c.useState(),r=c.useRef(null),o=c.useRef(e),a=c.useRef("none"),s=e?"mounted":"unmounted",[i,d]=lt(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const l=L(r.current);a.current=i==="mounted"?l:"none"},[i]),oe(()=>{const l=r.current,h=o.current;if(h!==e){const p=a.current,g=L(l);e?d("MOUNT"):g==="none"||(l==null?void 0:l.display)==="none"?d("UNMOUNT"):d(h&&p!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),oe(()=>{if(t){let l;const h=t.ownerDocument.defaultView??window,v=g=>{const u=L(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&u&&(d("ANIMATION_END"),!o.current)){const m=t.style.animationFillMode;t.style.animationFillMode="forwards",l=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=m)})}},p=g=>{g.target===t&&(a.current=L(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{h.clearTimeout(l),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:c.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function L(e){return(e==null?void 0:e.animationName)||"none"}function ft(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var J=0;function vt(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ge()),document.body.insertAdjacentElement("beforeend",e[1]??ge()),J++,()=>{J===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),J--}},[])}function ge(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var R=function(){return R=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},R.apply(this,arguments)};function Re(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function mt(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,a;r<o;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var G="right-scroll-bar-position",H="width-before-scroll-bar",ht="with-scroll-bars-hidden",gt="--removed-body-scroll-bar-size";function ee(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function pt(e,t){var n=c.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var yt=typeof window<"u"?c.useLayoutEffect:c.useEffect,pe=new WeakMap;function Et(e,t){var n=pt(null,function(r){return e.forEach(function(o){return ee(o,r)})});return yt(function(){var r=pe.get(n);if(r){var o=new Set(r),a=new Set(e),s=n.current;o.forEach(function(i){a.has(i)||ee(i,null)}),a.forEach(function(i){o.has(i)||ee(i,s)})}pe.set(n,e)},[e]),n}function bt(e){return e}function Ct(e,t){t===void 0&&(t=bt);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var s=t(a,r);return n.push(s),function(){n=n.filter(function(i){return i!==s})}},assignSyncMedium:function(a){for(r=!0;n.length;){var s=n;n=[],s.forEach(a)}n={push:function(i){return a(i)},filter:function(){return n}}},assignMedium:function(a){r=!0;var s=[];if(n.length){var i=n;n=[],i.forEach(a),s=n}var d=function(){var h=s;s=[],h.forEach(a)},l=function(){return Promise.resolve().then(d)};l(),n={push:function(h){s.push(h),l()},filter:function(h){return s=s.filter(h),n}}}};return o}function St(e){e===void 0&&(e={});var t=Ct(null);return t.options=R({async:!0,ssr:!1},e),t}var Ae=function(e){var t=e.sideCar,n=Re(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return c.createElement(r,R({},n))};Ae.isSideCarExport=!0;function wt(e,t){return e.useMedium(t),Ae}var xe=St(),te=function(){},Y=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:te,onWheelCapture:te,onTouchMoveCapture:te}),o=r[0],a=r[1],s=e.forwardProps,i=e.children,d=e.className,l=e.removeScrollBar,h=e.enabled,v=e.shards,p=e.sideCar,g=e.noRelative,w=e.noIsolation,u=e.inert,m=e.allowPinchZoom,y=e.as,E=y===void 0?"div":y,b=e.gapMode,C=Re(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=p,A=Et([n,t]),x=R(R({},C),o);return c.createElement(c.Fragment,null,h&&c.createElement(S,{sideCar:xe,removeScrollBar:l,shards:v,noRelative:g,noIsolation:w,inert:u,setCallbacks:a,allowPinchZoom:!!m,lockRef:n,gapMode:b}),s?c.cloneElement(c.Children.only(i),R(R({},x),{ref:A})):c.createElement(E,R({},x,{className:d,ref:A}),i))});Y.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Y.classNames={fullWidth:H,zeroRight:G};var Nt=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Rt(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Nt();return t&&e.setAttribute("nonce",t),e}function At(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function xt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Dt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Rt())&&(At(t,n),xt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ot=function(){var e=Dt();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},De=function(){var e=Ot(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Pt={left:0,top:0,right:0,gap:0},ne=function(e){return parseInt(e||"",10)||0},Tt=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ne(n),ne(r),ne(o)]},Mt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Pt;var t=Tt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},It=De(),F="data-scroll-locked",Ft=function(e,t,n,r){var o=e.left,a=e.top,s=e.right,i=e.gap;return n===void 0&&(n="margin"),`
|
|
1
|
+
import{r as c,j as f,a0 as ze,v as Ze}from"./index-CXxjosDd.js";import{u as de,a as k,P,b as oe,c as qe,d as Z,e as _,f as Qe,g as Je,D as et,h as tt}from"./index-BE8OC-Wj.js";var q="focusScope.autoFocusOnMount",Q="focusScope.autoFocusOnUnmount",fe={bubbles:!1,cancelable:!0},nt="FocusScope",Se=c.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:a,...s}=e,[i,d]=c.useState(null),l=de(o),h=de(a),v=c.useRef(null),p=k(t,u=>d(u)),g=c.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;c.useEffect(()=>{if(r){let u=function(b){if(g.paused||!i)return;const C=b.target;i.contains(C)?v.current=C:D(v.current,{select:!0})},m=function(b){if(g.paused||!i)return;const C=b.relatedTarget;C!==null&&(i.contains(C)||D(v.current,{select:!0}))},y=function(b){if(document.activeElement===document.body)for(const S of b)S.removedNodes.length>0&&D(i)};document.addEventListener("focusin",u),document.addEventListener("focusout",m);const E=new MutationObserver(y);return i&&E.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",u),document.removeEventListener("focusout",m),E.disconnect()}}},[r,i,g.paused]),c.useEffect(()=>{if(i){me.add(g);const u=document.activeElement;if(!i.contains(u)){const y=new CustomEvent(q,fe);i.addEventListener(q,l),i.dispatchEvent(y),y.defaultPrevented||(rt(ut(we(i)),{select:!0}),document.activeElement===u&&D(i))}return()=>{i.removeEventListener(q,l),setTimeout(()=>{const y=new CustomEvent(Q,fe);i.addEventListener(Q,h),i.dispatchEvent(y),y.defaultPrevented||D(u??document.body,{select:!0}),i.removeEventListener(Q,h),me.remove(g)},0)}}},[i,l,h,g]);const w=c.useCallback(u=>{if(!n&&!r||g.paused)return;const m=u.key==="Tab"&&!u.altKey&&!u.ctrlKey&&!u.metaKey,y=document.activeElement;if(m&&y){const E=u.currentTarget,[b,C]=ot(E);b&&C?!u.shiftKey&&y===C?(u.preventDefault(),n&&D(b,{select:!0})):u.shiftKey&&y===b&&(u.preventDefault(),n&&D(C,{select:!0})):y===E&&u.preventDefault()}},[n,r,g.paused]);return f.jsx(P.div,{tabIndex:-1,...s,ref:p,onKeyDown:w})});Se.displayName=nt;function rt(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(D(r,{select:t}),document.activeElement!==n)return}function ot(e){const t=we(e),n=ve(t,e),r=ve(t.reverse(),e);return[n,r]}function we(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ve(e,t){for(const n of e)if(!at(n,{upTo:t}))return n}function at(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function it(e){return e instanceof HTMLInputElement&&"select"in e}function D(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&it(e)&&t&&e.select()}}var me=ct();function ct(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=he(e,t),e.unshift(t)},remove(t){var n;e=he(e,t),(n=e[0])==null||n.resume()}}}function he(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ut(e){return e.filter(t=>t.tagName!=="A")}var st="Portal",Ne=c.forwardRef((e,t)=>{var i;const{container:n,...r}=e,[o,a]=c.useState(!1);oe(()=>a(!0),[]);const s=n||o&&((i=globalThis==null?void 0:globalThis.document)==null?void 0:i.body);return s?ze.createPortal(f.jsx(P.div,{...r,ref:t}),s):null});Ne.displayName=st;function lt(e,t){return c.useReducer((n,r)=>t[n][r]??n,e)}var X=e=>{const{present:t,children:n}=e,r=dt(t),o=typeof n=="function"?n({present:r.isPresent}):c.Children.only(n),a=k(r.ref,ft(o));return typeof n=="function"||r.isPresent?c.cloneElement(o,{ref:a}):null};X.displayName="Presence";function dt(e){const[t,n]=c.useState(),r=c.useRef(null),o=c.useRef(e),a=c.useRef("none"),s=e?"mounted":"unmounted",[i,d]=lt(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const l=L(r.current);a.current=i==="mounted"?l:"none"},[i]),oe(()=>{const l=r.current,h=o.current;if(h!==e){const p=a.current,g=L(l);e?d("MOUNT"):g==="none"||(l==null?void 0:l.display)==="none"?d("UNMOUNT"):d(h&&p!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,d]),oe(()=>{if(t){let l;const h=t.ownerDocument.defaultView??window,v=g=>{const u=L(r.current).includes(CSS.escape(g.animationName));if(g.target===t&&u&&(d("ANIMATION_END"),!o.current)){const m=t.style.animationFillMode;t.style.animationFillMode="forwards",l=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=m)})}},p=g=>{g.target===t&&(a.current=L(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{h.clearTimeout(l),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:c.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function L(e){return(e==null?void 0:e.animationName)||"none"}function ft(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var J=0;function vt(){c.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ge()),document.body.insertAdjacentElement("beforeend",e[1]??ge()),J++,()=>{J===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),J--}},[])}function ge(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var R=function(){return R=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},R.apply(this,arguments)};function Re(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function mt(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,a;r<o;r++)(a||!(r in t))&&(a||(a=Array.prototype.slice.call(t,0,r)),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var G="right-scroll-bar-position",H="width-before-scroll-bar",ht="with-scroll-bars-hidden",gt="--removed-body-scroll-bar-size";function ee(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function pt(e,t){var n=c.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var yt=typeof window<"u"?c.useLayoutEffect:c.useEffect,pe=new WeakMap;function Et(e,t){var n=pt(null,function(r){return e.forEach(function(o){return ee(o,r)})});return yt(function(){var r=pe.get(n);if(r){var o=new Set(r),a=new Set(e),s=n.current;o.forEach(function(i){a.has(i)||ee(i,null)}),a.forEach(function(i){o.has(i)||ee(i,s)})}pe.set(n,e)},[e]),n}function bt(e){return e}function Ct(e,t){t===void 0&&(t=bt);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var s=t(a,r);return n.push(s),function(){n=n.filter(function(i){return i!==s})}},assignSyncMedium:function(a){for(r=!0;n.length;){var s=n;n=[],s.forEach(a)}n={push:function(i){return a(i)},filter:function(){return n}}},assignMedium:function(a){r=!0;var s=[];if(n.length){var i=n;n=[],i.forEach(a),s=n}var d=function(){var h=s;s=[],h.forEach(a)},l=function(){return Promise.resolve().then(d)};l(),n={push:function(h){s.push(h),l()},filter:function(h){return s=s.filter(h),n}}}};return o}function St(e){e===void 0&&(e={});var t=Ct(null);return t.options=R({async:!0,ssr:!1},e),t}var Ae=function(e){var t=e.sideCar,n=Re(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return c.createElement(r,R({},n))};Ae.isSideCarExport=!0;function wt(e,t){return e.useMedium(t),Ae}var xe=St(),te=function(){},Y=c.forwardRef(function(e,t){var n=c.useRef(null),r=c.useState({onScrollCapture:te,onWheelCapture:te,onTouchMoveCapture:te}),o=r[0],a=r[1],s=e.forwardProps,i=e.children,d=e.className,l=e.removeScrollBar,h=e.enabled,v=e.shards,p=e.sideCar,g=e.noRelative,w=e.noIsolation,u=e.inert,m=e.allowPinchZoom,y=e.as,E=y===void 0?"div":y,b=e.gapMode,C=Re(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=p,A=Et([n,t]),x=R(R({},C),o);return c.createElement(c.Fragment,null,h&&c.createElement(S,{sideCar:xe,removeScrollBar:l,shards:v,noRelative:g,noIsolation:w,inert:u,setCallbacks:a,allowPinchZoom:!!m,lockRef:n,gapMode:b}),s?c.cloneElement(c.Children.only(i),R(R({},x),{ref:A})):c.createElement(E,R({},x,{className:d,ref:A}),i))});Y.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Y.classNames={fullWidth:H,zeroRight:G};var Nt=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Rt(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Nt();return t&&e.setAttribute("nonce",t),e}function At(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function xt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Dt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Rt())&&(At(t,n),xt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ot=function(){var e=Dt();return function(t,n){c.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},De=function(){var e=Ot(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Pt={left:0,top:0,right:0,gap:0},ne=function(e){return parseInt(e||"",10)||0},Tt=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ne(n),ne(r),ne(o)]},Mt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Pt;var t=Tt(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},It=De(),F="data-scroll-locked",Ft=function(e,t,n,r){var o=e.left,a=e.top,s=e.right,i=e.gap;return n===void 0&&(n="margin"),`
|
|
2
2
|
.`.concat(ht,` {
|
|
3
3
|
overflow: hidden `).concat(r,`;
|
|
4
4
|
padding-right: `).concat(i,"px ").concat(r,`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as q,r as c,i as Q,u as X,b as ee,t as te,j as e,e as B,A as ne,Y as re}from"./index-
|
|
1
|
+
import{c as q,r as c,i as Q,u as X,b as ee,t as te,j as e,e as B,A as ne,Y as re}from"./index-CXxjosDd.js";import{f as Z,a as se,c as ae,h as ie,i as G,j as oe,k as ce,m as le}from"./recordings-BWe1ydXm.js";import{P as ue}from"./page-header-DsTokPlH.js";import{B as C}from"./button-DjeIU-Ty.js";import{E as $}from"./EmptyState-CfkN-nUG.js";import{M as de}from"./Modal-DXyaClqh.js";import{P as fe,M as me,a as ge}from"./Menu-DfwEC8pG.js";import{A as pe}from"./AnnotationOverlay-DZrFxYPZ.js";import{t as O,v as he,R as ye,P as be,n as ke,c as z,o as ve,a as R,f as xe,p as je,S as V,b as Me,d as we}from"./recordings-n-GTW3aT.js";import{A as Re}from"./arrow-left-WRIrign1.js";import{T as Ne}from"./trash-2-yjlULOrf.js";import{D as Se}from"./download-D14AYHRg.js";import"./utils-CDN07tui.js";import"./index-BE8OC-Wj.js";import"./check-DUR92DEE.js";/**
|
|
2
2
|
* @license lucide-react v0.555.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as V,E as Y,r as l,j as n,Y as z,A as G,e as q}from"./index-
|
|
1
|
+
import{u as V,E as Y,r as l,j as n,Y as z,A as G,e as q}from"./index-CXxjosDd.js";import{P as Q}from"./page-header-DsTokPlH.js";import{T as Z,a as J,b as T,c as h,d as X,e as m}from"./Table-BDO5qlOf.js";import{B as v}from"./button-DjeIU-Ty.js";import{E as y}from"./EmptyState-CfkN-nUG.js";import{I as ee}from"./input-DPn63eF4.js";import{F as f}from"./FilterMenu-BT_Q7-4t.js";import{l as A}from"./recordings-BWe1ydXm.js";import{f as ne,a as te}from"./recordings-n-GTW3aT.js";import"./utils-CDN07tui.js";import"./Menu-DfwEC8pG.js";import"./index-BE8OC-Wj.js";import"./check-DUR92DEE.js";import"./plus-OjIdQkG_.js";const re={phone:"",by:"",when:"any",q:""},oe=["any","24h","7d","30d"],R=864e5,se={"24h":R,"7d":7*R,"30d":30*R},ae={any:"Any time","24h":"Last 24 hours","7d":"Last 7 days","30d":"Last 30 days"};function ce(t){const r=t.get("when");return{phone:t.get("phone")??"",by:t.get("by")??"",when:r&&oe.includes(r)?r:"any",q:t.get("q")??""}}function F(t){const r=new URLSearchParams;return t.phone&&r.set("phone",t.phone),t.by&&r.set("by",t.by),t.when!=="any"&&r.set("when",t.when),t.q.trim()&&r.set("q",t.q),r}function ie(t){return!!(t.phone||t.by||t.when!=="any"||t.q.trim())}function P(t,r){return{udid:t.phone||void 0,startedBy:t.by||void 0,since:t.when==="any"?void 0:new Date(r-se[t.when]).toISOString(),q:t.q.trim()||void 0}}const B=50,le=250;function de(t){const r=t.phones.map(g=>g.name);return{text:r.length>2?`${r.slice(0,2).join(", ")} +${r.length-2}`:r.join(", "),title:r.join(`
|
|
2
2
|
`)}}const ue=t=>t.status==="recording"?"/devices/live":`/recordings/${encodeURIComponent(t.groupId)}`;function Ne(){const t=V(),[r,g]=Y(),a=ce(r),x=F(a).toString(),[s,S]=l.useState(null),[I,D]=l.useState(null),[j,C]=l.useState([]),[N,w]=l.useState(null),[M,k]=l.useState(!1),[H,O]=l.useState(0),u=l.useRef(0),d=l.useRef(!0),p=e=>g(F(e),{replace:!0});l.useEffect(()=>{d.current=!0;const e=++u.current,c=window.setTimeout(()=>{A({...P(a,Date.now()),limit:B}).then(i=>{!d.current||e!==u.current||(S(i),C(i.recordings),w(null),D(x))}).catch(i=>{!d.current||e!==u.current||w(i instanceof Error?i.message:String(i))})},le);return()=>{window.clearTimeout(c),d.current=!1}},[x,H]);const b=I===x?(s==null?void 0:s.nextCursor)??null:null,_=async()=>{if(!b)return;const e=u.current;k(!0);try{const c=await A({...P(a,Date.now()),limit:B,cursor:b});if(!d.current||e!==u.current)return;S(c),C(i=>i.concat(c.recordings))}catch(c){if(!d.current||e!==u.current)return;w(c instanceof Error?c.message:String(c))}finally{d.current&&k(!1)}},o=s==null?void 0:s.facets,W=[{value:"",label:"Any phone",count:(o==null?void 0:o.when.any)??0},...((o==null?void 0:o.phones)??[]).map(e=>({value:e.udid,label:e.name,count:e.count}))],K=[{value:"",label:"Anyone",count:(o==null?void 0:o.when.any)??0},...((o==null?void 0:o.people)??[]).map(e=>({value:e.id,label:e.name,count:e.count})),...o&&o.unknownCount>0?[{value:"unknown",label:"Unknown",count:o.unknownCount}]:[]],U=["any","24h","7d","30d"].map(e=>({value:e,label:ae[e],count:(o==null?void 0:o.when[e])??0})),E=(s==null?void 0:s.total)??0;return n.jsxs("div",{className:"rec-page",children:[n.jsx(Q,{icon:z,title:"Recordings",subtitle:s?`${E} recording${E===1?"":"s"}`:void 0}),n.jsxs("div",{className:"rec-toolbar",children:[n.jsx(ee,{type:"text",className:"rec-search","aria-label":"Search recordings",placeholder:"Search phones and bookmarks",value:a.q,onChange:e=>p({...a,q:e.target.value})}),n.jsx(f,{name:"Phone",value:a.phone,anyValue:"",options:W,onChange:e=>p({...a,phone:e})}),n.jsx(f,{name:"Recorded by",value:a.by,anyValue:"",options:K,onChange:e=>p({...a,by:e})}),n.jsx(f,{name:"When",value:a.when,anyValue:"any",options:U,onChange:e=>p({...a,when:e})})]}),N?n.jsx(y,{title:"Couldn't load recordings",description:N,action:n.jsxs(v,{variant:"secondary",onClick:()=>O(e=>e+1),children:[n.jsx(G,{size:14,"aria-hidden":"true"}),"Retry"]})}):s?j.length===0?ie(a)?n.jsx(y,{title:"No recordings match",action:n.jsx(v,{variant:"secondary",onClick:()=>p(re),children:"Clear filters"})}):n.jsx(y,{title:"No recordings yet",description:"Record phones from Live devices.",action:n.jsx(q,{className:"rec-link",to:"/devices/live",children:"Open Live devices"})}):n.jsxs(n.Fragment,{children:[n.jsxs(Z,{className:"rec-table",children:[n.jsxs("caption",{className:"sr-only",children:["Recordings, ",j.length," shown"]}),n.jsx(J,{children:n.jsxs(T,{children:[n.jsx(h,{scope:"col",children:"When"}),n.jsx(h,{scope:"col",children:"Phones"}),n.jsx(h,{scope:"col",children:"Length"}),n.jsx(h,{scope:"col",children:"Recorded by"}),n.jsx(h,{scope:"col",children:"Bookmarks"}),n.jsx(h,{scope:"col",children:"Status"})]})}),n.jsx(X,{children:j.map(e=>{var L;const c=de(e),i=ue(e);return n.jsxs(T,{className:"rec-row",onClick:$=>{$.target.closest("a")||t(i)},children:[n.jsx(m,{children:n.jsx(q,{to:i,className:"rec-link",children:ne(e.startedAt)})}),n.jsx(m,{title:c.title,children:c.text}),n.jsx(m,{className:"rec-num",children:e.durationMs===null?"—":te(e.durationMs)}),n.jsx(m,{children:((L=e.startedBy)==null?void 0:L.name)??"Unknown"}),n.jsx(m,{className:"rec-num",children:e.bookmarkCount}),n.jsx(m,{children:e.status==="recording"?"Recording…":e.status==="failed"?"Failed":""})]},e.groupId)})})]}),b&&n.jsx("div",{className:"rec-more",children:n.jsx(v,{variant:"secondary",onClick:_,disabled:M,children:"Load more"})})]}):n.jsx(y,{title:"Loading recordings…"}),s&&n.jsxs("p",{className:"rec-footnote",children:["Recordings are kept for ",s.retention.days," days, up to the newest"," ",s.retention.maxCount,"."]})]})}export{Ne as default,de as phoneNames};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./index-
|
|
1
|
+
import{j as e}from"./index-CXxjosDd.js";const s=({kind:n,size:a=6,className:l})=>e.jsx("span",{className:`status-dot status-dot-${n}${l?" "+l:""}`,style:{width:a,height:a},"aria-hidden":!0});function d({segments:n,value:a,onChange:l,size:o="md",label:i}){return e.jsx("div",{className:`seg seg-${o}`,role:"tablist","aria-label":i,children:n.map(t=>e.jsxs("button",{role:"tab","aria-selected":t.value===a,"aria-label":t.title&&typeof t.label=="string"?t.label:void 0,"aria-keyshortcuts":t.keyShortcuts,title:t.title,disabled:t.disabled,className:`seg-btn${t.value===a?" seg-btn-active":""}`,onClick:()=>{t.disabled||l(t.value)},type:"button",children:[t.tone&&e.jsx(s,{kind:t.tone}),e.jsx("span",{children:t.label}),typeof t.count=="number"&&e.jsx("span",{className:`seg-count${t.count===0?" seg-count-zero":""}`,children:t.count})]},t.value))})}export{s as S,d as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as n,j as s,A as h}from"./index-
|
|
1
|
+
import{c as n,j as s,A as h}from"./index-CXxjosDd.js";import{B as r}from"./button-DjeIU-Ty.js";/**
|
|
2
2
|
* @license lucide-react v0.555.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./index-
|
|
1
|
+
import{j as t}from"./index-CXxjosDd.js";const x=({className:s,...a})=>t.jsx("table",{className:`tbl${s?" "+s:""}`,...a}),j=s=>t.jsx("thead",{...s}),c=s=>t.jsx("tbody",{...s}),e=s=>t.jsx("tr",{...s}),n=s=>t.jsx("th",{...s}),T=s=>t.jsx("td",{...s});export{x as T,j as a,e as b,n as c,c as d,T as e};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as p,t as z,r as c,X as m,j as e,S as k,A as N,P as I,Q as $}from"./index-
|
|
1
|
+
import{c as p,t as z,r as c,X as m,j as e,S as k,A as N,P as I,Q as $}from"./index-CXxjosDd.js";/* empty css */import{S,A as F}from"./SettingCard-CWTz_r_8.js";import{P as B}from"./page-header-DsTokPlH.js";import{L as T}from"./lock-Cy-A3o47.js";import{C as b}from"./circle-check-CqDvbZtW.js";import{A as E}from"./activity-CGdR3Ff6.js";import"./button-DjeIU-Ty.js";import"./utils-CDN07tui.js";/**
|
|
2
2
|
* @license lucide-react v0.555.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as le,r as a,j as e,A as $,V as g,y as oe}from"./index-BpIf5nE2.js";/* empty css */import{a as L}from"./time-B8FIgwPE.js";import{T as ce,a as de,b as z,c as l,d as me,e as o}from"./Table-D-WtrnfJ.js";import{F as m}from"./FieldGroup-BIgXTGgC.js";import{P as O}from"./page-header-DCNc9cYT.js";import{M as B}from"./Modal-DJG1w3KG.js";import{B as u}from"./button-pgE9Zb7y.js";import{I as H}from"./input-CPS4hChq.js";import{S as M}from"./select-6Q8XgEfq.js";import{P as v}from"./plus-C6Uuyu5Z.js";import{T as pe}from"./trash-2-D3idPlqv.js";import{C as he}from"./check-BOAfxviA.js";import{C as xe}from"./copy-D60KmcdV.js";import"./index-BB9sO7Nt.js";import"./utils-CDN07tui.js";const U=["read","sessions","devices","admin"],W={"7d":"7 days","30d":"30 days","90d":"90 days","1y":"1 year",never:"No expiry"},ue={"7d":7,"30d":30,"90d":90,"1y":365};function Y(i){return i==="never"?null:new Date(Date.now()+ue[i]*864e5).toISOString()}function q(i){if(!i)return"Never";const n=Date.now()-new Date(i).getTime();return n<6e4?"Just now":n<36e5?`${Math.floor(n/6e4)}m ago`:n<864e5?`${Math.floor(n/36e5)}h ago`:`${Math.floor(n/864e5)}d ago`}const Ee=()=>{const{toast:i}=le(),[n,w]=a.useState([]),[b,J]=a.useState([]),[X,N]=a.useState(!0),[G,k]=a.useState(!1),[V,d]=a.useState(!1),[r,y]=a.useState(null),[C,S]=a.useState(null),[T,_]=a.useState(!1),[p,A]=a.useState(""),[j,I]=a.useState({read:!0,sessions:!0,devices:!1,admin:!1}),[R,P]=a.useState(300),[E,D]=a.useState(""),[h,F]=a.useState("30d"),[x,K]=a.useState(!1),Q=s=>{var t;return s?((t=b.find(c=>c.id===s))==null?void 0:t.name)||s.slice(0,8):"Shared"},f=async()=>{N(!0);try{const[s,t]=await Promise.all([fetch("/xenon/api/apikeys",{credentials:"include"}),fetch("/xenon/api/teams",{credentials:"include"})]);if(s.status===403){k(!0),w([]);return}if(!s.ok)throw new Error(`HTTP ${s.status}`);w(await s.json()),t.ok&&J(await t.json()),k(!1)}catch(s){i(`Failed to load API keys: ${s.message}`,"error")}finally{N(!1)}};a.useEffect(()=>{f()},[]);const Z=()=>{A(""),I({read:!0,sessions:!0,devices:!1,admin:!1}),P(300),D(""),F("30d")},ee=async()=>{const s=U.filter(t=>j[t]);if(!p.trim()){i("Key name is required","error");return}if(s.length===0){i("Select at least one scope","error");return}K(!0);try{const t=await fetch("/xenon/api/apikeys",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:p.trim(),scopes:s,rateLimit:R,teamId:E||null,expiresAt:Y(h)})});if(!t.ok)throw new Error(`HTTP ${t.status}`);const c=await t.json();d(!1),Z(),y({name:p.trim(),raw:c.key}),await f()}catch(t){i(`Create failed: ${t.message}`,"error")}finally{K(!1)}},se=async s=>{S(s);try{const t=await fetch(`/xenon/api/apikeys/${s}`,{method:"DELETE",credentials:"include"});if(!t.ok)throw new Error(`HTTP ${t.status}`);i("Key revoked","success"),await f()}catch(t){i(`Revoke failed: ${t.message}`,"error")}finally{S(null)}},te=async s=>{try{await navigator.clipboard.writeText(s),_(!0),setTimeout(()=>_(!1),1500)}catch{i("Copy failed — select the text manually","error")}};if(X)return e.jsxs("div",{className:"settings-loading",children:[e.jsx($,{className:"animate-spin",size:32}),e.jsx("span",{children:"Loading API keys…"})]});if(G)return e.jsx("div",{className:"settings-container",children:e.jsx(O,{icon:g,title:"API keys",subtitle:e.jsxs(e.Fragment,{children:["Your key lacks the ",e.jsx("code",{children:"admin"})," scope. Ask an administrator to issue an admin key so you can manage access for other users."]})})});const ae=n.length,ie=n.filter(s=>s.scopes.includes("admin")).length,ne=n.filter(s=>s.lastUsedAt&&Date.now()-new Date(s.lastUsedAt).getTime()<864e5).length;return e.jsxs("div",{className:"settings-container",children:[e.jsx(O,{icon:g,title:"API keys",subtitle:e.jsxs(e.Fragment,{children:["Issue scoped credentials for humans (dashboard login) and machines (CI, WebDriver clients via ",e.jsx("code",{children:"xe:options.accessKey"})," + ",e.jsx("code",{children:"xe:options.token"}),"). Keys are shown only once at creation — copy the value before closing the dialog."]}),action:e.jsxs("button",{type:"button",className:"page-header-action",onClick:()=>d(!0),children:[e.jsx(v,{size:16}),e.jsx("span",{children:"Create new key"})]})}),e.jsxs("div",{className:"settings-content",children:[n.length>0&&e.jsxs("div",{className:"stat-strip",children:[e.jsxs("div",{className:"stat-strip__cell",children:[e.jsx("div",{className:"stat-strip__value",children:ae}),e.jsx("div",{className:"stat-strip__label",children:"Total keys"})]}),e.jsxs("div",{className:"stat-strip__cell",children:[e.jsx("div",{className:"stat-strip__value stat-strip__value--accent",children:ie}),e.jsx("div",{className:"stat-strip__label",children:"Admin scope"})]}),e.jsxs("div",{className:"stat-strip__cell",children:[e.jsx("div",{className:"stat-strip__value",children:ne}),e.jsx("div",{className:"stat-strip__label",children:"Active in last 24h"})]})]}),n.length===0?e.jsxs("div",{className:"empty-state",children:[e.jsx("div",{className:"empty-state__icon",children:e.jsx(g,{size:28})}),e.jsx("h3",{className:"empty-state__title",children:"No API keys yet"}),e.jsx("p",{className:"empty-state__copy",children:"Issue your first key to authenticate WebDriver clients or CI pipelines. Keys are shown only once at creation — copy the value before closing the dialog."}),e.jsxs("button",{type:"button",className:"page-header-action empty-state__action",onClick:()=>d(!0),children:[e.jsx(v,{size:16}),e.jsx("span",{children:"Create your first key"})]})]}):e.jsx("div",{className:"data-card",children:e.jsxs(ce,{children:[e.jsx(de,{children:e.jsxs(z,{children:[e.jsx(l,{children:"Name"}),e.jsx(l,{children:"Team"}),e.jsx(l,{children:"Scopes"}),e.jsx(l,{children:"Rate limit"}),e.jsx(l,{children:"Last used"}),e.jsx(l,{children:"Created"}),e.jsx(l,{children:"Expires"}),e.jsx(l,{style:{textAlign:"right"},children:"Actions"})]})}),e.jsx(me,{children:n.map(s=>e.jsxs(z,{children:[e.jsxs(o,{children:[e.jsx("strong",{children:s.name}),e.jsx("div",{className:"row-meta-mono",children:s.id.slice(0,8)})]}),e.jsx(o,{children:e.jsx("span",{className:`pill-chip ${s.teamId?"pill-chip--team":"pill-chip--shared"}`,children:Q(s.teamId)})}),e.jsx(o,{children:e.jsx("div",{className:"scope-chips",children:s.scopes.split(",").map(t=>{const c=t.trim(),re=c==="admin";return e.jsx("span",{className:`pill-chip ${re?"pill-chip--admin":"pill-chip--scope"}`,children:c},t)})})}),e.jsxs(o,{className:"row-mono",children:[s.rateLimit,"/min"]}),e.jsx(o,{className:"row-mono",children:q(s.lastUsedAt)}),e.jsx(o,{className:"row-mono",children:q(s.createdAt)}),e.jsx(o,{className:"row-mono",children:s.expiresAt?new Date(s.expiresAt).getTime()<=Date.now()?e.jsx("span",{style:{color:"var(--red)"},children:"expired"}):L(s.expiresAt):"Never"}),e.jsx(o,{style:{textAlign:"right"},children:e.jsxs("button",{type:"button",className:"row-action row-action--danger",disabled:C===s.id,onClick:()=>{window.confirm(`Revoke "${s.name}"? Any client using this key will immediately fail.`)&&se(s.id)},children:[e.jsx(pe,{size:13}),C===s.id?"Revoking…":"Revoke"]})})]},s.id))})]})})]}),e.jsx(B,{open:V,title:"Create API key",width:520,onClose:()=>d(!1),footer:e.jsxs(e.Fragment,{children:[e.jsx(u,{variant:"secondary",onClick:()=>d(!1),disabled:x,children:"Cancel"}),e.jsxs(u,{variant:"primary",onClick:ee,disabled:x,children:[x?e.jsx($,{className:"animate-spin",size:18}):e.jsx(v,{size:18}),x?"Creating…":"Create key"]})]}),children:e.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.jsx(m,{label:"Name",htmlFor:"apikey-name",children:e.jsx(H,{id:"apikey-name",type:"text",value:p,onChange:s=>A(s.target.value),placeholder:"alice-laptop, ci-main, etc.",className:"w-full",autoFocus:!0})}),e.jsx(m,{label:"Scopes",description:e.jsxs(e.Fragment,{children:[e.jsx("code",{children:"admin"})," grants full access including API-key management."," ",e.jsx("code",{children:"sessions"})," is required for WebDriver sessions (",e.jsx("code",{children:"xe:options.accessKey"})," + ",e.jsx("code",{children:"xe:options.token"}),")."]}),children:e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:U.map(s=>e.jsxs("label",{style:ye,children:[e.jsx("input",{type:"checkbox",checked:j[s],onChange:t=>I({...j,[s]:t.target.checked})}),e.jsx("span",{children:s})]},s))})}),e.jsx(m,{label:"Rate limit (requests/min)",htmlFor:"apikey-ratelimit",children:e.jsx(H,{id:"apikey-ratelimit",type:"number",min:10,step:10,value:R,onChange:s=>P(parseInt(s.target.value)||300),className:"w-full"})}),e.jsx(m,{label:"Default team",description:e.jsxs(e.Fragment,{children:["Keys without a team can only reach shared-pool devices. Admins can override at session time via ",e.jsx("code",{children:"xe:options.team"}),"."]}),htmlFor:"apikey-team",children:e.jsxs(M,{id:"apikey-team",value:E,onChange:s=>D(s.target.value),className:"w-full",children:[e.jsx("option",{value:"",children:"No team (shared pool only)"}),b.map(s=>e.jsx("option",{value:s.id,children:s.name},s.id))]})}),e.jsx(m,{label:"Expires after",description:h==="never"?"Key never expires. Rotate manually when needed.":`Key will stop working on ${L(Y(h))}.`,htmlFor:"apikey-expiry",children:e.jsx(M,{id:"apikey-expiry",value:h,onChange:s=>F(s.target.value),className:"w-full",children:Object.keys(W).map(s=>e.jsx("option",{value:s,children:W[s]},s))})})]})}),e.jsx(B,{open:!!r,title:r?`Key created: ${r.name}`:"",width:560,onClose:()=>y(null),closeOnOverlayClick:!1,footer:e.jsxs(e.Fragment,{children:[e.jsxs(u,{variant:"primary",onClick:()=>r&&te(r.raw),disabled:!r,children:[T?e.jsx(he,{size:18}):e.jsx(xe,{size:18}),T?"Copied":"Copy to clipboard"]}),e.jsx(u,{variant:"secondary",onClick:()=>y(null),children:"I've saved it"})]}),children:r&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{style:{background:"var(--status-busy-bg)",border:"1px solid var(--status-busy-border)",borderRadius:6,padding:12,display:"flex",gap:8,alignItems:"flex-start"},children:[e.jsx(oe,{size:18,style:{flexShrink:0,marginTop:2}}),e.jsxs("div",{children:[e.jsx("strong",{children:"This key will not be shown again."})," Copy it now and store it in your password manager, CI secret store, or client config."]})]}),e.jsx("div",{style:{fontFamily:"monospace",padding:12,background:"rgb(var(--rgb-black) / 0.3)",borderRadius:6,wordBreak:"break-all",fontSize:"0.9em"},children:r.raw})]})})]})},ye={display:"flex",alignItems:"center",gap:6,padding:"6px 12px",background:"rgb(var(--rgb-white) / 0.04)",borderRadius:6,cursor:"pointer",fontFamily:"monospace",fontSize:"0.9em"};export{Ee as ApiKeys};
|
|
1
|
+
import{t as le,r as a,j as e,A as $,V as g,y as oe}from"./index-CXxjosDd.js";/* empty css */import{a as L}from"./time-B8FIgwPE.js";import{T as ce,a as de,b as z,c as l,d as me,e as o}from"./Table-BDO5qlOf.js";import{F as m}from"./FieldGroup-DQu6Zo15.js";import{P as O}from"./page-header-DsTokPlH.js";import{M as B}from"./Modal-DXyaClqh.js";import{B as u}from"./button-DjeIU-Ty.js";import{I as H}from"./input-DPn63eF4.js";import{S as M}from"./select-CHKzkHre.js";import{P as v}from"./plus-OjIdQkG_.js";import{T as pe}from"./trash-2-yjlULOrf.js";import{C as he}from"./check-DUR92DEE.js";import{C as xe}from"./copy-BufiyibK.js";import"./index-BE8OC-Wj.js";import"./utils-CDN07tui.js";const U=["read","sessions","devices","admin"],W={"7d":"7 days","30d":"30 days","90d":"90 days","1y":"1 year",never:"No expiry"},ue={"7d":7,"30d":30,"90d":90,"1y":365};function Y(i){return i==="never"?null:new Date(Date.now()+ue[i]*864e5).toISOString()}function q(i){if(!i)return"Never";const n=Date.now()-new Date(i).getTime();return n<6e4?"Just now":n<36e5?`${Math.floor(n/6e4)}m ago`:n<864e5?`${Math.floor(n/36e5)}h ago`:`${Math.floor(n/864e5)}d ago`}const Ee=()=>{const{toast:i}=le(),[n,w]=a.useState([]),[b,J]=a.useState([]),[X,N]=a.useState(!0),[G,k]=a.useState(!1),[V,d]=a.useState(!1),[r,y]=a.useState(null),[C,S]=a.useState(null),[T,_]=a.useState(!1),[p,A]=a.useState(""),[j,I]=a.useState({read:!0,sessions:!0,devices:!1,admin:!1}),[R,P]=a.useState(300),[E,D]=a.useState(""),[h,F]=a.useState("30d"),[x,K]=a.useState(!1),Q=s=>{var t;return s?((t=b.find(c=>c.id===s))==null?void 0:t.name)||s.slice(0,8):"Shared"},f=async()=>{N(!0);try{const[s,t]=await Promise.all([fetch("/xenon/api/apikeys",{credentials:"include"}),fetch("/xenon/api/teams",{credentials:"include"})]);if(s.status===403){k(!0),w([]);return}if(!s.ok)throw new Error(`HTTP ${s.status}`);w(await s.json()),t.ok&&J(await t.json()),k(!1)}catch(s){i(`Failed to load API keys: ${s.message}`,"error")}finally{N(!1)}};a.useEffect(()=>{f()},[]);const Z=()=>{A(""),I({read:!0,sessions:!0,devices:!1,admin:!1}),P(300),D(""),F("30d")},ee=async()=>{const s=U.filter(t=>j[t]);if(!p.trim()){i("Key name is required","error");return}if(s.length===0){i("Select at least one scope","error");return}K(!0);try{const t=await fetch("/xenon/api/apikeys",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:p.trim(),scopes:s,rateLimit:R,teamId:E||null,expiresAt:Y(h)})});if(!t.ok)throw new Error(`HTTP ${t.status}`);const c=await t.json();d(!1),Z(),y({name:p.trim(),raw:c.key}),await f()}catch(t){i(`Create failed: ${t.message}`,"error")}finally{K(!1)}},se=async s=>{S(s);try{const t=await fetch(`/xenon/api/apikeys/${s}`,{method:"DELETE",credentials:"include"});if(!t.ok)throw new Error(`HTTP ${t.status}`);i("Key revoked","success"),await f()}catch(t){i(`Revoke failed: ${t.message}`,"error")}finally{S(null)}},te=async s=>{try{await navigator.clipboard.writeText(s),_(!0),setTimeout(()=>_(!1),1500)}catch{i("Copy failed — select the text manually","error")}};if(X)return e.jsxs("div",{className:"settings-loading",children:[e.jsx($,{className:"animate-spin",size:32}),e.jsx("span",{children:"Loading API keys…"})]});if(G)return e.jsx("div",{className:"settings-container",children:e.jsx(O,{icon:g,title:"API keys",subtitle:e.jsxs(e.Fragment,{children:["Your key lacks the ",e.jsx("code",{children:"admin"})," scope. Ask an administrator to issue an admin key so you can manage access for other users."]})})});const ae=n.length,ie=n.filter(s=>s.scopes.includes("admin")).length,ne=n.filter(s=>s.lastUsedAt&&Date.now()-new Date(s.lastUsedAt).getTime()<864e5).length;return e.jsxs("div",{className:"settings-container",children:[e.jsx(O,{icon:g,title:"API keys",subtitle:e.jsxs(e.Fragment,{children:["Issue scoped credentials for humans (dashboard login) and machines (CI, WebDriver clients via ",e.jsx("code",{children:"xe:options.accessKey"})," + ",e.jsx("code",{children:"xe:options.token"}),"). Keys are shown only once at creation — copy the value before closing the dialog."]}),action:e.jsxs("button",{type:"button",className:"page-header-action",onClick:()=>d(!0),children:[e.jsx(v,{size:16}),e.jsx("span",{children:"Create new key"})]})}),e.jsxs("div",{className:"settings-content",children:[n.length>0&&e.jsxs("div",{className:"stat-strip",children:[e.jsxs("div",{className:"stat-strip__cell",children:[e.jsx("div",{className:"stat-strip__value",children:ae}),e.jsx("div",{className:"stat-strip__label",children:"Total keys"})]}),e.jsxs("div",{className:"stat-strip__cell",children:[e.jsx("div",{className:"stat-strip__value stat-strip__value--accent",children:ie}),e.jsx("div",{className:"stat-strip__label",children:"Admin scope"})]}),e.jsxs("div",{className:"stat-strip__cell",children:[e.jsx("div",{className:"stat-strip__value",children:ne}),e.jsx("div",{className:"stat-strip__label",children:"Active in last 24h"})]})]}),n.length===0?e.jsxs("div",{className:"empty-state",children:[e.jsx("div",{className:"empty-state__icon",children:e.jsx(g,{size:28})}),e.jsx("h3",{className:"empty-state__title",children:"No API keys yet"}),e.jsx("p",{className:"empty-state__copy",children:"Issue your first key to authenticate WebDriver clients or CI pipelines. Keys are shown only once at creation — copy the value before closing the dialog."}),e.jsxs("button",{type:"button",className:"page-header-action empty-state__action",onClick:()=>d(!0),children:[e.jsx(v,{size:16}),e.jsx("span",{children:"Create your first key"})]})]}):e.jsx("div",{className:"data-card",children:e.jsxs(ce,{children:[e.jsx(de,{children:e.jsxs(z,{children:[e.jsx(l,{children:"Name"}),e.jsx(l,{children:"Team"}),e.jsx(l,{children:"Scopes"}),e.jsx(l,{children:"Rate limit"}),e.jsx(l,{children:"Last used"}),e.jsx(l,{children:"Created"}),e.jsx(l,{children:"Expires"}),e.jsx(l,{style:{textAlign:"right"},children:"Actions"})]})}),e.jsx(me,{children:n.map(s=>e.jsxs(z,{children:[e.jsxs(o,{children:[e.jsx("strong",{children:s.name}),e.jsx("div",{className:"row-meta-mono",children:s.id.slice(0,8)})]}),e.jsx(o,{children:e.jsx("span",{className:`pill-chip ${s.teamId?"pill-chip--team":"pill-chip--shared"}`,children:Q(s.teamId)})}),e.jsx(o,{children:e.jsx("div",{className:"scope-chips",children:s.scopes.split(",").map(t=>{const c=t.trim(),re=c==="admin";return e.jsx("span",{className:`pill-chip ${re?"pill-chip--admin":"pill-chip--scope"}`,children:c},t)})})}),e.jsxs(o,{className:"row-mono",children:[s.rateLimit,"/min"]}),e.jsx(o,{className:"row-mono",children:q(s.lastUsedAt)}),e.jsx(o,{className:"row-mono",children:q(s.createdAt)}),e.jsx(o,{className:"row-mono",children:s.expiresAt?new Date(s.expiresAt).getTime()<=Date.now()?e.jsx("span",{style:{color:"var(--red)"},children:"expired"}):L(s.expiresAt):"Never"}),e.jsx(o,{style:{textAlign:"right"},children:e.jsxs("button",{type:"button",className:"row-action row-action--danger",disabled:C===s.id,onClick:()=>{window.confirm(`Revoke "${s.name}"? Any client using this key will immediately fail.`)&&se(s.id)},children:[e.jsx(pe,{size:13}),C===s.id?"Revoking…":"Revoke"]})})]},s.id))})]})})]}),e.jsx(B,{open:V,title:"Create API key",width:520,onClose:()=>d(!1),footer:e.jsxs(e.Fragment,{children:[e.jsx(u,{variant:"secondary",onClick:()=>d(!1),disabled:x,children:"Cancel"}),e.jsxs(u,{variant:"primary",onClick:ee,disabled:x,children:[x?e.jsx($,{className:"animate-spin",size:18}):e.jsx(v,{size:18}),x?"Creating…":"Create key"]})]}),children:e.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[e.jsx(m,{label:"Name",htmlFor:"apikey-name",children:e.jsx(H,{id:"apikey-name",type:"text",value:p,onChange:s=>A(s.target.value),placeholder:"alice-laptop, ci-main, etc.",className:"w-full",autoFocus:!0})}),e.jsx(m,{label:"Scopes",description:e.jsxs(e.Fragment,{children:[e.jsx("code",{children:"admin"})," grants full access including API-key management."," ",e.jsx("code",{children:"sessions"})," is required for WebDriver sessions (",e.jsx("code",{children:"xe:options.accessKey"})," + ",e.jsx("code",{children:"xe:options.token"}),")."]}),children:e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:U.map(s=>e.jsxs("label",{style:ye,children:[e.jsx("input",{type:"checkbox",checked:j[s],onChange:t=>I({...j,[s]:t.target.checked})}),e.jsx("span",{children:s})]},s))})}),e.jsx(m,{label:"Rate limit (requests/min)",htmlFor:"apikey-ratelimit",children:e.jsx(H,{id:"apikey-ratelimit",type:"number",min:10,step:10,value:R,onChange:s=>P(parseInt(s.target.value)||300),className:"w-full"})}),e.jsx(m,{label:"Default team",description:e.jsxs(e.Fragment,{children:["Keys without a team can only reach shared-pool devices. Admins can override at session time via ",e.jsx("code",{children:"xe:options.team"}),"."]}),htmlFor:"apikey-team",children:e.jsxs(M,{id:"apikey-team",value:E,onChange:s=>D(s.target.value),className:"w-full",children:[e.jsx("option",{value:"",children:"No team (shared pool only)"}),b.map(s=>e.jsx("option",{value:s.id,children:s.name},s.id))]})}),e.jsx(m,{label:"Expires after",description:h==="never"?"Key never expires. Rotate manually when needed.":`Key will stop working on ${L(Y(h))}.`,htmlFor:"apikey-expiry",children:e.jsx(M,{id:"apikey-expiry",value:h,onChange:s=>F(s.target.value),className:"w-full",children:Object.keys(W).map(s=>e.jsx("option",{value:s,children:W[s]},s))})})]})}),e.jsx(B,{open:!!r,title:r?`Key created: ${r.name}`:"",width:560,onClose:()=>y(null),closeOnOverlayClick:!1,footer:e.jsxs(e.Fragment,{children:[e.jsxs(u,{variant:"primary",onClick:()=>r&&te(r.raw),disabled:!r,children:[T?e.jsx(he,{size:18}):e.jsx(xe,{size:18}),T?"Copied":"Copy to clipboard"]}),e.jsx(u,{variant:"secondary",onClick:()=>y(null),children:"I've saved it"})]}),children:r&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[e.jsxs("div",{style:{background:"var(--status-busy-bg)",border:"1px solid var(--status-busy-border)",borderRadius:6,padding:12,display:"flex",gap:8,alignItems:"flex-start"},children:[e.jsx(oe,{size:18,style:{flexShrink:0,marginTop:2}}),e.jsxs("div",{children:[e.jsx("strong",{children:"This key will not be shown again."})," Copy it now and store it in your password manager, CI secret store, or client config."]})]}),e.jsx("div",{style:{fontFamily:"monospace",padding:12,background:"rgb(var(--rgb-black) / 0.3)",borderRadius:6,wordBreak:"break-all",fontSize:"0.9em"},children:r.raw})]})})]})},ye={display:"flex",alignItems:"center",gap:6,padding:"6px 12px",background:"rgb(var(--rgb-white) / 0.04)",borderRadius:6,cursor:"pointer",fontFamily:"monospace",fontSize:"0.9em"};export{Ee as ApiKeys};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as k,j as e,r as i,A as K,t as ve,b as fe,X as p,H as je,q as V,z as ye,v as ge}from"./index-
|
|
1
|
+
import{c as k,j as e,r as i,A as K,t as ve,b as fe,X as p,H as je,q as V,z as ye,v as ge}from"./index-CXxjosDd.js";import{f as Ne}from"./time-B8FIgwPE.js";import{c as be,B as x}from"./button-DjeIU-Ty.js";import{c as ke}from"./utils-CDN07tui.js";import{P as we}from"./page-header-DsTokPlH.js";import{S as Z}from"./select-CHKzkHre.js";import{M as J}from"./Modal-DXyaClqh.js";import{F as Q}from"./FieldGroup-DQu6Zo15.js";import{U as ee,T as H}from"./upload-BcrYG7kK.js";import{C as Ce}from"./check-DUR92DEE.js";import{C as Ae}from"./copy-BufiyibK.js";import{Z as Se}from"./zap-CZK3Cbup.js";import{D as ze}from"./download-D14AYHRg.js";import{T as Me}from"./trash-2-yjlULOrf.js";import"./index-BE8OC-Wj.js";/**
|
|
2
2
|
* @license lucide-react v0.555.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{c as i,j as e,n,S as o}from"./index-
|
|
1
|
+
import{c as i,j as e,n,S as o}from"./index-CXxjosDd.js";import{N as l}from"./network-D-W1VWM_.js";/**
|
|
2
2
|
* @license lucide-react v0.555.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const d=[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]],c=i("monitor-smartphone",d),x=[{icon:o,title:"Self-healing selectors",body:"Broken locators recover through six escalating tiers before a test fails."},{icon:c,title:"Live Android & iOS devices",body:"Watch, drive and record real devices from the browser."},{icon:l,title:"Hub–node scaling",body:"One hub orchestrates device labs across machines."}];function b({children:t}){return e.jsxs("div",{className:"grid min-h-screen w-full grid-cols-1 bg-[var(--bg)] text-[var(--text)] md:grid-cols-[minmax(0,5fr)_minmax(0,7fr)]",children:[e.jsxs("aside",{className:"relative hidden overflow-hidden border-r border-[rgb(var(--rgb-fg)/0.06)] bg-[var(--surface-sunken)] md:flex md:flex-col",children:[e.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 bg-[radial-gradient(ellipse_90%_60%_at_0%_0%,rgb(var(--rgb-accent)/0.14),transparent_60%)]"}),e.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 bg-[linear-gradient(to_right,rgb(var(--rgb-white)/0.03)_1px,transparent_1px),linear-gradient(to_bottom,rgb(var(--rgb-white)/0.03)_1px,transparent_1px)] bg-[size:48px_48px] [mask-image:linear-gradient(to_bottom,black,transparent_85%)]"}),e.jsxs("div",{className:"relative flex flex-1 flex-col justify-between px-12 py-10",children:[e.jsx(n,{className:"h-8 w-auto self-start object-contain"}),e.jsxs("div",{className:"max-w-md",children:[e.jsxs("h2",{className:"text-4xl font-semibold leading-tight tracking-tight",children:["Your device lab,",e.jsx("br",{}),e.jsx("span",{className:"text-[var(--color-accent)]",children:"under control."})]}),e.jsx("p",{className:"mt-4 text-sm leading-relaxed text-[var(--text-muted)]",children:"Appium orchestration for the devices you own — with self-healing tests, live streaming and recordable proof of what ran."}),e.jsx("ul",{className:"mt-10 space-y-6",children:x.map(({icon:a,title:r,body:s})=>e.jsxs("li",{className:"flex gap-4",children:[e.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg border border-[var(--accent-border)] bg-[var(--accent-subtle)]",children:e.jsx(a,{className:"h-4 w-4 text-[var(--color-accent)]","aria-hidden":"true"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-[var(--text)]",children:r}),e.jsx("div",{className:"mt-0.5 text-sm text-[var(--text-muted)]",children:s})]})]},r))})]}),e.jsxs("footer",{className:"flex items-center justify-between border-t border-[rgb(var(--rgb-fg)/0.06)] pt-5 text-xs text-[var(--text-muted)]",children:[e.jsxs("span",{children:["Xenon v","2.8.
|
|
6
|
+
*/const d=[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]],c=i("monitor-smartphone",d),x=[{icon:o,title:"Self-healing selectors",body:"Broken locators recover through six escalating tiers before a test fails."},{icon:c,title:"Live Android & iOS devices",body:"Watch, drive and record real devices from the browser."},{icon:l,title:"Hub–node scaling",body:"One hub orchestrates device labs across machines."}];function b({children:t}){return e.jsxs("div",{className:"grid min-h-screen w-full grid-cols-1 bg-[var(--bg)] text-[var(--text)] md:grid-cols-[minmax(0,5fr)_minmax(0,7fr)]",children:[e.jsxs("aside",{className:"relative hidden overflow-hidden border-r border-[rgb(var(--rgb-fg)/0.06)] bg-[var(--surface-sunken)] md:flex md:flex-col",children:[e.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 bg-[radial-gradient(ellipse_90%_60%_at_0%_0%,rgb(var(--rgb-accent)/0.14),transparent_60%)]"}),e.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 bg-[linear-gradient(to_right,rgb(var(--rgb-white)/0.03)_1px,transparent_1px),linear-gradient(to_bottom,rgb(var(--rgb-white)/0.03)_1px,transparent_1px)] bg-[size:48px_48px] [mask-image:linear-gradient(to_bottom,black,transparent_85%)]"}),e.jsxs("div",{className:"relative flex flex-1 flex-col justify-between px-12 py-10",children:[e.jsx(n,{className:"h-8 w-auto self-start object-contain"}),e.jsxs("div",{className:"max-w-md",children:[e.jsxs("h2",{className:"text-4xl font-semibold leading-tight tracking-tight",children:["Your device lab,",e.jsx("br",{}),e.jsx("span",{className:"text-[var(--color-accent)]",children:"under control."})]}),e.jsx("p",{className:"mt-4 text-sm leading-relaxed text-[var(--text-muted)]",children:"Appium orchestration for the devices you own — with self-healing tests, live streaming and recordable proof of what ran."}),e.jsx("ul",{className:"mt-10 space-y-6",children:x.map(({icon:a,title:r,body:s})=>e.jsxs("li",{className:"flex gap-4",children:[e.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-lg border border-[var(--accent-border)] bg-[var(--accent-subtle)]",children:e.jsx(a,{className:"h-4 w-4 text-[var(--color-accent)]","aria-hidden":"true"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-[var(--text)]",children:r}),e.jsx("div",{className:"mt-0.5 text-sm text-[var(--text-muted)]",children:s})]})]},r))})]}),e.jsxs("footer",{className:"flex items-center justify-between border-t border-[rgb(var(--rgb-fg)/0.06)] pt-5 text-xs text-[var(--text-muted)]",children:[e.jsxs("span",{children:["Xenon v","2.8.3"," · Self-hosted device lab"]}),e.jsx("a",{href:"/xenon/api-docs",target:"_blank",rel:"noreferrer",className:"text-[var(--text-muted)] underline-offset-4 hover:text-[var(--text)] hover:underline",children:"API docs"})]})]})]}),e.jsx("main",{className:"flex items-center justify-center px-6 py-10",children:e.jsx("div",{className:"w-full max-w-[400px] rounded-xl border border-[var(--border)] bg-[var(--surface)] px-8 py-9 shadow-[var(--shadow-lg)]",children:t})})]})}export{b as A};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as ee,r as h,p as te,X,j as e,z as q,R as _,f as se,T as ae,q as re,u as ne,i as le,t as oe,M as ie}from"./index-
|
|
1
|
+
import{c as ee,r as h,p as te,X,j as e,z as q,R as _,f as se,T as ae,q as re,u as ne,i as le,t as oe,M as ie}from"./index-CXxjosDd.js";import{s as ce,b as L,P as de,T as B,i as xe,f as V,a as ue,c as me,d as pe,p as he,e as fe,r as ve,C as be,g as ge,h as je,j as A,k as Ne,l as W,S as we,m as S,n as ye,o as Se,u as Ce,q as $e}from"./stat-tile-Be2twadZ.js";import{I as J}from"./input-DPn63eF4.js";import{L as ke}from"./layers-DJZQUOez.js";import{B as O}from"./button-DjeIU-Ty.js";import{D as Me}from"./download-D14AYHRg.js";import{s as Ee}from"./labels-C21SA4JG.js";import{C as Te}from"./circle-x-CsYtRLC8.js";import{C as Re}from"./circle-check-CqDvbZtW.js";import{C as Be}from"./chevron-right-iRDZ5v7C.js";import{T as Le}from"./tablet-C7QkOkHs.js";import{M as Ie}from"./monitor-Cyvro78e.js";import{P as _e}from"./page-header-DsTokPlH.js";import{S as De}from"./select-CHKzkHre.js";import{E as F}from"./EmptyState-CfkN-nUG.js";import{L as Ae}from"./list-checks-YM2_VNMv.js";import"./time-B8FIgwPE.js";import"./utils-CDN07tui.js";/**
|
|
2
2
|
* @license lucide-react v0.555.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as x,j as z}from"./index-
|
|
1
|
+
import{r as x,j as z}from"./index-CXxjosDd.js";import{a as j,c as g}from"./utils-CDN07tui.js";const v=a=>typeof a=="boolean"?`${a}`:a===0?"0":a,b=j,k=(a,e)=>t=>{var l;if((e==null?void 0:e.variants)==null)return b(a,t==null?void 0:t.class,t==null?void 0:t.className);const{variants:d,defaultVariants:r}=e,y=Object.keys(d).map(n=>{const s=t==null?void 0:t[n],o=r==null?void 0:r[n];if(s===null)return null;const i=v(s)||v(o);return d[n][i]}),c=t&&Object.entries(t).reduce((n,s)=>{let[o,i]=s;return i===void 0||(n[o]=i),n},{}),f=e==null||(l=e.compoundVariants)===null||l===void 0?void 0:l.reduce((n,s)=>{let{class:o,className:i,...V}=s;return Object.entries(V).every(N=>{let[m,u]=N;return Array.isArray(u)?u.includes({...r,...c}[m]):{...r,...c}[m]===u})?[...n,o,i]:n},[]);return b(a,y,f,t==null?void 0:t.class,t==null?void 0:t.className)},C=k("btn-base",{variants:{variant:{default:"btn-primary",primary:"btn-primary",secondary:"btn-secondary",outline:"btn-secondary",ghost:"btn-ghost",tonal:"btn-tonal",link:"btn-link",destructive:"btn-danger",danger:"btn-danger"},size:{default:"btn-size-md",md:"btn-size-md",sm:"btn-size-sm",lg:"btn-size-lg",icon:"btn-size-icon"}},defaultVariants:{variant:"primary",size:"md"}}),O=x.forwardRef(({className:a,variant:e,size:t,...l},d)=>z.jsx("button",{className:g(C({variant:e,size:t,className:a})),ref:d,...l}));O.displayName="Button";export{O as B,k as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as U,j as e,r as c,C as Ms,U as Wn,X as M,t as Ve,v as sn,b as qn,u as mt,a as Mt,T as Kn,q as ns,R as Fe,w as Xn,x as _s,y as $e,z as hs,I as nn,S as Nt,f as ct,A as St,i as an,B as Gn,D as Yn,E as Zn,p as Jn}from"./index-
|
|
1
|
+
import{c as U,j as e,r as c,C as Ms,U as Wn,X as M,t as Ve,v as sn,b as qn,u as mt,a as Mt,T as Kn,q as ns,R as Fe,w as Xn,x as _s,y as $e,z as hs,I as nn,S as Nt,f as ct,A as St,i as an,B as Gn,D as Yn,E as Zn,p as Jn}from"./index-CXxjosDd.js";import{P as Qn}from"./page-header-DsTokPlH.js";import{P as Ct,S as ea,B as ta}from"./BugReportButton-TyYrNWYM.js";import{A as sa}from"./activity-CGdR3Ff6.js";import{h as na,M as rn,S as on,C as aa,H as ia,a as Gt,A as ot,I as Yt}from"./keycodes-BYgvJDTE.js";import{p as _t}from"./labels-C21SA4JG.js";import{B as Y}from"./button-DjeIU-Ty.js";import{S as ms}from"./select-CHKzkHre.js";import{P as cn,M as ln,a as pe,b as ra}from"./Menu-DfwEC8pG.js";import{M as ps}from"./Modal-DXyaClqh.js";import{F as $t}from"./FieldGroup-DQu6Zo15.js";import{C as oa}from"./clock-DB9ihtTE.js";import{P as ca}from"./plus-OjIdQkG_.js";import{C as Te}from"./copy-BufiyibK.js";import{T as la}from"./tablet-C7QkOkHs.js";import{S as da,a as zs}from"./SegmentedControl-DaqYH9BW.js";import{T as ua,a as ha,b as dn,c as At,d as ma,e as Oe}from"./Table-BDO5qlOf.js";import{f as pa}from"./time-B8FIgwPE.js";import{L as un}from"./layers-DJZQUOez.js";import{C as fa}from"./chevron-right-iRDZ5v7C.js";import{M as Ls}from"./mouse-pointer-2-26YTYUOD.js";import{L as ya}from"./list-checks-YM2_VNMv.js";import{Z as hn}from"./zap-CZK3Cbup.js";import{C as dt}from"./check-DUR92DEE.js";import{C as mn}from"./circle-check-CqDvbZtW.js";import{C as pn}from"./circle-x-CsYtRLC8.js";import{D as xa}from"./download-D14AYHRg.js";import{T as as}from"./trash-2-yjlULOrf.js";import{U as va,T as ga}from"./upload-BcrYG7kK.js";import{A as ba}from"./arrow-left-WRIrign1.js";import{A as ja}from"./arrow-right-BuIztKwL.js";import{C as Os}from"./chevron-left-CRvlIuad.js";import{L as Na}from"./lock-Cy-A3o47.js";import{F as Ps}from"./FilterMenu-BT_Q7-4t.js";import"./utils-CDN07tui.js";import"./index-BE8OC-Wj.js";/**
|
|
2
2
|
* @license lucide-react v0.555.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,j as e,e as m,g as b}from"./index-
|
|
1
|
+
import{r as t,j as e,e as m,g as b}from"./index-CXxjosDd.js";import{u as g}from"./use-password-reset-mode-BhRH2TTL.js";import{A as c}from"./auth-shell-BS884uL2.js";import"./network-D-W1VWM_.js";function N(){const[s,d]=t.useState(""),[a,o]=t.useState(!1),[u,x]=t.useState(!1),[n,l]=t.useState(null),i=g();async function f(r){r.preventDefault(),o(!0),l(null);try{await b(s),x(!0)}catch(h){l(h.message||"Request failed")}finally{o(!1)}}return i!=="email"?e.jsxs(c,{children:[e.jsx("h1",{className:"text-2xl font-semibold mb-1",children:"Forgot password?"}),i==="admin"&&e.jsx("p",{className:"text-sm text-[var(--text-muted)] mb-6",children:"This Xenon server can't send email, so passwords are reset by an administrator. Ask a Xenon admin to send you a reset link from the Users page."}),e.jsx("div",{className:"mt-6 text-center",children:e.jsx(m,{to:"/login",className:"text-sm text-[var(--color-accent)] underline-offset-4 hover:underline",children:"Back to sign in"})})]}):e.jsx(c,{children:e.jsxs("form",{onSubmit:f,children:[e.jsx("h1",{className:"text-2xl font-semibold mb-1",children:"Forgot password?"}),e.jsx("p",{className:"text-sm text-[var(--text-muted)] mb-6",children:"Enter your email and we'll send you a reset link if your account exists."}),u?e.jsx("div",{className:"text-sm text-[var(--text)] mb-6",children:"If your email is registered, you'll receive a reset link shortly. Check your spam folder if you don't see it within a minute."}):e.jsxs(e.Fragment,{children:[e.jsx("label",{htmlFor:"forgot-email",className:"block text-sm font-medium text-[var(--text)] mb-1.5",children:"Email"}),e.jsx("input",{id:"forgot-email",type:"email",autoComplete:"username",value:s,onChange:r=>d(r.target.value),autoFocus:!0,required:!0,className:"w-full mb-4 h-10 px-3 rounded-lg bg-[var(--bg)] border border-[var(--border-strong)] text-sm text-[var(--text)] outline-none focus:border-[var(--color-accent)] focus:shadow-[0_0_0_3px_var(--accent-subtle)]"}),n&&e.jsx("div",{role:"alert",className:"text-sm text-[var(--red)] mb-3",children:n}),e.jsx("button",{type:"submit",disabled:a||!s,className:"mt-5 w-full h-10 rounded-md bg-[var(--color-accent)] text-[var(--color-on-accent)] font-medium text-sm disabled:opacity-50",children:a?"Sending…":"Send reset link"})]}),e.jsx("div",{className:"mt-6 text-center",children:e.jsx(m,{to:"/login",className:"text-sm text-[var(--color-accent)] underline-offset-4 hover:underline",children:"Back to sign in"})})]})})}export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,j as h,x as U,a1 as N}from"./index-
|
|
1
|
+
import{r as o,j as h,x as U,a1 as N}from"./index-CXxjosDd.js";function T(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function B(...e){return t=>{let r=!1;const s=e.map(n=>{const i=T(n,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let n=0;n<s.length;n++){const i=s[n];typeof i=="function"?i():T(e[n],null)}}}}function W(...e){return o.useCallback(B(...e),e)}function V(e){const t=z(e),r=o.forwardRef((s,n)=>{const{children:i,...u}=s,c=o.Children.toArray(i),f=c.find(X);if(f){const a=f.props.children,l=c.map(v=>v===f?o.Children.count(a)>1?o.Children.only(null):o.isValidElement(a)?a.props.children:null:v);return h.jsx(t,{...u,ref:n,children:o.isValidElement(a)?o.cloneElement(a,void 0,l):null})}return h.jsx(t,{...u,ref:n,children:i})});return r.displayName=`${e}.Slot`,r}function z(e){const t=o.forwardRef((r,s)=>{const{children:n,...i}=r;if(o.isValidElement(n)){const u=Z(n),c=Y(i,n.props);return n.type!==o.Fragment&&(c.ref=s?B(s,u):u),o.cloneElement(n,c)}return o.Children.count(n)>1?o.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var K=Symbol("radix.slottable");function X(e){return o.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===K}function Y(e,t){const r={...t};for(const s in t){const n=e[s],i=t[s];/^on[A-Z]/.test(s)?n&&i?r[s]=(...c)=>{const f=i(...c);return n(...c),f}:n&&(r[s]=n):s==="style"?r[s]={...n,...i}:s==="className"&&(r[s]=[n,i].filter(Boolean).join(" "))}return{...e,...r}}function Z(e){var s,n;let t=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(n=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var q=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],$=q.reduce((e,t)=>{const r=V(`Primitive.${t}`),s=o.forwardRef((n,i)=>{const{asChild:u,...c}=n,f=u?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(f,{...c,ref:i})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function G(e,t){e&&U.flushSync(()=>e.dispatchEvent(t))}function pe(e,t){const r=o.createContext(t),s=i=>{const{children:u,...c}=i,f=o.useMemo(()=>c,Object.values(c));return h.jsx(r.Provider,{value:f,children:u})};s.displayName=e+"Provider";function n(i){const u=o.useContext(r);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[s,n]}function ve(e,t=[]){let r=[];function s(i,u){const c=o.createContext(u),f=r.length;r=[...r,u];const a=v=>{var b;const{scope:d,children:m,...E}=v,y=((b=d==null?void 0:d[e])==null?void 0:b[f])||c,P=o.useMemo(()=>E,Object.values(E));return h.jsx(y.Provider,{value:P,children:m})};a.displayName=i+"Provider";function l(v,d){var y;const m=((y=d==null?void 0:d[e])==null?void 0:y[f])||c,E=o.useContext(m);if(E)return E;if(u!==void 0)return u;throw new Error(`\`${v}\` must be used within \`${i}\``)}return[a,l]}const n=()=>{const i=r.map(u=>o.createContext(u));return function(c){const f=(c==null?void 0:c[e])||i;return o.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return n.scopeName=e,[s,J(n,...t)]}function J(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const s=e.map(n=>({useScope:n(),scopeName:n.scopeName}));return function(i){const u=s.reduce((c,{useScope:f,scopeName:a})=>{const v=f(i)[`__scope${a}`];return{...c,...v}},{});return o.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return r.scopeName=t.scopeName,r}function g(e){const t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>(...r)=>{var s;return(s=t.current)==null?void 0:s.call(t,...r)},[])}var j=globalThis!=null&&globalThis.document?o.useLayoutEffect:()=>{};function S(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e==null||e(n),r===!1||!n.defaultPrevented)return t==null?void 0:t(n)}}function Q(e,t=globalThis==null?void 0:globalThis.document){const r=g(e);o.useEffect(()=>{const s=n=>{n.key==="Escape"&&r(n)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[r,t])}var H="DismissableLayer",w="dismissableLayer.update",ee="dismissableLayer.pointerDownOutside",te="dismissableLayer.focusOutside",I,A=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ne=o.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:s,onPointerDownOutside:n,onFocusOutside:i,onInteractOutside:u,onDismiss:c,...f}=e,a=o.useContext(A),[l,v]=o.useState(null),d=(l==null?void 0:l.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=o.useState({}),E=W(t,p=>v(p)),y=Array.from(a.layers),[P]=[...a.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(P),D=l?y.indexOf(l):-1,k=a.layersWithOutsidePointerEventsDisabled.size>0,R=D>=b,M=oe(p=>{const C=p.target,O=[...a.branches].some(x=>x.contains(C));!R||O||(n==null||n(p),u==null||u(p),p.defaultPrevented||c==null||c())},d),L=ie(p=>{const C=p.target;[...a.branches].some(x=>x.contains(C))||(i==null||i(p),u==null||u(p),p.defaultPrevented||c==null||c())},d);return Q(p=>{D===a.layers.size-1&&(s==null||s(p),!p.defaultPrevented&&c&&(p.preventDefault(),c()))},d),o.useEffect(()=>{if(l)return r&&(a.layersWithOutsidePointerEventsDisabled.size===0&&(I=d.body.style.pointerEvents,d.body.style.pointerEvents="none"),a.layersWithOutsidePointerEventsDisabled.add(l)),a.layers.add(l),_(),()=>{r&&a.layersWithOutsidePointerEventsDisabled.size===1&&(d.body.style.pointerEvents=I)}},[l,d,r,a]),o.useEffect(()=>()=>{l&&(a.layers.delete(l),a.layersWithOutsidePointerEventsDisabled.delete(l),_())},[l,a]),o.useEffect(()=>{const p=()=>m({});return document.addEventListener(w,p),()=>document.removeEventListener(w,p)},[]),h.jsx($.div,{...f,ref:E,style:{pointerEvents:k?R?"auto":"none":void 0,...e.style},onFocusCapture:S(e.onFocusCapture,L.onFocusCapture),onBlurCapture:S(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:S(e.onPointerDownCapture,M.onPointerDownCapture)})});ne.displayName=H;var re="DismissableLayerBranch",se=o.forwardRef((e,t)=>{const r=o.useContext(A),s=o.useRef(null),n=W(t,s);return o.useEffect(()=>{const i=s.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),h.jsx($.div,{...e,ref:n})});se.displayName=re;function oe(e,t=globalThis==null?void 0:globalThis.document){const r=g(e),s=o.useRef(!1),n=o.useRef(()=>{});return o.useEffect(()=>{const i=c=>{if(c.target&&!s.current){let f=function(){F(ee,r,a,{discrete:!0})};const a={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",n.current),n.current=f,t.addEventListener("click",n.current,{once:!0})):f()}else t.removeEventListener("click",n.current);s.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",i),t.removeEventListener("click",n.current)}},[t,r]),{onPointerDownCapture:()=>s.current=!0}}function ie(e,t=globalThis==null?void 0:globalThis.document){const r=g(e),s=o.useRef(!1);return o.useEffect(()=>{const n=i=>{i.target&&!s.current&&F(te,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",n),()=>t.removeEventListener("focusin",n)},[t,r]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function _(){const e=new CustomEvent(w);document.dispatchEvent(e)}function F(e,t,r,{discrete:s}){const n=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&n.addEventListener(e,t,{once:!0}),s?G(n,i):n.dispatchEvent(i)}var ce=N[" useId ".trim().toString()]||(()=>{}),ue=0;function Ee(e){const[t,r]=o.useState(ce());return j(()=>{r(s=>s??String(ue++))},[e]),e||(t?`radix-${t}`:"")}var ae=N[" useInsertionEffect ".trim().toString()]||j;function ye({prop:e,defaultProp:t,onChange:r=()=>{},caller:s}){const[n,i,u]=le({defaultProp:t,onChange:r}),c=e!==void 0,f=c?e:n;{const l=o.useRef(e!==void 0);o.useEffect(()=>{const v=l.current;v!==c&&console.warn(`${s} is changing from ${v?"controlled":"uncontrolled"} to ${c?"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.`),l.current=c},[c,s])}const a=o.useCallback(l=>{var v;if(c){const d=fe(l)?l(e):l;d!==e&&((v=u.current)==null||v.call(u,d))}else i(l)},[c,e,i,u]);return[f,a]}function le({defaultProp:e,onChange:t}){const[r,s]=o.useState(e),n=o.useRef(r),i=o.useRef(t);return ae(()=>{i.current=t},[t]),o.useEffect(()=>{var u;n.current!==r&&((u=i.current)==null||u.call(i,r),n.current=r)},[r,n]),[r,s,i]}function fe(e){return typeof e=="function"}export{ne as D,$ as P,W as a,j as b,ye as c,Ee as d,S as e,ve as f,V as g,pe as h,B as i,g as u};
|