const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/hybrid-pricing-plans-view-DrCQIRex.js","assets/hybrid-downgrade-to-personal-dialog-JiEv1Km4.js","assets/billing-KlbniKgx.js","assets/trial-aware-addon-cta-Cfgiw6d8.js","assets/pricing-plans-view-vMDVW4Ub.js","assets/device-management-view-DFye15Ac.js","assets/tailnet-lock-CToZyatu.js","assets/device-posture-integrations-section-ISybOH10.js","assets/device-posture-crowdstrike-view-D0uMNoPh.js","assets/posture-identity-collection-form-3UH6kf4T.js","assets/settings-setup-section-Sed8husz.js","assets/sensitive-input-C9-03bwZ.js","assets/eye-DGjmZ2ZD.js","assets/device-posture-fleet-view-B6qeZQoC.js","assets/device-posture-huntress-view-BF3BMM9j.js","assets/device-posture-intune-view-KMzz2pd-.js","assets/device-posture-jamf-view-DNoTqVFj.js","assets/device-posture-kandji-view-Bh8z5plg.js","assets/device-posture-kolide-view-CGVWcq-C.js","assets/device-posture-sentinelone-view-CN6nJ_Pl.js","assets/enable-tailnet-lock-BTqzddrX.js","assets/machine-selector-Cey6W30c.js","assets/mullvad-configure-view-29-EPzUg.js","assets/trust-credentials-view-CbVjqjvZ.js","assets/customoverflow-BTBk-KCe.js","assets/trust-credentials-utils-CaQpU817.js","assets/user-management-view-D1L1nR1s.js","assets/provisioning-group-row-Bxxzsfr_.js","assets/switch-idp-C5TaYklw.js","assets/switch-idp-view-xQfOIBPV.js","assets/cookie-B_GDHzTD.js","assets/edit-idp-view-qCa9Xw8v.js","assets/device-posture-integrations-selection-view-_0UbSYGr.js","assets/acl-view-HhlDyj24.js","assets/javascript-BmLdubLb.js","assets/javascript-BcRMuNTp.css","assets/switch-mQEYdbIu.js","assets/acl-gui-utils-CBF4ClzF.js","assets/message-square-more-Bi0swjgm.js","assets/acl-view-BDweUFl0.css","assets/dns-view-DF64kAou.js","assets/tcd-GELsDPRo.js","assets/dnd.esm-BYOLGrAU.js","assets/services-view-BeCeVvyc.js","assets/vip-service-hosts-DkxXPByl.js","assets/vip-services-DdAbnmdH.js","assets/seat-calculator-view-DtgsH-WR.js","assets/progress-DK7A4Ms-.js","assets/logs-view-DAEUGWrb.js","assets/log-streaming-setup-BbrXV02s.js","assets/log-streaming-setup-page-BZ7sChxv.js","assets/log-streaming-setup-locked-DMdBKEiQ.js","assets/pam-session-details-view-DQh1Aj8a.js","assets/pam-session-log-cells-8b7uJ5S1.js","assets/pam-session-details-view-DUR3Co_a.css","assets/design-view-QEyiaBjC.js","assets/country-flags-D1i9yNUJ.js","assets/acl-gui-view-CDiGVdri.js","assets/acl-gui-auto-approvers-NSrnnQNR.js","assets/acl-gui-tabs-XlfjepST.js","assets/acl-auto-approver-services-BaHjS3Gw.js","assets/acl-gui-tests-DzkCVIqK.js","assets/acl-tests-ssh-B-lyyfjZ.js","assets/acl-ssh-rules-BZwea_sa.js","assets/acl-gui-groups-B6EuL2BU.js","assets/acl-gui-add-edit-view-CTpQtVIC.js","assets/pam-detect-CAe6Asht.js","assets/acl-gui-user-defined-group-view-CKHkrXCD.js","assets/acl-gui-user-defined-groups-view-BXFb4wiz.js","assets/acl-gui-synced-group-view-UKkv7_y6.js","assets/acl-gui-synced-groups-view-CvhgUjzF.js","assets/acl-gui-autogroup-view-BRLXFB6f.js","assets/acl-gui-autogroups-view-BcpMdELo.js","assets/acl-gui-auto-approver-routes-view-CRfl1V2S.js","assets/acl-gui-auto-approver-services-view-DRpYcaHl.js","assets/acl-gui-auto-approver-exit-nodes-view-D1Zq4Ijj.js","assets/acl-gui-tests-view-Dciadftq.js","assets/acl-gui-tests-ssh-view-ZLDBEmff.js","assets/acl-redirect-view-AJKaIvGS.js","assets/new-service-view-DQ_tSinT.js","assets/new-pam-service-view-CBQu9MhM.js","assets/border0-services-6HnhZ54w.js","assets/service-details-view-miGDmu1B.js","assets/edit-service-view-BWTDnOOD.js","assets/trust-credentials-wizard-9Z4pzUQb.js"])))=>i.map(i=>d[i]); function xI(e,t){for(var r=0;rs[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();function Qc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var w1={exports:{}},ac={},j1={exports:{}},gt={};var s5;function vI(){if(s5)return gt;s5=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.iterator;function v(P){return P===null||typeof P!="object"?null:(P=g&&P[g]||P["@@iterator"],typeof P=="function"?P:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,b={};function w(P,q,Q){this.props=P,this.context=q,this.refs=b,this.updater=Q||y}w.prototype.isReactComponent={},w.prototype.setState=function(P,q){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,q,"setState")},w.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function N(){}N.prototype=w.prototype;function k(P,q,Q){this.props=P,this.context=q,this.refs=b,this.updater=Q||y}var E=k.prototype=new N;E.constructor=k,C(E,w.prototype),E.isPureReactComponent=!0;var T=Array.isArray,_=Object.prototype.hasOwnProperty,I={current:null},F={key:!0,ref:!0,__self:!0,__source:!0};function z(P,q,Q){var ae,X={},fe=null,he=null;if(q!=null)for(ae in q.ref!==void 0&&(he=q.ref),q.key!==void 0&&(fe=""+q.key),q)_.call(q,ae)&&!F.hasOwnProperty(ae)&&(X[ae]=q[ae]);var se=arguments.length-2;if(se===1)X.children=Q;else if(1>>1,Q=L[q];if(0>>1;qa(fe,P))hea(se,fe)?(L[q]=se,L[he]=P,q=he):(L[q]=fe,L[X]=P,q=X);else if(hea(se,P))L[q]=se,L[he]=P,q=he;else break e}}return V}function a(L,V){var P=L.sortIndex-V.sortIndex;return P!==0?P:L.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],m=[],p=1,g=null,v=3,y=!1,C=!1,b=!1,w=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(L){for(var V=r(m);V!==null;){if(V.callback===null)s(m);else if(V.startTime<=L)s(m),V.sortIndex=V.expirationTime,t(d,V);else break;V=r(m)}}function T(L){if(b=!1,E(L),!C)if(r(d)!==null)C=!0,re(_);else{var V=r(m);V!==null&&me(T,V.startTime-L)}}function _(L,V){C=!1,b&&(b=!1,N(z),z=-1),y=!0;var P=v;try{for(E(V),g=r(d);g!==null&&(!(g.expirationTime>V)||L&&!Y());){var q=g.callback;if(typeof q=="function"){g.callback=null,v=g.priorityLevel;var Q=q(g.expirationTime<=V);V=e.unstable_now(),typeof Q=="function"?g.callback=Q:g===r(d)&&s(d),E(V)}else s(d);g=r(d)}if(g!==null)var ae=!0;else{var X=r(m);X!==null&&me(T,X.startTime-V),ae=!1}return ae}finally{g=null,v=P,y=!1}}var I=!1,F=null,z=-1,H=5,J=-1;function Y(){return!(e.unstable_now()-JL||125q?(L.sortIndex=P,t(m,L),r(d)===null&&L===r(m)&&(b?(N(z),z=-1):b=!0,me(T,P-q))):(L.sortIndex=Q,t(d,L),C||y||(C=!0,re(_))),L},e.unstable_shouldYield=Y,e.unstable_wrapCallback=function(L){var V=v;return function(){var P=v;v=V;try{return L.apply(this,arguments)}finally{v=P}}}})(N1)),N1}var c5;function wI(){return c5||(c5=1,k1.exports=CI()),k1.exports}var u5;function jI(){if(u5)return nr;u5=1;var e=Di(),t=wI();function r(o){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+o,h=1;h"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,m=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,p={},g={};function v(o){return d.call(g,o)?!0:d.call(p,o)?!1:m.test(o)?g[o]=!0:(p[o]=!0,!1)}function y(o,c,h,x){if(h!==null&&h.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return x?!1:h!==null?!h.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function C(o,c,h,x){if(c===null||typeof c>"u"||y(o,c,h,x))return!0;if(x)return!1;if(h!==null)switch(h.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function b(o,c,h,x,j,S,A){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=x,this.attributeNamespace=j,this.mustUseProperty=h,this.propertyName=o,this.type=c,this.sanitizeURL=S,this.removeEmptyString=A}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){w[o]=new b(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var c=o[0];w[c]=new b(c,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){w[o]=new b(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){w[o]=new b(o,2,!1,o,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(o){w[o]=new b(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){w[o]=new b(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){w[o]=new b(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){w[o]=new b(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){w[o]=new b(o,5,!1,o.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function k(o){return o[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(o){var c=o.replace(N,k);w[c]=new b(c,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var c=o.replace(N,k);w[c]=new b(c,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var c=o.replace(N,k);w[c]=new b(c,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){w[o]=new b(o,1,!1,o.toLowerCase(),null,!1,!1)}),w.xlinkHref=new b("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){w[o]=new b(o,1,!1,o.toLowerCase(),null,!0,!0)});function E(o,c,h,x){var j=w.hasOwnProperty(c)?w[c]:null;(j!==null?j.type!==0:x||!(2M||j[A]!==S[M]){var $=` `+j[A].replace(" at new "," at ");return o.displayName&&$.includes("")&&($=$.replace("",o.displayName)),$}while(1<=A&&0<=M);break}}}finally{ae=!1,Error.prepareStackTrace=h}return(o=o?o.displayName||o.name:"")?Q(o):""}function fe(o){switch(o.tag){case 5:return Q(o.type);case 16:return Q("Lazy");case 13:return Q("Suspense");case 19:return Q("SuspenseList");case 0:case 2:case 15:return o=X(o.type,!1),o;case 11:return o=X(o.type.render,!1),o;case 1:return o=X(o.type,!0),o;default:return""}}function he(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case F:return"Fragment";case I:return"Portal";case H:return"Profiler";case z:return"StrictMode";case W:return"Suspense";case U:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case Y:return(o.displayName||"Context")+".Consumer";case J:return(o._context.displayName||"Context")+".Provider";case B:var c=o.render;return o=o.displayName,o||(o=c.displayName||c.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case Z:return c=o.displayName||null,c!==null?c:he(o.type)||"Memo";case re:c=o._payload,o=o._init;try{return he(o(c))}catch{}}return null}function se(o){var c=o.type;switch(o.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=c.render,o=o.displayName||o.name||"",c.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return he(c);case 8:return c===z?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function le(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Ae(o){var c=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function Te(o){var c=Ae(o)?"checked":"value",h=Object.getOwnPropertyDescriptor(o.constructor.prototype,c),x=""+o[c];if(!o.hasOwnProperty(c)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var j=h.get,S=h.set;return Object.defineProperty(o,c,{configurable:!0,get:function(){return j.call(this)},set:function(A){x=""+A,S.call(this,A)}}),Object.defineProperty(o,c,{enumerable:h.enumerable}),{getValue:function(){return x},setValue:function(A){x=""+A},stopTracking:function(){o._valueTracker=null,delete o[c]}}}}function Ue(o){o._valueTracker||(o._valueTracker=Te(o))}function Ze(o){if(!o)return!1;var c=o._valueTracker;if(!c)return!0;var h=c.getValue(),x="";return o&&(x=Ae(o)?o.checked?"true":"false":o.value),o=x,o!==h?(c.setValue(o),!0):!1}function ct(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function ht(o,c){var h=c.checked;return P({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??o._wrapperState.initialChecked})}function Tt(o,c){var h=c.defaultValue==null?"":c.defaultValue,x=c.checked!=null?c.checked:c.defaultChecked;h=le(c.value!=null?c.value:h),o._wrapperState={initialChecked:x,initialValue:h,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function xe(o,c){c=c.checked,c!=null&&E(o,"checked",c,!1)}function Fe(o,c){xe(o,c);var h=le(c.value),x=c.type;if(h!=null)x==="number"?(h===0&&o.value===""||o.value!=h)&&(o.value=""+h):o.value!==""+h&&(o.value=""+h);else if(x==="submit"||x==="reset"){o.removeAttribute("value");return}c.hasOwnProperty("value")?mt(o,c.type,h):c.hasOwnProperty("defaultValue")&&mt(o,c.type,le(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(o.defaultChecked=!!c.defaultChecked)}function st(o,c,h){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var x=c.type;if(!(x!=="submit"&&x!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+o._wrapperState.initialValue,h||c===o.value||(o.value=c),o.defaultValue=c}h=o.name,h!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,h!==""&&(o.name=h)}function mt(o,c,h){(c!=="number"||ct(o.ownerDocument)!==o)&&(h==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+h&&(o.defaultValue=""+h))}var At=Array.isArray;function Qe(o,c,h,x){if(o=o.options,c){c={};for(var j=0;j"+c.valueOf().toString()+"",c=$t.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;c.firstChild;)o.appendChild(c.firstChild)}});function As(o,c){if(c){var h=o.firstChild;if(h&&h===o.lastChild&&h.nodeType===3){h.nodeValue=c;return}}o.textContent=c}var Ka={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},wl=["Webkit","ms","Moz","O"];Object.keys(Ka).forEach(function(o){wl.forEach(function(c){c=c+o.charAt(0).toUpperCase()+o.substring(1),Ka[c]=Ka[o]})});function vy(o,c,h){return c==null||typeof c=="boolean"||c===""?"":h||typeof c!="number"||c===0||Ka.hasOwnProperty(o)&&Ka[o]?(""+c).trim():c+"px"}function yy(o,c){o=o.style;for(var h in c)if(c.hasOwnProperty(h)){var x=h.indexOf("--")===0,j=vy(h,c[h],x);h==="float"&&(h="cssFloat"),x?o.setProperty(h,j):o[h]=j}}var wP=P({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Mh(o,c){if(c){if(wP[o]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(r(137,o));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(r(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(r(61))}if(c.style!=null&&typeof c.style!="object")throw Error(r(62))}}function Lh(o,c){if(o.indexOf("-")===-1)return typeof c.is=="string";switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Rh=null;function Oh(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var Fh=null,Ki=null,Gi=null;function by(o){if(o=zl(o)){if(typeof Fh!="function")throw Error(r(280));var c=o.stateNode;c&&(c=td(c),Fh(o.stateNode,o.type,c))}}function Cy(o){Ki?Gi?Gi.push(o):Gi=[o]:Ki=o}function wy(){if(Ki){var o=Ki,c=Gi;if(Gi=Ki=null,by(o),c)for(o=0;o>>=0,o===0?32:31-(_P(o)/MP|0)|0}var Ou=64,Fu=4194304;function Nl(o){switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function Bu(o,c){var h=o.pendingLanes;if(h===0)return 0;var x=0,j=o.suspendedLanes,S=o.pingedLanes,A=h&268435455;if(A!==0){var M=A&~j;M!==0?x=Nl(M):(S&=A,S!==0&&(x=Nl(S)))}else A=h&~j,A!==0?x=Nl(A):S!==0&&(x=Nl(S));if(x===0)return 0;if(c!==0&&c!==x&&(c&j)===0&&(j=x&-x,S=c&-c,j>=S||j===16&&(S&4194240)!==0))return c;if((x&4)!==0&&(x|=h&16),c=o.entangledLanes,c!==0)for(o=o.entanglements,c&=x;0h;h++)c.push(o);return c}function El(o,c,h){o.pendingLanes|=c,c!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,c=31-Ur(c),o[c]=h}function FP(o,c){var h=o.pendingLanes&~c;o.pendingLanes=c,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=c,o.mutableReadLanes&=c,o.entangledLanes&=c,c=o.entanglements;var x=o.eventTimes;for(o=o.expirationTimes;0=Ll),Zy=" ",Qy=!1;function Jy(o,c){switch(o){case"keyup":return mT.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xy(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var Zi=!1;function hT(o,c){switch(o){case"compositionend":return Xy(c);case"keypress":return c.which!==32?null:(Qy=!0,Zy);case"textInput":return o=c.data,o===Zy&&Qy?null:o;default:return null}}function pT(o,c){if(Zi)return o==="compositionend"||!np&&Jy(o,c)?(o=zy(),zu=Zh=sa=null,Zi=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1=c)return{node:h,offset:c-o};o=x}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=i3(h)}}function l3(o,c){return o&&c?o===c?!0:o&&o.nodeType===3?!1:c&&c.nodeType===3?l3(o,c.parentNode):"contains"in o?o.contains(c):o.compareDocumentPosition?!!(o.compareDocumentPosition(c)&16):!1:!1}function c3(){for(var o=window,c=ct();c instanceof o.HTMLIFrameElement;){try{var h=typeof c.contentWindow.location.href=="string"}catch{h=!1}if(h)o=c.contentWindow;else break;c=ct(o.document)}return c}function ap(o){var c=o&&o.nodeName&&o.nodeName.toLowerCase();return c&&(c==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||c==="textarea"||o.contentEditable==="true")}function ST(o){var c=c3(),h=o.focusedElem,x=o.selectionRange;if(c!==h&&h&&h.ownerDocument&&l3(h.ownerDocument.documentElement,h)){if(x!==null&&ap(h)){if(c=x.start,o=x.end,o===void 0&&(o=c),"selectionStart"in h)h.selectionStart=c,h.selectionEnd=Math.min(o,h.value.length);else if(o=(c=h.ownerDocument||document)&&c.defaultView||window,o.getSelection){o=o.getSelection();var j=h.textContent.length,S=Math.min(x.start,j);x=x.end===void 0?S:Math.min(x.end,j),!o.extend&&S>x&&(j=x,x=S,S=j),j=o3(h,S);var A=o3(h,x);j&&A&&(o.rangeCount!==1||o.anchorNode!==j.node||o.anchorOffset!==j.offset||o.focusNode!==A.node||o.focusOffset!==A.offset)&&(c=c.createRange(),c.setStart(j.node,j.offset),o.removeAllRanges(),S>x?(o.addRange(c),o.extend(A.node,A.offset)):(c.setEnd(A.node,A.offset),o.addRange(c)))}}for(c=[],o=h;o=o.parentNode;)o.nodeType===1&&c.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h=document.documentMode,Qi=null,ip=null,Bl=null,op=!1;function u3(o,c,h){var x=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;op||Qi==null||Qi!==ct(x)||(x=Qi,"selectionStart"in x&&ap(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),Bl&&Fl(Bl,x)||(Bl=x,x=Ju(ip,"onSelect"),0no||(o.current=yp[no],yp[no]=null,no--)}function Lt(o,c){no++,yp[no]=o.current,o.current=c}var la={},Pn=oa(la),Qn=oa(!1),Ya=la;function ro(o,c){var h=o.type.contextTypes;if(!h)return la;var x=o.stateNode;if(x&&x.__reactInternalMemoizedUnmaskedChildContext===c)return x.__reactInternalMemoizedMaskedChildContext;var j={},S;for(S in h)j[S]=c[S];return x&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=c,o.__reactInternalMemoizedMaskedChildContext=j),j}function Jn(o){return o=o.childContextTypes,o!=null}function nd(){Ft(Qn),Ft(Pn)}function k3(o,c,h){if(Pn.current!==la)throw Error(r(168));Lt(Pn,c),Lt(Qn,h)}function N3(o,c,h){var x=o.stateNode;if(c=c.childContextTypes,typeof x.getChildContext!="function")return h;x=x.getChildContext();for(var j in x)if(!(j in c))throw Error(r(108,se(o)||"Unknown",j));return P({},h,x)}function rd(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||la,Ya=Pn.current,Lt(Pn,o),Lt(Qn,Qn.current),!0}function E3(o,c,h){var x=o.stateNode;if(!x)throw Error(r(169));h?(o=N3(o,c,Ya),x.__reactInternalMemoizedMergedChildContext=o,Ft(Qn),Ft(Pn),Lt(Pn,o)):Ft(Qn),Lt(Qn,h)}var Ts=null,sd=!1,bp=!1;function A3(o){Ts===null?Ts=[o]:Ts.push(o)}function RT(o){sd=!0,A3(o)}function ca(){if(!bp&&Ts!==null){bp=!0;var o=0,c=It;try{var h=Ts;for(It=1;o>=A,j-=A,Is=1<<32-Ur(c)+j|h<nt?(gn=Ye,Ye=null):gn=Ye.sibling;var St=pe(ee,Ye,ne[nt],Ce);if(St===null){Ye===null&&(Ye=gn);break}o&&Ye&&St.alternate===null&&c(ee,Ye),G=S(St,G,nt),qe===null?Ve=St:qe.sibling=St,qe=St,Ye=gn}if(nt===ne.length)return h(ee,Ye),Ht&&Qa(ee,nt),Ve;if(Ye===null){for(;ntnt?(gn=Ye,Ye=null):gn=Ye.sibling;var va=pe(ee,Ye,St.value,Ce);if(va===null){Ye===null&&(Ye=gn);break}o&&Ye&&va.alternate===null&&c(ee,Ye),G=S(va,G,nt),qe===null?Ve=va:qe.sibling=va,qe=va,Ye=gn}if(St.done)return h(ee,Ye),Ht&&Qa(ee,nt),Ve;if(Ye===null){for(;!St.done;nt++,St=ne.next())St=ve(ee,St.value,Ce),St!==null&&(G=S(St,G,nt),qe===null?Ve=St:qe.sibling=St,qe=St);return Ht&&Qa(ee,nt),Ve}for(Ye=x(ee,Ye);!St.done;nt++,St=ne.next())St=_e(Ye,ee,nt,St.value,Ce),St!==null&&(o&&St.alternate!==null&&Ye.delete(St.key===null?nt:St.key),G=S(St,G,nt),qe===null?Ve=St:qe.sibling=St,qe=St);return o&&Ye.forEach(function(gI){return c(ee,gI)}),Ht&&Qa(ee,nt),Ve}function Xt(ee,G,ne,Ce){if(typeof ne=="object"&&ne!==null&&ne.type===F&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case _:e:{for(var Ve=ne.key,qe=G;qe!==null;){if(qe.key===Ve){if(Ve=ne.type,Ve===F){if(qe.tag===7){h(ee,qe.sibling),G=j(qe,ne.props.children),G.return=ee,ee=G;break e}}else if(qe.elementType===Ve||typeof Ve=="object"&&Ve!==null&&Ve.$$typeof===re&&$3(Ve)===qe.type){h(ee,qe.sibling),G=j(qe,ne.props),G.ref=Wl(ee,qe,ne),G.return=ee,ee=G;break e}h(ee,qe);break}else c(ee,qe);qe=qe.sibling}ne.type===F?(G=ai(ne.props.children,ee.mode,Ce,ne.key),G.return=ee,ee=G):(Ce=Dd(ne.type,ne.key,ne.props,null,ee.mode,Ce),Ce.ref=Wl(ee,G,ne),Ce.return=ee,ee=Ce)}return A(ee);case I:e:{for(qe=ne.key;G!==null;){if(G.key===qe)if(G.tag===4&&G.stateNode.containerInfo===ne.containerInfo&&G.stateNode.implementation===ne.implementation){h(ee,G.sibling),G=j(G,ne.children||[]),G.return=ee,ee=G;break e}else{h(ee,G);break}else c(ee,G);G=G.sibling}G=x1(ne,ee.mode,Ce),G.return=ee,ee=G}return A(ee);case re:return qe=ne._init,Xt(ee,G,qe(ne._payload),Ce)}if(At(ne))return Le(ee,G,ne,Ce);if(V(ne))return Be(ee,G,ne,Ce);fd(ee,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"?(ne=""+ne,G!==null&&G.tag===6?(h(ee,G.sibling),G=j(G,ne),G.return=ee,ee=G):(h(ee,G),G=g1(ne,ee.mode,Ce),G.return=ee,ee=G),A(ee)):h(ee,G)}return Xt}var co=H3(!0),z3=H3(!1),Kl={},us=oa(Kl),Gl=oa(Kl),ql=oa(Kl);function Xa(o){if(o===Kl)throw Error(r(174));return o}function Mp(o,c){switch(Lt(ql,c),Lt(Gl,o),Lt(us,Kl),o=c.nodeType,o){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:vn(null,"");break;default:o=o===8?c.parentNode:c,c=o.namespaceURI||null,o=o.tagName,c=vn(c,o)}Ft(us),Lt(us,c)}function uo(){Ft(us),Ft(Gl),Ft(ql)}function W3(o){Xa(ql.current);var c=Xa(us.current),h=vn(c,o.type);c!==h&&(Lt(Gl,o),Lt(us,h))}function Lp(o){Gl.current===o&&(Ft(us),Ft(Gl))}var Wt=oa(0);function hd(o){for(var c=o;c!==null;){if(c.tag===13){var h=c.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===o)break;for(;c.sibling===null;){if(c.return===null||c.return===o)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Rp=[];function Op(){for(var o=0;oh?h:4,o(!0);var x=Fp.transition;Fp.transition={};try{o(!1),c()}finally{It=h,Fp.transition=x}}function c4(){return kr().memoizedState}function UT(o,c,h){var x=pa(o);if(h={lane:x,action:h,hasEagerState:!1,eagerState:null,next:null},u4(o))d4(c,h);else if(h=M3(o,c,h,x),h!==null){var j=Vn();Kr(h,o,x,j),m4(h,c,x)}}function VT(o,c,h){var x=pa(o),j={lane:x,action:h,hasEagerState:!1,eagerState:null,next:null};if(u4(o))d4(c,j);else{var S=o.alternate;if(o.lanes===0&&(S===null||S.lanes===0)&&(S=c.lastRenderedReducer,S!==null))try{var A=c.lastRenderedState,M=S(A,h);if(j.hasEagerState=!0,j.eagerState=M,Vr(M,A)){var $=c.interleaved;$===null?(j.next=j,Tp(c)):(j.next=$.next,$.next=j),c.interleaved=j;return}}catch{}h=M3(o,c,j,x),h!==null&&(j=Vn(),Kr(h,o,x,j),m4(h,c,x))}}function u4(o){var c=o.alternate;return o===Kt||c!==null&&c===Kt}function d4(o,c){Yl=gd=!0;var h=o.pending;h===null?c.next=c:(c.next=h.next,h.next=c),o.pending=c}function m4(o,c,h){if((h&4194240)!==0){var x=c.lanes;x&=o.pendingLanes,h|=x,c.lanes=h,Wh(o,h)}}var yd={readContext:Sr,useCallback:Tn,useContext:Tn,useEffect:Tn,useImperativeHandle:Tn,useInsertionEffect:Tn,useLayoutEffect:Tn,useMemo:Tn,useReducer:Tn,useRef:Tn,useState:Tn,useDebugValue:Tn,useDeferredValue:Tn,useTransition:Tn,useMutableSource:Tn,useSyncExternalStore:Tn,useId:Tn,unstable_isNewReconciler:!1},$T={readContext:Sr,useCallback:function(o,c){return ds().memoizedState=[o,c===void 0?null:c],o},useContext:Sr,useEffect:t4,useImperativeHandle:function(o,c,h){return h=h!=null?h.concat([o]):null,xd(4194308,4,s4.bind(null,c,o),h)},useLayoutEffect:function(o,c){return xd(4194308,4,o,c)},useInsertionEffect:function(o,c){return xd(4,2,o,c)},useMemo:function(o,c){var h=ds();return c=c===void 0?null:c,o=o(),h.memoizedState=[o,c],o},useReducer:function(o,c,h){var x=ds();return c=h!==void 0?h(c):c,x.memoizedState=x.baseState=c,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:c},x.queue=o,o=o.dispatch=UT.bind(null,Kt,o),[x.memoizedState,o]},useRef:function(o){var c=ds();return o={current:o},c.memoizedState=o},useState:X3,useDebugValue:Wp,useDeferredValue:function(o){return ds().memoizedState=o},useTransition:function(){var o=X3(!1),c=o[0];return o=BT.bind(null,o[1]),ds().memoizedState=o,[c,o]},useMutableSource:function(){},useSyncExternalStore:function(o,c,h){var x=Kt,j=ds();if(Ht){if(h===void 0)throw Error(r(407));h=h()}else{if(h=c(),pn===null)throw Error(r(349));(ei&30)!==0||q3(x,c,h)}j.memoizedState=h;var S={value:h,getSnapshot:c};return j.queue=S,t4(Z3.bind(null,x,S,o),[o]),x.flags|=2048,Jl(9,Y3.bind(null,x,S,h,c),void 0,null),h},useId:function(){var o=ds(),c=pn.identifierPrefix;if(Ht){var h=Ds,x=Is;h=(x&~(1<<32-Ur(x)-1)).toString(32)+h,c=":"+c+"R"+h,h=Zl++,0<\/script>",o=o.removeChild(o.firstChild)):typeof x.is=="string"?o=A.createElement(h,{is:x.is}):(o=A.createElement(h),h==="select"&&(A=o,x.multiple?A.multiple=!0:x.size&&(A.size=x.size))):o=A.createElementNS(o,h),o[cs]=c,o[Hl]=x,P4(o,c,!1,!1),c.stateNode=o;e:{switch(A=Lh(h,x),h){case"dialog":Ot("cancel",o),Ot("close",o),j=x;break;case"iframe":case"object":case"embed":Ot("load",o),j=x;break;case"video":case"audio":for(j=0;jpo&&(c.flags|=128,x=!0,Xl(S,!1),c.lanes=4194304)}else{if(!x)if(o=hd(A),o!==null){if(c.flags|=128,x=!0,h=o.updateQueue,h!==null&&(c.updateQueue=h,c.flags|=4),Xl(S,!0),S.tail===null&&S.tailMode==="hidden"&&!A.alternate&&!Ht)return In(c),null}else 2*Jt()-S.renderingStartTime>po&&h!==1073741824&&(c.flags|=128,x=!0,Xl(S,!1),c.lanes=4194304);S.isBackwards?(A.sibling=c.child,c.child=A):(h=S.last,h!==null?h.sibling=A:c.child=A,S.last=A)}return S.tail!==null?(c=S.tail,S.rendering=c,S.tail=c.sibling,S.renderingStartTime=Jt(),c.sibling=null,h=Wt.current,Lt(Wt,x?h&1|2:h&1),c):(In(c),null);case 22:case 23:return f1(),x=c.memoizedState!==null,o!==null&&o.memoizedState!==null!==x&&(c.flags|=8192),x&&(c.mode&1)!==0?(hr&1073741824)!==0&&(In(c),c.subtreeFlags&6&&(c.flags|=8192)):In(c),null;case 24:return null;case 25:return null}throw Error(r(156,c.tag))}function ZT(o,c){switch(wp(c),c.tag){case 1:return Jn(c.type)&&nd(),o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 3:return uo(),Ft(Qn),Ft(Pn),Op(),o=c.flags,(o&65536)!==0&&(o&128)===0?(c.flags=o&-65537|128,c):null;case 5:return Lp(c),null;case 13:if(Ft(Wt),o=c.memoizedState,o!==null&&o.dehydrated!==null){if(c.alternate===null)throw Error(r(340));io()}return o=c.flags,o&65536?(c.flags=o&-65537|128,c):null;case 19:return Ft(Wt),null;case 4:return uo(),null;case 10:return Ap(c.type._context),null;case 22:case 23:return f1(),null;case 24:return null;default:return null}}var wd=!1,Dn=!1,QT=typeof WeakSet=="function"?WeakSet:Set,Me=null;function fo(o,c){var h=o.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(x){Zt(o,c,x)}else h.current=null}function t1(o,c,h){try{h()}catch(x){Zt(o,c,x)}}var D4=!1;function JT(o,c){if(fp=$u,o=c3(),ap(o)){if("selectionStart"in o)var h={start:o.selectionStart,end:o.selectionEnd};else e:{h=(h=o.ownerDocument)&&h.defaultView||window;var x=h.getSelection&&h.getSelection();if(x&&x.rangeCount!==0){h=x.anchorNode;var j=x.anchorOffset,S=x.focusNode;x=x.focusOffset;try{h.nodeType,S.nodeType}catch{h=null;break e}var A=0,M=-1,$=-1,ie=0,ge=0,ve=o,pe=null;t:for(;;){for(var _e;ve!==h||j!==0&&ve.nodeType!==3||(M=A+j),ve!==S||x!==0&&ve.nodeType!==3||($=A+x),ve.nodeType===3&&(A+=ve.nodeValue.length),(_e=ve.firstChild)!==null;)pe=ve,ve=_e;for(;;){if(ve===o)break t;if(pe===h&&++ie===j&&(M=A),pe===S&&++ge===x&&($=A),(_e=ve.nextSibling)!==null)break;ve=pe,pe=ve.parentNode}ve=_e}h=M===-1||$===-1?null:{start:M,end:$}}else h=null}h=h||{start:0,end:0}}else h=null;for(hp={focusedElem:o,selectionRange:h},$u=!1,Me=c;Me!==null;)if(c=Me,o=c.child,(c.subtreeFlags&1028)!==0&&o!==null)o.return=c,Me=o;else for(;Me!==null;){c=Me;try{var Le=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Le!==null){var Be=Le.memoizedProps,Xt=Le.memoizedState,ee=c.stateNode,G=ee.getSnapshotBeforeUpdate(c.elementType===c.type?Be:Hr(c.type,Be),Xt);ee.__reactInternalSnapshotBeforeUpdate=G}break;case 3:var ne=c.stateNode.containerInfo;ne.nodeType===1?ne.textContent="":ne.nodeType===9&&ne.documentElement&&ne.removeChild(ne.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(Ce){Zt(c,c.return,Ce)}if(o=c.sibling,o!==null){o.return=c.return,Me=o;break}Me=c.return}return Le=D4,D4=!1,Le}function ec(o,c,h){var x=c.updateQueue;if(x=x!==null?x.lastEffect:null,x!==null){var j=x=x.next;do{if((j.tag&o)===o){var S=j.destroy;j.destroy=void 0,S!==void 0&&t1(c,h,S)}j=j.next}while(j!==x)}}function jd(o,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var h=c=c.next;do{if((h.tag&o)===o){var x=h.create;h.destroy=x()}h=h.next}while(h!==c)}}function n1(o){var c=o.ref;if(c!==null){var h=o.stateNode;o.tag,o=h,typeof c=="function"?c(o):c.current=o}}function _4(o){var c=o.alternate;c!==null&&(o.alternate=null,_4(c)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(c=o.stateNode,c!==null&&(delete c[cs],delete c[Hl],delete c[vp],delete c[MT],delete c[LT])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function M4(o){return o.tag===5||o.tag===3||o.tag===4}function L4(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||M4(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function r1(o,c,h){var x=o.tag;if(x===5||x===6)o=o.stateNode,c?h.nodeType===8?h.parentNode.insertBefore(o,c):h.insertBefore(o,c):(h.nodeType===8?(c=h.parentNode,c.insertBefore(o,h)):(c=h,c.appendChild(o)),h=h._reactRootContainer,h!=null||c.onclick!==null||(c.onclick=ed));else if(x!==4&&(o=o.child,o!==null))for(r1(o,c,h),o=o.sibling;o!==null;)r1(o,c,h),o=o.sibling}function s1(o,c,h){var x=o.tag;if(x===5||x===6)o=o.stateNode,c?h.insertBefore(o,c):h.appendChild(o);else if(x!==4&&(o=o.child,o!==null))for(s1(o,c,h),o=o.sibling;o!==null;)s1(o,c,h),o=o.sibling}var yn=null,zr=!1;function ma(o,c,h){for(h=h.child;h!==null;)R4(o,c,h),h=h.sibling}function R4(o,c,h){if(ls&&typeof ls.onCommitFiberUnmount=="function")try{ls.onCommitFiberUnmount(Ru,h)}catch{}switch(h.tag){case 5:Dn||fo(h,c);case 6:var x=yn,j=zr;yn=null,ma(o,c,h),yn=x,zr=j,yn!==null&&(zr?(o=yn,h=h.stateNode,o.nodeType===8?o.parentNode.removeChild(h):o.removeChild(h)):yn.removeChild(h.stateNode));break;case 18:yn!==null&&(zr?(o=yn,h=h.stateNode,o.nodeType===8?xp(o.parentNode,h):o.nodeType===1&&xp(o,h),Dl(o)):xp(yn,h.stateNode));break;case 4:x=yn,j=zr,yn=h.stateNode.containerInfo,zr=!0,ma(o,c,h),yn=x,zr=j;break;case 0:case 11:case 14:case 15:if(!Dn&&(x=h.updateQueue,x!==null&&(x=x.lastEffect,x!==null))){j=x=x.next;do{var S=j,A=S.destroy;S=S.tag,A!==void 0&&((S&2)!==0||(S&4)!==0)&&t1(h,c,A),j=j.next}while(j!==x)}ma(o,c,h);break;case 1:if(!Dn&&(fo(h,c),x=h.stateNode,typeof x.componentWillUnmount=="function"))try{x.props=h.memoizedProps,x.state=h.memoizedState,x.componentWillUnmount()}catch(M){Zt(h,c,M)}ma(o,c,h);break;case 21:ma(o,c,h);break;case 22:h.mode&1?(Dn=(x=Dn)||h.memoizedState!==null,ma(o,c,h),Dn=x):ma(o,c,h);break;default:ma(o,c,h)}}function O4(o){var c=o.updateQueue;if(c!==null){o.updateQueue=null;var h=o.stateNode;h===null&&(h=o.stateNode=new QT),c.forEach(function(x){var j=oI.bind(null,o,x);h.has(x)||(h.add(x),x.then(j,j))})}}function Wr(o,c){var h=c.deletions;if(h!==null)for(var x=0;xj&&(j=A),x&=~S}if(x=j,x=Jt()-x,x=(120>x?120:480>x?480:1080>x?1080:1920>x?1920:3e3>x?3e3:4320>x?4320:1960*eI(x/1960))-x,10o?16:o,ha===null)var x=!1;else{if(o=ha,ha=null,Ad=0,(jt&6)!==0)throw Error(r(331));var j=jt;for(jt|=4,Me=o.current;Me!==null;){var S=Me,A=S.child;if((Me.flags&16)!==0){var M=S.deletions;if(M!==null){for(var $=0;$Jt()-o1?ri(o,0):i1|=h),tr(o,c)}function Z4(o,c){c===0&&((o.mode&1)===0?c=1:(c=Fu,Fu<<=1,(Fu&130023424)===0&&(Fu=4194304)));var h=Vn();o=_s(o,c),o!==null&&(El(o,c,h),tr(o,h))}function iI(o){var c=o.memoizedState,h=0;c!==null&&(h=c.retryLane),Z4(o,h)}function oI(o,c){var h=0;switch(o.tag){case 13:var x=o.stateNode,j=o.memoizedState;j!==null&&(h=j.retryLane);break;case 19:x=o.stateNode;break;default:throw Error(r(314))}x!==null&&x.delete(c),Z4(o,h)}var Q4;Q4=function(o,c,h){if(o!==null)if(o.memoizedProps!==c.pendingProps||Qn.current)Xn=!0;else{if((o.lanes&h)===0&&(c.flags&128)===0)return Xn=!1,qT(o,c,h);Xn=(o.flags&131072)!==0}else Xn=!1,Ht&&(c.flags&1048576)!==0&&P3(c,id,c.index);switch(c.lanes=0,c.tag){case 2:var x=c.type;Cd(o,c),o=c.pendingProps;var j=ro(c,Pn.current);lo(c,h),j=Up(null,c,x,o,j,h);var S=Vp();return c.flags|=1,typeof j=="object"&&j!==null&&typeof j.render=="function"&&j.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Jn(x)?(S=!0,rd(c)):S=!1,c.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,Ip(c),j.updater=md,c.stateNode=j,j._reactInternals=c,_p(c,x,o,h),c=Yp(null,c,x,!0,S,h)):(c.tag=0,Ht&&S&&Cp(c),Un(null,c,j,h),c=c.child),c;case 16:x=c.elementType;e:{switch(Cd(o,c),o=c.pendingProps,j=x._init,x=j(x._payload),c.type=x,j=c.tag=cI(x),o=Hr(x,o),j){case 0:c=qp(null,c,x,o,h);break e;case 1:c=j4(null,c,x,o,h);break e;case 11:c=v4(null,c,x,o,h);break e;case 14:c=y4(null,c,x,Hr(x.type,o),h);break e}throw Error(r(306,x,""))}return c;case 0:return x=c.type,j=c.pendingProps,j=c.elementType===x?j:Hr(x,j),qp(o,c,x,j,h);case 1:return x=c.type,j=c.pendingProps,j=c.elementType===x?j:Hr(x,j),j4(o,c,x,j,h);case 3:e:{if(S4(c),o===null)throw Error(r(387));x=c.pendingProps,S=c.memoizedState,j=S.element,L3(o,c),dd(c,x,null,h);var A=c.memoizedState;if(x=A.element,S.isDehydrated)if(S={element:x,isDehydrated:!1,cache:A.cache,pendingSuspenseBoundaries:A.pendingSuspenseBoundaries,transitions:A.transitions},c.updateQueue.baseState=S,c.memoizedState=S,c.flags&256){j=mo(Error(r(423)),c),c=k4(o,c,x,h,j);break e}else if(x!==j){j=mo(Error(r(424)),c),c=k4(o,c,x,h,j);break e}else for(fr=ia(c.stateNode.containerInfo.firstChild),mr=c,Ht=!0,$r=null,h=z3(c,null,x,h),c.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(io(),x===j){c=Ls(o,c,h);break e}Un(o,c,x,h)}c=c.child}return c;case 5:return W3(c),o===null&&Sp(c),x=c.type,j=c.pendingProps,S=o!==null?o.memoizedProps:null,A=j.children,pp(x,j)?A=null:S!==null&&pp(x,S)&&(c.flags|=32),w4(o,c),Un(o,c,A,h),c.child;case 6:return o===null&&Sp(c),null;case 13:return N4(o,c,h);case 4:return Mp(c,c.stateNode.containerInfo),x=c.pendingProps,o===null?c.child=co(c,null,x,h):Un(o,c,x,h),c.child;case 11:return x=c.type,j=c.pendingProps,j=c.elementType===x?j:Hr(x,j),v4(o,c,x,j,h);case 7:return Un(o,c,c.pendingProps,h),c.child;case 8:return Un(o,c,c.pendingProps.children,h),c.child;case 12:return Un(o,c,c.pendingProps.children,h),c.child;case 10:e:{if(x=c.type._context,j=c.pendingProps,S=c.memoizedProps,A=j.value,Lt(ld,x._currentValue),x._currentValue=A,S!==null)if(Vr(S.value,A)){if(S.children===j.children&&!Qn.current){c=Ls(o,c,h);break e}}else for(S=c.child,S!==null&&(S.return=c);S!==null;){var M=S.dependencies;if(M!==null){A=S.child;for(var $=M.firstContext;$!==null;){if($.context===x){if(S.tag===1){$=Ms(-1,h&-h),$.tag=2;var ie=S.updateQueue;if(ie!==null){ie=ie.shared;var ge=ie.pending;ge===null?$.next=$:($.next=ge.next,ge.next=$),ie.pending=$}}S.lanes|=h,$=S.alternate,$!==null&&($.lanes|=h),Pp(S.return,h,c),M.lanes|=h;break}$=$.next}}else if(S.tag===10)A=S.type===c.type?null:S.child;else if(S.tag===18){if(A=S.return,A===null)throw Error(r(341));A.lanes|=h,M=A.alternate,M!==null&&(M.lanes|=h),Pp(A,h,c),A=S.sibling}else A=S.child;if(A!==null)A.return=S;else for(A=S;A!==null;){if(A===c){A=null;break}if(S=A.sibling,S!==null){S.return=A.return,A=S;break}A=A.return}S=A}Un(o,c,j.children,h),c=c.child}return c;case 9:return j=c.type,x=c.pendingProps.children,lo(c,h),j=Sr(j),x=x(j),c.flags|=1,Un(o,c,x,h),c.child;case 14:return x=c.type,j=Hr(x,c.pendingProps),j=Hr(x.type,j),y4(o,c,x,j,h);case 15:return b4(o,c,c.type,c.pendingProps,h);case 17:return x=c.type,j=c.pendingProps,j=c.elementType===x?j:Hr(x,j),Cd(o,c),c.tag=1,Jn(x)?(o=!0,rd(c)):o=!1,lo(c,h),U3(c,x,j),_p(c,x,j,h),Yp(null,c,x,!0,o,h);case 19:return A4(o,c,h);case 22:return C4(o,c,h)}throw Error(r(156,c.tag))};function J4(o,c){return Ty(o,c)}function lI(o,c,h,x){this.tag=o,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Er(o,c,h,x){return new lI(o,c,h,x)}function p1(o){return o=o.prototype,!(!o||!o.isReactComponent)}function cI(o){if(typeof o=="function")return p1(o)?1:0;if(o!=null){if(o=o.$$typeof,o===B)return 11;if(o===Z)return 14}return 2}function xa(o,c){var h=o.alternate;return h===null?(h=Er(o.tag,c,o.key,o.mode),h.elementType=o.elementType,h.type=o.type,h.stateNode=o.stateNode,h.alternate=o,o.alternate=h):(h.pendingProps=c,h.type=o.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=o.flags&14680064,h.childLanes=o.childLanes,h.lanes=o.lanes,h.child=o.child,h.memoizedProps=o.memoizedProps,h.memoizedState=o.memoizedState,h.updateQueue=o.updateQueue,c=o.dependencies,h.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},h.sibling=o.sibling,h.index=o.index,h.ref=o.ref,h}function Dd(o,c,h,x,j,S){var A=2;if(x=o,typeof o=="function")p1(o)&&(A=1);else if(typeof o=="string")A=5;else e:switch(o){case F:return ai(h.children,j,S,c);case z:A=8,j|=8;break;case H:return o=Er(12,h,c,j|2),o.elementType=H,o.lanes=S,o;case W:return o=Er(13,h,c,j),o.elementType=W,o.lanes=S,o;case U:return o=Er(19,h,c,j),o.elementType=U,o.lanes=S,o;case me:return _d(h,j,S,c);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case J:A=10;break e;case Y:A=9;break e;case B:A=11;break e;case Z:A=14;break e;case re:A=16,x=null;break e}throw Error(r(130,o==null?o:typeof o,""))}return c=Er(A,h,c,j),c.elementType=o,c.type=x,c.lanes=S,c}function ai(o,c,h,x){return o=Er(7,o,x,c),o.lanes=h,o}function _d(o,c,h,x){return o=Er(22,o,x,c),o.elementType=me,o.lanes=h,o.stateNode={isHidden:!1},o}function g1(o,c,h){return o=Er(6,o,null,c),o.lanes=h,o}function x1(o,c,h){return c=Er(4,o.children!==null?o.children:[],o.key,c),c.lanes=h,c.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},c}function uI(o,c,h,x,j){this.tag=c,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zh(0),this.expirationTimes=zh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zh(0),this.identifierPrefix=x,this.onRecoverableError=j,this.mutableSourceEagerHydrationData=null}function v1(o,c,h,x,j,S,A,M,$){return o=new uI(o,c,h,M,$),c===1?(c=1,S===!0&&(c|=8)):c=0,S=Er(3,null,null,c),o.current=S,S.stateNode=o,S.memoizedState={element:x,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ip(S),o}function dI(o,c,h){var x=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),S1.exports=jI(),S1.exports}var m5;function SI(){if(m5)return Ud;m5=1;var e=I8();return Ud.createRoot=e.createRoot,Ud.hydrateRoot=e.hydrateRoot,Ud}var kI=SI();const NI="modulepreload",EI=function(e){return"/admin/"+e},f5={},$e=function(t,r,s){let a=Promise.resolve();if(r&&r.length>0){let d=function(m){return Promise.all(m.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=l?.nonce||l?.getAttribute("nonce");a=d(r.map(m=>{if(m=EI(m),m in f5)return;f5[m]=!0;const p=m.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${g}`))return;const v=document.createElement("link");if(v.rel=p?"stylesheet":NI,p||(v.as="script"),v.crossOrigin="",v.href=m,u&&v.setAttribute("nonce",u),document.head.appendChild(v),p)return new Promise((y,C)=>{v.addEventListener("load",y),v.addEventListener("error",()=>C(new Error(`Unable to preload CSS for ${m}`)))})}))}function i(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return a.then(l=>{for(const u of l||[])u.status==="rejected"&&i(u.reason);return t().catch(i)})};var E1={exports:{}};var h5;function AI(){return h5||(h5=1,(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var s=[],a=0;a"u")){l=Vd({},t,l),typeof l.expires=="number"&&(l.expires=new Date(Date.now()+l.expires*864e5)),l.expires&&(l.expires=l.expires.toUTCString()),a=encodeURIComponent(a).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var u="";for(var d in l)l[d]&&(u+="; "+d,l[d]!==!0&&(u+="="+l[d].split(";")[0]));return document.cookie=a+"="+e.write(i,a)+u}}function s(a){if(!(typeof document>"u"||arguments.length&&!a)){for(var i=document.cookie?document.cookie.split("; "):[],l={},u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:u;return P1.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,P1}var g5;function DI(){return g5||(g5=1,A1.exports=II()),A1.exports}var Gg=DI();const _8=0,M8=1,L8=2,x5=3;var v5=Object.prototype.hasOwnProperty;function qg(e,t){var r,s;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((s=e.length)===t.length)for(;s--&&qg(e[s],t[s]););return s===-1}if(!r||typeof e=="object"){s=0;for(r in e)if(v5.call(e,r)&&++s&&!v5.call(t,r)||!(r in t)||!qg(e[r],t[r]))return!1;return Object.keys(t).length===s}}return e!==e&&t!==t}const Us=new WeakMap,Vs=()=>{},jn=Vs(),_m=Object,xt=e=>e===jn,Zr=e=>typeof e=="function",Gs=(e,t)=>({...e,...t}),R8=e=>Zr(e.then),T1={},$d={},px="undefined",Jc=typeof window!=px,Yg=typeof document!=px,_I=Jc&&"Deno"in window,MI=()=>Jc&&typeof window.requestAnimationFrame!=px,O8=(e,t)=>{const r=Us.get(e);return[()=>!xt(t)&&e.get(t)||T1,s=>{if(!xt(t)){const a=e.get(t);t in $d||($d[t]=a),r[5](t,Gs(a,s),a||T1)}},r[6],()=>!xt(t)&&t in $d?$d[t]:!xt(t)&&e.get(t)||T1]};let Zg=!0;const LI=()=>Zg,[Qg,Jg]=Jc&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Vs,Vs],RI=()=>{const e=Yg&&document.visibilityState;return xt(e)||e!=="hidden"},OI=e=>(Yg&&document.addEventListener("visibilitychange",e),Qg("focus",e),()=>{Yg&&document.removeEventListener("visibilitychange",e),Jg("focus",e)}),FI=e=>{const t=()=>{Zg=!0,e()},r=()=>{Zg=!1};return Qg("online",t),Qg("offline",r),()=>{Jg("online",t),Jg("offline",r)}},BI={isOnline:LI,isVisible:RI},UI={initFocus:OI,initReconnect:FI},y5=!ce.useId,To=!Jc||_I,VI=e=>MI()?window.requestAnimationFrame(e):setTimeout(e,1),xm=To?f.useEffect:f.useLayoutEffect,I1=typeof navigator<"u"&&navigator.connection,b5=!To&&I1&&(["slow-2g","2g"].includes(I1.effectiveType)||I1.saveData),Hd=new WeakMap,$I=e=>_m.prototype.toString.call(e),D1=(e,t)=>e===`[object ${t}]`;let HI=0;const Xg=e=>{const t=typeof e,r=$I(e),s=D1(r,"Date"),a=D1(r,"RegExp"),i=D1(r,"Object");let l,u;if(_m(e)===e&&!s&&!a){if(l=Hd.get(e),l)return l;if(l=++HI+"~",Hd.set(e,l),Array.isArray(e)){for(l="@",u=0;u{if(Zr(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Xg(e):"",[e,t]};let zI=0;const e0=()=>++zI;async function F8(...e){const[t,r,s,a]=e,i=Gs({populateCache:!0,throwOnError:!0},typeof a=="boolean"?{revalidate:a}:a||{});let l=i.populateCache;const u=i.rollbackOnError;let d=i.optimisticData;const m=v=>typeof u=="function"?u(v):u!==!1,p=i.throwOnError;if(Zr(r)){const v=r,y=[],C=t.keys();for(const b of C)!/^\$(inf|sub)\$/.test(b)&&v(t.get(b)._k)&&y.push(b);return Promise.all(y.map(g))}return g(r);async function g(v){const[y]=gx(v);if(!y)return;const[C,b]=O8(t,y),[w,N,k,E]=Us.get(t),T=()=>{const U=w[y];return(Zr(i.revalidate)?i.revalidate(C().data,v):i.revalidate!==!1)&&(delete k[y],delete E[y],U&&U[0])?U[0](L8).then(()=>C().data):C().data};if(e.length<3)return T();let _=s,I,F=!1;const z=e0();N[y]=[z,0];const H=!xt(d),J=C(),Y=J.data,B=J._c,W=xt(B)?Y:B;if(H&&(d=Zr(d)?d(W,Y):d,b({data:d,_c:W})),Zr(_))try{_=_(W)}catch(U){I=U,F=!0}if(_&&R8(_))if(_=await _.catch(U=>{I=U,F=!0}),z!==N[y][0]){if(F)throw I;return _}else F&&H&&m(I)&&(l=!0,b({data:W,_c:jn}));if(l&&!F)if(Zr(l)){const U=l(_,W);b({data:U,error:jn,_c:jn})}else b({data:_,error:jn,_c:jn});if(N[y][1]=e0(),Promise.resolve(T()).then(()=>{b({_c:jn})}),F){if(p)throw I;return}return _}}const C5=(e,t)=>{for(const r in e)e[r][0]&&e[r][0](t)},B8=(e,t)=>{if(!Us.has(e)){const r=Gs(UI,t),s=Object.create(null),a=F8.bind(jn,e);let i=Vs;const l=Object.create(null),u=(p,g)=>{const v=l[p]||[];return l[p]=v,v.push(g),()=>v.splice(v.indexOf(g),1)},d=(p,g,v)=>{e.set(p,g);const y=l[p];if(y)for(const C of y)C(g,v)},m=()=>{if(!Us.has(e)&&(Us.set(e,[s,Object.create(null),Object.create(null),Object.create(null),a,d,u]),!To)){const p=r.initFocus(setTimeout.bind(jn,C5.bind(jn,s,_8))),g=r.initReconnect(setTimeout.bind(jn,C5.bind(jn,s,M8)));i=()=>{p&&p(),g&&g(),Us.delete(e)}}};return m(),[e,a,m,i]}return[e,Us.get(e)[4]]},WI=(e,t,r,s,a)=>{const i=r.errorRetryCount,l=a.retryCount,u=~~((Math.random()+.5)*(1<<(l<8?l:8)))*r.errorRetryInterval;!xt(i)&&l>i||setTimeout(s,u,a)},KI=qg,[xx,yi]=B8(new Map),U8=Gs({onLoadingSlow:Vs,onSuccess:Vs,onError:Vs,onErrorRetry:WI,onDiscarded:Vs,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:b5?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:b5?5e3:3e3,compare:KI,isPaused:()=>!1,cache:xx,mutate:yi,fallback:{}},BI),V8=(e,t)=>{const r=Gs(e,t);if(t){const{use:s,fallback:a}=e,{use:i,fallback:l}=t;s&&i&&(r.use=s.concat(i)),a&&l&&(r.fallback=Gs(a,l))}return r},t0=f.createContext({}),GI=e=>{const{value:t}=e,r=f.useContext(t0),s=Zr(t),a=f.useMemo(()=>s?t(r):t,[s,r,t]),i=f.useMemo(()=>s?a:V8(r,a),[s,r,a]),l=a&&a.provider,u=f.useRef(jn);l&&!u.current&&(u.current=B8(l(i.cache||xx),a));const d=u.current;return d&&(i.cache=d[0],i.mutate=d[1]),xm(()=>{if(d)return d[2]&&d[2](),d[3]},[]),f.createElement(t0.Provider,Gs(e,{value:i}))},qI="$inf$",$8=Jc&&window.__SWR_DEVTOOLS_USE__,YI=$8?window.__SWR_DEVTOOLS_USE__:[],ZI=()=>{$8&&(window.__SWR_DEVTOOLS_REACT__=ce)},QI=e=>Zr(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],Xc=()=>{const e=f.useContext(t0);return f.useMemo(()=>Gs(U8,e),[e])},JI=e=>(t,r,s)=>e(t,r&&((...i)=>{const[l]=gx(t),[,,,u]=Us.get(xx);if(l.startsWith(qI))return r(...i);const d=u[l];return xt(d)?r(...i):(delete u[l],d)}),s),XI=YI.concat(JI),eD=e=>function(...r){const s=Xc(),[a,i,l]=QI(r),u=V8(s,l);let d=e;const{use:m}=u,p=(m||[]).concat(XI);for(let g=p.length;g--;)d=p[g](d);return d(a,i||u.fetcher||null,u)},tD=(e,t,r)=>{const s=t[e]||(t[e]=[]);return s.push(r),()=>{const a=s.indexOf(r);a>=0&&(s[a]=s[s.length-1],s.pop())}};ZI();const _1=ce.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),M1={dedupe:!0},w5=Promise.resolve(jn),nD=()=>Vs,rD=(e,t,r)=>{const{cache:s,compare:a,suspense:i,fallbackData:l,revalidateOnMount:u,revalidateIfStale:d,refreshInterval:m,refreshWhenHidden:p,refreshWhenOffline:g,keepPreviousData:v,strictServerPrefetchWarning:y}=r,[C,b,w,N]=Us.get(s),[k,E]=gx(e),T=f.useRef(!1),_=f.useRef(!1),I=f.useRef(k),F=f.useRef(t),z=f.useRef(r),H=()=>z.current,J=()=>H().isVisible()&&H().isOnline(),[Y,B,W,U]=O8(s,k),Z=f.useRef({}).current,re=xt(l)?xt(r.fallback)?jn:r.fallback[k]:l,me=(xe,Fe)=>{for(const st in Z){const mt=st;if(mt==="data"){if(!a(xe[mt],Fe[mt])&&(!xt(xe[mt])||!a(he,Fe[mt])))return!1}else if(Fe[mt]!==xe[mt])return!1}return!0},L=!T.current,V=f.useMemo(()=>{const xe=Y(),Fe=U(),st=lt=>{const wt=Gs(lt);return delete wt._k,(()=>{if(!k||!t||H().isPaused())return!1;if(L&&!xt(u))return u;const _t=xt(re)?wt.data:re;return xt(_t)||d})()?{isValidating:!0,isLoading:!0,...wt}:wt},mt=st(xe),At=xe===Fe?mt:st(Fe);let Qe=mt;return[()=>{const lt=st(Y());return me(lt,Qe)?(Qe.data=lt.data,Qe.isLoading=lt.isLoading,Qe.isValidating=lt.isValidating,Qe.error=lt.error,Qe):(Qe=lt,lt)},()=>At]},[s,k]),P=Gg.useSyncExternalStore(f.useCallback(xe=>W(k,(Fe,st)=>{me(st,Fe)||xe()}),[s,k]),V[0],V[1]),q=C[k]&&C[k].length>0,Q=P.data,ae=xt(Q)?re&&R8(re)?_1(re):re:Q,X=P.error,fe=f.useRef(ae),he=v?xt(Q)?xt(fe.current)?ae:fe.current:Q:ae,se=k&&xt(ae),le=f.useRef(null);!To&&Gg.useSyncExternalStore(nD,()=>(le.current=!1,le),()=>(le.current=!0,le));const Ae=le.current;y&&Ae&&!i&&se&&console.warn(`Missing pre-initiated data for serialized key "${k}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const Te=!k||!t||H().isPaused()||q&&!xt(X)?!1:L&&!xt(u)?u:i?xt(ae)?!1:d:xt(ae)||d,Ue=xt(P.isValidating)?Te:P.isValidating,Ze=xt(P.isLoading)?Te:P.isLoading,ct=f.useCallback(async xe=>{const Fe=F.current;if(!k||!Fe||_.current||H().isPaused())return!1;let st,mt,At=!0;const Qe=xe||{},lt=!w[k]||!Qe.dedupe,wt=()=>y5?!_.current&&k===I.current&&T.current:k===I.current,Mt={isValidating:!1,isLoading:!1},_t=()=>{B(Mt)},pt=()=>{const $t=w[k];$t&&$t[1]===mt&&delete w[k]},vn={isValidating:!0};xt(Y().data)&&(vn.isLoading=!0);try{if(lt&&(B(vn),r.loadingTimeout&&xt(Y().data)&&setTimeout(()=>{At&&wt()&&H().onLoadingSlow(k,r)},r.loadingTimeout),w[k]=[Fe(E),e0()]),[st,mt]=w[k],st=await st,lt&&setTimeout(pt,r.dedupingInterval),!w[k]||w[k][1]!==mt)return lt&&wt()&&H().onDiscarded(k),!1;Mt.error=jn;const $t=b[k];if(!xt($t)&&(mt<=$t[0]||mt<=$t[1]||$t[1]===0))return _t(),lt&&wt()&&H().onDiscarded(k),!1;const An=Y().data;Mt.data=a(An,st)?An:st,lt&&wt()&&H().onSuccess(st,k,r)}catch($t){pt();const An=H(),{shouldRetryOnError:As}=An;An.isPaused()||(Mt.error=$t,lt&&wt()&&(An.onError($t,k,An),(As===!0||Zr(As)&&As($t))&&(!H().revalidateOnFocus||!H().revalidateOnReconnect||J())&&An.onErrorRetry($t,k,An,Ka=>{const wl=C[k];wl&&wl[0]&&wl[0](x5,Ka)},{retryCount:(Qe.retryCount||0)+1,dedupe:!0})))}return At=!1,_t(),!0},[k,s]),ht=f.useCallback((...xe)=>F8(s,I.current,...xe),[]);if(xm(()=>{F.current=t,z.current=r,xt(Q)||(fe.current=Q)}),xm(()=>{if(!k)return;const xe=ct.bind(jn,M1);let Fe=0;H().revalidateOnFocus&&(Fe=Date.now()+H().focusThrottleInterval);const mt=tD(k,C,(At,Qe={})=>{if(At==_8){const lt=Date.now();H().revalidateOnFocus&<>Fe&&J()&&(Fe=lt+H().focusThrottleInterval,xe())}else if(At==M8)H().revalidateOnReconnect&&J()&&xe();else{if(At==L8)return ct();if(At==x5)return ct(Qe)}});return _.current=!1,I.current=k,T.current=!0,B({_k:E}),Te&&(w[k]||(xt(ae)||To?xe():VI(xe))),()=>{_.current=!0,mt()}},[k]),xm(()=>{let xe;function Fe(){const mt=Zr(m)?m(Y().data):m;mt&&xe!==-1&&(xe=setTimeout(st,mt))}function st(){!Y().error&&(p||H().isVisible())&&(g||H().isOnline())?ct(M1).then(Fe):Fe()}return Fe(),()=>{xe&&(clearTimeout(xe),xe=-1)}},[m,p,g,k]),f.useDebugValue(he),i){if(!y5&&To&&se)throw new Error("Fallback data is required when using Suspense in SSR.");se&&(F.current=t,z.current=r,_.current=!1);const xe=N[k],Fe=!xt(xe)&&se?ht(xe):w5;if(_1(Fe),!xt(X)&&se)throw X;const st=se?ct(M1):w5;!xt(he)&&se&&(st.status="fulfilled",st.value=!0),_1(st)}return{mutate:ht,get data(){return Z.data=!0,he},get error(){return Z.error=!0,X},get isValidating(){return Z.isValidating=!0,Ue},get isLoading(){return Z.isLoading=!0,Ze}}},sD=_m.defineProperty(GI,"defaultValue",{value:U8}),dt=eD(rD);function aD(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var r,s,a,i,l=[],u="",d=e.split("/");for(d[0]||d.shift();a=d.shift();)r=a[0],r==="*"?(l.push(r),u+=a[1]==="?"?"(?:/(.*))?":"/(.*)"):r===":"?(s=a.indexOf("?",1),i=a.indexOf(".",1),l.push(a.substring(1,~s?s:~i?i:a.length)),u+=~s&&!~i?"(?:/([^/]+?))?":"/([^/]+?)",~i&&(u+=(~s?"?":"")+"\\"+a.substring(i))):u+="/"+a;return{keys:l,pattern:new RegExp("^"+u+(t?"(?=$|/)":"/?$"),"i")}}const iD=hx.useInsertionEffect,oD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",H8=oD?f.useLayoutEffect:f.useEffect,lD=iD||H8,Nf=e=>{const t=f.useRef([e,(...r)=>t[0](...r)]).current;return lD(()=>{t[0]=e}),t[1]},cD="popstate",vx="pushState",yx="replaceState",uD="hashchange",j5=[cD,vx,yx,uD],dD=e=>{for(const t of j5)addEventListener(t,e);return()=>{for(const t of j5)removeEventListener(t,e)}},z8=(e,t)=>Gg.useSyncExternalStore(dD,e,t),mD=()=>location.search,fD=({ssrSearch:e=""}={})=>z8(mD,()=>e),S5=()=>location.pathname,hD=({ssrPath:e}={})=>z8(S5,e?()=>e:S5),pD=(e,{replace:t=!1,state:r=null}={})=>history[t?yx:vx](r,"",e),gD=(e={})=>[hD(e),pD],k5=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[k5]>"u"){for(const e of[vx,yx]){const t=history[e];history[e]=function(){const r=t.apply(this,arguments),s=new Event(e);return s.arguments=arguments,dispatchEvent(s),r}}Object.defineProperty(window,k5,{value:!0})}const xD=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",W8=(e="")=>e==="/"?"":e,vD=(e,t)=>e[0]==="~"?e.slice(1):W8(t)+e,yD=(e="",t)=>xD(n0(W8(e)),n0(t)),bD=e=>e[0]==="?"?e.slice(1):e,n0=e=>{try{return decodeURI(e)}catch{return e}},CD=e=>n0(bD(e)),K8={hook:gD,searchHook:fD,parser:aD,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e},G8=f.createContext(K8),Ra=()=>f.useContext(G8),q8={},Y8=f.createContext(q8),wD=()=>f.useContext(Y8),eu=e=>{const[t,r]=e.hook(e);return[yD(e.base,t),Nf((s,a)=>r(vD(s,e.base),a))]},ft=()=>eu(Ra()),Z8=()=>{const e=Ra();return CD(e.searchHook(e))},bx=(e,t,r,s)=>{const{pattern:a,keys:i}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",s),l=a.exec(r)||[],[u,...d]=l;return u!==void 0?[!0,(()=>{const m=i!==!1?Object.fromEntries(i.map((g,v)=>[g,d[v]])):l.groups;let p={...d};return m&&Object.assign(p,m),p})(),...s?[u]:[]]:[!1,null]},lle=e=>bx(Ra().parser,e,ft()[0]),jD=({children:e,...t})=>{const r=Ra(),s=t.hook?K8:r;let a=s;const[i,l]=t.ssrPath?.split("?")??[];l&&(t.ssrSearch=l,t.ssrPath=i),t.hrefs=t.hrefs??t.hook?.hrefs;let u=f.useRef({}),d=u.current,m=d;for(let p in s){const g=p==="base"?s[p]+(t[p]||""):t[p]||s[p];d===m&&g!==m[p]&&(u.current=m={...m}),m[p]=g,(g!==s[p]||g!==a[p])&&(a=m)}return f.createElement(G8.Provider,{value:a,children:e})},N5=({children:e,component:t},r)=>t?f.createElement(t,{params:r}):typeof e=="function"?e(r):e,SD=e=>{let t=f.useRef(q8);const r=t.current;return t.current=Object.keys(e).length!==Object.keys(r).length||Object.entries(e).some(([s,a])=>a!==r[s])?e:r};function rl(){const[e,t]=ft(),r=Z8(),s=f.useMemo(()=>new URLSearchParams(r),[r]);let a=s;const i=Nf((l,u)=>{a=new URLSearchParams(typeof l=="function"?l(a):l),t(e+"?"+a,u)});return[s,i]}const be=({path:e,nest:t,match:r,...s})=>{const a=Ra(),[i]=eu(a),[l,u,d]=r??bx(a.parser,e,i,t),m=SD({...wD(),...u});if(!l)return null;const p=d?f.createElement(jD,{base:d},N5(s,m)):N5(s,m);return f.createElement(Y8.Provider,{value:m,children:p})},ze=f.forwardRef((e,t)=>{const r=Ra(),[s,a]=eu(r),{to:i="",href:l=i,onClick:u,asChild:d,children:m,className:p,replace:g,state:v,...y}=e,C=Nf(w=>{w.ctrlKey||w.metaKey||w.altKey||w.shiftKey||w.button!==0||(u?.(w),w.defaultPrevented||(w.preventDefault(),a(l,e)))}),b=r.hrefs(l[0]==="~"?l.slice(1):r.base+l,r);return d&&f.isValidElement(m)?f.cloneElement(m,{onClick:C,href:b}):f.createElement("a",{...y,onClick:C,href:b,className:p?.call?p(s===l):p,children:m,ref:t})}),Q8=e=>Array.isArray(e)?e.flatMap(t=>Q8(t&&t.type===f.Fragment?t.props.children:t)):[e],r0=({children:e,location:t})=>{const r=Ra(),[s]=eu(r);for(const a of Q8(e)){let i=0;if(f.isValidElement(a)&&(i=bx(r.parser,a.props.path,t||s,a.props.nest))[0])return f.cloneElement(a,{match:i})}return null},_i=e=>{const{to:t,href:r=t}=e,s=Ra(),[,a]=eu(s),i=Nf(()=>a(t||r,e)),{ssrContext:l}=s;return H8(()=>{i()},[]),l&&(l.redirectTo=t),null};function J8(e){const[t,r]=f.useState("md"),s=f.useMemo(()=>kD(e,t),[e,t]);return f.useEffect(()=>{function a(){r(l=>{const u=i.findIndex(m=>m.matches);if(u===-1)return l;const d=E5[u];return d?d.breakpoint:l})}const i=E5.map(l=>{const u=globalThis.matchMedia(l.query);return typeof u.addEventListener=="function"?u.addEventListener("change",a):u.addListener(a),u});return a(),()=>{i.forEach(l=>{typeof l.removeEventListener=="function"?l.removeEventListener("change",a):l.removeListener(a)})}},[]),s}const di={none:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536},E5=Object.keys(di).sort((e,t)=>di[t]-di[e]).map(e=>({query:`(min-width: ${di[e]}px)`,breakpoint:e,breakpointAmount:di[e]}));function kD(e,t){return di[e]t=>{const r=ND.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),rs=e=>(e=e.toLowerCase(),t=>Pf(t)===e),Tf=e=>t=>typeof t===e,{isArray:sl}=Array,Vo=Tf("undefined");function tu(e){return e!==null&&!Vo(e)&&e.constructor!==null&&!Vo(e.constructor)&&lr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const tC=rs("ArrayBuffer");function ED(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&tC(e.buffer),t}const AD=Tf("string"),lr=Tf("function"),nC=Tf("number"),nu=e=>e!==null&&typeof e=="object",PD=e=>e===!0||e===!1,vm=e=>{if(Pf(e)!=="object")return!1;const t=Ef(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(eC in e)&&!(Af in e)},TD=e=>{if(!nu(e)||tu(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},ID=rs("Date"),DD=rs("File"),_D=e=>!!(e&&typeof e.uri<"u"),MD=e=>e&&typeof e.getParts<"u",LD=rs("Blob"),RD=rs("FileList"),OD=e=>nu(e)&&lr(e.pipe);function FD(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const A5=FD(),P5=typeof A5.FormData<"u"?A5.FormData:void 0,BD=e=>{if(!e)return!1;if(P5&&e instanceof P5)return!0;const t=Ef(e);if(!t||t===Object.prototype||!lr(e.append))return!1;const r=Pf(e);return r==="formdata"||r==="object"&&lr(e.toString)&&e.toString()==="[object FormData]"},UD=rs("URLSearchParams"),[VD,$D,HD,zD]=["ReadableStream","Request","Response","Headers"].map(rs),WD=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ru(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let s,a;if(typeof e!="object"&&(e=[e]),sl(e))for(s=0,a=e.length;s0;)if(a=r[s],t===a.toLowerCase())return a;return null}const hi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,sC=e=>!Vo(e)&&e!==hi;function s0(...e){const{caseless:t,skipUndefined:r}=sC(this)&&this||{},s={},a=(i,l)=>{if(l==="__proto__"||l==="constructor"||l==="prototype")return;const u=t&&rC(s,l)||l,d=a0(s,u)?s[u]:void 0;vm(d)&&vm(i)?s[u]=s0(d,i):vm(i)?s[u]=s0({},i):sl(i)?s[u]=i.slice():(!r||!Vo(i))&&(s[u]=i)};for(let i=0,l=e.length;i(ru(t,(a,i)=>{r&&lr(a)?Object.defineProperty(e,i,{__proto__:null,value:X8(a,r),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{__proto__:null,value:a,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:s}),e),GD=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),qD=(e,t,r,s)=>{e.prototype=Object.create(t.prototype,s),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),r&&Object.assign(e.prototype,r)},YD=(e,t,r,s)=>{let a,i,l;const u={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),i=a.length;i-- >0;)l=a[i],(!s||s(l,e,t))&&!u[l]&&(t[l]=e[l],u[l]=!0);e=r!==!1&&Ef(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},ZD=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const s=e.indexOf(t,r);return s!==-1&&s===r},QD=e=>{if(!e)return null;if(sl(e))return e;let t=e.length;if(!nC(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},JD=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ef(Uint8Array)),XD=(e,t)=>{const s=(e&&e[Af]).call(e);let a;for(;(a=s.next())&&!a.done;){const i=a.value;t.call(e,i[0],i[1])}},e_=(e,t)=>{let r;const s=[];for(;(r=e.exec(t))!==null;)s.push(r);return s},t_=rs("HTMLFormElement"),n_=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,s,a){return s.toUpperCase()+a}),a0=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),r_=rs("RegExp"),aC=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),s={};ru(r,(a,i)=>{let l;(l=t(a,i,e))!==!1&&(s[i]=l||a)}),Object.defineProperties(e,s)},s_=e=>{aC(e,(t,r)=>{if(lr(e)&&["arguments","caller","callee"].includes(r))return!1;const s=e[r];if(lr(s)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},a_=(e,t)=>{const r={},s=a=>{a.forEach(i=>{r[i]=!0})};return sl(e)?s(e):s(String(e).split(t)),r},i_=()=>{},o_=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function l_(e){return!!(e&&lr(e.append)&&e[eC]==="FormData"&&e[Af])}const c_=e=>{const t=new Array(10),r=(s,a)=>{if(nu(s)){if(t.indexOf(s)>=0)return;if(tu(s))return s;if(!("toJSON"in s)){t[a]=s;const i=sl(s)?[]:{};return ru(s,(l,u)=>{const d=r(l,a+1);!Vo(d)&&(i[u]=d)}),t[a]=void 0,i}}return s};return r(e,0)},u_=rs("AsyncFunction"),d_=e=>e&&(nu(e)||lr(e))&&lr(e.then)&&lr(e.catch),iC=((e,t)=>e?setImmediate:t?((r,s)=>(hi.addEventListener("message",({source:a,data:i})=>{a===hi&&i===r&&s.length&&s.shift()()},!1),a=>{s.push(a),hi.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",lr(hi.postMessage)),m_=typeof queueMicrotask<"u"?queueMicrotask.bind(hi):typeof process<"u"&&process.nextTick||iC,f_=e=>e!=null&&lr(e[Af]),te={isArray:sl,isArrayBuffer:tC,isBuffer:tu,isFormData:BD,isArrayBufferView:ED,isString:AD,isNumber:nC,isBoolean:PD,isObject:nu,isPlainObject:vm,isEmptyObject:TD,isReadableStream:VD,isRequest:$D,isResponse:HD,isHeaders:zD,isUndefined:Vo,isDate:ID,isFile:DD,isReactNativeBlob:_D,isReactNative:MD,isBlob:LD,isRegExp:r_,isFunction:lr,isStream:OD,isURLSearchParams:UD,isTypedArray:JD,isFileList:RD,forEach:ru,merge:s0,extend:KD,trim:WD,stripBOM:GD,inherits:qD,toFlatObject:YD,kindOf:Pf,kindOfTest:rs,endsWith:ZD,toArray:QD,forEachEntry:XD,matchAll:e_,isHTMLForm:t_,hasOwnProperty:a0,hasOwnProp:a0,reduceDescriptors:aC,freezeMethods:s_,toObjectSet:a_,toCamelCase:n_,noop:i_,toFiniteNumber:o_,findKey:rC,global:hi,isContextDefined:sC,isSpecCompliantForm:l_,toJSONObject:c_,isAsyncFn:u_,isThenable:d_,setImmediate:iC,asap:m_,isIterable:f_},h_=te.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),p_=e=>{const t={};let r,s,a;return e&&e.split(` `).forEach(function(l){a=l.indexOf(":"),r=l.substring(0,a).trim().toLowerCase(),s=l.substring(a+1).trim(),!(!r||t[r]&&h_[r])&&(r==="set-cookie"?t[r]?t[r].push(s):t[r]=[s]:t[r]=t[r]?t[r]+", "+s:s)}),t},T5=Symbol("internals"),g_=/[^\x09\x20-\x7E\x80-\xFF]/g;function x_(e){let t=0,r=e.length;for(;tt;){const s=e.charCodeAt(r-1);if(s!==9&&s!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}function ic(e){return e&&String(e).trim().toLowerCase()}function v_(e){return x_(e.replace(g_,""))}function ym(e){return e===!1||e==null?e:te.isArray(e)?e.map(ym):v_(String(e))}function y_(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=r.exec(e);)t[s[1]]=s[2];return t}const b_=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function L1(e,t,r,s,a){if(te.isFunction(s))return s.call(this,t,r);if(a&&(t=r),!!te.isString(t)){if(te.isString(s))return t.indexOf(s)!==-1;if(te.isRegExp(s))return s.test(t)}}function C_(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,s)=>r.toUpperCase()+s)}function w_(e,t){const r=te.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(e,s+r,{__proto__:null,value:function(a,i,l){return this[s].call(this,t,a,i,l)},configurable:!0})})}let Gn=class{constructor(t){t&&this.set(t)}set(t,r,s){const a=this;function i(u,d,m){const p=ic(d);if(!p)throw new Error("header name must be a non-empty string");const g=te.findKey(a,p);(!g||a[g]===void 0||m===!0||m===void 0&&a[g]!==!1)&&(a[g||d]=ym(u))}const l=(u,d)=>te.forEach(u,(m,p)=>i(m,p,d));if(te.isPlainObject(t)||t instanceof this.constructor)l(t,r);else if(te.isString(t)&&(t=t.trim())&&!b_(t))l(p_(t),r);else if(te.isObject(t)&&te.isIterable(t)){let u={},d,m;for(const p of t){if(!te.isArray(p))throw TypeError("Object iterator must return a key-value pair");u[m=p[0]]=(d=u[m])?te.isArray(d)?[...d,p[1]]:[d,p[1]]:p[1]}l(u,r)}else t!=null&&i(r,t,s);return this}get(t,r){if(t=ic(t),t){const s=te.findKey(this,t);if(s){const a=this[s];if(!r)return a;if(r===!0)return y_(a);if(te.isFunction(r))return r.call(this,a,s);if(te.isRegExp(r))return r.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=ic(t),t){const s=te.findKey(this,t);return!!(s&&this[s]!==void 0&&(!r||L1(this,this[s],s,r)))}return!1}delete(t,r){const s=this;let a=!1;function i(l){if(l=ic(l),l){const u=te.findKey(s,l);u&&(!r||L1(s,s[u],u,r))&&(delete s[u],a=!0)}}return te.isArray(t)?t.forEach(i):i(t),a}clear(t){const r=Object.keys(this);let s=r.length,a=!1;for(;s--;){const i=r[s];(!t||L1(this,this[i],i,t,!0))&&(delete this[i],a=!0)}return a}normalize(t){const r=this,s={};return te.forEach(this,(a,i)=>{const l=te.findKey(s,i);if(l){r[l]=ym(a),delete r[i];return}const u=t?C_(i):String(i).trim();u!==i&&delete r[i],r[u]=ym(a),s[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return te.forEach(this,(s,a)=>{s!=null&&s!==!1&&(r[a]=t&&te.isArray(s)?s.join(", "):s)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const s=new this(t);return r.forEach(a=>s.set(a)),s}static accessor(t){const s=(this[T5]=this[T5]={accessors:{}}).accessors,a=this.prototype;function i(l){const u=ic(l);s[u]||(w_(a,l),s[u]=!0)}return te.isArray(t)?t.forEach(i):i(t),this}};Gn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);te.reduceDescriptors(Gn.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[r]=s}}});te.freezeMethods(Gn);const j_="[REDACTED ****]";function S_(e){if(te.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(te.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function k_(e,t){const r=new Set(t.map(i=>String(i).toLowerCase())),s=[],a=i=>{if(i===null||typeof i!="object"||te.isBuffer(i))return i;if(s.indexOf(i)!==-1)return;i instanceof Gn&&(i=i.toJSON()),s.push(i);let l;if(te.isArray(i))l=[],i.forEach((u,d)=>{const m=a(u);te.isUndefined(m)||(l[d]=m)});else{if(!te.isPlainObject(i)&&S_(i))return s.pop(),i;l=Object.create(null);for(const[u,d]of Object.entries(i)){const m=r.has(u.toLowerCase())?j_:a(d);te.isUndefined(m)||(l[u]=m)}}return s.pop(),l};return a(e)}let Oe=class oC extends Error{static from(t,r,s,a,i,l){const u=new oC(t.message,r||t.code,s,a,i);return u.cause=t,u.name=t.name,t.status!=null&&u.status==null&&(u.status=t.status),l&&Object.assign(u,l),u}constructor(t,r,s,a,i){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,r&&(this.code=r),s&&(this.config=s),a&&(this.request=a),i&&(this.response=i,this.status=i.status)}toJSON(){const t=this.config,r=t&&te.hasOwnProp(t,"redact")?t.redact:void 0,s=te.isArray(r)&&r.length>0?k_(t,r):te.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:s,code:this.code,status:this.status}}};Oe.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";Oe.ERR_BAD_OPTION="ERR_BAD_OPTION";Oe.ECONNABORTED="ECONNABORTED";Oe.ETIMEDOUT="ETIMEDOUT";Oe.ECONNREFUSED="ECONNREFUSED";Oe.ERR_NETWORK="ERR_NETWORK";Oe.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";Oe.ERR_DEPRECATED="ERR_DEPRECATED";Oe.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";Oe.ERR_BAD_REQUEST="ERR_BAD_REQUEST";Oe.ERR_CANCELED="ERR_CANCELED";Oe.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";Oe.ERR_INVALID_URL="ERR_INVALID_URL";Oe.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const N_=null;function i0(e){return te.isPlainObject(e)||te.isArray(e)}function lC(e){return te.endsWith(e,"[]")?e.slice(0,-2):e}function R1(e,t,r){return e?e.concat(t).map(function(a,i){return a=lC(a),!r&&i?"["+a+"]":a}).join(r?".":""):t}function E_(e){return te.isArray(e)&&!e.some(i0)}const A_=te.toFlatObject(te,{},null,function(t){return/^is[A-Z]/.test(t)});function If(e,t,r){if(!te.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=te.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,N){return!te.isUndefined(N[w])});const s=r.metaTokens,a=r.visitor||g,i=r.dots,l=r.indexes,u=r.Blob||typeof Blob<"u"&&Blob,d=r.maxDepth===void 0?100:r.maxDepth,m=u&&te.isSpecCompliantForm(t);if(!te.isFunction(a))throw new TypeError("visitor must be a function");function p(b){if(b===null)return"";if(te.isDate(b))return b.toISOString();if(te.isBoolean(b))return b.toString();if(!m&&te.isBlob(b))throw new Oe("Blob is not supported. Use a Buffer instead.");return te.isArrayBuffer(b)||te.isTypedArray(b)?m&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function g(b,w,N){let k=b;if(te.isReactNative(t)&&te.isReactNativeBlob(b))return t.append(R1(N,w,i),p(b)),!1;if(b&&!N&&typeof b=="object"){if(te.endsWith(w,"{}"))w=s?w:w.slice(0,-2),b=JSON.stringify(b);else if(te.isArray(b)&&E_(b)||(te.isFileList(b)||te.endsWith(w,"[]"))&&(k=te.toArray(b)))return w=lC(w),k.forEach(function(T,_){!(te.isUndefined(T)||T===null)&&t.append(l===!0?R1([w],_,i):l===null?w:w+"[]",p(T))}),!1}return i0(b)?!0:(t.append(R1(N,w,i),p(b)),!1)}const v=[],y=Object.assign(A_,{defaultVisitor:g,convertValue:p,isVisitable:i0});function C(b,w,N=0){if(!te.isUndefined(b)){if(N>d)throw new Oe("Object is too deeply nested ("+N+" levels). Max depth: "+d,Oe.ERR_FORM_DATA_DEPTH_EXCEEDED);if(v.indexOf(b)!==-1)throw Error("Circular reference detected in "+w.join("."));v.push(b),te.forEach(b,function(E,T){(!(te.isUndefined(E)||E===null)&&a.call(t,E,te.isString(T)?T.trim():T,w,y))===!0&&C(E,w?w.concat(T):[T],N+1)}),v.pop()}}if(!te.isObject(e))throw new TypeError("data must be an object");return C(e),t}function I5(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(s){return t[s]})}function Cx(e,t){this._pairs=[],e&&If(e,this,t)}const cC=Cx.prototype;cC.append=function(t,r){this._pairs.push([t,r])};cC.toString=function(t){const r=t?function(s){return t.call(this,s,I5)}:I5;return this._pairs.map(function(a){return r(a[0])+"="+r(a[1])},"").join("&")};function P_(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function uC(e,t,r){if(!t)return e;const s=r&&r.encode||P_,a=te.isFunction(r)?{serialize:r}:r,i=a&&a.serialize;let l;if(i?l=i(t,a):l=te.isURLSearchParams(t)?t.toString():new Cx(t,a).toString(s),l){const u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+l}return e}class D5{constructor(){this.handlers=[]}use(t,r,s){return this.handlers.push({fulfilled:t,rejected:r,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){te.forEach(this.handlers,function(s){s!==null&&t(s)})}}const wx={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},T_=typeof URLSearchParams<"u"?URLSearchParams:Cx,I_=typeof FormData<"u"?FormData:null,D_=typeof Blob<"u"?Blob:null,__={isBrowser:!0,classes:{URLSearchParams:T_,FormData:I_,Blob:D_},protocols:["http","https","file","blob","url","data"]},jx=typeof window<"u"&&typeof document<"u",o0=typeof navigator=="object"&&navigator||void 0,M_=jx&&(!o0||["ReactNative","NativeScript","NS"].indexOf(o0.product)<0),L_=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",R_=jx&&window.location.href||"http://localhost",O_=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:jx,hasStandardBrowserEnv:M_,hasStandardBrowserWebWorkerEnv:L_,navigator:o0,origin:R_},Symbol.toStringTag,{value:"Module"})),On={...O_,...__};function F_(e,t){return If(e,new On.classes.URLSearchParams,{visitor:function(r,s,a,i){return On.isNode&&te.isBuffer(r)?(this.append(s,r.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function B_(e){return te.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function U_(e){const t={},r=Object.keys(e);let s;const a=r.length;let i;for(s=0;s=r.length;return l=!l&&te.isArray(a)?a.length:l,d?(te.hasOwnProp(a,l)?a[l]=te.isArray(a[l])?a[l].concat(s):[a[l],s]:a[l]=s,!u):((!a[l]||!te.isObject(a[l]))&&(a[l]=[]),t(r,s,a[l],i)&&te.isArray(a[l])&&(a[l]=U_(a[l])),!u)}if(te.isFormData(e)&&te.isFunction(e.entries)){const r={};return te.forEachEntry(e,(s,a)=>{t(B_(s),a,r,0)}),r}return null}const xo=(e,t)=>e!=null&&te.hasOwnProp(e,t)?e[t]:void 0;function V_(e,t,r){if(te.isString(e))try{return(t||JSON.parse)(e),te.trim(e)}catch(s){if(s.name!=="SyntaxError")throw s}return(r||JSON.stringify)(e)}const su={transitional:wx,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const s=r.getContentType()||"",a=s.indexOf("application/json")>-1,i=te.isObject(t);if(i&&te.isHTMLForm(t)&&(t=new FormData(t)),te.isFormData(t))return a?JSON.stringify(dC(t)):t;if(te.isArrayBuffer(t)||te.isBuffer(t)||te.isStream(t)||te.isFile(t)||te.isBlob(t)||te.isReadableStream(t))return t;if(te.isArrayBufferView(t))return t.buffer;if(te.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(i){const d=xo(this,"formSerializer");if(s.indexOf("application/x-www-form-urlencoded")>-1)return F_(t,d).toString();if((u=te.isFileList(t))||s.indexOf("multipart/form-data")>-1){const m=xo(this,"env"),p=m&&m.FormData;return If(u?{"files[]":t}:t,p&&new p,d)}}return i||a?(r.setContentType("application/json",!1),V_(t)):t}],transformResponse:[function(t){const r=xo(this,"transitional")||su.transitional,s=r&&r.forcedJSONParsing,a=xo(this,"responseType"),i=a==="json";if(te.isResponse(t)||te.isReadableStream(t))return t;if(t&&te.isString(t)&&(s&&!a||i)){const u=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t,xo(this,"parseReviver"))}catch(d){if(u)throw d.name==="SyntaxError"?Oe.from(d,Oe.ERR_BAD_RESPONSE,this,null,xo(this,"response")):d}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:On.classes.FormData,Blob:On.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};te.forEach(["delete","get","head","post","put","patch","query"],e=>{su.headers[e]={}});function O1(e,t){const r=this||su,s=t||r,a=Gn.from(s.headers);let i=s.data;return te.forEach(e,function(u){i=u.call(r,i,a.normalize(),t?t.status:void 0)}),a.normalize(),i}function mC(e){return!!(e&&e.__CANCEL__)}let au=class extends Oe{constructor(t,r,s){super(t??"canceled",Oe.ERR_CANCELED,r,s),this.name="CanceledError",this.__CANCEL__=!0}};function fC(e,t,r){const s=r.config.validateStatus;!r.status||!s||s(r.status)?e(r):t(new Oe("Request failed with status code "+r.status,r.status>=400&&r.status<500?Oe.ERR_BAD_REQUEST:Oe.ERR_BAD_RESPONSE,r.config,r.request,r))}function $_(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function H_(e,t){e=e||10;const r=new Array(e),s=new Array(e);let a=0,i=0,l;return t=t!==void 0?t:1e3,function(d){const m=Date.now(),p=s[i];l||(l=m),r[a]=d,s[a]=m;let g=i,v=0;for(;g!==a;)v+=r[g++],g=g%e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),m-l{r=p,a=null,i&&(clearTimeout(i),i=null),e(...m)};return[(...m)=>{const p=Date.now(),g=p-r;g>=s?l(m,p):(a=m,i||(i=setTimeout(()=>{i=null,l(a)},s-g)))},()=>a&&l(a)]}const Mm=(e,t,r=3)=>{let s=0;const a=H_(50,250);return z_(i=>{const l=i.loaded,u=i.lengthComputable?i.total:void 0,d=u!=null?Math.min(l,u):l,m=Math.max(0,d-s),p=a(m);s=Math.max(s,d);const g={loaded:d,total:u,progress:u?d/u:void 0,bytes:m,rate:p||void 0,estimated:p&&u?(u-d)/p:void 0,event:i,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(g)},r)},_5=(e,t)=>{const r=e!=null;return[s=>t[0]({lengthComputable:r,total:e,loaded:s}),t[1]]},M5=e=>(...t)=>te.asap(()=>e(...t)),W_=On.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,On.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(On.origin),On.navigator&&/(msie|trident)/i.test(On.navigator.userAgent)):()=>!0,K_=On.hasStandardBrowserEnv?{write(e,t,r,s,a,i,l){if(typeof document>"u")return;const u=[`${e}=${encodeURIComponent(t)}`];te.isNumber(r)&&u.push(`expires=${new Date(r).toUTCString()}`),te.isString(s)&&u.push(`path=${s}`),te.isString(a)&&u.push(`domain=${a}`),i===!0&&u.push("secure"),te.isString(l)&&u.push(`SameSite=${l}`),document.cookie=u.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let r=0;re instanceof Gn?{...e}:e;function bi(e,t){t=t||{};const r=Object.create(null);Object.defineProperty(r,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function s(m,p,g,v){return te.isPlainObject(m)&&te.isPlainObject(p)?te.merge.call({caseless:v},m,p):te.isPlainObject(p)?te.merge({},p):te.isArray(p)?p.slice():p}function a(m,p,g,v){if(te.isUndefined(p)){if(!te.isUndefined(m))return s(void 0,m,g,v)}else return s(m,p,g,v)}function i(m,p){if(!te.isUndefined(p))return s(void 0,p)}function l(m,p){if(te.isUndefined(p)){if(!te.isUndefined(m))return s(void 0,m)}else return s(void 0,p)}function u(m,p,g){if(te.hasOwnProp(t,g))return s(m,p);if(te.hasOwnProp(e,g))return s(void 0,m)}const d={url:i,method:i,data:i,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,allowedSocketPaths:l,responseEncoding:l,validateStatus:u,headers:(m,p,g)=>a(L5(m),L5(p),g,!0)};return te.forEach(Object.keys({...e,...t}),function(p){if(p==="__proto__"||p==="constructor"||p==="prototype")return;const g=te.hasOwnProp(d,p)?d[p]:a,v=te.hasOwnProp(e,p)?e[p]:void 0,y=te.hasOwnProp(t,p)?t[p]:void 0,C=g(v,y,p);te.isUndefined(C)&&g!==u||(r[p]=C)}),r}const Y_=["content-type","content-length"];function Z_(e,t,r){if(r!=="content-only"){e.set(t);return}Object.entries(t).forEach(([s,a])=>{Y_.includes(s.toLowerCase())&&e.set(s,a)})}const Q_=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,r)=>String.fromCharCode(parseInt(r,16))),pC=e=>{const t=bi({},e),r=v=>te.hasOwnProp(t,v)?t[v]:void 0,s=r("data");let a=r("withXSRFToken");const i=r("xsrfHeaderName"),l=r("xsrfCookieName");let u=r("headers");const d=r("auth"),m=r("baseURL"),p=r("allowAbsoluteUrls"),g=r("url");if(t.headers=u=Gn.from(u),t.url=uC(hC(m,g,p),e.params,e.paramsSerializer),d&&u.set("Authorization","Basic "+btoa((d.username||"")+":"+(d.password?Q_(d.password):""))),te.isFormData(s)&&(On.hasStandardBrowserEnv||On.hasStandardBrowserWebWorkerEnv?u.setContentType(void 0):te.isFunction(s.getHeaders)&&Z_(u,s.getHeaders(),r("formDataHeaderPolicy"))),On.hasStandardBrowserEnv&&(te.isFunction(a)&&(a=a(t)),a===!0||a==null&&W_(t.url))){const y=i&&l&&K_.read(l);y&&u.set(i,y)}return t},J_=typeof XMLHttpRequest<"u",X_=J_&&function(e){return new Promise(function(r,s){const a=pC(e);let i=a.data;const l=Gn.from(a.headers).normalize();let{responseType:u,onUploadProgress:d,onDownloadProgress:m}=a,p,g,v,y,C;function b(){y&&y(),C&&C(),a.cancelToken&&a.cancelToken.unsubscribe(p),a.signal&&a.signal.removeEventListener("abort",p)}let w=new XMLHttpRequest;w.open(a.method.toUpperCase(),a.url,!0),w.timeout=a.timeout;function N(){if(!w)return;const E=Gn.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),_={data:!u||u==="text"||u==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:E,config:e,request:w};fC(function(F){r(F),b()},function(F){s(F),b()},_),w=null}"onloadend"in w?w.onloadend=N:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.startsWith("file:"))||setTimeout(N)},w.onabort=function(){w&&(s(new Oe("Request aborted",Oe.ECONNABORTED,e,w)),b(),w=null)},w.onerror=function(T){const _=T&&T.message?T.message:"Network Error",I=new Oe(_,Oe.ERR_NETWORK,e,w);I.event=T||null,s(I),b(),w=null},w.ontimeout=function(){let T=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const _=a.transitional||wx;a.timeoutErrorMessage&&(T=a.timeoutErrorMessage),s(new Oe(T,_.clarifyTimeoutError?Oe.ETIMEDOUT:Oe.ECONNABORTED,e,w)),b(),w=null},i===void 0&&l.setContentType(null),"setRequestHeader"in w&&te.forEach(l.toJSON(),function(T,_){w.setRequestHeader(_,T)}),te.isUndefined(a.withCredentials)||(w.withCredentials=!!a.withCredentials),u&&u!=="json"&&(w.responseType=a.responseType),m&&([v,C]=Mm(m,!0),w.addEventListener("progress",v)),d&&w.upload&&([g,y]=Mm(d),w.upload.addEventListener("progress",g),w.upload.addEventListener("loadend",y)),(a.cancelToken||a.signal)&&(p=E=>{w&&(s(!E||E.type?new au(null,e,w):E),w.abort(),b(),w=null)},a.cancelToken&&a.cancelToken.subscribe(p),a.signal&&(a.signal.aborted?p():a.signal.addEventListener("abort",p)));const k=$_(a.url);if(k&&!On.protocols.includes(k)){s(new Oe("Unsupported protocol "+k+":",Oe.ERR_BAD_REQUEST,e));return}w.send(i||null)})},eM=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let s=new AbortController,a;const i=function(m){if(!a){a=!0,u();const p=m instanceof Error?m:this.reason;s.abort(p instanceof Oe?p:new au(p instanceof Error?p.message:p))}};let l=t&&setTimeout(()=>{l=null,i(new Oe(`timeout of ${t}ms exceeded`,Oe.ETIMEDOUT))},t);const u=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(m=>{m.unsubscribe?m.unsubscribe(i):m.removeEventListener("abort",i)}),e=null)};e.forEach(m=>m.addEventListener("abort",i));const{signal:d}=s;return d.unsubscribe=()=>te.asap(u),d}},tM=function*(e,t){let r=e.byteLength;if(r{const a=nM(e,t);let i=0,l,u=d=>{l||(l=!0,s&&s(d))};return new ReadableStream({async pull(d){try{const{done:m,value:p}=await a.next();if(m){u(),d.close();return}let g=p.byteLength;if(r){let v=i+=g;r(v)}d.enqueue(new Uint8Array(p))}catch(m){throw u(m),m}},cancel(d){return u(d),a.return()}},{highWaterMark:2})};function sM(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;const t=e.indexOf(",");if(t<0)return 0;const r=e.slice(5,t),s=e.slice(t+1);if(/;base64/i.test(r)){let l=s.length;const u=s.length;for(let y=0;y=48&&C<=57||C>=65&&C<=70||C>=97&&C<=102)&&(b>=48&&b<=57||b>=65&&b<=70||b>=97&&b<=102)&&(l-=2,y+=2)}let d=0,m=u-1;const p=y=>y>=2&&s.charCodeAt(y-2)===37&&s.charCodeAt(y-1)===51&&(s.charCodeAt(y)===68||s.charCodeAt(y)===100);m>=0&&(s.charCodeAt(m)===61?(d++,m--):p(m)&&(d++,m-=3)),d===1&&m>=0&&(s.charCodeAt(m)===61||p(m))&&d++;const v=Math.floor(l/4)*3-(d||0);return v>0?v:0}if(typeof Buffer<"u"&&typeof Buffer.byteLength=="function")return Buffer.byteLength(s,"utf8");let i=0;for(let l=0,u=s.length;l=55296&&d<=56319&&l+1=56320&&m<=57343?(i+=4,l++):i+=3}else i+=3}return i}const Sx="1.16.0",O5=64*1024,{isFunction:zd}=te,F5=(e,...t)=>{try{return!!e(...t)}catch{return!1}},aM=e=>{const t=te.global??globalThis,{ReadableStream:r,TextEncoder:s}=t;e=te.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:a,Request:i,Response:l}=e,u=a?zd(a):typeof fetch=="function",d=zd(i),m=zd(l);if(!u)return!1;const p=u&&zd(r),g=u&&(typeof s=="function"?(N=>k=>N.encode(k))(new s):async N=>new Uint8Array(await new i(N).arrayBuffer())),v=d&&p&&F5(()=>{let N=!1;const k=new i(On.origin,{body:new r,method:"POST",get duplex(){return N=!0,"half"}}),E=k.headers.has("Content-Type");return k.body!=null&&k.body.cancel(),N&&!E}),y=m&&p&&F5(()=>te.isReadableStream(new l("").body)),C={stream:y&&(N=>N.body)};u&&["text","arrayBuffer","blob","formData","stream"].forEach(N=>{!C[N]&&(C[N]=(k,E)=>{let T=k&&k[N];if(T)return T.call(k);throw new Oe(`Response type '${N}' is not supported`,Oe.ERR_NOT_SUPPORT,E)})});const b=async N=>{if(N==null)return 0;if(te.isBlob(N))return N.size;if(te.isSpecCompliantForm(N))return(await new i(On.origin,{method:"POST",body:N}).arrayBuffer()).byteLength;if(te.isArrayBufferView(N)||te.isArrayBuffer(N))return N.byteLength;if(te.isURLSearchParams(N)&&(N=N+""),te.isString(N))return(await g(N)).byteLength},w=async(N,k)=>{const E=te.toFiniteNumber(N.getContentLength());return E??b(k)};return async N=>{let{url:k,method:E,data:T,signal:_,cancelToken:I,timeout:F,onDownloadProgress:z,onUploadProgress:H,responseType:J,headers:Y,withCredentials:B="same-origin",fetchOptions:W,maxContentLength:U,maxBodyLength:Z}=pC(N);const re=te.isNumber(U)&&U>-1,me=te.isNumber(Z)&&Z>-1;let L=a||fetch;J=J?(J+"").toLowerCase():"text";let V=eM([_,I&&I.toAbortSignal()],F),P=null;const q=V&&V.unsubscribe&&(()=>{V.unsubscribe()});let Q;try{if(re&&typeof k=="string"&&k.startsWith("data:")&&sM(k)>U)throw new Oe("maxContentLength size of "+U+" exceeded",Oe.ERR_BAD_RESPONSE,N,P);if(me&&E!=="get"&&E!=="head"){const le=await w(Y,T);if(typeof le=="number"&&isFinite(le)&&le>Z)throw new Oe("Request body larger than maxBodyLength limit",Oe.ERR_BAD_REQUEST,N,P)}if(H&&v&&E!=="get"&&E!=="head"&&(Q=await w(Y,T))!==0){let le=new i(k,{method:"POST",body:T,duplex:"half"}),Ae;if(te.isFormData(T)&&(Ae=le.headers.get("content-type"))&&Y.setContentType(Ae),le.body){const[Te,Ue]=_5(Q,Mm(M5(H)));T=R5(le.body,O5,Te,Ue)}}te.isString(B)||(B=B?"include":"omit");const ae=d&&"credentials"in i.prototype;if(te.isFormData(T)){const le=Y.getContentType();le&&/^multipart\/form-data/i.test(le)&&!/boundary=/i.test(le)&&Y.delete("content-type")}Y.set("User-Agent","axios/"+Sx,!1);const X={...W,signal:V,method:E.toUpperCase(),headers:Y.normalize().toJSON(),body:T,duplex:"half",credentials:ae?B:void 0};P=d&&new i(k,X);let fe=await(d?L(P,W):L(k,X));if(re){const le=te.toFiniteNumber(fe.headers.get("content-length"));if(le!=null&&le>U)throw new Oe("maxContentLength size of "+U+" exceeded",Oe.ERR_BAD_RESPONSE,N,P)}const he=y&&(J==="stream"||J==="response");if(y&&fe.body&&(z||re||he&&q)){const le={};["status","statusText","headers"].forEach(ht=>{le[ht]=fe[ht]});const Ae=te.toFiniteNumber(fe.headers.get("content-length")),[Te,Ue]=z&&_5(Ae,Mm(M5(z),!0))||[];let Ze=0;const ct=ht=>{if(re&&(Ze=ht,Ze>U))throw new Oe("maxContentLength size of "+U+" exceeded",Oe.ERR_BAD_RESPONSE,N,P);Te&&Te(ht)};fe=new l(R5(fe.body,O5,ct,()=>{Ue&&Ue(),q&&q()}),le)}J=J||"text";let se=await C[te.findKey(C,J)||"text"](fe,N);if(re&&!y&&!he){let le;if(se!=null&&(typeof se.byteLength=="number"?le=se.byteLength:typeof se.size=="number"?le=se.size:typeof se=="string"&&(le=typeof s=="function"?new s().encode(se).byteLength:se.length)),typeof le=="number"&&le>U)throw new Oe("maxContentLength size of "+U+" exceeded",Oe.ERR_BAD_RESPONSE,N,P)}return!he&&q&&q(),await new Promise((le,Ae)=>{fC(le,Ae,{data:se,headers:Gn.from(fe.headers),status:fe.status,statusText:fe.statusText,config:N,request:P})})}catch(ae){if(q&&q(),V&&V.aborted&&V.reason instanceof Oe){const X=V.reason;throw X.config=N,P&&(X.request=P),ae!==X&&(X.cause=ae),X}throw ae&&ae.name==="TypeError"&&/Load failed|fetch/i.test(ae.message)?Object.assign(new Oe("Network Error",Oe.ERR_NETWORK,N,P,ae&&ae.response),{cause:ae.cause||ae}):Oe.from(ae,ae&&ae.code,N,P,ae&&ae.response)}}},iM=new Map,gC=e=>{let t=e&&e.env||{};const{fetch:r,Request:s,Response:a}=t,i=[s,a,r];let l=i.length,u=l,d,m,p=iM;for(;u--;)d=i[u],m=p.get(d),m===void 0&&p.set(d,m=u?new Map:aM(t)),p=m;return m};gC();const kx={http:N_,xhr:X_,fetch:{get:gC}};te.forEach(kx,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const B5=e=>`- ${e}`,oM=e=>te.isFunction(e)||e===null||e===!1;function lM(e,t){e=te.isArray(e)?e:[e];const{length:r}=e;let s,a;const i={};for(let l=0;l`adapter ${d} `+(m===!1?"is not supported by the environment":"is not available in the build"));let u=r?l.length>1?`since : `+l.map(B5).join(` `):" "+B5(l[0]):"as no adapter specified";throw new Oe("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return a}const xC={getAdapter:lM,adapters:kx};function F1(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new au(null,e)}function U5(e){return F1(e),e.headers=Gn.from(e.headers),e.data=O1.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),xC.getAdapter(e.adapter||su.adapter,e)(e).then(function(s){F1(e),e.response=s;try{s.data=O1.call(e,e.transformResponse,s)}finally{delete e.response}return s.headers=Gn.from(s.headers),s},function(s){if(!mC(s)&&(F1(e),s&&s.response)){e.response=s.response;try{s.response.data=O1.call(e,e.transformResponse,s.response)}finally{delete e.response}s.response.headers=Gn.from(s.response.headers)}return Promise.reject(s)})}const Df={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Df[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const V5={};Df.transitional=function(t,r,s){function a(i,l){return"[Axios v"+Sx+"] Transitional option '"+i+"'"+l+(s?". "+s:"")}return(i,l,u)=>{if(t===!1)throw new Oe(a(l," has been removed"+(r?" in "+r:"")),Oe.ERR_DEPRECATED);return r&&!V5[l]&&(V5[l]=!0,console.warn(a(l," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,l,u):!0}};Df.spelling=function(t){return(r,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function cM(e,t,r){if(typeof e!="object")throw new Oe("options must be an object",Oe.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let a=s.length;for(;a-- >0;){const i=s[a],l=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(l){const u=e[i],d=u===void 0||l(u,i,e);if(d!==!0)throw new Oe("option "+i+" must be "+d,Oe.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Oe("Unknown option "+i,Oe.ERR_BAD_OPTION)}}const bm={assertOptions:cM,validators:Df},Ar=bm.validators;let pi=class{constructor(t){this.defaults=t||{},this.interceptors={request:new D5,response:new D5}}async request(t,r){try{return await this._request(t,r)}catch(s){if(s instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const i=(()=>{if(!a.stack)return"";const l=a.stack.indexOf(` `);return l===-1?"":a.stack.slice(l+1)})();try{if(!s.stack)s.stack=i;else if(i){const l=i.indexOf(` `),u=l===-1?-1:i.indexOf(` `,l+1),d=u===-1?"":i.slice(u+1);String(s.stack).endsWith(d)||(s.stack+=` `+i)}}catch{}}throw s}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=bi(this.defaults,r);const{transitional:s,paramsSerializer:a,headers:i}=r;s!==void 0&&bm.assertOptions(s,{silentJSONParsing:Ar.transitional(Ar.boolean),forcedJSONParsing:Ar.transitional(Ar.boolean),clarifyTimeoutError:Ar.transitional(Ar.boolean),legacyInterceptorReqResOrdering:Ar.transitional(Ar.boolean)},!1),a!=null&&(te.isFunction(a)?r.paramsSerializer={serialize:a}:bm.assertOptions(a,{encode:Ar.function,serialize:Ar.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),bm.assertOptions(r,{baseUrl:Ar.spelling("baseURL"),withXsrfToken:Ar.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let l=i&&te.merge(i.common,i[r.method]);i&&te.forEach(["delete","get","head","post","put","patch","query","common"],C=>{delete i[C]}),r.headers=Gn.concat(l,i);const u=[];let d=!0;this.interceptors.request.forEach(function(b){if(typeof b.runWhen=="function"&&b.runWhen(r)===!1)return;d=d&&b.synchronous;const w=r.transitional||wx;w&&w.legacyInterceptorReqResOrdering?u.unshift(b.fulfilled,b.rejected):u.push(b.fulfilled,b.rejected)});const m=[];this.interceptors.response.forEach(function(b){m.push(b.fulfilled,b.rejected)});let p,g=0,v;if(!d){const C=[U5.bind(this),void 0];for(C.unshift(...u),C.push(...m),v=C.length,p=Promise.resolve(r);g{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](a);s._listeners=null}),this.promise.then=a=>{let i;const l=new Promise(u=>{s.subscribe(u),i=u}).then(a);return l.cancel=function(){s.unsubscribe(i)},l},t(function(i,l,u){s.reason||(s.reason=new au(i,l,u),r(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=s=>{t.abort(s)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new vC(function(a){t=a}),cancel:t}}};function dM(e){return function(r){return e.apply(null,r)}}function mM(e){return te.isObject(e)&&e.isAxiosError===!0}const l0={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(l0).forEach(([e,t])=>{l0[t]=e});function yC(e){const t=new pi(e),r=X8(pi.prototype.request,t);return te.extend(r,pi.prototype,t,{allOwnKeys:!0}),te.extend(r,t,null,{allOwnKeys:!0}),r.create=function(a){return yC(bi(e,a))},r}const rn=yC(su);rn.Axios=pi;rn.CanceledError=au;rn.CancelToken=uM;rn.isCancel=mC;rn.VERSION=Sx;rn.toFormData=If;rn.AxiosError=Oe;rn.Cancel=rn.CanceledError;rn.all=function(t){return Promise.all(t)};rn.spread=dM;rn.isAxiosError=mM;rn.mergeConfig=bi;rn.AxiosHeaders=Gn;rn.formToJSON=e=>dC(te.isHTMLForm(e)?new FormData(e):e);rn.getAdapter=xC.getAdapter;rn.HttpStatusCode=l0;rn.default=rn;const{Axios:mle,AxiosError:fle,CanceledError:hle,isCancel:ple,CancelToken:gle,VERSION:xle,all:vle,Cancel:yle,isAxiosError:ble,spread:Cle,toFormData:wle,AxiosHeaders:jle,HttpStatusCode:Sle,formToJSON:kle,getAdapter:Nle,mergeConfig:Ele,create:Ale}=rn,fM=new Set(["console.tailscale.com","console.staging.tailscale.com"]);function hM(e,t){const r=typeof e.consoleMode=="boolean"?e.consoleMode:t!==void 0&&fM.has(t),s=typeof e.controlOrigin=="string"?e.controlOrigin:r?"https://login.tailscale.com":"";return{isConsoleMode:r,controlOrigin:s}}function pM(){if(typeof document>"u")return{};try{const e=document.querySelector("#tailscale-runtime-config");if(!e?.textContent)return{};const t=JSON.parse(e.textContent);return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}const bC=hM(pM(),globalThis.location?.hostname),gr=bC.isConsoleMode;function _f(){return bC.controlOrigin}let Nx="";function Ex(e){typeof e=="string"&&e&&(Nx=e)}function Lm(){return _f()||Nx}function vr(e,t){const r=(_f()||Nx)+e;if(t?.returnTo&&gr){const s=e.includes("?")?"&":"?";return r+s+"next_url="+encodeURIComponent(t.returnTo)}return r}function gM(e){return gr?globalThis.location.origin+e:e}let CC=0,c0;function Yn(){const e=Date.now()+CC;return new Date(e)}function xM(e){if(!e||!vM())return;const t=new Date(e);if(Number.isNaN(t.getTime()))return;const r=new Date;CC=t.getTime()-r.getTime(),c0=t}function vM(){const e=Yn();return e.setSeconds(e.getSeconds()-29),c0===void 0||c0=t?(this.tokens-=t,!0):!1}getAvailableTokens(){return this.refill(),Math.floor(this.tokens)}}const bM=new yM({capacity:3,refillRate:1});let Wd=0;function al(e){const t={name:e.name,message:e.message,stacktrace:SM(e.stack),pageUrl:globalThis.location.href};jM(e)&&e.config&&(t.extra={method:e.config.method,url:e.config.url,params:jC(e.config.params),data:wM(e.config.data)}),bM.tryConsume()?(Wd>0&&(t.extra={...t.extra,droppedExceptionReports:Wd},Wd=0),Ie.post("/public/events/exception",t).catch(()=>{})):(Wd++,console.error("Exception report dropped due to rate limit:",t))}function wC(e){if(e instanceof Error)return e;if(typeof e=="string")return new Error(e);try{return new Error(JSON.stringify(e))}catch{return new Error(String(e))}}function jC(e){if(!(!e||typeof e!="object"))return Object.fromEntries(Object.entries(e).filter(([t])=>CM.has(t)))}const CM=new Set(["state","type"]);function wM(e){if(typeof e=="string")try{const t=JSON.parse(e);if(typeof t=="object")return jC(t)}catch{}}function jM(e){return"isAxiosError"in e&&e.isAxiosError===!0}function SM(e){if(e===void 0)return;const t=[],r=e.split(` `);let s,a,i,l;return r.forEach(u=>{if(i=kM.exec(u))s=i[2]&&i[2].indexOf("eval")===0,s&&(a=PM.exec(i[2]))&&(i[2]=a[1],i[3]=a[2],i[4]=a[3]),l={filename:i[2]&&i[2].indexOf("address at ")===0?i[2].slice(11):i[2],function:i[1]||Kd,lineno:i[3]?+i[3]:void 0,colno:i[4]?+i[4]:void 0};else if(i=EM.exec(u))l={filename:i[2],function:i[1]||Kd,lineno:+i[3],colno:i[4]?+i[4]:void 0};else if(i=NM.exec(u))s=i[3]&&i[3].includes(" > eval"),s&&(a=AM.exec(i[3]))&&(i[1]=i[1]||"eval",i[3]=a[1],i[4]=a[2],i[5]=""),l={filename:i[3],function:i[1]||Kd,lineno:i[4]?+i[4]:void 0,colno:i[5]?+i[5]:void 0};else return;!l.function&&l.lineno&&(l.function=Kd),t.push(l)}),t.length>0?{frames:t}:void 0}const Kd="?",kM=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack||[a-z-]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,NM=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code]|[^@]*(?:bundle|\d+\.js)|\/[\w ./=-]+)(?::(\d+))?(?::(\d+))?\s*$/i,EM=/^\s*at (?:((?:\[object object])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,AM=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,PM=/\((\S*):(\d+):(\d+)\)/,$5=new Set,H5=new Map;function O(e,t,r){if(r?.once){if($5.has(e))return;$5.add(e)}if(r?.throttleMs){const s=Date.now(),a=H5.get(e);if(a&&s-a{console.error(s),al(s)})}const R={MachinesEmptyStateViewed:"Machines Empty State Viewed",AddDeviceButtonClicked:"Add Device Button Clicked",AddFirstDeviceClicked:"Add First Device Clicked",AddSecondDeviceClicked:"Add Second Device Clicked",AddLinuxServerClicked:"Add Linux Server Clicked",AddClientDeviceClicked:"Add Client Device Clicked",AddLinuxServerGenerateScriptClicked:"Add Linux Server Generate Script Clicked",AddClientDeviceDialogSendEmailButtonClicked:"Add Client Device Dialog Send Email Button Clicked",AddClientDeviceDialogCopyLinkButtonClicked:"Add Client Device Dialog Copy Link Button Clicked",AddClientDeviceDialogShareButtonClicked:"Add Client Device Dialog Share Button Clicked",AddClientDeviceDialogEmailTabViewed:"Add Client Device Dialog Email Tab Viewed",AddClientDeviceDialogCopyTabViewed:"Add Client Device Dialog Copy Tab Viewed",AddClientDeviceDialogGuideTabViewed:"Add Client Device Dialog Guide Tab Viewed",AddDevicesBannerButtonClicked:"Add Devices Banner Button Clicked",MachinesSearchFocused:"Machines Search Focused",MachinesSearchSubmitted:"Machines Search Submitted",MachinesFilterDropdownOpened:"Machines Filter Dropdown Opened",MachinesFilterCategorySelected:"Machines Filter Category Selected",MachinesFilterAdded:"Machines Filter Added",MachinesDownloadClicked:"Machines Download Clicked",MachinesCSVDownloaded:"Machines CSV Downloaded",MachineMenuOpened:"Machine Menu Opened",MachineEditIPv4Selected:"Machine Edit IPv4 Selected",MachineViewRecentActivitySelected:"Machine View Recent Activity Selected",MachineRemoveSelected:"Machine Remove Selected",MachineRemoved:"Machine Removed",MachineIPv4Updated:"Machine IPv4 Updated",MachineAddressesDropdownOpened:"Machine Addresses Dropdown Opened",MachineDetailClicked:"Machine Detail Clicked",OnboardingCompleted:"Onboarding Completed",OnboardingSkipped:"Onboarding Skipped",OnboardingStepViewed:"Onboarding Step Viewed",OnboardingSurveyBackfillViewed:"Onboarding Survey Backfill Viewed",OnboardingSurveyBackfillSubmitted:"Onboarding Survey Backfill Submitted",OnboardingSurveyBackfillDismissed:"Onboarding Survey Backfill Dismissed",UseCaseCardClicked:"Use Case Card Clicked",UseCaseFeedbackClicked:"Use Case Feedback Clicked",UseCaseClicked:"Use Case Clicked",OnboardingCheckoutStarted:"Onboarding Checkout Started",OnboardingCheckoutSkipped:"Onboarding Checkout Skipped",ConfigLogUsersFilterReset:"ConfigLog Users Filter Reset",ConfigLogTargetFilterReset:"ConfigLog Target Filter Reset",ConfigLogTypesFilterReset:"ConfigLog Types Filter Reset",ConfigLogDateFilterUpdated:"ConfigLog Date Filter Updated",ConfigLogTypesFilterUpdated:"ConfigLog Types Filter Updated",ConfigLogUsersFilterUpdated:"ConfigLog Users Filter Updated",ConfigLogCustomTargetSearchTriggered:"ConfigLog Custom Target Search Triggered",ConfigLogCustomUserSearchTriggered:"ConfigLog Custom User Search Triggered",SSHQuickstartBackToMachinesClicked:"SSH Quickstart Back To Machines Clicked",SSHQuickstartDocsLinkClicked:"SSH Quickstart Docs Link Clicked",SSHQuickstartEnableCommandCopied:"SSH Quickstart Enable Command Copied",SSHQuickstartAddDefaultRuleClicked:"SSH Quickstart Add Default Rule Clicked",SSHQuickstartAccessControlsLinkClicked:"SSH Quickstart Access Controls Link Clicked",SSHQuickstartConnectCommandCopied:"SSH Quickstart Connect Command Copied",SSHQuickstartAdvancedUseCaseClicked:"SSH Quickstart Advanced Use Case Clicked",ExitNodeQuickstartPageViewed:"Exit Node Quickstart Page Viewed",ExitNodeQuickstartBackToMachinesClicked:"Exit Node Quickstart Back To Machines Clicked",ExitNodeQuickstartDocsLinkClicked:"Exit Node Quickstart Docs Link Clicked",ExitNodeQuickstartAdvertiseCommandCopied:"Exit Node Quickstart Advertise Command Copied",ExitNodeQuickstartFixIPForwardingLinkClicked:"Exit Node Quickstart Fix IP Forwarding Link Clicked",ExitNodeQuickstartAllowRoutingToggled:"Exit Node Quickstart Allow Routing Toggled",ExitNodeQuickstartGoingFurtherClicked:"Exit Node Quickstart Going Further Clicked",ExitNodeDialogOpened:"Exit Node Dialog Opened",ExitNodeDialogAllowRoutingChanged:"Exit Node Dialog Allow Routing Changed",ExitNodeDialogSaved:"Exit Node Dialog Saved",SubnetRouterQuickstartPageViewed:"Subnet Router Quickstart Page Viewed",SubnetRouterQuickstartBackToMachinesClicked:"Subnet Router Quickstart Back To Machines Clicked",SubnetRouterQuickstartDocsLinkClicked:"Subnet Router Quickstart Docs Link Clicked",SubnetRouterQuickstartAdvertiseCommandCopied:"Subnet Router Quickstart Advertise Command Copied",SubnetRouterQuickstartFixIPForwardingLinkClicked:"Subnet Router Quickstart Fix IP Forwarding Link Clicked",SubnetRouterQuickstartRouteCheckboxChanged:"Subnet Router Quickstart Route Checkbox Changed",SubnetRouterQuickstartSaved:"Subnet Router Quickstart Saved",SubnetRouterQuickstartGoingFurtherClicked:"Subnet Router Quickstart Going Further Clicked",SubnetRouterDialogOpened:"Subnet Router Dialog Opened",SubnetRouterDialogFixIPForwardingLinkClicked:"Subnet Router Dialog Fix IP Forwarding Link Clicked",SubnetRouterDialogRouteCheckboxChanged:"Subnet Router Dialog Route Checkbox Changed",SubnetRouterDialogSaved:"Subnet Router Dialog Saved",OpenedMachineSSHSession:"Opened machine SSH session",ClosedMachineSSHSession:"Closed machine SSH session",InvoiceDownloaded:"Invoice downloaded",OpenedAWSCloudFormationQuickStart:"Opened AWS CloudFormation QuickStart",LearnMoreLinkClicked:"Learn more link clicked",VisualEditorAddClicked:"Visual Editor Add Clicked",VisualEditorEditClicked:"Visual Editor Edit Clicked",VisualEditorDeleteClicked:"Visual Editor Delete Clicked",VisualEditorSaveClicked:"Visual Editor Save Clicked",HeaderLogoClicked:"Header Logo Clicked",HeaderHelpClicked:"Header Help Clicked",HeaderHelpDownloadLinkClicked:"Header Help Download Link Clicked",HeaderHelpGiveFeedbackLinkClicked:"Header Help Give Feedback Link Clicked",HeaderHelpSupportLinkClicked:"Header Help Support Link Clicked",HeaderHelpDocsLinkClicked:"Header Help Docs Link Clicked",HeaderHelpUseCaseGuidesLinkClicked:"Header Help Use Case Guides Link Clicked",SwitchTailnet:"Switch Tailnet",UserMenuClicked:"User Menu Clicked",LogoutMenuItemClicked:"Logout Menu Item Clicked",NewCopyCardClicked:"new copy card clicked",OpenedShareFromDropdown:"Opened share from dropdown",OpenedShareFromQuickActions:"Opened share from quick actions",OpenedShareFromMachineHeader:"Opened share from machine header",RequestedThemeChanged:"Requested Theme Changed",ACLSwitchToggled:"ACL Switch Toggled",UpgradePlanButtonClicked:"Upgrade Plan Button Clicked",SwitchPlanButtonClicked:"Switch Plan Button Clicked",ContactSalesButtonClicked:"Contact Sales Button Clicked",ManageAddonsButtonClicked:"Manage Addons Button Clicked",BackToBillingClicked:"Back To Billing Clicked",ComparePlansClicked:"Compare Plans Clicked",ComparePlansInDetailLinkClicked:"Compare Plans In Detail Link Clicked",DowngradeToPersonalButtonClicked:"Downgrade To Personal Button Clicked",CancelSubscriptionButtonClicked:"Cancel Subscription Button Clicked",SelectPersonalPlanButtonClicked:"Select Personal Plan Button Clicked",ContactSupportClicked:"Contact Support Clicked",UpgradeToHybridStandardPlanButtonClicked:"Upgrade To Hybrid Standard Plan Button Clicked",DowngradeToHybridStandardPlanButtonClicked:"Downgrade To Hybrid Standard Plan Button Clicked",UpgradeToHybridPremiumPlanButtonClicked:"Upgrade To Hybrid Premium Plan Button Clicked",ApertureGetStartedClicked:"Aperture Get Started Clicked",ExplorePlatformExtensionsExpanded:"Explore Platform Extensions Expanded",TrialAddonWarningModalViewed:"Trial Addon Warning Modal Viewed",TrialAddonWarningModalConfirmed:"Trial Addon Warning Modal Confirmed",TrialAddonWarningModalDismissed:"Trial Addon Warning Modal Dismissed",UsageTabClicked:"Usage Tab Clicked",AddOnsTabClicked:"Add-Ons Tab Clicked",InvoicesTabClicked:"Invoices Tab Clicked",BillingDetailsTabClicked:"Billing Details Tab Clicked",EditMullvadBillingButtonClicked:"Edit Mullvad Billing Button Clicked",PurchaseMullvadVPNButtonClicked:"Purchase Mullvad VPN Button Clicked",PurchaseMoreSeatsButtonClicked:"Purchase More Seats Button Clicked",EditSeatsAmountButtonClicked:"Edit Seats Amount Button Clicked",PurchaseMoreMullvadDevicesButtonClicked:"Purchase More Mullvad Devices Button Clicked",PurchaseMoreTaggedResourcesButtonClicked:"Purchase More Tagged Resources Button Clicked",PurchaseTaggedResourcesTileClicked:"Purchase Tagged Resources Tile Clicked",LearnMoreTaggedResourcesClicked:"Learn More Tagged Resources Clicked",PurchaseMullvadTileClicked:"Purchase Mullvad Tile Clicked",MullvadAwarenessBannerPurchaseClicked:"Mullvad Awareness Banner Purchase Clicked",MullvadAwarenessBannerLearnMoreClicked:"Mullvad Awareness Banner Learn More Clicked",MullvadAwarenessBannerDismissClicked:"Mullvad Awareness Banner Dismiss Clicked",EditPaymentMethodButtonClicked:"Edit Payment Method Button Clicked",AddPaymentMethodButtonClicked:"Add Payment Method Button Clicked",EditBillingEmailButtonClicked:"Edit Billing Email Button Clicked",EditBillingAddressButtonClicked:"Edit Billing Address Button Clicked",AddBillingEmailButtonClicked:"Add Billing Email Button Clicked",EditInvoiceDetailsButtonClicked:"Edit Invoice Details Button Clicked",AddInvoiceDetailsButtonClicked:"Add Invoice Details Button Clicked",AddTaxIDButtonClicked:"Add Tax ID Button Clicked",HybridPlanSeatInputValueChanged:"Hybrid Plan Seat Input Value Changed",BillingEmailInputFocused:"Billing Email Input Focused",StripeBillingAddressElementLoaded:"Stripe Billing Address Element Loaded",ContinueToPaymentDetailsButtonClicked:"Continue To Payment Details Button Clicked",StripePaymentElementLoaded:"Stripe Payment Element Loaded",HybridSeatsFAQToggled:"Hybrid Seats FAQ Toggled",PromoCodeInputFocused:"Promo Code Input Focused",PromoCodeAppliedFromURL:"Promo Code Applied From URL",PromoCodeApplyButtonClicked:"Promo Code Apply Button Clicked",PromoCodeRemoveButtonClicked:"Promo Code Remove Button Clicked",ConfirmUpgradeButtonClicked:"Confirm Upgrade Button Clicked",ConfirmDowngradeButtonClicked:"Confirm Downgrade Button Clicked",PurchasePlanButtonClicked:"Purchase Plan Button Clicked",CustomerPlanChangeSuccessful:"Customer Plan Change Successful",CustomerPlanChangeFailed:"Customer Plan Change Failed",UpcomingInvoiceClicked:"Upcoming Invoice Clicked",UpcomingInvoiceDialogViewed:"Upcoming Invoice Dialog Viewed",UpcomingInvoiceDialogClosed:"Upcoming Invoice Dialog Closed",SeatsUsageSectionToggled:"Seats Usage Section Toggled",UserDevicesUsageSectionToggled:"User Devices Usage Section Toggled",MullvadDevicesUsageSectionToggled:"Mullvad Devices Usage Section Toggled",TaggedResourcesUsageSectionToggled:"Tagged Resources Usage Section Toggled",SelectMullvadAddonButtonClicked:"Select Mullvad Addon Button Clicked",SelectTaggedResourcesAddonButtonClicked:"Select Tagged Resources Addon Button Clicked",RemoveMullvadAddonButtonClicked:"Remove Mullvad Addon Button Clicked",RemoveTaggedResourcesAddonButtonClicked:"Remove Tagged Resources Addon Button Clicked",MullvadDeviceInputValueChanged:"Mullvad Device Input Value Changed",TaggedResourcesInputValueChanged:"Tagged Resources Input Value Changed",MullvadDeviceSelectionInfoViewed:"Mullvad Device Selection Info Viewed",GiveDevicesMullvadVPNAccessClicked:"Give Devices Mullvad VPN Access Clicked",SubscriptionAddonChangeSuccessful:"Subscription Addon Change Successful",SubscriptionAddonChangeFailed:"Subscription Addon Change Failed",SelectHybridStandardPlanButtonClicked:"Select Hybrid Standard Plan Button Clicked",SelectHybridPremiumPlanButtonClicked:"Select Hybrid Premium Plan Button Clicked",ChooseAPlanButtonClicked:"Choose A Plan Button Clicked",TrialExpiredBannerViewed:"Trial Expired Banner Viewed",TrialExpiredBannerPromoCodeCopied:"Trial Expired Banner Promo Code Copied",LearnMoreMullvadVPNClicked:"Learn More Mullvad VPN Clicked",MullvadVPNTermsLinkClicked:"Mullvad VPN Terms Link Clicked",LearnMoreSeatsClicked:"Learn More Seats Clicked",SeatCalculatorLinkClicked:"Seat Calculator Link Clicked",SeatCalculatorTabChanged:"Seat Calculator Tab Changed",SeatCalculatorPlanSelected:"Seat Calculator Plan Selected",SeatCalculatorSwitchPlanClicked:"Seat Calculator Switch Plan Clicked",SeatCalculatorBreakdownToggled:"Seat Calculator Breakdown Toggled",SeatCalculatorEstimateChanged:"Seat Calculator Estimate Changed",SeatCalculatorEditUsersClicked:"Seat Calculator Edit Users Clicked",SeatCalculatorContactSalesClicked:"Seat Calculator Contact Sales Clicked",DowngradeSurveyDialogOpened:"Downgrade Survey Dialog Opened",DowngradeSurveyDialogClosed:"Downgrade Survey Dialog Closed",DowngradeSurveyReasonSelected:"Downgrade Survey Reason Selected",DowngradeSurveyCommentsInputChanged:"Downgrade Survey Comments Input Changed",DowngradeSurveyDialogConfirmed:"Downgrade Survey Dialog Confirmed",UpgradeSuccessDialogOpened:"Upgrade Success Dialog Opened",UpgradeSuccessDialogClosed:"Upgrade Success Dialog Closed",EmbeddedDowngradeSurveyDialogOpened:"Embedded Downgrade Survey Dialog Opened",EmbeddedDowngradeSurveyDialogConfirmed:"Embedded Downgrade Survey Dialog Confirmed",ChoosePersonalPlanDialogOpened:"Choose Personal Plan Dialog Opened",ChoosePersonalPlanDialogClosed:"Choose Personal Plan Dialog Closed",ChoosePersonalPlanDialogConfirmButtonClicked:"Choose Personal Plan Dialog Confirm Button Clicked",PersonalPlanTermsAgreed:"Personal Plan Terms Agreed",PersonalPlanSalesLedBlocked:"Personal Plan Sales Led Blocked",PersonalPlanReviewUsersButtonClicked:"Personal Plan Review Users Button Clicked",CloudMarketplaceAwarenessCardViewed:"Cloud Marketplace Awareness Card Viewed",CloudMarketplaceAwarenessCardDismissed:"Cloud Marketplace Awareness Card Dismissed",BuyWithAWSButtonClicked:"Buy With AWS Button Clicked",RequestPrivateAWSOfferButtonClicked:"Request Private AWS Offer Button Clicked",BuyWithAzureButtonClicked:"Buy With Azure Button Clicked",StepperAddOnsStepClicked:"Stepper Add-ons Step Clicked",StepperPlansStepClicked:"Stepper Plans Step Clicked",StepperCalculateStepClicked:"Stepper Calculate Step Clicked",StepperBillingDetailsStepClicked:"Stepper Billing Details Step Clicked",StepperPaymentStepClicked:"Stepper Payment Step Clicked",ViewPlansFromRequiredHybridPlanBadgeClicked:"View Plans From Required Hybrid Plan Badge Clicked",CancelScheduledChangesButtonClicked:"Cancel Scheduled Changes Button Clicked",CancelScheduledChangesDialogOpened:"Cancel Scheduled Changes Dialog Opened",CancelScheduledChangesDialogClosed:"Cancel Scheduled Changes Dialog Closed",CancelAllScheduledChangesClicked:"Cancel All Scheduled Changes Clicked",CancelIndividualScheduledChangeClicked:"Cancel Individual Scheduled Change Clicked",CancelScheduledPlanChangeClicked:"Cancel Scheduled Plan Change Clicked",SendWelcomeEmailClicked:"Send welcome email clicked",InviteYourTeamDialogOpened:"Invite Your Team Dialog Opened",InviteYourTeamDialogClosed:"Invite Your Team Dialog Closed",InviteYourTeamRoleDropdownClicked:"Invite Your Team Role Dropdown Clicked",InviteYourTeamRoleSelected:"Invite Your Team Role Selected",InviteYourTeamEmailsAdded:"Invite Your Team Emails Added",InviteYourTeamEmailsCleared:"Invite Your Team Emails Cleared",InviteYourTeamSendInvitesButtonClicked:"Invite Your Team Send Invites Button Clicked",InviteYourTeamRetryButtonClicked:"Invite Your Team Retry Button Clicked",InviteYourTeamGithubDocsLinkClicked:"Invite Your Team GitHub Docs Link Clicked",InviteYourTeamCancelButtonClicked:"Invite Your Team Cancel Button Clicked",InviteYourTeamCloseButtonClicked:"Invite Your Team Close Button Clicked",InviteYourTeamEmailChipDeleted:"Invite Your Team Email Pill Deleted",InviteYourTeamAdminConsoleLinkClicked:"Invite Your Team Admin Console Link Clicked",InvitingYourTeamLearnMoreDocsLinkClicked:"Inviting Your Team Learn More Docs Link Clicked",InviteYourTeamEmailTemplateCopied:"Invite Your Team Email Template Copied",InviteYourTeamValidationWarningViewed:"Invite Your Team Validation Warning Viewed",InviteYourTeamSubmitResultViewed:"Invite Your Team Submit Result Viewed",InviteExternalUserClicked:"Invite external user clicked",InviteLinkCopied:"Invite Link Copied",InviteTeamMailtoLinkClicked:"Invite Team Mailto Link Clicked",InviteUsersButtonClicked:"Invite Users Button Clicked",InMyOrgMenuItemClicked:"In My Org MenuItem Clicked",OutsideMyOrgMenuItemClicked:"Outside My Org MenuItem Clicked",InviteYourTeamBannerViewed:"Invite Your Team Banner Viewed",SendInvitesButtonClicked:"Send Invites Button Clicked",InviteYourTeamBannerDismissButtonClicked:"Invite Your Team Banner Dismiss Button Clicked",InviteExternalUserDialogOpened:"Invite External User Dialog Opened",InviteExternalUserDialogClosed:"Invite External User Dialog Closed",InviteExternalUserDocsLinkClicked:"Invite External User Docs Link Clicked",InviteExternalUserRoleSelected:"Invite External User Role Selected",InviteExternalUserCopyLinkButtonClicked:"Invite External User Copy Link Button Clicked",InviteExternalUserSendInviteButtonClicked:"Invite External User Send Invite Button Clicked",InviteExternalUserTabSelected:"Invite External User Tab Selected",InviteExternalUserRoleDropdownClicked:"Invite External User Role Dropdown Clicked",InviteExternalUserEmailInputBlurred:"Invite External User Email Input Blurred",WelcomeEmailDialogOpened:"Welcome Email Dialog Opened",WelcomeEmailRoleDropdownClicked:"Welcome Email Role Dropdown Clicked",WelcomeEmailRoleSelected:"Welcome Email Role Selected",WelcomeEmailEmailInputBlurred:"Welcome Email Email Input Blurred",WelcomeEmailAdminConsoleLinkClicked:"Welcome Email Admin Console Link Clicked",WelcomeEmailLearnMoreDocsLinkClicked:"Welcome Email Learn More Docs Link Clicked",WelcomeEmailUpgradePlanLinkClicked:"Welcome Email Upgrade Plan Link Clicked",WelcomeEmailBillingPageLinkClicked:"Welcome Email Billing Page Link Clicked",WelcomeEmailGithubDocsLinkClicked:"Welcome Email GitHub Docs Link Clicked",UsersHeaderAdminConsoleLinkClicked:"Users Header Admin Console Link Clicked",UsersHeaderEditSettingsLinkClicked:"Users Header Edit Settings Link Clicked",TrustCredentials:{LearnMoreClicked:"Trust Credentials Learn More Clicked",Searched:"Trust Credentials Searched",SearchCleared:"Trust Credentials Search Cleared",FilterDropdownOpened:"Trust Credentials Filter Dropdown Opened",FilterAdded:"Trust Credentials Filter Added",FilterRemoved:"Trust Credentials Filter Removed",FilterEdited:"Trust Credentials Filter Edited",DetailsExpanded:"Trust Credentials Details Expanded",DetailsContracted:"Trust Credentials Details Contracted",DetailsCopiedToClipboard:"Trust Credentials Details Copied to Clipboard",ContextMenuOpened:"Trust Credentials Context Menu Opened",ContextMenuDismissed:"Trust Credentials Context Menu Dismissed",RevokeClickedInContextMenu:"Trust Credentials Revoke Clicked in Context Menu",RevokeClickedInModal:"Trust Credentials Revoke Clicked in Modal",RevokeModalDismissed:"Trust Credentials Revoke Modal Dismissed",CreateButtonClicked:"Trust Credentials Create Button Clicked",ViewClickedInContextMenu:"Trust Credentials View Clicked in Context Menu",EditClickedInContextMenu:"Trust Credentials Edit Clicked in Context Menu",Wizard:{TypeSelected:"Trust Credentials Wizard Type Selected",DescriptionFieldEdited:"Trust Credentials Wizard Description Field Edited",OIDCDetailFieldEdited:"Trust Credentials Wizard OIDC Detail Field Edited",ContinuedToPage2:"Trust Credentials Wizard Continued to Page 2",ExitedViaBreadcrumb:"Trust Credentials Wizard Exited via Breadcrumb",ScopesLearnMoreClicked:"Trust Credentials Wizard Scopes Learn More Clicked",PresetScopesDropdownOpened:"Trust Credentials Wizard Preset Scopes Dropdown Opened",PresetScopeSelected:"Trust Credentials Wizard Preset Scope Selected",PresetScopesDropdownDismissed:"Trust Credentials Wizard Preset Scopes Dropdown Dismissed",ScopesSectionExpanded:"Trust Credentials Wizard Scopes Section Expanded",ScopesSectionContracted:"Trust Credentials Wizard Scopes Section Contracted",ScopeSelected:"Trust Credentials Wizard Scope Selected",ScopeDeselected:"Trust Credentials Wizard Scope Deselected",SaveButtonClicked:"Trust Credentials Wizard Save Button Clicked",BackButtonClicked:"Trust Credentials Wizard Back Button Clicked",SuccessfullySaved:"Trust Credentials Wizard Successfully Saved"}},DisableUserApprovalDialogOpened:"Disable User Approval Dialog Opened",DisableUserApprovalDialogClosed:"Disable User Approval Dialog Closed",DisableUserApprovalDialogConfirmed:"Disable User Approval Dialog Confirmed",DisableUserApprovalLearnMoreClicked:"Disable User Approval Learn More Clicked",ExperimentExposure:"$exposure",SolutionGuidesTileClicked:"Solution Guides Tile Clicked",SolutionGuidesVideoLinkClicked:"Solution Guides Video Link Clicked",SolutionGuidesDismissed:"Solution Guides Dismissed",SolutionGuidesUseCaseChanged:"Solution Guides Use Case Changed",ResourceHubTaskOpened:"Resource Hub Task Opened",ResourceHubStepActionClicked:"Resource Hub Step Action Clicked",ResourceHubHelpLinkClicked:"Resource Hub Help Link Clicked",ResourceHubInstallOptionClicked:"Resource Hub Install Option Clicked",ACLAwarenessSetUpClicked:"ACL Awareness Set Up Clicked",ACLAwarenessSeeHowClicked:"ACL Awareness See How Clicked",ApertureBannerSignupClicked:"Aperture Awareness Sign Up Clicked",ApertureAwarenessBannerDismissed:"Aperture Awareness Banner Dismissed",PAMEnableButtonClicked:"PAM Enable Button Clicked",PAMLaunchButtonClicked:"PAM Launch Button Clicked",PAMLearnMoreLinkClicked:"PAM Learn More Link Clicked",PAMReconnectButtonClicked:"PAM Reconnect Button Clicked"},K={Onboarding:"onboarding",Billing:"billing",Machines:"machines",Users:"users",Settings:"settings",Header:"header",ResourceHub:"resource_hub",Logs:"logs",Services:"services"},oe={AddOns:"addons",AddonCheckout:"addon_checkout",Checkout:"checkout",EmptyState:"empty_state",Root:"root",Plans:"plans",PageHeader:"page_header",TrialExpiredBanner:"trial_expired_banner",TrialBadge:"trial_badge",FreeUpgradeBadge:"free_upgrade_badge",InviteYourTeamBanner:"invite_your_team_banner",TrustCredentials:"trust_credentials",InviteDialog:"invite_dialog",ManageSyncGroups:"manage_sync_groups",SSHQuickstart:"ssh_quickstart",ExitNodeQuickstart:"exit_node_quickstart",ExitNodeDialog:"exit_node_dialog",SubnetRouterQuickstart:"subnet_router_quickstart",SubnetRouterDialog:"subnet_router_dialog",Usage:"usage",Invoices:"invoices",BillingDetails:"billing_details",RequiredHybridPlanBadge:"required_hybrid_plan_badge",PlansPlatformExtensions:"plans_platform_extensions",SeatCalculator:"seat_calculator",UserApproval:"user_approval",MullvadSettings:"mullvad_settings",MullvadAwarenessBanner:"mullvad_awareness_banner",AclAwarenessNav:"acl_awareness_nav",PAM:"pam_border0",ApertureAwarenessBanner:"aperture_awareness_banner",LogsView:"logs_view",ServicesView:"services_view"};function Zn({children:e,className:t="link",type:r,eventProperties:s}){const a="https://tailscale.com/contact/support",i=r?`${a}?type=${encodeURIComponent(r)}#support-form`:`${a}#support-form`;return n.jsx("a",{href:i,className:t,rel:"noopener noreferrer",target:"_blank",onClick:()=>O(R.ContactSupportClicked,{eventProperties:s}),children:e})}function u0({children:e,className:t="link-underline",eventProperties:r}){return n.jsx("a",{href:"https://tailscale.com/contact/sales/",className:t,rel:"noopener noreferrer",target:"_blank",onClick:()=>O(R.ContactSalesButtonClicked,{eventProperties:r}),children:e})}var Ax=ou(),it=e=>iu(e,Ax),Px=ou();it.write=e=>iu(e,Px);var Mf=ou();it.onStart=e=>iu(e,Mf);var Tx=ou();it.onFrame=e=>iu(e,Tx);var Ix=ou();it.onFinish=e=>iu(e,Ix);var Io=[];it.setTimeout=(e,t)=>{const r=it.now()+t,s=()=>{const i=Io.findIndex(l=>l.cancel==s);~i&&Io.splice(i,1),Na-=~i?1:0},a={time:r,handler:e,cancel:s};return Io.splice(SC(r),0,a),Na+=1,kC(),a};var SC=e=>~(~Io.findIndex(t=>t.time>e)||~Io.length);it.cancel=e=>{Mf.delete(e),Tx.delete(e),Ix.delete(e),Ax.delete(e),Px.delete(e)};it.sync=e=>{d0=!0,it.batchedUpdates(e),d0=!1};it.throttle=e=>{let t;function r(){try{e(...t)}finally{t=null}}function s(...a){t=a,it.onStart(r)}return s.handler=e,s.cancel=()=>{Mf.delete(r),t=null},s};var Dx=typeof window<"u"?window.requestAnimationFrame:(()=>{});it.use=e=>Dx=e;it.now=typeof performance<"u"?()=>performance.now():Date.now;it.batchedUpdates=e=>e();it.catch=console.error;it.frameLoop="always";it.advance=()=>{it.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):EC()};var ka=-1,Na=0,d0=!1;function iu(e,t){d0?(t.delete(e),e(0)):(t.add(e),kC())}function kC(){ka<0&&(ka=0,it.frameLoop!=="demand"&&Dx(NC))}function TM(){ka=-1}function NC(){~ka&&(Dx(NC),it.batchedUpdates(EC))}function EC(){const e=ka;ka=it.now();const t=SC(ka);if(t&&(AC(Io.splice(0,t),r=>r.handler()),Na-=t),!Na){TM();return}Mf.flush(),Ax.flush(e?Math.min(64,ka-e):16.667),Tx.flush(),Px.flush(),Ix.flush()}function ou(){let e=new Set,t=e;return{add(r){Na+=t==e&&!e.has(r)?1:0,e.add(r)},delete(r){return Na-=t==e&&e.has(r)?1:0,e.delete(r)},flush(r){t.size&&(e=new Set,Na-=t.size,AC(t,s=>s(r)&&e.add(s)),Na+=e.size,t=e)}}}function AC(e,t){e.forEach(r=>{try{t(r)}catch(s){it.catch(s)}})}var IM=Object.defineProperty,DM=(e,t)=>{for(var r in t)IM(e,r,{get:t[r],enumerable:!0})},Jr={};DM(Jr,{assign:()=>MM,colors:()=>Ta,createStringInterpolator:()=>Mx,skipAnimation:()=>TC,to:()=>PC,willAdvance:()=>Lx});function m0(){}var _M=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}),ye={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function Os(e,t){if(ye.arr(e)){if(!ye.arr(t)||e.length!==t.length)return!1;for(let r=0;re.forEach(t);function ys(e,t,r){if(ye.arr(e)){for(let s=0;sye.und(e)?[]:ye.arr(e)?e:[e];function Cc(e,t){if(e.size){const r=Array.from(e);e.clear(),ut(r,t)}}var gc=(e,...t)=>Cc(e,r=>r(...t)),_x=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Mx,PC,Ta=null,TC=!1,Lx=m0,MM=e=>{e.to&&(PC=e.to),e.now&&(it.now=e.now),e.colors!==void 0&&(Ta=e.colors),e.skipAnimation!=null&&(TC=e.skipAnimation),e.createStringInterpolator&&(Mx=e.createStringInterpolator),e.requestAnimationFrame&&it.use(e.requestAnimationFrame),e.batchedUpdates&&(it.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Lx=e.willAdvance),e.frameLoop&&(it.frameLoop=e.frameLoop)},wc=new Set,Tr=[],B1=[],Rm=0,Lf={get idle(){return!wc.size&&!Tr.length},start(e){Rm>e.priority?(wc.add(e),it.onStart(LM)):(IC(e),it(f0))},advance:f0,sort(e){if(Rm)it.onFrame(()=>Lf.sort(e));else{const t=Tr.indexOf(e);~t&&(Tr.splice(t,1),DC(e))}},clear(){Tr=[],wc.clear()}};function LM(){wc.forEach(IC),wc.clear(),it(f0)}function IC(e){Tr.includes(e)||DC(e)}function DC(e){Tr.splice(RM(Tr,t=>t.priority>e.priority),0,e)}function f0(e){const t=B1;for(let r=0;r0}function RM(e,t){const r=e.findIndex(t);return r<0?e.length:r}var OM={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Qr="[-+]?\\d*\\.?\\d+",Om=Qr+"%";function Rf(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var FM=new RegExp("rgb"+Rf(Qr,Qr,Qr)),BM=new RegExp("rgba"+Rf(Qr,Qr,Qr,Qr)),UM=new RegExp("hsl"+Rf(Qr,Om,Om)),VM=new RegExp("hsla"+Rf(Qr,Om,Om,Qr)),$M=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,HM=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,zM=/^#([0-9a-fA-F]{6})$/,WM=/^#([0-9a-fA-F]{8})$/;function KM(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=zM.exec(e))?parseInt(t[1]+"ff",16)>>>0:Ta&&Ta[e]!==void 0?Ta[e]:(t=FM.exec(e))?(vo(t[1])<<24|vo(t[2])<<16|vo(t[3])<<8|255)>>>0:(t=BM.exec(e))?(vo(t[1])<<24|vo(t[2])<<16|vo(t[3])<<8|K5(t[4]))>>>0:(t=$M.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=WM.exec(e))?parseInt(t[1],16)>>>0:(t=HM.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=UM.exec(e))?(z5(W5(t[1]),Gd(t[2]),Gd(t[3]))|255)>>>0:(t=VM.exec(e))?(z5(W5(t[1]),Gd(t[2]),Gd(t[3]))|K5(t[4]))>>>0:null}function U1(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function z5(e,t,r){const s=r<.5?r*(1+t):r+t-r*t,a=2*r-s,i=U1(a,s,e+1/3),l=U1(a,s,e),u=U1(a,s,e-1/3);return Math.round(i*255)<<24|Math.round(l*255)<<16|Math.round(u*255)<<8}function vo(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function W5(e){return(parseFloat(e)%360+360)%360/360}function K5(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function Gd(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function G5(e){let t=KM(e);if(t===null)return e;t=t||0;const r=(t&4278190080)>>>24,s=(t&16711680)>>>16,a=(t&65280)>>>8,i=(t&255)/255;return`rgba(${r}, ${s}, ${a}, ${i})`}var Ec=(e,t,r)=>{if(ye.fun(e))return e;if(ye.arr(e))return Ec({range:e,output:t,extrapolate:r});if(ye.str(e.output[0]))return Mx(e);const s=e,a=s.output,i=s.range||[0,1],l=s.extrapolateLeft||s.extrapolate||"extend",u=s.extrapolateRight||s.extrapolate||"extend",d=s.easing||(m=>m);return m=>{const p=qM(m,i);return GM(m,i[p],i[p+1],a[p],a[p+1],d,l,u,s.map)}};function GM(e,t,r,s,a,i,l,u,d){let m=d?d(e):e;if(mr){if(u==="identity")return m;u==="clamp"&&(m=r)}return s===a?s:t===r?e<=t?s:a:(t===-1/0?m=-m:r===1/0?m=m-t:m=(m-t)/(r-t),m=i(m),s===-1/0?m=-m:a===1/0?m=m+s:m=m*(a-s)+s,m)}function qM(e,t){for(var r=1;r=e);++r);return r-1}var YM={linear:e=>e},Ac=Symbol.for("FluidValue.get"),$o=Symbol.for("FluidValue.observers"),Pr=e=>!!(e&&e[Ac]),rr=e=>e&&e[Ac]?e[Ac]():e,q5=e=>e[$o]||null;function ZM(e,t){e.eventObserved?e.eventObserved(t):e(t)}function Pc(e,t){const r=e[$o];r&&r.forEach(s=>{ZM(s,t)})}var _C=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");QM(this,e)}},QM=(e,t)=>MC(e,Ac,t);function il(e,t){if(e[Ac]){let r=e[$o];r||MC(e,$o,r=new Set),r.has(t)||(r.add(t),e.observerAdded&&e.observerAdded(r.size,t))}return t}function Tc(e,t){const r=e[$o];if(r&&r.has(t)){const s=r.size-1;s?r.delete(t):e[$o]=null,e.observerRemoved&&e.observerRemoved(s,t)}}var MC=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}),Cm=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,JM=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Y5=new RegExp(`(${Cm.source})(%|[a-z]+)`,"i"),XM=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Of=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,LC=e=>{const[t,r]=eL(e);if(!t||_x())return e;const s=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(s)return s.trim();if(r&&r.startsWith("--")){const a=window.getComputedStyle(document.documentElement).getPropertyValue(r);return a||e}else{if(r&&Of.test(r))return LC(r);if(r)return r}return e},eL=e=>{const t=Of.exec(e);if(!t)return[,];const[,r,s]=t;return[r,s]},V1,tL=(e,t,r,s,a)=>`rgba(${Math.round(t)}, ${Math.round(r)}, ${Math.round(s)}, ${a})`,RC=e=>{V1||(V1=Ta?new RegExp(`(${Object.keys(Ta).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map(i=>rr(i).replace(Of,LC).replace(JM,G5).replace(V1,G5)),r=t.map(i=>i.match(Cm).map(Number)),a=r[0].map((i,l)=>r.map(u=>{if(!(l in u))throw Error('The arity of each "output" value must be equal');return u[l]})).map(i=>Ec({...e,output:i}));return i=>{const l=!Y5.test(t[0])&&t.find(d=>Y5.test(d))?.replace(Cm,"");let u=0;return t[0].replace(Cm,()=>`${a[u++](i)}${l||""}`).replace(XM,tL)}},Rx="react-spring: ",OC=e=>{const t=e;let r=!1;if(typeof t!="function")throw new TypeError(`${Rx}once requires a function parameter`);return(...s)=>{r||(t(...s),r=!0)}},nL=OC(console.warn);function rL(){nL(`${Rx}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var sL=OC(console.warn);function aL(){sL(`${Rx}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function Ff(e){return ye.str(e)&&(e[0]=="#"||/\d/.test(e)||!_x()&&Of.test(e)||e in(Ta||{}))}var Eo=_x()?f.useEffect:f.useLayoutEffect,iL=()=>{const e=f.useRef(!1);return Eo(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function FC(){const e=f.useState()[1],t=iL();return()=>{t.current&&e(Math.random())}}function oL(e,t){const[r]=f.useState(()=>({inputs:t,result:e()})),s=f.useRef(),a=s.current;let i=a;return i?t&&i.inputs&&lL(t,i.inputs)||(i={inputs:t,result:e()}):i=r,f.useEffect(()=>{s.current=i,a==r&&(r.inputs=r.result=void 0)},[i]),i.result}function lL(e,t){if(e.length!==t.length)return!1;for(let r=0;rf.useEffect(e,cL),cL=[];function uL(e){const t=f.useRef();return f.useEffect(()=>{t.current=e}),t.current}var Ic=Symbol.for("Animated:node"),dL=e=>!!e&&e[Ic]===e,ps=e=>e&&e[Ic],Ox=(e,t)=>_M(e,Ic,t),Bf=e=>e&&e[Ic]&&e[Ic].getPayload(),UC=class{constructor(){Ox(this,this)}getPayload(){return this.payload||[]}},lu=class extends UC{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,ye.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new lu(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return ye.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,ye.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Dc=class extends lu{constructor(e){super(0),this._string=null,this._toString=Ec({output:[e,e]})}static create(e){return new Dc(e)}getValue(){const e=this._string;return e??(this._string=this._toString(this._value))}setValue(e){if(ye.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=Ec({output:[this.getValue(),e]})),this._value=0,super.reset()}},Fm={dependencies:null},Uf=class extends UC{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return ys(this.source,(r,s)=>{dL(r)?t[s]=r.getValue(e):Pr(r)?t[s]=rr(r):e||(t[s]=r)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&ut(this.payload,e=>e.reset())}_makePayload(e){if(e){const t=new Set;return ys(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Fm.dependencies&&Pr(e)&&Fm.dependencies.add(e);const t=Bf(e);t&&ut(t,r=>this.add(r))}},VC=class extends Uf{constructor(e){super(e)}static create(e){return new VC(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){const t=this.getPayload();return e.length==t.length?t.map((r,s)=>r.setValue(e[s])).some(Boolean):(super.setValue(e.map(mL)),!0)}};function mL(e){return(Ff(e)?Dc:lu).create(e)}function h0(e){const t=ps(e);return t?t.constructor:ye.arr(e)?VC:Ff(e)?Dc:lu}var Z5=(e,t)=>{const r=!ye.fun(e)||e.prototype&&e.prototype.isReactComponent;return f.forwardRef((s,a)=>{const i=f.useRef(null),l=r&&f.useCallback(C=>{i.current=pL(a,C)},[a]),[u,d]=hL(s,t),m=FC(),p=()=>{const C=i.current;if(r&&!C)return;(C?t.applyAnimatedValues(C,u.getValue(!0)):!1)===!1&&m()},g=new fL(p,d),v=f.useRef();Eo(()=>(v.current=g,ut(d,C=>il(C,g)),()=>{v.current&&(ut(v.current.deps,C=>Tc(C,v.current)),it.cancel(v.current.update))})),f.useEffect(p,[]),BC(()=>()=>{const C=v.current;ut(C.deps,b=>Tc(b,C))});const y=t.getComponentProps(u.getValue());return f.createElement(e,{...y,ref:l})})},fL=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type=="change"&&it.write(this.update)}};function hL(e,t){const r=new Set;return Fm.dependencies=r,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new Uf(e),Fm.dependencies=null,[e,r]}function pL(e,t){return e&&(ye.fun(e)?e(t):e.current=t),t}var Q5=Symbol.for("AnimatedComponent"),gL=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:r=a=>new Uf(a),getComponentProps:s=a=>a}={})=>{const a={applyAnimatedValues:t,createAnimatedStyle:r,getComponentProps:s},i=l=>{const u=J5(l)||"Anonymous";return ye.str(l)?l=i[l]||(i[l]=Z5(l,a)):l=l[Q5]||(l[Q5]=Z5(l,a)),l.displayName=`Animated(${u})`,l};return ys(e,(l,u)=>{ye.arr(e)&&(u=J5(l)),i[u]=i(l)}),{animated:i}},J5=e=>ye.str(e)?e:e&&ye.str(e.displayName)?e.displayName:ye.fun(e)&&e.name||null;function sr(e,...t){return ye.fun(e)?e(...t):e}var jc=(e,t)=>e===!0||!!(t&&e&&(ye.fun(e)?e(t):Kn(e).includes(t))),$C=(e,t)=>ye.obj(e)?t&&e[t]:e,HC=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,xL=e=>e,Fx=(e,t=xL)=>{let r=vL;e.default&&e.default!==!0&&(e=e.default,r=Object.keys(e));const s={};for(const a of r){const i=t(e[a],a);ye.und(i)||(s[a]=i)}return s},vL=["config","onProps","onStart","onChange","onPause","onResume","onRest"],yL={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function bL(e){const t={};let r=0;if(ys(e,(s,a)=>{yL[a]||(t[a]=s,r++)}),r)return t}function Bx(e){const t=bL(e);if(t){const r={to:t};return ys(e,(s,a)=>a in t||(r[a]=s)),r}return{...e}}function _c(e){return e=rr(e),ye.arr(e)?e.map(_c):Ff(e)?Jr.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function CL(e){for(const t in e)return!0;return!1}function p0(e){return ye.fun(e)||ye.arr(e)&&ye.obj(e[0])}function X5(e,t){e.ref?.delete(e),t?.delete(e)}function wL(e,t){t&&e.ref!==t&&(e.ref?.delete(e),t.add(e),e.ref=t)}var jL={default:{tension:170,friction:26}},g0={...jL.default,mass:1,damping:1,easing:YM.linear,clamp:!1},SL=class{constructor(){this.velocity=0,Object.assign(this,g0)}};function kL(e,t,r){r&&(r={...r},eb(r,t),t={...r,...t}),eb(e,t),Object.assign(e,t);for(const l in g0)e[l]==null&&(e[l]=g0[l]);let{frequency:s,damping:a}=e;const{mass:i}=e;return ye.und(s)||(s<.01&&(s=.01),a<0&&(a=0),e.tension=Math.pow(2*Math.PI/s,2)*i,e.friction=4*Math.PI*a*i/s),e}function eb(e,t){if(!ye.und(t.decay))e.duration=void 0;else{const r=!ye.und(t.tension)||!ye.und(t.friction);(r||!ye.und(t.frequency)||!ye.und(t.damping)||!ye.und(t.mass))&&(e.duration=void 0,e.decay=void 0),r&&(e.frequency=void 0)}}var tb=[],NL=class{constructor(){this.changed=!1,this.values=tb,this.toValues=null,this.fromValues=tb,this.config=new SL,this.immediate=!1}};function zC(e,{key:t,props:r,defaultProps:s,state:a,actions:i}){return new Promise((l,u)=>{let d,m,p=jc(r.cancel??s?.cancel,t);if(p)y();else{ye.und(r.pause)||(a.paused=jc(r.pause,t));let C=s?.pause;C!==!0&&(C=a.paused||jc(C,t)),d=sr(r.delay||0,t),C?(a.resumeQueue.add(v),i.pause()):(i.resume(),v())}function g(){a.resumeQueue.add(v),a.timeouts.delete(m),m.cancel(),d=m.time-it.now()}function v(){d>0&&!Jr.skipAnimation?(a.delayed=!0,m=it.setTimeout(y,d),a.pauseQueue.add(g),a.timeouts.add(m)):y()}function y(){a.delayed&&(a.delayed=!1),a.pauseQueue.delete(g),a.timeouts.delete(m),e<=(a.cancelId||0)&&(p=!0);try{i.start({...r,callId:e,cancel:p},l)}catch(C){u(C)}}})}var Ux=(e,t)=>t.length==1?t[0]:t.some(r=>r.cancelled)?Do(e.get()):t.every(r=>r.noop)?WC(e.get()):Yr(e.get(),t.every(r=>r.finished)),WC=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Yr=(e,t,r=!1)=>({value:e,finished:t,cancelled:r}),Do=e=>({value:e,cancelled:!0,finished:!1});function KC(e,t,r,s){const{callId:a,parentId:i,onRest:l}=t,{asyncTo:u,promise:d}=r;return!i&&e===u&&!t.reset?d:r.promise=(async()=>{r.asyncId=a,r.asyncTo=e;const m=Fx(t,(w,N)=>N==="onRest"?void 0:w);let p,g;const v=new Promise((w,N)=>(p=w,g=N)),y=w=>{const N=a<=(r.cancelId||0)&&Do(s)||a!==r.asyncId&&Yr(s,!1);if(N)throw w.result=N,g(w),w},C=(w,N)=>{const k=new nb,E=new rb;return(async()=>{if(Jr.skipAnimation)throw Mc(r),E.result=Yr(s,!1),g(E),E;y(k);const T=ye.obj(w)?{...w}:{...N,to:w};T.parentId=a,ys(m,(I,F)=>{ye.und(T[F])&&(T[F]=I)});const _=await s.start(T);return y(k),r.paused&&await new Promise(I=>{r.resumeQueue.add(I)}),_})()};let b;if(Jr.skipAnimation)return Mc(r),Yr(s,!1);try{let w;ye.arr(e)?w=(async N=>{for(const k of N)await C(k)})(e):w=Promise.resolve(e(C,s.stop.bind(s))),await Promise.all([w.then(p),v]),b=Yr(s.get(),!0,!1)}catch(w){if(w instanceof nb)b=w.result;else if(w instanceof rb)b=w.result;else throw w}finally{a==r.asyncId&&(r.asyncId=i,r.asyncTo=i?u:void 0,r.promise=i?d:void 0)}return ye.fun(l)&&it.batchedUpdates(()=>{l(b,s,s.item)}),b})()}function Mc(e,t){Cc(e.timeouts,r=>r.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var nb=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},rb=class extends Error{constructor(){super("SkipAnimationSignal")}},x0=e=>e instanceof Vx,EL=1,Vx=class extends _C{constructor(){super(...arguments),this.id=EL++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=ps(this);return e&&e.getValue()}to(...e){return Jr.to(this,e)}interpolate(...e){return rL(),Jr.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Pc(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Lf.sort(this),Pc(this,{type:"priority",parent:this,priority:e})}},Ci=Symbol.for("SpringPhase"),GC=1,v0=2,y0=4,$1=e=>(e[Ci]&GC)>0,ya=e=>(e[Ci]&v0)>0,oc=e=>(e[Ci]&y0)>0,sb=(e,t)=>t?e[Ci]|=v0|GC:e[Ci]&=~v0,ab=(e,t)=>t?e[Ci]|=y0:e[Ci]&=~y0,AL=class extends Vx{constructor(e,t){if(super(),this.animation=new NL,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!ye.und(e)||!ye.und(t)){const r=ye.obj(e)?{...e}:{...t,from:e};ye.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(ya(this)||this._state.asyncTo)||oc(this)}get goal(){return rr(this.animation.to)}get velocity(){const e=ps(this);return e instanceof lu?e.lastVelocity||0:e.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return $1(this)}get isAnimating(){return ya(this)}get isPaused(){return oc(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,r=!1;const s=this.animation;let{toValues:a}=s;const{config:i}=s,l=Bf(s.to);!l&&Pr(s.to)&&(a=Kn(rr(s.to))),s.values.forEach((m,p)=>{if(m.done)return;const g=m.constructor==Dc?1:l?l[p].lastPosition:a[p];let v=s.immediate,y=g;if(!v){if(y=m.lastPosition,i.tension<=0){m.done=!0;return}let C=m.elapsedTime+=e;const b=s.fromValues[p],w=m.v0!=null?m.v0:m.v0=ye.arr(i.velocity)?i.velocity[p]:i.velocity;let N;const k=i.precision||(b==g?.005:Math.min(1,Math.abs(g-b)*.001));if(ye.und(i.duration))if(i.decay){const E=i.decay===!0?.998:i.decay,T=Math.exp(-(1-E)*C);y=b+w/(1-E)*(1-T),v=Math.abs(m.lastPosition-y)<=k,N=w*T}else{N=m.lastVelocity==null?w:m.lastVelocity;const E=i.restVelocity||k/10,T=i.clamp?0:i.bounce,_=!ye.und(T),I=b==g?m.v0>0:bE,!(!F&&(v=Math.abs(g-y)<=k,v)));++Y){_&&(z=y==g||y>g==I,z&&(N=-N*T,y=g));const B=-i.tension*1e-6*(y-g),W=-i.friction*.001*N,U=(B+W)/i.mass;N=N+U*H,y=y+N*H}}else{let E=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,m.durationProgress>0&&(m.elapsedTime=i.duration*m.durationProgress,C=m.elapsedTime+=e)),E=(i.progress||0)+C/this._memoizedDuration,E=E>1?1:E<0?0:E,m.durationProgress=E),y=b+i.easing(E)*(g-b),N=(y-m.lastPosition)/e,v=E==1}m.lastVelocity=N,Number.isNaN(y)&&(console.warn("Got NaN while animating:",this),v=!0)}l&&!l[p].done&&(v=!1),v?m.done=!0:t=!1,m.setValue(y,i.round)&&(r=!0)});const u=ps(this),d=u.getValue();if(t){const m=rr(s.to);(d!==m||r)&&!i.decay?(u.setValue(m),this._onChange(m)):r&&i.decay&&this._onChange(d),this._stop()}else r&&this._onChange(d)}set(e){return it.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(ya(this)){const{to:e,config:t}=this.animation;it.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let r;return ye.und(e)?(r=this.queue||[],this.queue=[]):r=[ye.obj(e)?e:{...t,to:e}],Promise.all(r.map(s=>this._update(s))).then(s=>Ux(this,s))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Mc(this._state,e&&this._lastCallId),it.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:r,from:s}=e;r=ye.obj(r)?r[t]:r,(r==null||p0(r))&&(r=void 0),s=ye.obj(s)?s[t]:s,s==null&&(s=void 0);const a={to:r,from:s};return $1(this)||(e.reverse&&([r,s]=[s,r]),s=rr(s),ye.und(s)?ps(this)||this._set(r):this._set(s)),a}_update({...e},t){const{key:r,defaultProps:s}=this;e.default&&Object.assign(s,Fx(e,(l,u)=>/^on/.test(u)?$C(l,r):l)),ob(this,e,"onProps"),cc(this,"onProps",e,this);const a=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const i=this._state;return zC(++this._lastCallId,{key:r,props:e,defaultProps:s,state:i,actions:{pause:()=>{oc(this)||(ab(this,!0),gc(i.pauseQueue),cc(this,"onPause",Yr(this,lc(this,this.animation.to)),this))},resume:()=>{oc(this)&&(ab(this,!1),ya(this)&&this._resume(),gc(i.resumeQueue),cc(this,"onResume",Yr(this,lc(this,this.animation.to)),this))},start:this._merge.bind(this,a)}}).then(l=>{if(e.loop&&l.finished&&!(t&&l.noop)){const u=qC(e);if(u)return this._update(u,!0)}return l})}_merge(e,t,r){if(t.cancel)return this.stop(!0),r(Do(this));const s=!ye.und(e.to),a=!ye.und(e.from);if(s||a)if(t.callId>this._lastToId)this._lastToId=t.callId;else return r(Do(this));const{key:i,defaultProps:l,animation:u}=this,{to:d,from:m}=u;let{to:p=d,from:g=m}=e;a&&!s&&(!t.default||ye.und(p))&&(p=g),t.reverse&&([p,g]=[g,p]);const v=!Os(g,m);v&&(u.from=g),g=rr(g);const y=!Os(p,d);y&&this._focus(p);const C=p0(t.to),{config:b}=u,{decay:w,velocity:N}=b;(s||a)&&(b.velocity=0),t.config&&!C&&kL(b,sr(t.config,i),t.config!==l.config?sr(l.config,i):void 0);let k=ps(this);if(!k||ye.und(p))return r(Yr(this,!0));const E=ye.und(t.reset)?a&&!t.default:!ye.und(g)&&jc(t.reset,i),T=E?g:this.get(),_=_c(p),I=ye.num(_)||ye.arr(_)||Ff(_),F=!C&&(!I||jc(l.immediate||t.immediate,i));if(y){const Y=h0(p);if(Y!==k.constructor)if(F)k=this._set(_);else throw Error(`Cannot animate between ${k.constructor.name} and ${Y.name}, as the "to" prop suggests`)}const z=k.constructor;let H=Pr(p),J=!1;if(!H){const Y=E||!$1(this)&&v;(y||Y)&&(J=Os(_c(T),_),H=!J),(!Os(u.immediate,F)&&!F||!Os(b.decay,w)||!Os(b.velocity,N))&&(H=!0)}if(J&&ya(this)&&(u.changed&&!E?H=!0:H||this._stop(d)),!C&&((H||Pr(d))&&(u.values=k.getPayload(),u.toValues=Pr(p)?null:z==Dc?[1]:Kn(_)),u.immediate!=F&&(u.immediate=F,!F&&!E&&this._set(d)),H)){const{onRest:Y}=u;ut(PL,W=>ob(this,t,W));const B=Yr(this,lc(this,d));gc(this._pendingCalls,B),this._pendingCalls.add(r),u.changed&&it.batchedUpdates(()=>{u.changed=!E,Y?.(B,this),E?sr(l.onRest,B):u.onStart?.(B,this)})}E&&this._set(T),C?r(KC(t.to,t,this._state,this)):H?this._start():ya(this)&&!y?this._pendingCalls.add(r):r(WC(T))}_focus(e){const t=this.animation;e!==t.to&&(q5(this)&&this._detach(),t.to=e,q5(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Pr(t)&&(il(t,this),x0(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Pr(e)&&Tc(e,this)}_set(e,t=!0){const r=rr(e);if(!ye.und(r)){const s=ps(this);if(!s||!Os(r,s.getValue())){const a=h0(r);!s||s.constructor!=a?Ox(this,a.create(r)):s.setValue(r),s&&it.batchedUpdates(()=>{this._onChange(r,t)})}}return ps(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,cc(this,"onStart",Yr(this,lc(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),sr(this.animation.onChange,e,this)),sr(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;ps(this).reset(rr(e.to)),e.immediate||(e.fromValues=e.values.map(t=>t.lastPosition)),ya(this)||(sb(this,!0),oc(this)||this._resume())}_resume(){Jr.skipAnimation?this.finish():Lf.start(this)}_stop(e,t){if(ya(this)){sb(this,!1);const r=this.animation;ut(r.values,a=>{a.done=!0}),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),Pc(this,{type:"idle",parent:this});const s=t?Do(this.get()):Yr(this.get(),lc(this,e??r.to));gc(this._pendingCalls,s),r.changed&&(r.changed=!1,cc(this,"onRest",s,this))}}};function lc(e,t){const r=_c(t),s=_c(e.get());return Os(s,r)}function qC(e,t=e.loop,r=e.to){const s=sr(t);if(s){const a=s!==!0&&Bx(s),i=(a||e).reverse,l=!a||a.reset;return Bm({...e,loop:t,default:!1,pause:void 0,to:!i||p0(r)?r:void 0,from:l?e.from:void 0,reset:l,...a})}}function Bm(e){const{to:t,from:r}=e=Bx(e),s=new Set;return ye.obj(t)&&ib(t,s),ye.obj(r)&&ib(r,s),e.keys=s.size?Array.from(s):null,e}function ib(e,t){ys(e,(r,s)=>r!=null&&t.add(s))}var PL=["onStart","onRest","onChange","onPause","onResume"];function ob(e,t,r){e.animation[r]=t[r]!==HC(t,r)?$C(t[r],e.key):void 0}function cc(e,t,...r){e.animation[t]?.(...r),e.defaultProps[t]?.(...r)}var TL=["onStart","onChange","onRest"],IL=1,DL=class{constructor(e,t){this.id=IL++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each((t,r)=>e[r]=t.get()),e}set(e){for(const t in e){const r=e[t];ye.und(r)||this.springs[t].set(r)}}update(e){return e&&this.queue.push(Bm(e)),this}start(e){let{queue:t}=this;return e?t=Kn(e).map(Bm):this.queue=[],this._flush?this._flush(this,t):(JC(this,t),_L(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const r=this.springs;ut(Kn(t),s=>r[s].stop(!!e))}else Mc(this._state,this._lastAsyncId),this.each(r=>r.stop(!!e));return this}pause(e){if(ye.und(e))this.start({pause:!0});else{const t=this.springs;ut(Kn(e),r=>t[r].pause())}return this}resume(e){if(ye.und(e))this.start({pause:!1});else{const t=this.springs;ut(Kn(e),r=>t[r].resume())}return this}each(e){ys(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:r}=this._events,s=this._active.size>0,a=this._changed.size>0;(s&&!this._started||a&&!this._started)&&(this._started=!0,Cc(e,([u,d])=>{d.value=this.get(),u(d,this,this._item)}));const i=!s&&this._started,l=a||i&&r.size?this.get():null;a&&t.size&&Cc(t,([u,d])=>{d.value=l,u(d,this,this._item)}),i&&(this._started=!1,Cc(r,([u,d])=>{d.value=l,u(d,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;it.onFrame(this._onFrame)}};function _L(e,t){return Promise.all(t.map(r=>YC(e,r))).then(r=>Ux(e,r))}async function YC(e,t,r){const{keys:s,to:a,from:i,loop:l,onRest:u,onResolve:d}=t,m=ye.obj(t.default)&&t.default;l&&(t.loop=!1),a===!1&&(t.to=null),i===!1&&(t.from=null);const p=ye.arr(a)||ye.fun(a)?a:void 0;p?(t.to=void 0,t.onRest=void 0,m&&(m.onRest=void 0)):ut(TL,b=>{const w=t[b];if(ye.fun(w)){const N=e._events[b];t[b]=({finished:k,cancelled:E})=>{const T=N.get(w);T?(k||(T.finished=!1),E&&(T.cancelled=!0)):N.set(w,{value:null,finished:k||!1,cancelled:E||!1})},m&&(m[b]=t[b])}});const g=e._state;t.pause===!g.paused?(g.paused=t.pause,gc(t.pause?g.pauseQueue:g.resumeQueue)):g.paused&&(t.pause=!0);const v=(s||Object.keys(e.springs)).map(b=>e.springs[b].start(t)),y=t.cancel===!0||HC(t,"cancel")===!0;(p||y&&g.asyncId)&&v.push(zC(++e._lastAsyncId,{props:t,state:g,actions:{pause:m0,resume:m0,start(b,w){y?(Mc(g,e._lastAsyncId),w(Do(e))):(b.onRest=u,w(KC(p,b,g,e)))}}})),g.paused&&await new Promise(b=>{g.resumeQueue.add(b)});const C=Ux(e,await Promise.all(v));if(l&&C.finished&&!(r&&C.noop)){const b=qC(t,l,a);if(b)return JC(e,[b]),YC(e,b,!0)}return d&&it.batchedUpdates(()=>d(C,e,e.item)),C}function ML(e,t){const r={...e.springs};return t&&ut(Kn(t),s=>{ye.und(s.keys)&&(s=Bm(s)),ye.obj(s.to)||(s={...s,to:void 0}),QC(r,s,a=>ZC(a))}),LL(e,r),r}function LL(e,t){ys(t,(r,s)=>{e.springs[s]||(e.springs[s]=r,il(r,e))})}function ZC(e,t){const r=new AL;return r.key=e,t&&il(r,t),r}function QC(e,t,r){t.keys&&ut(t.keys,s=>{(e[s]||(e[s]=r(s)))._prepareNode(t)})}function JC(e,t){ut(t,r=>{QC(e.springs,r,s=>ZC(s,e))})}var Vf=({children:e,...t})=>{const r=f.useContext(Um),s=t.pause||!!r.pause,a=t.immediate||!!r.immediate;t=oL(()=>({pause:s,immediate:a}),[s,a]);const{Provider:i}=Um;return f.createElement(i,{value:t},e)},Um=RL(Vf,{});Vf.Provider=Um.Provider;Vf.Consumer=Um.Consumer;function RL(e,t){return Object.assign(e,f.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}var OL=()=>{const e=[],t=function(s){aL();const a=[];return ut(e,(i,l)=>{if(ye.und(s))a.push(i.start());else{const u=r(s,i,l);u&&a.push(i.start(u))}}),a};t.current=e,t.add=function(s){e.includes(s)||e.push(s)},t.delete=function(s){const a=e.indexOf(s);~a&&e.splice(a,1)},t.pause=function(){return ut(e,s=>s.pause(...arguments)),this},t.resume=function(){return ut(e,s=>s.resume(...arguments)),this},t.set=function(s){ut(e,(a,i)=>{const l=ye.fun(s)?s(i,a):s;l&&a.set(l)})},t.start=function(s){const a=[];return ut(e,(i,l)=>{if(ye.und(s))a.push(i.start());else{const u=this._getProps(s,i,l);u&&a.push(i.start(u))}}),a},t.stop=function(){return ut(e,s=>s.stop(...arguments)),this},t.update=function(s){return ut(e,(a,i)=>a.update(this._getProps(s,a,i))),this};const r=function(s,a,i){return ye.fun(s)?s(i,a):s};return t._getProps=r,t};function FL(e,t,r){const s=ye.fun(t)&&t,{reset:a,sort:i,trail:l=0,expires:u=!0,exitBeforeEnter:d=!1,onDestroyed:m,ref:p,config:g}=s?s():t,v=f.useMemo(()=>s||arguments.length==3?OL():void 0,[]),y=Kn(e),C=[],b=f.useRef(null),w=a?null:b.current;Eo(()=>{b.current=C}),BC(()=>(ut(C,U=>{v?.add(U.ctrl),U.ctrl.ref=v}),()=>{ut(b.current,U=>{U.expired&&clearTimeout(U.expirationId),X5(U.ctrl,v),U.ctrl.stop(!0)})}));const N=UL(y,s?s():t,w),k=a&&b.current||[];Eo(()=>ut(k,({ctrl:U,item:Z,key:re})=>{X5(U,v),sr(m,Z,re)}));const E=[];if(w&&ut(w,(U,Z)=>{U.expired?(clearTimeout(U.expirationId),k.push(U)):(Z=E[Z]=N.indexOf(U.key),~Z&&(C[Z]=U))}),ut(y,(U,Z)=>{C[Z]||(C[Z]={key:N[Z],item:U,phase:"mount",ctrl:new DL},C[Z].ctrl.item=U)}),E.length){let U=-1;const{leave:Z}=s?s():t;ut(E,(re,me)=>{const L=w[me];~re?(U=C.indexOf(L),C[U]={...L,item:y[re]}):Z&&C.splice(++U,0,L)})}ye.fun(i)&&C.sort((U,Z)=>i(U.item,Z.item));let T=-l;const _=FC(),I=Fx(t),F=new Map,z=f.useRef(new Map),H=f.useRef(!1);ut(C,(U,Z)=>{const re=U.key,me=U.phase,L=s?s():t;let V,P;const q=sr(L.delay||0,re);if(me=="mount")V=L.enter,P="enter";else{const fe=N.indexOf(re)<0;if(me!="leave")if(fe)V=L.leave,P="leave";else if(V=L.update)P="update";else return;else if(!fe)V=L.enter,P="enter";else return}if(V=sr(V,U.item,Z),V=ye.obj(V)?Bx(V):{to:V},!V.config){const fe=g||I.config;V.config=sr(fe,U.item,Z,P)}T+=l;const Q={...I,delay:q+T,ref:p,immediate:L.immediate,reset:!1,...V};if(P=="enter"&&ye.und(Q.from)){const fe=s?s():t,he=ye.und(fe.initial)||w?fe.from:fe.initial;Q.from=sr(he,U.item,Z)}const{onResolve:ae}=Q;Q.onResolve=fe=>{sr(ae,fe);const he=b.current,se=he.find(le=>le.key===re);if(se&&!(fe.cancelled&&se.phase!="update")&&se.ctrl.idle){const le=he.every(Ae=>Ae.ctrl.idle);if(se.phase=="leave"){const Ae=sr(u,se.item);if(Ae!==!1){const Te=Ae===!0?0:Ae;if(se.expired=!0,!le&&Te>0){Te<=2147483647&&(se.expirationId=setTimeout(_,Te));return}}}le&&he.some(Ae=>Ae.expired)&&(z.current.delete(se),d&&(H.current=!0),_())}};const X=ML(U.ctrl,Q);P==="leave"&&d?z.current.set(U,{phase:P,springs:X,payload:Q}):F.set(U,{phase:P,springs:X,payload:Q})});const J=f.useContext(Vf),Y=uL(J),B=J!==Y&&CL(J);Eo(()=>{B&&ut(C,U=>{U.ctrl.start({default:J})})},[J]),ut(F,(U,Z)=>{if(z.current.size){const re=C.findIndex(me=>me.key===Z.key);C.splice(re,1)}}),Eo(()=>{ut(z.current.size?z.current:F,({phase:U,payload:Z},re)=>{const{ctrl:me}=re;re.phase=U,v?.add(me),B&&U=="enter"&&me.start({default:J}),Z&&(wL(me,Z.ref),(me.ref||v)&&!H.current?me.update(Z):(me.start(Z),H.current&&(H.current=!1)))})},a?void 0:r);const W=U=>f.createElement(f.Fragment,null,C.map((Z,re)=>{const{springs:me}=F.get(Z)||Z.ctrl,L=U({...me},Z.item,Z,re);return L&&L.type?f.createElement(L.type,{...L.props,key:ye.str(Z.key)||ye.num(Z.key)?Z.key:Z.ctrl.id,ref:L.ref}):L}));return v?[W,v]:W}var BL=1;function UL(e,{key:t,keys:r=t},s){if(r===null){const a=new Set;return e.map(i=>{const l=s&&s.find(u=>u.item===i&&u.phase!=="leave"&&!a.has(u));return l?(a.add(l),l.key):BL++})}return ye.und(r)?e:ye.fun(r)?e.map(r):Kn(r)}var VL=class extends Vx{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=Ec(...t);const r=this._get(),s=h0(r);Ox(this,s.create(r))}advance(e){const t=this._get(),r=this.get();Os(t,r)||(ps(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&lb(this._active)&&H1(this)}_get(){const e=ye.arr(this.source)?this.source.map(rr):Kn(rr(this.source));return this.calc(...e)}_start(){this.idle&&!lb(this._active)&&(this.idle=!1,ut(Bf(this),e=>{e.done=!1}),Jr.skipAnimation?(it.batchedUpdates(()=>this.advance()),H1(this)):Lf.start(this))}_attach(){let e=1;ut(Kn(this.source),t=>{Pr(t)&&il(t,this),x0(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){ut(Kn(this.source),e=>{Pr(e)&&Tc(e,this)}),this._active.clear(),H1(this)}eventObserved(e){e.type=="change"?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type=="idle"?this._active.delete(e.parent):e.type=="priority"&&(this.priority=Kn(this.source).reduce((t,r)=>Math.max(t,(x0(r)?r.priority:0)+1),0))}};function $L(e){return e.idle!==!1}function lb(e){return!e.size||Array.from(e).every($L)}function H1(e){e.idle||(e.idle=!0,ut(Bf(e),t=>{t.done=!0}),Pc(e,{type:"idle",parent:e}))}Jr.assign({createStringInterpolator:RC,to:(e,t)=>new VL(e,t)});var Mi=I8();const HL=Qc(Mi);var XC=/^--/;function zL(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t=="number"&&t!==0&&!XC.test(e)&&!(Sc.hasOwnProperty(e)&&Sc[e])?t+"px":(""+t).trim()}var cb={};function WL(e,t){if(!e.nodeType||!e.setAttribute)return!1;const r=e.nodeName==="filter"||e.parentNode&&e.parentNode.nodeName==="filter",{className:s,style:a,children:i,scrollTop:l,scrollLeft:u,viewBox:d,...m}=t,p=Object.values(m),g=Object.keys(m).map(v=>r||e.hasAttribute(v)?v:cb[v]||(cb[v]=v.replace(/([A-Z])/g,y=>"-"+y.toLowerCase())));i!==void 0&&(e.textContent=i);for(const v in a)if(a.hasOwnProperty(v)){const y=zL(v,a[v]);XC.test(v)?e.style.setProperty(v,y):e.style[v]=y}g.forEach((v,y)=>{e.setAttribute(v,p[y])}),s!==void 0&&(e.className=s),l!==void 0&&(e.scrollTop=l),u!==void 0&&(e.scrollLeft=u),d!==void 0&&e.setAttribute("viewBox",d)}var Sc={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},KL=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),GL=["Webkit","Ms","Moz","O"];Sc=Object.keys(Sc).reduce((e,t)=>(GL.forEach(r=>e[KL(r,t)]=e[t]),e),Sc);var qL=/^(matrix|translate|scale|rotate|skew)/,YL=/^(translate)/,ZL=/^(rotate|skew)/,z1=(e,t)=>ye.num(e)&&e!==0?e+t:e,wm=(e,t)=>ye.arr(e)?e.every(r=>wm(r,t)):ye.num(e)?e===t:parseFloat(e)===t,QL=class extends Uf{constructor({x:e,y:t,z:r,...s}){const a=[],i=[];(e||t||r)&&(a.push([e||0,t||0,r||0]),i.push(l=>[`translate3d(${l.map(u=>z1(u,"px")).join(",")})`,wm(l,0)])),ys(s,(l,u)=>{if(u==="transform")a.push([l||""]),i.push(d=>[d,d===""]);else if(qL.test(u)){if(delete s[u],ye.und(l))return;const d=YL.test(u)?"px":ZL.test(u)?"deg":"";a.push(Kn(l)),i.push(u==="rotate3d"?([m,p,g,v])=>[`rotate3d(${m},${p},${g},${z1(v,d)})`,wm(v,0)]:m=>[`${u}(${m.map(p=>z1(p,d)).join(",")})`,wm(m,u.startsWith("scale")?1:0)])}}),a.length&&(s.transform=new JL(a,i)),super(s)}},JL=class extends _C{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return ut(this.inputs,(r,s)=>{const a=rr(r[0]),[i,l]=this.transforms[s](ye.arr(a)?a:r.map(rr));e+=" "+i,t=t&&l}),t?"none":e}observerAdded(e){e==1&&ut(this.inputs,t=>ut(t,r=>Pr(r)&&il(r,this)))}observerRemoved(e){e==0&&ut(this.inputs,t=>ut(t,r=>Pr(r)&&Tc(r,this)))}eventObserved(e){e.type=="change"&&(this._value=null),Pc(this,e)}},XL=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];Jr.assign({batchedUpdates:Mi.unstable_batchedUpdates,createStringInterpolator:RC,colors:OM});var eR=gL(XL,{applyAnimatedValues:WL,createAnimatedStyle:e=>new QL(e),getComponentProps:({scrollTop:e,scrollLeft:t,...r})=>r}),tR=eR.animated;function $x(e){const{className:t,...r}=e;return n.jsxs("div",{className:D(t,"loading-dots flex gap-1"),...r,children:[n.jsx("span",{}),n.jsx("span",{}),n.jsx("span",{})]})}const Ple=Object.freeze(Object.defineProperty({__proto__:null,default:$x},Symbol.toStringTag,{value:"Module"})),Hx=e=>{const{variant:t="filled",intent:r="base",sizeVariant:s="medium",active:a,iconOnly:i,prefixIcon:l,suffixIcon:u}=e,d=!!(l||u);return{"bg-gray-0 dark:bg-gray-700 border-gray-300 dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-600 hover:border-gray-300 dark:hover:border-gray-500 focus-visible:bg-gray-100 dark:focus-visible:bg-gray-600 focus-visible:border-gray-300 dark:focus-visible:border-gray-500 hover:text-gray-900 dark:hover:text-gray-300 disabled:border-gray-200 dark:disabled:border-gray-600/30 disabled:text-text-disabled":r==="base"&&t==="filled","bg-gray-200 dark:bg-gray-800 border-gray-300 dark:border-gray-700":r==="base"&&t==="filled"&&a,"bg-blue-500 dark:bg-blue-600 border-blue-500 dark:border-blue-600 text-white hover:bg-blue-600 dark:hover:bg-blue-500 hover:border-blue-600 dark:hover:border-blue-500 focus-visible:bg-blue-600 dark:focus-visible:bg-blue-500 disabled:text-blue-50 disabled:bg-blue-200 dark:disabled:bg-blue-600 disabled:border-blue-200 dark:disabled:border-blue-600 dark:disabled:opacity-40":r==="primary"&&t==="filled","bg-red-400 dark:bg-red-500 border-red-400 dark:border-red-500 text-white hover:bg-red-500 dark:hover:bg-red-400 hover:border-red-500 dark:hover:border-red-400 focus-visible:outline-outline-focus-danger focus-visible:bg-red-500 dark:focus-visible:bg-red-400 disabled:text-red-50 disabled:bg-red-200 dark:disabled:bg-red-500 disabled:border-red-200 dark:disabled:border-red-500 dark:disabled:opacity-40":r==="danger"&&t==="filled","bg-yellow-300 dark:bg-yellow-400 border-yellow-300 dark:border-yellow-400 text-white hover:bg-yellow-400 dark:hover:bg-yellow-300 hover:border-yellow-400 dark:hover:border-yellow-300 focus-visible:outline-outline-focus-warning focus-visible:bg-yellow-400 dark:focus-visible:bg-yellow-300 disabled:text-yellow-50 disabled:bg-yellow-100 dark:disabled:bg-yellow-400 disabled:border-yellow-100 dark:disabled:border-yellow-400 dark:disabled:opacity-40":r==="warning"&&t==="filled","bg-gray-800 border-gray-800 text-white hover:bg-gray-900 dark:hover:bg-gray-700 hover:border-gray-900 dark:hover:border-gray-700 disabled:opacity-75":r==="black"&&t==="filled","bg-transparent border-transparent shadow-none disabled:border-transparent disabled:text-text-disabled":t==="minimal","text-text-base focus-visible:bg-gray-100 dark:focus-visible:bg-gray-500/10 hover:bg-gray-100 dark:hover:bg-gray-500/10":t==="minimal"&&(r==="base"||r==="black"),"bg-gray-200 border-gray-300":t==="minimal"&&(r==="base"||r==="black")&&a,"text-text-primary focus-visible:bg-blue-0 dark:focus-visible:bg-blue-400/10 hover:bg-blue-0 dark:hover:bg-blue-400/10":t==="minimal"&&r==="primary","text-text-danger focus-visible:bg-red-0 dark:focus-visible:bg-red-400/10 focus-visible:outline-outline-focus-danger hover:bg-red-0 dark:hover:bg-red-400/10":t==="minimal"&&r==="danger","text-text-warning focus-visible:bg-orange-0 dark:focus-visible:bg-orange-400/10 focus-visible:outline-outline-focus-warning hover:bg-orange-0 dark:hover:bg-orange-400/10":t==="minimal"&&r==="warning","h-10":s==="large","h-9":s==="medium","h-8":s==="small","h-6":s==="xsmall","px-4":s==="large"&&!i,"px-3":s==="medium"&&!i,"px-2.5":s==="small"&&!i,"aspect-square":i,"icon-parent gap-2":d||i,"justify-start":d&&!i,"button-active relative z-10":a===!0}},ue=ce.forwardRef((e,t)=>{const{className:r,disabled:s,children:a,loading:i,active:l,iconOnly:u,prefixIcon:d,suffixIcon:m,textAlign:p,sizeVariant:g,...v}=e;return n.jsxs("button",{className:D("button",Hx(e),r),ref:t,disabled:s||i,...v,children:[d&&n.jsx("span",{className:D("flex-shrink-0",{invisible:i}),children:d}),i&&n.jsx($x,{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-current"}),a&&n.jsx("span",{className:D("max-w-full",{"text-transparent":i===!0,"text-left flex-1":p==="left"}),children:a}),m&&n.jsx("span",{className:D("flex-shrink-0",{invisible:i}),children:m})]})}),Tle=Object.freeze(Object.defineProperty({__proto__:null,default:ue,getButtonStyles:Hx},Symbol.toStringTag,{value:"Module"}));const nR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),rR=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,s)=>s?s.toUpperCase():r.toLowerCase()),ub=e=>{const t=rR(e);return t.charAt(0).toUpperCase()+t.slice(1)},ew=(...e)=>e.filter((t,r,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===r).join(" ").trim(),sR=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var aR={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const iR=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:a="",children:i,iconNode:l,...u},d)=>f.createElement("svg",{ref:d,...aR,width:t,height:t,stroke:e,strokeWidth:s?Number(r)*24/Number(t):r,className:ew("lucide",a),...!i&&!sR(u)&&{"aria-hidden":"true"},...u},[...l.map(([m,p])=>f.createElement(m,p)),...Array.isArray(i)?i:[i]]));const we=(e,t)=>{const r=f.forwardRef(({className:s,...a},i)=>f.createElement(iR,{ref:i,iconNode:t,className:ew(`lucide-${nR(ub(e))}`,`lucide-${e}`,s),...a}));return r.displayName=ub(e),r};const oR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],qd=we("arrow-right",oR);const lR=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],zx=we("arrow-up-right",lR);const cR=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],tw=we("book-open",cR);const uR=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],$f=we("book",uR);const dR=[["path",{d:"M12 6V2H8",key:"1155em"}],["path",{d:"m8 18-4 4V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2Z",key:"w2lp3e"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M9 11v2",key:"1ueba0"}],["path",{d:"M15 11v2",key:"i11awn"}],["path",{d:"M20 12h2",key:"1q8mjw"}]],mR=we("bot-message-square",dR);const fR=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],hR=we("boxes",fR);const pR=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]],gR=we("building",pR);const xR=[["path",{d:"M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1",key:"10bnsj"}],["path",{d:"M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9",key:"1eqmu1"}],["path",{d:"M21 21v-2h-4",key:"14zm7j"}],["path",{d:"M3 5h4V3",key:"z442eg"}],["path",{d:"M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3",key:"ebdjd7"}]],nw=we("cable",xR);const vR=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]],yR=we("calendar-days",vR);const bR=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],CR=we("calendar",bR);const wR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],nn=we("check",wR);const jR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Nn=we("chevron-down",jR);const SR=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Li=we("chevron-left",SR);const kR=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],js=we("chevron-right",kR);const NR=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],rw=we("chevron-up",NR);const ER=[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]],sw=we("chevrons-left",ER);const AR=[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]],aw=we("chevrons-right",AR);const PR=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],TR=we("chevrons-up-down",PR);const IR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Oa=we("circle-alert",IR);const DR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],_R=we("circle-arrow-up",DR);const MR=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],iw=we("circle-check-big",MR);const LR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Wx=we("circle-check",LR);const RR=[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]],OR=we("circle-dashed",RR);const FR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]],BR=we("circle-play",FR);const UR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],VR=we("circle-plus",UR);const $R=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"9",x2:"15",y1:"15",y2:"9",key:"1dfufj"}]],HR=we("circle-slash",$R);const zR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Kx=we("circle-question-mark",zR);const WR=[["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"}]],ow=we("circle-user",WR);const KR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],lw=we("clock",KR);const GR=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],qR=we("cloud",GR);const YR=[["path",{d:"M17.5 21H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"gqqjvc"}],["path",{d:"M22 10a3 3 0 0 0-3-3h-2.207a5.502 5.502 0 0 0-10.702.5",key:"1p2s76"}]],ZR=we("cloudy",YR);const QR=[["path",{d:"M16 2v2",key:"scm5qe"}],["path",{d:"M7 22v-2a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2",key:"1waht3"}],["path",{d:"M8 2v2",key:"pbkmx"}],["circle",{cx:"12",cy:"11",r:"3",key:"itu57m"}],["rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",key:"12vinp"}]],JR=we("contact",QR);const XR=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Lc=we("copy",XR);const eO=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],cw=we("credit-card",eO);const tO=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],Gx=we("dollar-sign",tO);const nO=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],rO=we("download",nO);const sO=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aO=we("ellipsis",sO);const iO=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],uw=we("external-link",iO);const oO=[["path",{d:"M12 22h6a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3.072",key:"n6s66f"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m6.69 16.479 1.29 4.88a.5.5 0 0 1-.698.591l-1.843-.849a1 1 0 0 0-.88.001l-1.846.85a.5.5 0 0 1-.693-.593l1.29-4.88",key:"1e6yvx"}],["circle",{cx:"5",cy:"14",r:"3",key:"ufru5t"}]],lO=we("file-badge",oO);const cO=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],uO=we("file-text",cO);const dO=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],mO=we("funnel",dO);const fO=[["line",{x1:"6",x2:"10",y1:"11",y2:"11",key:"1gktln"}],["line",{x1:"8",x2:"8",y1:"9",y2:"13",key:"qnk9ow"}],["line",{x1:"15",x2:"15.01",y1:"12",y2:"12",key:"krot7o"}],["line",{x1:"18",x2:"18.01",y1:"10",y2:"10",key:"1lcuu1"}],["path",{d:"M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z",key:"mfqc10"}]],hO=we("gamepad-2",fO);const pO=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],gO=we("github",pO);const xO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],Hf=we("globe",xO);const vO=[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]],yO=we("heart",vO);const bO=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],dw=we("house",bO);const CO=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],bs=we("info",CO);const wO=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],qx=we("key",wO);const jO=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],cu=we("link",jO);const SO=[["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],kO=we("list-checks",SO);const NO=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],EO=we("lock-open",NO);const AO=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],mw=we("lock",AO);const PO=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],uu=we("mail",PO);const TO=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],IO=we("menu",TO);const DO=[["path",{d:"M5 12h14",key:"1ays0h"}]],Yx=we("minus",DO);const _O=[["path",{d:"M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",key:"1pctta"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]],fw=we("monitor-play",_O);const MO=[["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"}]],LO=we("monitor-smartphone",MO);const RO=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],Zx=we("monitor",RO);const OO=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],hw=we("moon",OO);const FO=[["path",{d:"M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7 5.3a2.41 2.41 0 0 0 0 3.4L7 13",key:"orapub"}],["path",{d:"m8 6 2-2",key:"115y1s"}],["path",{d:"m18 16 2-2",key:"ee94s4"}],["path",{d:"m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17",key:"cfq27r"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],BO=we("pencil-ruler",FO);const UO=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Qx=we("plus",UO);const VO=[["path",{d:"M13 3H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-3",key:"i8wdob"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"m17 8 5-5",key:"fqif7o"}],["path",{d:"M17 3h5v5",key:"1o3tu8"}]],$O=we("screen-share",VO);const HO=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Jx=we("search",HO);const zO=[["path",{d:"m10.852 14.772-.383.923",key:"11vil6"}],["path",{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923",key:"1v3clb"}],["path",{d:"m13.148 9.228.383-.923",key:"t2zzyc"}],["path",{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544",key:"1bxfiv"}],["path",{d:"m14.772 10.852.923-.383",key:"k9m8cz"}],["path",{d:"m14.772 13.148.923.383",key:"1xvhww"}],["path",{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5",key:"tn8das"}],["path",{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5",key:"1g2pve"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"m9.228 10.852-.923-.383",key:"1wtb30"}],["path",{d:"m9.228 13.148-.923.383",key:"1a830x"}]],WO=we("server-cog",zO);const KO=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],ol=we("server",KO);const GO=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Xx=we("settings",GO);const qO=[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]],e2=we("shapes",qO);const YO=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],ZO=we("share-2",YO);const QO=[["path",{d:"M12 2v13",key:"1km8f5"}],["path",{d:"m16 6-4-4-4 4",key:"13yo43"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}]],JO=we("share",QO);const XO=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}],["path",{d:"M12 17h.01",key:"p32p05"}]],eF=we("shield-question-mark",XO);const tF=[["path",{d:"M22 2 2 22",key:"y4kqgn"}]],t2=we("slash",tF);const nF=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}]],rF=we("sparkle",nF);const sF=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],pw=we("sun",sF);const aF=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],iF=we("tag",aF);const oF=[["path",{d:"M17 14V2",key:"8ymqnk"}],["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z",key:"m61m77"}]],lF=we("thumbs-down",oF);const cF=[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]],uF=we("thumbs-up",cF);const dF=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],mF=we("timer",dF);const fF=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Da=we("triangle-alert",fF);const hF=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],pF=we("user-plus",hF);const gF=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],gw=we("user",gF);const xF=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],wi=we("users",xF);const vF=[["circle",{cx:"12",cy:"4.5",r:"2.5",key:"r5ysbb"}],["path",{d:"m10.2 6.3-3.9 3.9",key:"1nzqf6"}],["circle",{cx:"4.5",cy:"12",r:"2.5",key:"jydg6v"}],["path",{d:"M7 12h10",key:"b7w52i"}],["circle",{cx:"19.5",cy:"12",r:"2.5",key:"1piiel"}],["path",{d:"m13.8 17.7 3.9-3.9",key:"1wyg1y"}],["circle",{cx:"12",cy:"19.5",r:"2.5",key:"13o1pw"}]],xw=we("waypoints",vF);const yF=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],bF=we("webhook",yF);const CF=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Or=we("x",CF);function vw({className:e,size:t=24,color:r="currentColor",...s}){return n.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:r,xmlns:"http://www.w3.org/2000/svg",className:e,...s,children:n.jsx("path",{d:"M5 9.5L12 16.5L19 9.5",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ile({className:e,size:t=24,color:r="currentColor",...s}){return n.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,...s,children:n.jsx("path",{fill:r,fillRule:"evenodd",clipRule:"evenodd",d:"M11.555 2.34556L11.5559 2.34511C11.694 2.27669 11.846 2.24109 12 2.24109C12.1541 2.24109 12.3061 2.27669 12.4442 2.34511L12.445 2.34556L19.759 6.00252L12 9.88198L4.24113 6.00252L11.555 2.34556ZM3.00005 7.61805V16.767C2.99875 16.9534 3.04954 17.1364 3.14672 17.2954C3.24374 17.4542 3.38313 17.5827 3.5492 17.6666L11 21.392V11.618L3.00005 7.61805ZM20.4428 17.6656L13 21.387V11.6181L21 7.61804V16.7695C20.9999 16.9555 20.948 17.1379 20.8499 17.296C20.7519 17.4541 20.6117 17.5817 20.445 17.6645L20.4428 17.6656ZM13.335 0.554497L12.89 1.45003L13.3373 0.555601L21.335 4.5545L21.3363 4.55513C21.8356 4.80352 22.2557 5.18614 22.5496 5.66006C22.8438 6.13439 22.9998 6.6819 23 7.24003V16.7706C22.9998 17.3287 22.8438 17.8757 22.5496 18.35C22.2557 18.824 21.8354 19.2067 21.336 19.4551L21.335 19.4556L13.3373 23.4545C12.9206 23.6629 12.461 23.7715 11.995 23.7715C11.529 23.7715 11.0693 23.6629 10.6525 23.4543L2.65283 19.4545L2.65007 19.4531C2.15077 19.2015 1.7317 18.8154 1.44015 18.3383C1.14927 17.8623 0.996878 17.3147 1.00005 16.7569L1.00005 7.2395C1.00034 6.68137 1.15633 6.13439 1.45047 5.66006C1.74436 5.18613 2.16454 4.80349 2.66381 4.55511L2.66505 4.5545L10.6628 0.555601L10.665 0.554497C11.0799 0.348361 11.5368 0.241089 12 0.241089C12.4633 0.241089 12.9202 0.348361 13.335 0.554497ZM12 7C12.8284 7 13.5 6.55228 13.5 6C13.5 5.44772 12.8284 5 12 5C11.1716 5 10.5 5.44772 10.5 6C10.5 6.55228 11.1716 7 12 7ZM5 14C5.55228 14 6 14.6716 6 15.5C6 16.3284 5.55228 17 5 17C4.44772 17 4 16.3284 4 15.5C4 14.6716 4.44772 14 5 14ZM10 13.5C10 12.6716 9.55228 12 9 12C8.44771 12 8 12.6716 8 13.5C8 14.3284 8.44771 15 9 15C9.55229 15 10 14.3284 10 13.5ZM15 12C15.5523 12 16 12.6716 16 13.5C16 14.3284 15.5523 15 15 15C14.4477 15 14 14.3284 14 13.5C14 12.6716 14.4477 12 15 12ZM16 17.5C16 16.6716 15.5523 16 15 16C14.4477 16 14 16.6716 14 17.5C14 18.3284 14.4477 19 15 19C15.5523 19 16 18.3284 16 17.5ZM19 14C19.5523 14 20 14.6716 20 15.5C20 16.3284 19.5523 17 19 17C18.4477 17 18 16.3284 18 15.5C18 14.6716 18.4477 14 19 14ZM20 11.5C20 10.6716 19.5523 10 19 10C18.4477 10 18 10.6716 18 11.5C18 12.3284 18.4477 13 19 13C19.5523 13 20 12.3284 20 11.5Z"})})}function n2({className:e,size:t=24,color:r="currentColor",...s}){return n.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,...s,children:n.jsx("path",{d:"M15.4326 6.98584L14.4702 6.71433V6.71433L15.4326 6.98584ZM9.56737 6.98584L10.5298 6.71433V6.71433L9.56737 6.98584ZM10.4121 13V14C10.8447 14 11.2282 13.7219 11.3626 13.3107L10.4121 13ZM3 18H2V19H3V18ZM22 18V19H23V18H22ZM14.5879 13L13.6374 13.3107C13.7718 13.7219 14.1553 14 14.5879 14V13ZM16 4.5H15C15 4.60418 14.9639 4.84751 14.8598 5.27633C14.7617 5.68062 14.6255 6.16394 14.4702 6.71433L15.4326 6.98584L16.3951 7.25734C16.5472 6.71809 16.6947 6.19581 16.8034 5.74824C16.9061 5.32522 17 4.87044 17 4.5H16ZM12.5 1V2C13.8933 2 15 3.06479 15 4.5H16H17C17 1.93521 14.9727 0 12.5 0V1ZM9 4.5H10C10 3.06479 11.1067 2 12.5 2V1V0C10.0273 0 8 1.93521 8 4.5H9ZM9.56737 6.98584L10.5298 6.71433C10.3745 6.16394 10.2383 5.68062 10.1402 5.27633C10.0361 4.84751 10 4.60418 10 4.5H9H8C8 4.87044 8.09394 5.32522 8.19665 5.74824C8.30532 6.1958 8.45281 6.71809 8.60494 7.25734L9.56737 6.98584ZM10.4121 13L11.3626 13.3107C11.6761 12.3517 11.5575 11.1322 11.3584 10.0453C11.1513 8.91463 10.812 7.71466 10.5298 6.71433L9.56737 6.98584L8.60494 7.25734C8.89233 8.27611 9.204 9.38378 9.39117 10.4057C9.58638 11.4714 9.6054 12.2494 9.46159 12.6893L10.4121 13ZM5 13V14H10.4121V13V12H5V13ZM3 15H4C4 14.4477 4.44772 14 5 14V13V12C3.34315 12 2 13.3431 2 15H3ZM3 18H4V15H3H2V18H3ZM22 18V17H3V18V19H22V18ZM22 15H21V18H22H23V15H22ZM20 13V14C20.5523 14 21 14.4477 21 15H22H23C23 13.3431 21.6569 12 20 12V13ZM14.5879 13V14H20V13V12H14.5879V13ZM15.4326 6.98584L14.4702 6.71433C14.188 7.71466 13.8487 8.91463 13.6416 10.0453C13.4425 11.1322 13.3239 12.3517 13.6374 13.3107L14.5879 13L15.5384 12.6893C15.3946 12.2494 15.4136 11.4714 15.6088 10.4057C15.796 9.38378 16.1077 8.27611 16.3951 7.25734L15.4326 6.98584ZM4 22V23H21V22V21H4V22Z",fill:r})})}function wF({className:e,size:t=24,color:r="currentColor",...s}){return n.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,...s,children:[n.jsx("path",{d:"M18 19C18.5523 19 19 18.5523 19 18C19 17.4477 18.5523 17 18 17V18V19ZM3 18H2V19H3V18ZM10.4121 13V14C10.8447 14 11.2282 13.7219 11.3626 13.3107L10.4121 13ZM11.391 10.2369C11.298 9.69248 10.7813 9.32655 10.2369 9.41955C9.69248 9.51256 9.32655 10.0293 9.41955 10.5737L10.4053 10.4053L11.391 10.2369ZM21 16.3506C21 16.9029 21.4477 17.3506 22 17.3506C22.5523 17.3506 23 16.9029 23 16.3506H22H21ZM18.6494 12C18.0971 12 17.6494 12.4477 17.6494 13C17.6494 13.5523 18.0971 14 18.6494 14V13V12ZM15.6514 6.2041L16.6143 6.47374L16.6159 6.46802L15.6514 6.2041ZM15.2139 7.7666L14.2509 7.49697L14.2499 7.50066L15.2139 7.7666ZM13.8726 8.96598C13.7454 9.50342 14.078 10.0422 14.6154 10.1694C15.1528 10.2966 15.6916 9.96403 15.8188 9.42659L14.8457 9.19629L13.8726 8.96598ZM8.17979 3.2141C8.02674 3.74475 8.33285 4.299 8.86351 4.45205C9.39417 4.60509 9.94842 4.29898 10.1015 3.76833L9.14062 3.49121L8.17979 3.2141ZM18 18V17H3V18V19H18V18ZM3 18H4V15H3H2V18H3ZM3 15H4C4 14.4477 4.44772 14 5 14V13V12C3.34315 12 2 13.3431 2 15H3ZM5 13V14H10.4121V13V12H5V13ZM10.4121 13L11.3626 13.3107C11.6603 12.4001 11.566 11.2612 11.391 10.2369L10.4053 10.4053L9.41955 10.5737C9.58875 11.5641 9.59569 12.2791 9.4616 12.6893L10.4121 13ZM20 13V14C20.5523 14 21 14.4477 21 15H22H23C23 13.3431 21.6569 12 20 12V13ZM22 15H21V16.3506H22H23V15H22ZM18.6494 13V14H20V13V12H18.6494V13ZM12.5 1V2C13.8933 2 15 3.06479 15 4.5H16H17C17 1.93521 14.9727 0 12.5 0V1ZM16 4.5H15C15 4.69279 14.9013 5.15634 14.6868 5.94018L15.6514 6.2041L16.6159 6.46802C16.8069 5.77001 17 5.01901 17 4.5H16ZM15.6514 6.2041L14.6884 5.93447L14.2509 7.49697L15.2139 7.7666L16.1768 8.03623L16.6143 6.47373L15.6514 6.2041ZM15.2139 7.7666L14.2499 7.50066C14.1189 7.97543 13.9898 8.47061 13.8726 8.96598L14.8457 9.19629L15.8188 9.42659C15.9293 8.95995 16.0519 8.48902 16.1779 8.03254L15.2139 7.7666ZM9.14062 3.49121L10.1015 3.76833C10.4015 2.72814 11.3476 2 12.5 2V1V0C10.4703 0 8.73053 1.30452 8.17979 3.2141L9.14062 3.49121Z",fill:r}),n.jsx("path",{d:"M22 22V23C22.4045 23 22.7691 22.7564 22.9239 22.3827C23.0787 22.009 22.9931 21.5789 22.7071 21.2929L22 22ZM2.70711 1.29289C2.31658 0.902369 1.68342 0.902369 1.29289 1.29289C0.902369 1.68342 0.902369 2.31658 1.29289 2.70711L2 2L2.70711 1.29289ZM4 22V23H22V22V21H4V22ZM2 2L1.29289 2.70711L21.2929 22.7071L22 22L22.7071 21.2929L2.70711 1.29289L2 2Z",fill:r})]})}function Dle({className:e,size:t=24,color:r="currentColor",...s}){return n.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,...s,children:[n.jsx("path",{d:"M6.5 12.5L8.05719 15.9428L11.5 17.5L8.05719 19.0572L6.5 22.5L4.94281 19.0572L1.5 17.5L4.94281 15.9428L6.5 12.5Z",fill:r}),n.jsx("path",{d:"M15.5 1L17.8358 6.16421L23 8.5L17.8358 10.8358L15.5 16L13.1642 10.8358L8 8.5L13.1642 6.16421L15.5 1Z",fill:r})]})}function _le({className:e,size:t=24,color:r="currentColor",...s}){return n.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,...s,children:n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.5 7C9.32843 7 10 6.32843 10 5.5C10 4.67157 9.32843 4 8.5 4C7.67157 4 7 4.67157 7 5.5C7 6.32843 7.67157 7 8.5 7ZM8.5 13C9.32843 13 10 12.3284 10 11.5C10 10.6716 9.32843 10 8.5 10C7.67157 10 7 10.6716 7 11.5C7 12.3284 7.67157 13 8.5 13ZM10 17.5C10 18.3284 9.32843 19 8.5 19C7.67157 19 7 18.3284 7 17.5C7 16.6716 7.67157 16 8.5 16C9.32843 16 10 16.6716 10 17.5ZM14.5 7C15.3284 7 16 6.32843 16 5.5C16 4.67157 15.3284 4 14.5 4C13.6716 4 13 4.67157 13 5.5C13 6.32843 13.6716 7 14.5 7ZM16 11.5C16 12.3284 15.3284 13 14.5 13C13.6716 13 13 12.3284 13 11.5C13 10.6716 13.6716 10 14.5 10C15.3284 10 16 10.6716 16 11.5ZM14.5 19C15.3284 19 16 18.3284 16 17.5C16 16.6716 15.3284 16 14.5 16C13.6716 16 13 16.6716 13 17.5C13 18.3284 13.6716 19 14.5 19Z",fill:r})})}function jF({className:e,size:t=24,color:r="currentColor",...s}){return n.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,...s,children:[n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 12C1 11.4477 1.44772 11 2 11H9C9.39238 11 9.7485 11.2295 9.91063 11.5868C10.0728 11.9441 10.011 12.3632 9.75258 12.6585L4.20377 19H9C9.55229 19 10 19.4477 10 20C10 20.5523 9.55229 21 9 21H2C1.60762 21 1.2515 20.7705 1.08937 20.4132C0.927231 20.0559 0.989042 19.6368 1.24742 19.3415L6.79623 13H2C1.44772 13 1 12.5523 1 12Z",fill:r}),n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5C12 4.44772 12.4477 4 13 4H22C22.3949 4 22.7528 4.23241 22.9135 4.59316C23.0742 4.95391 23.0075 5.37543 22.7433 5.66896L15.2454 14H22C22.5523 14 23 14.4477 23 15C23 15.5523 22.5523 16 22 16H13C12.6051 16 12.2472 15.7676 12.0865 15.4068C11.9258 15.0461 11.9925 14.6246 12.2567 14.331L19.7546 6H13C12.4477 6 12 5.55228 12 5Z",fill:r})]})}function SF({className:e,size:t=24,color:r="currentColor",label:s,...a}){return n.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,"aria-label":s,"aria-hidden":s?void 0:!0,...a,children:n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.5863 12.4671C10.6779 10.8695 11.3597 8.26699 12.8412 5.33301H5.33333C4.59695 5.33301 4 5.92996 4 6.66634V17.333C4 18.0694 4.59695 18.6663 5.33333 18.6663H12.9117C12.7891 17.8747 12.7469 17.0846 12.7501 16.3445C12.451 16.3835 12.1475 16.4046 11.8431 16.4046C10.7679 16.4046 9.702 16.142 8.81073 15.7511C7.92993 15.3648 7.1676 14.8297 6.745 14.2429C6.58904 14.0263 6.63821 13.7242 6.85487 13.5682C7.07147 13.4123 7.37353 13.4614 7.52947 13.6781C7.8128 14.0715 8.40347 14.5169 9.19907 14.8659C9.98427 15.2103 10.9184 15.4379 11.8431 15.4379C12.1563 15.4379 12.4705 15.4118 12.7797 15.3639C12.8241 14.5497 12.9102 13.8379 12.9788 13.3109H11.3921C10.9486 13.3109 10.5589 12.9462 10.5863 12.4671ZM13.7187 16.1537C14.1256 16.0465 14.5149 15.9093 14.8755 15.7511C15.7564 15.3648 16.5187 14.8297 16.9413 14.2429C17.0973 14.0263 17.0481 13.7242 16.8315 13.5682C16.6148 13.4123 16.3127 13.4614 16.1568 13.6781C15.8735 14.0715 15.2829 14.5169 14.4873 14.8659C14.2571 14.9668 14.0142 15.0577 13.7625 15.1357C13.8133 14.3959 13.896 13.7485 13.9598 13.2651C14.0243 12.7757 13.6432 12.3442 13.1518 12.3442H11.564C11.6922 10.8127 12.393 8.2465 13.9289 5.33301H18.6667C19.4031 5.33301 20 5.92996 20 6.66634V17.333C20 18.0694 19.4031 18.6663 18.6667 18.6663H13.8905C13.7466 17.815 13.7059 16.9543 13.7187 16.1537ZM8.33333 8.18301C8.60027 8.18301 8.81667 8.3994 8.81667 8.66634V10.235C8.81667 10.5019 8.60027 10.7183 8.33333 10.7183C8.0664 10.7183 7.85 10.5019 7.85 10.235V8.66634C7.85 8.3994 8.0664 8.18301 8.33333 8.18301ZM16.15 8.66634C16.15 8.3994 15.9336 8.18301 15.6667 8.18301C15.3997 8.18301 15.1833 8.3994 15.1833 8.66634V10.235C15.1833 10.5019 15.3997 10.7183 15.6667 10.7183C15.9336 10.7183 16.15 10.5019 16.15 10.235V8.66634Z",fill:r})})}function kF({className:e,size:t=24,color:r="currentColor",label:s,...a}){return n.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,"aria-label":s,"aria-hidden":s?void 0:!0,...a,children:n.jsx("path",{d:"M4.33334 6.18623L10.6037 5.32854V11.3673H4.33334V6.18623ZM11.3589 5.20951L19.6667 4V11.3166H11.3589V5.20951ZM4.33334 12.0063H10.6037V18.0625L4.33334 17.1874V12.0063ZM11.3589 12.0867H19.6667V19.3333L11.3589 18.1606",fill:r})})}function NF({className:e,size:t=24,color:r="currentColor",label:s,...a}){return n.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,"aria-label":s,"aria-hidden":s?void 0:!0,...a,children:n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.5947 4.76129C13.7464 3.24336 15.3475 3.23598 15.3475 3.23598C15.3475 3.23598 15.5856 4.66307 14.4415 6.03783C13.2199 7.50581 11.8313 7.26561 11.8313 7.26561C11.8313 7.26561 11.5706 6.11114 12.5947 4.76129ZM11.9778 8.26527C12.5703 8.26527 13.6699 7.45084 15.1012 7.45084C17.5649 7.45084 18.5342 9.20396 18.5342 9.20396C18.5342 9.20396 16.6385 10.1731 16.6385 12.5248C16.6385 15.1778 19 16.0921 19 16.0921C19 16.0921 17.3492 20.7383 15.1195 20.7383C14.0954 20.7383 13.2993 20.0482 12.2202 20.0482C11.1207 20.0482 10.0295 20.764 9.31875 20.764C7.28272 20.7641 4.71048 16.3567 4.71048 12.8139C4.71048 9.32822 6.88768 7.49967 8.92984 7.49967C10.2574 7.49967 11.2877 8.26527 11.9778 8.26527Z",fill:r})})}function EF({color:e="currentColor"}){return n.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M20 6C20 4.89543 19.1046 4 18 4H4C2.89543 4 2 4.89543 2 6V14C2 15.1046 2.89543 16 4 16H14M1 20H14M17.8571 9H22.1429C22.6162 9 23 9.49249 23 10.1V18.9C23 19.5075 22.6162 20 22.1429 20H17.8571C17.3838 20 17 19.5075 17 18.9V10.1C17 9.49249 17.3838 9 17.8571 9Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function AF({className:e,size:t=24,color:r,label:s,...a}){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 48 44",fill:"none",...a,children:[n.jsx("path",{d:"M15.9985 22.0001H1.99854",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round"}),n.jsx("path",{d:"M26.0015 22H34.0015",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round"}),n.jsx("path",{d:"M13.8452 14.0001V7.44152C13.8452 6.58066 14.3961 5.81638 15.2128 5.54415L23.2128 2.87749C24.5078 2.4458 25.8452 3.40974 25.8452 4.77485V14.0004V30.0004V39.2252C25.8452 40.5903 24.5079 41.5543 23.2128 41.1226L15.2128 38.4562C14.3961 38.184 13.8452 37.4197 13.8452 36.5588V30.0003",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round"}),n.jsx("rect",{x:"34.0015",y:"16",width:"12",height:"12",rx:"3",stroke:"currentColor",strokeWidth:"4"})]})}function Mle(e){return e}function PF(e){return!!(e&&typeof e=="object"&&e.constructor===Object)}function db(e){return e?typeof e=="object"&&"then"in e:!1}function Vm(e,t){return e.length===t.length&&e.every((r,s)=>t[s]===r)}function Lle(e,t){return e.reduce((r,s)=>({...r,[s[t]]:s}),{})}const mb=Object.prototype.hasOwnProperty;function $m(e,t){let r,s;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((s=e.length)===t.length)for(;s--&&$m(e[s],t[s]););return s===-1}if(!r||typeof e=="object"){s=0;for(r in e)if(mb.call(e,r)&&++s&&!mb.call(t,r)||!(r in t)||!$m(e[r],t[r]))return!1;return Object.keys(t).length===s}}return e!==e&&t!==t}function Rle(e,t){const r=e.reduce((s,a)=>{const i=a[t],l=(s[i]||0)+1;return{...s,[i]:l}},{});return Object.entries(r).sort(([,s],[,a])=>a-s)}function b0(){}function yw(){return globalThis.navigator.userAgent.includes("Win")}function TF(){return globalThis.navigator.userAgent.includes("Mac")}function du(e){try{const t=document.createElement("a");t.href=e;const r=t.host!==globalThis.location.host,s=!t.pathname.startsWith("/admin/");return r||s}catch{return!0}}function Ole(e){return/^[\dA-Za-z]+$/.test(e)}function bw(e){return e.addresses[0]==="100.101.102.103"&&e.user==="services@tailscale.com"}function Fle(e){return/^[\dA-Fa-f]+?$/.test(e)}function Hm(e){return e.startsWith("100.")}function r2(e){return e.startsWith("fd7a:115c:a1e0")}function fb(e){return e.includes(".")}function hb(e){return e.includes(":")}function IF(){return!1}function DF(){return"https://login.tailscale.com"}function qs(e){return e.endsWith(".org.github")}function Cw(e,t){const r=Object.entries(t).reduce((a,[i,l])=>(l!==void 0&&(a[i]=l.toString()),a),{}),s=Object.keys(r).length>0?"?"+new URLSearchParams(r).toString():"";return e+s}function _F(e,t=50){let r=0;function s(){const a=document.querySelector(e);if(a){a.scrollIntoView({behavior:"smooth"});return}r++,r{let t;const r=new Set,s=(d,m)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const g=t;t=m??typeof p!="object"?p:Object.assign({},t,p),r.forEach(v=>v(t,g))}},a=()=>t,u={setState:s,getState:a,subscribe:d=>(r.add(d),()=>r.delete(d)),destroy:()=>{(MF&&"production")!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}};return t=e(s,a,u),u},LF=e=>e?pb(e):pb;var W1={exports:{}},K1={},G1={exports:{}},q1={};var gb;function RF(){if(gb)return q1;gb=1;var e=Di();function t(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var r=typeof Object.is=="function"?Object.is:t,s=e.useState,a=e.useEffect,i=e.useLayoutEffect,l=e.useDebugValue;function u(g,v){var y=v(),C=s({inst:{value:y,getSnapshot:v}}),b=C[0].inst,w=C[1];return i(function(){b.value=y,b.getSnapshot=v,d(b)&&w({inst:b})},[g,y,v]),a(function(){return d(b)&&w({inst:b}),g(function(){d(b)&&w({inst:b})})},[g]),l(y),y}function d(g){var v=g.getSnapshot;g=g.value;try{var y=v();return!r(g,y)}catch{return!0}}function m(g,v){return v()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?m:u;return q1.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,q1}var xb;function OF(){return xb||(xb=1,G1.exports=RF()),G1.exports}var vb;function FF(){if(vb)return K1;vb=1;var e=Di(),t=OF();function r(m,p){return m===p&&(m!==0||1/m===1/p)||m!==m&&p!==p}var s=typeof Object.is=="function"?Object.is:r,a=t.useSyncExternalStore,i=e.useRef,l=e.useEffect,u=e.useMemo,d=e.useDebugValue;return K1.useSyncExternalStoreWithSelector=function(m,p,g,v,y){var C=i(null);if(C.current===null){var b={hasValue:!1,value:null};C.current=b}else b=C.current;C=u(function(){function N(I){if(!k){if(k=!0,E=I,I=v(I),y!==void 0&&b.hasValue){var F=b.value;if(y(F,I))return T=F}return T=I}if(F=T,s(E,I))return F;var z=v(I);return y!==void 0&&y(F,z)?F:(E=I,T=z)}var k=!1,E,T,_=g===void 0?null:g;return[function(){return N(p())},_===null?void 0:function(){return N(_())}]},[p,g,v,y]);var w=a(m,C[0],C[1]);return l(function(){b.hasValue=!0,b.value=w},[w]),d(w),w},K1}var yb;function BF(){return yb||(yb=1,W1.exports=FF()),W1.exports}var UF=BF();const VF=Qc(UF),$F={},{useSyncExternalStoreWithSelector:HF}=VF;function zF(e,t=e.getState,r){const s=HF(e.subscribe,e.getState,e.getServerState||e.getState,t,r);return f.useDebugValue(s),s}const bb=e=>{($F&&"production")!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?LF(e):e,r=(s,a)=>zF(t,s,a);return Object.assign(r,t),r},zf=e=>e?bb(e):bb;function s2(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[s,a]of e)if(!Object.is(a,t.get(s)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!1;for(let s=0;s({toasts:[],maxToasts:5,clear:()=>{e({toasts:[]})},dismiss:r=>{e(s=>({toasts:s.toasts.filter(a=>a.key!==r)}))},show:r=>{const{toasts:s,maxToasts:a}=t(),i={key:Date.now().toString(),...r},l=s.findIndex(d=>d.key===i.key),u=l===-1?[...s,i]:[...s.slice(0,l),i,...s.slice(l+1)];return e({toasts:u.slice(-a)}),i.key}})),GF=e=>e.clear,qF=e=>({show:e.show,dismiss:e.dismiss,clear:e.clear}),YF=()=>a2(qF,s2);function ZF(e){const{children:t,canEscapeKeyClear:r=!0}=e,s=a2(GF);return f.useEffect(()=>{function a(i){r&&(i.key==="Esc"||i.key==="Escape")&&s()}return globalThis.addEventListener("keydown",a),()=>{globalThis.removeEventListener("keydown",a)}},[r,s]),n.jsxs(n.Fragment,{children:[t,n.jsx(JF,{})]})}const QF=e=>({toasts:e.toasts,dismiss:e.dismiss});function JF(){const{toasts:e,dismiss:t}=a2(QF,s2),r=f.useRef(e),[s]=f.useState(()=>new Map),a=l=>{let u=0,d=e,m=d.findIndex(p=>p.key===l);if(m===-1&&(d=r.current,m=d.findIndex(p=>p.key===l)),m===-1)return u;for(let p=d.length;p>m;p--){if(!d[p])continue;const g=s.get(d[p].key);g&&(u-=g.offsetHeight,u-=KF)}return u};f.useEffect(()=>{r.current=e},[e]);const i=FL(e,{keys:l=>l.key,from:{opacity:0,transform:"translateY(40px) scale(0.95)"},enter:l=>async u=>{const d=a(l.key);return u({opacity:1,transform:`translateY(${d}px) scale(1.0)`})},update:l=>async u=>{const d=a(l.key);return u({opacity:1,transform:`translateY(${d}px) scale(1.0)`,zIndex:5})},leave:l=>({opacity:0,transform:`translateY(${a(l.key)+5}px) scale(0.95)`,zIndex:2}),config:WF});if(!Rc)throw new Error("Could not find toast root");return Mi.createPortal(n.jsx("div",{className:"fixed bottom-6 right-6 z-[99]",children:i((l,u)=>n.jsx(tR.div,{style:l,children:n.jsx(XF,{ref:d=>d&&s.set(u.key,d),toast:u,onDismiss:t})}))}),Rc)}const XF=f.forwardRef(({toast:e,onDismiss:t=b0},r)=>{const{message:s,key:a,timeout:i=5e3,variant:l}=e,[u,d]=f.useState(!1),m=f.useCallback(()=>t(a),[t,a]),p=f.useCallback(()=>d(!0),[]),g=f.useCallback(()=>d(!1),[]);return f.useEffect(()=>{if(i<=0||u)return;const v=setTimeout(()=>m(),i);return()=>clearTimeout(v)},[m,i,u]),n.jsxs("div",{className:D("bottom-0 right-0 z-[99] w-[85vw] origin-bottom","sm:min-w-[400px] sm:max-w-[500px]","absolute shadow-sm rounded-md flex items-center justify-between",{"text-white bg-gray-700 dark:bg-gray-700 dark:border dark:border-gray-600":l===void 0,"text-white bg-red-400 dark:bg-red-500":l==="danger"}),"aria-live":"polite",ref:r,onBlur:g,onFocus:p,onMouseEnter:p,onMouseLeave:g,tabIndex:0,children:[n.jsx("span",{className:"pl-4 py-3.5 pr-2",children:s}),n.jsxs("div",{className:D("mr-1.5",{"flex items-center gap-1":e.additionalAction}),children:[e.additionalAction&&n.jsx(ue,{variant:"minimal",className:"!text-white hover:!bg-white hover:!bg-opacity-15",onClick:()=>{e.additionalAction?.onClick(),e.additionalAction?.persistToastAfterClick||m()},children:e.additionalAction.label}),n.jsx(ue,{variant:"minimal",iconOnly:!0,className:"!text-white hover:!bg-white hover:!bg-opacity-15",onClick:m,children:n.jsx(Or,{})})]})]})});function eB(e){return e*Number.parseFloat(getComputedStyle(document.documentElement).fontSize)}const et=YF,C0=zf(e=>({secFetchSiteErrorType:"none",setSecFetchSiteError:t=>e({secFetchSiteErrorType:t})})),tB=e=>e.secFetchSiteErrorType;function nB(){const e=et(),t=f.useRef(""),r=C0(tB,s2);f.useEffect(()=>{r==="missing"?t.current=e.show({variant:"danger",message:n.jsxs(n.Fragment,{children:[n.jsxs("strong",{children:["Missing ",n.jsx("code",{children:"Sec-Fetch-Site"})," security header"]}),n.jsxs("p",{children:["Your browser did not send the"," ",n.jsx("a",{href:"https://caniuse.com/mdn-http_headers_sec-fetch-site",className:"link-underline",target:"_blank",rel:"noopener noreferrer",children:n.jsx("code",{children:"Sec-Fetch-Site"})})," ","security header that is required by the Tailscale control plane. If this issue persists, you may need to update your browser."]})]}),timeout:1e4}):r==="invalid"?t.current=e.show({variant:"danger",message:n.jsxs(n.Fragment,{children:[n.jsxs("strong",{children:["Invalid ",n.jsx("code",{children:"Sec-Fetch-Site"})," security header"]}),n.jsxs("p",{children:["Your browser sent an invalid"," ",n.jsx("a",{href:"https://caniuse.com/mdn-http_headers_sec-fetch-site",className:"link-underline",target:"_blank",rel:"noopener noreferrer",children:n.jsx("code",{children:"Sec-Fetch-Site"})})," ","security header prohibited by the Tailscale control plane. Refresh the page to resolve this issue. Ensure the URL you are visiting begins with ",n.jsx("code",{children:"https://login.tailscale.com/"}),". If this issue persists,"," ",n.jsx(Zn,{type:"connectivity",className:"link-underline",children:"contact support"})," ","for help."]})]}),timeout:1e4}):t.current&&e.dismiss(t.current)},[r,e])}const Ie=rn.create({baseURL:_f()+"/admin/api",timeout:3e4,retries:3,...gr&&{withCredentials:!0}}),ww={fetcher:e=>Ie.get(e).then(t=>t.data.data),shouldRetryOnError:!1,fallback:rB()};function rB(){const e=document.querySelector("script#tailscale-api-prefetch");if(!e?.textContent)return{};try{return JSON.parse(e.textContent)}catch{return{}}}const jw=()=>yi(()=>!0,void 0,{revalidate:!1}),sB={retries:3};Ie.interceptors.response.use(void 0,e=>{Ex(e.response?.headers?.["x-control-origin"]);const{config:t}=e;if(!t)return Promise.reject(e);const{retries:r}=Object.assign({},sB,t);if(t.retryCount=t.retryCount||0,!(iB(e)&&t.retryCountsetTimeout(()=>i(Ie(t)),a))});Ie.interceptors.response.use(e=>(xM(e.headers.date),Ex(e.headers["x-control-origin"]),e));Ie.interceptors.response.use(e=>((e.config.method==="post"||e.config.method==="patch"||e.config.method==="delete"||e.config.method==="put")&&C0.getState().setSecFetchSiteError("none"),e),e=>{if(!e.response)return Promise.reject(e);const t=typeof e.response.data=="string"?e.response.data.toLowerCase():"";if(!(e.response.status===403&&t.includes("sec-fetch-site")))return Promise.reject(e);const s=t.includes("cross-origin")||t.includes("none"),a=t.includes("empty"),i=s?"invalid":a?"missing":"none";return C0.getState().setSecFetchSiteError(i),Promise.reject(e)});const aB=new Set(["GET","HEAD","OPTIONS","PUT","DELETE"]);function iB(e){if(!e.config||!e.config.method)return!1;const t=e.code!=="ECONNABORTED"&&(!e.response||e.response.status>=500&&e.response.status<=599),r=!!e.isAxiosError&&!e.response,s=aB.has(e.config.method.toUpperCase());return!!(t&&(r||s))}function oB(e=0){const t=Math.pow(2,e)*100,r=t*.2*Math.random();return t+r}function ot(){const{data:e,...t}=dt("/self",i=>Ie.get(i,{retries:5}).then(l=>l.data.data)),r=dt("/self/tailnets",i=>Ie.get(i,{retries:5}).then(l=>l.data.data));async function s(i){await Ie.post("/self/tailnets",{tailnetID:i})}const a=f.useMemo(()=>r.data?.tailnets.find(i=>i.tailnetID===r?.data?.currentTailnetID),[r.data?.currentTailnetID,r.data?.tailnets]);return{data:e?.user,permissions:e?.permissions,tailnets:r?.data?.tailnets,hasAdditionalTailnets:r?.data?.hasAdditionalTailnets,currentTailnetID:r?.data?.currentTailnetID,currentTailnet:a,isPersonalTailnet:r?.data?.isPersonalTailnet,switchTailnet:s,...t}}const lB={IntroducingGrantEditor:"new tailnet policy visual editor",CloudMarketplaceAwareness:"cloud marketplaces billing options",InviteTeamBanner:"invite team banner in users page for org tailnets",SolutionGuides:"solution guides banner on machines page",OnboardingSurveyBackfill:"onboarding survey re-prompt",MullvadAwarenessBanner:"Mullvad VPN add-on awareness banner",ApertureAwarenessBanner:"Aperture awareness banner for AI Infrastructure tailnets"},i2=Object.fromEntries(Object.keys(lB).map(e=>[e,e]));function mu(){const{data:e,mutate:t}=ot(),r=et();return{dismissNotice:i=>{Ie.post(`/public/dismiss-notice/${i}`).then(()=>{t()}).catch(()=>{r.show({message:"Error encountered dismissing notice, try again later."})})},isDismissed:i=>e?.dismissedNotices?.includes(i)||!1}}const cB={featureHTTPS:!1,freePersonalPro:!1,provisioningSupported:!1,billingManagedExternally:!1,auditLogs:!1,allowedTrialWithoutCard:!1,forceMachineAuthStuckOn:!1,webhooks:!1,machinesFilters:!1,emailPreferences:!1,trialBanner:!1,trialNoBanner:!1,userEnforcementDisabled:!1,networkLogging:!1,logStreaming:!1,devicePosture:!1,sshAdvanced:!1,featureMultiUseSharing:!1,featureCanSendEmail:!1,featureSeparateSearchDomains:!1,featureMachineAuth:!1,featureCustomKeyExpiry:!1,featureSessionExpiry:!1,featureAllUserRoles:!1,featureUserGroupDialog:!1,featureBYODomain:!1,featureSSHWebhookEvents:!1,featureUseNetworkLock:!1,featureOnboardingInvites:!1,featureIngress:!1,featureBringToWork:!1,featureGoogleSyncAllGroups:!1,featureTaildrive:!1,postureIdentity:!1,postureGeolocation:!1,postureIPAddress:!1,postureIntegrations:!1,postureTroubleshootingAlpha:!1,featureControlD:!1,staticRecords:!1,deviceAdminRole:!1,tailnetCreationAPI:!1,featureSelfServeIdP:!1,featureOAuthAuthorizationFlow:!1,featureNoWaitlistingOrInvites:!1,featureFreeMullvad:!1,featureTrafficSteering:!1,featureSeeGeoSteering:!1,featureExternalUserInvites:!1,featureShowExternalUsersRoleSelector:!1,featureDomainClaim:!1,featureTailnetDefaultAutoUpdate:!1,featureDeviceCertVerification:!1,featureResolverUseWithExitNode:!1,featureBorder0MilestoneOne:!1,featureBorder0MilestoneTwo:!1,featureBorder0MilestoneThree:!1,featureBorder0IntegrationOK:!1,featureServicesDisplayName:!1,featureAzureLogStreaming:!1,featureNewConsole:!1,featurePAMCapability:!1,featureOnboardingSurveyBackfill:!1,featureSeeDevicePostureIPAddress:!1,featureDevicePostureIPAddress:!1,featureSideNav:!1};function vt(){const{data:e,mutate:t}=dt("/self");return{data:e?.flags||cB,mutate:t}}function ss(e){const[t,r]=f.useState(e);return f.useEffect(()=>r(e),[e]),{value:t,setTrue:()=>r(!0),setFalse:()=>r(!1),set:s=>r(s),toggle:()=>r(s=>!s)}}function uB(){const e=et(),[t,r]=f.useState(!1);function s(a){return r(!0),Ie.post("/public/admin/send-email",{template:"onboarding",email:a}).then(()=>{r(!1),e.show({message:"Sent download link via email"})}).catch(()=>{r(!1),e.show({variant:"danger",message:"Failed to send download link via email"})})}return{sendOnboardingInvite:s,posting:t}}function Yt(){const[e]=ft();return e.startsWith("/admin/welcome")}const _a="/public/stripe/subscription",dB="/public/stripe/invoices",mB="/public/stripe/promo-codes",fB="/public/stripe/plansV1",Ble="/public/stripe/supported-tax-ids";function Ss(){const{data:e,error:t,mutate:r,isLoading:s}=dt("/users"),[a,i]=f.useState(!1),l=et();function u(m,p){return i(!0),Ie.post(`/public/users/${m.id}/role`,{role:p}).then(()=>{r(),i(!1),l.show({message:Cb(p,m,!0)})}).catch(()=>{i(!1),l.show({message:Cb(p,m,!1),variant:"danger"})})}function d(m,p){return i(!0),Ie.post(`/public/users/${m.id}/${p}`).then(g=>{if(g.data.refreshNeeded){globalThis.location.reload();return}return Promise.all([yi(_a),r()])}).then(()=>{l.show({message:wb(p,m,!0)})}).catch(()=>{l.show({message:wb(p,m,!1),variant:"danger"})}).finally(()=>{i(!1)})}return{data:e,error:t,mutate:r,setUserRole:u,handleAction:d,isPosting:a,isLoading:s}}function Cb(e,t,r){const s=t.loginName;switch(e){case"owner":return r?`Set ${s} as owner`:`Failed to set ${s} as owner`;case"admin":return r?`Set ${s} as admin`:`Failed to set ${s} as admin`;case"network-admin":return r?`Set ${s} as network admin`:`Failed to set ${s} as network admin`;case"it-admin":return r?`Set ${s} as IT admin`:`Failed to set ${s} as IT admin`;case"auditor":return r?`Set ${s} as auditor`:`Failed to set ${s} as auditor`;case"billing-admin":return r?`Set ${s} as billing admin`:`Failed to set ${s} as billing admin`;case"device-admin":return r?`Set ${s} as Device admin`:`Failed to set ${s} as Device admin`;case"member":return r?`Set ${s} as member`:`Failed to set ${s} as member`;default:return e}}function wb(e,t,r){const s=t.loginName;switch(e){case"suspend":return r?`Suspended ${s}`:`Failed to suspend ${s}`;case"restore":return r?`Restored ${s}`:`Failed to restore ${s}`;case"delete":return r?`Deleted ${s}`:`Failed to delete ${s}`;case"approve":return r?`Approved ${s}`:`Failed to approve ${s}`;default:return e}}var de=(e=>(e.Users="users",e.ExternalUsers="externalUsers",e.UserRoles="userRoles",e.Devices="devices",e.DeviceRouting="deviceRouting",e.DeviceAllTags="deviceAllTags",e.DeviceSharing="deviceSharing",e.DeviceAttributes="deviceAttributes",e.ACLs="acls",e.DNS="dns",e.NetworkingSettings="networkingSettings",e.FeatureSettings="featureSettings",e.AccountSettings="accountSettings",e.Keys="keys",e.AuthKeys="authKeys",e.TailnetKeys="tailnetKeys",e.FederatedKeys="federatedKeys",e.Webhooks="webhooks",e.Billing="billing",e.TailnetDeletion="tailnetDeletion",e.AuditLogs="auditLogs",e.NetworkLogs="networkLogs",e.LogStreaming="logStreaming",e.AdminPanelSSH="adminPanelSSH",e.UserInvites="userInvites",e.VIPServices="vipServices",e.OAuthApps="oauthApps",e.Tailnets="tailnets",e))(de||{});function Ho(e){return e!==void 0&&(e.type==="readonly"||e.type==="write")}function Sn(e){return e!==void 0&&e.type==="write"}function qt(e){const{data:t,permissions:r,isValidating:s}=ot();return{access:(r||{})[e],isLoading:t===void 0||s}}const Ea="You don’t have permission to edit this feature.",Sw="You don’t have permission to view this page.";function kw(e,t,r){const{access:s}=qt(e);return s!==void 0&&!t(s)?null:r}const Nw=6048e5,hB=864e5,Ew=6e4,pB=36e5,Ule=1e3,Yd=43200,jb=1440,Sb=Symbol.for("constructDateFrom");function _r(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Sb in e?e[Sb](t):e instanceof Date?new e.constructor(t):new Date(t)}function Qt(e,t){return _r(t||e,e)}function Aw(e,t,r){const s=Qt(e,r?.in);return isNaN(t)?_r(r?.in||e,NaN):(t&&s.setDate(s.getDate()+t),s)}function gB(e,t,r){const s=Qt(e,r?.in);if(isNaN(t))return _r(e,NaN);if(!t)return s;const a=s.getDate(),i=_r(e,s.getTime());i.setMonth(s.getMonth()+t+1,0);const l=i.getDate();return a>=l?i:(s.setFullYear(i.getFullYear(),i.getMonth(),a),s)}function Pw(e,t,r){const{years:s=0,months:a=0,weeks:i=0,days:l=0,hours:u=0,minutes:d=0,seconds:m=0}=t,p=Qt(e,r?.in),g=a||s?gB(p,a+s*12):p,v=l||i?Aw(g,l+i*7):g,y=d+u*60,b=(m+y*60)*1e3;return _r(e,+v+b)}let xB={};function ll(){return xB}function Oc(e,t){const r=ll(),s=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=Qt(e,t?.in),i=a.getDay(),l=(i=i.getTime()?s+1:r.getTime()>=u.getTime()?s:s-1}function Wm(e){const t=Qt(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),+e-+r}function ks(e,...t){const r=_r.bind(null,t.find(s=>typeof s=="object"));return t.map(r)}function Km(e,t){const r=Qt(e,t?.in);return r.setHours(0,0,0,0),r}function Iw(e,t,r){const[s,a]=ks(r?.in,e,t),i=Km(s),l=Km(a),u=+i-Wm(i),d=+l-Wm(l);return Math.round((u-d)/hB)}function vB(e,t){const r=Tw(e,t),s=_r(e,0);return s.setFullYear(r,0,4),s.setHours(0,0,0,0),zm(s)}function yB(e,t,r){const s=Qt(e,r?.in);return s.setTime(s.getTime()+t*Ew),s}function _o(e,t){const r=+Qt(e)-+Qt(t);return r<0?-1:r>0?1:r}function bB(e,t,r){const[s,a]=ks(r?.in,e,t);return+Km(s)==+Km(a)}function CB(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function o2(e){return!(!CB(e)&&typeof e!="number"||isNaN(+Qt(e)))}function wB(e,t,r){const[s,a]=ks(r?.in,e,t),i=s.getFullYear()-a.getFullYear(),l=s.getMonth()-a.getMonth();return i*12+l}function jB(e,t,r){const[s,a]=ks(r?.in,e,t);return s.getFullYear()-a.getFullYear()}function w0(e,t,r){const[s,a]=ks(r?.in,e,t),i=kb(s,a),l=Math.abs(Iw(s,a));s.setDate(s.getDate()-i*l);const u=+(kb(s,a)===-i),d=i*(l-u);return d===0?0:d}function kb(e,t){const r=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return r<0?-1:r>0?1:r}function Wf(e){return t=>{const s=(e?Math[e]:Math.trunc)(t);return s===0?0:s}}function Gm(e,t,r){const[s,a]=ks(r?.in,e,t),i=(+s-+a)/pB;return Wf(r?.roundingMethod)(i)}function Dw(e,t){return+Qt(e)-+Qt(t)}function Fc(e,t,r){const s=Dw(e,t)/Ew;return Wf(r?.roundingMethod)(s)}function SB(e,t){const r=Qt(e,t?.in);return r.setHours(23,59,59,999),r}function kB(e,t){const r=Qt(e,t?.in),s=r.getMonth();return r.setFullYear(r.getFullYear(),s+1,0),r.setHours(23,59,59,999),r}function NB(e,t){const r=Qt(e,t?.in);return+SB(r,t)==+kB(r,t)}function _w(e,t,r){const[s,a,i]=ks(r?.in,e,e,t),l=_o(a,i),u=Math.abs(wB(a,i));if(u<1)return 0;a.getMonth()===1&&a.getDate()>27&&a.setDate(30),a.setMonth(a.getMonth()-l*u);let d=_o(a,i)===-l;NB(s)&&u===1&&_o(s,i)===1&&(d=!1);const m=l*(u-+d);return m===0?0:m}function EB(e,t,r){const s=Dw(e,t)/1e3;return Wf(r?.roundingMethod)(s)}function Nb(e,t,r){const s=w0(e,t,r)/7;return Wf(r?.roundingMethod)(s)}function Eb(e,t,r){const[s,a]=ks(r?.in,e,t),i=_o(s,a),l=Math.abs(jB(s,a));s.setFullYear(1584),a.setFullYear(1584);const u=_o(s,a)===-i,d=i*(l-+u);return d===0?0:d}function AB(e,t){const r=Qt(e,t?.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}const PB={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},TB=(e,t,r)=>{let s;const a=PB[e];return typeof a=="string"?s=a:t===1?s=a.one:s=a.other.replace("{{count}}",t.toString()),r?.addSuffix?r.comparison&&r.comparison>0?"in "+s:s+" ago":s};function Y1(e){return(t={})=>{const r=t.width?String(t.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}const IB={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},DB={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},_B={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},MB={date:Y1({formats:IB,defaultWidth:"full"}),time:Y1({formats:DB,defaultWidth:"full"}),dateTime:Y1({formats:_B,defaultWidth:"full"})},LB={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},RB=(e,t,r,s)=>LB[e];function uc(e){return(t,r)=>{const s=r?.context?String(r.context):"standalone";let a;if(s==="formatting"&&e.formattingValues){const l=e.defaultFormattingWidth||e.defaultWidth,u=r?.width?String(r.width):l;a=e.formattingValues[u]||e.formattingValues[l]}else{const l=e.defaultWidth,u=r?.width?String(r.width):e.defaultWidth;a=e.values[u]||e.values[l]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const OB={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},FB={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},BB={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},UB={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},VB={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},$B={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},HB=(e,t)=>{const r=Number(e),s=r%100;if(s>20||s<10)switch(s%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},zB={ordinalNumber:HB,era:uc({values:OB,defaultWidth:"wide"}),quarter:uc({values:FB,defaultWidth:"wide",argumentCallback:e=>e-1}),month:uc({values:BB,defaultWidth:"wide"}),day:uc({values:UB,defaultWidth:"wide"}),dayPeriod:uc({values:VB,defaultWidth:"wide",formattingValues:$B,defaultFormattingWidth:"wide"})};function dc(e){return(t,r={})=>{const s=r.width,a=s&&e.matchPatterns[s]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const l=i[0],u=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(u)?KB(u,g=>g.test(l)):WB(u,g=>g.test(l));let m;m=e.valueCallback?e.valueCallback(d):d,m=r.valueCallback?r.valueCallback(m):m;const p=t.slice(l.length);return{value:m,rest:p}}}function WB(e,t){for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t(e[r]))return r}function KB(e,t){for(let r=0;r{const s=t.match(e.matchPattern);if(!s)return null;const a=s[0],i=t.match(e.parsePattern);if(!i)return null;let l=e.valueCallback?e.valueCallback(i[0]):i[0];l=r.valueCallback?r.valueCallback(l):l;const u=t.slice(a.length);return{value:l,rest:u}}}const qB=/^(\d+)(th|st|nd|rd)?/i,YB=/\d+/i,ZB={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},QB={any:[/^b/i,/^(a|c)/i]},JB={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},XB={any:[/1/i,/2/i,/3/i,/4/i]},eU={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},tU={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},nU={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},rU={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},sU={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},aU={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},iU={ordinalNumber:GB({matchPattern:qB,parsePattern:YB,valueCallback:e=>parseInt(e,10)}),era:dc({matchPatterns:ZB,defaultMatchWidth:"wide",parsePatterns:QB,defaultParseWidth:"any"}),quarter:dc({matchPatterns:JB,defaultMatchWidth:"wide",parsePatterns:XB,defaultParseWidth:"any",valueCallback:e=>e+1}),month:dc({matchPatterns:eU,defaultMatchWidth:"wide",parsePatterns:tU,defaultParseWidth:"any"}),day:dc({matchPatterns:nU,defaultMatchWidth:"wide",parsePatterns:rU,defaultParseWidth:"any"}),dayPeriod:dc({matchPatterns:sU,defaultMatchWidth:"any",parsePatterns:aU,defaultParseWidth:"any"})},Mw={code:"en-US",formatDistance:TB,formatLong:MB,formatRelative:RB,localize:zB,match:iU,options:{weekStartsOn:0,firstWeekContainsDate:1}};function oU(e,t){const r=Qt(e,t?.in);return Iw(r,AB(r))+1}function lU(e,t){const r=Qt(e,t?.in),s=+zm(r)-+vB(r);return Math.round(s/Nw)+1}function Lw(e,t){const r=Qt(e,t?.in),s=r.getFullYear(),a=ll(),i=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,l=_r(t?.in||e,0);l.setFullYear(s+1,0,i),l.setHours(0,0,0,0);const u=Oc(l,t),d=_r(t?.in||e,0);d.setFullYear(s,0,i),d.setHours(0,0,0,0);const m=Oc(d,t);return+r>=+u?s+1:+r>=+m?s:s-1}function cU(e,t){const r=ll(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=Lw(e,t),i=_r(t?.in||e,0);return i.setFullYear(a,0,s),i.setHours(0,0,0,0),Oc(i,t)}function uU(e,t){const r=Qt(e,t?.in),s=+Oc(r,t)-+cU(r,t);return Math.round(s/Nw)+1}function Dt(e,t){const r=e<0?"-":"",s=Math.abs(e).toString().padStart(t,"0");return r+s}const ba={y(e,t){const r=e.getFullYear(),s=r>0?r:1-r;return Dt(t==="yy"?s%100:s,t.length)},M(e,t){const r=e.getMonth();return t==="M"?String(r+1):Dt(r+1,2)},d(e,t){return Dt(e.getDate(),t.length)},a(e,t){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];default:return r==="am"?"a.m.":"p.m."}},h(e,t){return Dt(e.getHours()%12||12,t.length)},H(e,t){return Dt(e.getHours(),t.length)},m(e,t){return Dt(e.getMinutes(),t.length)},s(e,t){return Dt(e.getSeconds(),t.length)},S(e,t){const r=t.length,s=e.getMilliseconds(),a=Math.trunc(s*Math.pow(10,r-3));return Dt(a,t.length)}},yo={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Ab={G:function(e,t,r){const s=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(s,{width:"abbreviated"});case"GGGGG":return r.era(s,{width:"narrow"});default:return r.era(s,{width:"wide"})}},y:function(e,t,r){if(t==="yo"){const s=e.getFullYear(),a=s>0?s:1-s;return r.ordinalNumber(a,{unit:"year"})}return ba.y(e,t)},Y:function(e,t,r,s){const a=Lw(e,s),i=a>0?a:1-a;if(t==="YY"){const l=i%100;return Dt(l,2)}return t==="Yo"?r.ordinalNumber(i,{unit:"year"}):Dt(i,t.length)},R:function(e,t){const r=Tw(e);return Dt(r,t.length)},u:function(e,t){const r=e.getFullYear();return Dt(r,t.length)},Q:function(e,t,r){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(s);case"QQ":return Dt(s,2);case"Qo":return r.ordinalNumber(s,{unit:"quarter"});case"QQQ":return r.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(s,{width:"narrow",context:"formatting"});default:return r.quarter(s,{width:"wide",context:"formatting"})}},q:function(e,t,r){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(s);case"qq":return Dt(s,2);case"qo":return r.ordinalNumber(s,{unit:"quarter"});case"qqq":return r.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(s,{width:"narrow",context:"standalone"});default:return r.quarter(s,{width:"wide",context:"standalone"})}},M:function(e,t,r){const s=e.getMonth();switch(t){case"M":case"MM":return ba.M(e,t);case"Mo":return r.ordinalNumber(s+1,{unit:"month"});case"MMM":return r.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(s,{width:"narrow",context:"formatting"});default:return r.month(s,{width:"wide",context:"formatting"})}},L:function(e,t,r){const s=e.getMonth();switch(t){case"L":return String(s+1);case"LL":return Dt(s+1,2);case"Lo":return r.ordinalNumber(s+1,{unit:"month"});case"LLL":return r.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(s,{width:"narrow",context:"standalone"});default:return r.month(s,{width:"wide",context:"standalone"})}},w:function(e,t,r,s){const a=uU(e,s);return t==="wo"?r.ordinalNumber(a,{unit:"week"}):Dt(a,t.length)},I:function(e,t,r){const s=lU(e);return t==="Io"?r.ordinalNumber(s,{unit:"week"}):Dt(s,t.length)},d:function(e,t,r){return t==="do"?r.ordinalNumber(e.getDate(),{unit:"date"}):ba.d(e,t)},D:function(e,t,r){const s=oU(e);return t==="Do"?r.ordinalNumber(s,{unit:"dayOfYear"}):Dt(s,t.length)},E:function(e,t,r){const s=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(s,{width:"short",context:"formatting"});default:return r.day(s,{width:"wide",context:"formatting"})}},e:function(e,t,r,s){const a=e.getDay(),i=(a-s.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Dt(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,r,s){const a=e.getDay(),i=(a-s.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Dt(i,t.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,r){const s=e.getDay(),a=s===0?7:s;switch(t){case"i":return String(a);case"ii":return Dt(a,t.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(s,{width:"short",context:"formatting"});default:return r.day(s,{width:"wide",context:"formatting"})}},a:function(e,t,r){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,r){const s=e.getHours();let a;switch(s===12?a=yo.noon:s===0?a=yo.midnight:a=s/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,r){const s=e.getHours();let a;switch(s>=17?a=yo.evening:s>=12?a=yo.afternoon:s>=4?a=yo.morning:a=yo.night,t){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,r){if(t==="ho"){let s=e.getHours()%12;return s===0&&(s=12),r.ordinalNumber(s,{unit:"hour"})}return ba.h(e,t)},H:function(e,t,r){return t==="Ho"?r.ordinalNumber(e.getHours(),{unit:"hour"}):ba.H(e,t)},K:function(e,t,r){const s=e.getHours()%12;return t==="Ko"?r.ordinalNumber(s,{unit:"hour"}):Dt(s,t.length)},k:function(e,t,r){let s=e.getHours();return s===0&&(s=24),t==="ko"?r.ordinalNumber(s,{unit:"hour"}):Dt(s,t.length)},m:function(e,t,r){return t==="mo"?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):ba.m(e,t)},s:function(e,t,r){return t==="so"?r.ordinalNumber(e.getSeconds(),{unit:"second"}):ba.s(e,t)},S:function(e,t){return ba.S(e,t)},X:function(e,t,r){const s=e.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return Tb(s);case"XXXX":case"XX":return li(s);default:return li(s,":")}},x:function(e,t,r){const s=e.getTimezoneOffset();switch(t){case"x":return Tb(s);case"xxxx":case"xx":return li(s);default:return li(s,":")}},O:function(e,t,r){const s=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Pb(s,":");default:return"GMT"+li(s,":")}},z:function(e,t,r){const s=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Pb(s,":");default:return"GMT"+li(s,":")}},t:function(e,t,r){const s=Math.trunc(+e/1e3);return Dt(s,t.length)},T:function(e,t,r){return Dt(+e,t.length)}};function Pb(e,t=""){const r=e>0?"-":"+",s=Math.abs(e),a=Math.trunc(s/60),i=s%60;return i===0?r+String(a):r+String(a)+t+Dt(i,2)}function Tb(e,t){return e%60===0?(e>0?"-":"+")+Dt(Math.abs(e)/60,2):li(e,t)}function li(e,t=""){const r=e>0?"-":"+",s=Math.abs(e),a=Dt(Math.trunc(s/60),2),i=Dt(s%60,2);return r+a+t+i}const Ib=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},Rw=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},dU=(e,t)=>{const r=e.match(/(P+)(p+)?/)||[],s=r[1],a=r[2];if(!a)return Ib(e,t);let i;switch(s){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",Ib(s,t)).replace("{{time}}",Rw(a,t))},mU={p:Rw,P:dU},fU=/^D+$/,hU=/^Y+$/,pU=["D","DD","YY","YYYY"];function gU(e){return fU.test(e)}function xU(e){return hU.test(e)}function vU(e,t,r){const s=yU(e,t,r);if(console.warn(s),pU.includes(e))throw new RangeError(s)}function yU(e,t,r){const s=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${s} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const bU=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,CU=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,wU=/^'([^]*?)'?$/,jU=/''/g,SU=/[a-zA-Z]/;function kU(e,t,r){const s=ll(),a=r?.locale??s.locale??Mw,i=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,l=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0,u=Qt(e,r?.in);if(!o2(u))throw new RangeError("Invalid time value");let d=t.match(CU).map(p=>{const g=p[0];if(g==="p"||g==="P"){const v=mU[g];return v(p,a.formatLong)}return p}).join("").match(bU).map(p=>{if(p==="''")return{isToken:!1,value:"'"};const g=p[0];if(g==="'")return{isToken:!1,value:NU(p)};if(Ab[g])return{isToken:!0,value:p};if(g.match(SU))throw new RangeError("Format string contains an unescaped latin alphabet character `"+g+"`");return{isToken:!1,value:p}});a.localize.preprocessor&&(d=a.localize.preprocessor(u,d));const m={firstWeekContainsDate:i,weekStartsOn:l,locale:a};return d.map(p=>{if(!p.isToken)return p.value;const g=p.value;(!r?.useAdditionalWeekYearTokens&&xU(g)||!r?.useAdditionalDayOfYearTokens&&gU(g))&&vU(g,t,String(e));const v=Ab[g[0]];return v(u,g,a.localize,m)}).join("")}function NU(e){const t=e.match(wU);return t?t[1].replace(jU,"'"):e}function EU(e,t,r){const a=ll().locale??Mw,i=2520,l=_o(e,t);if(isNaN(l))throw new RangeError("Invalid time value");const u=Object.assign({},r,{addSuffix:r?.addSuffix,comparison:l}),[d,m]=ks(r?.in,...l>0?[t,e]:[e,t]),p=EB(m,d),g=(Wm(m)-Wm(d))/1e3,v=Math.round((p-g)/60);let y;if(v<2)return v===0?a.formatDistance("lessThanXMinutes",1,u):a.formatDistance("xMinutes",v,u);if(v<45)return a.formatDistance("xMinutes",v,u);if(v<90)return a.formatDistance("aboutXHours",1,u);if(v=0;--s)if(r[s].type==="timeZoneName")return r[s].value}function DU(e,t){const r=e.format(t).replace(/\u200E/g,""),s=/ [\w-+ ]+$/.exec(r);return s?s[0].substr(1):""}function _U(e,t,r){return new Intl.DateTimeFormat(r?[r.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function MU(e,t){const r=BU(t);return"formatToParts"in r?RU(r,e):OU(r,e)}const LU={year:0,month:1,day:2,hour:3,minute:4,second:5};function RU(e,t){try{const r=e.formatToParts(t),s=[];for(let a=0;a=0?i:1e3+i,s-a}function $U(e,t,r){let a=e.getTime()-t;const i=j0(new Date(a),r);if(t===i)return t;a-=i-t;const l=j0(new Date(a),r);return i===l?i:Math.max(i,l)}function Lb(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const Rb={};function HU(e){if(Rb[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),Rb[e]=!0,!0}catch{return!1}}const zU=60*1e3,WU={X:function(e,t,r){const s=J1(r.timeZone,e);if(s===0)return"Z";switch(t){case"X":return Ob(s);case"XXXX":case"XX":return No(s);default:return No(s,":")}},x:function(e,t,r){const s=J1(r.timeZone,e);switch(t){case"x":return Ob(s);case"xxxx":case"xx":return No(s);default:return No(s,":")}},O:function(e,t,r){const s=J1(r.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+KU(s,":");default:return"GMT"+No(s,":")}},z:function(e,t,r){switch(t){case"z":case"zz":case"zzz":return Db("short",e,r);default:return Db("long",e,r)}}};function J1(e,t){const r=e?Fw(e,t,!0)/zU:t?.getTimezoneOffset()??0;if(Number.isNaN(r))throw new RangeError("Invalid time zone specified: "+e);return r}function qm(e,t){const r=e<0?"-":"";let s=Math.abs(e).toString();for(;s.length0?"-":"+",s=Math.abs(e),a=qm(Math.floor(s/60),2),i=qm(Math.floor(s%60),2);return r+a+t+i}function Ob(e,t){return e%60===0?(e>0?"-":"+")+qm(Math.abs(e)/60,2):No(e,t)}function KU(e,t=""){const r=e>0?"-":"+",s=Math.abs(e),a=Math.floor(s/60),i=s%60;return i===0?r+String(a):r+String(a)+t+qm(i,2)}function Fb(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const GU=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,X1=36e5,Bb=6e4,qU=2,zn={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:GU};function YU(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const r=t.additionalDigits==null?qU:Number(t.additionalDigits);if(r!==2&&r!==1&&r!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const s=ZU(e),{year:a,restDateString:i}=QU(s.date,r),l=JU(i,a);if(l===null||isNaN(l.getTime()))return new Date(NaN);if(l){const u=l.getTime();let d=0,m;if(s.time&&(d=XU(s.time),d===null||isNaN(d)))return new Date(NaN);if(s.timeZone||t.timeZone){if(m=Fw(s.timeZone||t.timeZone,new Date(u+d)),isNaN(m))return new Date(NaN)}else m=Fb(new Date(u+d)),m=Fb(new Date(u+d+m));return new Date(u+d+m)}else return new Date(NaN)}function ZU(e){const t={};let r=zn.dateTimePattern.exec(e),s;if(r?(t.date=r[1],s=r[3]):(r=zn.datePattern.exec(e),r?(t.date=r[1],s=r[2]):(t.date=null,s=e)),s){const a=zn.timeZone.exec(s);a?(t.time=s.replace(a[1],""),t.timeZone=a[1].trim()):t.time=s}return t}function QU(e,t){if(e){const r=zn.YYY[t],s=zn.YYYYY[t];let a=zn.YYYY.exec(e)||s.exec(e);if(a){const i=a[1];return{year:parseInt(i,10),restDateString:e.slice(i.length)}}if(a=zn.YY.exec(e)||r.exec(e),a){const i=a[1];return{year:parseInt(i,10)*100,restDateString:e.slice(i.length)}}}return{year:null}}function JU(e,t){if(t===null)return null;let r,s,a;if(!e||!e.length)return r=new Date(0),r.setUTCFullYear(t),r;let i=zn.MM.exec(e);if(i)return r=new Date(0),s=parseInt(i[1],10)-1,Vb(t,s)?(r.setUTCFullYear(t,s),r):new Date(NaN);if(i=zn.DDD.exec(e),i){r=new Date(0);const l=parseInt(i[1],10);return nV(t,l)?(r.setUTCFullYear(t,0,l),r):new Date(NaN)}if(i=zn.MMDD.exec(e),i){r=new Date(0),s=parseInt(i[1],10)-1;const l=parseInt(i[2],10);return Vb(t,s,l)?(r.setUTCFullYear(t,s,l),r):new Date(NaN)}if(i=zn.Www.exec(e),i)return a=parseInt(i[1],10)-1,$b(a)?Ub(t,a):new Date(NaN);if(i=zn.WwwD.exec(e),i){a=parseInt(i[1],10)-1;const l=parseInt(i[2],10)-1;return $b(a,l)?Ub(t,a,l):new Date(NaN)}return null}function XU(e){let t,r,s=zn.HH.exec(e);if(s)return t=parseFloat(s[1].replace(",",".")),eg(t)?t%24*X1:NaN;if(s=zn.HHMM.exec(e),s)return t=parseInt(s[1],10),r=parseFloat(s[2].replace(",",".")),eg(t,r)?t%24*X1+r*Bb:NaN;if(s=zn.HHMMSS.exec(e),s){t=parseInt(s[1],10),r=parseInt(s[2],10);const a=parseFloat(s[3].replace(",","."));return eg(t,r,a)?t%24*X1+r*Bb+a*1e3:NaN}return null}function Ub(e,t,r){t=t||0,r=r||0;const s=new Date(0);s.setUTCFullYear(e,0,4);const a=s.getUTCDay()||7,i=t*7+r+1-a;return s.setUTCDate(s.getUTCDate()+i),s}const eV=[31,28,31,30,31,30,31,31,30,31,30,31],tV=[31,29,31,30,31,30,31,31,30,31,30,31];function Bw(e){return e%400===0||e%4===0&&e%100!==0}function Vb(e,t,r){if(t<0||t>11)return!1;if(r!=null){if(r<1)return!1;const s=Bw(e);if(s&&r>tV[t]||!s&&r>eV[t])return!1}return!0}function nV(e,t){if(t<1)return!1;const r=Bw(e);return!(r&&t>366||!r&&t>365)}function $b(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function eg(e,t,r){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||r!=null&&(r<0||r>=60))}const rV=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function ji(e,t,r={}){t=String(t);const s=t.match(rV);if(s){const a=YU(r.originalDate||e,r);t=s.reduce(function(i,l){if(l[0]==="'")return i;const u=i.indexOf(l),d=i[u-1]==="'",m=i.replace(l,"'"+WU[l[0]](a,l,r)+"'");return d?m.substring(0,u-1)+m.substring(u+1):m},t)}return kU(e,t,r)}function kt(){return n.jsx("span",{className:"text-text-disabled",children:"—"})}function je(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e?.(a),r===!1||!a.defaultPrevented)return t?.(a)}}function Hb(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Kf(...e){return t=>{let r=!1;const s=e.map(a=>{const i=Hb(a,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let a=0;a{const{children:l,...u}=i,d=f.useMemo(()=>u,Object.values(u));return n.jsx(r.Provider,{value:d,children:l})};s.displayName=e+"Provider";function a(i){const l=f.useContext(r);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[s,a]}function Cr(e,t=[]){let r=[];function s(i,l){const u=f.createContext(l),d=r.length;r=[...r,l];const m=g=>{const{scope:v,children:y,...C}=g,b=v?.[e]?.[d]||u,w=f.useMemo(()=>C,Object.values(C));return n.jsx(b.Provider,{value:w,children:y})};m.displayName=i+"Provider";function p(g,v){const y=v?.[e]?.[d]||u,C=f.useContext(y);if(C)return C;if(l!==void 0)return l;throw new Error(`\`${g}\` must be used within \`${i}\``)}return[m,p]}const a=()=>{const i=r.map(l=>f.createContext(l));return function(u){const d=u?.[e]||i;return f.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return a.scopeName=e,[s,aV(a,...t)]}function aV(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const s=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const l=s.reduce((u,{useScope:d,scopeName:m})=>{const g=d(i)[`__scope${m}`];return{...u,...g}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return r.scopeName=t.scopeName,r}function Si(e){const t=iV(e),r=f.forwardRef((s,a)=>{const{children:i,...l}=s,u=f.Children.toArray(i),d=u.find(lV);if(d){const m=d.props.children,p=u.map(g=>g===d?f.Children.count(m)>1?f.Children.only(null):f.isValidElement(m)?m.props.children:null:g);return n.jsx(t,{...l,ref:a,children:f.isValidElement(m)?f.cloneElement(m,void 0,p):null})}return n.jsx(t,{...l,ref:a,children:i})});return r.displayName=`${e}.Slot`,r}function iV(e){const t=f.forwardRef((r,s)=>{const{children:a,...i}=r;if(f.isValidElement(a)){const l=uV(a),u=cV(i,a.props);return a.type!==f.Fragment&&(u.ref=s?Kf(s,l):l),f.cloneElement(a,u)}return f.Children.count(a)>1?f.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Uw=Symbol("radix.slottable");function oV(e){const t=({children:r})=>n.jsx(n.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=Uw,t}function lV(e){return f.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Uw}function cV(e,t){const r={...t};for(const s in t){const a=e[s],i=t[s];/^on[A-Z]/.test(s)?a&&i?r[s]=(...u)=>{const d=i(...u);return a(...u),d}:a&&(r[s]=a):s==="style"?r[s]={...a,...i}:s==="className"&&(r[s]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}function uV(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var dV=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],tt=dV.reduce((e,t)=>{const r=Si(`Primitive.${t}`),s=f.forwardRef((a,i)=>{const{asChild:l,...u}=a,d=l?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),n.jsx(d,{...u,ref:i})});return s.displayName=`Primitive.${t}`,{...e,[t]:s}},{});function Vw(e,t){e&&Mi.flushSync(()=>e.dispatchEvent(t))}function Xr(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...r)=>t.current?.(...r),[])}function mV(e,t=globalThis?.document){const r=Xr(e);f.useEffect(()=>{const s=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",s,{capture:!0}),()=>t.removeEventListener("keydown",s,{capture:!0})},[r,t])}var fV="DismissableLayer",S0="dismissableLayer.update",hV="dismissableLayer.pointerDownOutside",pV="dismissableLayer.focusOutside",zb,$w=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ri=f.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:u,...d}=e,m=f.useContext($w),[p,g]=f.useState(null),v=p?.ownerDocument??globalThis?.document,[,y]=f.useState({}),C=Ct(t,F=>g(F)),b=Array.from(m.layers),[w]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),N=b.indexOf(w),k=p?b.indexOf(p):-1,E=m.layersWithOutsidePointerEventsDisabled.size>0,T=k>=N,_=vV(F=>{const z=F.target,H=[...m.branches].some(J=>J.contains(z));!T||H||(a?.(F),l?.(F),F.defaultPrevented||u?.())},v),I=yV(F=>{const z=F.target;[...m.branches].some(J=>J.contains(z))||(i?.(F),l?.(F),F.defaultPrevented||u?.())},v);return mV(F=>{k===m.layers.size-1&&(s?.(F),!F.defaultPrevented&&u&&(F.preventDefault(),u()))},v),f.useEffect(()=>{if(p)return r&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(zb=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(p)),m.layers.add(p),Wb(),()=>{r&&m.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=zb)}},[p,v,r,m]),f.useEffect(()=>()=>{p&&(m.layers.delete(p),m.layersWithOutsidePointerEventsDisabled.delete(p),Wb())},[p,m]),f.useEffect(()=>{const F=()=>y({});return document.addEventListener(S0,F),()=>document.removeEventListener(S0,F)},[]),n.jsx(tt.div,{...d,ref:C,style:{pointerEvents:E?T?"auto":"none":void 0,...e.style},onFocusCapture:je(e.onFocusCapture,I.onFocusCapture),onBlurCapture:je(e.onBlurCapture,I.onBlurCapture),onPointerDownCapture:je(e.onPointerDownCapture,_.onPointerDownCapture)})});Ri.displayName=fV;var gV="DismissableLayerBranch",xV=f.forwardRef((e,t)=>{const r=f.useContext($w),s=f.useRef(null),a=Ct(t,s);return f.useEffect(()=>{const i=s.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),n.jsx(tt.div,{...e,ref:a})});xV.displayName=gV;function vV(e,t=globalThis?.document){const r=Xr(e),s=f.useRef(!1),a=f.useRef(()=>{});return f.useEffect(()=>{const i=u=>{if(u.target&&!s.current){let d=function(){Hw(hV,r,m,{discrete:!0})};const m={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=d,t.addEventListener("click",a.current,{once:!0})):d()}else t.removeEventListener("click",a.current);s.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>s.current=!0}}function yV(e,t=globalThis?.document){const r=Xr(e),s=f.useRef(!1);return f.useEffect(()=>{const a=i=>{i.target&&!s.current&&Hw(pV,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function Wb(){const e=new CustomEvent(S0);document.dispatchEvent(e)}function Hw(e,t,r,{discrete:s}){const a=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),s?Vw(a,i):a.dispatchEvent(i)}var kn=globalThis?.document?f.useLayoutEffect:()=>{},bV=hx[" useId ".trim().toString()]||(()=>{}),CV=0;function qn(e){const[t,r]=f.useState(bV());return kn(()=>{r(s=>s??String(CV++))},[e]),e||(t?`radix-${t}`:"")}function cl(e){return e.split("-")[1]}function l2(e){return e==="y"?"height":"width"}function Hs(e){return e.split("-")[0]}function Oi(e){return["top","bottom"].includes(Hs(e))?"x":"y"}function Kb(e,t,r){let{reference:s,floating:a}=e;const i=s.x+s.width/2-a.width/2,l=s.y+s.height/2-a.height/2,u=Oi(t),d=l2(u),m=s[d]/2-a[d]/2,p=u==="x";let g;switch(Hs(t)){case"top":g={x:i,y:s.y-a.height};break;case"bottom":g={x:i,y:s.y+s.height};break;case"right":g={x:s.x+s.width,y:l};break;case"left":g={x:s.x-a.width,y:l};break;default:g={x:s.x,y:s.y}}switch(cl(t)){case"start":g[u]-=m*(r&&p?-1:1);break;case"end":g[u]+=m*(r&&p?-1:1)}return g}const wV=async(e,t,r)=>{const{placement:s="bottom",strategy:a="absolute",middleware:i=[],platform:l}=r,u=i.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let m=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:p,y:g}=Kb(m,s,d),v=s,y={},C=0;for(let b=0;b({name:"arrow",options:e,async fn(t){const{x:r,y:s,placement:a,rects:i,platform:l,elements:u}=t,{element:d,padding:m=0}=Ys(e,t)||{};if(d==null)return{};const p=zw(m),g={x:r,y:s},v=Oi(a),y=l2(v),C=await l.getDimensions(d),b=v==="y",w=b?"top":"left",N=b?"bottom":"right",k=b?"clientHeight":"clientWidth",E=i.reference[y]+i.reference[v]-g[v]-i.floating[y],T=g[v]-i.reference[v],_=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d));let I=_?_[k]:0;I&&await(l.isElement==null?void 0:l.isElement(_))||(I=u.floating[k]||i.floating[y]);const F=E/2-T/2,z=I/2-C[y]/2-1,H=Uc(p[w],z),J=Uc(p[N],z),Y=H,B=I-C[y]-J,W=I/2-C[y]/2+F,U=k0(Y,W,B),Z=cl(a)!=null&&W!=U&&i.reference[y]/2-(We.concat(t,t+"-start",t+"-end")),[]);const jV={left:"right",right:"left",bottom:"top",top:"bottom"};function Zm(e){return e.replace(/left|right|bottom|top/g,(t=>jV[t]))}function SV(e,t,r){r===void 0&&(r=!1);const s=cl(e),a=Oi(e),i=l2(a);let l=a==="x"?s===(r?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Zm(l)),{main:l,cross:Zm(l)}}const kV={start:"end",end:"start"};function tg(e){return e.replace(/start|end/g,(t=>kV[t]))}const NV=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r;const{placement:s,middlewareData:a,rects:i,initialPlacement:l,platform:u,elements:d}=t,{mainAxis:m=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:C=!0,...b}=Ys(e,t),w=Hs(s),N=Hs(l)===l,k=await(u.isRTL==null?void 0:u.isRTL(d.floating)),E=g||(N||!C?[Zm(l)]:(function(Y){const B=Zm(Y);return[tg(Y),B,tg(B)]})(l));g||y==="none"||E.push(...(function(Y,B,W,U){const Z=cl(Y);let re=(function(me,L,V){const P=["left","right"],q=["right","left"],Q=["top","bottom"],ae=["bottom","top"];switch(me){case"top":case"bottom":return V?L?q:P:L?P:q;case"left":case"right":return L?Q:ae;default:return[]}})(Hs(Y),W==="start",U);return Z&&(re=re.map((me=>me+"-"+Z)),B&&(re=re.concat(re.map(tg)))),re})(l,C,y,k));const T=[l,...E],_=await Bc(t,b),I=[];let F=((r=a.flip)==null?void 0:r.overflows)||[];if(m&&I.push(_[w]),p){const{main:Y,cross:B}=SV(s,i,k);I.push(_[Y],_[B])}if(F=[...F,{placement:s,overflows:I}],!I.every((Y=>Y<=0))){var z,H;const Y=(((z=a.flip)==null?void 0:z.index)||0)+1,B=T[Y];if(B)return{data:{index:Y,overflows:F},reset:{placement:B}};let W=(H=F.filter((U=>U.overflows[0]<=0)).sort(((U,Z)=>U.overflows[1]-Z.overflows[1]))[0])==null?void 0:H.placement;if(!W)switch(v){case"bestFit":{var J;const U=(J=F.map((Z=>[Z.placement,Z.overflows.filter((re=>re>0)).reduce(((re,me)=>re+me),0)])).sort(((Z,re)=>Z[1]-re[1]))[0])==null?void 0:J[0];U&&(W=U);break}case"initialPlacement":W=l}if(s!==W)return{reset:{placement:W}}}return{}}}};function qb(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Yb(e){return Ww.some((t=>e[t]>=0))}const EV=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:s="referenceHidden",...a}=Ys(e,t);switch(s){case"referenceHidden":{const i=qb(await Bc(t,{...a,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Yb(i)}}}case"escaped":{const i=qb(await Bc(t,{...a,altBoundary:!0}),r.floating);return{data:{escapedOffsets:i,escaped:Yb(i)}}}default:return{}}}}},AV=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:r,y:s}=t,a=await(async function(i,l){const{placement:u,platform:d,elements:m}=i,p=await(d.isRTL==null?void 0:d.isRTL(m.floating)),g=Hs(u),v=cl(u),y=Oi(u)==="x",C=["left","top"].includes(g)?-1:1,b=p&&y?-1:1,w=Ys(l,i);let{mainAxis:N,crossAxis:k,alignmentAxis:E}=typeof w=="number"?{mainAxis:w,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...w};return v&&typeof E=="number"&&(k=v==="end"?-1*E:E),y?{x:k*b,y:N*C}:{x:N*C,y:k*b}})(t,e);return{x:r+a.x,y:s+a.y,data:a}}}};function Kw(e){return e==="x"?"y":"x"}const PV=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:s,placement:a}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:w=>{let{x:N,y:k}=w;return{x:N,y:k}}},...d}=Ys(e,t),m={x:r,y:s},p=await Bc(t,d),g=Oi(Hs(a)),v=Kw(g);let y=m[g],C=m[v];if(i){const w=g==="y"?"bottom":"right";y=k0(y+p[g==="y"?"top":"left"],y,y-p[w])}if(l){const w=v==="y"?"bottom":"right";C=k0(C+p[v==="y"?"top":"left"],C,C-p[w])}const b=u.fn({...t,[g]:y,[v]:C});return{...b,data:{x:b.x-r,y:b.y-s}}}}},TV=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:s,placement:a,rects:i,middlewareData:l}=t,{offset:u=0,mainAxis:d=!0,crossAxis:m=!0}=Ys(e,t),p={x:r,y:s},g=Oi(a),v=Kw(g);let y=p[g],C=p[v];const b=Ys(u,t),w=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(d){const E=g==="y"?"height":"width",T=i.reference[g]-i.floating[E]+w.mainAxis,_=i.reference[g]+i.reference[E]-w.mainAxis;y_&&(y=_)}if(m){var N,k;const E=g==="y"?"width":"height",T=["top","left"].includes(Hs(a)),_=i.reference[v]-i.floating[E]+(T&&((N=l.offset)==null?void 0:N[v])||0)+(T?0:w.crossAxis),I=i.reference[v]+i.reference[E]+(T?0:((k=l.offset)==null?void 0:k[v])||0)-(T?w.crossAxis:0);C<_?C=_:C>I&&(C=I)}return{[g]:y,[v]:C}}}},IV=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:s,platform:a,elements:i}=t,{apply:l=(()=>{}),...u}=Ys(e,t),d=await Bc(t,u),m=Hs(r),p=cl(r),g=Oi(r)==="x",{width:v,height:y}=s.floating;let C,b;m==="top"||m==="bottom"?(C=m,b=p===(await(a.isRTL==null?void 0:a.isRTL(i.floating))?"start":"end")?"left":"right"):(b=m,C=p==="end"?"top":"bottom");const w=y-d[C],N=v-d[b],k=!t.middlewareData.shift;let E=w,T=N;if(g){const I=v-d.left-d.right;T=p||k?Uc(N,I):I}else{const I=y-d.top-d.bottom;E=p||k?Uc(w,I):I}if(k&&!p){const I=ci(d.left,0),F=ci(d.right,0),z=ci(d.top,0),H=ci(d.bottom,0);g?T=v-2*(I!==0||F!==0?I+F:ci(d.left,d.right)):E=y-2*(z!==0||H!==0?z+H:ci(d.top,d.bottom))}await l({...t,availableWidth:T,availableHeight:E});const _=await a.getDimensions(i.floating);return v!==_.width||y!==_.height?{reset:{rects:!0}}:{}}}};function xr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Cs(e){return xr(e).getComputedStyle(e)}function Gw(e){return e instanceof xr(e).Node}function Ma(e){return Gw(e)?(e.nodeName||"").toLowerCase():"#document"}function es(e){return e instanceof HTMLElement||e instanceof xr(e).HTMLElement}function Zb(e){return typeof ShadowRoot<"u"&&(e instanceof xr(e).ShadowRoot||e instanceof ShadowRoot)}function Vc(e){const{overflow:t,overflowX:r,overflowY:s,display:a}=Cs(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+r)&&!["inline","contents"].includes(a)}function DV(e){return["table","td","th"].includes(Ma(e))}function N0(e){const t=c2(),r=Cs(e);return r.transform!=="none"||r.perspective!=="none"||!!r.containerType&&r.containerType!=="normal"||!t&&!!r.backdropFilter&&r.backdropFilter!=="none"||!t&&!!r.filter&&r.filter!=="none"||["transform","perspective","filter"].some((s=>(r.willChange||"").includes(s)))||["paint","layout","strict","content"].some((s=>(r.contain||"").includes(s)))}function c2(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Gf(e){return["html","body","#document"].includes(Ma(e))}const E0=Math.min,Mo=Math.max,Qm=Math.round,Zd=Math.floor,La=e=>({x:e,y:e});function qw(e){const t=Cs(e);let r=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const a=es(e),i=a?e.offsetWidth:r,l=a?e.offsetHeight:s,u=Qm(r)!==i||Qm(s)!==l;return u&&(r=i,s=l),{width:r,height:s,$:u}}function zs(e){return e instanceof Element||e instanceof xr(e).Element}function u2(e){return zs(e)?e:e.contextElement}function Lo(e){const t=u2(e);if(!es(t))return La(1);const r=t.getBoundingClientRect(),{width:s,height:a,$:i}=qw(t);let l=(i?Qm(r.width):r.width)/s,u=(i?Qm(r.height):r.height)/a;return l&&Number.isFinite(l)||(l=1),u&&Number.isFinite(u)||(u=1),{x:l,y:u}}const _V=La(0);function Yw(e){const t=xr(e);return c2()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:_V}function ki(e,t,r,s){t===void 0&&(t=!1),r===void 0&&(r=!1);const a=e.getBoundingClientRect(),i=u2(e);let l=La(1);t&&(s?zs(s)&&(l=Lo(s)):l=Lo(e));const u=(function(v,y,C){return y===void 0&&(y=!1),!(!C||y&&C!==xr(v))&&y})(i,r,s)?Yw(i):La(0);let d=(a.left+u.x)/l.x,m=(a.top+u.y)/l.y,p=a.width/l.x,g=a.height/l.y;if(i){const v=xr(i),y=s&&zs(s)?xr(s):s;let C=v.frameElement;for(;C&&s&&y!==v;){const b=Lo(C),w=C.getBoundingClientRect(),N=getComputedStyle(C),k=w.left+(C.clientLeft+parseFloat(N.paddingLeft))*b.x,E=w.top+(C.clientTop+parseFloat(N.paddingTop))*b.y;d*=b.x,m*=b.y,p*=b.x,g*=b.y,d+=k,m+=E,C=xr(C).frameElement}}return Ym({width:p,height:g,x:d,y:m})}function qf(e){return zs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ws(e){var t;return(t=(Gw(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Zw(e){return ki(Ws(e)).left+qf(e).scrollLeft}function zo(e){if(Ma(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Zb(e)&&e.host||Ws(e);return Zb(t)?t.host:t}function Qw(e){const t=zo(e);return Gf(t)?e.ownerDocument?e.ownerDocument.body:e.body:es(t)&&Vc(t)?t:Qw(t)}function Jm(e,t){var r;t===void 0&&(t=[]);const s=Qw(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),i=xr(s);return a?t.concat(i,i.visualViewport||[],Vc(s)?s:[]):t.concat(s,Jm(s))}function Qb(e,t,r){let s;if(t==="viewport")s=(function(a,i){const l=xr(a),u=Ws(a),d=l.visualViewport;let m=u.clientWidth,p=u.clientHeight,g=0,v=0;if(d){m=d.width,p=d.height;const y=c2();(!y||y&&i==="fixed")&&(g=d.offsetLeft,v=d.offsetTop)}return{width:m,height:p,x:g,y:v}})(e,r);else if(t==="document")s=(function(a){const i=Ws(a),l=qf(a),u=a.ownerDocument.body,d=Mo(i.scrollWidth,i.clientWidth,u.scrollWidth,u.clientWidth),m=Mo(i.scrollHeight,i.clientHeight,u.scrollHeight,u.clientHeight);let p=-l.scrollLeft+Zw(a);const g=-l.scrollTop;return Cs(u).direction==="rtl"&&(p+=Mo(i.clientWidth,u.clientWidth)-d),{width:d,height:m,x:p,y:g}})(Ws(e));else if(zs(t))s=(function(a,i){const l=ki(a,!0,i==="fixed"),u=l.top+a.clientTop,d=l.left+a.clientLeft,m=es(a)?Lo(a):La(1);return{width:a.clientWidth*m.x,height:a.clientHeight*m.y,x:d*m.x,y:u*m.y}})(t,r);else{const a=Yw(e);s={...t,x:t.x-a.x,y:t.y-a.y}}return Ym(s)}function Jw(e,t){const r=zo(e);return!(r===t||!zs(r)||Gf(r))&&(Cs(r).position==="fixed"||Jw(r,t))}function MV(e,t,r){const s=es(t),a=Ws(t),i=r==="fixed",l=ki(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const d=La(0);if(s||!s&&!i)if((Ma(t)!=="body"||Vc(a))&&(u=qf(t)),es(t)){const m=ki(t,!0,i,t);d.x=m.x+t.clientLeft,d.y=m.y+t.clientTop}else a&&(d.x=Zw(a));return{x:l.left+u.scrollLeft-d.x,y:l.top+u.scrollTop-d.y,width:l.width,height:l.height}}function Jb(e,t){return es(e)&&Cs(e).position!=="fixed"?t?t(e):e.offsetParent:null}function Xb(e,t){const r=xr(e);if(!es(e))return r;let s=Jb(e,t);for(;s&&DV(s)&&Cs(s).position==="static";)s=Jb(s,t);return s&&(Ma(s)==="html"||Ma(s)==="body"&&Cs(s).position==="static"&&!N0(s))?r:s||(function(a){let i=zo(a);for(;es(i)&&!Gf(i);){if(N0(i))return i;i=zo(i)}return null})(e)||r}const LV={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:r,strategy:s}=e;const a=es(r),i=Ws(r);if(r===i)return t;let l={scrollLeft:0,scrollTop:0},u=La(1);const d=La(0);if((a||!a&&s!=="fixed")&&((Ma(r)!=="body"||Vc(i))&&(l=qf(r)),es(r))){const m=ki(r);u=Lo(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-l.scrollLeft*u.x+d.x,y:t.y*u.y-l.scrollTop*u.y+d.y}},getDocumentElement:Ws,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:s,strategy:a}=e;const i=[...r==="clippingAncestors"?(function(d,m){const p=m.get(d);if(p)return p;let g=Jm(d).filter((b=>zs(b)&&Ma(b)!=="body")),v=null;const y=Cs(d).position==="fixed";let C=y?zo(d):d;for(;zs(C)&&!Gf(C);){const b=Cs(C),w=N0(C);w||b.position!=="fixed"||(v=null),(y?!w&&!v:!w&&b.position==="static"&&v&&["absolute","fixed"].includes(v.position)||Vc(C)&&!w&&Jw(d,C))?g=g.filter((N=>N!==C)):v=b,C=zo(C)}return m.set(d,g),g})(t,this._c):[].concat(r),s],l=i[0],u=i.reduce(((d,m)=>{const p=Qb(t,m,a);return d.top=Mo(p.top,d.top),d.right=E0(p.right,d.right),d.bottom=E0(p.bottom,d.bottom),d.left=Mo(p.left,d.left),d}),Qb(t,l,a));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},getOffsetParent:Xb,getElementRects:async function(e){let{reference:t,floating:r,strategy:s}=e;const a=this.getOffsetParent||Xb,i=this.getDimensions;return{reference:MV(t,await a(r),s),floating:{x:0,y:0,...await i(r)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return qw(e)},getScale:Lo,isElement:zs,isRTL:function(e){return getComputedStyle(e).direction==="rtl"}};function RV(e,t,r,s){s===void 0&&(s={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=s,m=u2(e),p=a||i?[...m?Jm(m):[],...Jm(t)]:[];p.forEach((w=>{a&&w.addEventListener("scroll",r,{passive:!0}),i&&w.addEventListener("resize",r)}));const g=m&&u?(function(w,N){let k,E=null;const T=Ws(w);function _(){clearTimeout(k),E&&E.disconnect(),E=null}return(function I(F,z){F===void 0&&(F=!1),z===void 0&&(z=1),_();const{left:H,top:J,width:Y,height:B}=w.getBoundingClientRect();if(F||N(),!Y||!B)return;const W={rootMargin:-Zd(J)+"px "+-Zd(T.clientWidth-(H+Y))+"px "+-Zd(T.clientHeight-(J+B))+"px "+-Zd(H)+"px",threshold:Mo(0,E0(1,z))||1};let U=!0;function Z(re){const me=re[0].intersectionRatio;if(me!==z){if(!U)return I();me?I(!1,me):k=setTimeout((()=>{I(!1,1e-7)}),100)}U=!1}try{E=new IntersectionObserver(Z,{...W,root:T.ownerDocument})}catch{E=new IntersectionObserver(Z,W)}E.observe(w)})(!0),_})(m,r):null;let v,y=-1,C=null;l&&(C=new ResizeObserver((w=>{let[N]=w;N&&N.target===m&&C&&(C.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame((()=>{C&&C.observe(t)}))),r()})),m&&!d&&C.observe(m),C.observe(t));let b=d?ki(e):null;return d&&(function w(){const N=ki(e);!b||N.x===b.x&&N.y===b.y&&N.width===b.width&&N.height===b.height||r(),b=N,v=requestAnimationFrame(w)})(),r(),()=>{p.forEach((w=>{a&&w.removeEventListener("scroll",r),i&&w.removeEventListener("resize",r)})),g&&g(),C&&C.disconnect(),C=null,d&&cancelAnimationFrame(v)}}const OV=(e,t,r)=>{const s=new Map,a={platform:LV,...r},i={...a.platform,_c:s};return wV(e,t,{...a,platform:i})},FV=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:s,padding:a}=typeof e=="function"?e(r):e;return s&&t(s)?s.current!=null?Gb({element:s.current,padding:a}).fn(r):{}:s?Gb({element:s,padding:a}).fn(r):{}}}};var jm=typeof document<"u"?f.useLayoutEffect:f.useEffect;function Xm(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,s,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(s=r;s--!==0;)if(!Xm(e[s],t[s]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(s=r;s--!==0;)if(!{}.hasOwnProperty.call(t,a[s]))return!1;for(s=r;s--!==0;){const i=a[s];if(!(i==="_owner"&&e.$$typeof)&&!Xm(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Xw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function e9(e,t){const r=Xw(e);return Math.round(t*r)/r}function t9(e){const t=f.useRef(e);return jm(()=>{t.current=e}),t}function BV(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:s=[],platform:a,elements:{reference:i,floating:l}={},transform:u=!0,whileElementsMounted:d,open:m}=e,[p,g]=f.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[v,y]=f.useState(s);Xm(v,s)||y(s);const[C,b]=f.useState(null),[w,N]=f.useState(null),k=f.useCallback(re=>{re!=I.current&&(I.current=re,b(re))},[b]),E=f.useCallback(re=>{re!==F.current&&(F.current=re,N(re))},[N]),T=i||C,_=l||w,I=f.useRef(null),F=f.useRef(null),z=f.useRef(p),H=t9(d),J=t9(a),Y=f.useCallback(()=>{if(!I.current||!F.current)return;const re={placement:t,strategy:r,middleware:v};J.current&&(re.platform=J.current),OV(I.current,F.current,re).then(me=>{const L={...me,isPositioned:!0};B.current&&!Xm(z.current,L)&&(z.current=L,Mi.flushSync(()=>{g(L)}))})},[v,t,r,J]);jm(()=>{m===!1&&z.current.isPositioned&&(z.current.isPositioned=!1,g(re=>({...re,isPositioned:!1})))},[m]);const B=f.useRef(!1);jm(()=>(B.current=!0,()=>{B.current=!1}),[]),jm(()=>{if(T&&(I.current=T),_&&(F.current=_),T&&_){if(H.current)return H.current(T,_,Y);Y()}},[T,_,Y,H]);const W=f.useMemo(()=>({reference:I,floating:F,setReference:k,setFloating:E}),[k,E]),U=f.useMemo(()=>({reference:T,floating:_}),[T,_]),Z=f.useMemo(()=>{const re={position:r,left:0,top:0};if(!U.floating)return re;const me=e9(U.floating,p.x),L=e9(U.floating,p.y);return u?{...re,transform:"translate("+me+"px, "+L+"px)",...Xw(U.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:me,top:L}},[r,u,U.floating,p.x,p.y]);return f.useMemo(()=>({...p,update:Y,refs:W,elements:U,floatingStyles:Z}),[p,Y,W,U,Z])}var UV="Arrow",e7=f.forwardRef((e,t)=>{const{children:r,width:s=10,height:a=5,...i}=e;return n.jsx(tt.svg,{...i,ref:t,width:s,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:n.jsx("polygon",{points:"0,0 30,0 15,10"})})});e7.displayName=UV;var VV=e7;function t7(e){const[t,r]=f.useState(void 0);return kn(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let l,u;if("borderBoxSize"in i){const d=i.borderBoxSize,m=Array.isArray(d)?d[0]:d;l=m.inlineSize,u=m.blockSize}else l=e.offsetWidth,u=e.offsetHeight;r({width:l,height:u})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else r(void 0)},[e]),t}var d2="Popper",[n7,Ns]=Cr(d2),[$V,r7]=n7(d2),s7=e=>{const{__scopePopper:t,children:r}=e,[s,a]=f.useState(null);return n.jsx($V,{scope:t,anchor:s,onAnchorChange:a,children:r})};s7.displayName=d2;var a7="PopperAnchor",i7=f.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:s,...a}=e,i=r7(a7,r),l=f.useRef(null),u=Ct(t,l),d=f.useRef(null);return f.useEffect(()=>{const m=d.current;d.current=s?.current||l.current,m!==d.current&&i.onAnchorChange(d.current)}),s?null:n.jsx(tt.div,{...a,ref:u})});i7.displayName=a7;var m2="PopperContent",[HV,zV]=n7(m2),o7=f.forwardRef((e,t)=>{const{__scopePopper:r,side:s="bottom",sideOffset:a=0,align:i="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:m=[],collisionPadding:p=0,sticky:g="partial",hideWhenDetached:v=!1,updatePositionStrategy:y="optimized",onPlaced:C,...b}=e,w=r7(m2,r),[N,k]=f.useState(null),E=Ct(t,se=>k(se)),[T,_]=f.useState(null),I=t7(T),F=I?.width??0,z=I?.height??0,H=s+(i!=="center"?"-"+i:""),J=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},Y=Array.isArray(m)?m:[m],B=Y.length>0,W={padding:J,boundary:Y.filter(KV),altBoundary:B},{refs:U,floatingStyles:Z,placement:re,isPositioned:me,middlewareData:L}=BV({strategy:"fixed",placement:H,whileElementsMounted:(...se)=>RV(...se,{animationFrame:y==="always"}),elements:{reference:w.anchor},middleware:[AV({mainAxis:a+z,alignmentAxis:l}),d&&PV({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?TV():void 0,...W}),d&&NV({...W}),IV({...W,apply:({elements:se,rects:le,availableWidth:Ae,availableHeight:Te})=>{const{width:Ue,height:Ze}=le.reference,ct=se.floating.style;ct.setProperty("--radix-popper-available-width",`${Ae}px`),ct.setProperty("--radix-popper-available-height",`${Te}px`),ct.setProperty("--radix-popper-anchor-width",`${Ue}px`),ct.setProperty("--radix-popper-anchor-height",`${Ze}px`)}}),T&&FV({element:T,padding:u}),GV({arrowWidth:F,arrowHeight:z}),v&&EV({strategy:"referenceHidden",...W})]}),[V,P]=u7(re),q=Xr(C);kn(()=>{me&&q?.()},[me,q]);const Q=L.arrow?.x,ae=L.arrow?.y,X=L.arrow?.centerOffset!==0,[fe,he]=f.useState();return kn(()=>{N&&he(window.getComputedStyle(N).zIndex)},[N]),n.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...Z,transform:me?Z.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:n.jsx(HV,{scope:r,placedSide:V,onArrowChange:_,arrowX:Q,arrowY:ae,shouldHideArrow:X,children:n.jsx(tt.div,{"data-side":V,"data-align":P,...b,ref:E,style:{...b.style,animation:me?void 0:"none"}})})})});o7.displayName=m2;var l7="PopperArrow",WV={top:"bottom",right:"left",bottom:"top",left:"right"},c7=f.forwardRef(function(t,r){const{__scopePopper:s,...a}=t,i=zV(l7,s),l=WV[i.placedSide];return n.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:n.jsx(VV,{...a,ref:r,style:{...a.style,display:"block"}})})});c7.displayName=l7;function KV(e){return e!==null}var GV=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:s,middlewareData:a}=t,l=a.arrow?.centerOffset!==0,u=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[m,p]=u7(r),g={start:"0%",center:"50%",end:"100%"}[p],v=(a.arrow?.x??0)+u/2,y=(a.arrow?.y??0)+d/2;let C="",b="";return m==="bottom"?(C=l?g:`${v}px`,b=`${-d}px`):m==="top"?(C=l?g:`${v}px`,b=`${s.floating.height+d}px`):m==="right"?(C=`${-d}px`,b=l?g:`${y}px`):m==="left"&&(C=`${s.floating.width+d}px`,b=l?g:`${y}px`),{data:{x:C,y:b}}}});function u7(e){const[t,r="center"]=e.split("-");return[t,r]}var ul=s7,dl=i7,fu=o7,hu=c7,qV="Portal",Fi=f.forwardRef((e,t)=>{const{container:r,...s}=e,[a,i]=f.useState(!1);kn(()=>i(!0),[]);const l=r||a&&globalThis?.document?.body;return l?HL.createPortal(n.jsx(tt.div,{...s,ref:t}),l):null});Fi.displayName=qV;function YV(e,t){return f.useReducer((r,s)=>t[r][s]??r,e)}var En=e=>{const{present:t,children:r}=e,s=ZV(t),a=typeof r=="function"?r({present:s.isPresent}):f.Children.only(r),i=Ct(s.ref,QV(a));return typeof r=="function"||s.isPresent?f.cloneElement(a,{ref:i}):null};En.displayName="Presence";function ZV(e){const[t,r]=f.useState(),s=f.useRef(null),a=f.useRef(e),i=f.useRef("none"),l=e?"mounted":"unmounted",[u,d]=YV(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const m=Qd(s.current);i.current=u==="mounted"?m:"none"},[u]),kn(()=>{const m=s.current,p=a.current;if(p!==e){const v=i.current,y=Qd(m);e?d("MOUNT"):y==="none"||m?.display==="none"?d("UNMOUNT"):d(p&&v!==y?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),kn(()=>{if(t){let m;const p=t.ownerDocument.defaultView??window,g=y=>{const b=Qd(s.current).includes(CSS.escape(y.animationName));if(y.target===t&&b&&(d("ANIMATION_END"),!a.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",m=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},v=y=>{y.target===t&&(i.current=Qd(s.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{p.clearTimeout(m),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:f.useCallback(m=>{s.current=m?getComputedStyle(m):null,r(m)},[])}}function Qd(e){return e?.animationName||"none"}function QV(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var JV=hx[" useInsertionEffect ".trim().toString()]||kn;function Mr({prop:e,defaultProp:t,onChange:r=()=>{},caller:s}){const[a,i,l]=XV({defaultProp:t,onChange:r}),u=e!==void 0,d=u?e:a;{const p=f.useRef(e!==void 0);f.useEffect(()=>{const g=p.current;g!==u&&console.warn(`${s} is changing from ${g?"controlled":"uncontrolled"} to ${u?"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.`),p.current=u},[u,s])}const m=f.useCallback(p=>{if(u){const g=e$(p)?p(e):p;g!==e&&l.current?.(g)}else i(p)},[u,e,i,l]);return[d,m]}function XV({defaultProp:e,onChange:t}){const[r,s]=f.useState(e),a=f.useRef(r),i=f.useRef(t);return JV(()=>{i.current=t},[t]),f.useEffect(()=>{a.current!==r&&(i.current?.(r),a.current=r)},[r,a]),[r,s,i]}function e$(e){return typeof e=="function"}var d7=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),t$="VisuallyHidden",m7=f.forwardRef((e,t)=>n.jsx(tt.span,{...e,ref:t,style:{...d7,...e.style}}));m7.displayName=t$;var n$=m7,[Yf]=Cr("Tooltip",[Ns]),Zf=Ns(),f7="TooltipProvider",r$=700,A0="tooltip.open",[s$,f2]=Yf(f7),h7=e=>{const{__scopeTooltip:t,delayDuration:r=r$,skipDelayDuration:s=300,disableHoverableContent:a=!1,children:i}=e,l=f.useRef(!0),u=f.useRef(!1),d=f.useRef(0);return f.useEffect(()=>{const m=d.current;return()=>window.clearTimeout(m)},[]),n.jsx(s$,{scope:t,isOpenDelayedRef:l,delayDuration:r,onOpen:f.useCallback(()=>{window.clearTimeout(d.current),l.current=!1},[]),onClose:f.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.current=!0,s)},[s]),isPointerInTransitRef:u,onPointerInTransitChange:f.useCallback(m=>{u.current=m},[]),disableHoverableContent:a,children:i})};h7.displayName=f7;var $c="Tooltip",[a$,pu]=Yf($c),p7=e=>{const{__scopeTooltip:t,children:r,open:s,defaultOpen:a,onOpenChange:i,disableHoverableContent:l,delayDuration:u}=e,d=f2($c,e.__scopeTooltip),m=Zf(t),[p,g]=f.useState(null),v=qn(),y=f.useRef(0),C=l??d.disableHoverableContent,b=u??d.delayDuration,w=f.useRef(!1),[N,k]=Mr({prop:s,defaultProp:a??!1,onChange:F=>{F?(d.onOpen(),document.dispatchEvent(new CustomEvent(A0))):d.onClose(),i?.(F)},caller:$c}),E=f.useMemo(()=>N?w.current?"delayed-open":"instant-open":"closed",[N]),T=f.useCallback(()=>{window.clearTimeout(y.current),y.current=0,w.current=!1,k(!0)},[k]),_=f.useCallback(()=>{window.clearTimeout(y.current),y.current=0,k(!1)},[k]),I=f.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{w.current=!0,k(!0),y.current=0},b)},[b,k]);return f.useEffect(()=>()=>{y.current&&(window.clearTimeout(y.current),y.current=0)},[]),n.jsx(ul,{...m,children:n.jsx(a$,{scope:t,contentId:v,open:N,stateAttribute:E,trigger:p,onTriggerChange:g,onTriggerEnter:f.useCallback(()=>{d.isOpenDelayedRef.current?I():T()},[d.isOpenDelayedRef,I,T]),onTriggerLeave:f.useCallback(()=>{C?_():(window.clearTimeout(y.current),y.current=0)},[_,C]),onOpen:T,onClose:_,disableHoverableContent:C,children:r})})};p7.displayName=$c;var P0="TooltipTrigger",g7=f.forwardRef((e,t)=>{const{__scopeTooltip:r,...s}=e,a=pu(P0,r),i=f2(P0,r),l=Zf(r),u=f.useRef(null),d=Ct(t,u,a.onTriggerChange),m=f.useRef(!1),p=f.useRef(!1),g=f.useCallback(()=>m.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",g),[g]),n.jsx(dl,{asChild:!0,...l,children:n.jsx(tt.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...s,ref:d,onPointerMove:je(e.onPointerMove,v=>{v.pointerType!=="touch"&&!p.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),p.current=!0)}),onPointerLeave:je(e.onPointerLeave,()=>{a.onTriggerLeave(),p.current=!1}),onPointerDown:je(e.onPointerDown,()=>{a.open&&a.onClose(),m.current=!0,document.addEventListener("pointerup",g,{once:!0})}),onFocus:je(e.onFocus,()=>{m.current||a.onOpen()}),onBlur:je(e.onBlur,a.onClose),onClick:je(e.onClick,a.onClose)})})});g7.displayName=P0;var h2="TooltipPortal",[i$,o$]=Yf(h2,{forceMount:void 0}),x7=e=>{const{__scopeTooltip:t,forceMount:r,children:s,container:a}=e,i=pu(h2,t);return n.jsx(i$,{scope:t,forceMount:r,children:n.jsx(En,{present:r||i.open,children:n.jsx(Fi,{asChild:!0,container:a,children:s})})})};x7.displayName=h2;var Wo="TooltipContent",v7=f.forwardRef((e,t)=>{const r=o$(Wo,e.__scopeTooltip),{forceMount:s=r.forceMount,side:a="top",...i}=e,l=pu(Wo,e.__scopeTooltip);return n.jsx(En,{present:s||l.open,children:l.disableHoverableContent?n.jsx(y7,{side:a,...i,ref:t}):n.jsx(l$,{side:a,...i,ref:t})})}),l$=f.forwardRef((e,t)=>{const r=pu(Wo,e.__scopeTooltip),s=f2(Wo,e.__scopeTooltip),a=f.useRef(null),i=Ct(t,a),[l,u]=f.useState(null),{trigger:d,onClose:m}=r,p=a.current,{onPointerInTransitChange:g}=s,v=f.useCallback(()=>{u(null),g(!1)},[g]),y=f.useCallback((C,b)=>{const w=C.currentTarget,N={x:C.clientX,y:C.clientY},k=f$(N,w.getBoundingClientRect()),E=h$(N,k),T=p$(b.getBoundingClientRect()),_=x$([...E,...T]);u(_),g(!0)},[g]);return f.useEffect(()=>()=>v(),[v]),f.useEffect(()=>{if(d&&p){const C=w=>y(w,p),b=w=>y(w,d);return d.addEventListener("pointerleave",C),p.addEventListener("pointerleave",b),()=>{d.removeEventListener("pointerleave",C),p.removeEventListener("pointerleave",b)}}},[d,p,y,v]),f.useEffect(()=>{if(l){const C=b=>{const w=b.target,N={x:b.clientX,y:b.clientY},k=d?.contains(w)||p?.contains(w),E=!g$(N,l);k?v():E&&(v(),m())};return document.addEventListener("pointermove",C),()=>document.removeEventListener("pointermove",C)}},[d,p,l,m,v]),n.jsx(y7,{...e,ref:i})}),[c$,u$]=Yf($c,{isInside:!1}),d$=oV("TooltipContent"),y7=f.forwardRef((e,t)=>{const{__scopeTooltip:r,children:s,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:l,...u}=e,d=pu(Wo,r),m=Zf(r),{onClose:p}=d;return f.useEffect(()=>(document.addEventListener(A0,p),()=>document.removeEventListener(A0,p)),[p]),f.useEffect(()=>{if(d.trigger){const g=v=>{v.target?.contains(d.trigger)&&p()};return window.addEventListener("scroll",g,{capture:!0}),()=>window.removeEventListener("scroll",g,{capture:!0})}},[d.trigger,p]),n.jsx(Ri,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:g=>g.preventDefault(),onDismiss:p,children:n.jsxs(fu,{"data-state":d.stateAttribute,...m,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[n.jsx(d$,{children:s}),n.jsx(c$,{scope:r,isInside:!0,children:n.jsx(n$,{id:d.contentId,role:"tooltip",children:a||s})})]})})});v7.displayName=Wo;var b7="TooltipArrow",m$=f.forwardRef((e,t)=>{const{__scopeTooltip:r,...s}=e,a=Zf(r);return u$(b7,r).isInside?null:n.jsx(hu,{...a,...s,ref:t})});m$.displayName=b7;function f$(e,t){const r=Math.abs(t.top-e.y),s=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(r,s,a,i)){case i:return"left";case a:return"right";case r:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function h$(e,t,r=5){const s=[];switch(t){case"top":s.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":s.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":s.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":s.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return s}function p$(e){const{top:t,right:r,bottom:s,left:a}=e;return[{x:a,y:t},{x:r,y:t},{x:r,y:s},{x:a,y:s}]}function g$(e,t){const{x:r,y:s}=e;let a=!1;for(let i=0,l=t.length-1;is!=v>s&&r<(g-m)*(s-p)/(v-p)+m&&(a=!a)}return a}function x$(e){const t=e.slice();return t.sort((r,s)=>r.xs.x?1:r.ys.y?1:0),v$(t)}function v$(e){if(e.length<=1)return e.slice();const t=[];for(let s=0;s=2;){const i=t[t.length-1],l=t[t.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))t.pop();else break}t.push(a)}t.pop();const r=[];for(let s=e.length-1;s>=0;s--){const a=e[s];for(;r.length>=2;){const i=r[r.length-1],l=r[r.length-2];if((i.x-l.x)*(a.y-l.y)>=(i.y-l.y)*(a.x-l.x))r.pop();else break}r.push(a)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var y$=h7,b$=p7,C$=x7,w$=v7;const Fa=ce.createContext(void 0);function Ee(e){const{delay:t=150,side:r,align:s,sideOffset:a=10,content:i,children:l,asChild:u=!0}=e;return n.jsxs(b$,{delayDuration:t,children:[n.jsx(g7,{asChild:u,children:u?n.jsx("span",{children:l}):l}),i&&n.jsx(Fa.Consumer,{children:d=>n.jsx(C$,{container:d,children:n.jsx(w$,{className:"tooltip",role:"tooltip",sideOffset:a,side:r,align:s,"aria-live":"polite",collisionPadding:12,children:i})})})]})}function j$(e){return n.jsx(bs,{size:"1em",className:D(e.className,"cursor-default inline-flex")})}Ee.InfoIcon=j$;Ee.Provider=y$;const Ko=100,S$=1e3,k$="y/MM/dd";function ml(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function Vle(e){return e.toLowerCase().replaceAll(/[_-]+/g," ").replaceAll(/[^\s\w]/g,"").replaceAll(/\s+(.)(\w*)/g,(t,r,s)=>`${r.toUpperCase()+s}`).replace(/\w/,t=>t.toUpperCase())}const N$={ios:"iOS",macos:"macOS",js:"JS",openbsd:"OpenBSD",freebsd:"FreeBSD",tvos:"tvOS"};function pr(e){const t=N$[e.toLowerCase()];return t||e.replaceAll(/\b\w/g,r=>r.toUpperCase())}function $le(e){return e.replaceAll(/([a-z][A-Z])/g,t=>t.slice(0,1)+"-"+t.slice(1,2).toLowerCase()).toLowerCase().replaceAll(/[^\da-z-]+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}function C7(e){return e.replace(/\.local$/,"").replace(/\.localdomain$/,"")}function p2(e){return e.replace(/-t[\da-f].*/,"").replace(/-g\w+/,"")}function E$(e){return e.parsedOSVersion?n.jsx(Ee,{content:e.osVersion,side:"top",align:"start",children:e.parsedOSVersion}):e.osVersion}function A$(e){return e.split(":").map((r,s)=>s===0?n.jsx("span",{children:r},s):n.jsxs(f.Fragment,{children:[n.jsx("wbr",{}),":",n.jsx("span",{children:r})]},s))}function bo(e){return e===void 0?n.jsx(kt,{}):e?"Yes":"No"}const g2=()=>navigator.userLanguage||navigator.languages&&navigator.languages.length>0&&navigator.languages[0]||navigator.language||navigator.browserLanguage||navigator.systemLanguage||"en-US";function w7(e){return new Intl.DateTimeFormat(e,{hour:"numeric"}).resolvedOptions().hourCycle==="h23"}function Hc(e){const t=g2();return w7(t)?ji(e,"H:mm z"):ji(e,"p z")}function Hle(e){const t=g2();return w7(t)?ji(e,"HH:mm"):ji(e,"hh:mmaaa")}function ws(e){return ji(e,"MMM d, y")}function zc(e){if(!e)return;const t=new Date(e);return Number.isNaN(t.getTime())?void 0:ws(t)}function Go(e){return ji(e,"MMM d")}function zle(e,t){return`${Go(e)} - ${ws(t)}`}function Wle(e,t){return`${e.jurisdiction?`${e.displayName} – ${e.jurisdiction}`:e.displayName||"Tax"} (${e.percentage}% on ${Ks(t)})`}function Kle(e){const t=e.couponName||"Discount";return e.percentOff?`${t} (${e.percentOff}% off)`:t}function Gle(e){return ji(e,k$)}function j7(e){const t=Yn(),r=Gm(e,t)/24;return Math.max(0,Math.ceil(r))}function S7(e,t=Yn()){return Gm(t,e)>48?ws(e):(EU(e,t)+(e<=t?" ago":" from now")).replace("about ","")}const P$=e=>new Intl.NumberFormat(void 0,{style:"currency",currency:e.toUpperCase(),currencyDisplay:"symbol"}),T$=e=>new Intl.NumberFormat(void 0,{style:"currency",currency:e.toUpperCase(),currencyDisplay:"symbol",minimumFractionDigits:0,maximumFractionDigits:0});function Ks(e,t=!0,r="usd"){const s=e/Ko;return(t?P$(r).format(s):T$(r).format(s)).replace("US$","$")}function yt(e,t){if(t!==void 0&&t===1)return e;const r={"(quiz)$":"$1zes","^(ox)$":"$1en","([m|l])ouse$":"$1ice","(matr|vert|ind)ix|ex$":"$1ices","(x|ch|ss|sh)$":"$1es","([^aeiouy]|qu)y$":"$1ies","(hive)$":"$1s","(?:([^f])fe|([lr])f)$":"$1$2ves","(shea|lea|loa|thie)f$":"$1ves",sis$:"ses","([ti])um$":"$1a","(tomat|potat|ech|her|vet)o$":"$1oes","(bu)s$":"$1ses","(alias)$":"$1es","(octop)us$":"$1i","(ax|test)is$":"$1es","(us)$":"$1es","([^s]+)$":"$1s"},s={move:"moves",foot:"feet",goose:"geese",sex:"sexes",child:"children",man:"men",tooth:"teeth",person:"people"};if(["sheep","fish","deer","moose","series","species","money","rice","information","equipment","bison","cod","offspring","pike","salmon","shrimp","swine","trout","aircraft","hovercraft","spacecraft","sugar","tuna","you","wood"].includes(e.toLowerCase()))return e;for(const i in s){const l=new RegExp(`${i}$`,"i"),u=s[i];if(l.test(e))return e.replace(l,u)}for(const i in r){const l=new RegExp(i,"i");if(l.test(e))return e.replace(l,r[i])}return e}function n9(e){return e===1?"is":"are"}const I$=(e,t)=>/^[\s\w-]+$/.test(e);function Ge({url:e,kbTopic:t,label:r,onClick:s}){return n.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"link whitespace-nowrap","aria-label":`Read documentation about ${t}`,onClick:s,children:r??"Learn more"})}function r9(e){const t=e.replaceAll(/^[\s*.]+|\s+/g,"");return t?t.split(","):[]}const x2=6,D$=6;var _$=(e=>(e.ChargeAutomatically="charge_automatically",e.SendInvoice="send_invoice",e))(_$||{});const qle={total:{amount:x2,unlimited:!1}};function M$(e){return e==="github_community"?!1:!Ro(e)}function k7(e){return e==="starter"||e==="premium"||e==="personal_plus"}function Zs(e){return e==="hybrid_standard"||e==="hybrid_premium"}const L$=new Set(["ds_hybrid_standard","ds_hybrid_premium","ds_hybrid_enterprise","aws_private_offer_hybrid_standard","aws_private_offer_hybrid_premium","aws_private_offer_hybrid_enterprise","azure_private_offer_hybrid_standard","azure_private_offer_hybrid_premium","azure_private_offer_hybrid_enterprise","reseller_hybrid_standard","reseller_hybrid_premium","reseller_hybrid_enterprise","aws_self_serve_hybrid_standard","aws_self_serve_hybrid_premium"]);function v2(e){return e?L$.has(e):!1}function R$(e){return e==="enterprise"||e==="enterprise_credits"||e==="starter_credits"||e==="premium_credits"}function gu(e){return R$(e)||v2(e)}function ef(e){switch(e){case"starter":return 600;case"premium":return 1800;case"personal_plus":return 500;case"hybrid_standard":return 800;case"hybrid_premium":return 1800;case"ds_hybrid_standard":case"ds_hybrid_premium":case"ds_hybrid_enterprise":case"aws_private_offer_hybrid_standard":case"aws_private_offer_hybrid_enterprise":case"aws_private_offer_hybrid_premium":case"azure_private_offer_hybrid_standard":case"azure_private_offer_hybrid_premium":case"azure_private_offer_hybrid_enterprise":case"reseller_hybrid_standard":case"reseller_hybrid_premium":case"reseller_hybrid_enterprise":case"aws_self_serve_hybrid_standard":case"aws_self_serve_hybrid_premium":return Number.NaN}}const O$=500,Wc=5,N7=100,T0=1,F$=50;function Qs(e){if(!e)return"Custom";switch(e){case"personal":case"free":return"Personal";case"personal_pro":return"Personal Pro";case"personal_plus":return"Personal Plus";case"starter":return"Starter";case"premium":return"Premium";case"hybrid_standard":case"ds_hybrid_standard":case"aws_private_offer_hybrid_standard":case"azure_private_offer_hybrid_standard":case"reseller_hybrid_standard":case"aws_self_serve_hybrid_standard":return"Standard";case"hybrid_premium":case"ds_hybrid_premium":case"aws_private_offer_hybrid_premium":case"azure_private_offer_hybrid_premium":case"reseller_hybrid_premium":case"aws_self_serve_hybrid_premium":return"Premium";case"team":return"Team";case"business":return"Business";case"enterprise":case"ds_hybrid_enterprise":case"aws_private_offer_hybrid_enterprise":case"azure_private_offer_hybrid_enterprise":case"reseller_hybrid_enterprise":case"enterprise_trial":return"Enterprise";case"github_community":return"GitHub Community";case"legacy_connectivity":return"Connectivity";case"legacy_security":return"Security";case"addon_devices":return"Additional devices";case"addon_acl_named_users":return"Additional users in ACL";case"addon_subnet_routers":return"Additional subnet routers";case"starter_credits":return"Starter (credits)";case"premium_credits":return"Premium (credits)";case"insider":return"Tailscale Insider";case"enterprise_credits":return"Enterprise (credits)";case"mullvad":return"Mullvad VPN";case"tagged_resources":return"Tagged Resources"}}function qo(e){return Js[e].name}function Yle(e){return e.items?"Custom "+Object.values(e.items).map(t=>t.productName).join(", "):"Custom"}var E7=(e=>(e.Month="month",e.Year="year",e))(E7||{});function B$(e,t){if(e?.canEditBilling){if(!t)return!0}else return!1;const r=t.readableProductID||"personal";return _7(r)?!1:r==="personal"||r==="free"||r==="github_community"||r==="enterprise_trial"||r==="personal_pro"?!0:gu(r)?!1:Zs(r)||k7(r)?!0:P7(t)}function Zle(e){if(!e)return!1;const t=e.readableProductID;return k7(t)||Zs(t)||P7(e)||t==="personal_pro"||t==="github_community"}function A7(e,t){if(e?.canEditBilling){if(!t)return!0}else return!1;const r=t.readableProductID||"personal";return _7(r)?!1:r==="personal"||r==="free"||r==="personal_pro"||r==="personal_plus"||r==="github_community"||r==="starter"||r==="premium"||r==="hybrid_standard"||r==="hybrid_premium"||r==="enterprise_trial"||r==="insider"||t?.type==="custom"}function P7(e){if(!e||e.type!=="pricingV1"&&e.type!=="pricingV0")return!1;const t=e.readableProductID;return t==="team"||t==="business"||t==="legacy_connectivity"||t==="legacy_security"}function U$(e){return["active_users","users","devices","subnets","admin_users","acl_named_users"].includes(e)}function V$(e){return["active_users","users","devices","tag_devices","subnets","admin_users","acl_named_users","occupied_seats","ephemeral_minutes","pam_seats"].includes(e)}const $$="price_1NW3rCJko6VkHnHBgtDqLdxG",H$="price_1Pr2sYIRzk6XgwDkdZmnAIgv",z$="price_1NW46vJko6VkHnHBfEOLFJtf",W$="price_1PlGuTIRzk6XgwDky0g8mcZB",K$="price_1NnkbnJko6VkHnHBlSCUEMPX",G$="price_1PlGuTIRzk6XgwDkjcWnO1Rv",q$="price_1NnvcmJko6VkHnHBRgPrBUUt",Y$="price_1TRH3CJko6VkHnHB4tFUUXQm",Z$="price_1TRHF9Jko6VkHnHB1e6kjhdV",Q$="price_1TRHEWIRzk6XgwDkWpUvT6HU",Js={mullvad:{pricePerPack:O$,pricePerPackYearly:6e3,devicesPerPack:Wc,priceIds:new Set([$$,H$,z$,W$,K$,G$,q$]),name:"Mullvad VPN",termsUrl:"https://tailscale.com/mullvad-terms",termsLabel:"Mullvad VPN Terms For Tailscale Customers",termsClickEvent:R.MullvadVPNTermsLinkClicked,confirmationPath:(e,t)=>`/admin/settings/billing/confirmation/mullvad?packs=${e}&interval=${t}`},tagged_resources:{pricePerPack:N7,pricePerPackYearly:1200,devicesPerPack:T0,priceIds:new Set([Y$,Z$,Q$]),name:"Tagged Resources",usageFeatureId:"tag_devices"}};function J$(e){return e.replaceAll("_","-")}const X$={mullvad:"mullvad","tagged-resources":"tagged_resources"};function s9(e){return X$[e]}function eH(e,t){return e?.type!=="pricingV2"&&e?.type!=="hybrid"&&e?.type!=="custom"&&e?.readableProductID!=="personal_pro"&&e?.readableProductID!=="github_community"?0:Object.values(e?.items||{}).filter(r=>t.has(r.priceId)).map(r=>r.quantity).reduce((r,s)=>r+s,0)}function Nt(){const{data:e,error:t,isValidating:r,isLoading:s,mutate:a}=dt(kw(de.Billing,Ho,_a)),{data:i}=Ss(),[l,u]=f.useState(!1),[,d]=ft(),m=et(),p=e?.subscription,g=f.useMemo(()=>e?.subscription?.type==="hybrid"?V$:U$,[e?.subscription?.type]),v=f.useMemo(()=>p?.interval||"month",[p?.interval]),y=f.useMemo(()=>p?.type!=="hybrid"?0:Object.values(p.items||{}).find(_=>Zs(_.readableProductID))?.quantity||0,[p]),C=f.useMemo(()=>{const T=e?.billingUsage;return T?.usage&&!T.usage.active_users_valid&&(T.usage.active_users=(i?.users||[]).filter(_=>_.status===void 0).length),T},[e?.billingUsage,i?.users]),b=()=>(u(!0),Ie.delete("/public/stripe/subscription/delete/"+p?.id).then(()=>{u(!1),a(),d("/admin/settings/billing"),m.show({message:"Cancelled billing plan"}),O(R.CustomerPlanChangeSuccessful,{eventProperties:{productArea:K.Billing,productSubArea:oe.Checkout},checkoutProperties:{targetPlan:"personal"}})}).catch(T=>{N(),O(R.CustomerPlanChangeFailed,{eventProperties:{productArea:K.Billing,productSubArea:oe.Checkout},errorProperties:{errorMessage:T.toString()}}),a()})),w=()=>(u(!0),Ie.post("/public/stripe/subscription/trial/cancel").then(()=>{u(!1),a(),d("/admin/settings/billing"),m.show({message:"Switched plan to Personal"}),O(R.CustomerPlanChangeSuccessful,{eventProperties:{productArea:K.Billing,productSubArea:oe.Checkout},checkoutProperties:{targetPlan:"personal"}})}).catch(T=>{N(),O(R.CustomerPlanChangeFailed,{eventProperties:{productArea:K.Billing,productSubArea:oe.Checkout},errorProperties:{errorMessage:T.toString()}}),a()})),N=()=>{u(!1),m.show({message:fH,variant:"danger"})},k=f.useMemo(()=>{const T={};for(const[_,I]of Object.entries(Js))T[_]=eH(p,I.priceIds);return T},[p]),E=f.useMemo(()=>{const T=C?.usage,_=C?.allowance;return!T||!_?[]:Object.keys(T).filter(I=>g(I)).map(I=>{const F=I,z=nH(T[F],_[F]);return{feature:F,overBy:z}}).filter(I=>I.overBy>0)},[C,g]);return{error:t,data:p,mutate:a,loaded:!s,isPosting:l,isValidating:r,billingUsage:C,overAllowance:E,deleteSubscription:b,cancelTrial:w,addOnsDetails:{addonPacks:k,numMullvadPacks:k.mullvad,numTaggedResourcePacks:k.tagged_resources},billingInterval:v,currentHybridPlanSeatCount:y}}const I0="add-on geographically unavailable";function tH(e,t,r,s,a,i){return Ie.post("/public/stripe/subscription/setup",{plan:e,customerDetails:s,createSetupIntent:a,seats:i}).then(({data:l})=>(t.setFalse(),l.data)).catch(l=>{t.setFalse();const u=l?.response?.data?.error??"";throw r.show({message:u===I0?"This plan is not available in your region.":"Failed to update customer info.",variant:"danger"}),l})}function T7(){const{mutate:e}=Xc(),t=ss(!1),r=et(),s=Yt(),{data:a}=Nt(),i=f.useCallback((u,d,m,p)=>(t.setTrue(),tH(u,t,r,m,p,d)),[t,r]),l=f.useCallback((u,d,m,p,g)=>{t.setTrue();const v={plan:u,seats:d};return g&&(v.promoCode=g),Ie.post("/public/stripe/subscription/hybrid",v).then(()=>{if(t.setFalse(),!s){const y=a?.readableProductID===u;r.show({key:m,message:y?"Subscription seats updated":`Switched plan to ${Qs(u)}`})}O(R.CustomerPlanChangeSuccessful,{eventProperties:{productArea:s?K.Onboarding:K.Billing,productSubArea:oe.Checkout},checkoutProperties:{targetPlan:Qs(u),promoId:g||void 0,promoCode:p||void 0}}),e(_a)}).catch(y=>{const C=D7(y,g);throw t.setFalse(),r.show({message:C,variant:"danger"}),O(R.CustomerPlanChangeFailed,{eventProperties:{productArea:s?K.Onboarding:K.Billing,productSubArea:oe.Checkout},errorProperties:{errorMessage:C}}),y})},[t,r,e,s,a]);return{isPosting:t.value,postSetup:i,postCheckout:l}}function Qle(){const{mutate:e}=Xc(),[t,r]=f.useState(null),s=et(),a=f.useCallback((i,l)=>(r(i?.length?l?`${i[0]}:${l}`:i[0]:"all"),Ie.delete("/public/stripe/subscription/schedule",{data:i?.length?{changeTypes:i,addon:l}:void 0}).then(()=>{r(null),s.show({message:i?.length?"Cancelled scheduled change.":"Cancelled all scheduled changes."}),e(_a)}).catch(u=>{throw r(null),s.show({message:i?.length?`Failed to cancel scheduled ${gH(i[0])}.`:"Failed to cancel scheduled changes.",variant:"danger"}),u})),[s,e]);return{isPosting:t!==null,cancellingKey:t,cancelScheduleChanges:a}}function Qf(){const{data:e}=Nt(),t=e?.schedule;return f.useMemo(()=>{const r={hasPlanDowngrade:!1,hasSeatReduction:!1,hasAddonChange:!1,addonChanges:{},scheduledSeatTarget:void 0,scheduledPlanTarget:void 0};if(!t?.phases||t.phases.length<2)return r;const s=t.phases[0],a=t.phases[1],i=s.items.find(d=>Ro(d.readableProductID)),l=a.items.find(d=>Ro(d.readableProductID));i&&l&&(l.priceId!==i.priceId&&(r.hasPlanDowngrade=!0,r.scheduledPlanTarget=l.readableProductID),l.quantity!Ro(d.readableProductID)).map(d=>[d.priceId,d]));for(const[d,m]of u){const p=a.items.find(g=>g.priceId===d);if(!p||p.quantity(e.setTrue(),Ie.post("/public/stripe/subscription/addon/setup",{addon:d,quantity:m,billingInterval:p,customerDetails:g,createSetupIntent:v}).then(({data:y})=>(e.setFalse(),y.data)).catch(y=>{e.setFalse();const C=y.response?.data?.error;throw C===I0?a(!0):C.includes("subscription in past due state")?t.show({message:"We cannot complete this request due to an issue with your account state. Please reach out to support.",variant:"danger"}):t.show({message:"Failed to update customer info.",variant:"danger"}),y})),[e,t]),l=f.useCallback((d,m,p,g,v,y)=>(e.setTrue(),Ie.post("/public/stripe/subscription/addon",{addon:d,quantity:m,billingInterval:p,promoCode:v||void 0}).then(()=>{e.setFalse(),t.show({key:g,message:`${qo(d)} subscription updated`}),O(R.SubscriptionAddonChangeSuccessful,{eventProperties:{productArea:K.Billing,productSubArea:oe.Checkout},checkoutProperties:{promoCode:v||void 0,promoId:y||void 0}}),r(_a)}).catch(C=>{throw e.setFalse(),C.response?.data?.error===I0?a(!0):t.show({message:D7(C),variant:"danger"}),O(R.SubscriptionAddonChangeFailed,{eventProperties:{productArea:K.Billing,productSubArea:oe.Checkout}}),C})),[e,t,r]),u=d=>(e.setTrue(),Ie.delete(`/public/stripe/subscription/addon/${d}`).then(()=>{e.setFalse(),O(R.SubscriptionAddonChangeSuccessful,{eventProperties:{productArea:K.Billing,productSubArea:oe.Checkout}}),r(_a),t.show({message:"Cancelled add-on"})}).catch(m=>{throw e.setFalse(),m}));return{isPosting:e.value,postSetup:i,postCheckout:l,deleteAddon:u,purchaseGeoRestricted:s,setPurchaseGeoRestricted:a}}function Jle({limit:e}){const t=Cw(dB,{limit:e}),{error:r,data:s,isLoading:a}=dt(t);return{isLoading:a,error:r,data:s}}function I7({code:e}){const t=e?Cw(mB,{code:e}):null,{error:r,data:s,isLoading:a}=dt(t),i=function(l,u){let d=!1;return(l.applicableProducts&&l.applicableProducts.includes(u)||!l.applicableProducts)&&(d=!0),{id:l.id,isValid:d,name:l.couponName,discount:{amountOff:l.discount.amountOff,percentOff:l.discount.percentOff,duration:{duration:l.discount.duration.duration,months:l.discount.duration?.months}}}};return s?.promoCodes&&(s.promoCodes=s.promoCodes.filter(l=>l.active)),{isLoading:a,error:r,data:s,constructPromo:i}}function Xle(){const{error:e,data:t,isValidating:r}=dt(fB);return{error:e,data:t,loaded:!r||t!==void 0}}const nH=(e,{total:t})=>t===void 0||t.unlimited?0:e-t.amount,ece=(e,t)=>{switch(e){case"active_users":return yt("active user",t);case"users":return yt("user",t);case"occupied_seats":return yt("occupied seat",t);case"admin_users":return yt("admin user",t);case"acl_named_users":return yt("unique ACL user",t);case"devices":return yt("device",t);case"tag_devices":return yt("tag device",t);case"subnets":return yt("subnet router",t);case"acl_tags":return yt("ACL tag",t);case"ephemeral_minutes":return yt("ephemeral minute",t);case"pam_seats":return yt("PAM seat",t)}},Ir={Upgrade:"upgrade",Downgrade:"downgrade",Current:"current"};function rH(e,t,r){const s={free:1,personal:1,personal_plus:2,starter:3,premium:4,hybrid_standard:5,hybrid_premium:6,enterprise_trial:7,enterprise:8,ds_hybrid_standard:8,ds_hybrid_premium:8,ds_hybrid_enterprise:8,aws_private_offer_hybrid_standard:8,aws_private_offer_hybrid_premium:8,aws_private_offer_hybrid_enterprise:8,azure_private_offer_hybrid_standard:8,azure_private_offer_hybrid_premium:8,azure_private_offer_hybrid_enterprise:8,reseller_hybrid_standard:8,reseller_hybrid_premium:8,reseller_hybrid_enterprise:8,aws_self_serve_hybrid_standard:8,aws_self_serve_hybrid_premium:8};if(r||e==="enterprise_trial")return"select";const a=s[e],i=s[t];return a?i===a?"current":i>a?"upgrade":is.personal?"upgrade":"downgrade":"select"}function xu(e){const{data:t}=Nt(),r=Yt(),s=t?.readableProductID||"personal";return f.useMemo(()=>rH(s,e,r),[s,e,r])}function sH(){const e=et(),{mutate:t}=Xc(),[r,s]=f.useState(void 0),a=()=>{s(!0),Ie.get("/public/stripe/update-billing-card").then(async({data:u})=>{s(!1),globalThis.location.href=u.data.checkoutUrl}).catch(l)},i=u=>{s(!0),Ie.post("/public/stripe/update-billing-card",{sessionId:u}).then(()=>{s(!1),t(_a),e.show({message:"Updated billing card"})}).catch(l)},l=()=>{s(!1),e.show({message:hH,variant:"danger"})};return{isLoading:r,startUpdateBillingCard:a,completeUpdateBillingCard:i}}const aH=e=>{switch(e){case"month":return"monthly";case"year":return"yearly";default:return}},iH=(e,t,r)=>`${Ks(e,!1)}${r?" per user":""} · ${aH(t)}`;function oH(e,t){if(!e?.items||!e.basePriceId||!t)return{};const r=e.basePriceId,s=e.items[r]?.productId,a=t.basePlans[s]||t.legacyPlans[s],i=lH(a,r);return{plan:a,price:i}}function lH(e,t){if(e)return Object.values(e.prices).find(r=>r.id===t)}function cH(e){return e!=="personal"&&e!=="personal_pro"}function vu(e){if(!e)return!1;const t=e.readableProductID||"personal";return e.trialEnd!==void 0&&e.status==="trialing"||t==="enterprise_trial"}const uH=7;function dH(e){return!!e&&e.interval==="year"&&!Zs(e.readableProductID||"")}function mH(e){return e?.status==="past_due"}function D7(e,t){let r;try{r=JSON.parse(e?.response?.data?.error)?.message??""}catch{r=e?.response?.data?.error??""}if(t&&r){const i={"prior transactions":"This promo code is only valid for new customers.","already been redeemed":"This promo code can only be used once and has already been redeemed.","not specified for use with this customer":"This promo code is not valid for your account. Contact support if you think this is a mistake."};for(const[l,u]of Object.entries(i))if(r.includes(l))return u}const s=r.toLowerCase(),a={"insufficient funds":"Your card has insufficient funds. Please use a different payment method.","card was declined":"Your card was declined. Please use a different payment method.","expired card":"Your card has expired. Please update your payment method.","incorrect cvc":"The CVC code is incorrect. Please check your card details.","processing error":"Your card could not be processed. Please try again or use a different payment method.","authentication required":"Your card requires authentication. Please try again or use a different payment method.","card verification failed":"Your card could not be verified. Please use a different payment method."};for(const[i,l]of Object.entries(a))if(s.includes(i))return`${l} If this persists, please contact support@tailscale.com.`;return"There was an error during checkout. Please try again or contact support@tailscale.com for help."}const fH="Failed to update billing plan. Please try again or reach out to support@tailscale.com for help.",hH="Failed to update billing card. Please try again or reach out to support@tailscale.com for help.";function _7(e){return e==="starter_credits"||e==="premium_credits"||e==="enterprise_credits"}function y2(e){return!!e?.email&&!!e?.name&&!!e?.address}function Xf(e){switch(e){case"personal":case"free":return x2;case"personal_plus":return D$}}function fl(e){return!e||e==="personal"||e==="free"}function tce(e,t){const r=e?.readableProductID||"personal",s=e?.trialEnd&&e?.status==="trialing",a=e?.trialEnd?new Date(e.trialEnd):void 0,i=a&&a.getTime()({personal_plus:"Per month",starter:"Per month, per active user",premium:"Per month, per active user",hybrid_standard:"PER USER, PER MONTH",hybrid_premium:"PER USER, PER MONTH"})[e||""];function gH(e){return e.replaceAll("_"," ")}function Bi(e){return e.useBusinessPricing??!e.isSharedDomain}function Rt(e){const{data:t,isLoading:r,error:s,mutate:a}=dt("/public/tailnet/-/settings",e),i=et(),[l,u]=f.useState("");return{error:s,isLoading:r,updateErr:l,data:t,invalidate:()=>{a()},setTailnetSettings:(p,g,v)=>(t&&!v?.disableOptimisticUpdate&&a({...t,...p},!1),Ie.patch("/public/tailnet/-/settings",p).then(()=>{a(),u(""),g&&i.show({message:g})}).catch(y=>{a(),u(y?.response?.data?.error);const C=v?.showBadRequestErrorServerMessage&&y?.response?.status===400&&y?.response?.data?.error?y.response.data.error:"Failed to update tailnet settings";i.show({message:C,variant:"danger"})}))}}function xH(e){if(!e)return;const t=e.personalization;return{isBusiness:Bi(e),isSharedDomain:e.isSharedDomain??!1,useCase:t?.useCase,roleInOrganization:t?.roleInOrganization,referralSource:t?.referralSource,hasAdopted:t?.hasAdopted??!1,hasPotentialNonTailscaleSSHUsage:t?.hasPotentialNonTailscaleSSHUsage??!1,hasDefaultACLs:t?.hasDefaultACLs??!1,hasMullvadAddOn:e.mullvadVPN??!1,isAPITailnet:e.isAPITailnet??!1}}function vH(e,t){return!e||!t?!1:Object.keys(t).every(r=>{const s=t[r],a=e[r];return Array.isArray(s)?s.includes(a):s===a})}function Xs(e){const{data:t,isLoading:r}=Rt(),s=xH(t),[a]=ft(),{permissions:i}=ot(),{data:l}=vt(),{isDismissed:u,dismissNotice:d}=mu(),{minDeviceCount:m,inTrial:p,inEnterpriseTrial:g,permissions:v,flags:y,minBreakpoint:C,dismissNoticeKey:b,pathPrefix:w,excludePathPrefix:N,...k}=e,E=J8(C??"none"),T=C===void 0||E,{data:_}=dt(m===void 0?null:"/machines",{refreshInterval:30*1e3}),I=p!==void 0||g!==void 0,F=kw(de.Billing,Ho,_a),{data:z}=dt(I?F:null),H=z?.subscription;return{inSegment:!(!vH(s,k)||m!==void 0&&(_?.machines.length??0)l[B]===W)||!T||b!==void 0&&u(b)||w!==void 0&&!a.startsWith(w)||N!==void 0&&N.some(B=>a.startsWith(B))),isLoading:r,dismiss:()=>{b!==void 0&&d(b)}}}function yH(e,t){return e?t.every(r=>{const s=e[r.permission];return r.access==="write"?Sn(s):Ho(s)}):!1}function M7({className:e}){return n.jsxs("span",{"aria-hidden":!0,className:D("flex h-2 w-2 pointer-events-none",e),children:[n.jsx("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-blue-500 opacity-75"}),n.jsx("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-blue-500"})]})}function at(e){const{children:t,className:r,elevated:s,empty:a,noPadding:i}=e;return n.jsx("div",{"data-testid":"card",className:D("rounded-md border",r,{"shadow-soft":s,"bg-gray-0 dark:bg-gray-800":a,"bg-bg-base":!a,"p-5":!i}),children:t})}const nce=Object.freeze(Object.defineProperty({__proto__:null,default:at},Symbol.toStringTag,{value:"Module"}));function Vt(e){const{children:t,className:r,sizeVariant:s,...a}=e,i="href"in e?e.href:e.to;if(!i)throw new Error("LinkButton requires either href or to prop");const l=du(i),u=D("button",Hx(e),r);if(l){const{to:g,replace:v,state:y,asChild:C,...b}=a;return n.jsx("a",{href:i,className:u,target:"_blank",rel:"noopener noreferrer",...b,children:t})}const{target:d,rel:m,...p}=a;return n.jsx(ze,{to:i,className:u,...p,children:t})}const rce=Object.freeze(Object.defineProperty({__proto__:null,default:Vt},Symbol.toStringTag,{value:"Module"}));var ng=0;function eh(){f.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??a9()),document.body.insertAdjacentElement("beforeend",e[1]??a9()),ng++,()=>{ng===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ng--}},[])}function a9(){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 rg="focusScope.autoFocusOnMount",sg="focusScope.autoFocusOnUnmount",i9={bubbles:!1,cancelable:!0},bH="FocusScope",yu=f.forwardRef((e,t)=>{const{loop:r=!1,trapped:s=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=e,[u,d]=f.useState(null),m=Xr(a),p=Xr(i),g=f.useRef(null),v=Ct(t,b=>d(b)),y=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(s){let b=function(E){if(y.paused||!u)return;const T=E.target;u.contains(T)?g.current=T:ja(g.current,{select:!0})},w=function(E){if(y.paused||!u)return;const T=E.relatedTarget;T!==null&&(u.contains(T)||ja(g.current,{select:!0}))},N=function(E){if(document.activeElement===document.body)for(const _ of E)_.removedNodes.length>0&&ja(u)};document.addEventListener("focusin",b),document.addEventListener("focusout",w);const k=new MutationObserver(N);return u&&k.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",w),k.disconnect()}}},[s,u,y.paused]),f.useEffect(()=>{if(u){l9.add(y);const b=document.activeElement;if(!u.contains(b)){const N=new CustomEvent(rg,i9);u.addEventListener(rg,m),u.dispatchEvent(N),N.defaultPrevented||(CH(NH(L7(u)),{select:!0}),document.activeElement===b&&ja(u))}return()=>{u.removeEventListener(rg,m),setTimeout(()=>{const N=new CustomEvent(sg,i9);u.addEventListener(sg,p),u.dispatchEvent(N),N.defaultPrevented||ja(b??document.body,{select:!0}),u.removeEventListener(sg,p),l9.remove(y)},0)}}},[u,m,p,y]);const C=f.useCallback(b=>{if(!r&&!s||y.paused)return;const w=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,N=document.activeElement;if(w&&N){const k=b.currentTarget,[E,T]=wH(k);E&&T?!b.shiftKey&&N===T?(b.preventDefault(),r&&ja(E,{select:!0})):b.shiftKey&&N===E&&(b.preventDefault(),r&&ja(T,{select:!0})):N===k&&b.preventDefault()}},[r,s,y.paused]);return n.jsx(tt.div,{tabIndex:-1,...l,ref:v,onKeyDown:C})});yu.displayName=bH;function CH(e,{select:t=!1}={}){const r=document.activeElement;for(const s of e)if(ja(s,{select:t}),document.activeElement!==r)return}function wH(e){const t=L7(e),r=o9(t,e),s=o9(t.reverse(),e);return[r,s]}function L7(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const a=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||a?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function o9(e,t){for(const r of e)if(!jH(r,{upTo:t}))return r}function jH(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 SH(e){return e instanceof HTMLInputElement&&"select"in e}function ja(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&SH(e)&&t&&e.select()}}var l9=kH();function kH(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=c9(e,t),e.unshift(t)},remove(t){e=c9(e,t),e[0]?.resume()}}}function c9(e,t){const r=[...e],s=r.indexOf(t);return s!==-1&&r.splice(s,1),r}function NH(e){return e.filter(t=>t.tagName!=="A")}var EH=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Co=new WeakMap,Jd=new WeakMap,Xd={},ag=0,R7=function(e){return e&&(e.host||R7(e.parentNode))},AH=function(e,t){return t.map(function(r){if(e.contains(r))return r;var s=R7(r);return s&&e.contains(s)?s:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},PH=function(e,t,r,s){var a=AH(t,Array.isArray(e)?e:[e]);Xd[r]||(Xd[r]=new WeakMap);var i=Xd[r],l=[],u=new Set,d=new Set(a),m=function(g){!g||u.has(g)||(u.add(g),m(g.parentNode))};a.forEach(m);var p=function(g){!g||d.has(g)||Array.prototype.forEach.call(g.children,function(v){if(u.has(v))p(v);else try{var y=v.getAttribute(s),C=y!==null&&y!=="false",b=(Co.get(v)||0)+1,w=(i.get(v)||0)+1;Co.set(v,b),i.set(v,w),l.push(v),b===1&&C&&Jd.set(v,!0),w===1&&v.setAttribute(r,"true"),C||v.setAttribute(s,"true")}catch(N){console.error("aria-hidden: cannot operate on ",v,N)}})};return p(t),u.clear(),ag++,function(){l.forEach(function(g){var v=Co.get(g)-1,y=i.get(g)-1;Co.set(g,v),i.set(g,y),v||(Jd.has(g)||g.removeAttribute(s),Jd.delete(g)),y||g.removeAttribute(r)}),ag--,ag||(Co=new WeakMap,Co=new WeakMap,Jd=new WeakMap,Xd={})}},th=function(e,t,r){r===void 0&&(r="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),a=EH(e);return a?(s.push.apply(s,Array.from(a.querySelectorAll("[aria-live]"))),PH(s,a,r,"aria-hidden")):function(){return null}},ir=function(){return ir=Object.assign||function(t){for(var r,s=1,a=arguments.length;s"u")return KH;var t=GH(e),r=document.documentElement.clientWidth,s=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,s-r+t[2]-t[0])}},YH=U7(),Oo="data-scroll-locked",ZH=function(e,t,r,s){var a=e.left,i=e.top,l=e.right,u=e.gap;return r===void 0&&(r="margin"),` .`.concat(IH,` { overflow: hidden `).concat(s,`; padding-right: `).concat(u,"px ").concat(s,`; } body[`).concat(Oo,`] { overflow: hidden `).concat(s,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(s,";"),r==="margin"&&` padding-left: `.concat(a,`px; padding-top: `).concat(i,`px; padding-right: `).concat(l,`px; margin-left:0; margin-top:0; margin-right: `).concat(u,"px ").concat(s,`; `),r==="padding"&&"padding-right: ".concat(u,"px ").concat(s,";")].filter(Boolean).join(""),` } .`).concat(Sm,` { right: `).concat(u,"px ").concat(s,`; } .`).concat(km,` { margin-right: `).concat(u,"px ").concat(s,`; } .`).concat(Sm," .").concat(Sm,` { right: 0 `).concat(s,`; } .`).concat(km," .").concat(km,` { margin-right: 0 `).concat(s,`; } body[`).concat(Oo,`] { `).concat(DH,": ").concat(u,`px; } `)},d9=function(){var e=parseInt(document.body.getAttribute(Oo)||"0",10);return isFinite(e)?e:0},QH=function(){f.useEffect(function(){return document.body.setAttribute(Oo,(d9()+1).toString()),function(){var e=d9()-1;e<=0?document.body.removeAttribute(Oo):document.body.setAttribute(Oo,e.toString())}},[])},JH=function(e){var t=e.noRelative,r=e.noImportant,s=e.gapMode,a=s===void 0?"margin":s;QH();var i=f.useMemo(function(){return qH(a)},[a]);return f.createElement(YH,{styles:ZH(i,!t,a,r?"":"!important")})},D0=!1;if(typeof window<"u")try{var em=Object.defineProperty({},"passive",{get:function(){return D0=!0,!0}});window.addEventListener("test",em,em),window.removeEventListener("test",em,em)}catch{D0=!1}var wo=D0?{passive:!1}:!1,XH=function(e){return e.tagName==="TEXTAREA"},V7=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!XH(e)&&r[t]==="visible")},ez=function(e){return V7(e,"overflowY")},tz=function(e){return V7(e,"overflowX")},m9=function(e,t){var r=t.ownerDocument,s=t;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var a=$7(e,s);if(a){var i=H7(e,s),l=i[1],u=i[2];if(l>u)return!0}s=s.parentNode}while(s&&s!==r.body);return!1},nz=function(e){var t=e.scrollTop,r=e.scrollHeight,s=e.clientHeight;return[t,r,s]},rz=function(e){var t=e.scrollLeft,r=e.scrollWidth,s=e.clientWidth;return[t,r,s]},$7=function(e,t){return e==="v"?ez(t):tz(t)},H7=function(e,t){return e==="v"?nz(t):rz(t)},sz=function(e,t){return e==="h"&&t==="rtl"?-1:1},az=function(e,t,r,s,a){var i=sz(e,window.getComputedStyle(t).direction),l=i*s,u=r.target,d=t.contains(u),m=!1,p=l>0,g=0,v=0;do{var y=H7(e,u),C=y[0],b=y[1],w=y[2],N=b-w-i*C;(C||N)&&$7(e,u)&&(g+=N,v+=C),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(p&&Math.abs(g)<1||!p&&Math.abs(v)<1)&&(m=!0),m},tm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},f9=function(e){return[e.deltaX,e.deltaY]},h9=function(e){return e&&"current"in e?e.current:e},iz=function(e,t){return e[0]===t[0]&&e[1]===t[1]},oz=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},lz=0,jo=[];function cz(e){var t=f.useRef([]),r=f.useRef([0,0]),s=f.useRef(),a=f.useState(lz++)[0],i=f.useState(U7)[0],l=f.useRef(e);f.useEffect(function(){l.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var b=TH([e.lockRef.current],(e.shards||[]).map(h9),!0).filter(Boolean);return b.forEach(function(w){return w.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),b.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=f.useCallback(function(b,w){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!l.current.allowPinchZoom;var N=tm(b),k=r.current,E="deltaX"in b?b.deltaX:k[0]-N[0],T="deltaY"in b?b.deltaY:k[1]-N[1],_,I=b.target,F=Math.abs(E)>Math.abs(T)?"h":"v";if("touches"in b&&F==="h"&&I.type==="range")return!1;var z=m9(F,I);if(!z)return!0;if(z?_=F:(_=F==="v"?"h":"v",z=m9(F,I)),!z)return!1;if(!s.current&&"changedTouches"in b&&(E||T)&&(s.current=_),!_)return!0;var H=s.current||_;return az(H,w,b,H==="h"?E:T)},[]),d=f.useCallback(function(b){var w=b;if(!(!jo.length||jo[jo.length-1]!==i)){var N="deltaY"in w?f9(w):tm(w),k=t.current.filter(function(_){return _.name===w.type&&(_.target===w.target||w.target===_.shadowParent)&&iz(_.delta,N)})[0];if(k&&k.should){w.cancelable&&w.preventDefault();return}if(!k){var E=(l.current.shards||[]).map(h9).filter(Boolean).filter(function(_){return _.contains(w.target)}),T=E.length>0?u(w,E[0]):!l.current.noIsolation;T&&w.cancelable&&w.preventDefault()}}},[]),m=f.useCallback(function(b,w,N,k){var E={name:b,delta:w,target:N,should:k,shadowParent:uz(N)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(T){return T!==E})},1)},[]),p=f.useCallback(function(b){r.current=tm(b),s.current=void 0},[]),g=f.useCallback(function(b){m(b.type,f9(b),b.target,u(b,e.lockRef.current))},[]),v=f.useCallback(function(b){m(b.type,tm(b),b.target,u(b,e.lockRef.current))},[]);f.useEffect(function(){return jo.push(i),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:v}),document.addEventListener("wheel",d,wo),document.addEventListener("touchmove",d,wo),document.addEventListener("touchstart",p,wo),function(){jo=jo.filter(function(b){return b!==i}),document.removeEventListener("wheel",d,wo),document.removeEventListener("touchmove",d,wo),document.removeEventListener("touchstart",p,wo)}},[]);var y=e.removeScrollBar,C=e.inert;return f.createElement(f.Fragment,null,C?f.createElement(i,{styles:oz(a)}):null,y?f.createElement(JH,{gapMode:e.gapMode}):null)}function uz(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const dz=BH(B7,cz);var bu=f.forwardRef(function(e,t){return f.createElement(nh,ir({},e,{ref:t,sideCar:dz}))});bu.classNames=nh.classNames;var rh="Popover",[z7]=Cr(rh,[Ns]),Cu=Ns(),[mz,Ba]=z7(rh),W7=e=>{const{__scopePopover:t,children:r,open:s,defaultOpen:a,onOpenChange:i,modal:l=!1}=e,u=Cu(t),d=f.useRef(null),[m,p]=f.useState(!1),[g,v]=Mr({prop:s,defaultProp:a??!1,onChange:i,caller:rh});return n.jsx(ul,{...u,children:n.jsx(mz,{scope:t,contentId:qn(),triggerRef:d,open:g,onOpenChange:v,onOpenToggle:f.useCallback(()=>v(y=>!y),[v]),hasCustomAnchor:m,onCustomAnchorAdd:f.useCallback(()=>p(!0),[]),onCustomAnchorRemove:f.useCallback(()=>p(!1),[]),modal:l,children:r})})};W7.displayName=rh;var K7="PopoverAnchor",G7=f.forwardRef((e,t)=>{const{__scopePopover:r,...s}=e,a=Ba(K7,r),i=Cu(r),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=a;return f.useEffect(()=>(l(),()=>u()),[l,u]),n.jsx(dl,{...i,...s,ref:t})});G7.displayName=K7;var q7="PopoverTrigger",Y7=f.forwardRef((e,t)=>{const{__scopePopover:r,...s}=e,a=Ba(q7,r),i=Cu(r),l=Ct(t,a.triggerRef),u=n.jsx(tt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":tj(a.open),...s,ref:l,onClick:je(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:n.jsx(dl,{asChild:!0,...i,children:u})});Y7.displayName=q7;var b2="PopoverPortal",[fz,hz]=z7(b2,{forceMount:void 0}),Z7=e=>{const{__scopePopover:t,forceMount:r,children:s,container:a}=e,i=Ba(b2,t);return n.jsx(fz,{scope:t,forceMount:r,children:n.jsx(En,{present:r||i.open,children:n.jsx(Fi,{asChild:!0,container:a,children:s})})})};Z7.displayName=b2;var Yo="PopoverContent",Q7=f.forwardRef((e,t)=>{const r=hz(Yo,e.__scopePopover),{forceMount:s=r.forceMount,...a}=e,i=Ba(Yo,e.__scopePopover);return n.jsx(En,{present:s||i.open,children:i.modal?n.jsx(gz,{...a,ref:t}):n.jsx(xz,{...a,ref:t})})});Q7.displayName=Yo;var pz=Si("PopoverContent.RemoveScroll"),gz=f.forwardRef((e,t)=>{const r=Ba(Yo,e.__scopePopover),s=f.useRef(null),a=Ct(t,s),i=f.useRef(!1);return f.useEffect(()=>{const l=s.current;if(l)return th(l)},[]),n.jsx(bu,{as:pz,allowPinchZoom:!0,children:n.jsx(J7,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:je(e.onCloseAutoFocus,l=>{l.preventDefault(),i.current||r.triggerRef.current?.focus()}),onPointerDownOutside:je(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,m=u.button===2||d;i.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:je(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),xz=f.forwardRef((e,t)=>{const r=Ba(Yo,e.__scopePopover),s=f.useRef(!1),a=f.useRef(!1);return n.jsx(J7,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(s.current||r.triggerRef.current?.focus(),i.preventDefault()),s.current=!1,a.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(s.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;r.triggerRef.current?.contains(l)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),J7=f.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:m,onInteractOutside:p,...g}=e,v=Ba(Yo,r),y=Cu(r);return eh(),n.jsx(yu,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:a,onUnmountAutoFocus:i,children:n.jsx(Ri,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:m,onDismiss:()=>v.onOpenChange(!1),children:n.jsx(fu,{"data-state":tj(v.open),role:"dialog",id:v.contentId,...y,...g,ref:t,style:{...g.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),X7="PopoverClose",vz=f.forwardRef((e,t)=>{const{__scopePopover:r,...s}=e,a=Ba(X7,r);return n.jsx(tt.button,{type:"button",...s,ref:t,onClick:je(e.onClick,()=>a.onOpenChange(!1))})});vz.displayName=X7;var yz="PopoverArrow",ej=f.forwardRef((e,t)=>{const{__scopePopover:r,...s}=e,a=Cu(r);return n.jsx(hu,{...a,...s,ref:t})});ej.displayName=yz;function tj(e){return e?"open":"closed"}var C2=W7,bz=G7,nj=Y7,w2=Z7,j2=Q7,rj=ej;function Ni(e){const{children:t,className:r,content:s,side:a,sideOffset:i,align:l,alignOffset:u,arrow:d,asChild:m,open:p,onOpenChange:g,onOpenAutoFocus:v,modal:y}=e;return n.jsxs(C2,{open:p,onOpenChange:g,modal:y,children:[n.jsx(nj,{asChild:m,children:t}),n.jsx(Fa.Consumer,{children:C=>n.jsx(w2,{container:C,children:n.jsxs(j2,{className:D("origin-radix-popover shadow-popover bg-bg-base rounded-md z-50","state-open:animate-scale-in state-closed:animate-scale-out","focus-within:outline-none",r),side:a,sideOffset:i,align:l,alignOffset:u,collisionPadding:12,onOpenAutoFocus:v,children:[s,d&&n.jsx(rj,{className:"-mt-px fill-bg-base drop-shadow-[0_2px_0_var(--color-border-base)]",width:12,height:6})]})})})]})}Ni.defaultProps={sideOffset:10};const sce=Object.freeze(Object.defineProperty({__proto__:null,default:Ni},Symbol.toStringTag,{value:"Module"})),Cz=2;function S2({children:e,side:t="bottom",align:r="center",wrapperClassName:s="relative inline-flex",dotClassName:a="absolute top-1 right-1"}){const[i,l]=ce.useState(!0),{inSegment:u,isLoading:d}=Xs({isBusiness:!0,hasDefaultACLs:!0,minDeviceCount:Cz,excludePathPrefix:["/admin/acls"]}),m={productArea:K.Header,productSubArea:oe.AclAwarenessNav};return d||!u?n.jsx(n.Fragment,{children:e}):n.jsx(Ni,{open:i,onOpenChange:l,asChild:!0,side:t,align:r,className:"w-80",arrow:!0,content:n.jsx(at,{elevated:!0,className:"relative !p-4",children:n.jsxs("div",{className:"relative z-10 flex flex-col gap-3",children:[n.jsx("h3",{className:"font-medium text-base",children:"Next: Tighten access controls"}),n.jsx("p",{children:"Currently, users on your tailnet will be able to access all devices and resources. Tag those that you intend to share with others."}),n.jsxs("div",{className:"flex items-center gap-2 flex-row-reverse justify-start",children:[n.jsx(Vt,{to:"/admin/acls/visual/tags",intent:"primary",sizeVariant:"small",onClick:()=>{O(R.ACLAwarenessSetUpClicked,{eventProperties:m})},children:"Set up"}),n.jsx(Vt,{href:"https://tailscale.com/docs/features/tags",variant:"minimal",sizeVariant:"small",onClick:()=>{O(R.ACLAwarenessSeeHowClicked,{eventProperties:m})},children:"See how"})]})]})}),children:n.jsxs("div",{className:s,children:[e,n.jsx(M7,{className:a})]})})}class sj extends f.Component{constructor(t){super(t),this.state={error:void 0}}static getDerivedStateFromError(t){if(wz(t)){const r=globalThis.localStorage.getItem(p9),s=new Date(r||0);TU(new Date)>s&&(globalThis.localStorage.setItem(p9,new Date().toISOString()),globalThis.location.reload())}return{error:t}}componentDidCatch(t,r){console.error("Uncaught Error",t,r),al(t),this.props.onError?.(t,r)}render(){if(this.state.error!==void 0){if(typeof this.props.fallback=="function")return this.props.fallback({error:this.state.error,resetError:()=>this.setState({error:void 0})});if(f.isValidElement(this.props.fallback))return this.props.fallback;throw new Error("Missing fallback element")}return this.props.children}}function wz(e){return!!e?.message?.includes("Failed to fetch dynamically imported module")}const p9="tailscale/missing-chunk-refresh";function jz(e){return n.jsx(sj,{fallback:Sz,children:e.children})}function Sz({error:e}){const t=e?e.message:"an unknown error occurred",r=()=>{globalThis.location.reload()};return n.jsx("div",{className:"flex items-center justify-center min-h-screen",children:n.jsx("div",{className:"flex flex-col items-start justify-center container",children:n.jsxs("div",{className:"mx-auto max-w-lg",children:[n.jsxs("div",{className:"relative grow mb-4 md:mb-2 md:mr-3 text-red-400 -top-0.5",children:[n.jsx(Da,{className:"hidden md:inline-block",size:"1.25rem"}),n.jsx(Da,{className:"md:hidden",size:"2rem"})]}),n.jsxs("div",{children:[n.jsxs("h3",{className:"mb-2 font-medium",children:["Error: ",t]}),n.jsxs("p",{children:["An unknown error occurred. You can"," ",n.jsx("button",{className:"link",onClick:r,children:"refresh the page"})," ","to try again, or if the error continues, please"," ",n.jsx(Zn,{type:"other",children:"contact us"})," ","for help."]})]})]})})})}const Zo=e=>f.createElement("svg",{width:18,height:18,viewBox:"0 0 23 23",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("circle",{opacity:.2,cx:3.4,cy:3.25,r:2.7,fill:"currentColor"}),f.createElement("circle",{cx:3.4,cy:11.3,r:2.7,fill:"currentColor"}),f.createElement("circle",{opacity:.2,cx:3.4,cy:19.5,r:2.7,fill:"currentColor"}),f.createElement("circle",{cx:11.5,cy:11.3,r:2.7,fill:"currentColor"}),f.createElement("circle",{cx:11.5,cy:19.5,r:2.7,fill:"currentColor"}),f.createElement("circle",{opacity:.2,cx:11.5,cy:3.25,r:2.7,fill:"currentColor"}),f.createElement("circle",{opacity:.2,cx:19.5,cy:3.25,r:2.7,fill:"currentColor"}),f.createElement("circle",{cx:19.5,cy:11.3,r:2.7,fill:"currentColor"}),f.createElement("circle",{opacity:.2,cx:19.5,cy:19.5,r:2.7,fill:"currentColor"})),aj="theme",ij=f.createContext({requestedTheme:"system",resolvedTheme:"light",setTheme:()=>{}});function kz({children:e}){const[t,r]=f.useState(_0()),[s,a]=f.useState(Nm(t));f.useEffect(()=>{_0()!==t&&O(R.RequestedThemeChanged,{themeProperties:{requestedTheme:t,resolvedTheme:Nm(t)}}),localStorage.setItem(aj,t)},[t]),f.useEffect(()=>{const l=()=>a(Nm(t));if(l(),t!=="system")return;const u=globalThis.matchMedia("(prefers-color-scheme: dark)");return u.addEventListener("change",l),()=>u.removeEventListener("change",l)},[a,t]),f.useEffect(()=>{const l=document.documentElement;if(!l)return;const u=Nz();l.classList.toggle("dark",s==="dark"),u()},[s]);const i=f.useMemo(()=>({requestedTheme:t,resolvedTheme:s,setTheme:r}),[t,s]);return n.jsx(ij.Provider,{value:i,children:e})}function hl(){const e=f.useContext(ij);if(!e)throw new Error("useTheme must be used within a ThemeProvider. Wrap a parent component in ");return e}function Nz(){const e=document.createElement("style");return e.type="text/css",e.textContent=` * { -webkit-transition: none !important; -moz-transition: none !important; -o-transition: none !important; -ms-transition: none !important; transition: none !important; } `,document.head.append(e),()=>{globalThis.getComputedStyle(e).opacity,e.remove()}}function Nm(e){switch(e){case"dark":return"dark";case"light":return"light";default:return Ez()?"dark":"light"}}function Ez(){return globalThis.matchMedia("(prefers-color-scheme: dark)").matches}function _0(){switch(localStorage.getItem(aj)){case"dark":return"dark";case"light":return"light";default:return"system"}}function Fr(e,t){const r=void 0,{data:s,isLoading:a,error:i}=dt(t?"/public/experiments":null),l=s?.[e]?.variant,u=s?.[e]?.payload,d=!t||!l||l==="off"||!!i,m=d?"control":l,p=f.useRef(new Set);return f.useEffect(()=>{!a&&!d&&!p.current.has(e)&&(p.current.add(e),O(R.ExperimentExposure,{experimentProperties:{flag_key:e,variant:m}}))},[e,m,a,d]),r?{variant:r,payload:void 0,isEnrolled:!0,isLoading:!1}:{variant:m,payload:d?void 0:u,isEnrolled:!d,isLoading:a}}function pl({experimentKey:e,enabled:t,variants:r,unenrolled:s,loadingDisplay:a}){const{variant:i,isEnrolled:l,isLoading:u}=Fr(e,t);if(u&&a!==void 0)return n.jsx(n.Fragment,{children:a});if(!l&&s!==void 0)return n.jsx(n.Fragment,{children:s});const d=r[i in r?i:"control"];return n.jsx(n.Fragment,{children:d})}function We(e){const{className:t,color:r,variant:s,...a}=e;return n.jsx("div",{className:D("inline-flex items-center align-middle justify-center font-medium text-sm",{"border border-gray-200 dark:border-transparent bg-gray-200 dark:bg-gray-600 text-gray-600 dark:text-gray-300":r==="gray","border border-green-50 dark:border-transparent bg-green-50 dark:bg-green-400 text-text-success dark:text-green-0":r==="green","border border-blue-50 dark:border-transparent bg-blue-50 dark:bg-blue-600 text-text-primary dark:text-blue-50":r==="blue","border border-orange-50 dark:border-transparent bg-orange-50 dark:bg-orange-400/50 text-text-warning dark:text-orange-50":r==="orange","border border-yellow-50 dark:border-transparent bg-yellow-50 dark:bg-yellow-200 text-text-warning dark:text-orange-800":r==="yellow","border border-red-50 dark:border-transparent bg-red-50 dark:bg-red-800 text-text-danger dark:text-red-100":r==="red","border border-purple-50 dark:border-transparent bg-purple-50 dark:bg-purple-600 text-purple-600 dark:text-purple-50":r==="purple","border border-border-interactive bg-bg-base":r==="outline","rounded-full px-2 py-1 leading-none":s==="status","rounded-sm px-1":s==="tag","rounded-md px-1":s==="cell"},t),...a})}We.defaultProps={color:"gray"};function k2(e){return n.jsx(We,{className:D("relative",e.className),variant:"status",color:"yellow",children:"Alpha"})}function Qo(e){return n.jsxs(We,{className:D("relative",e.className),variant:"status",color:"yellow",children:["Beta",e.feature&&n.jsxs(n.Fragment,{children:[":",n.jsx("span",{className:"font-normal ml-1",children:e.feature})]})]})}const ace=Object.freeze(Object.defineProperty({__proto__:null,AlphaBadge:k2,BetaBadge:Qo,default:We},Symbol.toStringTag,{value:"Module"}));var cg,sh="HoverCard",[oj]=Cr(sh,[Ns]),ah=Ns(),[Az,ih]=oj(sh),lj=e=>{const{__scopeHoverCard:t,children:r,open:s,defaultOpen:a,onOpenChange:i,openDelay:l=700,closeDelay:u=300}=e,d=ah(t),m=f.useRef(0),p=f.useRef(0),g=f.useRef(!1),v=f.useRef(!1),[y,C]=Mr({prop:s,defaultProp:a??!1,onChange:i,caller:sh}),b=f.useCallback(()=>{clearTimeout(p.current),m.current=window.setTimeout(()=>C(!0),l)},[l,C]),w=f.useCallback(()=>{clearTimeout(m.current),!g.current&&!v.current&&(p.current=window.setTimeout(()=>C(!1),u))},[u,C]),N=f.useCallback(()=>C(!1),[C]);return f.useEffect(()=>()=>{clearTimeout(m.current),clearTimeout(p.current)},[]),n.jsx(Az,{scope:t,open:y,onOpenChange:C,onOpen:b,onClose:w,onDismiss:N,hasSelectionRef:g,isPointerDownOnContentRef:v,children:n.jsx(ul,{...d,children:r})})};lj.displayName=sh;var cj="HoverCardTrigger",uj=f.forwardRef((e,t)=>{const{__scopeHoverCard:r,...s}=e,a=ih(cj,r),i=ah(r);return n.jsx(dl,{asChild:!0,...i,children:n.jsx(tt.a,{"data-state":a.open?"open":"closed",...s,ref:t,onPointerEnter:je(e.onPointerEnter,nf(a.onOpen)),onPointerLeave:je(e.onPointerLeave,nf(a.onClose)),onFocus:je(e.onFocus,a.onOpen),onBlur:je(e.onBlur,a.onClose),onTouchStart:je(e.onTouchStart,l=>l.preventDefault())})})});uj.displayName=cj;var N2="HoverCardPortal",[Pz,Tz]=oj(N2,{forceMount:void 0}),dj=e=>{const{__scopeHoverCard:t,forceMount:r,children:s,container:a}=e,i=ih(N2,t);return n.jsx(Pz,{scope:t,forceMount:r,children:n.jsx(En,{present:r||i.open,children:n.jsx(Fi,{asChild:!0,container:a,children:s})})})};dj.displayName=N2;var tf="HoverCardContent",mj=f.forwardRef((e,t)=>{const r=Tz(tf,e.__scopeHoverCard),{forceMount:s=r.forceMount,...a}=e,i=ih(tf,e.__scopeHoverCard);return n.jsx(En,{present:s||i.open,children:n.jsx(Iz,{"data-state":i.open?"open":"closed",...a,onPointerEnter:je(e.onPointerEnter,nf(i.onOpen)),onPointerLeave:je(e.onPointerLeave,nf(i.onClose)),ref:t})})});mj.displayName=tf;var Iz=f.forwardRef((e,t)=>{const{__scopeHoverCard:r,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,...u}=e,d=ih(tf,r),m=ah(r),p=f.useRef(null),g=Ct(t,p),[v,y]=f.useState(!1);return f.useEffect(()=>{if(v){const C=document.body;return cg=C.style.userSelect||C.style.webkitUserSelect,C.style.userSelect="none",C.style.webkitUserSelect="none",()=>{C.style.userSelect=cg,C.style.webkitUserSelect=cg}}},[v]),f.useEffect(()=>{if(p.current){const C=()=>{y(!1),d.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==""&&(d.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",C),()=>{document.removeEventListener("pointerup",C),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!1}}},[d.isPointerDownOnContentRef,d.hasSelectionRef]),f.useEffect(()=>{p.current&&Mz(p.current).forEach(b=>b.setAttribute("tabindex","-1"))}),n.jsx(Ri,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:l,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:je(i,C=>{C.preventDefault()}),onDismiss:d.onDismiss,children:n.jsx(fu,{...m,...u,onPointerDown:je(u.onPointerDown,C=>{C.currentTarget.contains(C.target)&&y(!0),d.hasSelectionRef.current=!1,d.isPointerDownOnContentRef.current=!0}),ref:g,style:{...u.style,userSelect:v?"text":void 0,WebkitUserSelect:v?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),Dz="HoverCardArrow",_z=f.forwardRef((e,t)=>{const{__scopeHoverCard:r,...s}=e,a=ah(r);return n.jsx(hu,{...a,...s,ref:t})});_z.displayName=Dz;function nf(e){return t=>t.pointerType==="touch"?void 0:e()}function Mz(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;r.nextNode();)t.push(r.currentNode);return t}var fj=lj,hj=uj,pj=dj,gj=mj;function xj({children:e,icon:t,title:r,description:s,primaryAction:a,secondaryAction:i,asChild:l=!0,className:u,openDelay:d=150,closeDelay:m=200,side:p,sideOffset:g=10,align:v,alignOffset:y}){const[C,b]=ce.useState(!1),w=()=>b(!1),N=()=>b(!0);return n.jsxs(fj,{open:C,onOpenChange:b,openDelay:d,closeDelay:m,children:[n.jsx(hj,{asChild:l,children:l?n.jsx("span",{tabIndex:0,onClick:N,children:e}):e}),n.jsx(Fa.Consumer,{children:k=>n.jsx(pj,{container:k,children:n.jsx(gj,{className:D("z-50 w-80",u),side:p,sideOffset:g,align:v,alignOffset:y,collisionPadding:12,"aria-live":"polite",children:n.jsx(at,{elevated:!0,className:"!p-4",children:n.jsxs("div",{className:"flex flex-col gap-3",children:[(t||r)&&n.jsxs("div",{className:"flex items-center gap-2",children:[t&&n.jsx("span",{className:"flex shrink-0 items-center",children:t}),r&&n.jsx("h3",{className:"text-base font-medium",children:r})]}),n.jsx("div",{children:s}),a&&n.jsx(Vt,{...Lz(a.href),intent:"primary",sizeVariant:"small",onClick:()=>{a.onClick?.(),w()},children:a.label}),i&&n.jsxs("p",{children:[i.prefix&&n.jsx("span",{className:"mr-1",children:i.prefix}),n.jsx(Rz,{action:i,onAfterClick:w})]})]})})})})})]})}function Lz(e){return du(e)?{href:e}:{to:e}}function Rz({action:e,onAfterClick:t}){const r=()=>{e.onClick?.(),t()};return du(e.href)?n.jsx("a",{href:e.href,className:"underline",target:"_blank",rel:"noopener noreferrer",onClick:r,children:e.label}):n.jsx(ze,{href:e.href,className:"underline",onClick:r,children:e.label})}const rf="/admin/settings/billing/plans",sf={productArea:K.Billing,productSubArea:oe.TrialBadge},af=()=>O(R.ChooseAPlanButtonClicked,{eventProperties:sf});function Oz(){const{data:e}=Nt(),t=e?.readableProductID;if(Yt()||!e?.trialEnd||e?.status!=="trialing"&&t!=="enterprise_trial")return null;const s=t==="enterprise_trial",a=j7(new Date(e.trialEnd)),i=a===0?"expired":a<3?"expiring":"active",l=Qs(t),u=n.jsxs(We,{variant:"tag",color:i==="active"?"yellow":"red",children:[n.jsx("span",{className:"font-semibold",children:"Trial"}),n.jsx("span",{className:"font-normal ml-1 text-nowrap",children:i==="expired"?"ended":`${a} ${a===1?"day":"days"} left`})]});if(!s)return n.jsx(Ee,{content:n.jsxs("p",{children:["You are currently on a free trial of the ",l," plan. Your billing will begin when the trial ends."]}),children:u});const d=Fz({badge:u,badgeState:i,planLabel:l}),m=Bz({badge:u,badgeState:i,daysRemaining:a,planLabel:l}),p=Uz({badge:u,badgeState:i,planLabel:l});return n.jsx(pl,{experimentKey:"trial-badge-optimization",variants:{control:d,variant1:m,variant2:p},enabled:!0})}function Fz({badge:e,badgeState:t,planLabel:r}){const s=t==="expired"?n.jsxs("p",{children:["We hope you enjoyed your free trial of the ",r," plan.",n.jsx(ze,{className:"underline ml-1",href:rf,onClick:af,children:"Choose a plan"}),", or",n.jsx(u0,{className:"underline mx-1",eventProperties:sf,children:"contact sales"}),"if you have any questions or need an extension."]}):n.jsxs(n.Fragment,{children:[n.jsxs("p",{children:["You are currently on a free trial of our ",r," plan. Remember to",n.jsx(ze,{className:"underline mx-1",href:rf,onClick:af,children:"select a plan"}),"before your trial ends to avoid any service interruptions."]}),n.jsxs("p",{children:["Need more time?",n.jsx(u0,{className:"underline ml-1",eventProperties:sf,children:"Contact sales"}),"."]})]});return n.jsx(Ee,{content:s,children:e})}function Bz({badge:e,badgeState:t,daysRemaining:r,planLabel:s}){const a=t==="expired"?"0 days left":`${r} ${r===1?"day":"days"} left`,i=t==="expired"?n.jsxs("p",{children:["We hope you enjoyed your free trial of our ",s," plan. Choose a plan now to avoid any interruptions."]}):n.jsxs("p",{children:["You’re enjoying a free trial of our ",s," plan. Choose a plan now to avoid any interruptions."]});return n.jsx(xj,{icon:n.jsx(CR,{size:"1.25em","aria-hidden":!0}),title:a,description:i,primaryAction:{label:"Choose a plan",href:rf,onClick:af},secondaryAction:{prefix:"Need more time?",label:"Contact sales",href:"https://tailscale.com/contact/sales/",onClick:()=>O(R.ContactSalesButtonClicked,{eventProperties:sf})},children:e})}function Uz({badge:e,badgeState:t,planLabel:r}){const s=t==="expired"?n.jsxs("p",{children:["We hope you enjoyed your free trial of our ",r," plan. Choose a plan now to avoid any interruptions."]}):n.jsxs("p",{children:["You are currently on a free trial of our ",r," plan. Choose a plan before your trial ends to avoid any interruptions."]});return n.jsxs("span",{className:"inline-flex items-center gap-1",children:[n.jsx(Ee,{content:s,children:e}),n.jsx(Vt,{to:rf,intent:"primary",variant:"minimal",sizeVariant:"small",onClick:af,children:"Choose a plan"})]})}function Vz(){return n.jsx(Ee,{content:n.jsxs("p",{children:[n.jsx("strong",{children:"Update your payment method."})," If not resolved by the end of your billing period, your plan will be downgraded."]}),children:n.jsx(We,{variant:"tag",color:"red",className:"text-sm",children:"Payment overdue"})})}const $z="/admin/settings/billing/plans",Hz={productArea:K.Billing,productSubArea:oe.FreeUpgradeBadge},zz=()=>O(R.ChooseAPlanButtonClicked,{eventProperties:Hz});function Wz(){const e=n.jsx(We,{variant:"tag",color:"gray",className:"text-sm",children:"Free"});return n.jsx(xj,{title:"Free plan",description:n.jsx("p",{children:"You are currently on a free Personal plan. As your network grows, choose a plan to unlock additional features and add more devices and users."}),primaryAction:{label:"Choose a plan",href:$z,onClick:zz},children:e})}function Kz(){const{data:e}=ot(),{data:t}=vt(),{data:r,loaded:s,addOnsDetails:{numMullvadPacks:a}}=Nt(),i=r?.readableProductID||"personal";return s?mH(r)&&e?.canEditBilling?n.jsx(Vz,{}):fl(i)&&!a?n.jsx(Wz,{}):!t.trialBanner&&!t.trialNoBanner?n.jsx(Oz,{}):null:null}function Lr(e){const{className:t,sizeClassName:r,user:s,group:a,children:i,...l}=e,u=s&&s.profilePicURL&&s.profilePicURL.length>0;return n.jsx("div",{className:D("relative shrink-0 rounded-full overflow-hidden transition-all duration-300",r,t),...l,children:s?u?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"w-full h-full bg-cover bg-center",style:{backgroundImage:`url(${s.profilePicURL})`}}),n.jsx("div",{className:"absolute inset-0 w-full h-full rounded-full"})]}):n.jsx("div",{className:D(g9,r),style:{backgroundColor:v9(s.id||s.loginName)},children:(s.displayName||s.loginName||"-").slice(0,1)}):a?n.jsx("div",{className:D(g9,r),style:{backgroundColor:v9(a)},children:n.jsx(wi,{color:"white",size:"60%"})}):n.jsx("div",{className:D("flex justify-center items-center pointer-events-none rounded-full border border-border-interactive border-dashed",r),children:i})})}const g9="flex items-center justify-center text-center capitalize text-white font-medium text-lg pointer-events-none transition-all duration-300",x9=["#cca000","#ca6940","#0d4b3b","#a13821","#496495","#762B0B","#0E6245","#C44C34","#3F5DB3","#324994","#19224A","#2C2929","#0E6245","#09825D","#BB5504"];function v9(e){const t=e.split("").reduce((r,s)=>r^(s.codePointAt(0)??0),0);return x9[Math.abs(t)%x9.length]}Lr.defaultProps={sizeClassName:"w-12 h-12 text-lg"};const ice=Object.freeze(Object.defineProperty({__proto__:null,default:Lr},Symbol.toStringTag,{value:"Module"}));function E2(e){const t=e+"CollectionProvider",[r,s]=Cr(t),[a,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),l=b=>{const{scope:w,children:N}=b,k=ce.useRef(null),E=ce.useRef(new Map).current;return n.jsx(a,{scope:w,itemMap:E,collectionRef:k,children:N})};l.displayName=t;const u=e+"CollectionSlot",d=Si(u),m=ce.forwardRef((b,w)=>{const{scope:N,children:k}=b,E=i(u,N),T=Ct(w,E.collectionRef);return n.jsx(d,{ref:T,children:k})});m.displayName=u;const p=e+"CollectionItemSlot",g="data-radix-collection-item",v=Si(p),y=ce.forwardRef((b,w)=>{const{scope:N,children:k,...E}=b,T=ce.useRef(null),_=Ct(w,T),I=i(p,N);return ce.useEffect(()=>(I.itemMap.set(T,{ref:T,...E}),()=>{I.itemMap.delete(T)})),n.jsx(v,{[g]:"",ref:_,children:k})});y.displayName=p;function C(b){const w=i(e+"CollectionConsumer",b);return ce.useCallback(()=>{const k=w.collectionRef.current;if(!k)return[];const E=Array.from(k.querySelectorAll(`[${g}]`));return Array.from(w.itemMap.values()).sort((I,F)=>E.indexOf(I.ref.current)-E.indexOf(F.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:l,Slot:m,ItemSlot:y},C,s]}var Gz=f.createContext(void 0);function oh(e){const t=f.useContext(Gz);return e||t||"ltr"}var ug="rovingFocusGroup.onEntryFocus",qz={bubbles:!1,cancelable:!0},wu="RovingFocusGroup",[M0,vj,Yz]=E2(wu),[Zz,lh]=Cr(wu,[Yz]),[Qz,Jz]=Zz(wu),yj=f.forwardRef((e,t)=>n.jsx(M0.Provider,{scope:e.__scopeRovingFocusGroup,children:n.jsx(M0.Slot,{scope:e.__scopeRovingFocusGroup,children:n.jsx(Xz,{...e,ref:t})})}));yj.displayName=wu;var Xz=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:s,loop:a=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:m,preventScrollOnEntryFocus:p=!1,...g}=e,v=f.useRef(null),y=Ct(t,v),C=oh(i),[b,w]=Mr({prop:l,defaultProp:u??null,onChange:d,caller:wu}),[N,k]=f.useState(!1),E=Xr(m),T=vj(r),_=f.useRef(!1),[I,F]=f.useState(0);return f.useEffect(()=>{const z=v.current;if(z)return z.addEventListener(ug,E),()=>z.removeEventListener(ug,E)},[E]),n.jsx(Qz,{scope:r,orientation:s,dir:C,loop:a,currentTabStopId:b,onItemFocus:f.useCallback(z=>w(z),[w]),onItemShiftTab:f.useCallback(()=>k(!0),[]),onFocusableItemAdd:f.useCallback(()=>F(z=>z+1),[]),onFocusableItemRemove:f.useCallback(()=>F(z=>z-1),[]),children:n.jsx(tt.div,{tabIndex:N||I===0?-1:0,"data-orientation":s,...g,ref:y,style:{outline:"none",...e.style},onMouseDown:je(e.onMouseDown,()=>{_.current=!0}),onFocus:je(e.onFocus,z=>{const H=!_.current;if(z.target===z.currentTarget&&H&&!N){const J=new CustomEvent(ug,qz);if(z.currentTarget.dispatchEvent(J),!J.defaultPrevented){const Y=T().filter(re=>re.focusable),B=Y.find(re=>re.active),W=Y.find(re=>re.id===b),Z=[B,W,...Y].filter(Boolean).map(re=>re.ref.current);wj(Z,p)}}_.current=!1}),onBlur:je(e.onBlur,()=>k(!1))})})}),bj="RovingFocusGroupItem",Cj=f.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:s=!0,active:a=!1,tabStopId:i,children:l,...u}=e,d=qn(),m=i||d,p=Jz(bj,r),g=p.currentTabStopId===m,v=vj(r),{onFocusableItemAdd:y,onFocusableItemRemove:C,currentTabStopId:b}=p;return f.useEffect(()=>{if(s)return y(),()=>C()},[s,y,C]),n.jsx(M0.ItemSlot,{scope:r,id:m,focusable:s,active:a,children:n.jsx(tt.span,{tabIndex:g?0:-1,"data-orientation":p.orientation,...u,ref:t,onMouseDown:je(e.onMouseDown,w=>{s?p.onItemFocus(m):w.preventDefault()}),onFocus:je(e.onFocus,()=>p.onItemFocus(m)),onKeyDown:je(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){p.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const N=nW(w,p.orientation,p.dir);if(N!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let E=v().filter(T=>T.focusable).map(T=>T.ref.current);if(N==="last")E.reverse();else if(N==="prev"||N==="next"){N==="prev"&&E.reverse();const T=E.indexOf(w.currentTarget);E=p.loop?rW(E,T+1):E.slice(T+1)}setTimeout(()=>wj(E))}}),children:typeof l=="function"?l({isCurrentTabStop:g,hasTabStop:b!=null}):l})})});Cj.displayName=bj;var eW={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tW(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function nW(e,t,r){const s=tW(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return eW[s]}function wj(e,t=!1){const r=document.activeElement;for(const s of e)if(s===r||(s.focus({preventScroll:t}),document.activeElement!==r))return}function rW(e,t){return e.map((r,s)=>e[(t+s)%e.length])}var jj=yj,Sj=Cj,L0=["Enter"," "],sW=["ArrowDown","PageUp","Home"],kj=["ArrowUp","PageDown","End"],aW=[...sW,...kj],iW={ltr:[...L0,"ArrowRight"],rtl:[...L0,"ArrowLeft"]},oW={ltr:["ArrowLeft"],rtl:["ArrowRight"]},ju="Menu",[Kc,lW,cW]=E2(ju),[Ui,Nj]=Cr(ju,[cW,Ns,lh]),Su=Ns(),Ej=lh(),[Aj,Ua]=Ui(ju),[uW,ku]=Ui(ju),Pj=e=>{const{__scopeMenu:t,open:r=!1,children:s,dir:a,onOpenChange:i,modal:l=!0}=e,u=Su(t),[d,m]=f.useState(null),p=f.useRef(!1),g=Xr(i),v=oh(a);return f.useEffect(()=>{const y=()=>{p.current=!0,document.addEventListener("pointerdown",C,{capture:!0,once:!0}),document.addEventListener("pointermove",C,{capture:!0,once:!0})},C=()=>p.current=!1;return document.addEventListener("keydown",y,{capture:!0}),()=>{document.removeEventListener("keydown",y,{capture:!0}),document.removeEventListener("pointerdown",C,{capture:!0}),document.removeEventListener("pointermove",C,{capture:!0})}},[]),n.jsx(ul,{...u,children:n.jsx(Aj,{scope:t,open:r,onOpenChange:g,content:d,onContentChange:m,children:n.jsx(uW,{scope:t,onClose:f.useCallback(()=>g(!1),[g]),isUsingKeyboardRef:p,dir:v,modal:l,children:s})})})};Pj.displayName=ju;var dW="MenuAnchor",A2=f.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e,a=Su(r);return n.jsx(dl,{...a,...s,ref:t})});A2.displayName=dW;var P2="MenuPortal",[mW,Tj]=Ui(P2,{forceMount:void 0}),Ij=e=>{const{__scopeMenu:t,forceMount:r,children:s,container:a}=e,i=Ua(P2,t);return n.jsx(mW,{scope:t,forceMount:r,children:n.jsx(En,{present:r||i.open,children:n.jsx(Fi,{asChild:!0,container:a,children:s})})})};Ij.displayName=P2;var Dr="MenuContent",[fW,T2]=Ui(Dr),Dj=f.forwardRef((e,t)=>{const r=Tj(Dr,e.__scopeMenu),{forceMount:s=r.forceMount,...a}=e,i=Ua(Dr,e.__scopeMenu),l=ku(Dr,e.__scopeMenu);return n.jsx(Kc.Provider,{scope:e.__scopeMenu,children:n.jsx(En,{present:s||i.open,children:n.jsx(Kc.Slot,{scope:e.__scopeMenu,children:l.modal?n.jsx(hW,{...a,ref:t}):n.jsx(pW,{...a,ref:t})})})})}),hW=f.forwardRef((e,t)=>{const r=Ua(Dr,e.__scopeMenu),s=f.useRef(null),a=Ct(t,s);return f.useEffect(()=>{const i=s.current;if(i)return th(i)},[]),n.jsx(I2,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:je(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),pW=f.forwardRef((e,t)=>{const r=Ua(Dr,e.__scopeMenu);return n.jsx(I2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),gW=Si("MenuContent.ScrollLock"),I2=f.forwardRef((e,t)=>{const{__scopeMenu:r,loop:s=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:u,onEntryFocus:d,onEscapeKeyDown:m,onPointerDownOutside:p,onFocusOutside:g,onInteractOutside:v,onDismiss:y,disableOutsideScroll:C,...b}=e,w=Ua(Dr,r),N=ku(Dr,r),k=Su(r),E=Ej(r),T=lW(r),[_,I]=f.useState(null),F=f.useRef(null),z=Ct(t,F,w.onContentChange),H=f.useRef(0),J=f.useRef(""),Y=f.useRef(0),B=f.useRef(null),W=f.useRef("right"),U=f.useRef(0),Z=C?bu:f.Fragment,re=C?{as:gW,allowPinchZoom:!0}:void 0,me=V=>{const P=J.current+V,q=T().filter(se=>!se.disabled),Q=document.activeElement,ae=q.find(se=>se.ref.current===Q)?.textValue,X=q.map(se=>se.textValue),fe=AW(X,P,ae),he=q.find(se=>se.textValue===fe)?.ref.current;(function se(le){J.current=le,window.clearTimeout(H.current),le!==""&&(H.current=window.setTimeout(()=>se(""),1e3))})(P),he&&setTimeout(()=>he.focus())};f.useEffect(()=>()=>window.clearTimeout(H.current),[]),eh();const L=f.useCallback(V=>W.current===B.current?.side&&TW(V,B.current?.area),[]);return n.jsx(fW,{scope:r,searchRef:J,onItemEnter:f.useCallback(V=>{L(V)&&V.preventDefault()},[L]),onItemLeave:f.useCallback(V=>{L(V)||(F.current?.focus(),I(null))},[L]),onTriggerLeave:f.useCallback(V=>{L(V)&&V.preventDefault()},[L]),pointerGraceTimerRef:Y,onPointerGraceIntentChange:f.useCallback(V=>{B.current=V},[]),children:n.jsx(Z,{...re,children:n.jsx(yu,{asChild:!0,trapped:a,onMountAutoFocus:je(i,V=>{V.preventDefault(),F.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:n.jsx(Ri,{asChild:!0,disableOutsidePointerEvents:u,onEscapeKeyDown:m,onPointerDownOutside:p,onFocusOutside:g,onInteractOutside:v,onDismiss:y,children:n.jsx(jj,{asChild:!0,...E,dir:N.dir,orientation:"vertical",loop:s,currentTabStopId:_,onCurrentTabStopIdChange:I,onEntryFocus:je(d,V=>{N.isUsingKeyboardRef.current||V.preventDefault()}),preventScrollOnEntryFocus:!0,children:n.jsx(fu,{role:"menu","aria-orientation":"vertical","data-state":Yj(w.open),"data-radix-menu-content":"",dir:N.dir,...k,...b,ref:z,style:{outline:"none",...b.style},onKeyDown:je(b.onKeyDown,V=>{const q=V.target.closest("[data-radix-menu-content]")===V.currentTarget,Q=V.ctrlKey||V.altKey||V.metaKey,ae=V.key.length===1;q&&(V.key==="Tab"&&V.preventDefault(),!Q&&ae&&me(V.key));const X=F.current;if(V.target!==X||!aW.includes(V.key))return;V.preventDefault();const he=T().filter(se=>!se.disabled).map(se=>se.ref.current);kj.includes(V.key)&&he.reverse(),NW(he)}),onBlur:je(e.onBlur,V=>{V.currentTarget.contains(V.target)||(window.clearTimeout(H.current),J.current="")}),onPointerMove:je(e.onPointerMove,Gc(V=>{const P=V.target,q=U.current!==V.clientX;if(V.currentTarget.contains(P)&&q){const Q=V.clientX>U.current?"right":"left";W.current=Q,U.current=V.clientX}}))})})})})})})});Dj.displayName=Dr;var xW="MenuGroup",D2=f.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e;return n.jsx(tt.div,{role:"group",...s,ref:t})});D2.displayName=xW;var vW="MenuLabel",_j=f.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e;return n.jsx(tt.div,{...s,ref:t})});_j.displayName=vW;var of="MenuItem",y9="menu.itemSelect",ch=f.forwardRef((e,t)=>{const{disabled:r=!1,onSelect:s,...a}=e,i=f.useRef(null),l=ku(of,e.__scopeMenu),u=T2(of,e.__scopeMenu),d=Ct(t,i),m=f.useRef(!1),p=()=>{const g=i.current;if(!r&&g){const v=new CustomEvent(y9,{bubbles:!0,cancelable:!0});g.addEventListener(y9,y=>s?.(y),{once:!0}),Vw(g,v),v.defaultPrevented?m.current=!1:l.onClose()}};return n.jsx(Mj,{...a,ref:d,disabled:r,onClick:je(e.onClick,p),onPointerDown:g=>{e.onPointerDown?.(g),m.current=!0},onPointerUp:je(e.onPointerUp,g=>{m.current||g.currentTarget?.click()}),onKeyDown:je(e.onKeyDown,g=>{const v=u.searchRef.current!=="";r||v&&g.key===" "||L0.includes(g.key)&&(g.currentTarget.click(),g.preventDefault())})})});ch.displayName=of;var Mj=f.forwardRef((e,t)=>{const{__scopeMenu:r,disabled:s=!1,textValue:a,...i}=e,l=T2(of,r),u=Ej(r),d=f.useRef(null),m=Ct(t,d),[p,g]=f.useState(!1),[v,y]=f.useState("");return f.useEffect(()=>{const C=d.current;C&&y((C.textContent??"").trim())},[i.children]),n.jsx(Kc.ItemSlot,{scope:r,disabled:s,textValue:a??v,children:n.jsx(Sj,{asChild:!0,...u,focusable:!s,children:n.jsx(tt.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...i,ref:m,onPointerMove:je(e.onPointerMove,Gc(C=>{s?l.onItemLeave(C):(l.onItemEnter(C),C.defaultPrevented||C.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:je(e.onPointerLeave,Gc(C=>l.onItemLeave(C))),onFocus:je(e.onFocus,()=>g(!0)),onBlur:je(e.onBlur,()=>g(!1))})})})}),yW="MenuCheckboxItem",Lj=f.forwardRef((e,t)=>{const{checked:r=!1,onCheckedChange:s,...a}=e;return n.jsx(Uj,{scope:e.__scopeMenu,checked:r,children:n.jsx(ch,{role:"menuitemcheckbox","aria-checked":lf(r)?"mixed":r,...a,ref:t,"data-state":L2(r),onSelect:je(a.onSelect,()=>s?.(lf(r)?!0:!r),{checkForDefaultPrevented:!1})})})});Lj.displayName=yW;var Rj="MenuRadioGroup",[bW,CW]=Ui(Rj,{value:void 0,onValueChange:()=>{}}),Oj=f.forwardRef((e,t)=>{const{value:r,onValueChange:s,...a}=e,i=Xr(s);return n.jsx(bW,{scope:e.__scopeMenu,value:r,onValueChange:i,children:n.jsx(D2,{...a,ref:t})})});Oj.displayName=Rj;var Fj="MenuRadioItem",Bj=f.forwardRef((e,t)=>{const{value:r,...s}=e,a=CW(Fj,e.__scopeMenu),i=r===a.value;return n.jsx(Uj,{scope:e.__scopeMenu,checked:i,children:n.jsx(ch,{role:"menuitemradio","aria-checked":i,...s,ref:t,"data-state":L2(i),onSelect:je(s.onSelect,()=>a.onValueChange?.(r),{checkForDefaultPrevented:!1})})})});Bj.displayName=Fj;var _2="MenuItemIndicator",[Uj,wW]=Ui(_2,{checked:!1}),Vj=f.forwardRef((e,t)=>{const{__scopeMenu:r,forceMount:s,...a}=e,i=wW(_2,r);return n.jsx(En,{present:s||lf(i.checked)||i.checked===!0,children:n.jsx(tt.span,{...a,ref:t,"data-state":L2(i.checked)})})});Vj.displayName=_2;var jW="MenuSeparator",$j=f.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e;return n.jsx(tt.div,{role:"separator","aria-orientation":"horizontal",...s,ref:t})});$j.displayName=jW;var SW="MenuArrow",Hj=f.forwardRef((e,t)=>{const{__scopeMenu:r,...s}=e,a=Su(r);return n.jsx(hu,{...a,...s,ref:t})});Hj.displayName=SW;var M2="MenuSub",[kW,zj]=Ui(M2),Wj=e=>{const{__scopeMenu:t,children:r,open:s=!1,onOpenChange:a}=e,i=Ua(M2,t),l=Su(t),[u,d]=f.useState(null),[m,p]=f.useState(null),g=Xr(a);return f.useEffect(()=>(i.open===!1&&g(!1),()=>g(!1)),[i.open,g]),n.jsx(ul,{...l,children:n.jsx(Aj,{scope:t,open:s,onOpenChange:g,content:m,onContentChange:p,children:n.jsx(kW,{scope:t,contentId:qn(),triggerId:qn(),trigger:u,onTriggerChange:d,children:r})})})};Wj.displayName=M2;var xc="MenuSubTrigger",Kj=f.forwardRef((e,t)=>{const r=Ua(xc,e.__scopeMenu),s=ku(xc,e.__scopeMenu),a=zj(xc,e.__scopeMenu),i=T2(xc,e.__scopeMenu),l=f.useRef(null),{pointerGraceTimerRef:u,onPointerGraceIntentChange:d}=i,m={__scopeMenu:e.__scopeMenu},p=f.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return f.useEffect(()=>p,[p]),f.useEffect(()=>{const g=u.current;return()=>{window.clearTimeout(g),d(null)}},[u,d]),n.jsx(A2,{asChild:!0,...m,children:n.jsx(Mj,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":a.contentId,"data-state":Yj(r.open),...e,ref:Kf(t,a.onTriggerChange),onClick:g=>{e.onClick?.(g),!(e.disabled||g.defaultPrevented)&&(g.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:je(e.onPointerMove,Gc(g=>{i.onItemEnter(g),!g.defaultPrevented&&!e.disabled&&!r.open&&!l.current&&(i.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{r.onOpenChange(!0),p()},100))})),onPointerLeave:je(e.onPointerLeave,Gc(g=>{p();const v=r.content?.getBoundingClientRect();if(v){const y=r.content?.dataset.side,C=y==="right",b=C?-5:5,w=v[C?"left":"right"],N=v[C?"right":"left"];i.onPointerGraceIntentChange({area:[{x:g.clientX+b,y:g.clientY},{x:w,y:v.top},{x:N,y:v.top},{x:N,y:v.bottom},{x:w,y:v.bottom}],side:y}),window.clearTimeout(u.current),u.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(g),g.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:je(e.onKeyDown,g=>{const v=i.searchRef.current!=="";e.disabled||v&&g.key===" "||iW[s.dir].includes(g.key)&&(r.onOpenChange(!0),r.content?.focus(),g.preventDefault())})})})});Kj.displayName=xc;var Gj="MenuSubContent",qj=f.forwardRef((e,t)=>{const r=Tj(Dr,e.__scopeMenu),{forceMount:s=r.forceMount,...a}=e,i=Ua(Dr,e.__scopeMenu),l=ku(Dr,e.__scopeMenu),u=zj(Gj,e.__scopeMenu),d=f.useRef(null),m=Ct(t,d);return n.jsx(Kc.Provider,{scope:e.__scopeMenu,children:n.jsx(En,{present:s||i.open,children:n.jsx(Kc.Slot,{scope:e.__scopeMenu,children:n.jsx(I2,{id:u.contentId,"aria-labelledby":u.triggerId,...a,ref:m,align:"start",side:l.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:p=>{l.isUsingKeyboardRef.current&&d.current?.focus(),p.preventDefault()},onCloseAutoFocus:p=>p.preventDefault(),onFocusOutside:je(e.onFocusOutside,p=>{p.target!==u.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:je(e.onEscapeKeyDown,p=>{l.onClose(),p.preventDefault()}),onKeyDown:je(e.onKeyDown,p=>{const g=p.currentTarget.contains(p.target),v=oW[l.dir].includes(p.key);g&&v&&(i.onOpenChange(!1),u.trigger?.focus(),p.preventDefault())})})})})})});qj.displayName=Gj;function Yj(e){return e?"open":"closed"}function lf(e){return e==="indeterminate"}function L2(e){return lf(e)?"indeterminate":e?"checked":"unchecked"}function NW(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}function EW(e,t){return e.map((r,s)=>e[(t+s)%e.length])}function AW(e,t,r){const a=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let l=EW(e,Math.max(i,0));a.length===1&&(l=l.filter(m=>m!==r));const d=l.find(m=>m.toLowerCase().startsWith(a.toLowerCase()));return d!==r?d:void 0}function PW(e,t){const{x:r,y:s}=e;let a=!1;for(let i=0,l=t.length-1;is!=v>s&&r<(g-m)*(s-p)/(v-p)+m&&(a=!a)}return a}function TW(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return PW(r,t)}function Gc(e){return t=>t.pointerType==="mouse"?e(t):void 0}var IW=Pj,DW=A2,_W=Ij,MW=Dj,LW=D2,RW=_j,OW=ch,FW=Lj,BW=Oj,UW=Bj,VW=Vj,$W=$j,HW=Hj,zW=Wj,WW=Kj,KW=qj,uh="DropdownMenu",[GW]=Cr(uh,[Nj]),Bn=Nj(),[qW,Zj]=GW(uh),Qj=e=>{const{__scopeDropdownMenu:t,children:r,dir:s,open:a,defaultOpen:i,onOpenChange:l,modal:u=!0}=e,d=Bn(t),m=f.useRef(null),[p,g]=Mr({prop:a,defaultProp:i??!1,onChange:l,caller:uh});return n.jsx(qW,{scope:t,triggerId:qn(),triggerRef:m,contentId:qn(),open:p,onOpenChange:g,onOpenToggle:f.useCallback(()=>g(v=>!v),[g]),modal:u,children:n.jsx(IW,{...d,open:p,onOpenChange:g,dir:s,modal:u,children:r})})};Qj.displayName=uh;var Jj="DropdownMenuTrigger",Xj=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,disabled:s=!1,...a}=e,i=Zj(Jj,r),l=Bn(r);return n.jsx(DW,{asChild:!0,...l,children:n.jsx(tt.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":s?"":void 0,disabled:s,...a,ref:Kf(t,i.triggerRef),onPointerDown:je(e.onPointerDown,u=>{!s&&u.button===0&&u.ctrlKey===!1&&(i.onOpenToggle(),i.open||u.preventDefault())}),onKeyDown:je(e.onKeyDown,u=>{s||(["Enter"," "].includes(u.key)&&i.onOpenToggle(),u.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(u.key)&&u.preventDefault())})})})});Xj.displayName=Jj;var YW="DropdownMenuPortal",eS=e=>{const{__scopeDropdownMenu:t,...r}=e,s=Bn(t);return n.jsx(_W,{...s,...r})};eS.displayName=YW;var tS="DropdownMenuContent",nS=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=Zj(tS,r),i=Bn(r),l=f.useRef(!1);return n.jsx(MW,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...s,ref:t,onCloseAutoFocus:je(e.onCloseAutoFocus,u=>{l.current||a.triggerRef.current?.focus(),l.current=!1,u.preventDefault()}),onInteractOutside:je(e.onInteractOutside,u=>{const d=u.detail.originalEvent,m=d.button===0&&d.ctrlKey===!0,p=d.button===2||m;(!a.modal||p)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});nS.displayName=tS;var ZW="DropdownMenuGroup",rS=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=Bn(r);return n.jsx(LW,{...a,...s,ref:t})});rS.displayName=ZW;var QW="DropdownMenuLabel",JW=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=Bn(r);return n.jsx(RW,{...a,...s,ref:t})});JW.displayName=QW;var XW="DropdownMenuItem",sS=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=Bn(r);return n.jsx(OW,{...a,...s,ref:t})});sS.displayName=XW;var eK="DropdownMenuCheckboxItem",aS=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=Bn(r);return n.jsx(FW,{...a,...s,ref:t})});aS.displayName=eK;var tK="DropdownMenuRadioGroup",iS=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=Bn(r);return n.jsx(BW,{...a,...s,ref:t})});iS.displayName=tK;var nK="DropdownMenuRadioItem",oS=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=Bn(r);return n.jsx(UW,{...a,...s,ref:t})});oS.displayName=nK;var rK="DropdownMenuItemIndicator",lS=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=Bn(r);return n.jsx(VW,{...a,...s,ref:t})});lS.displayName=rK;var sK="DropdownMenuSeparator",cS=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=Bn(r);return n.jsx($W,{...a,...s,ref:t})});cS.displayName=sK;var aK="DropdownMenuArrow",iK=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=Bn(r);return n.jsx(HW,{...a,...s,ref:t})});iK.displayName=aK;var oK=e=>{const{__scopeDropdownMenu:t,children:r,open:s,onOpenChange:a,defaultOpen:i}=e,l=Bn(t),[u,d]=Mr({prop:s,defaultProp:i??!1,onChange:a,caller:"DropdownMenuSub"});return n.jsx(zW,{...l,open:u,onOpenChange:d,children:r})},lK="DropdownMenuSubTrigger",uS=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=Bn(r);return n.jsx(WW,{...a,...s,ref:t})});uS.displayName=lK;var cK="DropdownMenuSubContent",dS=f.forwardRef((e,t)=>{const{__scopeDropdownMenu:r,...s}=e,a=Bn(r);return n.jsx(KW,{...a,...s,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});dS.displayName=cK;var mS=Qj,fS=Xj,R2=eS,hS=nS,uK=rS,pS=sS,dK=aS,mK=iS,fK=oS,gS=lS,xS=cS,hK=oK,pK=uS,gK=dS;function Pe(e){const{children:t,asChild:r,trigger:s,side:a,sideOffset:i,align:l,alignOffset:u,collisionPadding:d,open:m,disabled:p,onOpenChange:g,onCloseAutoFocus:v,onDismiss:y,contentClassName:C,modal:b}=e;return p?n.jsx(n.Fragment,{children:s}):n.jsxs(mS,{open:m,onOpenChange:g,dir:"ltr",modal:b,children:[n.jsx(fS,{asChild:r,children:s}),n.jsx(Fa.Consumer,{children:w=>n.jsx(R2,{container:w,children:n.jsx(hS,{className:D(vS,"state-open:animate-scale-in state-closed:animate-scale-out",C),side:a,sideOffset:i,align:l,alignOffset:u,collisionPadding:d??12,onCloseAutoFocus:v,onPointerDownOutside:y,children:t})})})]})}Pe.defaultProps={sideOffset:10};Pe.Group=xK;Pe.Item=vK;Pe.Link=bK;Pe.RadioGroup=mK;Pe.RadioItem=yK;Pe.Separator=CK;const vS="dropdown bg-bg-base rounded-md py-1 z-50",Vi="block px-4 py-2",gl="cursor-pointer hover:enabled:bg-bg-menu-item-hover focus:outline-none focus:bg-bg-menu-item-hover";function xK(e){const{className:t,...r}=e;return n.jsx(uK,{className:D(t,Vi),...r})}function vK(e){const{className:t,disabled:r,intent:s,stopPropagation:a,hidden:i,...l}=e;return i===!0?null:n.jsx(pS,{className:D(t,Vi,gl,{"text-text-danger":s==="danger","text-text-disabled hover:cursor-default":r}),disabled:r,onClick:a?u=>u.stopPropagation():void 0,...l})}function yK(e){const{className:t,disabled:r,hidden:s,children:a,icon:i,...l}=e;if(s===!0)return null;const u=n.jsx(gS,{className:"icon-parent",children:n.jsx(nn,{className:D("relative",{"-ml-6":!i})})});return n.jsxs(fK,{className:D(t,Vi,gl,"relative flex items-center",{"pl-9":!i,"gap-4 icon-parent":i,"text-text-disabled bg-bg-base cursor-default":r}),disabled:r,...l,children:[i||u,a,i&&n.jsx("div",{className:"ml-auto inline-flex",children:u})]})}function bK(e){const{className:t,children:r,disabled:s,intent:a,href:i,hidden:l,sameTab:u=!1,onNavigate:d,...m}=e,[,p]=ft(),g=f.useRef(null);if(l===!0)return null;const v=du(i),y=v&&!u?{target:"_blank",rel:"noopener noreferer"}:{},C=w=>{if(s){w.preventDefault(),w.stopPropagation();return}if(d?.(),!v){if(w.preventDefault(),w.metaKey||w.ctrlKey){window.open(i,"_blank");return}p(i);return}w.stopPropagation()},b=()=>{if(d?.(),!v){p(i);return}globalThis.location.href=i};return n.jsx(pS,{className:D("relative",t,Vi,gl,{"text-text-danger":a==="danger","text-text-disabled bg-bg-base cursor-default":s}),disabled:s,onSelect:b,...m,children:n.jsx("a",{ref:g,className:D("stretched-link",{"pointer-events-none":s}),href:s?void 0:i,"aria-disabled":s||void 0,tabIndex:s?-1:void 0,onClick:C,...y,children:r})})}function CK(e){const{className:t,hidden:r,noMargin:s,...a}=e;return r===!0?null:n.jsx(xS,{className:D(s?"my-0":"my-1","border-b",t),...a})}function wK(e){const{className:t,children:r,trigger:s,hidden:a,...i}=e;return a===!0?null:n.jsxs(hK,{children:[n.jsxs(pK,{className:D(t,Vi,gl,"flex items-center gap-4 icon-parent"),disabled:i.disabled,children:[s,n.jsx(js,{className:"ml-auto top-0"})]}),n.jsx(R2,{children:n.jsx(gK,{className:vS,sideOffset:2,alignOffset:-5,children:r})})]})}Pe.SubMenu=wK;const R0="showHelpTooltip";function vc({setSwitchingTailnets:e}){const{data:t,tailnets:r,hasAdditionalTailnets:s,currentTailnetID:a,switchTailnet:i}=ot(),[l]=ft(),{data:u}=Rt(),d=et(),{data:m}=vt(),p=hl(),g=Yt(),[v,y]=f.useState(!1),[C,b]=rl();f.useEffect(()=>{C.get(R0)==="true"&&(y(!0),b(E=>{const T=new URLSearchParams(E);return T.delete(R0),T},{replace:!0}))},[C,b]);const w=f.useCallback(()=>{O(R.HeaderLogoClicked,{eventProperties:{type:"navigation",productArea:"header"}})},[]);if(!t)return null;function N(E){O(R.SwitchTailnet,{eventProperties:{type:"tailnet_switch",productArea:"navigation"}}),e(!0),i(E).then(()=>{e(!1),globalThis.sessionStorage.clear(),globalThis.localStorage.clear(),jw(),globalThis.location.href=gr?vr("/"):"/"}).catch(()=>{e(!1),d.show({variant:"danger",message:"Failed to switch tailnet."})})}const k=(E,T,_)=>(_===E?u?.displayName:T)??T??"";return n.jsxs("header",{className:"flex justify-between items-center px-2 md:px-0 gap-4",role:"banner","data-testid":"banner",children:[n.jsx("div",{className:"flex items-center min-w-0 gap-3",children:g?n.jsxs("div",{className:"flex items-center min-w-0 gap-3",children:[n.jsx(Zo,{className:"shrink-0","aria-hidden":"true"}),n.jsx("div",{className:"text-xl font-semibold truncate",children:u?.displayName})]}):n.jsxs(n.Fragment,{children:[n.jsxs(ze,{href:"/admin",className:"flex items-center min-w-0 gap-3",onClick:w,"aria-label":`${u?.displayName}’s admin console home`,children:[n.jsx(Zo,{className:"shrink-0","aria-hidden":"true"}),n.jsxs("div",{className:"text-xl font-semibold truncate",children:[u?.displayName,u?.isInsider&&n.jsx(We,{variant:"status",className:"mx-2 uppercase tracking-wide text-text-muted border rounded-full py-1 px-2 !bg-bg-base !border-border-interactive",children:"INSIDER"})]})]}),n.jsx(Kz,{})]})}),n.jsxs("nav",{className:"flex gap-3 items-center","aria-label":"External links",children:[n.jsxs(C2,{open:v,onOpenChange:y,children:[n.jsxs(Pe,{asChild:!0,onOpenChange:E=>{E&&(y(!1),O(R.HeaderHelpClicked,{eventProperties:{type:"navigation",productArea:"header"}}))},trigger:n.jsx(bz,{asChild:!0,children:n.jsx("button",{"aria-label":"Help menu",className:"text-text-muted hover:bg-gray-200 dark:hover:bg-gray-800 rounded-full w-8 h-8 flex items-center justify-center",title:"Help and resources",children:n.jsx(Kx,{size:22})})}),side:"bottom",align:"end",children:[n.jsx(Pe.Link,{href:"https://tailscale.com/docs/",onClickCapture:()=>O(R.HeaderHelpDocsLinkClicked,{eventProperties:{type:"navigation",productArea:"header"}}),children:"Docs"}),n.jsx(Pe.Link,{href:"https://tailscale.com/docs/use-cases",onClickCapture:()=>O(R.HeaderHelpUseCaseGuidesLinkClicked,{eventProperties:{type:"navigation",productArea:"header"}}),children:"Use case guides"}),n.jsx(Pe.Link,{href:"https://tailscale.com/contact/support",onClickCapture:()=>O(R.HeaderHelpSupportLinkClicked,{eventProperties:{type:"navigation",productArea:"header"}}),children:"Support"}),n.jsx(Pe.Link,{href:"https://tailscale.com/download",onClickCapture:()=>O(R.HeaderHelpDownloadLinkClicked,{eventProperties:{type:"navigation",productArea:"header"}}),children:"Download"}),n.jsx(Pe.Link,{href:jK(u?.stableTailnetID,t.id,l),onClickCapture:()=>O(R.HeaderHelpGiveFeedbackLinkClicked,{eventProperties:{type:"navigation",productArea:"header"}}),children:"Give feedback"})]}),n.jsx(Fa.Consumer,{children:E=>n.jsx(w2,{container:E,children:n.jsxs(j2,{side:"bottom",align:"end",sideOffset:10,collisionPadding:12,className:"bg-bg-base shadow-popover rounded-md p-4 max-w-[280px] z-50 origin-radix-popover state-open:animate-scale-in state-closed:animate-scale-out",onOpenAutoFocus:T=>T.preventDefault(),children:[n.jsx("p",{children:"You can access docs and guides anytime from this help menu."}),n.jsx(ue,{onClick:()=>y(!1),className:"w-full mt-3",children:"Got it"}),n.jsx(rj,{className:"fill-bg-base"})]})})})]}),n.jsx("div",{className:"heart-wrapper",children:n.jsxs(Pe,{asChild:!0,onOpenChange:E=>{E&&O(R.UserMenuClicked,{eventProperties:{type:"navigation",productArea:"header"}})},trigger:n.jsxs("button",{className:"relative rounded-full","aria-label":"User menu…",children:[m.freePersonalPro&&n.jsx("div",{className:"heart"}),n.jsx(Lr,{sizeClassName:"w-7 h-7",user:t})]}),side:"bottom",align:"end",children:[n.jsxs(Pe.Group,{children:[n.jsx("div",{children:n.jsx("strong",{children:t.displayName})}),n.jsx("div",{className:"opacity-75",children:t.loginName})]}),n.jsx(Pe.Separator,{hidden:!m.freePersonalPro}),n.jsx(Pe.Link,{hidden:!m.freePersonalPro,href:"https://tailscale.com/thanks",className:"text-red-500",children:"❤️ Thank you"}),n.jsx(Pe.Separator,{hidden:!r||Object.keys(r).length<2}),r&&r.length>1&&r.map(({tailnetID:E,tailnetName:T})=>n.jsx(Pe.Item,{onClickCapture:()=>a!==E&&N(E),children:n.jsxs("div",{className:"flex items-center justify-between max-w-sm",children:[n.jsx("span",{className:"break-all",title:k(E,T,a),"aria-label":k(E,T,a),children:k(E,T,a)}),a===E&&n.jsx(nn,{size:"1.5em",strokeWidth:"2.2",className:"self-center ml-2"})]})},`tailnet-${E}`)),n.jsx(Pe.Separator,{hidden:!s}),n.jsx(Pe.Link,{hidden:!s,href:vr("/switch-tailnet",{returnTo:"/admin"}),sameTab:!0,children:"Join additional tailnets"}),n.jsxs(n.Fragment,{children:[n.jsx(Pe.Separator,{}),n.jsx(Pe.SubMenu,{trigger:"Appearance",children:n.jsxs(Pe.RadioGroup,{value:p.requestedTheme,onValueChange:E=>p.setTheme(E),children:[n.jsx(Pe.RadioItem,{value:"system",icon:n.jsx(Zx,{}),children:"Use system setting"}),n.jsx(Pe.RadioItem,{value:"light",icon:n.jsx(pw,{}),children:"Light"}),n.jsx(Pe.RadioItem,{value:"dark",icon:n.jsx(hw,{}),children:"Dark"})]})})]}),n.jsx(Pe.Separator,{}),n.jsx(Pe.Link,{href:vr(`/logout?next_url=${encodeURIComponent(gr?globalThis.location.origin+"/admin/":"/welcome")}`),sameTab:!0,onNavigate:()=>O(R.LogoutMenuItemClicked,{eventProperties:{type:"navigation",productArea:"header"}}),children:"Log out"})]})})]})]})}function jK(e,t,r=""){const s=new URL("https://tailscale.typeform.com/to/iZlFugDi"),a=["machines","apps","services","users","acls","logs","dns","settings"],i=new Set(r.split("/").filter(Boolean)),u=a.find(d=>i.has(d))??"console";return e&&s.searchParams.set("n",e),t&&s.searchParams.set("x",t),s.searchParams.set("p",u),s.toString()}function ts(e){const{className:t,size:r,...s}=e;return n.jsx("div",{className:D("spinner inline-block rounded-full align-middle",{"border-2 w-4 h-4":r==="sm","border-4 w-8 h-8":r==="md"},t),...s})}ts.defaultProps={size:"md"};function De(e){const{error:t,loadingMessage:r,className:s}=e;return n.jsx("div",{className:D("w-full p-3 flex items-center justify-center",s),children:t?n.jsxs("div",{className:"flex items-center justify-center",children:[n.jsx(Da,{className:"mr-3 text-red-400",size:"1.25rem"}),n.jsxs("div",{children:[n.jsx("strong",{children:"Error:"})," ",t.message]})]}):n.jsxs("div",{className:"flex items-center justify-center text-text-muted",children:[n.jsx(ts,{className:"text-gray-400",size:"sm"}),r&&n.jsx("span",{className:"ml-3",children:r})]})})}function Se(e){const{access:t}=qt(e.permission);return t===void 0?n.jsx(De,{}):t.type===""?e.noAccess?n.jsx(e.noAccess,{}):null:t.type==="readonly"?n.jsx(e.readWrite,{readonly:!0}):t.type==="write"?n.jsx(e.readWrite,{readonly:!1}):t}function b9(){const{data:e}=vt();return e.forceMachineAuthStuckOn?n.jsx("div",{className:"py-3 bg-orange-50 dark:bg-orange-400/10",children:n.jsx("div",{className:"container mx-auto sidenav:max-w-content-wide sidenav:mx-auto sidenav:px-6 lg:sidenav:px-10",children:n.jsxs("p",{className:"text-center",children:[n.jsx("strong",{children:"Adding new users or machines is disabled for your tailnet."})," ","Please"," ",n.jsx(Zn,{type:"billing",className:"link-underline",children:"contact support"})," ","to have this restriction lifted."]})})}):null}var dh="Dialog",[yS]=Cr(dh),[SK,as]=yS(dh),bS=e=>{const{__scopeDialog:t,children:r,open:s,defaultOpen:a,onOpenChange:i,modal:l=!0}=e,u=f.useRef(null),d=f.useRef(null),[m,p]=Mr({prop:s,defaultProp:a??!1,onChange:i,caller:dh});return n.jsx(SK,{scope:t,triggerRef:u,contentRef:d,contentId:qn(),titleId:qn(),descriptionId:qn(),open:m,onOpenChange:p,onOpenToggle:f.useCallback(()=>p(g=>!g),[p]),modal:l,children:r})};bS.displayName=dh;var CS="DialogTrigger",wS=f.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,a=as(CS,r),i=Ct(t,a.triggerRef);return n.jsx(tt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":B2(a.open),...s,ref:i,onClick:je(e.onClick,a.onOpenToggle)})});wS.displayName=CS;var O2="DialogPortal",[kK,jS]=yS(O2,{forceMount:void 0}),SS=e=>{const{__scopeDialog:t,forceMount:r,children:s,container:a}=e,i=as(O2,t);return n.jsx(kK,{scope:t,forceMount:r,children:f.Children.map(s,l=>n.jsx(En,{present:r||i.open,children:n.jsx(Fi,{asChild:!0,container:a,children:l})}))})};SS.displayName=O2;var cf="DialogOverlay",kS=f.forwardRef((e,t)=>{const r=jS(cf,e.__scopeDialog),{forceMount:s=r.forceMount,...a}=e,i=as(cf,e.__scopeDialog);return i.modal?n.jsx(En,{present:s||i.open,children:n.jsx(EK,{...a,ref:t})}):null});kS.displayName=cf;var NK=Si("DialogOverlay.RemoveScroll"),EK=f.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,a=as(cf,r);return n.jsx(bu,{as:NK,allowPinchZoom:!0,shards:[a.contentRef],children:n.jsx(tt.div,{"data-state":B2(a.open),...s,ref:t,style:{pointerEvents:"auto",...s.style}})})}),Ei="DialogContent",NS=f.forwardRef((e,t)=>{const r=jS(Ei,e.__scopeDialog),{forceMount:s=r.forceMount,...a}=e,i=as(Ei,e.__scopeDialog);return n.jsx(En,{present:s||i.open,children:i.modal?n.jsx(AK,{...a,ref:t}):n.jsx(PK,{...a,ref:t})})});NS.displayName=Ei;var AK=f.forwardRef((e,t)=>{const r=as(Ei,e.__scopeDialog),s=f.useRef(null),a=Ct(t,r.contentRef,s);return f.useEffect(()=>{const i=s.current;if(i)return th(i)},[]),n.jsx(ES,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:je(e.onCloseAutoFocus,i=>{i.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:je(e.onPointerDownOutside,i=>{const l=i.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&i.preventDefault()}),onFocusOutside:je(e.onFocusOutside,i=>i.preventDefault())})}),PK=f.forwardRef((e,t)=>{const r=as(Ei,e.__scopeDialog),s=f.useRef(!1),a=f.useRef(!1);return n.jsx(ES,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{e.onCloseAutoFocus?.(i),i.defaultPrevented||(s.current||r.triggerRef.current?.focus(),i.preventDefault()),s.current=!1,a.current=!1},onInteractOutside:i=>{e.onInteractOutside?.(i),i.defaultPrevented||(s.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=i.target;r.triggerRef.current?.contains(l)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),ES=f.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:i,...l}=e,u=as(Ei,r),d=f.useRef(null),m=Ct(t,d);return eh(),n.jsxs(n.Fragment,{children:[n.jsx(yu,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:a,onUnmountAutoFocus:i,children:n.jsx(Ri,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":B2(u.open),...l,ref:m,onDismiss:()=>u.onOpenChange(!1)})}),n.jsxs(n.Fragment,{children:[n.jsx(IK,{titleId:u.titleId}),n.jsx(_K,{contentRef:d,descriptionId:u.descriptionId})]})]})}),F2="DialogTitle",AS=f.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,a=as(F2,r);return n.jsx(tt.h2,{id:a.titleId,...s,ref:t})});AS.displayName=F2;var PS="DialogDescription",TK=f.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,a=as(PS,r);return n.jsx(tt.p,{id:a.descriptionId,...s,ref:t})});TK.displayName=PS;var TS="DialogClose",IS=f.forwardRef((e,t)=>{const{__scopeDialog:r,...s}=e,a=as(TS,r);return n.jsx(tt.button,{type:"button",...s,ref:t,onClick:je(e.onClick,()=>a.onOpenChange(!1))})});IS.displayName=TS;function B2(e){return e?"open":"closed"}var DS="DialogTitleWarning",[oce,_S]=sV(DS,{contentName:Ei,titleName:F2,docsSlug:"dialog"}),IK=({titleId:e})=>{const t=_S(DS),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return f.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},DK="DialogDescriptionWarning",_K=({contentRef:e,descriptionId:t})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${_S(DK).contentName}}.`;return f.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(s))},[s,e,t]),null},MS=bS,MK=wS,LS=SS,RS=kS,OS=NS,LK=AS,FS=IS;function U2(e,t){const[r,s]=f.useState(()=>{const a=globalThis.localStorage.getItem(t);try{return a===null?e:JSON.parse(a)}catch{return console.warn("Could not parse sticky state",a),e}});return f.useEffect(()=>{const a=JSON.stringify(r);globalThis.localStorage.setItem(t,a),a!==void 0&&globalThis.sessionStorage.setItem(t,a)},[t,r]),[r,s]}function BS({className:e}){const{inSegment:t}=Xs({isSharedDomain:!1,isBusiness:!0});return n.jsx(pl,{experimentKey:"resource-hub-tab-improve-resource-hub-awareness",variants:{control:n.jsx(C9,{className:e}),variant1:n.jsx(C9,{className:e})},enabled:t,unenrolled:null})}const C9=function({className:t="absolute top-[0.55rem] right-[-0.55rem]"}){const[r,s]=U2(!1,"resource-hub-visited"),[a]=ft(),i=a.includes("/resource-hub");return ce.useEffect(()=>{i&&!r&&s(!0)},[i,r,s]),r?null:n.jsx(M7,{className:t})};function US({setSwitchingTailnets:e,onNavigate:t,onClose:r,showACLAwareness:s=!0}){const{data:a}=vt(),i=[{href:"/admin/machines",label:"Machines",icon:ol},...a.featureBorder0IntegrationOK&&a.featureBorder0MilestoneThree?[{href:"/admin/pam_connectors",label:"Connectors",icon:nw}]:[],{href:"/admin/apps",label:"Apps",icon:e2},{href:"/admin/services",label:"Services",icon:xw},{href:"/admin/users",label:"Users",icon:wi},{href:"/admin/acls",label:"Access controls",icon:mw},...a.auditLogs?[{href:"/admin/logs",label:"Logs",icon:$f}]:[],{href:"/admin/dns",label:"DNS",icon:Hf},{href:"/admin/settings",label:"Settings",icon:Xx}];return n.jsxs("nav",{className:"w-full h-full border-r bg-bg-app flex flex-col","aria-label":"Primary",children:[n.jsxs("div",{className:"p-2.5 border-b flex items-start gap-1",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(RK,{setSwitchingTailnets:e})}),r&&n.jsx("button",{"aria-label":"Close navigation menu",onClick:r,className:"lg:hidden shrink-0 text-text-muted hover:bg-gray-200 dark:hover:bg-gray-800 rounded-md w-8 h-8 flex items-center justify-center",children:n.jsx(Or,{size:20})})]}),n.jsx("div",{className:"relative flex-1 min-h-0",children:n.jsxs("div",{className:"h-full overflow-y-auto p-2.5 flex flex-col",children:[n.jsx("div",{className:"flex flex-col gap-0.5",children:i.map(l=>l.href==="/admin/acls"&&s?n.jsx(S2,{side:"right",align:"center",wrapperClassName:"relative flex [&>a]:flex-1",dotClassName:"absolute right-2 top-1/2 -translate-y-1/2",children:n.jsx(dg,{onNavigate:t,...l})},l.href):n.jsx(dg,{onNavigate:t,...l},l.href))}),n.jsxs("div",{className:"mt-auto relative flex [&>a]:flex-1",children:[n.jsx(dg,{href:"/admin/resource-hub",label:"Resource hub",icon:tw,onNavigate:t}),n.jsx(BS,{className:"absolute right-2 top-1/2 -translate-y-1/2"})]})]})}),n.jsxs("div",{className:"p-2.5 border-t flex items-center justify-between",children:[n.jsx(FK,{}),n.jsx(OK,{})]})]})}function dg({href:e,label:t,icon:r,onNavigate:s}){const[a]=ft(),i=a.startsWith(e);return n.jsxs(ze,{href:e,"aria-current":i?"page":void 0,onClick:s,className:i?"flex items-center gap-2 px-2 py-1.5 rounded-md bg-gray-200 dark:bg-gray-800 text-text-base font-medium":"flex items-center gap-2 px-2 py-1.5 rounded-md text-text-base hover:bg-gray-200 dark:hover:bg-gray-800",children:[n.jsx(r,{size:"1.125em",strokeWidth:i?"2.5":"2"}),t]})}function RK({setSwitchingTailnets:e}){const{tailnets:t,currentTailnetID:r,currentTailnet:s,switchTailnet:a}=ot(),{data:i}=Rt(),l=et(),u=f.useCallback(m=>{e(!0),a(m).then(()=>{globalThis.sessionStorage.clear(),globalThis.localStorage.clear(),jw(),globalThis.location.href=gr?vr("/"):"/"}).catch(()=>{e(!1),l.show({variant:"danger",message:"Failed to switch tailnet."})})},[e,a,l]),d=i?.displayName??s?.tailnetName??"Tailnet";return!t||t.length<2?n.jsxs("div",{className:"flex items-center gap-3.5 px-2 py-1.5",children:[n.jsx(Zo,{className:"shrink-0","aria-hidden":"true"}),n.jsx("span",{className:"font-semibold truncate",children:d})]}):n.jsx(Pe,{asChild:!0,modal:!1,side:"bottom",align:"start",sideOffset:4,collisionPadding:10,contentClassName:"origin-top min-w-[var(--radix-dropdown-menu-trigger-width)]",trigger:n.jsxs("button",{className:"flex items-center gap-3.5 px-2 py-1.5 rounded-md hover:bg-gray-200 dark:hover:bg-gray-800 w-full text-left",children:[n.jsx(Zo,{className:"shrink-0","aria-hidden":"true"}),n.jsx("span",{className:"font-semibold truncate flex-1",children:d}),n.jsx(TR,{size:"1em",className:"shrink-0 text-text-muted"})]}),children:t.map(({tailnetID:m,tailnetName:p})=>{const g=m===r;return n.jsx(Pe.Item,{onClickCapture:()=>!g&&u(m),children:n.jsxs("span",{className:"flex items-center gap-2",children:[g?n.jsx(nn,{size:"1em",className:"shrink-0"}):n.jsx("span",{className:"w-[1em] shrink-0"}),p]})},m)})})}function OK(){return n.jsxs(Pe,{asChild:!0,modal:!1,side:"top",align:"end",collisionPadding:10,trigger:n.jsx("button",{"aria-label":"Help menu",className:"text-text-muted hover:bg-gray-200 dark:hover:bg-gray-800 rounded-full w-8 h-8 flex items-center justify-center",title:"Help and resources",children:n.jsx(Kx,{size:20})}),children:[n.jsx(Pe.Link,{href:"https://tailscale.com/docs/",children:"Docs"}),n.jsx(Pe.Link,{href:"https://tailscale.com/docs/use-cases",children:"Use case guides"}),n.jsx(Pe.Link,{href:"https://tailscale.com/contact/support",children:"Support"}),n.jsx(Pe.Link,{href:"https://tailscale.com/download",children:"Download"})]})}function FK(){const{data:e}=ot(),t=hl();return e?n.jsxs(Pe,{asChild:!0,modal:!1,side:"top",align:"start",collisionPadding:10,trigger:n.jsx("button",{className:"hover:bg-gray-200 dark:hover:bg-gray-800 rounded-full w-8 h-8 flex items-center justify-center","aria-label":"User menu",children:n.jsx(Lr,{sizeClassName:"w-7 h-7",user:e})}),children:[n.jsxs(Pe.Group,{children:[n.jsx("div",{children:n.jsx("strong",{children:e.displayName})}),n.jsx("div",{className:"opacity-75",children:e.loginName})]}),n.jsx(Pe.Separator,{}),n.jsx(Pe.SubMenu,{trigger:"Appearance",children:n.jsxs(Pe.RadioGroup,{value:t.requestedTheme,onValueChange:r=>t.setTheme(r),children:[n.jsx(Pe.RadioItem,{value:"system",icon:n.jsx(Zx,{}),children:"Use system setting"}),n.jsx(Pe.RadioItem,{value:"light",icon:n.jsx(pw,{}),children:"Light"}),n.jsx(Pe.RadioItem,{value:"dark",icon:n.jsx(hw,{}),children:"Dark"})]})}),n.jsx(Pe.Separator,{}),n.jsx(Pe.Link,{href:vr(`/logout?next_url=${encodeURIComponent(gr?globalThis.location.origin+"/admin/":"/welcome")}`),sameTab:!0,children:"Log out"})]}):null}const VS="bg-gray-900 bg-opacity-[0.3] dark:bg-gray-1000 dark:bg-opacity-[0.7]",BK=D("fixed !overflow-y-auto inset-0 py-8 z-10",VS),UK=D("bg-bg-base dark:border rounded-lg absolute min-w-[19rem] w-[97%] shadow-dialog overflow-hidden","@container","transform-gpu"),VK={"top-left":"top-0 md:left-0 md:translate-x-0 sm:left-1/2 sm:-translate-x-1/2 mt-8 md:ml-8","top-center":"top-0 left-1/2 -translate-x-1/2 mt-8","top-right":"top-0 md:right-0 md:translate-x-0 sm:right-1/2 sm:translate-x-1/2 mt-8 md:mr-8","center-left":"top-1/2 md:left-0 md:translate-x-0 -translate-y-1/2 sm:left-1/2 sm:-translate-x-1/2 md:ml-8","center-center":"top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2","center-right":"top-1/2 md:right-0 md:translate-x-0 -translate-y-1/2 sm:right-1/2 sm:translate-x-1/2 md:mr-8","bottom-left":"bottom-0 md:left-0 md:translate-x-0 sm:left-1/2 sm:-translate-x-1/2 mb-8 md:ml-8","bottom-center":"bottom-0 left-1/2 -translate-x-1/2 mb-8","bottom-right":"bottom-0 md:right-0 md:translate-x-0 sm:right-1/2 sm:translate-x-1/2 mb-8 md:mr-8"};function Re(e){const{open:t,defaultOpen:r,onOpenChange:s,trigger:a,title:i,titleSuffixDecoration:l,children:u,restoreFocus:d=!0,onPointerDownOutside:m=N=>N.preventDefault(),onEscapeKeyDown:p,size:g="regular",position:v="top-center",hideCloseIcon:y=!1,forcedCloseIconDarkMode:C=!1,noPadding:b=!1,ariaLabelledBy:w}=e;return n.jsxs(MS,{open:t,defaultOpen:r,onOpenChange:s,children:[a&&n.jsx(MK,{asChild:!0,children:a}),n.jsx(Fa.Consumer,{children:N=>n.jsx(LS,{container:N,children:n.jsx(RS,{className:BK,children:n.jsx(OS,{"aria-describedby":void 0,"aria-label":w?void 0:i,"aria-labelledby":w,className:D(VK[v],UK,{"max-w-lg":g==="regular","max-w-xl":g==="large","max-w-2xl":g==="xlarge","max-w-3xl":g==="2xlarge"},{"p-4 md:p-6":!b}),onCloseAutoFocus:k=>{d===!1&&(k.preventDefault(),document.body.style.pointerEvents="")},onPointerDownOutside:m,onEscapeKeyDown:p,children:n.jsxs(HK,{children:[n.jsx(LK,{children:i&&n.jsx("header",{className:"flex items-center justify-between space-x-4 mb-5 mr-8",children:n.jsxs("div",{className:"font-semibold text-lg flex items-center gap-2 min-w-0",children:[n.jsx("span",{className:"truncate",children:i}),l]})})}),u,!y&&n.jsx(FS,{asChild:!0,children:n.jsx(ue,{variant:"minimal",className:D("absolute top-2 right-2 px-2 py-2",{"text-white hover:bg-white/10 focus-visible:bg-white/10":C}),children:n.jsx(Or,{"aria-hidden":!0,size:"1.25em"})})})]})})})})})]})}Re.Form=$K;function $K(e){const{children:t,disabled:r=!1,destructive:s=!1,loading:a=!1,autoFocus:i="submit",cancelButton:l,submitButton:u,footerClassName:d,onSubmit:m}=e,p=!!(l||u),g=N=>{N.preventDefault(),m?.(N)},v=!!(l&&!a&&i==="cancel"),y=!!(u&&!a&&!r&&i==="submit"),C=s?"danger":"primary",b="min-w-[4.5rem]";let w=null;return l&&(w=l===!0?n.jsx(ue,{...mg,autoFocus:v,disabled:a,className:b}):typeof l=="string"?n.jsx(ue,{...mg,autoFocus:v,children:l,disabled:a,className:b}):n.jsx(ue,{...mg,autoFocus:v,disabled:a,...l,className:b}),PF(l)&&l.onClick!==void 0||(w=n.jsx(FS,{asChild:!0,children:w}))),n.jsxs("form",{onSubmit:g,children:[t,p&&n.jsxs("footer",{className:D("flex mt-10 justify-end space-x-4",d),children:[w,u&&n.jsx(n.Fragment,{children:u===!0?n.jsx(ue,{...fg,intent:C,autoFocus:y,disabled:a||r,loading:a,className:b}):typeof u=="string"?n.jsx(ue,{...fg,intent:C,children:u,autoFocus:y,disabled:a||r,loading:a,className:b}):n.jsx(ue,{...fg,intent:C,autoFocus:y,disabled:a||r,...u,loading:a,className:b})})]})]})}const mg={type:"button",intent:"base",sizeVariant:"medium",children:"Cancel"},fg={type:"submit",sizeVariant:"medium",children:"Submit"};class HK extends f.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,r){console.error("Uncaught Error in dialog",t,r),al(t)}render(){return this.state.hasError?n.jsx("div",{className:"font-semibold text-lg",children:"Something went wrong."}):this.props.children}}function zK({setSwitchingTailnets:e,children:t}){const[r,s]=f.useState(!1),[a]=ft(),i=J8("lg");return f.useEffect(()=>s(!1),[a]),f.useEffect(()=>{i&&s(!1)},[i]),n.jsxs("div",{className:"min-h-screen lg:pl-60",children:[n.jsx("div",{className:"hidden lg:block fixed top-0 left-0 w-60 h-screen",children:n.jsx(US,{setSwitchingTailnets:e,showACLAwareness:i})}),n.jsx(WK,{onMenuClick:()=>s(!0),showACLAwareness:!i}),n.jsx("div",{className:"min-w-0",children:t}),n.jsx(KK,{open:r,onOpenChange:s,setSwitchingTailnets:e})]})}function WK({onMenuClick:e,showACLAwareness:t}){const{data:r}=Rt(),{currentTailnet:s}=ot(),a=r?.displayName??s?.tailnetName??"Tailnet",i=n.jsx("button",{"aria-label":"Open navigation menu",onClick:e,className:"text-text-base hover:bg-gray-200 dark:hover:bg-gray-800 rounded-md w-8 h-8 flex items-center justify-center",children:n.jsx(IO,{size:20})});return n.jsxs("header",{className:"lg:hidden sticky top-0 z-10 flex items-center gap-3 p-2.5 border-b bg-bg-app",children:[t?n.jsx(S2,{side:"bottom",align:"start",dotClassName:"absolute top-0 right-0",children:i}):i,n.jsxs("div",{className:"flex items-center gap-3.5 min-w-0",children:[n.jsx(Zo,{className:"shrink-0","aria-hidden":"true"}),n.jsx("span",{className:"font-semibold truncate",children:a})]})]})}function KK({open:e,onOpenChange:t,setSwitchingTailnets:r}){return n.jsx(MS,{open:e,onOpenChange:t,children:n.jsxs(LS,{children:[n.jsx(RS,{className:D("fixed inset-0 z-20",VS,"motion-safe:state-open:animate-[fade-in_200ms_ease-out] motion-safe:state-closed:animate-[fade-out_200ms_ease-out_forwards]")}),n.jsx(OS,{"aria-label":"Navigation menu",className:"fixed inset-y-0 left-0 z-30 w-full sm:w-60 motion-safe:state-open:animate-[drawer-slide-in_200ms_cubic-bezier(0.2,0,0,1)] motion-safe:state-closed:animate-[drawer-slide-out_200ms_cubic-bezier(0.2,0,0,1)_forwards]",children:n.jsx(US,{setSwitchingTailnets:r,onNavigate:()=>t(!1),onClose:()=>t(!1)})})]})})}function GK(){const{data:e}=vt();return e.featureSideNav?"sidenav":"topnav"}function qK({setSwitchingTailnets:e,topNav:t,children:r}){const s=GK();return f.useEffect(()=>(document.documentElement.dataset.layout=s,()=>{delete document.documentElement.dataset.layout}),[s]),n.jsx(n.Fragment,{children:s==="sidenav"?n.jsxs(zK,{setSwitchingTailnets:e,children:[n.jsx(b9,{}),r]}):n.jsxs(n.Fragment,{children:[n.jsx(b9,{}),t,r]})})}const YK="tailnet-selection-required",ZK="not-admin";function QK(e){const{data:t,error:r,mutate:s,isValidating:a}=ot(),{data:i}=vt(),[l,u]=ft();if(!r&&!t)return n.jsx("div",{className:"min-h-screen flex items-center",children:n.jsx(De,{})});if(r){const d=r.response?.status;if(gr&&r.response?.data?.errorCode===YK){const m=Lm()||r.response?.headers?.["x-control-origin"]||"";if(m)return globalThis.location.href=m+"/switch-tailnet?next_url="+encodeURIComponent(globalThis.location.href),n.jsx("div",{className:"min-h-screen flex items-center",children:n.jsx(De,{})})}return gr&&r.response?.data?.errorCode===ZK?n.jsx(w9,{}):d===401||d===403?n.jsx(JK,{error:r,children:e.children}):r.response?n.jsx("div",{className:"min-h-screen w-full p-3 flex items-center justify-center",children:n.jsxs("div",{className:"max-w-md text-center",children:[n.jsx(Da,{className:"mx-auto mb-4 text-red-400",size:"2rem"}),n.jsxs("div",{role:"alert",className:"font-medium text-lg mb-3",children:["Error: ",r.message]}),n.jsxs("p",{className:"mb-4",children:["We weren’t able to load information from the server after several seconds of retrying. Please try again, and if the issue persists,"," ",n.jsx(Zn,{type:"other",children:"contact us"})," ","for help."]}),n.jsx("div",{children:n.jsx(ue,{onClick:()=>s(),loading:a,children:"Retry"})})]})}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"bg-yellow-400 text-white font-medium py-2 px-4 text-center",children:["You are offline. Try to"," ",n.jsx("button",{className:"text-yellow-50",onClick:()=>s(),children:"reconnect"}),"."]}),e.children]})}if(gr&&!i.featureNewConsole){const d=Lm();return d?(globalThis.location.href=d+globalThis.location.pathname+globalThis.location.search+globalThis.location.hash,n.jsx("div",{className:"min-h-screen flex items-center",children:n.jsx(De,{})})):n.jsx(w9,{})}if(gr&&t){const d=l.startsWith("/admin/welcome"),m=l.startsWith("/admin/welcome/finish-setup"),p=globalThis.location?.search??"";if(t.needsOnboarding&&!d)return u("/admin/welcome"+p,{replace:!0}),n.jsx("div",{className:"min-h-screen flex items-center",children:n.jsx(De,{})});if(!t.needsOnboarding&&d&&!m){let g="/admin";return(l.startsWith("/admin/welcome/checkout/")||l.startsWith("/admin/welcome/plans"))&&(g=l.replace("/admin/welcome/","/admin/settings/billing/")),u(g+p,{replace:!0}),n.jsx("div",{className:"min-h-screen flex items-center",children:n.jsx(De,{})})}}return e.children}function w9(){return n.jsx("div",{className:"min-h-screen w-full p-3 flex items-center justify-center",children:n.jsxs("div",{className:"max-w-md text-center",children:[n.jsx(Da,{className:"mx-auto mb-4 text-red-400",size:"2rem"}),n.jsx("div",{role:"alert",className:"font-medium text-lg mb-3",children:"Access denied"}),n.jsxs("p",{className:"mb-4",children:["Your account does not have access to the Tailscale console. If you believe this is an error, please"," ",n.jsx(Zn,{type:"other",children:"contact us"})," for help."]}),n.jsxs("div",{className:"flex items-center justify-center gap-3",children:[n.jsx("a",{className:"text-blue-500 hover:text-blue-600 font-medium",href:vr("/switch-tailnet",{returnTo:gM("/admin/")}),children:"Switch tailnet"}),n.jsx("a",{className:"text-blue-500 hover:text-blue-600 font-medium",href:vr("/logout"),children:"Log out"})]})]})})}function JK({error:e,children:t}){const r=_f()||e.response?.headers?.["x-control-origin"]||"";return r?(globalThis.location.href=`${r}/login?next_url=${encodeURIComponent(globalThis.location.href)}`,n.jsx("div",{className:"min-h-screen flex items-center",children:n.jsx(De,{})})):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"bg-yellow-400 text-white font-medium py-2 px-4 text-center",children:["Your session has expired. Please"," ",n.jsx("a",{className:"text-yellow-50",href:`/login?next_url=${globalThis.location.pathname}`,children:"log in"})," ","to continue."]}),t]})}function is({title:e,classes:t,isSubpage:r}){const s=f.useRef(null),[a]=ft();return f.useEffect(()=>{const i=`${e} - Tailscale`;document.title!=="Tailscale"&&document.title!==i&&(s.current?.focus(),s.current?.setAttribute("tabIndex","-1")),document.title=i},[a,e]),r?n.jsx("h2",{className:t,ref:s,children:e}):n.jsx("h1",{className:t,ref:s,children:e})}const Et={pageTitle:"text-3xl font-semibold tracking-tight leading-tight",pageSubTitle:"text-2xl font-semibold tracking-tight",sectionTitle:"text-xl font-semibold tracking-tight",allCaps:"text-sm font-semibold uppercase tracking-[0.04em]",fieldLabel:"font-medium",fieldHelpText:"text-text-muted",fieldErrorText:"text-text-danger"};function mn(e){const{className:t,title:r,description:s,badge:a,learnMoreUrl:i,learnMoreLabel:l,children:u,cta:d,additionalHeader:m}=e,p=r?.toLowerCase().replaceAll(/\s+/g,"_")??"unknown";return n.jsxs("section",{className:t,children:[r&&n.jsxs("header",{className:"flex gap-2",children:[n.jsxs("div",{className:"flex-grow",children:[n.jsxs("div",{className:"flex flex-wrap justify-between items-center gap-x-4 gap-y-4",children:[n.jsxs("div",{className:"flex items-center",children:[n.jsx(is,{title:r,classes:Et.pageTitle}),a==="alpha"?n.jsx(k2,{className:"ml-3"}):a==="beta"?n.jsx(Qo,{className:"ml-3"}):null]}),d]}),s&&n.jsxs("p",{className:"mt-2 max-w-[40rem]",children:[s," ",i&&n.jsx(Ge,{kbTopic:r,url:i,label:l,onClick:()=>{O(R.LearnMoreLinkClicked,{eventProperties:{productArea:p,productSubArea:`${p}_view`}})}})]})]}),m]}),n.jsx(sj,{fallback:XK,children:n.jsx(f.Suspense,{fallback:null,children:u})})]})}function XK({error:e}){const t=e?e.message:"an unknown error occurred",r=()=>{globalThis.location.reload()};return n.jsx("div",{className:"flex items-center justify-center w-full container",children:n.jsxs("div",{className:"max-w-lg mx-auto w-full",children:[n.jsxs("header",{className:"mb-4",children:[n.jsxs("div",{className:"relative mb-2 text-red-400",children:[n.jsx(Da,{className:"hidden md:inline-block",size:"1.5rem"}),n.jsx(Da,{className:"md:hidden",size:"2rem"})]}),n.jsxs("h3",{className:"text-lg font-medium",children:["Error: ",t]})]}),n.jsx("div",{children:n.jsxs("p",{children:["You can"," ",n.jsx("button",{className:"link",onClick:r,children:"refresh the page"})," ","to try again. If the error continues, please"," ",n.jsx(Zn,{type:"other",children:"contact us"})," for help."]})})]})})}function Ne(){return n.jsx(mn,{children:n.jsx("div",{className:"border rounded-md text-center py-4 px-4 text-text-muted",children:"You are not authorized to access this page."})})}const $S=e=>f.createElement("svg",{width:86,height:16,viewBox:"0 0 86 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("circle",{cx:1.91326,cy:7.65301,r:1.91326,fill:"currentColor"}),f.createElement("circle",{cx:7.65301,cy:7.65301,r:1.91326,fill:"currentColor"}),f.createElement("circle",{opacity:.2,cx:1.91326,cy:13.3928,r:1.91326,fill:"currentColor"}),f.createElement("circle",{opacity:.2,cx:13.3928,cy:13.3928,r:1.91326,fill:"currentColor"}),f.createElement("circle",{cx:7.65301,cy:13.3928,r:1.91326,fill:"currentColor"}),f.createElement("circle",{cx:13.3928,cy:7.65301,r:1.91326,fill:"currentColor"}),f.createElement("circle",{opacity:.2,cx:1.91326,cy:1.91326,r:1.91326,fill:"currentColor"}),f.createElement("circle",{opacity:.2,cx:7.65301,cy:1.91326,r:1.91326,fill:"currentColor"}),f.createElement("circle",{opacity:.2,cx:13.3928,cy:1.91326,r:1.91326,fill:"currentColor"}),f.createElement("path",{d:"M26.892 14.1397C27.4336 14.1397 27.8737 14.0889 28.3984 13.9873V12.0239C28.0768 12.1424 27.7213 12.1763 27.3828 12.1763C26.5534 12.1763 26.2488 11.77 26.2488 10.9914V6.9969H28.3984V5.03348H26.2488V2.1222H23.8791V5.03348H22.3389V6.9969H23.8791V11.2115C23.8791 13.0733 24.8608 14.1397 26.892 14.1397Z",fill:"currentColor"}),f.createElement("path",{d:"M32.2684 14.1397C33.5378 14.1397 34.3841 13.7165 34.8073 13.0564C34.8411 13.3442 34.9427 13.7335 35.0781 13.9704H37.2108C37.0923 13.5642 37.0076 12.921 37.0076 12.4979V7.86013C37.0076 5.94749 35.6366 4.86422 33.3178 4.86422C31.5575 4.86422 30.1865 5.52433 29.4248 6.48912L30.7789 7.82627C31.3882 7.14923 32.1668 6.79379 33.1147 6.79379C34.2656 6.79379 34.7734 7.18308 34.7734 7.75857C34.7734 8.24942 34.4349 8.58794 32.6069 8.58794C30.8466 8.58794 29.0693 9.31576 29.0693 11.3469C29.0693 13.2257 30.4234 14.1397 32.2684 14.1397ZM32.7423 12.3455C31.8283 12.3455 31.4051 11.9562 31.4051 11.2623C31.4051 10.6529 31.9129 10.2467 32.7592 10.2467C34.1133 10.2467 34.4857 10.1621 34.7734 9.87432V10.6021C34.7734 11.5669 33.961 12.3455 32.7423 12.3455Z",fill:"currentColor"}),f.createElement("path",{d:"M38.548 3.89944H41.0192V1.68213H38.548V3.89944ZM38.5988 13.9704H40.9685V5.03348H38.5988V13.9704Z",fill:"currentColor"}),f.createElement("path",{d:"M42.6948 13.9704H45.0644V1.95294H42.6948V13.9704Z",fill:"currentColor"}),f.createElement("path",{d:"M49.9898 14.1397C52.5964 14.1397 53.9335 12.7687 53.9335 11.33C53.9335 10.0267 53.2734 9.06187 51.1069 8.67257C49.5835 8.40176 48.6357 8.06324 48.6357 7.53853C48.6357 7.08153 49.1773 6.75993 50.0913 6.75993C50.9038 6.75993 51.5808 7.03075 52.0886 7.62316L53.595 6.35371C52.8333 5.40585 51.5808 4.86422 50.0913 4.86422C47.8063 4.86422 46.3845 6.08289 46.3845 7.57238C46.3845 9.19728 47.874 9.9251 49.482 10.2128C50.8191 10.4498 51.5639 10.7037 51.5639 11.2792C51.5639 11.77 51.0392 12.1763 50.0405 12.1763C49.0588 12.1763 48.2972 11.7193 47.9417 11.0422L45.9444 11.9901C46.4353 13.2087 48.111 14.1397 49.9898 14.1397Z",fill:"currentColor"}),f.createElement("path",{d:"M59.2312 14.1397C60.9238 14.1397 62.1425 13.4626 63.0565 11.9393L61.1608 10.9745C60.8054 11.6854 60.2299 12.1763 59.2312 12.1763C57.7248 12.1763 56.9124 10.9576 56.9124 9.48502C56.9124 8.01246 57.7756 6.82764 59.2312 6.82764C60.1452 6.82764 60.7546 7.31849 61.11 8.06324L63.0227 7.04768C62.3795 5.64282 61.11 4.86422 59.2312 4.86422C56.1338 4.86422 54.5427 7.13231 54.5427 9.48502C54.5427 12.0409 56.4723 14.1397 59.2312 14.1397Z",fill:"currentColor"}),f.createElement("path",{d:"M66.8312 14.1397C68.1006 14.1397 68.9469 13.7165 69.3701 13.0564C69.4039 13.3442 69.5055 13.7335 69.6409 13.9704H71.7736C71.6551 13.5642 71.5704 12.921 71.5704 12.4979V7.86013C71.5704 5.94749 70.1994 4.86422 67.8806 4.86422C66.1203 4.86422 64.7493 5.52433 63.9876 6.48912L65.3417 7.82627C65.951 7.14923 66.7296 6.79379 67.6775 6.79379C68.8284 6.79379 69.3362 7.18308 69.3362 7.75857C69.3362 8.24942 68.9977 8.58794 67.1697 8.58794C65.4094 8.58794 63.6321 9.31576 63.6321 11.3469C63.6321 13.2257 64.9862 14.1397 66.8312 14.1397ZM67.3051 12.3455C66.3911 12.3455 65.9679 11.9562 65.9679 11.2623C65.9679 10.6529 66.4757 10.2467 67.322 10.2467C68.6761 10.2467 69.0485 10.1621 69.3362 9.87432V10.6021C69.3362 11.5669 68.5238 12.3455 67.3051 12.3455Z",fill:"currentColor"}),f.createElement("path",{d:"M72.9633 13.9704H75.3329V1.95294H72.9633V13.9704Z",fill:"currentColor"}),f.createElement("path",{d:"M81.0199 14.1397C82.7633 14.1397 84.1682 13.4457 84.9468 12.2101L83.1526 11.0591C82.6787 11.8039 82.0524 12.2101 81.0199 12.2101C79.852 12.2101 79.0057 11.5669 78.7857 10.3144H85.5222V9.48502C85.5222 7.13231 84.0835 4.86422 81.003 4.86422C78.0748 4.86422 76.4837 7.14923 76.4837 9.50195C76.4837 12.8533 79.0057 14.1397 81.0199 14.1397ZM78.8703 8.45254C79.2427 7.31849 80.0213 6.79379 81.0538 6.79379C82.2217 6.79379 82.9326 7.48775 83.1695 8.45254H78.8703Z",fill:"currentColor"}));function eG(){return n.jsxs("div",{className:"min-h-screen",children:[n.jsx("div",{className:"p-8 flex justify-center",children:n.jsx($S,{className:"h-6 w-auto"})}),n.jsxs("div",{className:"max-w-md mx-auto text-center px-4 mt-16",children:[n.jsx("h1",{className:"text-3xl font-semibold mb-4",children:"Your tailnet has been deleted."}),n.jsx("p",{className:"text-text-muted mb-4 text-lg",children:"If you log in again with your previous identity, Tailscale will automatically create a new account for you."}),n.jsxs("p",{className:"text-text-muted",children:["Have any feedback?"," ",n.jsx("a",{href:"https://tailscale.com/contact/support/?type=feedback",target:"_blank",rel:"noreferrer",className:"underline",children:"Let us know"}),"."]}),n.jsx("p",{className:"mt-6",children:n.jsx("a",{href:"https://tailscale.com",className:"underline",children:"Go to tailscale.com"})})]})]})}const tG="/admin/assets/main-DaDrq_Rt.wasm";function nG(e,t,r){return hg||(hg=sG(e,t,r)),hg}async function rG(){if(j9)return;j9=!0;const{wasmURL:e}=await HS(),t=document.createElement("link");t.rel="preload",t.as="fetch",t.crossOrigin="anonymous",t.href=e,document.head.append(t)}let j9=!1;async function HS(){let e,t;return e=await $e(()=>import("./pkg-v0ySevwe.js"),[]),t=tG,{tsconnectModule:e,wasmURL:t}}let hg;async function sG(e,t,r){const{tsconnectModule:s,wasmURL:a}=await HS(),i=y=>{r.onError?.({type:"panic",err:y})},l=await s.createIPN({wasmURL:a,controlURL:Lm()||globalThis.location.origin,authKey:e,panicHandler:i,hostname:t});let u=!1,d=!1,m=!1,p=[];function g(y){y.onRun(),s.runSSHSession(y.termContainerNode,y,l,{onConnectionProgress:y.onConnectionProgress,onConnected:y.onConnected,onDone:y.onDone,onError(C){r.onError?.({type:"ssh-session",err:C})}})}return{isRunning:new Promise(y=>{function C(){if(d&&!m){y(!0),u=!0;for(const b of p)g(b);p=[]}}l.run({notifyState(b){switch(b){case"NeedsLogin":{r.onNeedsLogin?.(),l.login();break}case"Starting":{r.onStarting?.();break}case"Running":{C();break}}},notifyNetMap(b){const w=JSON.parse(b);m=w.lockedOut,r.onLockedOutState?.(m,w.self.nodeKey),d=!0,C()},notifyBrowseToURL(){},notifyPanicRecover(b){i(b)}})}),logout(){l.logout()},runSSHSession(y){u?g(y):p.push(y)}}}function aG(e,t){new uG(e,t).start()}const pg=30,gg=1e3,S9=2e3,k9=10,iG=2e3,oG=20,lG="#569efe",N9="○◘◙•♂♀☼▲►▼◄↨↕↔¶¡‼§▬↑↓←→!\"#$%&'()*+,-./0123456789:;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇâäàåáèéêëíîïÄÅÉæÆòóôöùúûüÿÖÜ¢£¥₧ƒñѪº¿⌐¬¡»«¼½─│┌┐└┘├┤┬┴┼═║╒╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡╢╣╤╥╦╧╨╩╪╫╬▀▄█▌▐■⌠⌡ΓΘΣΦΩαδεπστφ∙√∞∟∩≈≡≤≥";function cG(){return N9[Math.floor(Math.random()*N9.length)]}class uG{constructor(t,r){this.parentWindow=t,this.xtermContainerNode=r,this.overlayNode=this.parentWindow.document.createElement("div"),this.overlayNode.className="pointer-events-none fixed z-100",this.overlayNode.setAttribute("aria-hidden","true")}parentWindow;xtermContainerNode;stepRequest;overlayNode;start(){this.parentWindow.document.body.append(this.overlayNode);const t=this.parentWindow.performance.now();this.requestStep(t,t,new Set)}stop(){this.stepRequest&&(this.parentWindow.cancelAnimationFrame(this.stepRequest),this.stepRequest=void 0),this.overlayNode?.parentElement&&this.overlayNode.remove()}requestStep(t,r,s){this.stepRequest=this.parentWindow.requestAnimationFrame(a=>{this.stepRequest=void 0,this.step(t,r,a,s)})}step(t,r,s,a){if(this.parentWindow.closed){this.stop();return}const i=s-t;let l;if(i0;C--){const b=Math.floor(Math.random()*(C+1)),w=y[C];y[C]=y[b],y[b]=w}y.forEach(C=>{const b=C.firstChild?.nodeValue;if(!(!b||b===" ")&&(m=!0,!a.has(b))){if(v>0){a.add(b),v--;return}C.firstChild.nodeValue=cG(),C.style.background="black",C.style.fontWeight="bold",C.style.color=lG,p=!0}}),this.overlayNode.append(d),!m||p?this.requestStep(t,s,a):this.stop()}}const wn=[];for(let e=0;e<256;++e)wn.push((e+256).toString(16).slice(1));function dG(e,t=0){return(wn[e[t+0]]+wn[e[t+1]]+wn[e[t+2]]+wn[e[t+3]]+"-"+wn[e[t+4]]+wn[e[t+5]]+"-"+wn[e[t+6]]+wn[e[t+7]]+"-"+wn[e[t+8]]+wn[e[t+9]]+"-"+wn[e[t+10]]+wn[e[t+11]]+wn[e[t+12]]+wn[e[t+13]]+wn[e[t+14]]+wn[e[t+15]]).toLowerCase()}const mG=new Uint8Array(16);function fG(){return crypto.getRandomValues(mG)}function hG(e,t,r){return crypto.randomUUID?crypto.randomUUID():pG(e)}function pG(e,t,r){e=e||{};const s=e.random??e.rng?.()??fG();if(s.length<16)throw new Error("Random bytes length must be >= 16");return s[6]=s[6]&15|64,s[8]=s[8]&63|128,dG(s)}function V2(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():hG()}const gG=1e3,xG=60,zS="tailscale/ssh-reauth-session/";function vG(e){const{machine:t}=e,r=qc.get(t.id);if(r&&!r.closed){r.focus();return}const s=window.open(void 0,void 0,["popup","width=800","height=450",`top=${window.screenTop+20}`,`left=${window.screenLeft+20}`].join(","));if(!s){e.reportError("Could not open a new window, please check your popup blocker.");return}qc.set(t.id,s),E9||(window.addEventListener("beforeunload",jG),window.addEventListener("unload",SG),E9=!0);const a=new URLSearchParams({target:t.stableId});if(gr){const i=V2();bG(i,{username:e.username,machineId:t.id,machineName:t.name,machineFqdn:t.fqdn,clientHostname:e.clientHostname,sneakersEffect:e.sneakersEffect,controlOrigin:Lm()}),a.set("origin",globalThis.location.origin),a.set("state",i),s.location.href=vr("/tsconnect/reauth?"+a.toString());return}if(O0){$2(e,s,O0);return}F0.set(s,e),s.location.href=vr("/tsconnect/reauth?"+a.toString())}function yG(){const e=new URLSearchParams(globalThis.location.hash.replace(/^#/,"")),t=e.get("authKey"),r=e.get("state");if(history.replaceState(null,"",globalThis.location.pathname),!t||!r)return"Could not complete re-authentication, please try again.";const s=CG(r);if(!s)return"Could not resume the SSH session, please try again.";s.controlOrigin&&Ex(s.controlOrigin),$2({username:s.username,machine:{id:s.machineId,name:s.machineName,fqdn:s.machineFqdn},clientHostname:s.clientHostname,reportError:a=>console.error(a),sneakersEffect:s.sneakersEffect},globalThis.window,t)}function bG(e,t){try{globalThis.localStorage.setItem(zS+e,JSON.stringify(t))}catch{}}function CG(e){const t=zS+e;try{const r=globalThis.localStorage.getItem(t);return globalThis.localStorage.removeItem(t),r?JSON.parse(r):void 0}catch{return}}globalThis.tsconnectReauthComplete=wG;function wG(e,t){const r=F0.get(e);if(!r)return;F0.delete(e),O0=t;let s=!1;const a=()=>{s||(s=!0,$2(r,e,t))};e.addEventListener("unload",()=>setTimeout(a,0),{once:!0}),setTimeout(a,200),e.location.href="about:blank"}let O0,yc;const F0=new WeakMap;async function $2({machine:e,username:t,clientHostname:r,reportError:s,sneakersEffect:a},i,l){const u=i.document.createElement("meta");if(u.setAttribute("name","viewport"),u.setAttribute("content","width=device-width, initial-scale=1"),i.document.head.append(u),i.document.body.className="overflow-hidden bg-black",i.document.title=`Tailscale - SSH to ${e.name}`,!(i===globalThis.window))for(const k of document.querySelectorAll("head link[rel=stylesheet]")){const E=i.document.createElement("link");E.rel="stylesheet",E.href=k.href,i.document.head.append(E)}function m(k){if(console.error("IPN Error",k),!!p)switch(k.type){case"panic":{s("Tailscale SSH has encountered an error, please reload the page and try again.");break}case"ssh-session":{let E="please try again or contact support";k.err.includes("Dial Error: context deadline exceeded")?E="the machine may be offline":k.err.includes("ssh: unable to authenticate")&&(E="authentication failed (there may not be a local user with that name)"),s(`Tailscale SSH encountered an error during the session, ${E}.`);break}}}let p=!1;i.addEventListener("beforeunload",k=>{p&&(k.preventDefault(),k.returnValue="This is an active SSH session. Are you sure you want to close it?")});const g=[];i.addEventListener("unload",()=>{for(const k of g)k();qc.delete(e.id),p=!1});const v=i.document.createElement("div");v.className="absolute inset-0 md:inset-2 overflow-hidden",i.document.body.append(v);const{visualViewport:y}=i;if(y){const k=()=>v.style.maxHeight=y.height+"px";k(),y.addEventListener("resize",k),g.push(()=>y.removeEventListener("resize",k))}const C=i.document.createElement("div");C.className="absolute inset-0 flex items-center justify-center text-white font-mono",i.document.body.append(C);const b=i.document.createElement("div");b.className="absolute inset-2 flex items-center justify-center text-white font-mono",b.style.visibility="hidden",i.document.body.append(b);function w(k){C.textContent=k}w("Loading Tailscale SSH Console…"),yc=yc??await nG(l,r,{onNeedsLogin(){w("Logging in to Tailscale…")},onStarting(){w("Starting Tailscale client…")},onError:m,onLockedOutState(k,E){k?(b.style.visibility="visible",b.textContent="The ephemeral node created for this SSH session needs to be signed, due to Tailnet Lock being enabled on this tailnet. Run the following command on a device with a trusted Tailnet Lock key: tailscale lock sign "+E,C.style.visibility="hidden"):(b.style.visibility="hidden",C.style.visibility="visible")}}),w("Connecting to Tailscale…"),await yc.isRunning;const N=Date.now();g.push(()=>O(R.ClosedMachineSSHSession,{sshProperties:{sessionDurationMinutes:Math.round((Date.now()-N)/gG/xG)}})),yc.runSSHSession({username:t,hostname:e.fqdn,timeoutSeconds:10,termContainerNode:v,onRun(){p=!0},onConnectionProgress:w,onConnected(){a&&aG(i,v),C.remove()},onDone(){p=!1,i.close()}})}const qc=new Map;let E9=!1;function jG(e){const t=Array.from(qc.values()).filter(r=>!r.closed).length;t&&(e.preventDefault(),e.returnValue=t>1?`There are ${t} SSH sessions open. Are you sure you want to close them?`:"There is an SSH session open. Are you sure you want to close it?")}function SG(){for(const e of qc.values())e.closed||e.close();yc?.logout()}function kG(){const[e,t]=f.useState();return f.useEffect(()=>{A9||(A9=!0,t(yG()))},[]),n.jsxs("div",{className:"min-h-screen bg-black text-white",children:[n.jsx("div",{className:"p-8 flex justify-center",children:n.jsx($S,{className:"h-6 w-auto"})}),e?n.jsx("div",{className:"max-w-md mx-auto text-center px-4 mt-16 font-mono",children:e}):null]})}let A9=!1;const NG=async([,e])=>{const t=await Ie.get(e);return new Set((t.data.data?.entries??[]).map(r=>r.name.toLowerCase()))};function $i(){const{data:e,error:t}=dt(["acl-tags-set","/public/tailnet/-/acl/tags"],NG),r=f.useMemo(()=>({all:e??new Set}),[e]);return{loaded:e!==void 0&&!t,error:t,aclTags:r}}const EG=async e=>{const t=await Ie.get(e);return new Set((t.data.data?.tags??[]).map(r=>r.toLowerCase()))};function WS(){const{data:e,error:t}=dt("/public/tailnet/-/acl/tags/assignable",EG),r=f.useMemo(()=>e??new Set,[e]);return{loaded:e!==void 0&&!t,error:t,assignable:r}}const lce=()=>{yi(["acl-tags-set","/public/tailnet/-/acl/tags"],void 0,{revalidate:!1}),yi("/public/tailnet/-/acl/tags/assignable",void 0,{revalidate:!1})};function xs(e,t){if(e==null)return{};var r={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(t.indexOf(s)!==-1)continue;r[s]=e[s]}return r}function bt(){return bt=Object.assign?Object.assign.bind():function(e){for(var t=1;ttypeof e=="object"&&e!=null&&e.nodeType===1,L9=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",nm=(e,t)=>{if(e.clientHeight{const a=(i=>{if(!i.ownerDocument||!i.ownerDocument.defaultView)return null;try{return i.ownerDocument.defaultView.frameElement}catch{return null}})(s);return!!a&&(a.clientHeightit||i>e&&l=t&&u>=r?i-e-s:l>t&&ur?l-t+a:0,MG=e=>{const t=e.parentElement;return t??(e.getRootNode().host||null)},LG=(e,t)=>{var r,s,a,i;if(typeof document>"u")return[];const{inline:l,boundary:u,skipOverflowHiddenElements:d}=t,m=typeof u=="function"?u:W=>W!==u;if(!M9(e))throw new TypeError("Invalid target");const p=document.scrollingElement||document.documentElement,g=[];let v=e;for(;M9(v)&&m(v);){if(v=MG(v),v===p){g.push(v);break}v!=null&&v===document.body&&nm(v)&&!nm(document.documentElement)||v!=null&&nm(v,d)&&g.push(v)}const y=(s=(r=window.visualViewport)==null?void 0:r.width)!=null?s:innerWidth,C=(i=(a=window.visualViewport)==null?void 0:a.height)!=null?i:innerHeight,{scrollX:b,scrollY:w}=window,{height:N,width:k,top:E,right:T,bottom:_,left:I}=e.getBoundingClientRect(),{top:F,right:z,left:H}=(W=>{const U=window.getComputedStyle(W);return{top:parseFloat(U.scrollMarginTop)||0,right:parseFloat(U.scrollMarginRight)||0,bottom:parseFloat(U.scrollMarginBottom)||0,left:parseFloat(U.scrollMarginLeft)||0}})(e);let J=E-F,Y=l==="center"?I+k/2-H+z:l==="end"?T+z:I-H;const B=[];for(let W=0;W=0&&I>=0&&_<=C&&T<=y&&(U===p&&!nm(U)||E>=me&&_<=V&&I>=P&&T<=L))return B;const q=getComputedStyle(U),Q=parseInt(q.borderLeftWidth,10),ae=parseInt(q.borderTopWidth,10),X=parseInt(q.borderRightWidth,10),fe=parseInt(q.borderBottomWidth,10);let he=0,se=0;const le="offsetWidth"in U?U.offsetWidth-U.clientWidth-Q-X:0,Ae="offsetHeight"in U?U.offsetHeight-U.clientHeight-ae-fe:0,Te="offsetWidth"in U?U.offsetWidth===0?0:re/U.offsetWidth:0,Ue="offsetHeight"in U?U.offsetHeight===0?0:Z/U.offsetHeight:0;if(p===U)he=rm(w,w+C,C,ae,fe,w+J,w+J+N,N),se=l==="start"?Y:l==="center"?Y-y/2:l==="end"?Y-y:rm(b,b+y,y,Q,X,b+Y,b+Y+k,k),he=Math.max(0,he+w),se=Math.max(0,se+b);else{he=rm(me,V,Z,ae,fe+Ae,J,J+N,N),se=l==="start"?Y-P-Q:l==="center"?Y-(P+re/2)+le/2:l==="end"?Y-L+X+le:rm(P,L,re,Q,X+le,Y,Y+k,k);const{scrollLeft:Ze,scrollTop:ct}=U;he=Ue===0?0:Math.max(0,Math.min(ct+he/Ue,U.scrollHeight-Z/Ue+Ae)),se=Te===0?0:Math.max(0,Math.min(Ze+se/Te,U.scrollWidth-re/Te+le)),J+=ct-he,Y+=Ze-se}B.push({el:U,top:he,left:se})}return B};var RG=0;function KS(){}function OG(e,t){if(e){var r=LG(e,{boundary:t});r.forEach(function(s){var a=s.el,i=s.top,l=s.left;a.scrollTop=i,a.scrollLeft=l})}}function R9(e,t,r){var s=e===t||t instanceof r.Node&&e.contains&&e.contains(t);return s}function H2(e,t){var r;function s(){r&&clearTimeout(r)}function a(){for(var i=arguments.length,l=new Array(i),u=0;u1?a-1:0),l=1;l=37&&r<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function Aa(e,t,r,s,a){a===void 0&&(a=!1);var i=r.length;if(i===0)return-1;var l=i-1;(typeof e!="number"||e<0||e>l)&&(e=t>0?-1:l+1);var u=e+t;u<0?u=a?l:0:u>l&&(u=a?0:l);var d=Jo(u,t<0,r,s,a);return d===-1?e>=i?-1:e:d}function Jo(e,t,r,s,a){a===void 0&&(a=!1);var i=r.length;if(t){for(var l=e;l>=0;l--)if(!s(r[l],l))return l}else for(var u=e;u"u"?void 0:window};function vs(e,t,r){r===void 0&&(r=YS);var s=e["default"+W2(t)];return s!==void 0?s:r[t]}function gi(e,t,r){r===void 0&&(r=YS);var s=e[t];if(s!==void 0)return s;var a=e["initial"+W2(t)];return a!==void 0?a:vs(e,t,r)}function XS(e){var t=gi(e,"selectedItem"),r=gi(e,"isOpen"),s=GG(e),a=gi(e,"inputValue");return{highlightedIndex:s<0&&t&&r?e.items.findIndex(function(i){return e.itemToKey(i)===e.itemToKey(t)}):s,isOpen:r,selectedItem:t,inputValue:a}}function xi(e,t,r){var s=e.items,a=e.initialHighlightedIndex,i=e.defaultHighlightedIndex,l=e.isItemDisabled,u=e.itemToKey,d=t.selectedItem,m=t.highlightedIndex;return s.length===0?-1:a!==void 0&&m===a&&!l(s[a],a)?a:i!==void 0&&!l(s[i],i)?i:d?s.findIndex(function(p){return u(d)===u(p)}):r<0&&!l(s[s.length-1],s.length-1)?s.length-1:r>0&&!l(s[0],0)?0:-1}function ek(e,t,r){var s=f.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1});return f.useEffect(function(){if(!e)return KS;var a=r.map(function(p){return p.current});function i(){s.current.isTouchEnd=!1,s.current.isMouseDown=!0}function l(p){s.current.isMouseDown=!1,O9(p.target,a,e)||t()}function u(){s.current.isTouchEnd=!1,s.current.isTouchMove=!1}function d(){s.current.isTouchMove=!0}function m(p){s.current.isTouchEnd=!0,!s.current.isTouchMove&&!O9(p.target,a,e,!1)&&t()}return e.addEventListener("mousedown",i),e.addEventListener("mouseup",l),e.addEventListener("touchstart",u),e.addEventListener("touchmove",d),e.addEventListener("touchend",m),function(){e.removeEventListener("mousedown",i),e.removeEventListener("mouseup",l),e.removeEventListener("touchstart",u),e.removeEventListener("touchmove",d),e.removeEventListener("touchend",m)}},[r,e,t]),s.current}var K2=function(){return KS};function G2(e,t,r,s){s===void 0&&(s={});var a=s.document,i=fh();f.useEffect(function(){if(!(!e||i||!a)){var l=e(t);F9(l,a)}},r),f.useEffect(function(){return function(){F9.cancel(),VG(a)}},[a])}function tk(e){var t=e.highlightedIndex,r=e.isOpen,s=e.itemRefs,a=e.getItemNodeFromIndex,i=e.menuElement,l=e.scrollIntoView,u=f.useRef(!0);return WG(function(){t<0||!r||!Object.keys(s.current).length||(u.current===!1?u.current=!0:l(a(t),i))},[t]),u}function mf(e,t,r){var s;r===void 0&&(r=!0);var a=((s=e.items)==null?void 0:s.length)&&t>=0;return bt({isOpen:!1,highlightedIndex:-1},a&&bt({selectedItem:e.items[t],isOpen:vs(e,"isOpen"),highlightedIndex:vs(e,"highlightedIndex")},r&&{inputValue:e.itemToString(e.items[t])}))}function nk(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function fh(){var e=ce.useRef(!0);return ce.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]),e.current}function ff(e){var t=vs(e,"highlightedIndex");return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function GG(e){var t=gi(e,"highlightedIndex");return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}var Em={environment:ke.shape({addEventListener:ke.func.isRequired,removeEventListener:ke.func.isRequired,document:ke.shape({createElement:ke.func.isRequired,getElementById:ke.func.isRequired,activeElement:ke.any.isRequired,body:ke.any.isRequired}).isRequired,Node:ke.func.isRequired}),itemToString:ke.func,itemToKey:ke.func,stateReducer:ke.func},rk=bt({},Em,{getA11yStatusMessage:ke.func,highlightedIndex:ke.number,defaultHighlightedIndex:ke.number,initialHighlightedIndex:ke.number,isOpen:ke.bool,defaultIsOpen:ke.bool,initialIsOpen:ke.bool,selectedItem:ke.any,initialSelectedItem:ke.any,defaultSelectedItem:ke.any,id:ke.string,labelId:ke.string,menuId:ke.string,getItemId:ke.func,toggleButtonId:ke.string,onSelectedItemChange:ke.func,onHighlightedIndexChange:ke.func,onStateChange:ke.func,onIsOpenChange:ke.func,scrollIntoView:ke.func});function sk(e,t,r){var s=t.type,a=t.props,i;switch(s){case r.ItemMouseMove:i={highlightedIndex:t.disabled?-1:t.index};break;case r.MenuMouseLeave:i={highlightedIndex:-1};break;case r.ToggleButtonClick:case r.FunctionToggleMenu:i={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:xi(a,e,0)};break;case r.FunctionOpenMenu:i={isOpen:!0,highlightedIndex:xi(a,e,0)};break;case r.FunctionCloseMenu:i={isOpen:!1};break;case r.FunctionSetHighlightedIndex:i={highlightedIndex:a.isItemDisabled(a.items[t.highlightedIndex],t.highlightedIndex)?-1:t.highlightedIndex};break;case r.FunctionSetInputValue:i={inputValue:t.inputValue};break;case r.FunctionReset:i={highlightedIndex:ff(a),isOpen:vs(a,"isOpen"),selectedItem:vs(a,"selectedItem"),inputValue:vs(a,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return bt({},e,i)}function qG(e){for(var t=e.keysSoFar,r=e.highlightedIndex,s=e.items,a=e.itemToString,i=e.isItemDisabled,l=t.toLowerCase(),u=0;u=0&&((r=a.items)==null?void 0:r.length)&&{selectedItem:a.items[e.highlightedIndex]});break;case sv:l={selectedItem:t.selectedItem};break;default:return sk(e,t,mk)}return bt({},e,l)}var QG=["onClick"],JG=["onMouseLeave","refKey","ref"],XG=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],eq=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];tq.stateChangeTypes=mk;function tq(e){e===void 0&&(e={});var t=bt({},YG,e),r=t.scrollIntoView,s=t.environment,a=t.getA11yStatusMessage,i=JS(ZG,t,XS,nk),l=i[0],u=i[1],d=l.isOpen,m=l.highlightedIndex,p=l.selectedItem,g=l.inputValue,v=f.useRef(null),y=f.useRef(null),C=f.useRef({}),b=f.useRef(null),w=ZS(t),N=mh({state:l,props:t}),k=f.useCallback(function(L){return C.current[w.getItemId(L)]},[w]);G2(a,l,[d,m,p,g],s);var E=tk({menuElement:y.current,highlightedIndex:m,isOpen:d,itemRefs:C,scrollIntoView:r,getItemNodeFromIndex:k});f.useEffect(function(){return b.current=H2(function(L){L({type:B0,inputValue:""})},500),function(){b.current.cancel()}},[]),f.useEffect(function(){g&&b.current(u)},[u,g]),f.useEffect(function(){var L=gi(t,"isOpen");L&&v.current&&v.current.focus()},[]);var T=ek(s,f.useCallback(function(){N.current.state.isOpen&&u({type:pf})},[u,N]),f.useMemo(function(){return[y,v]},[y.current,v.current])),_=K2();f.useEffect(function(){d||(C.current={})},[d]);var I=f.useMemo(function(){return{ArrowDown:function(V){V.preventDefault(),u({type:q2,altKey:V.altKey})},ArrowUp:function(V){V.preventDefault(),u({type:Y2,altKey:V.altKey})},Home:function(V){V.preventDefault(),u({type:Q2})},End:function(V){V.preventDefault(),u({type:J2})},Escape:function(){N.current.state.isOpen&&u({type:Z2})},Enter:function(V){V.preventDefault(),u({type:N.current.state.isOpen?X2:Am})},PageUp:function(V){N.current.state.isOpen&&(V.preventDefault(),u({type:tv}))},PageDown:function(V){N.current.state.isOpen&&(V.preventDefault(),u({type:nv}))}," ":function(V){V.preventDefault();var P=N.current.state;if(!P.isOpen){u({type:Am});return}P.inputValue?u({type:hf,key:" "}):u({type:ev})}}},[u,N]),F=f.useCallback(function(){u({type:ok})},[u]),z=f.useCallback(function(){u({type:ck})},[u]),H=f.useCallback(function(){u({type:lk})},[u]),J=f.useCallback(function(L){u({type:uk,highlightedIndex:L})},[u]),Y=f.useCallback(function(L){u({type:sv,selectedItem:L})},[u]),B=f.useCallback(function(){u({type:dk})},[u]),W=f.useCallback(function(L){u({type:B0,inputValue:L})},[u]),U=f.useCallback(function(L){var V=L===void 0?{}:L,P=V.onClick,q=xs(V,QG),Q=function(){var X;(X=v.current)==null||X.focus()};return bt({id:w.labelId,htmlFor:w.toggleButtonId,onClick:tn(P,Q)},q)},[w]),Z=f.useCallback(function(L,V){var P,q=L===void 0?{}:L,Q=q.onMouseLeave,ae=q.refKey,X=ae===void 0?"ref":ae,fe=q.ref,he=xs(q,JG),se=V===void 0?{}:V;se.suppressRefError;var le=function(){u({type:ak})};return bt((P={},P[X]=$s(fe,function(Ae){y.current=Ae}),P.id=w.menuId,P.role="listbox",P["aria-labelledby"]=he&&he["aria-label"]?void 0:""+w.labelId,P.onMouseLeave=tn(Q,le),P),he)},[u,_,w]),re=f.useCallback(function(L,V){var P,q=L===void 0?{}:L,Q=q.onBlur,ae=q.onClick;q.onPress;var X=q.onKeyDown,fe=q.refKey,he=fe===void 0?"ref":fe,se=q.ref,le=xs(q,XG),Ae=V===void 0?{}:V;Ae.suppressRefError;var Te=N.current.state,Ue=function(){u({type:Am})},Ze=function(){Te.isOpen&&!T.isMouseDown&&u({type:pf})},ct=function(xe){var Fe=df(xe);Fe&&I[Fe]?I[Fe](xe):KG(Fe)&&u({type:hf,key:Fe})},ht=bt((P={},P[he]=$s(se,function(Tt){v.current=Tt}),P["aria-activedescendant"]=Te.isOpen&&Te.highlightedIndex>-1?w.getItemId(Te.highlightedIndex):"",P["aria-controls"]=w.menuId,P["aria-expanded"]=N.current.state.isOpen,P["aria-haspopup"]="listbox",P["aria-labelledby"]=le&&le["aria-label"]?void 0:""+w.labelId,P.id=w.toggleButtonId,P.role="combobox",P.tabIndex=0,P.onBlur=tn(Q,Ze),P),le);return le.disabled||(ht.onClick=tn(ae,Ue),ht.onKeyDown=tn(X,ct)),ht},[u,w,N,T,_,I]),me=f.useCallback(function(L){var V,P=L===void 0?{}:L,q=P.item,Q=P.index,ae=P.onMouseMove,X=P.onClick,fe=P.onMouseDown;P.onPress;var he=P.refKey,se=he===void 0?"ref":he,le=P.disabled,Ae=P.ref,Te=xs(P,eq);le!==void 0&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var Ue=N.current,Ze=Ue.state,ct=Ue.props,ht=z2(q,Q,ct.items,"Pass either item or index to getItemProps!"),Tt=ht[0],xe=ht[1],Fe=ct.isItemDisabled(Tt,xe),st=function(){T.isTouchEnd||xe===Ze.highlightedIndex||(E.current=!1,u({type:ik,index:xe,disabled:Fe}))},mt=function(){u({type:rv,index:xe})},At=function(wt){return wt.preventDefault()},Qe=bt((V={},V[se]=$s(Ae,function(lt){lt&&(C.current[w.getItemId(xe)]=lt)}),V["aria-disabled"]=Fe,V["aria-selected"]=Tt===Ze.selectedItem,V.id=w.getItemId(xe),V.role="option",V),Te);return Fe||(Qe.onClick=tn(X,mt)),Qe.onMouseMove=tn(ae,st),Qe.onMouseDown=tn(fe,At),Qe},[N,w,T,E,u]);return{getToggleButtonProps:re,getLabelProps:U,getMenuProps:Z,getItemProps:me,toggleMenu:F,openMenu:H,closeMenu:z,setHighlightedIndex:J,selectItem:Y,reset:B,setInputValue:W,highlightedIndex:m,isOpen:d,selectedItem:p,inputValue:g}}var av=0,iv=1,ov=2,lv=3,cv=4,uv=5,dv=6,mv=7,fv=8,gf=9,hv=10,fk=11,hk=12,pv=13,pk=14,gk=15,xk=16,vk=17,yk=18,gv=19,bk=20,Ck=21,xv=22,wk=Object.freeze({__proto__:null,ControlledPropUpdatedSelectedItem:xv,FunctionCloseMenu:vk,FunctionOpenMenu:xk,FunctionReset:Ck,FunctionSelectItem:gv,FunctionSetHighlightedIndex:yk,FunctionSetInputValue:bk,FunctionToggleMenu:gk,InputBlur:gf,InputChange:fv,InputClick:hv,InputKeyDownArrowDown:av,InputKeyDownArrowUp:iv,InputKeyDownEnd:cv,InputKeyDownEnter:mv,InputKeyDownEscape:ov,InputKeyDownHome:lv,InputKeyDownPageDown:dv,InputKeyDownPageUp:uv,ItemClick:pv,ItemMouseMove:hk,MenuMouseLeave:fk,ToggleButtonClick:pk});function nq(e){var t=XS(e),r=t.selectedItem,s=t.inputValue;return s===""&&r&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(s=e.itemToString(r)),bt({},t,{inputValue:s})}bt({},rk,{items:ke.array.isRequired,isItemDisabled:ke.func,inputValue:ke.string,defaultInputValue:ke.string,initialInputValue:ke.string,inputId:ke.string,onInputValueChange:ke.func});function rq(e,t,r,s){var a=f.useRef(),i=QS(e,t,r,s),l=i[0],u=i[1],d=fh();return f.useEffect(function(){if(GS(t,"selectedItem")){if(!d){var m=t.itemToKey(t.selectedItem)!==t.itemToKey(a.current);m&&u({type:xv,inputValue:t.itemToString(t.selectedItem)})}a.current=l.selectedItem===a.current?t.selectedItem:l.selectedItem}},[l.selectedItem,t.selectedItem]),[uf(l,t),u]}var sq=bt({},kc,{isItemDisabled:function(){return!1}});function aq(e,t){var r,s=t.type,a=t.props,i=t.altKey,l;switch(s){case pv:l={isOpen:vs(a,"isOpen"),highlightedIndex:ff(a),selectedItem:a.items[t.index],inputValue:a.itemToString(a.items[t.index])};break;case av:e.isOpen?l={highlightedIndex:Aa(e.highlightedIndex,1,a.items,a.isItemDisabled,!0)}:l={highlightedIndex:i&&e.selectedItem==null?-1:xi(a,e,1),isOpen:a.items.length>=0};break;case iv:e.isOpen?i?l=mf(a,e.highlightedIndex):l={highlightedIndex:Aa(e.highlightedIndex,-1,a.items,a.isItemDisabled,!0)}:l={highlightedIndex:xi(a,e,-1),isOpen:a.items.length>=0};break;case mv:l=mf(a,e.highlightedIndex);break;case ov:l=bt({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case uv:l={highlightedIndex:Aa(e.highlightedIndex,-10,a.items,a.isItemDisabled,!0)};break;case dv:l={highlightedIndex:Aa(e.highlightedIndex,10,a.items,a.isItemDisabled,!0)};break;case lv:l={highlightedIndex:Jo(0,!1,a.items,a.isItemDisabled)};break;case cv:l={highlightedIndex:Jo(a.items.length-1,!0,a.items,a.isItemDisabled)};break;case gf:l=bt({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((r=a.items)==null?void 0:r.length)&&t.selectItem&&{selectedItem:a.items[e.highlightedIndex],inputValue:a.itemToString(a.items[e.highlightedIndex])});break;case fv:l={isOpen:!0,highlightedIndex:ff(a),inputValue:t.inputValue};break;case hv:l={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:xi(a,e,0)};break;case gv:l={selectedItem:t.selectedItem,inputValue:a.itemToString(t.selectedItem)};break;case xv:l={inputValue:t.inputValue};break;default:return sk(e,t,wk)}return bt({},e,l)}var iq=["onMouseLeave","refKey","ref"],oq=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],lq=["onClick","onPress","refKey","ref"],cq=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];Ln.stateChangeTypes=wk;function Ln(e){e===void 0&&(e={});var t=bt({},sq,e),r=t.items,s=t.scrollIntoView,a=t.environment,i=t.getA11yStatusMessage,l=rq(aq,t,nq,nk),u=l[0],d=l[1],m=u.isOpen,p=u.highlightedIndex,g=u.selectedItem,v=u.inputValue,y=f.useRef(null),C=f.useRef({}),b=f.useRef(null),w=f.useRef(null),N=fh(),k=ZS(t),E=f.useRef(),T=mh({state:u,props:t}),_=f.useCallback(function(Q){return C.current[k.getItemId(Q)]},[k]);G2(i,u,[m,p,g,v],a);var I=tk({menuElement:y.current,highlightedIndex:p,isOpen:m,itemRefs:C,scrollIntoView:s,getItemNodeFromIndex:_});f.useEffect(function(){var Q=gi(t,"isOpen");Q&&b.current&&b.current.focus()},[]),f.useEffect(function(){N||(E.current=r.length)});var F=ek(a,f.useCallback(function(){T.current.state.isOpen&&d({type:gf,selectItem:!1})},[d,T]),f.useMemo(function(){return[y,w,b]},[y.current,w.current,b.current])),z=K2();f.useEffect(function(){m||(C.current={})},[m]),f.useEffect(function(){var Q;!m||!(a!=null&&a.document)||!(b!=null&&(Q=b.current)!=null&&Q.focus)||a.document.activeElement!==b.current&&b.current.focus()},[m,a]);var H=f.useMemo(function(){return{ArrowDown:function(ae){ae.preventDefault(),d({type:av,altKey:ae.altKey})},ArrowUp:function(ae){ae.preventDefault(),d({type:iv,altKey:ae.altKey})},Home:function(ae){T.current.state.isOpen&&(ae.preventDefault(),d({type:lv}))},End:function(ae){T.current.state.isOpen&&(ae.preventDefault(),d({type:cv}))},Escape:function(ae){var X=T.current.state;(X.isOpen||X.inputValue||X.selectedItem||X.highlightedIndex>-1)&&(ae.preventDefault(),d({type:ov}))},Enter:function(ae){var X=T.current.state;!X.isOpen||ae.which===229||(ae.preventDefault(),d({type:mv}))},PageUp:function(ae){T.current.state.isOpen&&(ae.preventDefault(),d({type:uv}))},PageDown:function(ae){T.current.state.isOpen&&(ae.preventDefault(),d({type:dv}))}}},[d,T]),J=f.useCallback(function(Q){return bt({id:k.labelId,htmlFor:k.inputId},Q)},[k]),Y=f.useCallback(function(Q,ae){var X,fe=Q===void 0?{}:Q,he=fe.onMouseLeave,se=fe.refKey,le=se===void 0?"ref":se,Ae=fe.ref,Te=xs(fe,iq),Ue=ae===void 0?{}:ae;return Ue.suppressRefError,bt((X={},X[le]=$s(Ae,function(Ze){y.current=Ze}),X.id=k.menuId,X.role="listbox",X["aria-labelledby"]=Te&&Te["aria-label"]?void 0:""+k.labelId,X.onMouseLeave=tn(he,function(){d({type:fk})}),X),Te)},[d,z,k]),B=f.useCallback(function(Q){var ae,X,fe=Q===void 0?{}:Q,he=fe.item,se=fe.index,le=fe.refKey,Ae=le===void 0?"ref":le,Te=fe.ref,Ue=fe.onMouseMove,Ze=fe.onMouseDown,ct=fe.onClick;fe.onPress;var ht=fe.disabled,Tt=xs(fe,oq);ht!==void 0&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var xe=T.current,Fe=xe.props,st=xe.state,mt=z2(he,se,Fe.items,"Pass either item or index to getItemProps!"),At=mt[0],Qe=mt[1],lt=Fe.isItemDisabled(At,Qe),wt="onClick",Mt=ct,_t=function(){F.isTouchEnd||Qe===st.highlightedIndex||(I.current=!1,d({type:hk,index:Qe,disabled:lt}))},pt=function(){d({type:pv,index:Qe})},vn=function(An){return An.preventDefault()};return bt((ae={},ae[Ae]=$s(Te,function($t){$t&&(C.current[k.getItemId(Qe)]=$t)}),ae["aria-disabled"]=lt,ae["aria-selected"]=Qe===st.highlightedIndex,ae.id=k.getItemId(Qe),ae.role="option",ae),!lt&&(X={},X[wt]=tn(Mt,pt),X),{onMouseMove:tn(Ue,_t),onMouseDown:tn(Ze,vn)},Tt)},[d,k,T,F,I]),W=f.useCallback(function(Q){var ae,X=Q===void 0?{}:Q,fe=X.onClick;X.onPress;var he=X.refKey,se=he===void 0?"ref":he,le=X.ref,Ae=xs(X,lq),Te=T.current.state,Ue=function(){d({type:pk})};return bt((ae={},ae[se]=$s(le,function(Ze){w.current=Ze}),ae["aria-controls"]=k.menuId,ae["aria-expanded"]=Te.isOpen,ae.id=k.toggleButtonId,ae.tabIndex=-1,ae),!Ae.disabled&&bt({},{onClick:tn(fe,Ue)}),Ae)},[d,T,k]),U=f.useCallback(function(Q,ae){var X,fe=Q===void 0?{}:Q,he=fe.onKeyDown,se=fe.onChange,le=fe.onInput,Ae=fe.onBlur;fe.onChangeText;var Te=fe.onClick,Ue=fe.refKey,Ze=Ue===void 0?"ref":Ue,ct=fe.ref,ht=xs(fe,cq),Tt=ae===void 0?{}:ae;Tt.suppressRefError;var xe=T.current.state,Fe=function(_t){var pt=df(_t);pt&&H[pt]&&H[pt](_t)},st=function(_t){d({type:fv,inputValue:_t.target.value})},mt=function(_t){if(a!=null&&a.document&&xe.isOpen&&!F.isMouseDown){var pt=_t.relatedTarget===null&&a.document.activeElement!==a.document.body;d({type:gf,selectItem:!pt})}},At=function(){d({type:hv})},Qe="onChange",lt={};if(!ht.disabled){var wt;lt=(wt={},wt[Qe]=tn(se,le,st),wt.onKeyDown=tn(he,Fe),wt.onBlur=tn(Ae,mt),wt.onClick=tn(Te,At),wt)}return bt((X={},X[Ze]=$s(ct,function(Mt){b.current=Mt}),X["aria-activedescendant"]=xe.isOpen&&xe.highlightedIndex>-1?k.getItemId(xe.highlightedIndex):"",X["aria-autocomplete"]="list",X["aria-controls"]=k.menuId,X["aria-expanded"]=xe.isOpen,X["aria-labelledby"]=ht&&ht["aria-label"]?void 0:k.labelId,X.autoComplete="off",X.id=k.inputId,X.role="combobox",X.value=xe.inputValue,X),lt,ht)},[d,k,a,H,T,F,z]),Z=f.useCallback(function(){d({type:gk})},[d]),re=f.useCallback(function(){d({type:vk})},[d]),me=f.useCallback(function(){d({type:xk})},[d]),L=f.useCallback(function(Q){d({type:yk,highlightedIndex:Q})},[d]),V=f.useCallback(function(Q){d({type:gv,selectedItem:Q})},[d]),P=f.useCallback(function(Q){d({type:bk,inputValue:Q})},[d]),q=f.useCallback(function(){d({type:Ck})},[d]);return{getItemProps:B,getLabelProps:J,getMenuProps:Y,getInputProps:U,getToggleButtonProps:W,toggleMenu:Z,openMenu:me,closeMenu:re,setHighlightedIndex:L,setInputValue:P,selectItem:V,reset:q,highlightedIndex:p,isOpen:m,selectedItem:g,inputValue:v}}var jk={activeIndex:-1,selectedItems:[]};function B9(e,t){return gi(e,t,jk)}function U9(e,t){return vs(e,t,jk)}function uq(e){var t=B9(e,"activeIndex"),r=B9(e,"selectedItems");return{activeIndex:t,selectedItems:r}}function V9(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&t.value!==""&&(t.selectionStart!==0||t.selectionEnd!==0))}function dq(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}Em.stateReducer,Em.itemToKey,Em.environment,ke.array,ke.array,ke.array,ke.func,ke.number,ke.number,ke.number,ke.func,ke.func,ke.string,ke.string;var mq={itemToKey:kc.itemToKey,stateReducer:kc.stateReducer,environment:kc.environment,keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},vv=0,yv=1,bv=2,Cv=3,wv=4,jv=5,Sv=6,kv=7,Nv=8,Ev=9,Av=10,Pv=11,Tv=12,fq=Object.freeze({__proto__:null,DropdownClick:kv,DropdownKeyDownBackspace:Sv,DropdownKeyDownNavigationPrevious:jv,FunctionAddSelectedItem:Nv,FunctionRemoveSelectedItem:Ev,FunctionReset:Tv,FunctionSetActiveIndex:Pv,FunctionSetSelectedItems:Av,SelectedItemClick:vv,SelectedItemKeyDownBackspace:bv,SelectedItemKeyDownDelete:yv,SelectedItemKeyDownNavigationNext:Cv,SelectedItemKeyDownNavigationPrevious:wv});function hq(e,t){var r=t.type,s=t.index,a=t.props,i=t.selectedItem,l=e.activeIndex,u=e.selectedItems,d;switch(r){case vv:d={activeIndex:s};break;case wv:d={activeIndex:l-1<0?0:l-1};break;case Cv:d={activeIndex:l+1>=u.length?-1:l+1};break;case bv:case yv:{if(l<0)break;var m=l;u.length===1?m=-1:l===u.length-1&&(m=u.length-2),d=bt({selectedItems:[].concat(u.slice(0,l),u.slice(l+1))},{activeIndex:m});break}case jv:d={activeIndex:u.length-1};break;case Sv:d={selectedItems:u.slice(0,u.length-1)};break;case Nv:d={selectedItems:[].concat(u,[i])};break;case kv:d={activeIndex:-1};break;case Ev:{var p=l,g=u.findIndex(function(C){return a.itemToKey(C)===a.itemToKey(i)});if(g<0)break;u.length===1?p=-1:g===u.length-1&&(p=u.length-2),d={selectedItems:[].concat(u.slice(0,g),u.slice(g+1)),activeIndex:p};break}case Av:{var v=t.selectedItems;d={selectedItems:v};break}case Pv:{var y=t.activeIndex;d={activeIndex:y};break}case Tv:d={activeIndex:U9(a,"activeIndex"),selectedItems:U9(a,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return bt({},e,d)}var pq=["refKey","ref","onClick","onKeyDown","selectedItem","index"],gq=["refKey","ref","onKeyDown","onClick","preventKeyAction"];mi.stateChangeTypes=fq;function mi(e){e===void 0&&(e={});var t=bt({},mq,e),r=t.getA11yStatusMessage,s=t.environment,a=t.keyNavigationNext,i=t.keyNavigationPrevious,l=JS(hq,t,uq,dq),u=l[0],d=l[1],m=u.activeIndex,p=u.selectedItems,g=fh(),v=f.useRef(null),y=f.useRef();y.current=[];var C=mh({state:u,props:t});G2(r,u,[m,p],s),f.useEffect(function(){g||(m===-1&&v.current?v.current.focus():y.current[m]&&y.current[m].focus())},[m]);var b=K2(),w=f.useMemo(function(){var H;return H={},H[i]=function(){d({type:wv})},H[a]=function(){d({type:Cv})},H.Delete=function(){d({type:yv})},H.Backspace=function(){d({type:bv})},H},[d,a,i]),N=f.useMemo(function(){var H;return H={},H[i]=function(J){V9(J)&&d({type:jv})},H.Backspace=function(Y){V9(Y)&&d({type:Sv})},H},[d,i]),k=f.useCallback(function(H){var J,Y=H===void 0?{}:H,B=Y.refKey,W=B===void 0?"ref":B,U=Y.ref,Z=Y.onClick,re=Y.onKeyDown,me=Y.selectedItem,L=Y.index,V=xs(Y,pq),P=C.current.state,q=z2(me,L,P.selectedItems,"Pass either item or index to getSelectedItemProps!"),Q=q[1],ae=Q>-1&&Q===P.activeIndex,X=function(){d({type:vv,index:Q})},fe=function(se){var le=df(se);le&&w[le]&&w[le](se)};return bt((J={},J[W]=$s(U,function(he){he&&y.current.push(he)}),J.tabIndex=ae?0:-1,J.onClick=tn(Z,X),J.onKeyDown=tn(re,fe),J),V)},[d,C,w]),E=f.useCallback(function(H,J){var Y,B=H===void 0?{}:H,W=B.refKey,U=W===void 0?"ref":W,Z=B.ref,re=B.onKeyDown,me=B.onClick,L=B.preventKeyAction,V=L===void 0?!1:L,P=xs(B,gq),q=J===void 0?{}:J;q.suppressRefError;var Q=function(fe){var he=df(fe);he&&N[he]&&N[he](fe)},ae=function(){d({type:kv})};return bt((Y={},Y[U]=$s(Z,function(X){X&&(v.current=X)}),Y),!V&&{onKeyDown:tn(re,Q),onClick:tn(me,ae)},P)},[d,N,b]),T=f.useCallback(function(H){d({type:Nv,selectedItem:H})},[d]),_=f.useCallback(function(H){d({type:Ev,selectedItem:H})},[d]),I=f.useCallback(function(H){d({type:Av,selectedItems:H})},[d]),F=f.useCallback(function(H){d({type:Pv,activeIndex:H})},[d]),z=f.useCallback(function(){d({type:Tv})},[d]);return{getSelectedItemProps:k,getDropdownProps:E,addSelectedItem:T,removeSelectedItem:_,setSelectedItems:I,setActiveIndex:F,reset:z,selectedItems:p,activeIndex:m}}const Cg={base:{base:"bg-gray-200 dark:bg-gray-600/40 dark:text-gray-300",iconOpacity:"opacity-40 dark:opacity-40",disabledIconOpacity:"opacity-20 dark:opacity-20"},warning:{base:"bg-orange-50 dark:bg-yellow-600/40 text-text-warning",iconOpacity:"opacity-50 dark:opacity-60",disabledIconOpacity:"opacity-30 dark:opacity-20"},primary:{base:"bg-blue-0 dark:bg-blue-600/40 text-text-primary",iconOpacity:"opacity-70 dark:opacity-60",disabledIconOpacity:"opacity-40 dark:opacity-20"}},xl=f.forwardRef(({children:e,className:t,intent:r="base",readOnly:s=!1,disabled:a=!1,onRemove:i,...l},u)=>{const d=typeof e=="string"?e:void 0,m=f.useCallback(y=>{y.stopPropagation(),i&&!a&&i()},[i,a]),p=f.useCallback(y=>{if(a)return;const C=y.key==="Enter"||y.key===" ",b=y.key==="Backspace"||y.key==="Delete";(C||b)&&(y.preventDefault(),y.stopPropagation(),i?.())},[a,i]),g=D("flex items-center gap-0.5 max-w-fit px-2 py-1 text-sm transition-colors rounded",{[Cg[r].base]:!0,"pr-1":!s},t),v=l;return n.jsxs("div",{ref:u,className:g,...v,children:[n.jsx("span",{className:"max-w-52 truncate select-none",children:e}),!s&&n.jsx("button",{type:"button",onClick:m,disabled:a,"aria-label":d?`Remove ${d}`:"Remove",tabIndex:a?-1:0,onKeyDown:p,className:D("group flex-shrink-0 rounded-sm",{"focus-visible:outline-outline-focus":!a,"cursor-not-allowed":a}),children:n.jsx(Or,{size:16,className:D("stroke-current transition-opacity",{[Cg[r].disabledIconOpacity]:a,[Cg[r].iconOpacity]:!a,"group-hover:opacity-100 group-focus-visible:opacity-100":!a})})})]})});xl.displayName="Chip";const cce=Object.freeze(Object.defineProperty({__proto__:null,default:xl},Symbol.toStringTag,{value:"Module"}));class U0{value;_label;disabledTooltip;data;constructor({value:t,label:r,data:s,disabledTooltip:a}){this.value=t,this._label=r,this.data=s,this.disabledTooltip=a}displayLabel(){return this._label||this.value}includesIgnoreCase(t){const r=t.toLocaleLowerCase();return this.value.toLocaleLowerCase().includes(r)||this._label!==void 0&&this._label.toLocaleLowerCase().includes(r)}equalsIgnoreCase(t){const r=t.toLocaleLowerCase();return this.value.toLocaleLowerCase()===r||this._label!==void 0&&this._label.toLocaleLowerCase()===r}}class $9 extends U0{addHint;constructor({value:t,label:r,data:s,addHint:a,disabledTooltip:i}){super({value:t,label:r,data:s,disabledTooltip:i}),this.addHint=a}}function xq({values:e,selectedItems:t,onItemCreated:r,onSelectedItemsChanged:s,placeholder:a,hideSelectedItems:i,renderItem:l,addHint:u,withoutLeftBorder:d,withSearchIcon:m,autofocus:p}){const[g,v]=f.useState(""),y=f.useRef(null),C=f.useRef(null),[b,w]=f.useState(e);f.useEffect(()=>{w(((B,W)=>e.filter(U=>!B.some(Z=>Z.value===U.value)&&U.includesIgnoreCase(W)))(t,g))},[g,t,e]);const{getDropdownProps:N,removeSelectedItem:k}=mi({selectedItems:t,onStateChange({selectedItems:Y,type:B}){switch(B){case mi.stateChangeTypes.SelectedItemKeyDownBackspace:case mi.stateChangeTypes.SelectedItemKeyDownDelete:case mi.stateChangeTypes.DropdownKeyDownBackspace:case mi.stateChangeTypes.FunctionRemoveSelectedItem:{s(Y||[]);break}}}}),{isOpen:E,getMenuProps:T,getInputProps:_,highlightedIndex:I,setHighlightedIndex:F,getItemProps:z,getToggleButtonProps:H}=Ln({items:b,itemToString(Y){return Y?.displayLabel()||""},defaultHighlightedIndex:void 0,defaultIsOpen:!1,selectedItem:null,isItemDisabled(Y){return!!Y?.disabledTooltip},inputValue:g,onStateChange({inputValue:Y,type:B,selectedItem:W}){switch(B){case Ln.stateChangeTypes.InputKeyDownEnter:case Ln.stateChangeTypes.ItemClick:case Ln.stateChangeTypes.InputBlur:{W&&(s([...t,W]),e.includes(W)||(r?.(W),w(e)),v(""));break}case Ln.stateChangeTypes.InputChange:{v(Y||""),Y!==""&&F(0);break}}}});return n.jsxs("div",{ref:C,className:"relative",onClick:()=>{y.current?.focus()},children:[n.jsxs("div",{className:D("focus-within:visible-focus focus-within:outline-offset-0 focus-within:border-border-focus","flex flex-row rounded-md border border-border-interactive hover:border-border-interactive-hover px-3 py-1",{"rounded-l-none":d,"!pl-2":m}),children:[m&&n.jsx(Jx,{className:"text-text-disabled mr-2 mt-1 flex-shrink-0 flex-grow-0",size:"1.25em"}),n.jsxs("div",{className:D("flex flex-row items-center flex-wrap gap-1 self-stretch flex-grow flex-shrink py-px"),children:[i?n.jsx(n.Fragment,{}):t.map(Y=>n.jsx(xl,{onRemove:()=>{k(Y)},children:Y.displayLabel()},Y.value)),n.jsx("input",{type:"text",className:D("input !border-none flex-shrink flex-grow mr-0 pl-0 min-w-0 w-9 focus:outline-none h-6"),placeholder:t.length>0?"":a,..._(N({ref:y})),autoFocus:p})]}),n.jsx("button",{type:"button","aria-label":"toggle menu",className:"self-start",...H(),children:n.jsx(Nn,{className:"text-text-muted w-4 mt-0.5 flex-shrink-0 flex-grow-0"})})]}),n.jsx(vq,{inputItems:b,highlightedIndex:I,isOpen:E,getMenuProps:T,getItemProps:z,renderItem:l,inputValue:g,addHint:u,allowCreate:r!==void 0,containerRef:C})]})}function vq({inputItems:e,highlightedIndex:t,isOpen:r,getMenuProps:s,getItemProps:a,renderItem:i,inputValue:l,addHint:u,allowCreate:d,containerRef:m}){const[p,g]=f.useState();f.useEffect(()=>{if(!m.current)return;const y=()=>{if(!m.current)return;const b=m.current.getBoundingClientRect();g(window.innerHeight-b.bottom-16)},C=[];if(r){y(),window.addEventListener("resize",y);let b=m.current.parentElement;for(;b&&b!==document.body;)C.push({element:b,originalOverflow:b.style.overflow||getComputedStyle(b).overflow}),b.style.overflow="visible",b=b.parentElement}return()=>{window.removeEventListener("resize",y),C.forEach(({element:b,originalOverflow:w})=>{b.style.overflow=w==="visible"?"":w})}},[r,m]),d&&l&&!e.some(C=>C.equalsIgnoreCase(l))&&e.unshift(new $9({value:l,addHint:u}));const v=(y,C)=>{const b=()=>n.jsxs("div",{className:D("flex items-center justify-between",{"text-text-disabled":!!y.disabledTooltip}),children:[n.jsx("span",{className:"truncate",children:y.displayLabel()}),C===0&&l&&y instanceof $9&&n.jsx("span",{className:"text-sm text-text-disabled float-right",children:y.addHint})]});return y.disabledTooltip?n.jsx(Ee,{content:y.disabledTooltip,children:b()}):b()};return n.jsx("div",{className:"bg-bg-base overflow-auto rounded-b-md -mt-[1px]",children:n.jsx("ul",{className:`absolute w-full bg-bg-base mt-1 shadow-md rounded-b-md max-h-80 overflow-auto p-0 z-[9999] ${!(r&&e.length>0)&&"hidden"}`,...s(),style:{maxHeight:p?`min(20rem, ${p}px)`:void 0},children:r&&e.map((y,C)=>n.jsx("li",{className:D(t===C&&"bg-bg-menu-item-hover","py-2 px-3 flex flex-col"),...a({item:y,index:C}),children:i?i(y):v(y,C)},`${y.value}${C}`))})})}function V0(e){const{tag:t,className:r,hideTooltip:s,invalid:a,removable:i,onDelete:l}=e,u=t.replace("tag:","");return n.jsx(Ee,{content:!s&&bq(a),children:n.jsxs(We,{variant:"status",color:a?"gray":"outline",className:D("flex items-center",r),children:[a&&n.jsx(t2,{className:"mr-1 text-text-muted",size:10,strokeWidth:3}),n.jsx("span",{className:"text-text-muted",children:"tag:"}),n.jsx("span",{className:"font-medium",children:u}),i&&n.jsx("div",{className:"ml-1",children:n.jsx("button",{onClick:l,children:n.jsx(Or,{size:12})})})]})})}function yq(e){const{className:t,tag:r}=e;return n.jsx(We,{variant:"status",color:"gray",className:D("flex items-center",t),children:n.jsx("span",{className:"text-transparent","aria-hidden":"true",children:r??"tag:fake"})})}const bq=e=>e==="not-defined"?"This tag was deleted from the tailnet policy file, but never removed from this machine. It does not affect access anymore, and can be removed safely.":e==="not-tag-owner"?"This tag is invalid because the machine’s creator is not in the tag owners’ group. See the tailnet policy file for who is allowed to claim a tag.":void 0;function Iv(e){const{className:t,tags:r,disabled:s,updateTags:a}=e,{assignable:i,loaded:l}=WS();return n.jsxs("div",{className:D(t,"flex flex-col gap-2"),children:[n.jsx(Ee,{content:l&&i.size===0&&"You are not an owner of any tags.",children:n.jsx("div",{className:D({"pointer-events-none opacity-50":s||!l}),children:n.jsx(xq,{values:[...i].map(u=>new U0({value:u})),selectedItems:r.map(u=>new U0({value:u})),onSelectedItemsChanged:u=>a(u.map(d=>d.value)),placeholder:"Add tags",withSearchIcon:!0,autofocus:!0})})}),n.jsx("a",{className:"link self-end block",href:"/admin/acls/visual/tags",children:"Manage tags in Access Controls"})]})}function Sk(e){const t=f.useRef({value:e,previous:e});return f.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var hh="Checkbox",[Cq]=Cr(hh),[wq,Dv]=Cq(hh);function jq(e){const{__scopeCheckbox:t,checked:r,children:s,defaultChecked:a,disabled:i,form:l,name:u,onCheckedChange:d,required:m,value:p="on",internal_do_not_use_render:g}=e,[v,y]=Mr({prop:r,defaultProp:a??!1,onChange:d,caller:hh}),[C,b]=f.useState(null),[w,N]=f.useState(null),k=f.useRef(!1),E=C?!!l||!!C.closest("form"):!0,T={checked:v,disabled:i,setChecked:y,control:C,setControl:b,name:u,form:l,value:p,hasConsumerStoppedPropagationRef:k,required:m,defaultChecked:Ia(a)?!1:a,isFormControl:E,bubbleInput:w,setBubbleInput:N};return n.jsx(wq,{scope:t,...T,children:Sq(g)?g(T):s})}var kk="CheckboxTrigger",Nk=f.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...s},a)=>{const{control:i,value:l,disabled:u,checked:d,required:m,setControl:p,setChecked:g,hasConsumerStoppedPropagationRef:v,isFormControl:y,bubbleInput:C}=Dv(kk,e),b=Ct(a,p),w=f.useRef(d);return f.useEffect(()=>{const N=i?.form;if(N){const k=()=>g(w.current);return N.addEventListener("reset",k),()=>N.removeEventListener("reset",k)}},[i,g]),n.jsx(tt.button,{type:"button",role:"checkbox","aria-checked":Ia(d)?"mixed":d,"aria-required":m,"data-state":Dk(d),"data-disabled":u?"":void 0,disabled:u,value:l,...s,ref:b,onKeyDown:je(t,N=>{N.key==="Enter"&&N.preventDefault()}),onClick:je(r,N=>{g(k=>Ia(k)?!0:!k),C&&y&&(v.current=N.isPropagationStopped(),v.current||N.stopPropagation())})})});Nk.displayName=kk;var Ek=f.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:s,checked:a,defaultChecked:i,required:l,disabled:u,value:d,onCheckedChange:m,form:p,...g}=e;return n.jsx(jq,{__scopeCheckbox:r,checked:a,defaultChecked:i,disabled:u,required:l,onCheckedChange:m,name:s,form:p,value:d,internal_do_not_use_render:({isFormControl:v})=>n.jsxs(n.Fragment,{children:[n.jsx(Nk,{...g,ref:t,__scopeCheckbox:r}),v&&n.jsx(Ik,{__scopeCheckbox:r})]})})});Ek.displayName=hh;var Ak="CheckboxIndicator",Pk=f.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:s,...a}=e,i=Dv(Ak,r);return n.jsx(En,{present:s||Ia(i.checked)||i.checked===!0,children:n.jsx(tt.span,{"data-state":Dk(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});Pk.displayName=Ak;var Tk="CheckboxBubbleInput",Ik=f.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:s,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:l,required:u,disabled:d,name:m,value:p,form:g,bubbleInput:v,setBubbleInput:y}=Dv(Tk,e),C=Ct(r,y),b=Sk(i),w=t7(s);f.useEffect(()=>{const k=v;if(!k)return;const E=window.HTMLInputElement.prototype,_=Object.getOwnPropertyDescriptor(E,"checked").set,I=!a.current;if(b!==i&&_){const F=new Event("click",{bubbles:I});k.indeterminate=Ia(i),_.call(k,Ia(i)?!1:i),k.dispatchEvent(F)}},[v,b,i,a]);const N=f.useRef(Ia(i)?!1:i);return n.jsx(tt.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??N.current,required:u,disabled:d,name:m,value:p,form:g,...t,tabIndex:-1,ref:C,style:{...t.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});Ik.displayName=Tk;function Sq(e){return typeof e=="function"}function Ia(e){return e==="indeterminate"}function Dk(e){return Ia(e)?"indeterminate":e?"checked":"unchecked"}function yr(e){const{id:t,label:r,description:s,disabled:a,checked:i,className:l,labelClassName:u,descriptionClassName:d,truncateLabel:m,onChange:p}=e;return n.jsx("div",{className:D("flex flex-col",l),children:n.jsxs("div",{className:D("gap-2.5",{flex:s,"inline-flex":!s,"items-start":s,"items-center":!s,"min-w-0":m}),children:[n.jsx(Ek,{id:t,checked:i,className:D("flex flex-shrink-0 w-4 h-4 items-center justify-center relative mt-0.5","text-white border rounded shadow-form transition-colors duration-[120ms]","enabled:focus-visible:visible-focus","disabled:pointer-events-none disabled:select-none",{"bg-blue-500 border-blue-500 dark:bg-blue-400 dark:border-blue-400":i,"enabled:hover:bg-blue-600 dark:enabled:hover:bg-blue-500 enabled:hover:border-blue-600 dark:enabled:hover:border-blue-500":i,"disabled:bg-blue-200 dark:disabled:bg-blue-500 disabled:border-blue-200 dark:disabled:border-blue-500 disabled:text-blue-0 dark:disabled:opacity-40":i,"bg-gray-0 border-gray-300 dark:bg-gray-700 dark:border-gray-600":!i,"enabled:hover:bg-gray-100 dark:enabled:hover:bg-gray-600 enabled:hover:border-gray-300 dark:enabled:hover:border-gray-500":!i,"disabled:shadow-none disabled:border-gray-200 dark:disabled:border-gray-500/50 dark:disabled:bg-gray-600 dark:disabled:opacity-40":!i}),disabled:a,onCheckedChange:p,children:n.jsx(Pk,{className:"absolute",children:n.jsx(nn,{className:D("transition-colors duration-[120ms] group-disabled:text-blue-50 dark:group-disabled:text-blue-500",{"opacity-0":!i}),size:".875rem",strokeWidth:3})})}),n.jsxs("label",{htmlFor:t,className:D("cursor-pointer",{"max-w-full min-w-0":m}),children:[n.jsx("span",{className:D("select-none block",{"text-text-disabled cursor-not-allowed transition-colors duration-[120ms]":a,truncate:m},u),children:r}),s&&n.jsx("p",{className:D("text-text-muted text-sm leading-tight select-none transition-colors duration-[120ms]",d),children:s})]})]})})}const uce=Object.freeze(Object.defineProperty({__proto__:null,default:yr},Symbol.toStringTag,{value:"Module"}));function fn(e){const{action:t,className:r,description:s,icon:a,title:i}=e,u=kq(a,"text-text-muted");return n.jsxs("div",{className:D("flex justify-center",r,{"flex-col items-center":t||a||i}),children:[a&&n.jsx("div",{className:"mb-2",children:u}),i&&n.jsx("h3",{className:"text-xl font-medium text-center mb-2",children:i}),n.jsx("div",{className:"w-full text-center max-w-xl text-text-muted",children:s}),t&&n.jsx("div",{className:"mt-3.5",children:t})]})}function kq(e,t){return e?f.cloneElement(e,{className:t}):null}const dce=Object.freeze(Object.defineProperty({__proto__:null,default:fn},Symbol.toStringTag,{value:"Module"})),Nu=f.forwardRef((e,t)=>{const{className:r,inputClassName:s,onClearClick:a,...i}=e;return n.jsxs("div",{className:D("relative",r),children:[n.jsx(Jx,{className:"absolute text-text-disabled h-full ml-2",size:"1.25em"}),n.jsx("input",{type:"text",className:D("input px-8",s),ref:t,...i}),a&&i.value&&n.jsx("a",{href:"#",onClick:l=>{l.preventDefault(),a()},children:n.jsx(Or,{className:"absolute text-text-disabled h-full top-0 right-0 mr-2",size:"1.25em"})})]})});Nu.displayName="SearchInput";function Nq(e){const{disabled:t,children:r,tags:s,selected:a,onChange:i,open:l,side:u,align:d,onOpenChange:m}=e;return n.jsx(Ni,{open:t?!1:l,onOpenChange:m,side:u,sideOffset:5,align:d,content:n.jsx(Eq,{tags:s,selected:a,onChange:i}),modal:!0,asChild:!0,children:r})}function Eq(e){const{tags:t,selected:r,onChange:s,onOpenChange:a}=e,[i,l]=f.useState(""),u=f.useMemo(()=>t.filter(v=>v.includes(i)),[t,i]),{getMenuProps:d,getInputProps:m,highlightedIndex:p,getItemProps:g}=Ln({selectedItem:null,items:u,itemToString:v=>v||"",inputValue:i,onIsOpenChange:({isOpen:v})=>v===void 0?void 0:a?.(v),stateReducer(v,y){const{changes:C,type:b}=y;switch(b){case Ln.stateChangeTypes.InputBlur:case Ln.stateChangeTypes.InputKeyDownEnter:case Ln.stateChangeTypes.MenuMouseLeave:case Ln.stateChangeTypes.ItemClick:return{...C,highlightedIndex:v.highlightedIndex,isOpen:!0};default:return C}},onStateChange({type:v,inputValue:y,selectedItem:C}){switch(v){case Ln.stateChangeTypes.InputKeyDownEnter:case Ln.stateChangeTypes.ItemClick:{C&&(r.includes(C)?s(r.filter(b=>b!==C)):s([...r,C]));break}case Ln.stateChangeTypes.InputChange:{l(y||"");break}}}});return n.jsxs("div",{children:[n.jsx(Nu,{name:"query",inputClassName:"rounded-b-none border-l-0 border-t-0 border-r-0 pr-0 focus:ring-0",autoCorrect:"off",autoComplete:"off",autoCapitalize:"off",placeholder:"Search by tag...",...m()}),n.jsx("ul",{className:"mt-1 max-h-80 overflow-auto rounded-b-md",...d(),children:u.length===0?n.jsx("li",{className:"p-6",children:n.jsx(fn,{description:i?`No tags matching “${i}”`:"No tags available"})}):u.map((v,y)=>n.jsx("li",{className:D("w-full cursor-pointer",Vi,{"bg-bg-menu-item-hover":y===p}),...g({item:v,index:y}),children:n.jsx("div",{className:"flex flex-col justify-between p-1 leading-tight",children:n.jsx("div",{className:"flex items-center pointer-events-none",children:n.jsx(yr,{id:v,checked:r.includes(v),label:v,onChange:()=>{}})})})},`${v}-${y}`))})]})}function Aq(e){const{className:t,tags:r,removeCallback:s,disableChanges:a}=e;return r.length===0?n.jsx(at,{className:t,empty:!0,children:n.jsx(fn,{description:"No tags selected."})}):n.jsx("ul",{className:D("border rounded-lg py-1",t),children:r.map(i=>n.jsxs("li",{className:"flex border-b last:border-0 flex-row pl-5 pr-3 py-2",children:[n.jsx("div",{className:"grow flex justify-between leading-tight",children:n.jsx("div",{className:"flex items-center font-medium",children:i})}),n.jsx(ue,{intent:"danger",variant:"minimal",disabled:a,onClick:()=>s(i),"aria-label":`Remove ${i}`,children:"Remove"})]},i))})}const _k={name:"Custom",id:"custom"};function vl(e){const{data:t,error:r}=dt("/public/tailnet/-/acl/app-connectors/preset-apps",e);return{data:t,error:r}}const Pq=e=>f.createElement("svg",{fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",...e},f.createElement("linearGradient",{id:"a"},f.createElement("stop",{offset:0,stopColor:"#0052cc"}),f.createElement("stop",{offset:.9182,stopColor:"#2380fb"}),f.createElement("stop",{offset:1,stopColor:"#2684ff"})),f.createElement("linearGradient",{id:"b",gradientUnits:"userSpaceOnUse",x1:20.992,x2:8.49356,xlinkHref:"#a",y1:22.3893,y2:15.212}),f.createElement("linearGradient",{id:"c",gradientUnits:"userSpaceOnUse",x1:3.00783,x2:15.5065,xlinkHref:"#a",y1:.769356,y2:7.94667}),f.createElement("path",{d:"m2.72727 16.6305c-.21142.3325-.45306.7254-.63429 1.0277-.18122.3022-.09061.6951.21143.8765l4.13796 2.5387c.30204.1814.69468.0907.87593-.2115.151-.272.36241-.6347.60408-1.0276 1.63099-2.69 3.29222-2.3877 6.25222-.9672l4.1078 1.9343c.3322.1512.6947 0 .8457-.3022l1.9633-4.4429c.151-.3022 0-.6951-.3021-.8463-.8759-.3929-2.5976-1.2089-4.1077-1.9645-5.5878-2.6899-10.32984-2.5086-13.95433 3.385z",fill:"url(#b)"}),f.createElement("path",{d:"m21.2727 6.53596c.2115-.33246.4531-.72537.6343-1.02761s.0906-.69515-.2114-.87649l-4.138-2.53882c-.3021-.18134-.6947-.09066-.8759.21157-.151.27202-.3625.63471-.6041 1.02762-1.6311 2.68992-3.2922 2.38769-6.25227.96716l-4.10774-1.93433c-.33225-.15112-.69469 0-.84571.30224l-1.96327 4.44288c-.15102.30225 0 .69517.30204.84634.87592.39292 2.59756 1.20892 4.10778 1.9645 5.58767 2.65978 10.32977 2.50858 13.95427-3.38506z",fill:"url(#c)"})),Tq=e=>f.createElement("svg",{fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{clipRule:"evenodd",d:"m12.0083 1.9834c-5.53434 0-10.0083 4.50694-10.0083 10.0826 0 4.457 2.86662 8.2297 6.84338 9.565.4972.1004.67932-.217.67932-.4839 0-.2337-.01639-1.0349-.01639-1.8698-2.78406.6011-3.36382-1.2019-3.36382-1.2019-.44741-1.1685-1.11034-1.4688-1.11034-1.4688-.91123-.6177.06637-.6177.06637-.6177 1.01078.0668 1.54117 1.035 1.54117 1.035.89463 1.5356 2.33623 1.1017 2.91619.8346.08277-.6511.34806-1.1018.62972-1.3521-2.22046-.2337-4.55669-1.1017-4.55669-4.9746 0-1.1018.39743-2.00317 1.02717-2.7042-.09936-.25034-.44742-1.28551.09956-2.67098 0 0 .84505-.26714 2.75046 1.03496.8158-.22071 1.6571-.33298 2.5022-.33393.845 0 1.7065.11698 2.5019.33393 1.9057-1.3021 2.7507-1.03496 2.7507-1.03496.547 1.38547.1987 2.42064.0994 2.67098.6463.70103 1.0273 1.6024 1.0273 2.7042 0 3.8729-2.3362 4.7241-4.5733 4.9746.3647.3171.6793.918.6793 1.8696 0 1.352-.0163 2.4372-.0163 2.7709 0 .2671.1823.5845.6793.4843 3.9767-1.3357 6.8434-5.1082 6.8434-9.5652.0163-5.57566-4.474-10.0826-9.9917-10.0826z",fill:"var(--icon-color, #24292f)",fillRule:"evenodd"})),Iq=e=>f.createElement("svg",{fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"m21.68 12.2292c0-.715-.0642-1.4025-.1833-2.0625h-9.4967v3.905h5.4267c-.2384 1.2559-.9534 2.3192-2.0259 3.0342v2.5392h3.2725c1.9067-1.76 3.0067-4.345 3.0067-7.4159z",fill:"#4285f4"}),f.createElement("path",{d:"m12 22.0834c2.7225 0 5.005-.8984 6.6734-2.4384l-3.2725-2.5391c-.8984.605-2.0442.9716-3.4009.9716-2.62165 0-4.84915-1.7691-5.64665-4.1525h-3.355v2.6034c1.65917 3.2908 5.06 5.555 9.00165 5.555z",fill:"#34a853"}),f.createElement("path",{d:"m6.35335 13.916c-.20166-.605-.32083-1.2467-.32083-1.9159 0-.6691.11917-1.3108.32083-1.9158v-2.60334h-3.355c-.6875 1.35666-1.08166 2.88754-1.08166 4.51914 0 1.6317.39416 3.1625 1.08166 4.5192l2.6125-2.035z",fill:"#fbbc05"}),f.createElement("path",{d:"m12 5.93175c1.485 0 2.805.51333 3.8592 1.50333l2.8875-2.8875c-1.7508-1.63167-4.0242-2.63083-6.7467-2.63083-3.94165 0-7.34248 2.26416-9.00165 5.56416l3.355 2.60329c.7975-2.38329 3.025-4.15245 5.64665-4.15245z",fill:"#ea4335"})),Dq=e=>f.createElement("svg",{fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",...e},f.createElement("linearGradient",{id:"a"},f.createElement("stop",{offset:.176,stopColor:"#0052cc"}),f.createElement("stop",{offset:1,stopColor:"#2684ff"})),f.createElement("linearGradient",{id:"b",gradientUnits:"userSpaceOnUse",x1:11.4857,x2:7.36042,xlinkHref:"#a",y1:6.04906,y2:10.0478}),f.createElement("linearGradient",{id:"c",gradientUnits:"userSpaceOnUse",x1:12.5445,x2:16.6616,xlinkHref:"#a",y1:17.9052,y2:13.9144}),f.createElement("path",{d:"m21.1433 11.4459-8.3377-8.60157-.8184-.84433-6.26607 6.46436-2.86448 2.98154c-.30691.3166-.30691.818 0 1.1082l5.72896 5.9103 3.40159 3.5092 6.2661-6.4644.1022-.1055 2.7878-2.8496c.307-.3166.307-.818 0-1.1082zm-9.1561 3.5092-2.86449-2.9551 2.86449-2.95514 2.8645 2.95514z",fill:"#2684ff"}),f.createElement("path",{d:"m11.9872 9.04506c-1.867-1.92611-1.8926-5.06595-.0256-7.01845l-6.24047 6.46438 3.40158 3.50921z",fill:"url(#b)"}),f.createElement("path",{d:"m14.8773 11.9739-2.8901 2.9815c1.8926 1.9525 1.8926 5.0923 0 7.0449l6.2916-6.4908z",fill:"url(#c)"})),_q=e=>f.createElement("svg",{fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"m2.24502 14.3046c-.0445-.1897.1815-.3092.31928-.1714l7.30251 7.3025c.13779.1378.0183.3638-.1714.3193-3.68515-.8645-6.58591-3.7652-7.45039-7.4504zm-.2447-2.9267c-.00353.0566.01777.1119.05791.1521l10.41177 10.4118c.0402.0401.0955.0615.1522.0579.4738-.0295.9387-.092 1.3924-.1852.1529-.0314.2061-.2192.0957-.3296l-11.59517-11.59517c-.11037-.11038-.29823-.05726-.32964.09564-.09318.45373-.15566.91863-.18517 1.39253zm.84181-3.4368c-.0333.07476-.01634.16212.04153.22l12.95524 12.9553c.0579.0578.1453.0748.22.0415.3572-.1591.7034-.3385 1.0371-.5368.1104-.0656.1275-.2174.0367-.3082l-13.44562-13.44554c-.09082-.09082-.24255-.07378-.30815.03664-.19827.33368-.37769.67988-.5368 1.0371zm1.68956-2.32629c-.07402-.07402-.0786-.19274-.00886-.27082 1.83303-2.05212 4.49942-3.34399 7.46757-3.34399 5.5281 0 10.0096 4.48148 10.0096 10.0097 0 2.9681-1.2918 5.6345-3.344 7.4675-.078.0697-.1968.0651-.2708-.0089z",fill:"#222326"})),Mq=e=>f.createElement("svg",{fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"m12 2c-5.52684 0-10 4.47316-10 10 0 5.5268 4.47316 10 10 10 5.5268 0 10-4.4732 10-10 0-5.52684-4.4732-10-10-10zm0 15.0099c-2.76342 0-5.00994-2.2465-5.00994-5.0099 0-2.76342 2.24652-5.00994 5.00994-5.00994 2.7634 0 5.0099 2.24652 5.0099 5.00994 0 2.7634-2.2465 5.0099-5.0099 5.0099z",fill:"var(--icon-color, #00297a)"})),Lq=e=>f.createElement("svg",{fill:"none",height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("rect",{fill:"#635bff",height:20,rx:2.5,width:20,x:2,y:2}),f.createElement("path",{d:"m12.2935 8.76779c-.7588 0-1.2169.21645-1.2169.77922 0 1.61619 5.4545.85139 5.4688 5.15149 0 2.583-2.0472 4.0693-5.025 4.0693-1.2312 0-2.57697-.2453-3.90839-.8225v-3.4344c1.20258.6638 2.72009 1.1544 3.90839 1.1544.8017 0 1.3744-.2164 1.3744-.8802 0-1.7172-5.44027-1.0822-5.44027-5.06493 0-2.55411 1.93271-4.0837 4.83897-4.0837 1.1882 0 2.3622.18759 3.5504.66379v3.39105c-1.088-.59163-2.4624-.92352-3.5504-.92352z",fill:"#fff"}));function _v(e){const{presetAppID:t,className:r,size:s}=e;switch(t){case"confluence":return n.jsx(Pq,{className:r,width:s,height:s});case"jira":return n.jsx(Dq,{className:r,width:s,height:s});case"stripe":return n.jsx(Lq,{className:r,width:s,height:s});case"google-workspace":return n.jsx(Iq,{className:r,width:s,height:s});case"okta":return n.jsx(Mq,{className:D(r,"dark:[--icon-color:#fff]"),width:s,height:s});case"github":return n.jsx(Tq,{className:D(r,"dark:[--icon-color:#fff]"),width:s,height:s});case"linear":return n.jsx(_q,{className:r,width:s,height:s});default:return n.jsx(BO,{className:r,size:s})}}const Rq={maxHeight:260,listStyle:"none"};function Oq(e){const{presetApps:t,onChange:r}=e,[s,a]=f.useState(t),[i,l]=f.useState(""),{getMenuProps:u,getInputProps:d,highlightedIndex:m,getItemProps:p}=Ln({items:s,onInputValueChange:({inputValue:g})=>{l(g||""),a(t.filter(v=>{if(g===void 0||v.name.toLowerCase().startsWith(g.toLowerCase()))return!0;if(v.domains){for(const y of v.domains)if(y.toLowerCase().includes(g.toLowerCase()))return!0}return!1}))},onSelectedItemChange:({selectedItem:g})=>{g!==null&&g!==void 0&&r(g)}});return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"flex items-center border-b",children:n.jsx("input",{className:"input flex-1 rounded-b-none py-2 px-3 border-0",placeholder:"Search apps...",...d()})}),n.jsx("div",{className:"outline-none overflow-y-auto py-1 z-10",...u(),children:n.jsx(f.Fragment,{children:n.jsx("ul",{style:Rq,children:s.length===0?n.jsxs("div",{className:"flex flex-col items-center py-5 px-3 last:rounded-b-md",children:[n.jsxs("p",{className:"text-text-muted",children:["No targets match “",i,"”"]}),n.jsx("button",{className:"link",onClick:()=>r(_k),children:"Create a custom target"})]}):s.map((g,v)=>n.jsx("li",{className:D("flex py-2 px-3 cursor-pointer last:rounded-b-md",{"bg-bg-menu-item-hover":m===v}),style:{height:40},...p({item:g,index:v}),children:n.jsx(Mk,{name:g.name,id:g.id})},`${g}-${v}`))})})})]})}function Mk(e){const{name:t,id:r}=e;return n.jsx("div",{className:"flex-1 min-w-0",children:n.jsxs("div",{className:"flex items-center gap-x-2",children:[n.jsx("div",{className:"mr-2",children:n.jsx(_v,{presetAppID:r,size:24})}),n.jsx("span",{className:"gap-x-2",children:t})]})})}function ph(e,t){const[r,s]=f.useState(),[a,i]=f.useState(()=>{const l=globalThis.sessionStorage.getItem(t);try{return l===null?e:JSON.parse(l)}catch{return console.warn("Could not parse session state",l),e}});return f.useEffect(()=>{const l=JSON.stringify(a);if(l!==void 0)try{globalThis.sessionStorage.setItem(t,l),s(void 0)}catch(u){s(u),console.warn("Could not store session state",u)}},[t,a]),[a,i,r]}function Fq(e){return e.originalAcl!==void 0&&e.originalAcl!==e.draft}function mce(e,t){return{originalAcl:e.originalAcl,originalHash:e.originalHash,draft:t}}function Eu(e){const{data:t,mutate:r,error:s}=dt("/acls",{refreshInterval:e}),a=ss(!1),i=t?.hash,[l,u,d]=ph({originalAcl:t?.acl,originalHash:t?.hash,draft:t?.acl??""},"tailscale/acl-editor-draft");f.useEffect(()=>{const v=t?.acl!==void 0,y=l.originalAcl===void 0,C=!Fq(l),b=l.draft!==t?.acl;v&&(y||C&&b)&&u({originalAcl:t.acl,originalHash:t.hash,draft:t.acl})},[t,l,u]);const m=f.useCallback(async()=>r().then(v=>{u({originalAcl:v?.acl,originalHash:v?.hash,draft:v?.acl??""})}),[r,u]),p=f.useCallback(v=>(a.setTrue(),Ie.post("/acls/patch",{hash:i,patches:v}).then(()=>{a.setFalse(),m()}).catch(y=>{throw a.setFalse(),y})),[a,i,m]),g=()=>(a.setTrue(),Ie.get("/public/tailnet/-/acl/acls-to-grants").then(v=>(a.setFalse(),u({originalAcl:t?.acl,originalHash:t?.hash,draft:v.data.data.acl}),v.data.data.acl)).catch(v=>{throw a.setFalse(),v}));return{data:t,error:s,applyPatches:p,isPosting:a.value,aclDraft:l,setACLDraft:u,mutate:m,aclsToGrants:g,sessionStateError:d}}function Hi(e){const{data:t,error:r,mutate:s}=dt("/public/tailnet/-/acl/app-connectors",e),{applyPatches:a}=Eu();return{data:t,error:r,setAppConnector:(l,u,d)=>{const m=[],p=JSON.stringify(d);switch(l){case"add":{m.push({type:"add-app-connectors-attr",key:u,value:p});break}case"replace":{m.push({type:"replace-app-connectors-attr",key:u,value:p});break}case"remove":{m.push({type:"remove-app-connectors-attr",key:u,value:""});break}}return a(m).then(()=>s())}}}function Ai(e,t={}){const[r,s]=f.useState(e),a=f.useRef(),i=t.timeout||3e3;return f.useEffect(()=>(r!==e&&(a.current=globalThis.setTimeout(()=>{s(e)},i)),()=>{a.current&&clearTimeout(a.current)}),[r,e,i]),[r,s]}function Rr(e){return navigator.clipboard?db(e)?typeof ClipboardItem>"u"?e.then(t=>navigator.clipboard.writeText(wg(t))):navigator.clipboard.write([new ClipboardItem({"text/plain":e.then(t=>new Blob([wg(t)],{type:"text/plain"}))})]):navigator.clipboard.writeText(e):db(e)?e.then(t=>H9(wg(t))):H9(e)}function wg(e){if(typeof e!="string"||e.length===0)throw new TypeError("Expected string, got "+typeof e);if(e.length===0)throw new TypeError("Expected non-empty string");return e}function H9(e){const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.className="absolute opacity-0 pointer-events-none",document.body.append(t);let r=document.getSelection();const s=r&&r.rangeCount>0?r.getRangeAt(0):!1;return t.select(),document.execCommand("copy"),t.remove(),s&&(r=document.getSelection(),r&&(r.removeAllRanges(),r.addRange(s))),Promise.resolve()}function Xo(e){const{buttonLabel:t="Copy",className:r,onCopySuccess:s=b0,onCopyFailed:a=b0,text:i,visibleText:l,autoFocus:u,disabled:d}=e,[m,p]=Ai(!1),g="Copied!",v=g.length>t.length;return n.jsxs("div",{className:D("flex input-wrapper relative overflow-hidden min-w-0",r),children:[n.jsx("input",{className:D("outline-none py-2 px-3 w-full h-full font-mono text-code text-ellipsis bg-gray-100 dark:bg-gray-900 dark:hover:border-gray-900",{"bg-gray-0 dark:bg-gray-800 text-text-muted":d}),type:"text",readOnly:!0,autoFocus:u,onCopy:s,onClick:y=>{const C=y.currentTarget;C.setSelectionRange(0,C.value.length)},value:l||i,disabled:d}),n.jsxs("button",{className:D("flex justify-center py-2 pl-3 pr-4 rounded-md bg-bg-base focus:outline-none font-sans font-medium",{link:!d,"bg-gray-0 dark:bg-gray-900 text-text-muted":d}),type:"button",disabled:d,onClick:()=>{p(!0),Rr(i).then(()=>{p(!0),s?.()}).catch(()=>{a?.()})},children:[n.jsx("span",{className:D("whitespace-nowrap",{invisible:m,absolute:v}),children:t}),n.jsx("span",{className:D({invisible:!m,visible:m,absolute:!v}),children:g})]})]})}function Br({id:e,className:t,sideElement:r,label:s,description:a,help:i,children:l,error:u,optionality:d}){const m=f.useId();return n.jsxs("div",{className:t,children:[(s||a||r)&&n.jsxs("div",{className:D("flex justify-between",{"mb-2":l}),children:[n.jsxs("div",{children:[s&&n.jsxs("label",{className:"block font-medium",htmlFor:e||m,children:[s,d&&n.jsxs("span",{className:"text-text-muted font-normal",children:[" ","(",d,")"]})]}),a&&n.jsx("p",{className:"text-text-muted mt-1",children:a})]}),r?n.jsx("div",{children:r}):null]}),e?l:f.Children.map(l,p=>f.isValidElement(p)?f.cloneElement(p,{id:m,error:u}):p),u?n.jsx("p",{className:"text-sm text-text-danger mt-1",children:u}):i?n.jsx("p",{className:"text-sm text-text-muted mt-1",children:i}):null]})}const ln=ce.forwardRef((e,t)=>{const{className:r,inputClassName:s,error:a,prefix:i,suffix:l,suffixContainerClassName:u,disabled:d,...m}=e;return n.jsxs("div",{className:D("relative",r),children:[n.jsx("input",{ref:t,className:D("input z-10",s,{"input-error":a}),disabled:d,...m}),l?n.jsx("div",{className:D("absolute top-1 right-1 bottom-1 flex items-center rounded-r-md",u),children:l}):null]})}),fce=Object.freeze(Object.defineProperty({__proto__:null,default:ln},Symbol.toStringTag,{value:"Module"}));function rt(e){const{className:t,children:r,color:s,icon:a,title:i,titleSuffix:l,intent:u,dismissed:d,onDismiss:m,dismissLabel:p,...g}=e,v=Bq(a,u);return m&&d?null:n.jsxs("div",{className:D("flex overflow-hidden rounded-md py-3.5 px-4 gap-2 relative icon-parent",t,{"bg-gray-0 dark:bg-gray-800 border border-gray-200 dark:border-gray-700":!u||u==="info","bg-blue-0 dark:bg-blue-500/10 text-text-primary border border-blue-50 dark:border-blue-400/20":u==="primary","bg-orange-0 dark:bg-yellow-600/10 text-text-warning border border-orange-50 dark:border-yellow-400/20":u==="warning","bg-green-0 dark:bg-green-600/10 text-text-success border border-green-50 dark:border-green-400/20":u==="success","bg-red-0 dark:bg-red-600/10 text-text-danger border border-red-50 dark:border-red-400/20":u==="error"}),role:"alert",...g,children:[v&&n.jsx("div",{className:"mt-px",children:v}),n.jsxs("div",{className:D("w-full",{"pr-4":m&&!d&&!i}),children:[i&&n.jsxs("div",{className:D("flex items-center justify-between mb-2",{"pr-4":m&&!d}),children:[n.jsx("h4",{className:"font-medium",children:i}),l]}),n.jsx("div",{children:r})]}),m&&n.jsx(ue,{variant:"minimal",className:"absolute top-2 right-2 px-1 py-1",iconOnly:!0,"aria-label":p,prefixIcon:n.jsx(Or,{}),onClick:m})]})}function Bq(e,t){if(e)return f.cloneElement(e);if(e===!1)return null;switch(t){case"warning":return n.jsx(Da,{});case"error":return n.jsx(Oa,{});case"success":return n.jsx(Wx,{});default:return n.jsx(bs,{})}}const hce=Object.freeze(Object.defineProperty({__proto__:null,default:rt},Symbol.toStringTag,{value:"Module"}));function Lk(e){const{className:t,autoResize:r=!0,visible:s=!0,minHeight:a=32,maxHeight:i,...l}=e,u=ce.useRef(null);return f.useLayoutEffect(()=>{const d=u.current;if(!d||!r)return;const m=()=>{d.style.resize="none",d.style.height="inherit";const p=Math.min(Math.max(a,d.scrollHeight+4),i||Number.POSITIVE_INFINITY);d.style.height=`${p}px`};return d.addEventListener("input",m),m(),()=>{d.removeEventListener("input",m)}},[a,i,r,s]),n.jsx("textarea",{ref:u,className:D("textarea input py-3","scroll-py-3",t),...l})}function Au(e,t={}){let r=e.toLowerCase().replaceAll(/[^\da-z-]/g,"-").replaceAll(/-+/g,"-");return r=t.trim===!1?r.replaceAll(/^-$/g,""):r.replaceAll(/^-|-$/g,""),r}function Rk(e){const{open:t,onOpenChange:r,posting:s,setPosting:a}=e,{setAppConnector:i}=Hi(),l=et(),{data:u,error:d}=vl(),[m,p]=f.useState(),[g,v]=f.useState(!1),[y,C]=f.useState(""),[b,w]=f.useState([]),[N,k]=f.useState(""),{loaded:E,error:T,aclTags:_}=$i(),[I,F]=f.useState(!1),{data:z}=Rt(),H=f.useMemo(()=>Array.from(_.all.values()),[_.all]),J=L=>[...L].sort((V,P)=>V.idP.id?1:0),Y=L=>L||"ungrouped",B=f.useMemo(()=>{const L=new Set;L.add(_k);const V=new Map;u?.presetApps?.forEach(Q=>{const ae=Y(Q.group),X=V.get(ae);X?X.push(Q):V.set(ae,[Q])});const P=V.get("ungrouped");P?.length&&J(P).forEach(Q=>L.add(Q));const q=[...V.keys()].filter(Q=>Q!=="ungrouped").sort();for(const Q of q){const ae=V.get(Q);ae?.length&&J(ae).forEach(X=>L.add(X))}return[...L]},[u]),W=m===void 0||m?.id==="custom"&&!y||!b||m?.id!=="custom"&&b.length===0||b.length===0||m?.id==="custom"&&!N;f.useEffect(()=>{k("")},[m]);const U=()=>{C(""),w([]),k(""),p(void 0)},Z=f.useCallback(()=>{a(!0);const L=z9(y,b,N,m);i("add",L.name,L).then(()=>{a(!1),U(),r(!1),l.show({message:"App connector configuration created",timeout:8e3})}).catch(V=>{a(!1);const P=V?.response?.data?.error;l.show({key:"appConnectorAddErr",message:P?"Failed to create app connector configuration: "+P:"Failed to create app connector configuration",timeout:8e3,variant:"danger"})})},[y,b,N,a,l,r,i,m]),re=f.useMemo(()=>b.filter(L=>L!=="*"),[b]),me=f.useCallback(L=>{w(V=>V.filter(P=>P!==L))},[]);return n.jsx(Re,{open:t,onOpenChange:()=>{U(),r(!1)},title:"Add an app",children:n.jsx(Re.Form,{autoFocus:"cancel",disabled:s||z?.aclsExternallyManagedOn||W,cancelButton:"Cancel",submitButton:!z?.aclsExternallyManagedOn&&"Save",onSubmit:Z,children:n.jsx("div",{className:"mb-5",children:n.jsx("div",{className:"flex flex-col space-y-4 justify-between",children:n.jsxs(n.Fragment,{children:[n.jsx(Bk,{name:y,setName:C,placeHolder:m?.id}),n.jsx(Br,{label:"Target",description:"External app to route traffic for.",children:B?d?n.jsx(De,{error:d}):n.jsx(Ni,{content:n.jsx(Oq,{presetApps:B,onChange:L=>{p(L),v(!1)}}),asChild:!0,align:"start",open:g,onOpenChange:v,className:"py-0 min-w-[300px]",children:n.jsx(ue,{type:"button",sizeVariant:"small",suffixIcon:n.jsx(Nn,{}),children:m?n.jsx(Mk,{name:m.name,id:m.id}):n.jsx("span",{className:"flex-none",children:"Select a target"})})}):n.jsx(De,{loadingMessage:"Loading..."})}),m?.sources&&n.jsx(Vk,{presetApp:m}),m?.id==="custom"&&n.jsx(Uk,{domains:N,setDomains:k,setAppInformation:p}),n.jsx($k,{tagsOpen:I,setTagsOpen:F,availableTags:H,connectorsWithoutStar:re,setConnectors:w,posting:s,loaded:E,error:T,removeSelection:me}),z?.aclsExternallyManagedOn&&n.jsx(Hk,{attr:W?"":JSON.stringify(z9(y,b,N,m)),disabled:W})]})})})})})}function Ok(e){const{data:t}=Rt(),{open:r,onOpenChange:s,appConnectorID:a,posting:i,setPosting:l}=e,{data:u,setAppConnector:d}=Hi(),m=f.useMemo(()=>u?.appConnectors.find(L=>L.name===a),[a,u?.appConnectors]),p=et(),[,g]=ft(),[v,y]=f.useState(m?.name||""),[C,b]=f.useState(m?.connectors||[]),[w,N]=f.useState(m?.domains?.join(", ")||""),k=!v||!C||C.length===1&&C[0]==="*"||C.length===0||m?.presetAppID===void 0&&!w,{loaded:E,error:T,aclTags:_}=$i(),[I,F]=f.useState(!1),z=f.useMemo(()=>Array.from(_.all.values()),[_.all]),{data:H,error:J}=vl(),Y=f.useMemo(()=>H?.presetApps.find(L=>L.id===m?.presetAppID),[m,H?.presetApps]);f.useEffect(()=>{y(m?.name||""),b(m?.connectors||[]),N(m?.domains?.join(", ")||"")},[m]);const B=()=>{y(""),b([]),N("")},W=f.useMemo(()=>C.filter(L=>L!=="*"),[C]),U=C.length===1&&C[0]==="*",Z=f.useCallback(()=>{if(!m)return;l(!0);const L=W9(v,C,w,m.presetAppID);d("replace",m?.name,L).then(()=>{l(!1),B(),s(!1),p.show({message:"App connector configuration updated",timeout:8e3}),m.name!==L.name&&g("/admin/apps/"+L.name)}).catch(V=>{l(!1);const P=V?.response?.data?.error;p.show({key:"appConnectorUpdateErr",message:P?"Failed to update app connector configuration: "+P:"Failed to update app connector configuration",timeout:8e3,variant:"danger"})})},[m,v,C,w,l,p,s,d,g]),re=f.useCallback(L=>{b(V=>V.filter(P=>P!==L))},[]),me=f.useMemo(()=>m?v!==m.name||!K9(C,m.connectors)||!K9(gh(w),m.domains||[]):!0,[m,v,C,w]);return n.jsx(Re,{open:r,onOpenChange:()=>{B(),s(!1)},title:"Update app",children:n.jsx(Re.Form,{autoFocus:"cancel",disabled:i||t?.aclsExternallyManagedOn||k||!me,cancelButton:"Cancel",submitButton:!t?.aclsExternallyManagedOn&&"Save",onSubmit:Z,children:n.jsx("div",{className:"mb-5",children:n.jsxs("div",{className:"flex flex-col space-y-4 justify-between",children:[n.jsxs(n.Fragment,{children:[n.jsx(Bk,{name:v,setName:y}),!m?.presetAppID&&n.jsx(Uk,{domains:w,setDomains:N}),Y?.sources&&(J?n.jsx(De,{error:J}):n.jsx(Vk,{presetApp:Y})),n.jsx($k,{tagsOpen:I,setTagsOpen:F,availableTags:z,connectorsWithoutStar:W,setConnectors:b,posting:i,loaded:E,error:T,removeSelection:re,wildcardWarning:U})]}),t?.aclsExternallyManagedOn&&n.jsx(Hk,{attr:JSON.stringify(W9(v,C,w,m?.presetAppID)),disabled:k})]})})})})}function Fk(e){const{open:t,onOpenChange:r,appConnectorID:s,posting:a,setPosting:i,onDelete:l}=e,[,u]=ft(),d=et(),{data:m,setAppConnector:p}=Hi(),g=f.useMemo(()=>m?.appConnectors.find(k=>k.name===s),[s,m?.appConnectors]),v=g?.connectors.length===1&&g?.connectors[0]==="*",[y,C]=f.useState(g?.domains),{data:b}=vl(),w=f.useMemo(()=>b?.presetApps.find(k=>k.id===g?.presetAppID),[g,b?.presetApps]);f.useEffect(()=>{C(w?.domains||g?.domains)},[w,g,w?.domains]);const N=()=>{s===void 0||s===""||(i(!0),p("remove",s,g).then(()=>{i(!1),r(!1),l&&l(),u("/admin/apps"),d.show({message:"App connector configuration deleted",timeout:8e3})}).catch(k=>{i(!1);const E=k?.response?.data?.error;d.show({key:"appConnectorDeleteErr",message:E?"Failed to delete app connector configuration: "+E:"Failed to delete app connector configuration",timeout:8e3,variant:"danger"})}))};return n.jsx(Re,{open:t,onOpenChange:()=>r(!1),title:"Delete app connector configuration",children:n.jsx(Re.Form,{autoFocus:"cancel",destructive:!0,cancelButton:!0,submitButton:"Delete app",loading:a,disabled:a,onSubmit:N,children:n.jsxs("div",{className:"mb-5",children:[n.jsxs("p",{className:"mb-6",children:["Deleting the “",g?.name,"” connector configuration will stop routing traffic through"," ",v?"all connectors":n.jsxs(n.Fragment,{children:["connectors tagged with"," ",n.jsx(Uq,{separator:", ",children:g?.connectors.map((k,E)=>n.jsx("span",{className:"font-semibold",children:k},k))})]})," ","to the following domains:"]}),n.jsx("h3",{className:"font-semibold mb-2",children:"Domains"}),n.jsx("ul",{children:y?.map((k,E)=>n.jsx("li",{className:"flex items-center py-2 border-t",children:k},`${k}-${E}`))})]})})})}function z9(e,t,r,s){let a=e;s?.id&&s.id!=="custom"&&a===""&&(a=s.id);const l={name:Au(a),connectors:t};return s?.id==="custom"?l.domains=gh(r):l.presetAppID=s?.id,l}function W9(e,t,r,s){const a={name:Au(e),connectors:t};return s?a.presetAppID=s:a.domains=gh(r),a}function gh(e){const t=e.split(/[\s+,]/g),r=[];for(const s of t)s&&r.push(s.trim());return r}function Bk(e){const{name:t,setName:r,placeHolder:s}=e;return n.jsx(Br,{label:"Name",description:"Only shown in the admin console. Only letters, numbers, and dashes.",children:n.jsx(ln,{pattern:"^[a-zA-Z0-9\\-]*$",className:"w-full z-10",type:"text",placeholder:s!==void 0&&s!=="custom"?s:"example-name",autoComplete:"off",autoCorrect:"off",required:s==="custom",value:t,onChange:a=>r(Au(a.target.value,{trim:!1}))})})}function Uk(e){const{domains:t,setDomains:r,setAppInformation:s}=e,{data:a}=vl(),[i,l]=f.useState();return f.useEffect(()=>{const u=gh(t);for(const d of u){const m=a?.presetApps.find(p=>p.domains?.includes(d));l(m)}},[t,a?.presetApps]),n.jsxs("div",{children:[n.jsx("div",{className:"mb-2",children:"Comma- or space-separated list of domains to route. Wildcard domains are allowed. You are responsible for keeping this list up-to-date with domains used by this app."}),n.jsx(Lk,{className:"w-full z-10",id:"app-connector-domains",autoComplete:"off",autoCorrect:"off",required:!0,placeholder:"example.com, *.example.com",value:t,onChange:u=>r(u.currentTarget.value),maxHeight:450}),i&&s&&n.jsxs("div",{className:"mt-2 mb-2",children:["Some of these domains belong to ",i?.name,". Would you like to"," ",n.jsxs("button",{className:"link",onClick:()=>s(i),children:["add ",i.name," as an app"]}),"?"]})]})}function Vk(e){const{presetApp:t}=e;return n.jsxs("div",{className:"min-w-0",children:[n.jsxs("div",{className:"mb-2",children:["Tailscale will keep ",t.name,"’s configuration up-to-date using the following sources:"]}),n.jsx("ul",{className:"list-disc list-outside pl-4",children:t.sources?.map(r=>n.jsx("li",{children:n.jsxs("a",{href:r,rel:"noopener noreferrer",className:"link",children:[r," ↗"]})},r))})]})}function $k(e){const{tagsOpen:t,setTagsOpen:r,availableTags:s,connectorsWithoutStar:a,setConnectors:i,posting:l,loaded:u,error:d,removeSelection:m,wildcardWarning:p}=e;return n.jsxs(Br,{label:"Connectors",description:n.jsxs(n.Fragment,{children:["Configure which"," ",n.jsx("a",{href:"https://tailscale.com/kb/1342/app-connectors-setup",className:"link",children:"connectors"})," ","can route traffic for this app."]}),children:[p&&n.jsx(zk,{className:"mb-2"}),n.jsx(Nq,{align:"start",open:t,onOpenChange:r,disabled:s.length===0||l,tags:s||[],selected:a,onChange:i,children:n.jsx(ue,{type:"button",className:"mb-2",sizeVariant:"small",onClick:()=>r(!0),disabled:s.length===0||l,suffixIcon:n.jsx(Nn,{}),children:"Select ACL tags"})}),u?d?n.jsx(De,{error:d}):s.length>0?a.length>0?n.jsx(Aq,{tags:a,removeCallback:m,disableChanges:l}):n.jsx(at,{empty:!0,children:n.jsx(fn,{description:"Select connectors"})}):n.jsxs(rt,{className:"mb-2",children:["No ACL tags found. You can create ACL tags from the"," ",n.jsx(ze,{className:"link",href:"/admin/acls",children:"Access controls page"})]}):n.jsx(De,{})]})}function Hk(e){const{attr:t,disabled:r}=e;return n.jsxs(Br,{label:"Managed ACLs",children:[n.jsxs("div",{className:"mb-3",children:["Your tailnet's policy file is managed externally. App Connectors configuration must be specified manually."," ",n.jsx(Ge,{kbTopic:"App Connectors",url:"https://tailscale.com/kb/1342/app-connectors-setup"})]}),n.jsxs("p",{className:"mb-3",children:["Copy the configuration below into the"," ",n.jsxs("a",{className:"link",href:"https://tailscale.com/kb/1339/preset-apps#tailnet-policy-file-details",target:"_blank",rel:"noreferrer noopener",children:["app connector ",n.jsx("code",{children:"nodeAttr"})]})," ","of your tailnet policy file."]}),n.jsx(Xo,{className:"my-1",text:t,disabled:r})]})}function zk(e){const{title:t,className:r}=e;return n.jsxs(rt,{intent:"warning",className:r,title:t,children:["We no longer support apps configured to use all available connectors. You must update your app configuration to use tags instead."," ",n.jsx(Ge,{kbTopic:"app connectors",url:"https://tailscale.com/kb/1342/app-connectors-setup"})]})}function K9(e,t){return e.length===t.length&&e.every((r,s)=>r===t[s])}function Uq({children:e,separator:t}){return n.jsx(n.Fragment,{children:ce.Children.map(e,(r,s)=>n.jsxs(n.Fragment,{children:[s>0&&t,r]}))})}function vi(e){const{ip:t,className:r}=e;if(!r2(t))return n.jsx("span",{className:r,children:t});const[s,a]=Vq(t);return n.jsxs("span",{className:D("inline-flex justify-start min-w-0 max-w-full",r),children:[s.length>0&&n.jsx("span",{className:"truncate w-fit flex-shrink",children:s}),n.jsx("span",{className:"flex-grow-0 flex-shrink-0",children:a})]})}function Vq(e){const t=e.replaceAll(/(:{1,2})/g,"|$1").split("|"),r=12;let s=0,a=1;for(let u=t.length-1;u>=0;u--){const d=t[u];if(s+d.length>r)break;s+=d.length,a++}const i=t.slice(0,-a).join(""),l=t.slice(-a).join("");return[i,l]}function Fn(e){const{className:t,status:r,size:s="medium"}=e;return r==="error"?n.jsx("span",{className:D("inline-block text-orange-400",{"w-2.5 h-2.5":s==="medium","w-3 h-3":s==="large"},t),children:n.jsx("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M9.63767 3.36389C10.6876 1.54537 13.3124 1.54537 14.3623 3.36389L22.6305 17.6847C23.6804 19.5033 22.368 21.7764 20.2681 21.7764H3.73185C1.632 21.7764 0.319599 19.5033 1.36952 17.6847L9.63767 3.36389Z",fill:"currentColor"})})}):n.jsx("span",{className:D("inline-block w-2 h-2 rounded-full",{"w-2.5 h-2.5":s==="large","bg-green-300 dark:bg-green-400":r==="connected","bg-gray-300 dark:bg-gray-500":r==="offline"||r==="unknown","bg-yellow-300 dark:bg-yellow-500":r==="restricted"},t)})}function $q(e,t){if(t)return"connected";if(!o2(e))return"unknown";const r=Yn(),s=Fc(r,e);if(s<-10)return"unknown";if(s<60)return"lastHour";if(s<1440)return"lastDay";if(s<10080)return"lastWeek";const a=_w(r,e);return a<1?"lastMonth":a<3?"lastQuarter":"older"}function Hq(e,t){return e==="connected"||e==="lastHour"||e==="lastDay"?Hc(t):`${ws(t)} at ${Hc(t)}`}const mc={connected:{status:"connected",message:"Online"},error_ip_forwarding:{status:"error",message:"Online, IP forwarding broken"},error_unapproved_routes:{status:"error",message:"Online, has unapproved routes"},offline:{status:"offline",message:"Offline"},unknown:{status:"unknown",message:""}};function Wk(e,t=!1){const r=e?.lastSeen?new Date(e.lastSeen):e?.connectedToControl?Yn():void 0;if(!r||e===void 0)return{status:mc.unknown,timestamp:""};const s=!!e?.connectedToControl,a=$q(r,s),i=Hq(a,r);if(s&&t){if(e.brokenIPForwarding)return{status:mc.error_ip_forwarding,timestamp:i};if(e.extraIPs.length>0)return{status:mc.error_unapproved_routes,timestamp:i}}return s?{status:mc.connected,timestamp:i}:{status:mc.offline,timestamp:i}}var en=(e=>(e.NeedsApproval="needsapproval",e.Suspended="suspended",e.Unpaid="overbillinglimit",e.None="",e))(en||{}),zt=(e=>(e.SSH="SSH",e.DNS="DNS",e.HTTP="HTTP",e.HTTPS="HTTPS",e.IPP="IPP",e.RDP="RDP",e.VNC="VNC",e.Plex="Plex",e.Other="Other",e))(zt||{});const Je={Idle:"idle",Suspended:"suspended",NeedsApproval:"needsapproval",OverBillingLimit:"overbillinglimit",Invited:"invited",SuspendedGlobal:"suspendedglobal",ProvisionedOnly:"provisionedonly",None:"none"},pce=64;function sn(e){const{data:t,error:r,mutate:s,isLoading:a}=dt("/machines",e),{isPosting:i,setPosting:l}=Kq(),u=et(),d=f.useCallback((m,p,g,v)=>{const y={state:m,machinekey:p.machineKey,nodekey:p.nodeKey,...g},C=()=>{switch(m){case"authorize":return Ie.post(`/public/device/${p.id}/authorized`,{authorized:!0});case"delete-node":return Ie.delete(`/public/device/${p.id}`);case"extend-node-key":return Ie.post(`/public/device/${p.id}/extend-expiry`);case"remove-external":{if(p?.shareID)return Ie.delete(`/share/${p.shareID}`);break}case"rename-node":return Ie.post(`/public/device/${p.id}/name`,y);case"set-expires":return Ie.post(`/public/device/${p.id}/extend-expiry`).then(()=>Ie.post(`/public/device/${p.id}/key`,{keyExpiryDisabled:!1}));case"set-never-expires":return Ie.post(`/public/device/${p.id}/key`,y);case"set-tags":return Ie.post(`/public/device/${p.id}/tags`,y);case"update-client":return Ie.post(`/public/device/${p.id}/update-client`)}return Ie.post("/machines",y)},b=()=>Ie.get(`/machines/${p.id}`);let w=!1;return(m==="delete-node"||m==="remove-external")&&(queueMicrotask(()=>s(N=>zq(p.id,N),!1)),w=!0),l(!0),C().then(()=>{if(l(!1),w){G9(m,p,u);return}return b().then(N=>{const k=N.data?.data;return!t||!k?s():s(Wq(k,t),!1),G9(m,k,u),k||void 0})}).catch(N=>{l(!1),w&&s(),Gq(m,p,u,N),al(N),v!==void 0&&v(new Error(N.response?.data?.error))})},[t,s,u,l]);return{data:t,error:r,mutate:s,isPosting:i,isLoading:a,handleAction:d}}function zq(e,t){if(!t)return t;const r=t.machines.filter(s=>s.id!==e);return{...t,machines:r}}function Wq(e,t){const r=t.machines.findIndex(s=>s.nodeKey===e.nodeKey&&s.machineKey===e.machineKey);return{machines:[...t.machines.slice(0,r),e,...t.machines.slice(r+1)]}}const Kq=zf(e=>({isPosting:!1,setPosting:t=>e({isPosting:t})}));function G9(e,t,r){const s=Kk(e,t,!0);r.show({message:s})}function Gq(e,t,r,s){const a=Kk(e,t,!1,s);r.show({message:a,variant:"danger"})}function Kk(e,t,r,s){const a=t?.name||"machine";switch(e){case"authorize":return r?`Approved ${a}`:s&&qq(s)?n.jsxs(n.Fragment,{children:["Adding new users and machines is restricted for your tailnet. Please"," ",n.jsx(Zn,{type:"connectivity",className:"link-underline",children:"contact support"}),"."]}):`Failed to approve ${a}`;case"rename-node":return r?"Updated machine name":"Failed to update machine name";case"delete-node":return r?"Removed "+a:"Failed to remove "+a;case"add-external":return r?"Added external machine":"Failed to add external machine";case"remove-external":return r?"Revoked shared machine access":"Failed to revoke shared machine access";case"set-route-settings":return r?"Updated route settings":"Failed to update route settings";case"set-tags":return r?"Updated tags":"Failed to update tags";case"set-expires":return r?"Enabled key expiry":"Failed to update key expiry";case"set-never-expires":return r?"Disabled key expiry":"Failed to update key expiry";case"extend-node-key":return r?"Extended key expiration by 30 minutes":"Failed to extend key";case"set-ipv4":return r?"Updated machine IPv4 address":"Failed to update machine IP";case"update-client":return r?`Started update for ${a}`:`Failed to update ${a}: ${s?.response?.data?.error||s}`;default:return e}}function qq(e){return e?.response?.data?.errorCode==="machine-auth-stuck-on"}function Mv(e,t){if(!(!e.name||e.isExternal||!t))return e.name}function Gk(e,t){if(e.fqdn&&(e.funnelEnabled||t))return e.fqdn}function qk(e,t){return e.ownerDisabledStatus===en.Suspended&&t.ownerDisabledStatus!==en.Suspended?1:t.ownerDisabledStatus===en.Suspended&&e.ownerDisabledStatus!==en.Suspended?-1:e.ownerDisabledStatus===en.NeedsApproval&&t.ownerDisabledStatus!==en.NeedsApproval?1:t.ownerDisabledStatus===en.NeedsApproval&&e.ownerDisabledStatus!==en.NeedsApproval?-1:e.ownerDisabledStatus===en.Unpaid&&t.ownerDisabledStatus!==en.Unpaid?1:t.ownerDisabledStatus===en.Unpaid&&e.ownerDisabledStatus!==en.Unpaid?-1:e.authorized&&!t.authorized?1:t.authorized&&!e.authorized||e.isExternal&&!t.isExternal?-1:t.isExternal&&!e.isExternal?1:e.hasExitNode&&!t.hasExitNode?-1:t.hasExitNode&&!e.hasExitNode?1:e.hasSubnets&&!t.hasSubnets?-1:t.hasSubnets&&!e.hasSubnets?1:e.neverExpires&&!t.neverExpires?-1:t.neverExpires&&!e.neverExpires?1:e.hasTags&&!t.hasTags?-1:!e.hasTags&&t.hasTags?1:e.acceptedShareCount>t.acceptedShareCount?-1:e.acceptedShareCountt.user?1:t.user>e.user?-1:e.name.length===0?1:t.name.length===0?-1:e.name>t.name?1:-1}const el=ce.forwardRef((e,t)=>{const{open:r,onOpenChange:s,customTrigger:a,side:i,align:l,items:u,disabled:d,ariaLabel:m,onDismiss:p=()=>{},...g}=e,v=C=>{C.preventDefault()},y=(C,b)=>{switch(C.type){case"item":return C.label?f.createElement(Pe.Item,{...C,key:b},C.icon?n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[C.label,n.jsx(C.icon,{size:"1.125em"})]}):C.label):null;case"link":return C.label&&C.href||C.children&&C.href?f.createElement(Pe.Link,{...C,key:b},C.label,C.children):null;case"separator":return n.jsx(Pe.Separator,{hidden:C.hidden},b)}return C};return n.jsx(Pe,{asChild:!0,side:i||"left",align:l||"start",open:r,onOpenChange:s,disabled:d,onCloseAutoFocus:v,onDismiss:p,trigger:a?f.cloneElement(a,{"aria-label":m}):n.jsx(Yq,{"aria-label":m,open:r,...g,ref:t}),children:u.map((C,b)=>{const{disabledTooltipContent:w,...N}=C,k=y(N,b);return N.disabled&&w?n.jsx(Ee,{content:w,children:k},N.label):k})})}),Yq=ce.forwardRef((e,t)=>{const{iconSize:r,buttonClassName:s,iconClassName:a,iconClassOverride:i,open:l,...u}=e;return n.jsx("button",{ref:t,...u,className:D(`py-0.5 px-2 shadow-none rounded-md border dark:border-gray-700/0 group-hover:border-border-interactive hover:border-border-interactive group-hover:bg-bg-base hover:!bg-gray-0 dark:hover:!bg-gray-800 group-hover:shadow-md hover:shadow-md hover:cursor-pointer active:border-border-interactive active:shadow focus:outline-none focus:ring transition-shadow duration-100 ease-in-out z-50`,s,{"border-border-interactive":l,"border-gray-300/0":!l}),children:n.jsx(aO,{className:D({"text-text-muted":!a||a&&!i},a),size:r})})}),q9="pr-3 py-2 uppercase font-bold text-sm tracking-wider leading-4 text-text-muted align-middle",jg="pl-1 pr-3 py-4 h-[3.25rem]",Sg="flex justify-end ml-auto @md:ml-0 relative",Ut={cellExpand:"flex-auto",cellAction:Sg,cellActionFixed:"min-w-[4%]",NullValue:kt,cellHeader:`pl-1 ${q9}`,cellHeaderCollapsibleFirstCol:`pl-11 ${q9}`,cellBody:"pl-1 pr-3 py-2 align-top",aclGUICellBody:`${jg} align-middle`,aclGUICellBodyAlignTop:`${jg} align-top`,aclGUICellAction:`${Sg} !py-2`,collapsibleCellBody:`${jg} align-middle`,collapsibleCellAction:`${Sg} !py-2`,cellSizeSm:"w-1/5",cellSizeMd:"w-1/4",cellSizeLg:"w-5/12"};function Lv({data:e,error:t,loading:r,emptyDataMessage:s,errorMessage:a,columns:i,children:l}){return n.jsx("div",{className:"border rounded-lg mt-6 overflow-x-auto overflow-y-hidden",children:n.jsxs("table",{className:"w-full bg-white dark:bg-gray-900",children:[n.jsx("thead",{className:"border-b",children:n.jsx("tr",{children:i.map((u,d)=>n.jsxs("td",{className:D(Ut.cellHeader,u.className,"normal-case font-normal !tracking-normal"),children:[u.screenReaderDescription&&n.jsx("span",{className:"sr-only",children:u.screenReaderDescription}),u.label]},`column-${d}`))})}),t||r||!e||e.length===0?n.jsx("tbody",{children:n.jsx("tr",{children:n.jsx("td",{colSpan:i.length,className:D("py-6 text-center",{"text-text-disabled":!t,"text-text-muted":t}),children:t?n.jsxs("div",{className:"flex items-center justify-center gap-2",children:[n.jsx(Oa,{className:"text-red-500",size:"1.25em"}),n.jsxs("span",{className:"font-normal",children:[a," Please try again later."]})]}):r?n.jsx($x,{className:"text-current justify-center"}):s})})}):n.jsx(n.Fragment,{children:l})]})})}function Zq(e){const{readonly:t}=e,{error:r}=Hi(),[s,a]=f.useState(!1),{access:i}=qt(de.ACLs),u=i?.type!=="write"||t,{variant:d}=Fr("replace-learn-more-ctas-with-descriptive-ctas",!0);return n.jsx(mn,{className:"mb-24",title:"Apps",description:"Route traffic to third-party SaaS apps through connectors on your tailnet.",learnMoreUrl:"https://tailscale.com/kb/1342/app-connectors-setup",learnMoreLabel:d==="variant1"?"See how to set up app connectors":void 0,additionalHeader:n.jsx(Qq,{posting:s,setPosting:a,error:r,readonly:u}),children:n.jsx(Jq,{posting:s,setPosting:a,readonly:u})})}function Qq(e){const{posting:t,setPosting:r,error:s,readonly:a}=e,{data:i}=ot(),[l,u]=f.useState(!1);return i?n.jsxs("div",{className:"flex justify-end items-end",children:[n.jsx(Ee,{content:a&&Ea,children:n.jsx(ue,{intent:"primary",sizeVariant:"medium",onClick:()=>u(!0),disabled:a||s||t,children:"Add app"})}),n.jsx(Rk,{open:l,onOpenChange:u,posting:t,setPosting:r})]}):null}const Yk="@md:w-1/4 flex-auto @md:flex-initial @md:shrink-0 w-0 text-ellipsis",Zk="hidden @md:block @md:w-1/3 overflow-hidden",Qk="hidden @md:block w-1/4",Jk="hidden @lg:block @md:flex-auto",Xk=D(Ut.cellAction,"w-1/6 @lg:w-12");function Jq(e){const{posting:t,setPosting:r,readonly:s}=e,[a,i]=f.useState(!1),{data:l,error:u}=Hi(),[d,m]=f.useState(void 0);return u?n.jsx(De,{error:u}):l?.appConnectors.length===0?n.jsxs(at,{className:"flex flex-col mt-6 items-center p-10",elevated:!0,children:[n.jsx(fn,{icon:n.jsx(e2,{size:25}),title:"Add an app",description:"Apps let you control access to your third-party SaaS applications, without requiring any end user configuration.",action:n.jsxs("div",{className:"flex gap-2",children:[n.jsx(Ee,{content:s&&Ea,children:n.jsx(ue,{intent:"primary",sizeVariant:"medium",onClick:()=>i(!0),disabled:s||t,children:"Add app"})}),n.jsx("a",{href:"https://tailscale.com/kb/1342/app-connectors-setup",rel:"noreferrer",target:"_blank",children:n.jsx(ue,{variant:"minimal",intent:"primary",children:"Learn more"})})]})}),n.jsx(Rk,{open:a,onOpenChange:i,posting:t,setPosting:r})]}):n.jsxs(n.Fragment,{children:[n.jsxs(We,{variant:"status",color:"gray",className:"flex text-sm items-center mt-6",children:[l?.appConnectors.length," ",yt("route",l?.appConnectors.length)]}),n.jsxs("table",{className:"tb mt-4",children:[n.jsx("thead",{children:n.jsxs("tr",{children:[n.jsx("th",{className:Yk,children:"Name"}),n.jsx("th",{className:Zk,children:"Domains"}),n.jsx("th",{className:Qk,children:"Connectors"}),n.jsx("th",{className:Jk,children:"Status"}),n.jsx("th",{className:Xk,children:n.jsx("span",{className:"sr-only",children:"App action menu"})})]})}),n.jsx("tbody",{children:l?.appConnectors.map(p=>n.jsx(Xq,{appConnector:p,posting:t,setPosting:r,setDialogState:m,readonly:s},p.name))})]}),n.jsxs(n.Fragment,{children:[n.jsx(Ok,{open:d?.type==="edit-app-connector",onOpenChange:()=>m(void 0),appConnectorID:d?.id,posting:t,setPosting:r}),n.jsx(Fk,{open:d?.type==="delete-app-connector",onOpenChange:()=>m(void 0),appConnectorID:d?.id,posting:t,setPosting:r})]})]})}function Xq(e){const{appConnector:t,posting:r,readonly:s,setDialogState:a}=e,{data:i,isLoading:l}=sn(),[u,d]=f.useState(t.domains||[]),{data:m}=vl(),p=f.useMemo(()=>i?.machines.filter(g=>t?.nodeIDs?.includes(g.stableId)),[i?.machines,t?.nodeIDs]);return f.useEffect(()=>{const g=m?.presetApps.find(v=>v.id===t?.presetAppID);g?.domains&&d(g.domains)},[t,m]),n.jsxs("tr",{id:"app-row",className:"w-full px-0.5 group hover:bg-gray-0 dark:hover:bg-gray-800",children:[n.jsx("td",{className:Yk,children:n.jsx("div",{className:"relative",children:n.jsxs("div",{className:"flex items-center",children:[n.jsx(_v,{presetAppID:t.presetAppID,className:"mr-2",size:20}),n.jsx("span",{className:"font-semibold hover:text-text-primary",children:n.jsx(ze,{href:`/admin/apps/${t.name}`,className:"stretched-link","aria-label":`Detail view for ${t.name}`,children:t.name})})]})})}),n.jsx("td",{className:Zk,children:n.jsx("div",{children:n.jsx("ul",{children:u.map(g=>n.jsx("li",{children:n.jsx("p",{children:g})},g))})})}),n.jsx("td",{className:Qk,children:n.jsx("div",{children:n.jsx("ul",{children:l?n.jsx(ts,{className:"text-gray-400",size:"sm"}):p&&p.length>0?p.map(g=>n.jsx("li",{children:n.jsx(eY,{machine:g},g.name)},g.name)):n.jsx(kt,{})})})}),n.jsx("td",{className:Jk,children:l?n.jsx(ts,{className:"text-gray-400",size:"sm"}):n.jsx(tY,{appConnector:t,machines:p})}),n.jsx("td",{className:D(Xk,"justify-items-end items-center @md:items-start"),children:n.jsx(eN,{appConnector:t,minimalMenuButton:!0,posting:r,readonly:s,setOnEditOpenDialog:()=>a({type:"edit-app-connector",id:t.name}),setOnDeleteOpenDialog:()=>a({type:"delete-app-connector",id:t.name})})})]})}function eN(e){const{appConnector:t,minimalMenuButton:r,posting:s,readonly:a,setOnEditOpenDialog:i,setOnDeleteOpenDialog:l}=e,[u,d]=f.useState(!1);if(a)return null;const m=[{type:"item",label:"Edit...",onSelect:()=>i(!0),hidden:a,disabled:s},{type:"item",label:"Remove...",onSelect:()=>l(!0),hidden:a,intent:"danger",disabled:s}];return n.jsx(n.Fragment,{children:n.jsx(el,{ariaLabel:`Actions for ${t.name}`,items:m,open:u,onOpenChange:d,side:"bottom",customTrigger:r?void 0:n.jsx(ue,{className:"min-w-0",children:n.jsx("div",{className:"flex items-center",children:"Actions"})})})})}function eY(e){const{machine:t}=e,{status:r,timestamp:s}=Wk(t,!0);return n.jsx("div",{className:"inline-flex items-center cursor-default",children:n.jsxs(Ee,{content:`Last seen ${s}`,side:"bottom",children:[n.jsx(Fn,{className:"mr-2",status:r.status}),t.name||"unknown"]})})}function tY(e){const{appConnector:t,machines:r}=e,[s]=Rv(t,r);return n.jsxs("span",{className:"flex items-center gap-1",children:[n.jsx(Fn,{status:s}),s==="error"?"Needs action":s==="connected"?"Active":"Offline"]})}function Rv(e,t){const r=e.connectors.length===1&&e.connectors[0]==="*";if(t===void 0||t.length===0)return["error","No connectors available",r?"No machines are advertised as connectors.":`No machines tagged with ${e.connectors.join(", ")} are advertised as connectors.`];if(e.connectors.length===0)return["error","No connectors defined","No connectors are defined in the app connector configuration."];if(e.domains?.length===0)return["error","No domains defined","No domains are defined in the app connector configuration."];let s=0,a=0,i=0;for(const l of t){if((l.brokenIPForwarding||l.extraIPs.length>0)&&i++,l.connectedToControl){s++;continue}a++}return i>0?["error","Some connectors aren’t configured properly",`${i} of ${t.length} connectors aren’t configured properly to route traffic. Review the machines below to troubleshoot the issue.`]:s===0&&a>0?["offline","Connectors are offline.","All connectors are offline."]:a>0?["error","Some connectors are offline",`${a} of ${t.length} connectors are offline and unable route traffic.`]:["connected","",""]}function tN(){return n.jsx(mn,{children:n.jsxs("div",{className:"max-w-md",children:[n.jsx("h3",{className:"text-xl font-medium mb-4",children:"Not found"}),n.jsx("p",{children:"Sorry, but we couldn’t find the page you were looking for."}),n.jsxs("p",{children:["You can"," ",n.jsx(ze,{href:"/admin",className:"link",children:"return home"}),"."]})]})})}function He(e){return n.jsxs("dl",{className:"flex gap-1",children:[n.jsxs("dt",{className:D("text-text-muted","w-1/3 @sm:w-1/4 @lg:w-1/3 shrink-0","min-w-0 truncate"),children:[e.label,e.tooltipLabel&&n.jsx(Ee,{content:e.tooltipLabel,children:n.jsx(Ee.InfoIcon,{className:"relative -top-px text-text-muted hover:text-text-base ml-1"})})]}),n.jsx("dd",{className:D("min-w-0",{truncate:!e.noTruncation}),children:e.children})]})}function Ao({as:e="h3",className:t,children:r}){const s=e;return n.jsx(s,{className:D("first:mt-0 mt-4 mb-2 text-sm uppercase font-semibold text-text-muted tracking-wide",t),children:r})}function Rn(e){const{className:t,hideAffordance:r,primaryActionSubject:s,primaryActionValue:a,secondaryActionValue:i,secondaryActionName:l,secondaryActionSubject:u,onSecondaryAction:d,children:m}=e,p=et(),g=f.useRef(null),v=f.useRef(null),[y,C]=f.useState(!1);f.useEffect(()=>{if(!y||!g.current||!v.current)return;const N=g.current.getBoundingClientRect(),k=window.innerWidth-N.left+4;v.current.style.maxWidth=`${k}px`,v.current.style.visibility="visible"},[y]);const b=()=>{Rr(a),p.show({message:`Copied ${s} to the clipboard`})},w=()=>{i&&(Rr(i),p.show({message:`Copied ${u||l} to the clipboard`}),d?.())};return n.jsxs("div",{className:"flex relative min-w-0",ref:g,onMouseLeave:()=>C(!1),children:[n.jsx("div",{onMouseEnter:()=>C(!0),className:D("truncate",t),children:m}),!r&&n.jsx("button",{onMouseEnter:()=>C(!0),onClick:b,className:D("cursor-pointer text-blue-500 dark:text-blue-400",{"ml-2":m}),children:"Copy"}),y&&n.jsx("div",{className:`absolute -mt-1 -ml-2 -top-px -left-px shadow-md cursor-pointer rounded-md active:shadow-sm transition-shadow duration-100 ease-in-out z-50`,style:{visibility:"hidden"},ref:v,children:n.jsxs("div",{className:"flex border rounded-md border-border-interactive bg-bg-base",children:[n.jsxs("div",{className:D("flex min-w-0 py-1 px-2 hover:bg-gray-0 dark:hover:bg-gray-800",{"rounded-md":!i,"rounded-l-md":i}),onClick:b,children:[n.jsx("span",{className:D(t,"inline-block select-none truncate"),children:m}),n.jsx("button",{className:D("cursor-pointer text-blue-500 dark:text-blue-400",{"ml-2":m}),children:"Copy"})]}),i&&n.jsx("div",{className:"text-blue-500 dark:text-blue-400 py-1 px-2 border-l hover:bg-gray-100 dark:hover:bg-gray-800 rounded-r-md",onClick:w,children:l})]})})]})}const gce=Object.freeze(Object.defineProperty({__proto__:null,default:Rn},Symbol.toStringTag,{value:"Module"}));function nY(e){const[,t]=ft(),r=f.useCallback(()=>{t("/admin/apps",{replace:!0})},[t]);return n.jsx(sY,{handleDelete:r,...e})}const rY="p-4 @md:p-6 border rounded-md";function sY(e){const{id:t,readonly:r}=e,{data:s,error:a}=Hi(),{access:i}=qt(de.ACLs),u=i?.type!=="write"||r,{data:d}=sn(),[m,p]=f.useState(!1),[g,v]=f.useState(void 0),y=s?.appConnectors.find(z=>z.name===t),[C,b]=f.useState(y?.domains||[]),{data:w}=vl();f.useEffect(()=>{const z=w?.presetApps.find(H=>H.id===y?.presetAppID);z?.domains&&b(z.domains)},[y,w]);const N=f.useMemo(()=>d?.machines.filter(z=>y?.nodeIDs?.includes(z.stableId)),[d?.machines,y?.nodeIDs]),k=y?.connectors.length===1&&y?.connectors[0]==="*";if(a)return n.jsx(De,{error:a});if(N===void 0)return n.jsx(De,{});if(y===void 0)return n.jsx(tN,{});const[E,T,_]=Rv(y,N),I=y.connectors.length>0,F=y.connectors.length===1&&y.connectors[0]==="*";return n.jsxs(mn,{children:[n.jsxs("section",{className:"mb-8 ",children:[n.jsxs("header",{className:"pb-4 mb-8 border-b",children:[n.jsxs("div",{className:"text-lg font-medium space-x-2 mb-5 truncate flex",children:[n.jsx(ze,{href:"/admin/apps",className:"link",children:"All Apps"}),n.jsx("span",{className:"breadcrumb-divider",children:"/"}),n.jsx(ze,{href:`/admin/apps/${y.name}`,children:y.name})]}),n.jsxs("div",{className:"flex flex-wrap gap-2 items-center justify-between",children:[n.jsxs("div",{className:"flex gap-3 items-center",children:[n.jsx(_v,{presetAppID:y.presetAppID,size:20}),n.jsx(is,{title:y.name,classes:`${Et.pageSubTitle} truncate flex-shrink-0 max-w-full`}),n.jsx(Fn,{status:E,size:"large",className:"mt-[3px]"})]}),n.jsxs("div",{className:"flex",children:[n.jsx(eN,{appConnector:y,posting:m,readonly:u,setOnEditOpenDialog:()=>v({type:"edit-app-connector",id:y.name}),setOnDeleteOpenDialog:()=>v({type:"delete-app-connector",id:y.name})}),n.jsx(Ok,{open:g?.type==="edit-app-connector",onOpenChange:()=>v(void 0),appConnectorID:g?.id,posting:m,setPosting:p}),n.jsx(Fk,{open:g?.type==="delete-app-connector",onOpenChange:()=>v(void 0),appConnectorID:g?.id,posting:m,setPosting:p})]})]})]}),k&&n.jsx(zk,{title:"Apps configured to use all available connectors are no longer supported",className:"mb-2"}),_!==""&&n.jsx(rt,{title:T,intent:E==="error"?"warning":"info",className:"mb-4",children:_})]}),n.jsxs("section",{className:"mb-8 ",children:[n.jsxs("header",{className:"mb-4",children:[n.jsx("h3",{className:D(Et.sectionTitle,"mb-2"),children:"Access"}),n.jsxs("p",{children:["Members of your network can access this service at the following domains and IPs."," ",n.jsx(Ge,{kbTopic:"app connectors",url:"https://tailscale.com/kb/1342/app-connectors-setup"})]})]}),n.jsxs("div",{className:D(rY,"grid grid-cols-1 @lg:grid-cols-2 gap-y-2 @sm:gap-x-12"),children:[n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsxs(He,{label:"Name",tooltipLabel:"User defined label for app connector groups.",children:[y.name||n.jsx(kt,{}),!u&&n.jsx(Fo,{setOnEditOpenDialog:()=>v({type:"edit-app-connector",id:y.name}),className:"ml-1"})]}),n.jsx(He,{label:"Preset App ID",tooltipLabel:"Preset apps have their configuration managed by Tailscale and are automatically kept up-to-date.",children:y.presetAppID||n.jsx(kt,{})}),n.jsx(He,{label:"Domains",tooltipLabel:"Domains this app connector will route.",children:n.jsxs("ul",{className:"pl-3 -indent-3",children:[C&&C.length>0?C.map(z=>n.jsx("li",{children:z},z)):n.jsx("li",{children:n.jsx(kt,{})}),n.jsx("li",{children:!u&&!y.presetAppID&&n.jsx(Fo,{setOnEditOpenDialog:()=>v({type:"edit-app-connector",id:y.name})})})]})}),n.jsx(He,{label:"Connectors",tooltipLabel:"Connectors used for this app.",children:n.jsxs("ul",{className:"pl-3 -indent-3",children:[I?F?"All available connectors":y.connectors.map(z=>n.jsx("li",{children:z},z)):n.jsx("li",{children:n.jsx(kt,{})}),n.jsx("li",{children:!u&&n.jsx(Fo,{setOnEditOpenDialog:()=>v({type:"edit-app-connector",id:y.name})})})]})})]}),n.jsx("div",{className:"flex flex-col gap-2",children:n.jsx(He,{label:"Egress IPs",tooltipLabel:`Endpoint IP addresses of your app connector${N.length>1?"s":""}.`,children:n.jsx("ul",{children:y.egressIPs!==void 0&&y.egressIPs.length>0?n.jsx(oY,{egressIPs:y.egressIPs}):n.jsx("li",{children:n.jsx(kt,{})})})})})]})]}),n.jsxs("section",{className:"mb-8",children:[n.jsxs("header",{className:"mb-4",children:[n.jsx("h3",{className:D(Et.sectionTitle,"mb-2"),children:"Connectors"}),n.jsxs("p",{children:["The following machines provide these routes to your tailnet."," ",n.jsx(Ge,{kbTopic:"app connectors",url:"https://tailscale.com/kb/1342/app-connectors-setup"})]})]}),n.jsx(aY,{machines:N,appConnector:y})]})]})}const nN="@md:w-2/3 flex-auto @md:flex-initial @md:shrink-0 w-0 text-ellipsis",rN="hidden @md:block @md:w-1/3";function aY(e){const{machines:t,appConnector:r}=e;return n.jsxs("table",{className:"tb",children:[n.jsx("thead",{children:n.jsxs("tr",{children:[n.jsx("th",{className:nN,children:"Machine"}),n.jsx("th",{className:rN,children:"Managed By"})]})}),n.jsx("tbody",{children:t?.map(s=>n.jsx(iY,{machine:s,appConnector:r},s.name))})]})}function iY(e){const{appConnector:t,machine:r}=e,{status:s,timestamp:a}=Wk(r,!0);return n.jsxs("tr",{id:t.name,className:"w-full px-0.5 group hover:bg-gray-0 dark:hover:bg-gray-800",children:[n.jsx("td",{className:nN,children:n.jsx("div",{className:"relative",children:n.jsx("div",{className:"items-center font-semibold hover:text-blue-500",children:n.jsx("div",{className:"inline-flex items-center cursor-default",children:n.jsxs(Ee,{content:`Last seen ${a}`,side:"bottom",children:[n.jsx(Fn,{className:"mr-2",status:s.status}),n.jsx(ze,{href:"/admin/machines/"+r.addresses[0],className:"stretched-link","aria-label":`Detail view for ${r.name}`,children:r.name||"unknown"})]})})})})}),n.jsx("td",{className:rN,children:r.allowedTags.map(i=>t.connectors.includes(i)&&n.jsx(V0,{tag:i,className:"mr-1 mt-1"},i))})]})}function Fo(e){const{setOnEditOpenDialog:t,className:r}=e;return n.jsx("button",{onClick:t,className:D("cursor-pointer text-text-primary",r),children:"Edit"})}function oY(e){const{egressIPs:t}=e,r=f.useMemo(()=>t.sort((s,a)=>{const i=fb(s),l=fb(a);if(i&&!l)return-1;if(!i&&l)return 1;const u=hb(s),d=hb(a);return u&&!d?-1:!u&&d?1:s.localeCompare(a)}),[t]);return n.jsx(n.Fragment,{children:r?.map(s=>n.jsx("li",{children:n.jsx(Rn,{primaryActionValue:s,primaryActionSubject:"Egress IP address",children:n.jsx(vi,{ip:s})})},s))})}function lY(e,t,r,s){const[a,i]=f.useState(!1),[l,u]=f.useState(null);return{handleSurveyFormSubmit:()=>{if(a)return;i(!0),u(null);const{reason:m,comments:p}=e;Ie.post("/public/events/survey/downgrade",{reason:m?.value,comments:p,currentPlan:t,newPlan:r,addOn:s}).catch(g=>{u(g)}).finally(()=>{i(!1)})},isPosting:a,error:l}}function Y9(e,[t,r]){return Math.min(r,Math.max(t,e))}var cY=[" ","Enter","ArrowUp","ArrowDown"],uY=[" ","Enter"],Pi="Select",[xh,vh,dY]=E2(Pi),[yl]=Cr(Pi,[dY,Ns]),yh=Ns(),[mY,Va]=yl(Pi),[fY,hY]=yl(Pi),sN=e=>{const{__scopeSelect:t,children:r,open:s,defaultOpen:a,onOpenChange:i,value:l,defaultValue:u,onValueChange:d,dir:m,name:p,autoComplete:g,disabled:v,required:y,form:C}=e,b=yh(t),[w,N]=f.useState(null),[k,E]=f.useState(null),[T,_]=f.useState(!1),I=oh(m),[F,z]=Mr({prop:s,defaultProp:a??!1,onChange:i,caller:Pi}),[H,J]=Mr({prop:l,defaultProp:u,onChange:d,caller:Pi}),Y=f.useRef(null),B=w?C||!!w.closest("form"):!0,[W,U]=f.useState(new Set),Z=Array.from(W).map(re=>re.props.value).join(";");return n.jsx(ul,{...b,children:n.jsxs(mY,{required:y,scope:t,trigger:w,onTriggerChange:N,valueNode:k,onValueNodeChange:E,valueNodeHasChildren:T,onValueNodeHasChildrenChange:_,contentId:qn(),value:H,onValueChange:J,open:F,onOpenChange:z,dir:I,triggerPointerDownPosRef:Y,disabled:v,children:[n.jsx(xh.Provider,{scope:t,children:n.jsx(fY,{scope:e.__scopeSelect,onNativeOptionAdd:f.useCallback(re=>{U(me=>new Set(me).add(re))},[]),onNativeOptionRemove:f.useCallback(re=>{U(me=>{const L=new Set(me);return L.delete(re),L})},[]),children:r})}),B?n.jsxs(jN,{"aria-hidden":!0,required:y,tabIndex:-1,name:p,autoComplete:g,value:H,onChange:re=>J(re.target.value),disabled:v,form:C,children:[H===void 0?n.jsx("option",{value:""}):null,Array.from(W)]},Z):null]})})};sN.displayName=Pi;var aN="SelectTrigger",iN=f.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:s=!1,...a}=e,i=yh(r),l=Va(aN,r),u=l.disabled||s,d=Ct(t,l.onTriggerChange),m=vh(r),p=f.useRef("touch"),[g,v,y]=kN(b=>{const w=m().filter(E=>!E.disabled),N=w.find(E=>E.value===l.value),k=NN(w,b,N);k!==void 0&&l.onValueChange(k.value)}),C=b=>{u||(l.onOpenChange(!0),y()),b&&(l.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return n.jsx(dl,{asChild:!0,...i,children:n.jsx(tt.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":SN(l.value)?"":void 0,...a,ref:d,onClick:je(a.onClick,b=>{b.currentTarget.focus(),p.current!=="mouse"&&C(b)}),onPointerDown:je(a.onPointerDown,b=>{p.current=b.pointerType;const w=b.target;w.hasPointerCapture(b.pointerId)&&w.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(C(b),b.preventDefault())}),onKeyDown:je(a.onKeyDown,b=>{const w=g.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&v(b.key),!(w&&b.key===" ")&&cY.includes(b.key)&&(C(),b.preventDefault())})})})});iN.displayName=aN;var oN="SelectValue",lN=f.forwardRef((e,t)=>{const{__scopeSelect:r,className:s,style:a,children:i,placeholder:l="",...u}=e,d=Va(oN,r),{onValueNodeHasChildrenChange:m}=d,p=i!==void 0,g=Ct(t,d.onValueNodeChange);return kn(()=>{m(p)},[m,p]),n.jsx(tt.span,{...u,ref:g,style:{pointerEvents:"none"},children:SN(d.value)?n.jsx(n.Fragment,{children:l}):i})});lN.displayName=oN;var pY="SelectIcon",gY=f.forwardRef((e,t)=>{const{__scopeSelect:r,children:s,...a}=e;return n.jsx(tt.span,{"aria-hidden":!0,...a,ref:t,children:s||"▼"})});gY.displayName=pY;var xY="SelectPortal",cN=e=>n.jsx(Fi,{asChild:!0,...e});cN.displayName=xY;var Ti="SelectContent",uN=f.forwardRef((e,t)=>{const r=Va(Ti,e.__scopeSelect),[s,a]=f.useState();if(kn(()=>{a(new DocumentFragment)},[]),!r.open){const i=s;return i?Mi.createPortal(n.jsx(dN,{scope:e.__scopeSelect,children:n.jsx(xh.Slot,{scope:e.__scopeSelect,children:n.jsx("div",{children:e.children})})}),i):null}return n.jsx(mN,{...e,ref:t})});uN.displayName=Ti;var qr=10,[dN,$a]=yl(Ti),vY="SelectContentImpl",yY=Si("SelectContent.RemoveScroll"),mN=f.forwardRef((e,t)=>{const{__scopeSelect:r,position:s="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:l,side:u,sideOffset:d,align:m,alignOffset:p,arrowPadding:g,collisionBoundary:v,collisionPadding:y,sticky:C,hideWhenDetached:b,avoidCollisions:w,...N}=e,k=Va(Ti,r),[E,T]=f.useState(null),[_,I]=f.useState(null),F=Ct(t,se=>T(se)),[z,H]=f.useState(null),[J,Y]=f.useState(null),B=vh(r),[W,U]=f.useState(!1),Z=f.useRef(!1);f.useEffect(()=>{if(E)return th(E)},[E]),eh();const re=f.useCallback(se=>{const[le,...Ae]=B().map(Ze=>Ze.ref.current),[Te]=Ae.slice(-1),Ue=document.activeElement;for(const Ze of se)if(Ze===Ue||(Ze?.scrollIntoView({block:"nearest"}),Ze===le&&_&&(_.scrollTop=0),Ze===Te&&_&&(_.scrollTop=_.scrollHeight),Ze?.focus(),document.activeElement!==Ue))return},[B,_]),me=f.useCallback(()=>re([z,E]),[re,z,E]);f.useEffect(()=>{W&&me()},[W,me]);const{onOpenChange:L,triggerPointerDownPosRef:V}=k;f.useEffect(()=>{if(E){let se={x:0,y:0};const le=Te=>{se={x:Math.abs(Math.round(Te.pageX)-(V.current?.x??0)),y:Math.abs(Math.round(Te.pageY)-(V.current?.y??0))}},Ae=Te=>{se.x<=10&&se.y<=10?Te.preventDefault():E.contains(Te.target)||L(!1),document.removeEventListener("pointermove",le),V.current=null};return V.current!==null&&(document.addEventListener("pointermove",le),document.addEventListener("pointerup",Ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",le),document.removeEventListener("pointerup",Ae,{capture:!0})}}},[E,L,V]),f.useEffect(()=>{const se=()=>L(!1);return window.addEventListener("blur",se),window.addEventListener("resize",se),()=>{window.removeEventListener("blur",se),window.removeEventListener("resize",se)}},[L]);const[P,q]=kN(se=>{const le=B().filter(Ue=>!Ue.disabled),Ae=le.find(Ue=>Ue.ref.current===document.activeElement),Te=NN(le,se,Ae);Te&&setTimeout(()=>Te.ref.current.focus())}),Q=f.useCallback((se,le,Ae)=>{const Te=!Z.current&&!Ae;(k.value!==void 0&&k.value===le||Te)&&(H(se),Te&&(Z.current=!0))},[k.value]),ae=f.useCallback(()=>E?.focus(),[E]),X=f.useCallback((se,le,Ae)=>{const Te=!Z.current&&!Ae;(k.value!==void 0&&k.value===le||Te)&&Y(se)},[k.value]),fe=s==="popper"?$0:fN,he=fe===$0?{side:u,sideOffset:d,align:m,alignOffset:p,arrowPadding:g,collisionBoundary:v,collisionPadding:y,sticky:C,hideWhenDetached:b,avoidCollisions:w}:{};return n.jsx(dN,{scope:r,content:E,viewport:_,onViewportChange:I,itemRefCallback:Q,selectedItem:z,onItemLeave:ae,itemTextRefCallback:X,focusSelectedItem:me,selectedItemText:J,position:s,isPositioned:W,searchRef:P,children:n.jsx(bu,{as:yY,allowPinchZoom:!0,children:n.jsx(yu,{asChild:!0,trapped:k.open,onMountAutoFocus:se=>{se.preventDefault()},onUnmountAutoFocus:je(a,se=>{k.trigger?.focus({preventScroll:!0}),se.preventDefault()}),children:n.jsx(Ri,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:se=>se.preventDefault(),onDismiss:()=>k.onOpenChange(!1),children:n.jsx(fe,{role:"listbox",id:k.contentId,"data-state":k.open?"open":"closed",dir:k.dir,onContextMenu:se=>se.preventDefault(),...N,...he,onPlaced:()=>U(!0),ref:F,style:{display:"flex",flexDirection:"column",outline:"none",...N.style},onKeyDown:je(N.onKeyDown,se=>{const le=se.ctrlKey||se.altKey||se.metaKey;if(se.key==="Tab"&&se.preventDefault(),!le&&se.key.length===1&&q(se.key),["ArrowUp","ArrowDown","Home","End"].includes(se.key)){let Te=B().filter(Ue=>!Ue.disabled).map(Ue=>Ue.ref.current);if(["ArrowUp","End"].includes(se.key)&&(Te=Te.slice().reverse()),["ArrowUp","ArrowDown"].includes(se.key)){const Ue=se.target,Ze=Te.indexOf(Ue);Te=Te.slice(Ze+1)}setTimeout(()=>re(Te)),se.preventDefault()}})})})})})})});mN.displayName=vY;var bY="SelectItemAlignedPosition",fN=f.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:s,...a}=e,i=Va(Ti,r),l=$a(Ti,r),[u,d]=f.useState(null),[m,p]=f.useState(null),g=Ct(t,F=>p(F)),v=vh(r),y=f.useRef(!1),C=f.useRef(!0),{viewport:b,selectedItem:w,selectedItemText:N,focusSelectedItem:k}=l,E=f.useCallback(()=>{if(i.trigger&&i.valueNode&&u&&m&&b&&w&&N){const F=i.trigger.getBoundingClientRect(),z=m.getBoundingClientRect(),H=i.valueNode.getBoundingClientRect(),J=N.getBoundingClientRect();if(i.dir!=="rtl"){const Ue=J.left-z.left,Ze=H.left-Ue,ct=F.left-Ze,ht=F.width+ct,Tt=Math.max(ht,z.width),xe=window.innerWidth-qr,Fe=Y9(Ze,[qr,Math.max(qr,xe-Tt)]);u.style.minWidth=ht+"px",u.style.left=Fe+"px"}else{const Ue=z.right-J.right,Ze=window.innerWidth-H.right-Ue,ct=window.innerWidth-F.right-Ze,ht=F.width+ct,Tt=Math.max(ht,z.width),xe=window.innerWidth-qr,Fe=Y9(Ze,[qr,Math.max(qr,xe-Tt)]);u.style.minWidth=ht+"px",u.style.right=Fe+"px"}const Y=v(),B=window.innerHeight-qr*2,W=b.scrollHeight,U=window.getComputedStyle(m),Z=parseInt(U.borderTopWidth,10),re=parseInt(U.paddingTop,10),me=parseInt(U.borderBottomWidth,10),L=parseInt(U.paddingBottom,10),V=Z+re+W+L+me,P=Math.min(w.offsetHeight*5,V),q=window.getComputedStyle(b),Q=parseInt(q.paddingTop,10),ae=parseInt(q.paddingBottom,10),X=F.top+F.height/2-qr,fe=B-X,he=w.offsetHeight/2,se=w.offsetTop+he,le=Z+re+se,Ae=V-le;if(le<=X){const Ue=Y.length>0&&w===Y[Y.length-1].ref.current;u.style.bottom="0px";const Ze=m.clientHeight-b.offsetTop-b.offsetHeight,ct=Math.max(fe,he+(Ue?ae:0)+Ze+me),ht=le+ct;u.style.height=ht+"px"}else{const Ue=Y.length>0&&w===Y[0].ref.current;u.style.top="0px";const ct=Math.max(X,Z+b.offsetTop+(Ue?Q:0)+he)+Ae;u.style.height=ct+"px",b.scrollTop=le-X+b.offsetTop}u.style.margin=`${qr}px 0`,u.style.minHeight=P+"px",u.style.maxHeight=B+"px",s?.(),requestAnimationFrame(()=>y.current=!0)}},[v,i.trigger,i.valueNode,u,m,b,w,N,i.dir,s]);kn(()=>E(),[E]);const[T,_]=f.useState();kn(()=>{m&&_(window.getComputedStyle(m).zIndex)},[m]);const I=f.useCallback(F=>{F&&C.current===!0&&(E(),k?.(),C.current=!1)},[E,k]);return n.jsx(wY,{scope:r,contentWrapper:u,shouldExpandOnScrollRef:y,onScrollButtonChange:I,children:n.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:T},children:n.jsx(tt.div,{...a,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});fN.displayName=bY;var CY="SelectPopperPosition",$0=f.forwardRef((e,t)=>{const{__scopeSelect:r,align:s="start",collisionPadding:a=qr,...i}=e,l=yh(r);return n.jsx(fu,{...l,...i,ref:t,align:s,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});$0.displayName=CY;var[wY,Ov]=yl(Ti,{}),H0="SelectViewport",hN=f.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:s,...a}=e,i=$a(H0,r),l=Ov(H0,r),u=Ct(t,i.onViewportChange),d=f.useRef(0);return n.jsxs(n.Fragment,{children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),n.jsx(xh.Slot,{scope:r,children:n.jsx(tt.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:je(a.onScroll,m=>{const p=m.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:v}=l;if(v?.current&&g){const y=Math.abs(d.current-p.scrollTop);if(y>0){const C=window.innerHeight-qr*2,b=parseFloat(g.style.minHeight),w=parseFloat(g.style.height),N=Math.max(b,w);if(N0?T:0,g.style.justifyContent="flex-end")}}}d.current=p.scrollTop})})})]})});hN.displayName=H0;var pN="SelectGroup",[jY,SY]=yl(pN),kY=f.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e,a=qn();return n.jsx(jY,{scope:r,id:a,children:n.jsx(tt.div,{role:"group","aria-labelledby":a,...s,ref:t})})});kY.displayName=pN;var gN="SelectLabel",NY=f.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e,a=SY(gN,r);return n.jsx(tt.div,{id:a.id,...s,ref:t})});NY.displayName=gN;var xf="SelectItem",[EY,xN]=yl(xf),vN=f.forwardRef((e,t)=>{const{__scopeSelect:r,value:s,disabled:a=!1,textValue:i,...l}=e,u=Va(xf,r),d=$a(xf,r),m=u.value===s,[p,g]=f.useState(i??""),[v,y]=f.useState(!1),C=Ct(t,k=>d.itemRefCallback?.(k,s,a)),b=qn(),w=f.useRef("touch"),N=()=>{a||(u.onValueChange(s),u.onOpenChange(!1))};if(s==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return n.jsx(EY,{scope:r,value:s,disabled:a,textId:b,isSelected:m,onItemTextChange:f.useCallback(k=>{g(E=>E||(k?.textContent??"").trim())},[]),children:n.jsx(xh.ItemSlot,{scope:r,value:s,disabled:a,textValue:p,children:n.jsx(tt.div,{role:"option","aria-labelledby":b,"data-highlighted":v?"":void 0,"aria-selected":m&&v,"data-state":m?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...l,ref:C,onFocus:je(l.onFocus,()=>y(!0)),onBlur:je(l.onBlur,()=>y(!1)),onClick:je(l.onClick,()=>{w.current!=="mouse"&&N()}),onPointerUp:je(l.onPointerUp,()=>{w.current==="mouse"&&N()}),onPointerDown:je(l.onPointerDown,k=>{w.current=k.pointerType}),onPointerMove:je(l.onPointerMove,k=>{w.current=k.pointerType,a?d.onItemLeave?.():w.current==="mouse"&&k.currentTarget.focus({preventScroll:!0})}),onPointerLeave:je(l.onPointerLeave,k=>{k.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:je(l.onKeyDown,k=>{d.searchRef?.current!==""&&k.key===" "||(uY.includes(k.key)&&N(),k.key===" "&&k.preventDefault())})})})})});vN.displayName=xf;var bc="SelectItemText",yN=f.forwardRef((e,t)=>{const{__scopeSelect:r,className:s,style:a,...i}=e,l=Va(bc,r),u=$a(bc,r),d=xN(bc,r),m=hY(bc,r),[p,g]=f.useState(null),v=Ct(t,N=>g(N),d.onItemTextChange,N=>u.itemTextRefCallback?.(N,d.value,d.disabled)),y=p?.textContent,C=f.useMemo(()=>n.jsx("option",{value:d.value,disabled:d.disabled,children:y},d.value),[d.disabled,d.value,y]),{onNativeOptionAdd:b,onNativeOptionRemove:w}=m;return kn(()=>(b(C),()=>w(C)),[b,w,C]),n.jsxs(n.Fragment,{children:[n.jsx(tt.span,{id:d.textId,...i,ref:v}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Mi.createPortal(i.children,l.valueNode):null]})});yN.displayName=bc;var bN="SelectItemIndicator",CN=f.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e;return xN(bN,r).isSelected?n.jsx(tt.span,{"aria-hidden":!0,...s,ref:t}):null});CN.displayName=bN;var z0="SelectScrollUpButton",AY=f.forwardRef((e,t)=>{const r=$a(z0,e.__scopeSelect),s=Ov(z0,e.__scopeSelect),[a,i]=f.useState(!1),l=Ct(t,s.onScrollButtonChange);return kn(()=>{if(r.viewport&&r.isPositioned){let u=function(){const m=d.scrollTop>0;i(m)};const d=r.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),a?n.jsx(wN,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=r;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null});AY.displayName=z0;var W0="SelectScrollDownButton",PY=f.forwardRef((e,t)=>{const r=$a(W0,e.__scopeSelect),s=Ov(W0,e.__scopeSelect),[a,i]=f.useState(!1),l=Ct(t,s.onScrollButtonChange);return kn(()=>{if(r.viewport&&r.isPositioned){let u=function(){const m=d.scrollHeight-d.clientHeight,p=Math.ceil(d.scrollTop)d.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),a?n.jsx(wN,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=r;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null});PY.displayName=W0;var wN=f.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:s,...a}=e,i=$a("SelectScrollButton",r),l=f.useRef(null),u=vh(r),d=f.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return f.useEffect(()=>()=>d(),[d]),kn(()=>{u().find(p=>p.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),n.jsx(tt.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:je(a.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(s,50))}),onPointerMove:je(a.onPointerMove,()=>{i.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(s,50))}),onPointerLeave:je(a.onPointerLeave,()=>{d()})})}),TY="SelectSeparator",IY=f.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e;return n.jsx(tt.div,{"aria-hidden":!0,...s,ref:t})});IY.displayName=TY;var K0="SelectArrow",DY=f.forwardRef((e,t)=>{const{__scopeSelect:r,...s}=e,a=yh(r),i=Va(K0,r),l=$a(K0,r);return i.open&&l.position==="popper"?n.jsx(hu,{...a,...s,ref:t}):null});DY.displayName=K0;var _Y="SelectBubbleInput",jN=f.forwardRef(({__scopeSelect:e,value:t,...r},s)=>{const a=f.useRef(null),i=Ct(s,a),l=Sk(t);return f.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&p){const g=new Event("change",{bubbles:!0});p.call(u,t),u.dispatchEvent(g)}},[l,t]),n.jsx(tt.select,{...r,style:{...d7,...r.style},ref:i,defaultValue:t})});jN.displayName=_Y;function SN(e){return e===""||e===void 0}function kN(e){const t=Xr(e),r=f.useRef(""),s=f.useRef(0),a=f.useCallback(l=>{const u=r.current+l;t(u),(function d(m){r.current=m,window.clearTimeout(s.current),m!==""&&(s.current=window.setTimeout(()=>d(""),1e3))})(u)},[t]),i=f.useCallback(()=>{r.current="",window.clearTimeout(s.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(s.current),[]),[r,a,i]}function NN(e,t,r){const a=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,i=r?e.indexOf(r):-1;let l=MY(e,Math.max(i,0));a.length===1&&(l=l.filter(m=>m!==r));const d=l.find(m=>m.textValue.toLowerCase().startsWith(a.toLowerCase()));return d!==r?d:void 0}function MY(e,t){return e.map((r,s)=>e[(t+s)%e.length])}var LY=sN,RY=iN,Z9=lN,OY=cN,FY=uN,BY=hN,UY=vN,VY=yN,$Y=CN;function br({className:e,buttonClassName:t,values:r,selected:s,onUpdateSelected:a,placeholder:i,children:l,disabled:u,variant:d,asPopper:m,withoutIndicator:p,onOpen:g=()=>{},onDismiss:v}){return n.jsxs(LY,{value:s?.label,onValueChange:y=>{const C=r.find(b=>b.label===y);C&&a(C)},disabled:u,onOpenChange:y=>{y&&g()},children:[n.jsx(RY,{className:e,asChild:!0,children:l?n.jsx("button",{children:n.jsx(Z9,{asChild:!0,children:l})}):n.jsx(ue,{className:D("flex min-w-[180px]",t),textAlign:"left",variant:d,suffixIcon:n.jsx(Nn,{className:"text-text-muted"}),children:n.jsx("div",{className:"truncate leading-normal",children:n.jsx(Z9,{placeholder:i})})})}),n.jsx(OY,{children:n.jsx(FY,{className:D("dropdown rounded-md bg-bg-base max-w-lg overflow-hidden z-50",{"radix-select-full-width":m}),position:m?"popper":"item-aligned",onPointerDownOutside:v,children:n.jsx(BY,{children:r.map(y=>n.jsxs(UY,{className:Fv,value:y.label,children:[!p&&n.jsx("div",{className:EN,children:n.jsx($Y,{children:n.jsx(nn,{size:"1em"})})}),n.jsxs("div",{children:[n.jsx(VY,{children:y.label}),y.description&&n.jsx("p",{className:"!text-text-muted",children:y.description})]})]},y.label))})})})]})}function HY({values:e,selected:t,onUpdateSelected:r}){return n.jsx("div",{children:e.map(s=>n.jsxs("button",{className:D("w-full",Fv),value:s.value,onClick:()=>r(s),children:[n.jsx("div",{className:EN,children:t?.value===s.value&&n.jsx(nn,{size:"1em"})}),n.jsx("div",{children:s.label})]},s.value))})}const Fv=`${Vi} ${gl} flex items-center select-none gap-2`,EN="w-4";function zY(e){return WY.find(t=>t.name===e||t.code===e)}const WY=[{name:"Afghanistan",code:"AF"},{name:"Albania",code:"AL"},{name:"Algeria",code:"DZ"},{name:"American Samoa",code:"AS"},{name:"Andorra",code:"AD"},{name:"Angola",code:"AO"},{name:"Anguilla",code:"AI"},{name:"Antarctica",code:"AQ"},{name:"Antigua & Barbuda",code:"AG"},{name:"Argentina",code:"AR"},{name:"Armenia",code:"AM"},{name:"Aruba",code:"AW"},{name:"Australia",code:"AU"},{name:"Austria",code:"AT"},{name:"Azerbaijan",code:"AZ"},{name:"Bahamas",code:"BS"},{name:"Bahrain",code:"BH"},{name:"Bangladesh",code:"BD"},{name:"Barbados",code:"BB"},{name:"Belarus",code:"BY"},{name:"Belgium",code:"BE"},{name:"Belize",code:"BZ"},{name:"Benin",code:"BJ"},{name:"Bermuda",code:"BM"},{name:"Bhutan",code:"BT"},{name:"Bolivia",code:"BO"},{name:"Bosnia & Herzegovina",code:"BA"},{name:"Botswana",code:"BW"},{name:"Bouvet Island",code:"BV"},{name:"Brazil",code:"BR"},{name:"British Indian Ocean Territory",code:"IO"},{name:"British Virgin Islands",code:"VG"},{name:"Brunei",code:"BN"},{name:"Bulgaria",code:"BG"},{name:"Burkina Faso",code:"BF"},{name:"Burundi",code:"BI"},{name:"Cambodia",code:"KH"},{name:"Cameroon",code:"CM"},{name:"Canada",code:"CA"},{name:"Capo Verde",code:"CV"},{name:"Caribbean Netherlands",code:"BQ"},{name:"Cayman Islands",code:"KY"},{name:"Central African Republic",code:"CF"},{name:"Chad",code:"TD"},{name:"Chile",code:"CL"},{name:"China",code:"CN"},{name:"Christmas Island",code:"CX"},{name:"Cocos (Keeling) Islands",code:"CC"},{name:"Colombia",code:"CO"},{name:"Comoros",code:"KM"},{name:"Congo-Brazzaville",code:"CG"},{name:"Congo-Kinshasa",code:"CD"},{name:"Cook Islands",code:"CK"},{name:"Costa Rica",code:"CR"},{name:"Croatia",code:"HR"},{name:"Cuba",code:"CU"},{name:"Curaçao",code:"CW"},{name:"Cyprus",code:"CY"},{name:"Czech Republic",code:"CZ"},{name:"Côte d’Ivoire",code:"CI"},{name:"Denmark",code:"DK"},{name:"Djibouti",code:"DJ"},{name:"Dominica",code:"DM"},{name:"Dominican Republic",code:"DO"},{name:"Ecuador",code:"EC"},{name:"Egypt",code:"EG"},{name:"El Salvador",code:"SV"},{name:"Equatorial Guinea",code:"GQ"},{name:"Eritrea",code:"ER"},{name:"Estonia",code:"EE"},{name:"Eswatini",code:"SZ"},{name:"Ethiopia",code:"ET"},{name:"Falkland Islands",code:"FK"},{name:"Faroe Islands",code:"FO"},{name:"Fiji",code:"FJ"},{name:"Finland",code:"FI"},{name:"France",code:"FR"},{name:"French Guiana",code:"GF"},{name:"French Polynesia",code:"PF"},{name:"French Southern Territories",code:"TF"},{name:"Gabon",code:"GA"},{name:"Gambia",code:"GM"},{name:"Georgia",code:"GE"},{name:"Germany",code:"DE"},{name:"Ghana",code:"GH"},{name:"Gibraltar",code:"GI"},{name:"Greece",code:"GR"},{name:"Greenland",code:"GL"},{name:"Grenada",code:"GD"},{name:"Guadeloupe",code:"GP"},{name:"Guam",code:"GU"},{name:"Guatemala",code:"GT"},{name:"Guernsey",code:"GG"},{name:"Guinea",code:"GN"},{name:"Guinea-Bissau",code:"GW"},{name:"Guyana",code:"GY"},{name:"Haiti",code:"HT"},{name:"Heard Island & McDonald Islands",code:"HM"},{name:"Honduras",code:"HN"},{name:"Hong Kong",code:"HK"},{name:"Hungary",code:"HU"},{name:"Iceland",code:"IS"},{name:"India",code:"IN"},{name:"Indonesia",code:"ID"},{name:"Iran",code:"IR"},{name:"Iraq",code:"IQ"},{name:"Ireland",code:"IE"},{name:"Isle of Man",code:"IM"},{name:"Israel",code:"IL"},{name:"Italy",code:"IT"},{name:"Jamaica",code:"JM"},{name:"Japan",code:"JP"},{name:"Jersey",code:"JE"},{name:"Jordan",code:"JO"},{name:"Kazakhstan",code:"KZ"},{name:"Kenya",code:"KE"},{name:"Kiribati",code:"KI"},{name:"Kuwait",code:"KW"},{name:"Kyrgyzstan",code:"KG"},{name:"Laos",code:"LA"},{name:"Latvia",code:"LV"},{name:"Lebanon",code:"LB"},{name:"Lesotho",code:"LS"},{name:"Liberia",code:"LR"},{name:"Libya",code:"LY"},{name:"Liechtenstein",code:"LI"},{name:"Lithuania",code:"LT"},{name:"Luxembourg",code:"LU"},{name:"Macao",code:"MO"},{name:"Madagascar",code:"MG"},{name:"Malawi",code:"MW"},{name:"Malaysia",code:"MY"},{name:"Maldives",code:"MV"},{name:"Mali",code:"ML"},{name:"Malta",code:"MT"},{name:"Marshall Islands",code:"MH"},{name:"Martinique",code:"MQ"},{name:"Mauritania",code:"MR"},{name:"Mauritius",code:"MU"},{name:"Mayotte",code:"YT"},{name:"Mexico",code:"MX"},{name:"Micronesia",code:"FM"},{name:"Moldova",code:"MD"},{name:"Monaco",code:"MC"},{name:"Mongolia",code:"MN"},{name:"Montenegro",code:"ME"},{name:"Montserrat",code:"MS"},{name:"Morocco",code:"MA"},{name:"Mozambique",code:"MZ"},{name:"Myanmar (Burma)",code:"MM"},{name:"Namibia",code:"NA"},{name:"Nauru",code:"NR"},{name:"Nepal",code:"NP"},{name:"Netherlands",code:"NL"},{name:"New Caledonia",code:"NC"},{name:"New Zealand",code:"NZ"},{name:"Nicaragua",code:"NI"},{name:"Niger",code:"NE"},{name:"Nigeria",code:"NG"},{name:"Niue",code:"NU"},{name:"Norfolk Island",code:"NF"},{name:"North Korea",code:"KP"},{name:"North Macedonia",code:"MK"},{name:"Northern Mariana Islands",code:"MP"},{name:"Norway",code:"NO"},{name:"Oman",code:"OM"},{name:"Pakistan",code:"PK"},{name:"Palau",code:"PW"},{name:"Palestinian Territories",code:"PS"},{name:"Panama",code:"PA"},{name:"Papua New Guinea",code:"PG"},{name:"Paraguay",code:"PY"},{name:"Peru",code:"PE"},{name:"Philippines",code:"PH"},{name:"Pitcairn Islands",code:"PN"},{name:"Poland",code:"PL"},{name:"Portugal",code:"PT"},{name:"Puerto Rico",code:"PR"},{name:"Qatar",code:"QA"},{name:"Romania",code:"RO"},{name:"Russia",code:"RU"},{name:"Rwanda",code:"RW"},{name:"Réunion",code:"RE"},{name:"Samoa",code:"WS"},{name:"San Marino",code:"SM"},{name:"Saudi Arabia",code:"SA"},{name:"Senegal",code:"SN"},{name:"Serbia",code:"RS"},{name:"Seychelles",code:"SC"},{name:"Sierra Leone",code:"SL"},{name:"Singapore",code:"SG"},{name:"Sint Maarten",code:"SX"},{name:"Slovakia",code:"SK"},{name:"Slovenia",code:"SI"},{name:"Solomon Islands",code:"SB"},{name:"Somalia",code:"SO"},{name:"South Africa",code:"ZA"},{name:"South Georgia & the South Sandwich Islands",code:"GS"},{name:"South Korea",code:"KR"},{name:"South Sudan",code:"SS"},{name:"Spain",code:"ES"},{name:"Sri Lanka",code:"LK"},{name:"St. Barthélemy",code:"BL"},{name:"St. Helena",code:"SH"},{name:"St. Kitts & Nevis",code:"KN"},{name:"St. Lucia",code:"LC"},{name:"St. Martin",code:"MF"},{name:"St. Pierre & Miquelon",code:"PM"},{name:"St. Vincent & the Grenadines",code:"VC"},{name:"Sudan",code:"SD"},{name:"Suriname",code:"SR"},{name:"Svalbard & Jan Mayen",code:"SJ"},{name:"Sweden",code:"SE"},{name:"Switzerland",code:"CH"},{name:"Syria",code:"SY"},{name:"São Tomé & Príncipe",code:"ST"},{name:"Taiwan",code:"TW"},{name:"Tajikistan",code:"TJ"},{name:"Tanzania",code:"TZ"},{name:"Thailand",code:"TH"},{name:"Timor-Leste",code:"TL"},{name:"Togo",code:"TG"},{name:"Tokelau",code:"TK"},{name:"Tonga",code:"TO"},{name:"Trinidad & Tobago",code:"TT"},{name:"Tunisia",code:"TN"},{name:"Turkey",code:"TR"},{name:"Turkmenistan",code:"TM"},{name:"Turks & Caicos Islands",code:"TC"},{name:"Tuvalu",code:"TV"},{name:"U.S. Outlying Islands",code:"UM"},{name:"U.S. Virgin Islands",code:"VI"},{name:"Uganda",code:"UG"},{name:"Ukraine",code:"UA"},{name:"United Arab Emirates",code:"AE"},{name:"United Kingdom",code:"GB"},{name:"United States",code:"US"},{name:"Uruguay",code:"UY"},{name:"Uzbekistan",code:"UZ"},{name:"Vanuatu",code:"VU"},{name:"Vatican City",code:"VA"},{name:"Venezuela",code:"VE"},{name:"Vietnam",code:"VN"},{name:"Wallis & Futuna",code:"WF"},{name:"Western Sahara",code:"EH"},{name:"Yemen",code:"YE"},{name:"Zambia",code:"ZM"},{name:"Zimbabwe",code:"ZW"},{name:"Åland Islands",code:"AX"}],Pu=1,KY="hybrid",AN={Usage:"usage",Invoices:"invoices",BillingDetails:"billing-details",AddOns:"add-ons"},xce=new Set(Object.values(AN)),vce=AN.Usage,yce={Trial:{subtitle:"Everything on Enterprise, free for two weeks"},Personal:{subtitle:"Free"},Free:{subtitle:"Free"},Standard:{subtitle:`$${ef("hybrid_standard")/Ko} per seat`},Premium:{subtitle:`$${ef("hybrid_premium")/Ko} per seat`},Enterprise:{subtitle:"Fully custom pricing"}};function bl(){const{data:e,loaded:t}=Nt(),r=!t,s=e?.type===KY,a=!e?.id&&!e?.type;return{shouldUseHybridEligibleUI:s||Ro(e?.readableProductID)||a,isLoading:r}}function PN(){const{data:e}=Nt(),t=et(),r=gu(e?.readableProductID);return r&&t.show({key:"sales-led-no-self-service",message:"Contact sales to manage your subscription.",timeout:5e3,variant:"danger"}),r}function TN(e){const t=e?.readableProductID;return(!t||Ro(t))&&t!=="enterprise_trial"}function bce(e){return!!e?.id}function Cce(e){const t=e?.usage?.tag_devices??0,r=e?.allowance?.tag_devices?.total?.unlimited?0:e?.allowance?.tag_devices?.total?.amount??0,s=r>0&&t>r;return{usage:t,totalAllowance:r,overLimit:s}}function wce(e,t,r){return t&&!r||e==="enterprise_trial"?"Trial":QY(e)?"Personal":qY(e)?"Standard":YY(e)?"Premium":ZY(e)?"Enterprise":"Free"}function jce(e){return e==="Trial"?"Tailscale trial":`${e} plan`}function Sce(e){const t=[];if(e!==void 0&&(e.line1!==""&&t.push(e.line1),e.line2!==null&&e.line2!==""&&t.push(e.line2),e.city!==""&&t.push(e.city),e.state!==""&&t.push(e.state),e.postal_code!==""&&t.push(e.postal_code),e.country!=="")){const r=zY(e.country);t.push(r?.name||e.country)}return t.join(", ")}function IN(e,t,r,s,a){let i="";if(e==="forever")i=" forever";else if(e==="once")i=" (one-time)";else if(e==="repeating"&&t&&t>0){const u=`${t} month${t>1?"s":""}`;i=a?` for ${u}, ending on ${a}`:` for ${u}`}return`${r?`${r}% off`:s?`$${s/Ko} off`:""}${i}`}function GY(e,t){if(!e)return!1;const r=t?.duration?.duration,s=t?.duration?.months,a=t?.end?ws(new Date(t.end*S$)):void 0,i=IN(r,s,t?.percentOff,t?.amountOff,a);return{code:e,description:i,endsOn:r==="repeating"&&a?void 0:a}}function qY(e){return["hybrid_standard","ds_hybrid_standard","aws_private_offer_hybrid_standard","azure_private_offer_hybrid_standard","reseller_hybrid_standard","aws_self_serve_hybrid_standard"].includes(e)}function YY(e){return["hybrid_premium","ds_hybrid_premium","aws_private_offer_hybrid_premium","azure_private_offer_hybrid_premium","reseller_hybrid_premium","aws_self_serve_hybrid_premium"].includes(e)}function ZY(e){return["ds_hybrid_enterprise","aws_private_offer_hybrid_enterprise","azure_private_offer_hybrid_enterprise","reseller_hybrid_enterprise"].includes(e)}function QY(e){return["personal","free"].includes(e)}function kce(){const{data:e}=Nt(),t=Rt(),r=Yt(),s=!!(t.data&&Bi(t.data)),a=!!(t.data&&!t.data.isSharedDomain),i=e?.readableProductID==="enterprise_trial",l=a&&i&&t.data?.personalization?.useCase==="Personal or At-Home Use",u=r?"none":!s||l?"card":i?"cta":"none";return{showPersonalCard:u==="card",showPersonalUseCTA:u==="cta"}}function Bv(e){const{addOn:t,currentPlan:r,newPlan:s,isTrialing:a,isPosting:i,open:l,onOpenChange:u,onConfirm:d}=e,[m,p]=f.useState(Q9),{handleSurveyFormSubmit:g}=lY(m,r,s,t);f.useEffect(()=>{l&&O(R.DowngradeSurveyDialogOpened,{eventProperties:{productArea:K.Billing,productSubArea:t?oe.AddOns:void 0}})},[l,t]);const v=w=>{w||(p(Q9),O(R.DowngradeSurveyDialogClosed,{eventProperties:{productArea:K.Billing,productSubArea:t?oe.AddOns:void 0}})),u?.(w)},y=()=>{O(R.DowngradeSurveyDialogConfirmed,{eventProperties:{productArea:K.Billing,productSubArea:t?oe.AddOns:void 0}}),g(),d()},C=!m.reason,b=t?`Remove ${qo(t)}`:a?"Cancel trial":"Confirm downgrade";return n.jsx(Re,{open:l,onOpenChange:v,title:b,children:n.jsx(Re.Form,{autoFocus:"cancel",destructive:!0,loading:i,cancelButton:!0,submitButton:b,onSubmit:y,disabled:C,children:n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx(eZ,{addOn:t,surveyFormData:m,onChange:w=>p(w)}),n.jsx("p",{className:"text-text-muted text-sm",children:"Your feedback helps us improve Tailscale."})]})})})}const JY=[{type:"string-constant",label:"Too expensive",value:"Too expensive"},{type:"string-constant",label:"Too difficult to use",value:"Too difficult to use"},{type:"string-constant",label:"Switched to another product",value:"Switched to another product"},{type:"string-constant",label:"No longer needed",value:"No longer needed"},{type:"string-constant",label:"Didn’t solve my use case",value:"Didn’t solve my use case"},{type:"string-constant",label:"Other (please provide details below)",value:"Other"}],Q9={reason:void 0,comments:""},XY=({addOn:e})=>{const{shouldUseHybridEligibleUI:t}=bl();return e==="mullvad"?t?n.jsxs("p",{children:["Removing this add-on will stop access to ",qo(e)," exit nodes. This change will take place at the end of your current billing period."]}):n.jsxs("p",{children:["Removing this add-on will immediately stop access to"," ",qo(e)," exit nodes, and you will be credited a prorated amount."]}):null};function eZ({addOn:e,surveyFormData:t,onChange:r,selectButtonClassName:s}){return n.jsxs("div",{className:"flex flex-col gap-4",children:[e&&n.jsxs(n.Fragment,{children:[XY({addOn:e}),n.jsxs("p",{children:["Please help us improve Tailscale by letting us know why you’re removing the ",qo(e)," add-on."]})]}),n.jsx(Br,{label:e?void 0:"Why are you downgrading?",children:n.jsx(br,{"aria-label":"Downgrade reason",className:"w-full",values:JY,selected:t.reason,buttonClassName:s,onUpdateSelected:a=>{r({...t,reason:a}),O(R.DowngradeSurveyReasonSelected,{eventProperties:{productArea:K.Billing,productSubArea:e?oe.AddOns:void 0}},{once:!0})},placeholder:"Select reason..."})}),n.jsx(Lk,{id:"downgrade-reason-other","aria-label":"Additional comments",type:"text",value:t.comments,onChange:a=>{r({...t,comments:a.currentTarget.value})},onBlur:()=>{O(R.DowngradeSurveyCommentsInputChanged,{eventProperties:{productArea:K.Billing,productSubArea:e?oe.AddOns:void 0}},{throttleMs:5e3})},placeholder:"Any additional comments?"})]})}const tZ={addon:"You have scheduled changes to this add-on. To make further changes, cancel the scheduled ones.",plan:"You have scheduled changes to your plan. To make further changes, cancel the scheduled ones.",seat:"You have a scheduled seat reduction. To make further changes, cancel the scheduled one."};function nZ({scheduleChangeType:e,scheduleAddon:t,disabled:r,disabledTooltip:s,to:a,onClick:i,children:l,className:u,sizeVariant:d,variant:m,intent:p}){const g=Qf(),v=e==="addon"?t?!!g.addonChanges[t]:g.hasAddonChange:e==="plan"?g.hasPlanDowngrade:e==="seat"?g.hasSeatReduction:!1,y=r||v,C=s??(e?tZ[e]:"You have scheduled changes. To make further changes, cancel the scheduled ones.");return y?n.jsx(Ee,{content:C,children:n.jsx(ue,{variant:m,sizeVariant:d,intent:p,disabled:!0,className:D("!opacity-50 !pointer-events-auto !cursor-not-allowed",{"disabled:!text-text-primary":p==="primary"},u),onClick:i,children:l})}):a?n.jsx(Vt,{to:a,onClick:i,variant:m,sizeVariant:d,intent:p,className:u,children:l}):n.jsx(ue,{onClick:i,variant:m,sizeVariant:d,intent:p,className:u,children:l})}function DN({addOn:e,onClick:t}){const[r,s]=f.useState(!1),{deleteAddon:a,isPosting:i}=Jf(),[,l]=ft();return n.jsxs(n.Fragment,{children:[n.jsx(nZ,{scheduleChangeType:"addon",scheduleAddon:e,onClick:()=>{s(!0),t?.()},children:"Remove add-on…"}),n.jsx(Bv,{open:r,addOn:e,isPosting:i,onConfirm:()=>{a(e).then(()=>{s(!1),l("/admin/settings/billing",{replace:!0})})},onOpenChange:s})]})}function rZ(e){const{data:t,error:r,mutate:s}=dt("/public/tailnet/-/mullvad/configuration",e),{applyPatches:a}=Eu();return{error:r,data:t,mutate:l=>{const u=t?.configured||[],d=[];for(const m of u)l.some(p=>m.id===p.id)||d.push({type:"remove-mullvad-node-attr",value:m.nativeIP});for(const m of l)u.some(p=>m.id===p.id)||d.push({type:"add-mullvad-node-attr",value:m.nativeIP});return a(d).then(()=>s())}}}const sm=(e,t=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY)=>Math.min(Math.max(e,t),r),am=(e,t)=>Math.ceil(e/t)*t;function bh(e){const{value:t,min:r,max:s,steppers:a="on",variant:i="plus-minus",onChange:l,className:u,inputClassName:d,disabled:m,error:p,...g}=e,[v,y]=f.useState(t.toString()),[C,b]=f.useState(!1),w=e.step||1;f.useEffect(()=>{y(t.toString())},[t,y]),f.useEffect(()=>(document.body.style.setProperty("touch-action","pan-y"),()=>{document.body.style.removeProperty("touch-action")}),[]);const N=()=>{const B=t+w;l(am(sm(B,r,s),w))},k=()=>{const B=t-w;l(am(sm(B,r,s),w))},E=B=>{if(C)switch(B.key){case"ArrowUp":case"=":case"+":{N();break}case"ArrowDown":case"-":case"_":{k();break}}},T=B=>{B.target.select(),b(!0)},_=()=>{b(!1);const B=v.replaceAll(/\D/g,""),W=Number.parseInt(B,10);if(Number.isNaN(W)){y(t.toString());return}const U=sm(W,r,s),Z=am(U,w);Z!==W&&(y(Z.toString()),l(Z))},I=B=>{const W=B.target.value.replaceAll(/\D/g,"");y(W);const U=Number.parseInt(W,10);if(Number.isNaN(U))return;const Z=sm(U,r,s);am(Z,w)===U&&l(Z)},F=m===!0||a==="only",z=m||s!==void 0&&t>=s,H=m||r!==void 0&&t<=r,J=()=>n.jsxs("div",{className:"flex flex-col h-full",children:[n.jsx(ue,{type:"button",className:"!h-auto !min-h-0 flex-1 !w-7 !rounded-none !rounded-tr-md border-l-0 z-10 transition-all",iconOnly:!0,onClick:N,disabled:z,tabIndex:-1,children:n.jsx(rw,{})}),n.jsx(ue,{type:"button",className:D("!h-auto !min-h-0 flex-1 !w-7 !rounded-none !rounded-br-md border-l-0 -mt-px z-10 transition-all",{"!z-0":H}),iconOnly:!0,onClick:k,disabled:H,tabIndex:-1,children:n.jsx(Nn,{})})]}),Y=()=>n.jsxs("div",{className:"flex items-stretch",children:[n.jsx(ue,{type:"button",variant:"minimal",className:"!h-7 rounded-[0.1875rem]",iconOnly:!0,onClick:k,disabled:H,tabIndex:-1,children:n.jsx(Yx,{})}),n.jsx(ue,{type:"button",variant:"minimal",className:"!h-7 rounded-[0.1875rem]",iconOnly:!0,onClick:N,disabled:z,tabIndex:-1,children:n.jsx(Qx,{})})]});return n.jsx(ln,{type:"text",inputMode:"numeric",pattern:"[0-9]*",className:D(u,{"flex h-9":i==="chevrons"}),inputClassName:D(d,{"!bg-bg-base":a==="only"&&!m,"!rounded-r-none flex-grow":i==="chevrons"}),onFocus:T,onBlur:_,onKeyDown:E,value:v,onChange:I,disabled:F,error:p,suffix:a==="off"?void 0:i==="chevrons"?J():Y(),suffixContainerClassName:i==="chevrons"?"!relative !top-auto !bottom-auto !right-auto":void 0,...g})}function sZ({numOfDevices:e,setNumOfDevices:t,interval:r}){const{data:s}=rZ(),{maxDevices:a=0,freeAccess:i=!1}=s||{},{data:l}=ot(),{data:u}=Nt();return n.jsxs("div",{className:"w-full @md:max-w-lg space-y-4",children:[n.jsx("h3",{className:D("mr-4",Et.pageSubTitle),children:"Manage add-ons"}),!A7(l,u)&&n.jsxs(rt,{intent:"warning",className:"mb-4",children:[n.jsx("a",{href:"https://tailscale.com/kb/1182/billing-information/#migrating-from-a-legacy-plan",className:"link",onClick:()=>O(R.UpgradePlanButtonClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.AddonCheckout}}),children:"Upgrade to one of our plans"})," ","to use Mullvad. If you have any questions, reach out"," ",n.jsx(Zn,{type:"exitnode",eventProperties:{productArea:K.Billing,productSubArea:oe.AddonCheckout},children:"to our support team"}),"."]}),n.jsxs(at,{children:[n.jsx("h4",{className:"text-lg font-semibold mb-3",children:"Mullvad VPN"}),n.jsxs("p",{children:["Select a number of devices that can use Mullvad’s servers as exit nodes. At the end of every billing cycle, you will be billed"," ",r==="year"?"$60":"$5"," for up to ",Wc," ","devices, and for every ",Wc," after that."," ",n.jsx(Ge,{kbTopic:"Mullvad VPN",url:"https://tailscale.com/kb/1258/mullvad-exit-nodes/",onClick:()=>O(R.LearnMoreMullvadVPNClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.AddonCheckout}})})]}),n.jsx("p",{className:"mt-4",children:n.jsx("span",{onClick:()=>O(R.MullvadDeviceSelectionInfoViewed,{eventProperties:{productArea:K.Billing,productSubArea:oe.AddonCheckout}}),style:{cursor:"pointer"},children:"You will be able to pick which devices can use Mullvad VPN after completing the checkout."})}),n.jsx("div",{className:"mt-4 flex justify-between",children:n.jsx(at,{className:"py-2 w-[320px]",children:n.jsxs("div",{className:"flex items-center",children:[n.jsx("span",{className:"mr-2 whitespace-nowrap font-medium",children:"Up to"})," ",n.jsx(bh,{id:"mullvad-device-amount",step:5,steppers:"only",className:"w-4/5",min:5,onChange:d=>{t(d),O(R.MullvadDeviceInputValueChanged,{eventProperties:{productArea:K.Billing,productSubArea:oe.AddonCheckout}},{throttleMs:5e3})},value:e}),n.jsx("span",{className:"ml-2 font-medium",children:"devices"})]})})})]}),!i&&a>0&&n.jsx(DN,{addOn:"mullvad",onClick:()=>O(R.RemoveMullvadAddonButtonClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.Checkout}})})]})}function aZ({numOfDevices:e,setNumOfDevices:t}){const{data:r}=ot(),{data:s,addOnsDetails:a,billingUsage:i}=Nt(),l=(a?.addonPacks.tagged_resources??0)>0,u=i?.usage?.tag_devices??0,d=i?.allowance?.tag_devices?.total?.unlimited?void 0:i?.allowance?.tag_devices?.total?.amount??0;return n.jsxs("div",{className:"w-full @md:max-w-lg space-y-4",children:[n.jsx("h3",{className:D("mr-4",Et.pageSubTitle),children:"Manage add-ons"}),!A7(r,s)&&n.jsxs(rt,{intent:"warning",className:"mb-4",children:[n.jsx("a",{href:"https://tailscale.com/kb/1182/billing-information/#migrating-from-a-legacy-plan",className:"link",children:"Upgrade to one of our plans"})," ","to purchase tagged resources. If you have any questions, reach out"," ",n.jsx("a",{href:"https://tailscale.com/contact/support",className:"link",children:"to our support team"}),"."]}),n.jsxs(at,{children:[n.jsx("h4",{className:"text-lg font-semibold mb-3",children:"Tagged Resources"}),n.jsxs("p",{children:["Select the number of tagged resources you need. At the end of every billing cycle, you will be billed $1 per device."," ",n.jsx(Ge,{kbTopic:"ACL tags",url:"https://tailscale.com/kb/1068/acl-tags"})]}),n.jsx("div",{className:"mt-4 flex justify-between",children:n.jsx(at,{className:"py-2 w-[320px]",children:n.jsxs("div",{className:"flex items-center",children:[n.jsx("span",{className:"mr-2 whitespace-nowrap font-medium",children:"Up to"})," ",n.jsx(bh,{id:"tagged-resources-amount",step:T0,steppers:"only",className:"w-4/5",min:T0,onChange:m=>{t(m),O(R.TaggedResourcesInputValueChanged,{eventProperties:{productArea:K.Billing,productSubArea:oe.AddonCheckout}},{throttleMs:5e3})},value:e}),n.jsx("span",{className:"ml-2 font-medium",children:"devices"})]})})}),d!==void 0&&n.jsxs("p",{className:"text-sm text-text-muted mt-3",children:["Currently using ",u," of ",d," tagged resources."]})]}),l&&n.jsx(DN,{addOn:"tagged_resources",onClick:()=>O(R.RemoveTaggedResourcesAddonButtonClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.AddOns}})})]})}const _N=f.createContext(null),os=()=>f.useContext(_N);function MN({children:e,api:t,initialData:r={},initialStep:s=1}){const[a,i]=f.useState(s),[l,u]=f.useState(r);return n.jsx(_N.Provider,{value:{data:l,setData:u,step:a,goTo:i,api:{...t,postSetup:async d=>{const m=await t.postSetup(d);return u(p=>({...p,intentToken:m.intentToken??p.intentToken,taxCents:m.taxCents})),m}}},children:e})}function J9(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,s)}return r}function X9(e){for(var t=1;t=0)&&(r[a]=e[a]);return r}function oZ(e,t){if(e==null)return{};var r=iZ(e,t),s,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(r[s]=e[s])}return r}function RN(e,t){return lZ(e)||cZ(e,t)||uZ(e,t)||dZ()}function lZ(e){if(Array.isArray(e))return e}function cZ(e,t){var r=e&&(typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"]);if(r!=null){var s=[],a=!0,i=!1,l,u;try{for(r=r.call(e);!(a=(l=r.next()).done)&&(s.push(l.value),!(t&&s.length===t));a=!0);}catch(d){i=!0,u=d}finally{try{!a&&r.return!=null&&r.return()}finally{if(i)throw u}}return s}}function uZ(e,t){if(e){if(typeof e=="string")return e6(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e6(e,t)}}function e6(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,s=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:FN;if(t===null||fZ(t))return t;throw new Error(r)},pZ=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:FN;if(mZ(t))return{tag:"async",stripePromise:Promise.resolve(t).then(function(a){return n6(a,r)})};var s=n6(t,r);return s===null?{tag:"empty"}:{tag:"sync",stripe:s}},gZ=function(t){!t||!t._registerWrapper||!t.registerAppInfo||(t._registerWrapper({name:"react-stripe-js",version:"5.6.1"}),t.registerAppInfo({name:"react-stripe-js",version:"5.6.1",url:"https://stripe.com/docs/stripe-js/react"}))},Ch=ce.createContext(null);Ch.displayName="ElementsContext";var BN=function(t,r){if(!t)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(r," in an provider."));return t},wh=function(t){var r=t.stripe,s=t.options,a=t.children,i=ce.useMemo(function(){return pZ(r)},[r]),l=ce.useState(function(){return{stripe:i.tag==="sync"?i.stripe:null,elements:i.tag==="sync"?i.stripe.elements(s):null}}),u=RN(l,2),d=u[0],m=u[1];ce.useEffect(function(){var v=!0,y=function(b){m(function(w){return w.stripe?w:{stripe:b,elements:b.elements(s)}})};return i.tag==="async"&&!d.stripe?i.stripePromise.then(function(C){C&&v&&y(C)}):i.tag==="sync"&&!d.stripe&&y(i.stripe),function(){v=!1}},[i,d,s]);var p=G0(r);ce.useEffect(function(){p!==null&&p!==r&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[p,r]);var g=G0(s);return ce.useEffect(function(){if(d.elements){var v=ON(s,g,["clientSecret","fonts"]);v&&d.elements.update(v)}},[s,g,d.elements]),ce.useEffect(function(){gZ(d.stripe)},[d.stripe]),ce.createElement(Ch.Provider,{value:d},a)};wh.propTypes={stripe:ke.any,options:ke.object};var xZ=function(t){var r=ce.useContext(Ch);return BN(r,t)},vZ=function(){var t=xZ("calls useElements()"),r=t.elements;return r};ke.func.isRequired;var UN=ce.createContext(null);UN.displayName="CheckoutContext";ke.any,ke.shape({clientSecret:ke.oneOfType([ke.string,ke.instanceOf(Promise)]).isRequired,elementsOptions:ke.object}).isRequired;var q0=function(t){var r=ce.useContext(UN),s=ce.useContext(Ch);if(r){if(s)throw new Error("You cannot wrap the part of your app that ".concat(t," in both and providers."));return r}else return BN(s,t)},yZ=["mode"],bZ=function(t){return t.charAt(0).toUpperCase()+t.slice(1)},cr=function(t,r){var s="".concat(bZ(t),"Element"),a=function(d){var m=d.id,p=d.className,g=d.options,v=g===void 0?{}:g,y=d.onBlur,C=d.onFocus,b=d.onReady,w=d.onChange,N=d.onEscape,k=d.onClick,E=d.onLoadError,T=d.onLoaderStart,_=d.onNetworksChange,I=d.onConfirm,F=d.onCancel,z=d.onShippingAddressChange,H=d.onShippingRateChange,J=d.onSavedPaymentMethodRemove,Y=d.onSavedPaymentMethodUpdate,B=q0("mounts <".concat(s,">")),W="elements"in B?B.elements:null,U="checkoutState"in B?B.checkoutState:null,Z=U?.type==="success"||U?.type==="loading"?U.sdk:null,re=ce.useState(null),me=RN(re,2),L=me[0],V=me[1],P=ce.useRef(null),q=ce.useRef(null);$n(L,"blur",y),$n(L,"focus",C),$n(L,"escape",N),$n(L,"click",k),$n(L,"loaderror",E),$n(L,"loaderstart",T),$n(L,"networkschange",_),$n(L,"confirm",I),$n(L,"cancel",F),$n(L,"shippingaddresschange",z),$n(L,"shippingratechange",H),$n(L,"savedpaymentmethodremove",J),$n(L,"savedpaymentmethodupdate",Y),$n(L,"change",w);var Q;b&&(t==="expressCheckout"?Q=b:Q=function(){b(L)}),$n(L,"ready",Q),ce.useLayoutEffect(function(){if(P.current===null&&q.current!==null&&(W||Z)){var X=null;if(Z)switch(t){case"paymentForm":X=Z.createPaymentFormElement(v);break;case"payment":X=Z.createPaymentElement(v);break;case"address":if("mode"in v){var fe=v.mode,he=oZ(v,yZ);if(fe==="shipping")X=Z.createShippingAddressElement(he);else if(fe==="billing")X=Z.createBillingAddressElement(he);else throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.")}else throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");break;case"expressCheckout":X=Z.createExpressCheckoutElement(v);break;case"currencySelector":X=Z.createCurrencySelectorElement();break;case"taxId":X=Z.createTaxIdElement(v);break;default:throw new Error("Invalid Element type ".concat(s,". You must use either the , , , or ."))}else W&&(X=W.create(t,v));P.current=X,V(X),X&&X.mount(q.current)}},[W,Z,v]);var ae=G0(v);return ce.useEffect(function(){if(P.current){var X=ON(v,ae,["paymentRequest"]);X&&"update"in P.current&&P.current.update(X)}},[v,ae]),ce.useLayoutEffect(function(){return function(){if(P.current&&typeof P.current.destroy=="function")try{P.current.destroy(),P.current=null}catch{}}},[]),ce.createElement("div",{id:m,className:p,ref:q})},i=function(d){q0("mounts <".concat(s,">"));var m=d.id,p=d.className;return ce.createElement("div",{id:m,className:p})},l=r?i:a;return l.propTypes={id:ke.string,className:ke.string,onChange:ke.func,onBlur:ke.func,onFocus:ke.func,onReady:ke.func,onEscape:ke.func,onClick:ke.func,onLoadError:ke.func,onLoaderStart:ke.func,onNetworksChange:ke.func,onConfirm:ke.func,onCancel:ke.func,onShippingAddressChange:ke.func,onShippingRateChange:ke.func,onSavedPaymentMethodRemove:ke.func,onSavedPaymentMethodUpdate:ke.func,options:ke.object},l.displayName=s,l.__elementType=t,l},ur=typeof window>"u",CZ=ce.createContext(null);CZ.displayName="EmbeddedCheckoutProviderContext";var wZ=function(){var t=q0("calls useStripe()"),r=t.stripe;return r};cr("auBankAccount",ur);cr("card",ur);cr("cardNumber",ur);cr("cardExpiry",ur);cr("cardCvc",ur);cr("iban",ur);var VN=cr("payment",ur);cr("expressCheckout",ur);cr("paymentRequestButton",ur);cr("linkAuthentication",ur);var jZ=cr("address",ur);cr("shippingAddress",ur);cr("paymentMethodMessaging",ur);cr("taxId",ur);function Nc(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Nc=function(t){return typeof t}:Nc=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nc(e)}var $N="clover",SZ=function(t){return t===3?"v3":t},HN="https://js.stripe.com",kZ="".concat(HN,"/").concat($N,"/stripe.js"),NZ=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,EZ=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,r6="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",AZ=function(t){return NZ.test(t)||EZ.test(t)},PZ=function(){for(var t=document.querySelectorAll('script[src^="'.concat(HN,'"]')),r=0;r element.");return a.appendChild(s),s},TZ=function(t,r){!t||!t._registerWrapper||t._registerWrapper({name:"stripe-js",version:"8.9.0",startTime:r})},fc=null,im=null,om=null,IZ=function(t){return function(r){t(new Error("Failed to load Stripe.js",{cause:r}))}},DZ=function(t,r){return function(){window.Stripe?t(window.Stripe):r(new Error("Stripe.js not available"))}},_Z=function(t){return fc!==null?fc:(fc=new Promise(function(r,s){if(typeof window>"u"||typeof document>"u"){r(null);return}if(window.Stripe&&t&&console.warn(r6),window.Stripe){r(window.Stripe);return}try{var a=PZ();if(a&&t)console.warn(r6);else if(!a)a=s6(t);else if(a&&om!==null&&im!==null){var i;a.removeEventListener("load",om),a.removeEventListener("error",im),(i=a.parentNode)===null||i===void 0||i.removeChild(a),a=s6(t)}om=DZ(r,s),im=IZ(s),a.addEventListener("load",om),a.addEventListener("error",im)}catch(l){s(l);return}}),fc.catch(function(r){return fc=null,Promise.reject(r)}))},MZ=function(t,r,s){if(t===null)return null;var a=r[0];if(typeof a!="string")throw new Error("Expected publishable key to be of type string, got type ".concat(Nc(a)," instead."));var i=a.match(/^pk_test/),l=SZ(t.version),u=$N;i&&l!==u&&console.warn("Stripe.js@".concat(l," was loaded on the page, but @stripe/stripe-js@").concat("8.9.0"," expected Stripe.js@").concat(u,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var d=t.apply(void 0,r);return TZ(d,s),d},a6=function(t){var r=`invalid load parameters; expected object of shape {advancedFraudSignals: boolean} but received `.concat(JSON.stringify(t),` `);if(t===null||Nc(t)!=="object")throw new Error(r);if(Object.keys(t).length===1&&typeof t.advancedFraudSignals=="boolean")return t;throw new Error(r)},Tm,Y0=!1,Z0=function(){for(var t=arguments.length,r=new Array(t),s=0;s(e&&!Ng?Ng=Z0(RZ):!e&&!kg&&(kg=Z0(LZ)),e?Ng:kg),Uv=()=>{const[e,t]=f.useState(null),{data:r}=Rt();return f.useEffect(()=>{(async()=>{const a=await OZ(r?.useUSStripeInstance);t(a)})()},[r]),e},FZ="100.100.100.100",BZ=".beta.tailscale.net",UZ=["Google","Cloudflare","Quad9","Mullvad"],VZ={Mullvad:["194.242.2.2","2a07:e340::2"],Quad9:["9.9.9.9","149.112.112.112","2620:fe::fe","2620:fe::9"],Google:["8.8.8.8","8.8.4.4","2001:4860:4860::8888","2001:4860:4860::8844"],Cloudflare:["1.1.1.1","1.0.0.1","2606:4700:4700::1111","2606:4700:4700::1001"]},Nce=UZ.reduce((e,t)=>(VZ[t].forEach(r=>{e[r]=t}),e),{});function Cl(e){return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)}function $Z(e){if(e.includes("%")||e.includes("]"))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}const HZ=/^((25[0-5]|(2[0-4]|1\d|[1-9])\d|\d)\.){3}(25[0-5]|(2[0-4]|1\d|[1-9])\d|\d)$/;function zN(e){return WN(e)||$Z(e)}function WN(e){return HZ.test(e)}function zZ(e){return zN(e)&&e!==FZ}const Ece={isValid:zZ,errorMessage:"Invalid resolver. Only IPv4 and IPv6 values are allowed."},Ace={isValid:e=>GZ.test(e)&&e!==BZ,errorMessage:"Invalid search domain. Only valid URL characters are allowed."};function WZ(e){let t=!0,r=[];return e.length===0&&(t=!1,r=[...r,"Name must be non-empty"]),e.length>63&&(t=!1,r=[...r,"Name must be less than 64 characters"]),(e.startsWith("-")||e.endsWith("-"))&&(t=!1,r=[...r,"Name cannot start or end with a hyphen"]),KZ.test(e)||(t=!1,r=[...r,"Must only contain alphanumeric or hyphen characters"]),{isValid:t,error:r.join(". ")}}const KZ=/^[\dA-Za-z-]+$/,GZ=/^[\w'./:~-]+$/;function vf(e){return e!==""&&!Number.isNaN(Number(e))}function qZ(e){return e.split(/[\s,]+/).map(t=>t.trim()).filter(t=>t.length>0)}function Pce(e){return e===""?!1:qZ(e).every(r=>zN(r))}function Tce(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol==="https:"}const YZ=253,ZZ=63;function Ice(e){const t=e.trim(),r=(t.endsWith(".")?t.slice(0,-1):t).toLowerCase();if(r.length===0||t.length===0)return{isValid:!1,error:"Domain is required."};if(/\s/.test(t))return{isValid:!1,error:"Domain cannot contain spaces."};if(t.includes("://")||t.includes("/")||t.includes("?")||t.includes("#")||t.includes("@"))return{isValid:!1,error:"Enter only the domain (e.g., example.com)."};if(t.includes(":"))return{isValid:!1,error:"Enter only the domain (no port or scheme)."};if(r.length>YZ)return{isValid:!1,error:"Domain name is too long."};const s=r.split(".");if(s.length<2)return{isValid:!1,error:"Domain must include a top-level domain (e.g., example.com)."};for(const i of s){if(i.length===0)return{isValid:!1,error:"Domain contains empty labels."};if(i.length>ZZ)return{isValid:!1,error:"Domain label exceeds 63 characters."};if(i.startsWith("-")||i.endsWith("-"))return{isValid:!1,error:"Domain labels cannot start or end with a hyphen."}}if(!/^[a-z0-9.-]+$/.test(r))return{isValid:!1,error:"Domain contains invalid characters."};const a=s.at(-1);return/^\d+$/.test(a)?{isValid:!1,error:"Invalid top-level domain."}:{isValid:!0}}function KN({customerDetails:e,setCustomerDetails:t,setPurchaseGeoRestricted:r}){const s=hl(),a=f.useMemo(()=>Cl(e?.email||""),[e?.email]),i=Yt();return n.jsx(wh,{stripe:Uv(),options:$v(s.resolvedTheme),children:n.jsxs("div",{className:"w-full @md:max-w-lg space-y-4",children:[n.jsx("h3",{className:D("mr-4",Et.pageSubTitle),children:"Billing details"}),n.jsxs(at,{children:[n.jsx("h4",{className:"font-medium mb-5",children:"Billing email"}),n.jsx(ln,{type:"email",placeholder:"email@example.com",defaultValue:e?.email,onBlur:l=>t({...e,email:l.target.value}),onFocus:()=>{O(R.BillingEmailInputFocused,{eventProperties:{productArea:i?K.Onboarding:K.Billing,productSubArea:oe.Checkout}},{once:!0})}}),e?.email&&!a&&n.jsx("p",{className:"text-text-danger mt-2",children:"Your email is invalid."}),n.jsx("hr",{className:"my-5 border-t"}),n.jsx("h4",{className:"font-medium mb-5",children:"Billing address"}),n.jsx(jZ,{options:{mode:"billing",defaultValues:{name:e?.name,address:e?.address}},onChange:l=>{r&&r(!1),t({...e,name:l.complete?l.value.name:void 0,address:l.complete?l.value.address:void 0})},onReady:()=>{O(R.StripeBillingAddressElementLoaded,{eventProperties:{productArea:i?K.Onboarding:K.Billing,productSubArea:oe.Checkout}})}})]})]})})}const QZ=e=>f.createElement("svg",{width:40,height:40,viewBox:"0 0 60 60",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M55 8H24V52H55V8Z",fill:"#496495"}),f.createElement("path",{d:"M26 30C13.8497 30 4 39.8497 4 52H48C48 39.8497 38.1503 30 26 30Z",fill:"#C65835"}),f.createElement("path",{d:"M26 8C13.8497 8 4 17.8497 4 30H48C48 17.8497 38.1503 8 26 8Z",fill:"#C65835"})),i6=e=>f.createElement("svg",{width:60,height:30,viewBox:"0 0 60 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("rect",{y:15,width:15,height:30,rx:7.5,transform:"rotate(-90 0 15)",fill:"#B28FCC"}),f.createElement("path",{d:"M15 15C13.0302 15 11.0796 15.388 9.25975 16.1418C7.43986 16.8956 5.78628 18.0005 4.3934 19.3934C3.00052 20.7863 1.89563 22.4399 1.14181 24.2597C0.387986 26.0796 -1.72208e-07 28.0302 0 30L15 30L15 15Z",fill:"#9060B3"}),f.createElement("circle",{cx:22.5,cy:22.5,r:7.5,transform:"rotate(-90 22.5 22.5)",fill:"#9060B3"}),f.createElement("path",{d:"M30 30L60 30L60 -1.90735e-06L30 -1.90735e-06L30 30Z",fill:"#4C325F"})),JZ=e=>f.createElement("svg",{width:40,height:40,viewBox:"0 0 60 60",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M8 30C8 42.1503 17.8497 52 30 52L30 8C17.8497 8 8 17.8497 8 30Z",fill:"#496495"}),f.createElement("path",{d:"M30 8C17.8497 8 8 17.8497 8 30H52C52 17.8497 42.1503 8 30 8Z",fill:"#C65835"}),f.createElement("path",{d:"M30 30C42.1503 30 52 39.8497 52 52L30 52L30 30Z",fill:"#CCA000"})),XZ=e=>f.createElement("svg",{width:45,height:30,viewBox:"0 0 45 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M0 7.50004L0 22.4913C0 26.6334 3.35786 29.9912 7.49999 29.9912C11.6421 29.9912 15 26.6334 15 22.4913L15 7.50004C15 3.35791 11.6421 5.53131e-05 7.49999 5.53131e-05C3.35786 5.53131e-05 0 3.35791 0 7.50004Z",fill:"#0D4B3B"}),f.createElement("path",{d:"M44.9998 15.0001C44.9998 23.283 38.2828 30 29.9998 30C21.7169 30 14.9999 23.283 14.9999 15.0001L44.9998 15.0001Z",fill:"#22AB74"}),f.createElement("path",{d:"M44.9998 15.0001C44.9998 6.71707 38.2828 8.27909e-05 29.9998 8.27909e-05C21.7169 8.27909e-05 14.9999 6.71707 14.9999 15.0001L44.9998 15.0001Z",fill:"#85D996"})),eQ=e=>f.createElement("svg",{width:40,height:40,viewBox:"0 0 60 60",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M39 45C47.2843 45 54 38.2843 54 30C54 21.7157 47.2843 15 39 15C30.7157 15 24 21.7157 24 30C24 38.2843 30.7157 45 39 45Z",fill:"#C65835"}),f.createElement("path",{d:"M21 45C29.2843 45 36 38.2843 36 30C36 21.7157 29.2843 15 21 15C12.7157 15 6 21.7157 6 30C6 38.2843 12.7157 45 21 45Z",fill:"#496495"})),tQ=e=>f.createElement("svg",{width:45,height:30,viewBox:"0 0 45 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M14.9999 29.9999C6.71692 29.9999 -6.47395e-05 23.2829 -6.40154e-05 15C-6.32912e-05 6.71698 6.71693 -9.30719e-06 14.9999 -8.58307e-06L14.9999 29.9999Z",fill:"#85D996"}),f.createElement("path",{d:"M44.9999 15C44.9999 6.71577 38.2842 5.34058e-05 29.9999 5.34058e-05C21.7157 5.34058e-05 15 6.71577 15 15C15 23.2843 21.7157 30 29.9999 30C38.2842 30 44.9999 23.2843 44.9999 15Z",fill:"#0D4B3B"})),nQ=e=>f.createElement("svg",{width:60,height:30,viewBox:"0 0 60 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M30 6.10352e-05C30 8.28306 23.283 15.0001 15 15.0001C6.717 15.0001 0 8.28306 0 6.10352e-05H30Z",fill:"#EFC078"}),f.createElement("path",{d:"M30 15.0001C30 23.2831 23.283 30.0001 15 30.0001C6.717 30.0001 0 23.2831 0 15.0001H30Z",fill:"#EFC078"}),f.createElement("path",{d:"M45 30.0001C53.2843 30.0001 60 23.2843 60 15.0001C60 6.71579 53.2843 6.10352e-05 45 6.10352e-05C36.7157 6.10352e-05 30 6.71579 30 15.0001C30 23.2843 36.7157 30.0001 45 30.0001Z",fill:"#762B0B"})),rQ=e=>f.createElement("svg",{width:45,height:30,viewBox:"0 0 45 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M0 6.10352e-05C8.283 6.10352e-05 15 6.71706 15 15.0001C15 23.2831 8.283 30.0001 0 30.0001V6.10352e-05Z",fill:"#95BFFF"}),f.createElement("path",{d:"M15 30.0001L45 30.0001L45 5.91278e-05L15 5.91278e-05L15 30.0001Z",fill:"#3B51AA"})),sQ=e=>f.createElement("svg",{width:40,height:40,viewBox:"0 0 60 60",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("rect",{x:23,y:7,width:30,height:30,fill:"#C65835"}),f.createElement("circle",{cx:23,cy:36,r:16,fill:"#496495"}));function Vv(e){const{product:t,...r}=e;switch(t){case"personal":case"free":return n.jsx(tQ,{...r});case"personal_plus":return n.jsx(XZ,{...r});case"personal_pro":return n.jsx(eQ,{...r});case"github_community":return n.jsx(JZ,{...r});case"team":case"legacy_connectivity":return n.jsx(sQ,{...r});case"starter":case"hybrid_standard":case"ds_hybrid_standard":case"aws_private_offer_hybrid_standard":case"azure_private_offer_hybrid_standard":case"reseller_hybrid_standard":case"aws_self_serve_hybrid_standard":return n.jsx(rQ,{...r});case"business":case"legacy_security":return n.jsx(QZ,{...r});case"premium":case"hybrid_premium":case"ds_hybrid_premium":case"aws_private_offer_hybrid_premium":case"azure_private_offer_hybrid_premium":case"reseller_hybrid_premium":case"aws_self_serve_hybrid_premium":return n.jsx(nQ,{...r});case"ds_hybrid_enterprise":case"aws_private_offer_hybrid_enterprise":case"azure_private_offer_hybrid_enterprise":case"reseller_hybrid_enterprise":case"enterprise":case"enterprise_trial":return n.jsx(i6,{...r});default:return n.jsx(i6,{...r})}}function aQ({product:e,name:t,subtitle:r,totalPriceText:s,itemized:a,isAddOnFlow:i,billingInterval:l,threeFreeUsers:u,appliedPromo:d,setAppliedPromo:m,displayPromo:p=!1,className:g,isTaxLoading:v}){const y=e==="starter"||e==="premium",{shouldUseHybridEligibleUI:C}=bl(),[b,w]=f.useState(""),[N,k]=ft(),[E]=rl(),T=Yt();ce.useEffect(()=>{if(!m||!p)return;const W=E.get("promocode");W&&(O(R.PromoCodeAppliedFromURL,{eventProperties:{productArea:T?K.Onboarding:K.Billing,productSubArea:oe.Checkout},checkoutProperties:{targetPlan:e,promoCode:W}},{once:!0}),w(W),k(N,{replace:!0}))},[E,m,p,N,k,e,T]);const{data:_}=Nt(),F=vu(_),z=F?"You’re in your free 2-week trial. Final amount will be prorated based on the remaining days in the month after your trial ends.":"Final amount will be prorated based on the remaining days in the month.",{data:H,isLoading:J,constructPromo:Y}=I7({code:b});ce.useEffect(()=>{!J&&b&&(H?.promoCodes?.length===1&&e&&m?m(Y(H.promoCodes[0],e)):m&&m({isValid:!1,name:b}),w(""))},[J,b,H,m,Y,e]);const B=f.useMemo(()=>{const W=a.reduce((U,Z)=>U+(Z.price||0),0);return Math.max(W,0)},[a]);return n.jsxs(at,{className:g,children:[e&&!i&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Vv,{product:e,height:30}),n.jsxs("div",{children:[n.jsxs("h3",{className:"text-lg font-semibold leading-none",children:[t," Plan"]}),r&&n.jsx("p",{children:r}),s&&n.jsx("div",{children:s})]})]}),n.jsx("hr",{className:"my-5 border-t"})]}),n.jsxs("div",{className:"leading-relaxed",children:[n.jsx("h3",{className:"text-lg font-semibold",children:"Summary"}),a.map((W,U)=>n.jsxs("div",{className:D("flex gap-1.5 mt-3",{"text-text-success":W.type==="discount","font-medium":W.type==="discount"}),children:[W.promo?n.jsxs("div",{className:"text-text-success",children:[n.jsxs("div",{className:"font-medium",children:["Promo code: ",W.promo.name]}),n.jsxs("div",{children:[W.promo.discount?.amountOff?`-$${W.promo.discount.amountOff/Ko}`:`${W.promo.discount?.percentOff}% off`,W.promo.discount?.duration?.duration==="repeating"?` for ${W.promo.discount.duration.months} months`:""," ","·"," ",n.jsx("button",{className:"underline text-text-danger hover:text-text-danger",onClick:()=>{O(R.PromoCodeRemoveButtonClicked,{eventProperties:{productArea:T?K.Onboarding:K.Billing,productSubArea:oe.Checkout}}),m&&m(null),w("")},children:"Remove"})]})]}):W.name,W.tooltip&&n.jsx(Ee,{content:W.tooltip,side:"bottom",children:n.jsx(bs,{className:"text-text-muted",size:"0.9em"})}),n.jsx("span",{className:"ml-auto tabular-nums",children:W.price===void 0?v?n.jsx(ts,{size:"sm"}):n.jsx("span",{className:"text-text-muted",children:"TBD"}):Ks(W.price)})]},U)),p?n.jsx(GN,{setCode:W=>{m?.(null),w(W)},appliedPromo:d}):null,n.jsx("hr",{className:"my-5 border-t"}),y||i?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex gap-2 justify-between",children:[n.jsxs("div",{className:"font-medium",children:[n.jsxs("div",{children:["Total per ",l]}),n.jsx("div",{className:"text-2xl leading-none mt-1.5",children:B===0?"$0":Ks(B)})]}),n.jsxs("div",{className:"font-medium",children:[n.jsx("div",{children:"Next billing cycle starts"}),n.jsx(iQ,{className:"text-2xl leading-none mt-1.5"})]})]}),!C&&n.jsx("p",{className:"text-text-muted mt-2",children:z}),C&&F&&n.jsx("p",{className:"text-text-muted mt-2",children:"You’re in your free 2-week trial. You won’t be charged until your trial ends."}),n.jsxs("p",{className:"text-text-muted",children:[n.jsx("a",{className:"underline",href:"https://tailscale.com/kb/1182/billing-information/#sales-tax",target:"_blank",rel:"noreferrer noopener",children:"Learn more"})," ","about how Tailscale collects sales tax."]}),!i&&B===0&&u&&n.jsxs(rt,{className:"mt-4",icon:!1,children:[n.jsx("span",{className:"mr-2",children:"✨"}),"Free until you have more than"," ",Xf("personal")," active users."]})]}):n.jsxs("div",{className:"flex text-lg font-semibold",children:[n.jsx("span",{children:"Your total"}),n.jsx("span",{className:"ml-auto tabular-nums",children:Ks(B)})]})]})]})}function GN({setCode:e,appliedPromo:t}){const{data:r}=Nt(),s=et(),[a,i]=ce.useState(!1),[l,u]=ce.useState(""),[d,m]=ce.useState(!1),p=Yt(),[g,v]=ce.useState(!1),y=ce.useRef(null);ce.useEffect(()=>{a&&y.current&&y.current.focus()},[a]);const C=ce.useCallback(()=>{O(R.PromoCodeApplyButtonClicked,{eventProperties:{productArea:p?K.Onboarding:K.Billing,productSubArea:oe.Checkout}}),e(l),m(!1),v(!1),y.current?.blur()},[l,e,p]);if(ce.useEffect(()=>{if(t){if(t.isValid&&r?.coupon&&t.name===r.coupon){s.show({message:"This promo code is already applied to your subscription.",variant:"danger"}),e(""),i(!1),u(""),m(!1);return}t.isValid?(u(""),v(!1),i(!1),m(!1)):(t.name&&u(t.name),v(!0),i(!0),m(!0))}},[t,r?.coupon]),t?.isValid)return null;if(a)return n.jsx(Br,{label:"Promo code",className:"mt-5 pt-5 border-t",children:n.jsxs("form",{className:"flex items-center gap-2 w-full",onSubmit:w=>{w.preventDefault(),C()},children:[n.jsxs("div",{className:"flex flex-col flex-grow",children:[n.jsx(ln,{ref:y,type:"text",value:l,onChange:w=>{u(w.target.value),m(!0),v(!1)},placeholder:"Enter promo code",className:"w-full code-input","aria-label":"Enter code","aria-invalid":g,error:g,onFocus:()=>{O(R.PromoCodeInputFocused,{eventProperties:{productArea:p?K.Onboarding:K.Billing,productSubArea:oe.Checkout}},{throttleMs:5e3})}}),g&&n.jsx("span",{className:"text-red-500 mt-1",role:"alert",children:"Invalid code"})]}),n.jsx(ue,{className:"self-start",type:"submit",disabled:!d,children:"Apply"})]})});const b=GY(r?.coupon,r?.discount);return n.jsxs("div",{className:"mt-1",children:[n.jsx(ue,{className:"!h-7 !px-2 -ml-2 self-start",variant:"minimal",intent:"primary",onClick:()=>i(!0),children:r?.coupon?"Replace promo code":"Apply promo code"}),b&&n.jsxs("p",{className:"text-text-muted text-sm mt-1",children:["Active promo code: ",b.code,b.description&&` — ${b.description}`]})]})}function iQ({className:e}){const t=f.useMemo(()=>{const r=Yn();return r.setMonth(r.getMonth()+1),r.toLocaleString("default",{month:"long"})},[]);return n.jsxs("div",{className:e,children:[t," 1",n.jsx("span",{className:"sup",children:"st"})]})}function qN({customer:e,showEmail:t,onEditClick:r}){const s=Yt(),a=f.useCallback(()=>n.jsx(ue,{variant:"minimal",intent:"primary",className:"ml-auto -mr-4 -mt-2 relative",onClick:()=>{O(R.EditBillingEmailButtonClicked,{eventProperties:{productArea:s?K.Onboarding:K.Billing,productSubArea:oe.Checkout}}),r()},children:"Edit"}),[r,s]),i=f.useCallback(()=>n.jsx(ue,{variant:"minimal",intent:"primary",className:"ml-auto -mr-4 -mt-2 relative",onClick:()=>{O(R.EditBillingAddressButtonClicked,{eventProperties:{productArea:s?K.Onboarding:K.Billing,productSubArea:oe.Checkout}}),r()},children:"Edit"}),[r,s]);return n.jsxs(at,{children:[t&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-start",children:[n.jsxs("div",{children:[n.jsx("h4",{className:"font-medium mb-2",children:"Billing email"}),n.jsx("p",{children:e?.email||n.jsx(kt,{})})]}),n.jsx(a,{})]}),n.jsx("hr",{className:"my-4 border-t"})]}),n.jsxs("div",{className:"flex items-start",children:[n.jsxs("div",{children:[n.jsx("h4",{className:"font-medium mb-2",children:"Billing address"}),e?.name&&n.jsx("p",{children:e?.name}),n.jsx("p",{children:e?.address?oQ(e?.address):n.jsx(kt,{})})]}),n.jsx(i,{})]})]})}function oQ(e){return`${e.line1}${e.line2?" "+e.line2:""}, ${e.city}, ${e.state} ${e.postal_code}`}function lQ({paymentCard:e,onEditClick:t}){return n.jsxs(at,{className:"mt-4",children:[n.jsxs("div",{className:"flex items-start mb-2",children:[n.jsx("h4",{className:"font-medium",children:"Payment method"}),n.jsx(ue,{variant:"minimal",intent:"primary",className:"ml-auto -mr-4 -mt-2 relative",onClick:t,children:"Edit"})]}),n.jsxs("div",{className:"flex items-center",children:[n.jsx(cw,{className:"mr-2",size:20}),n.jsx("span",{className:"font-medium",children:ml(e.brand)}),n.jsx("span",{className:"mx-1",children:"ending with ••••"}),n.jsx("span",{className:"open-digits font-medium",children:e.lastFour})]})]})}function o6({customer:e,onEditAddressClick:t,children:r}){return n.jsxs("div",{className:"w-full @md:max-w-lg space-y-4 mr-4",children:[n.jsx("h3",{className:Et.pageSubTitle,children:"Payment information"}),n.jsx(qN,{customer:e,onEditClick:t,showEmail:!0}),r]})}function l6({summarySection:e,children:t}){return n.jsxs("div",{className:"w-full @md:max-w-lg mt-10 @md:mt-0",children:[e,t]})}function c6({plan:e,inOnboarding:t,isDowngrade:r,isAddonReduction:s}){return e?t?"Confirm purchase":r?"Downgrade plan":"Confirm upgrade":s?"Confirm changes":"Confirm add-on purchase"}function cQ({plan:e,summarySection:t,customer:r,paymentCard:s,paymentIntentToken:a,onEditAddressClick:i,onEditPaymentClick:l,onContinueClick:u,isDowngrade:d,isAddonReduction:m,isPosting:p,returnUrl:g,purchaseGeoRestricted:v,confirmationModal:y,confirmationModalTitle:C}){const b=hl(),[w,N]=f.useState(!1),[k,E]=f.useState(""),[T,_]=f.useState(!1),I=Yt(),F=!e,z=Uv();return n.jsx(n.Fragment,{children:a?n.jsxs(wh,{stripe:z,options:{clientSecret:a,...$v(b.resolvedTheme)},children:[n.jsx(o6,{customer:r,onEditAddressClick:i,children:n.jsx(at,{children:n.jsx(VN,{options:{layout:"tabs"},onChange:H=>N(H.complete),onReady:()=>{O(R.StripePaymentElementLoaded,{eventProperties:{productArea:I?K.Onboarding:K.Billing,productSubArea:F?oe.AddonCheckout:oe.Checkout}})}})})}),n.jsxs(l6,{summarySection:t,children:[n.jsx(QN,{error:k}),v&&n.jsx(Q0,{}),n.jsx(YN,{text:c6({plan:e,inOnboarding:I,isDowngrade:d,isAddonReduction:m}),customer:r,disabled:!w||p||v,setError:E,withSetup:!0,returnUrl:g,confirmationModal:y,confirmationModalTitle:C,isAddonFlow:F})]})]}):n.jsxs(n.Fragment,{children:[T&&y&&n.jsx(y,{open:T,onOpenChange:_,onConfirm:u,loading:p,title:C}),n.jsx(o6,{customer:r,onEditAddressClick:i,children:s&&n.jsx(lQ,{paymentCard:s,onEditClick:l})}),n.jsxs(l6,{summarySection:t,children:[v&&n.jsx(Q0,{}),n.jsx(ue,{className:"w-full mt-5",intent:"primary",loading:p,onClick:()=>{O(R.ConfirmUpgradeButtonClicked,{eventProperties:{productArea:I?K.Onboarding:K.Billing,productSubArea:F?oe.AddonCheckout:oe.Checkout}}),y?_(!0):u()},disabled:v,children:c6({plan:e,inOnboarding:I,isDowngrade:d,isAddonReduction:m})})]})]})})}function uQ({planSummarySection:e,customer:t,updateCustomer:r,onContinueClick:s,isPosting:a,purchaseGeoRestricted:i,setPurchaseGeoRestricted:l}){const u=f.useMemo(()=>Cl(t?.email||""),[t?.email]);return n.jsxs(n.Fragment,{children:[n.jsx(KN,{customerDetails:t,setCustomerDetails:r,setPurchaseGeoRestricted:l}),n.jsxs("div",{className:"w-full @md:max-w-lg mt-10 @md:mt-0",children:[e,i&&n.jsx(Q0,{}),n.jsx(ue,{className:"w-full mt-5",intent:"primary",disabled:!t?.address||!t.name||!u||a||i,loading:a,onClick:s,children:"Continue to payment details"})]})]})}function YN({text:e,customer:t,disabled:r,setError:s,withSetup:a,returnUrl:i,confirmationModal:l,confirmationModalTitle:u,isAddonFlow:d}){const m=wZ(),p=vZ(),[g,v]=f.useState(!1),[y,C]=f.useState(!1),b=Yt(),w=async()=>{if(!m||!p)return;v(!0);const N=a?m.confirmSetup:m.confirmPayment,k=i?`${globalThis.location.protocol}//${globalThis.location.host}/${i}`:`${globalThis.location.protocol}//${globalThis.location.host}/admin/settings/billing`;try{const E=await N({elements:p,confirmParams:{return_url:k,payment_method_data:{billing_details:{name:t?.name,address:{line1:t?.address?.line1,city:t?.address?.city,state:t?.address?.state,country:t?.address?.country,postal_code:t?.address?.postal_code}}}}});if(E.error)throw new Error(E.error.message||"unknown error")}catch(E){s(`Error submitting payment: ${E.message}. Please try again.`),O(R.CustomerPlanChangeFailed,{eventProperties:{productArea:b?K.Onboarding:K.Billing,productSubArea:d?oe.AddonCheckout:oe.Checkout},errorProperties:{errorMessage:E.message}})}finally{v(!1)}};return n.jsxs(n.Fragment,{children:[y&&l&&n.jsx(l,{open:y,onOpenChange:C,onConfirm:w,loading:g,title:u}),n.jsx(ue,{className:"w-full mt-5",intent:"primary",disabled:r,loading:g,onClick:()=>{O(R.ConfirmUpgradeButtonClicked,{eventProperties:{productArea:b?K.Onboarding:K.Billing,productSubArea:d?oe.AddonCheckout:oe.Checkout}}),l?C(!0):w()},children:e})]})}function Dce({open:e,onOpenChange:t,onConfirm:r,title:s,loading:a}){const i=()=>{Promise.resolve(r()).catch(()=>t(!1))};return n.jsx(Re,{title:"Before you continue",open:e,onOpenChange:t,children:n.jsx(Re.Form,{onSubmit:i,loading:a,submitButton:"Continue",cancelButton:"Cancel",children:n.jsx("p",{children:s})})})}function ZN(){return n.jsx("h3",{className:D("mb-4 invisible",Et.pageSubTitle),children:"Spacer"})}function QN({error:e}){return n.jsx(f.Fragment,{children:e&&n.jsx(rt,{intent:"error",title:"An error occurred",className:"mt-6",children:e})})}function Q0(){return n.jsxs(rt,{intent:"error",className:"mb-6",children:["Mullvad VPN is not available to purchase in your location."," ",n.jsx(Ge,{kbTopic:"Mullvad Exit Nodes",url:"https://tailscale.com/kb/1258/mullvad-exit-nodes/#available-regions"})]})}const Bt={white:"rgb(255, 255, 255)",gray0:"rgb(250, 249, 248)",gray300:"rgb(218, 214, 213)",gray400:"rgb(175, 172, 171)",gray500:"rgb(112, 110, 109)",gray600:"rgb(68, 67, 66)",gray800:"rgb(35, 34, 34)",gray900:"rgb(31, 30, 30)",blue200:"rgb(133, 170, 245)",blue300:"rgb(108, 148, 236)",blue400:"rgb(90, 130, 222)",blue600:"rgb(63, 93, 179)",blue700:"rgb(50, 73, 148)",red400:"rgb(208, 72, 65)",red600:"rgb(148, 8, 33)"};function $v(e){const t=e==="dark";return{appearance:{theme:"stripe",variables:{...t?{colorText:Bt.white,colorBackground:Bt.gray900,colorTextSecondary:Bt.gray400,colorPrimary:Bt.blue300,colorTextPlaceholder:Bt.gray600,colorDangerText:Bt.red400}:{colorText:Bt.gray800,colorTextSecondary:Bt.gray500,colorPrimary:Bt.blue600,colorTextPlaceholder:Bt.gray400,colorDangerText:Bt.red600},fontFamily:"Inter, system-ui, sans-serif",spacingGridRow:"12px"},rules:{".Block":{boxShadow:"none"},".Tab, .Tab--selected":{boxShadow:"none"},".Label":{marginBottom:"8px"},".Input, .Input--invalid, .Input--invalid:hover":{color:"var(--colorText)",border:`1px solid ${t?Bt.gray600:Bt.gray300}`,lineHeight:"20px",paddingTop:"8px",paddingRight:"12px",paddingBottom:"8px",paddingLeft:"12px",borderRadius:"6px",boxShadow:"none"},".Input:hover":{borderColor:t?Bt.gray500:Bt.gray400},".Input:focus":{borderColor:t?Bt.blue600:Bt.blue400,outline:`2px solid ${t?Bt.blue700:Bt.blue200}`,boxShadow:"none"},".Input:focus:hover":{borderColor:t?Bt.blue600:Bt.blue400},".Input:disabled, .Input:disabled:hover":{backgroundColor:t?Bt.gray800:Bt.gray0,borderColor:t?Bt.gray600:Bt.gray300},".Input--empty::placeholder":{color:"var(--colorTextPlaceholder)"},".Error":{marginTop:"8px",color:"var(--colorDangerText)"}}}}}function JN({children:e,className:t="mb-4"}){return n.jsx(rt,{intent:"info",className:t,icon:n.jsx(yR,{}),children:e})}function dQ({addon:e,quantity:t,originalQuantity:r}){const{shouldUseHybridEligibleUI:s}=bl(),{data:a}=Nt();if(!(s&&r>0&&t0?`Your seats will increase immediately, but your plan will change to Standard at the end of this billing period${t}. Until then, you’ll keep all your Premium features.`:e<0?`Your seats and plan will change at the end of this billing period${t}. Until then, you’ll keep all your Premium features.`:`Your plan will change to Standard at the end of this billing period${t}. Until then, you’ll keep all your Premium features.`}function xQ(e,t){const r=XN(t);return`Your ${qo(e)} device count will decrease at the end of this billing period${r}.`}function yf(){const{data:e,setData:t,api:r,step:s}=os(),a=f.useMemo(()=>NQ({quantity:e.quantity,billingInterval:e.billingInterval,promo:e.appliedPromo,addonType:e.addon}),[e.addon,e.appliedPromo,e.quantity,e.billingInterval]);return n.jsxs(n.Fragment,{children:[n.jsx(ZN,{}),n.jsx(dQ,{addon:e.addon,quantity:e.quantity,originalQuantity:e.originalQuantity}),n.jsx(aQ,{isAddOnFlow:!0,product:e.addon,billingInterval:e.billingInterval,itemized:[...a,{name:"Estimated sales tax",price:e.taxCents}],appliedPromo:e.appliedPromo,setAppliedPromo:i=>t({...e,appliedPromo:i}),displayPromo:!0,isTaxLoading:s>=4||r.isPosting})]})}const vQ={mullvad:sZ,tagged_resources:aZ};function yQ(){const{data:e,setData:t,goTo:r,api:s}=os();ce.useEffect(()=>{s.setPurchaseGeoRestricted?.(!1),t({...e,taxCents:void 0})},[]);const a=e.addon??"mullvad",i=Js[a],l=i.devicesPerPack,u=e.quantity*l,d=e.quantity===e.originalQuantity,m=s.isPosting||d||e.purchaseGeoRestricted,p=y2(e.customer)&&!!e.paymentCard,g=p?"Continue to payment details →":"Continue to billing details →",v=vQ[a];return n.jsxs("div",{className:"@md:flex @md:space-x-5 mt-10 mx-auto justify-between",children:[n.jsx(v,{numOfDevices:u,setNumOfDevices:y=>t({...e,quantity:Math.ceil(y/l)}),interval:e.billingInterval}),n.jsxs("div",{className:"w-full @md:max-w-lg mt-5 @md:mt-0",children:[n.jsx(yf,{}),n.jsx(ue,{className:"w-full mt-5",intent:"primary",disabled:m,onClick:()=>{O(R.ContinueToPaymentDetailsButtonClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.AddonCheckout}}),p?s.postSetup({quantity:e.quantity,customer:e.customer,createSetupIntent:!1}).then(()=>r(4)):r(3)},children:g}),i.termsUrl&&n.jsxs("p",{className:"mt-2 text-text-muted",children:["By clicking continue, you agree to the"," ",n.jsx("a",{href:i.termsUrl,className:"link",target:"_blank",rel:"noopener noreferrer",onClick:()=>i.termsClickEvent&&O(i.termsClickEvent,{eventProperties:{productArea:K.Billing,productSubArea:oe.AddonCheckout}}),children:i.termsLabel}),"."]}),e.purchaseGeoRestricted&&n.jsx(rt,{className:"mt-4",intent:"warning",icon:!1,children:"This product is not available in your country. Contact support if you believe this is an error."})]})]})}function bQ(e){const{number:t,label:r,isActive:s,onClick:a,variant:i="blue"}=e;return n.jsxs("button",{className:D("relative flex items-center text-sm flex-wrap justify-center gap-x-2 gap-y-1 min-[600px]:text-base",{"hover:opacity-75":a,"cursor-text":!a}),onClick:a,children:[n.jsx("div",{className:D("w-5 h-5 min-[600px]:w-6 min-[600px]:h-6 rounded-full border border-border-interactive text-center flex items-center justify-center font-medium",{"text-text-muted":!s,"bg-blue-500 !border-blue-500 dark:bg-blue-600 dark:border-blue-600 text-white":s&&i==="blue","bg-gray-900 !border-gray-900 dark:bg-gray-100 dark:border-gray-100 text-white dark:text-gray-900":s&&i==="neutral"}),children:t}),n.jsx("span",{className:D("font-medium whitespace-nowrap",{"text-text-primary":s&&i==="blue","text-gray-900 dark:text-white":s&&i==="neutral","text-text-muted":!s}),children:r})]})}function Hv({steps:e,hideSteps:t,currentStep:r}){const a=!Yt();return n.jsxs("header",{className:"mt-6 min-h-6",children:[a&&n.jsxs(ze,{to:"/admin/settings/billing",className:"link flex items-center mb-8 @lg:absolute @lg:m-0",onClick:()=>{O(R.BackToBillingClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.Plans}})},children:[n.jsx(Li,{size:20}),n.jsx("span",{children:"Back to billing"})]}),n.jsx("div",{className:"flex justify-center mb-6",children:!t&&n.jsx("div",{className:"relative flex items-center gap-3 @sm:gap-1.5 min-[600px]:gap-3",children:e.map((i,l)=>n.jsxs(ce.Fragment,{children:[n.jsx(bQ,{number:l+1,label:i.label,isActive:r===l+1,onClick:l+1<=r?i.onClick:void 0}),l!==e.length-1&&n.jsx("div",{className:"hidden @sm:block w-2 min-[600px]:w-4 h-px border-t border-border-interactive"})]},l))})})]})}function CQ(){const{data:e,setData:t,api:r,goTo:s}=os(),a=!!e.addon,i=Yt(),l=xu(e.planId),u=!a&&l===Ir.Downgrade,d=a?n.jsx(yf,{}):n.jsxs(n.Fragment,{children:[n.jsx("h3",{className:"mb-4 text-lg font-semibold leading-none",children:i?"Selected Plan":u?"Downgrading to":"Upgrading to"}),n.jsx(yf,{})]}),m=()=>{const p=a?{quantity:e.quantity,customer:e.customer,createSetupIntent:!e.paymentCard}:{planId:e.planId,customer:e.customer,createSetupIntent:!e.paymentCard};O(R.ContinueToPaymentDetailsButtonClicked,{eventProperties:{productArea:i?K.Onboarding:K.Billing,productSubArea:a?oe.AddonCheckout:oe.Checkout}}),r.postSetup(p).then(g=>{t({...e,intentToken:g.intentToken??e.intentToken,taxCents:g.taxCents}),s(a?4:3)})};return n.jsx("div",{className:"@md:flex @md:space-x-5 mt-10 mx-auto justify-between",children:n.jsx(uQ,{planSummarySection:d,customer:e.customer,updateCustomer:p=>t({...e,customer:p}),isPosting:r.isPosting,onContinueClick:m,purchaseGeoRestricted:e.purchaseGeoRestricted,setPurchaseGeoRestricted:r.setPurchaseGeoRestricted})})}function wQ(){const{data:e,setData:t,api:r,goTo:s}=os(),[,a]=ft(),[i,l]=f.useState(!1),u=Yt(),d=xu(e.planId),m=!!e.addon,p=m&&e.originalQuantity>0&&e.quantity{if(e.taxCents===void 0&&e.customer&&e.paymentCard){const k=m?{quantity:e.quantity,customer:e.customer,createSetupIntent:!1}:{planId:e.planId,customer:e.customer,createSetupIntent:!1};r.postSetup(k)}},[]);const v=()=>{const k=m?{quantity:e.quantity,promoCode:e.appliedPromo?.name,promoId:e.appliedPromo?.id}:{planId:e.planId,promoCode:e.appliedPromo?.name,promoId:e.appliedPromo?.id,intentToken:e.intentToken};r.postCheckout(k).then(()=>{const E=e.addon?Js[e.addon]:void 0;p||m&&!E?.confirmationPath?a("/admin/settings/billing",{replace:!0}):m&&E?.confirmationPath?a(E.confirmationPath(e.quantity,e.billingInterval),{replace:!0}):a(`/admin/settings/billing${g?"":`?newPlan=${e.planId}`}`,{replace:!0})}).catch(()=>{l(!1)})},y=e.appliedPromo?.id,C=e.appliedPromo?.name,b=u?"/admin/welcome":"/admin/settings/billing",w=y?`${b}/checkout/${e.planId}-complete?promo=${y}&promocode=${C}`:`${b}/checkout/${e.planId}-complete?purchasedPlan=${e.planId}`,N=m?`/admin/settings/billing/add/${J$(e.addon)}-complete?packs=${e.quantity}&interval=${e.billingInterval}`:w;return n.jsxs("div",{className:"@md:flex @md:space-x-5 mt-10 mx-auto justify-between",children:[n.jsx(cQ,{plan:m?void 0:e.planId,isPosting:r.isPosting,isDowngrade:m?void 0:g,isAddonReduction:p,summarySection:n.jsx(yf,{}),customer:e.customer,paymentCard:e.paymentCard,paymentIntentToken:e.intentToken,returnUrl:N,onEditAddressClick:()=>s(m?3:2),onEditPaymentClick:()=>r.postSetup(m?{quantity:e.quantity,customer:e.customer,createSetupIntent:!0}:{planId:e.planId,customer:e.customer,createSetupIntent:!0}).then(k=>t({...e,intentToken:k.intentToken??e.intentToken})),onContinueClick:()=>{g?l(!0):v()},purchaseGeoRestricted:e.purchaseGeoRestricted}),n.jsx(Bv,{currentPlan:e.currentPlanId,newPlan:e.planId,open:i,onOpenChange:l,isPosting:r.isPosting,onConfirm:v})]})}function jQ(){const{step:e,goTo:t}=os(),[,r]=ft(),s=[{label:"Add-ons",onClick:()=>{O(R.StepperAddOnsStepClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.AddOns}}),r("/admin/settings/billing/add")}},{label:"Calculate",onClick:()=>{O(R.StepperCalculateStepClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.AddOns}}),t(2)}},{label:"Billing details",onClick:()=>{O(R.StepperBillingDetailsStepClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.AddOns}}),t(3)}},{label:"Payment",onClick:()=>{O(R.StepperPaymentStepClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.AddOns}}),t(4)}}];return n.jsxs(mn,{children:[n.jsx(Hv,{currentStep:e,steps:s}),e===2&&n.jsx(yQ,{}),e===3&&n.jsx(CQ,{}),e===4&&n.jsx(wQ,{})]})}function SQ(){const[e,t]=f.useState(globalThis.location.pathname),[r,s]=f.useState(globalThis.location.search);f.useEffect(()=>{globalThis.addEventListener("popstate",l),globalThis.addEventListener("pushState",l),globalThis.addEventListener("replaceState",l);function l(){t(globalThis.location.pathname),s(globalThis.location.search)}return()=>{globalThis.removeEventListener("popstate",l),globalThis.removeEventListener("pushState",l),globalThis.removeEventListener("replaceState",l)}},[]);const a=kQ(r);function i(l,u=!1){let d=e;if(Object.keys(l).length>0){const m=new URLSearchParams(l);d=d+"?"+m.toString()}return globalThis.history[u?"replaceState":"pushState"](0,"",d)}return[a,i]}function kQ(e){const t=new URLSearchParams(e),r={};for(const s of t.keys()){const a=t.get(s);a&&(r[s]=a)}return r}function ns(e="q"){const[t,r]=SQ(),[s,a]=f.useState(t[e]||""),[i,l]=f.useState(s||""),u=t[e];f.useEffect(()=>{a(u||""),l(u||"")},[u]);const d=f.useCallback(m=>{const p={...t};m===""?delete p[e]:p[e]=m,r(p),a(m),l(m)},[e,r,t]);return{query:s,setQuery:d,tmpQuery:i,setTmpQuery:l}}function u6({addonType:e}){const t=Jf(),{data:r,loaded:s,error:a,addOnsDetails:i,billingInterval:l,billingUsage:u}=Nt(),{query:d}=ns("packs"),{query:m}=ns("quantity");if(!s||a)return n.jsx(De,{error:a});const p=i?.addonPacks[e]??0,g=Js[e].devicesPerPack;let v=1;if(vf(m)){const b=Number(m);v=Math.ceil(b/g)}else if(vf(d))v=Number(d);else if(p)v=p;else{const b=Js[e].usageFeatureId;if(b){const w=u?.usage?.[b]??0,N=u?.allowance?.[b],k=N?.total?.unlimited?0:N?.total?.amount??0,E=w-k;E>0&&(v=Math.ceil(E/g))}}const y=p??v,C={postSetup:({quantity:b,customer:w,createSetupIntent:N=!1})=>t.postSetup(e,b,l,w,N),postCheckout:({quantity:b,promoCode:w,promoId:N})=>t.postCheckout(e,b,l,void 0,w,N),isPosting:t.isPosting,setPurchaseGeoRestricted:t.setPurchaseGeoRestricted};return n.jsx(MN,{api:C,initialStep:2,initialData:{addon:e,quantity:v,originalQuantity:y,billingInterval:l,customer:r?.customerDetails,paymentCard:r?.billingCard,taxCents:void 0,intentToken:"",appliedPromo:null,purchaseGeoRestricted:t.purchaseGeoRestricted,activeTrial:r?.trialEnd&&r.status==="trialing"},children:n.jsx(jQ,{})})}function NQ(e){const{quantity:t,billingInterval:r,promo:s,addonType:a}=e,i=Js[a],l=r===E7.Year?t*i.pricePerPackYearly:t*i.pricePerPack,u=[{name:i.name,price:l}];if(s?.isValid){let d=0;s.discount?.amountOff?d=s.discount.amountOff:s.discount?.percentOff&&(d=s.discount.percentOff/100*l),u.push({name:"Promo code discount",price:-d,type:"discount",promo:s})}return u}function zv(e){const t=f.useRef(!1);f.useEffect(()=>{if(!t.current)return t.current=!0,e()},[])}function gs({to:e,toastKey:t,message:r,timeout:s=5e3,variant:a}){const i=et();return f.useEffect(()=>{i.show({key:t,message:r,timeout:s,variant:a})},[i,t,r,s,a]),n.jsx(_i,{to:e})}function EQ({addon:e}){const{query:t}=ns("packs"),{query:r}=ns("interval"),[s,a]=f.useState(),{purchaseGeoRestricted:i}=Jf(),{addonChanges:l}=Qf(),{data:u}=Nt(),d=PN(),m=TN(u);if(d)return n.jsx(_i,{to:"/admin/settings/billing"});const p=e?.replace(/-complete$/,""),g=p?s9(p):void 0;if(g&&l[g])return n.jsx(gs,{to:"/admin/settings/billing",toastKey:"scheduled-addon-changes-block",message:"You have scheduled changes to this add-on. Cancel them before making new changes.",variant:"danger"});if(s?.message.includes("geographically")||i)return n.jsx(TQ,{});if(e?.endsWith("-complete")){const v=e.replace(/-complete$/,""),y=s9(v),C=vf(t)?Number(t):null,b=r;return y?y!=="mullvad"&&!m?n.jsx(gs,{to:"/admin/settings/billing",toastKey:"addon-not-available-for-plan",message:d6(u?.readableProductID),variant:"danger"}):n.jsx(PQ,{addOn:y,quantity:C,billingInterval:b,onCheckoutErr:w=>a(w)}):n.jsx(gs,{to:"/admin/settings/billing",toastKey:"tagged-resources-not-available",message:"This add-on is not available.",variant:"danger"})}return e==="mullvad"?n.jsx(u6,{addonType:"mullvad"}):e==="tagged-resources"?m?n.jsx(u6,{addonType:"tagged_resources"}):n.jsx(gs,{to:"/admin/settings/billing",toastKey:"tagged-resources-not-available",message:d6(u?.readableProductID),variant:"danger"}):n.jsxs(mn,{children:[n.jsx(Hv,{currentStep:1,steps:[{label:"Add-ons",onClick:()=>{}},{label:"Calculate"},{label:"Billing details"},{label:"Payment"}]}),n.jsx(AQ,{})]})}function d6(e){return e==="enterprise_trial"?"Tagged resources add-on is not available during your trial.":gu(e)?"Contact sales to manage your add-ons.":"This add-on is not available for your current plan."}const m6="flex justify-between items-center gap-10";function AQ(){const[,e]=ft(),{data:t}=Nt(),r=f.useMemo(()=>vu(t),[t]);return n.jsxs("div",{className:"max-w-2xl m-auto p-6",children:[n.jsx(is,{title:"Select add-ons",isSubpage:!0,classes:D(Et.pageSubTitle)}),r&&n.jsx(rt,{className:"mt-6",icon:!1,intent:"warning",children:"Purchasing an add-on will immediately start billing, removing any remaining free days left on your plan."}),n.jsx(at,{className:"border-border-interactive hover:border-border-interactive-hover cursor-pointer mt-6",children:n.jsxs("div",{onClick:()=>{O(R.SelectMullvadAddonButtonClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.AddOns}}),e("/admin/settings/billing/add/mullvad")},className:m6,children:[n.jsxs("div",{children:[n.jsxs("h3",{className:D(Et.sectionTitle,"flex items-center justify-between"),children:["Mullvad VPN",n.jsx(qd,{size:"24",className:"@md:hidden w-8 shrink-0 text-text-disabled"})]}),n.jsxs("p",{className:"mt-2",children:["Encrypt and route your traffic using Mullvad’s global network of servers as exit nodes. At the end of every billing cycle, you will be billed $5 for up to ",Wc," devices, and for every ",Wc," after that.",n.jsx("br",{}),n.jsx(Ge,{kbTopic:"Mullvad VPN",url:"https://tailscale.com/kb/1258/mullvad-exit-nodes/","data-docslink":!0,onClick:s=>{s.stopPropagation(),O(R.LearnMoreMullvadVPNClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.AddOns}})}})]})]}),n.jsx(qd,{size:"24",className:"hidden @md:block w-8 shrink-0 text-text-disabled"})]})}),TN(t)&&n.jsx(at,{className:"border-border-interactive hover:border-border-interactive-hover cursor-pointer mt-4",children:n.jsxs("div",{onClick:()=>{O(R.SelectTaggedResourcesAddonButtonClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.AddOns}}),e("/admin/settings/billing/add/tagged-resources")},className:m6,children:[n.jsxs("div",{children:[n.jsxs("h3",{className:D(Et.sectionTitle,"flex items-center justify-between"),children:["Tagged Resources",n.jsx(qd,{size:"24",className:"@md:hidden w-8 shrink-0 text-text-disabled"})]}),n.jsxs("p",{className:"mt-2",children:["Scale your tagged resource capacity beyond the included"," ",F$," devices. $",N7/Ko,"/mo per tagged resource.",n.jsx("br",{}),n.jsx(Ge,{kbTopic:"ACL tags",url:"https://tailscale.com/kb/1068/acl-tags","data-docslink":!0,onClick:s=>{s.stopPropagation(),O(R.LearnMoreTaggedResourcesClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.AddOns}})}})]})]}),n.jsx(qd,{size:"24",className:"hidden @md:block w-8 shrink-0 text-text-disabled"})]})})]})}function PQ({quantity:e,addOn:t,billingInterval:r,onCheckoutErr:s}){const{postCheckout:a}=Jf(),[,i]=ft(),l=Js[t],u=l.confirmationPath?l.confirmationPath(e??0,r):"/admin/settings/billing";return zv(()=>{const d=new URLSearchParams(globalThis.location.search),m=d.get("setup_intent_client_secret"),p=d.get("promocode"),g=d.get("promo");e?a(t,e,r,m||void 0,p||void 0,g||void 0).then(()=>i(u,{replace:!0})).catch(v=>{s(v),i("/admin/settings/billing",{replace:!0})}):i(u,{replace:!0})}),n.jsx(De,{})}function eE({id:e}){const{query:t}=ns("packs"),[,r]=ft(),s={mullvad:{header:`Got access to Mullvad VPN for up to ${vf(t)?Number(t)*5:0} devices`,body:"Next, pick which devices can access Mullvad VPN",buttonCopy:"Give devices Mullvad VPN access",onClick:()=>r("/admin/settings/general/mullvad")}};return s[e]?n.jsxs("div",{className:"max-w-lg mx-auto text-center mt-32",children:[n.jsx("h3",{className:D("mb-4",Et.pageSubTitle),children:"Start using your add-on"}),n.jsxs(at,{children:[n.jsxs("div",{className:"flex icon-parent items-center",children:[n.jsx(iw,{color:"green",className:"mr-2"})," ",n.jsx("p",{className:"text-lg font-medium",children:s[e].header})]}),n.jsx("p",{className:"mt-2 text-left",children:s[e].body}),n.jsx(ue,{intent:"primary",className:"mt-4 w-full",onClick:()=>{O(R.GiveDevicesMullvadVPNAccessClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.AddOns}}),s[e].onClick()},children:s[e].buttonCopy})]})]}):(r("/admin/settings/billing"),null)}function TQ(){return n.jsxs(at,{elevated:!0,children:[n.jsx("p",{className:"font-medium text-lg",children:"This product is not available in your country."}),n.jsxs("p",{className:"mt-2",children:["If you have any questions, please reach out"," ",n.jsx(Zn,{type:"billing",eventProperties:{productArea:K.Billing,productSubArea:oe.AddOns},children:"to our support team"}),"."]})]})}const IQ=Object.freeze(Object.defineProperty({__proto__:null,MullvadConfirmation:eE,default:EQ},Symbol.toStringTag,{value:"Module"}));function DQ(e){const{isLoading:t,completeUpdateBillingCard:r}=sH();return zv(()=>r(e.sessionId)),t===!1?n.jsx(_i,{to:"/admin/settings/billing",replace:!0}):n.jsx(De,{})}const _n="/public/tailnet/-/border0/api",Mn={connectors:`${_n}/connectors`,connector:e=>`${_n}/connector/${encodeURIComponent(e)}`,connectorRoot:`${_n}/connector`,connectorInstallTokens:`${_n}/connector/install_tokens`,connectorInstallToken:e=>`${_n}/connector/install_tokens/${encodeURIComponent(e)}`,connectorTokens:e=>`${_n}/connector/${encodeURIComponent(e)}/tokens`,connectorTokenRoot:`${_n}/connector/token`,connectorToken:(e,t)=>`${_n}/connector/${encodeURIComponent(e)}/token/${encodeURIComponent(t)}`,connectorSockets:e=>`${_n}/connector/${encodeURIComponent(e)}/sockets`,socket:`${_n}/socket`,socketByName:e=>`${_n}/socket/${encodeURIComponent(e)}`,sessions:`${_n}/sessions`,sessionsDistinctSockets:`${_n}/sessions/distinct_sockets`,sessionsDistinctEmails:`${_n}/sessions/distinct_emails`,session:(e,t)=>`${_n}/session/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,sessionLog:(e,t)=>`${_n}/session/${encodeURIComponent(e)}/${encodeURIComponent(t)}/session_log`};function fs(e){return Ie.get(e).then(t=>t.data.data)}function Eg(e,t){return Ie.post(e,t).then(r=>r.data.data)}function _Q(e,t){return Ie.put(e,t).then(r=>r.data.data)}function f6(e){return Ie.delete(e).then(t=>t.data.data)}function MQ(e){const t=new URLSearchParams;return t.set("page",String(e.page)),t.set("page_size",String(e.pageSize)),e.socketNames?.forEach(r=>t.append("socket_names",r)),e.userEmails?.forEach(r=>t.append("user_emails",r)),e.authResult&&t.set("auth_result",e.authResult),e.start&&t.set("start_date_after",e.start.toISOString()),e.end&&t.set("start_date_before",e.end.toISOString()),t.toString()}const Es={listConnectors:()=>fs(Mn.connectors),getConnector:e=>fs(Mn.connector(e)),updateConnector:e=>_Q(Mn.connectorRoot,e),createInstallToken:()=>Eg(Mn.connectorInstallTokens),getInstallToken:e=>fs(Mn.connectorInstallToken(e)),listConnectorTokens:e=>fs(Mn.connectorTokens(e)),createConnectorToken:e=>Eg(Mn.connectorTokenRoot,e),deleteConnectorToken:(e,t)=>f6(Mn.connectorToken(e,t)),listConnectorSockets:e=>fs(Mn.connectorSockets(e)),createSocket:e=>Eg(Mn.socket,e),deleteSocket:e=>f6(Mn.socketByName(e)),listSessions:e=>fs(`${Mn.sessions}?${MQ(e)}`),listSessionsDistinctSockets:()=>fs(Mn.sessionsDistinctSockets),listSessionsDistinctEmails:()=>fs(Mn.sessionsDistinctEmails),getSession:(e,t)=>fs(Mn.session(e,t)),getSessionLog:(e,t,r={})=>{const s=new URLSearchParams;r.format==="text"&&s.set("format","text"),r.recordingId&&s.set("recording_id",r.recordingId);const a=s.toString(),i=Mn.sessionLog(e,t);return fs(a?`${i}?${a}`:i)}},zi={revalidateOnFocus:!1,revalidateOnReconnect:!1};function tE(e){const t=e.metadata?.connector_internal_metadata,r=t?.host_metadata,s=e.device?.networks?.[0];return{name:e.name,connectorId:e.connector_id,description:e.description??"",ipAddress:t?.ip_address,isConnected:e.is_connected??!1,createdAt:e.created_at,updatedAt:e.updated_at,lastSeenAt:e.last_seen_at,activeTokens:e.active_tokens??0,notificationsEnabled:e.notifications_enabled??!1,notifyAfterSeconds:e.notify_after_seconds??0,builtInSshServiceEnabled:e.built_in_ssh_service_enabled??!1,hostname:r?.hostname,os:r?.platform||r?.os,osVersion:r?.platform_version,version:t?.version,buildDate:t?.built_date,privateIpV4:s?.ipv4_address,privateIpV6:s?.ipv6_address,publicKey:e.device?.public_key}}function LQ(){const{data:e}=vt(),t=e.featureBorder0IntegrationOK&&e.featureBorder0MilestoneThree,{data:r,error:s,isLoading:a,mutate:i}=dt(t?"border0:connectors":null,()=>Es.listConnectors(),zi);return{connectors:f.useMemo(()=>(r?.list??[]).map(tE),[r]),error:s,isLoading:t&&a,mutate:i}}function nE(e){const{data:t}=vt(),r=t.featureBorder0IntegrationOK&&t.featureBorder0MilestoneThree&&!!e,{data:s,error:a,isLoading:i,mutate:l}=dt(r?["border0:connector",e]:null,()=>Es.getConnector(e),zi);return{connector:f.useMemo(()=>s?tE(s):void 0,[s]),error:a,isLoading:r&&i,mutate:l}}async function RQ(e){await Es.updateConnector({connector_id:e.connectorId,name:e.name,description:e.description,built_in_ssh_service_enabled:e.builtInSshServiceEnabled,notifications_enabled:e.notificationsEnabled,notify_after_seconds:e.notifyAfterSeconds})}function OQ(e){const{data:t}=vt(),r=t.featureBorder0IntegrationOK&&t.featureBorder0MilestoneThree&&!!e,{data:s,error:a}=dt(r?["border0:install_token_mint",e]:null,()=>Es.createInstallToken(),{...zi,revalidateIfStale:!1,dedupingInterval:36e5});return{token:s?.token,error:a}}function FQ(e){const{data:t}=vt(),r=t.featureBorder0IntegrationOK&&t.featureBorder0MilestoneThree&&!!e,{data:s}=dt(r?["border0:install_token",e]:null,()=>Es.getInstallToken(e),{...zi,refreshInterval:a=>a?.connector?.connector_id?0:3e3});return{connectorId:s?.connector?.connector_id}}function BQ(e){const{data:t}=vt(),r=t.featureBorder0IntegrationOK&&t.featureBorder0MilestoneThree&&!!e,{data:s}=dt(r?["border0:connector_status",e]:null,()=>Es.getConnector(e),{...zi,refreshInterval:a=>a?.is_connected?0:3e3});return{isConnected:s?.is_connected??!1}}function UQ(e){return{id:e.id,name:e.name,createdBy:e.created_by??"",createdAt:e.created_at,expiresAt:e.expires_at}}function VQ(e){const{data:t}=vt(),r=t.featureBorder0IntegrationOK&&t.featureBorder0MilestoneThree&&!!e,{data:s,error:a,isLoading:i,mutate:l}=dt(r?["border0:connector_tokens",e]:null,()=>Es.listConnectorTokens(e),zi);return{tokens:f.useMemo(()=>(s?.list??[]).map(UQ),[s]),error:a,isLoading:r&&i,mutate:l}}async function $Q(e,t,r){return Es.createConnectorToken({connector_id:e,name:t,...r?{expires_at:r}:{}})}async function HQ(e,t){await Es.deleteConnectorToken(e,t)}function zQ(e){return{socketId:e.socket_id,name:e.name,dnsname:e.dnsname??"",socketType:e.socket_type??"",alive:e.alive??!1}}function rE(e){const{data:t}=vt(),r=t.featureBorder0IntegrationOK&&t.featureBorder0MilestoneThree&&!!e,{data:s,error:a,isLoading:i,mutate:l}=dt(r?["border0:connector_sockets",e]:null,()=>Es.listConnectorSockets(e),zi);return{sockets:f.useMemo(()=>(s?.list??[]).map(zQ),[s]),error:a,isLoading:r&&i,mutate:l}}const WQ="https://tailscale.com/kb/pam",KQ=[{type:"string-constant",label:"PAM",value:"pam"}],GQ=[{type:"string-constant",label:"Online",value:"online"},{type:"string-constant",label:"Offline",value:"offline"}],sE="hidden md:table-cell",aE="hidden md:table-cell",iE="hidden md:table-cell";function qQ(){const{connectors:e,isLoading:t,error:r}=LQ(),{query:s,setQuery:a,tmpQuery:i,setTmpQuery:l}=ns(),[u,d]=f.useState(),m=f.useMemo(()=>{const p=s.trim().toLowerCase();return e.filter(g=>!(p&&!g.name.toLowerCase().includes(p)||u==="online"&&!g.isConnected||u==="offline"&&g.isConnected))},[e,s,u]);return n.jsxs(mn,{title:"Connectors",description:"Manage devices that route traffic to networks, apps, and services for your tailnet. Currently, only PAM type connectors appear here.",learnMoreUrl:WQ,children:[n.jsxs("div",{className:"flex flex-wrap justify-between items-center gap-3 pt-4 pb-4",children:[n.jsxs("div",{className:"flex flex-wrap items-center gap-3 flex-1",children:[n.jsx("form",{className:"flex-1 min-w-[16rem] max-w-md",onSubmit:p=>{p.preventDefault(),a(i)},children:n.jsx(Nu,{className:"w-full",placeholder:"Search connectors",value:i,onChange:p=>l(p.target.value),onClearClick:()=>{l(""),a("")}})}),n.jsx(h6,{title:"Type",values:KQ}),n.jsx(h6,{title:"Status",values:GQ,selectedValue:u,onChange:d})]}),n.jsx(Vt,{intent:"primary",to:"/admin/pam_connectors/new",children:"Add connector"})]}),n.jsx(Lv,{data:m,loading:t,error:r,errorMessage:"Error encountered loading connectors.",emptyDataMessage:e.length===0?n.jsx(QQ,{}):"No connectors match your filters.",columns:[{label:"Name"},{label:"IP address",className:sE},{label:"Destinations",className:aE},{label:"Created on",className:iE},{label:"Status"}],children:n.jsx("tbody",{children:m.map(p=>n.jsx(YQ,{connector:p},p.connectorId))})})]})}function YQ({connector:e}){return n.jsxs("tr",{className:"border-b last:border-b-0",children:[n.jsx("td",{className:Ut.cellBody,children:n.jsx(ze,{href:`/admin/pam_connectors/${e.connectorId}`,"aria-label":`Detail view for ${e.name}`,children:n.jsx("p",{className:"font-semibold hover:text-blue-500 dark:hover:text-blue-400",children:e.name})})}),n.jsx("td",{className:D(Ut.cellBody,sE,"tabular-nums"),children:e.ipAddress||n.jsx(Ut.NullValue,{})}),n.jsx("td",{className:D(Ut.cellBody,aE),children:n.jsx(ZQ,{connectorId:e.connectorId})}),n.jsx("td",{className:D(Ut.cellBody,iE,"whitespace-nowrap"),children:zc(e.createdAt)??n.jsx(Ut.NullValue,{})}),n.jsx("td",{className:Ut.cellBody,children:e.isConnected?n.jsxs("span",{children:[n.jsx(Fn,{status:"connected"}),n.jsx("span",{className:"ml-2",children:"Online"})]}):n.jsxs("span",{children:[n.jsx(Fn,{status:"offline"}),n.jsx("span",{className:"ml-2",children:"Offline"})]})})]})}function ZQ({connectorId:e}){const{sockets:t,isLoading:r}=rE(e);return r?n.jsx(Ut.NullValue,{}):n.jsxs(n.Fragment,{children:[t.length," ",t.length===1?"service":"services"]})}function h6({title:e,values:t,selectedValue:r,onChange:s}){const a=t.find(i=>i.value===r);return n.jsx(br,{values:t,selected:a,onUpdateSelected:i=>s?.(i.value===r?void 0:i.value),children:n.jsxs("div",{className:"flex items-center gap-1 rounded-md border border-border-interactive px-3 py-1.5 hover:bg-bg-menu-item-hover",children:[n.jsx("span",{children:e}),a&&n.jsxs("span",{className:"font-medium",children:[": ",a.label]}),n.jsx(Nn,{size:18,className:"text-text-muted"})]})})}function QQ(){return n.jsx(fn,{className:"mt-12",icon:n.jsx(AF,{size:28}),title:"No connectors yet",description:"Add a connector to route traffic to your networks, apps, and services.",action:n.jsx(Vt,{intent:"primary",to:"/admin/pam_connectors/new",children:"Add connector"})})}const Ag="/public/tailnet/-/border0/provisioning";function JQ(e){const t=[];return(!e.hasTag||!e.hasServiceAutoApprove)&&t.push("add tag:border0-managed to your policy file’s tagOwners and enable auto approval for services"),e.hasBroadServiceGrant||t.push("add an ACL grant giving access to your services (for example a grant with dst tag:border0-managed)"),t.length>0?`Privileged Access Management enabled. To complete setup, ${t.join(", and ")}.`:"Privileged Access Management enabled."}function oE(){const{data:e,error:t,isLoading:r,mutate:s}=dt(Ag),[a,i]=f.useState(null),l=et(),u=f.useCallback(async()=>(i("enable"),e&&s({...e,enabled:!0,hasTag:!0,hasServiceAutoApprove:!0},!1),Ie.post(Ag).then(m=>{const p=m.data.data;s(p,!1),l.show({message:JQ(p)})}).catch(m=>{s(),l.show({message:m.response?.data?.error||"Failed to enable Border0 provisioning",variant:"danger"})}).finally(()=>i(null))),[e,s,l]),d=f.useCallback(async()=>(i("reprovision"),Ie.post(`${Ag}/reprovision-authorization`).then(m=>{s(m.data.data,!1),l.show({message:"Border0 OIDC client re-provisioned."})}).catch(m=>{s(),l.show({message:m.response?.data?.error||"Failed to re-provision Border0 client",variant:"danger"})}).finally(()=>i(null))),[s,l]);return{data:e,error:t,isLoading:r,isEnabling:a==="enable",isReprovisioning:a==="reprovision",enable:u,reprovision:d}}const XQ="p-4 md:p-6 border rounded-md";function eJ({id:e,readonly:t}){const{connector:r,isLoading:s,mutate:a}=nE(e),[i,l]=f.useState(!1);return s?n.jsx(De,{}):r?n.jsxs(mn,{className:"mb-24",children:[n.jsxs("header",{className:"pb-4 mb-8",children:[n.jsx(p6,{name:r.name}),n.jsxs("div",{className:"flex flex-wrap gap-2 items-center justify-between",children:[n.jsxs("div",{className:"flex gap-3 items-center",children:[n.jsx(is,{title:r.name,classes:D(Et.pageSubTitle,"truncate flex-shrink-0 max-w-full")}),n.jsx(Fn,{status:r.isConnected?"connected":"offline",size:"large"})]}),!t&&n.jsx(ue,{onClick:()=>l(!0),children:"Edit connector"})]})]}),n.jsx(tJ,{connector:r}),n.jsx(iJ,{id:e}),i&&n.jsx(lJ,{connector:r,open:i,onOpenChange:l,onSaved:()=>a()})]}):n.jsxs(mn,{className:"mb-24",children:[n.jsx(p6,{name:e}),n.jsx("p",{className:"mt-6",children:"Connector not found."})]})}function p6({name:e}){return n.jsxs("div",{className:"text-lg font-medium space-x-2 mb-5 truncate flex",children:[n.jsx(ze,{href:"/admin/pam_connectors",className:"link",children:"Connectors"}),n.jsx("span",{className:"breadcrumb-divider",children:"/"}),n.jsx("span",{className:"truncate",children:e})]})}function tJ({connector:e}){return n.jsxs("section",{className:"mb-8",children:[n.jsx("header",{className:"max-w-xl mb-4",children:n.jsx("h3",{className:D(Et.sectionTitle,"mb-2"),children:"Connector details"})}),n.jsxs("div",{className:D(XQ,"grid grid-cols-1 lg:grid-cols-2 gap-y-2 sm:gap-x-12"),children:[n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx(He,{label:"OS",children:e.os?`${e.os}${e.osVersion?` ${e.osVersion}`:""}`:n.jsx(kt,{})}),n.jsx(He,{label:"Host name",children:e.hostname||n.jsx(kt,{})}),n.jsx(He,{label:"Public IP",noTruncation:!0,children:e.ipAddress?n.jsx(Rn,{primaryActionValue:e.ipAddress,primaryActionSubject:"public IP address",children:e.ipAddress}):n.jsx(kt,{})}),(e.privateIpV4||e.privateIpV6)&&n.jsx(He,{label:"Private IP",noTruncation:!0,children:n.jsxs("div",{className:"flex flex-col gap-1",children:[e.privateIpV4&&n.jsx(Rn,{primaryActionValue:e.privateIpV4,primaryActionSubject:"private IP address",children:e.privateIpV4}),e.privateIpV6&&n.jsx(Rn,{primaryActionValue:e.privateIpV6,primaryActionSubject:"private IP address",children:e.privateIpV6})]})}),n.jsx(He,{label:"Version",children:e.version?`${e.version}${e.buildDate?` (${e.buildDate})`:""}`:n.jsx(kt,{})}),n.jsx(He,{label:"ID",noTruncation:!0,children:n.jsx(Rn,{primaryActionValue:e.connectorId,primaryActionSubject:"connector ID",children:e.connectorId})}),e.publicKey&&n.jsx(He,{label:"Public key",noTruncation:!0,children:n.jsx(Rn,{primaryActionValue:e.publicKey,primaryActionSubject:"public key",children:e.publicKey})})]}),n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx(He,{label:"Description",noTruncation:!0,children:e.description||n.jsx(kt,{})}),n.jsx(He,{label:"Last seen on",children:zc(e.lastSeenAt)??n.jsx(kt,{})}),n.jsx(He,{label:"Created on",children:zc(e.createdAt)??n.jsx(kt,{})}),n.jsx(He,{label:"Notifications",children:e.notificationsEnabled?`Enabled after ${Math.floor(e.notifyAfterSeconds/60)} minutes`:"Disabled"}),n.jsx(He,{label:"Tokens",children:n.jsxs(ze,{href:`/admin/pam_connectors/${e.connectorId}/tokens`,className:"link",children:[e.activeTokens," ",e.activeTokens===1?"token":"tokens"]})})]})]})]})}const lE="hidden md:table-cell",cE="text-right",nJ="tailscale.client.border0.com",rJ=new Set(["http","https","aws_access"]),sJ=new Set(["ssh","database","tls","vnc","kubernetes","rdp","aws_s3"]);function aJ(e,t){if(e.dnsname){if(rJ.has(e.socketType))return`https://${e.dnsname}`;if(sJ.has(e.socketType)){const r=e.socketType==="tls"?"nc":e.socketType==="aws_s3"?"aws/s3":e.socketType,s=t?`&org=${encodeURIComponent(t)}`:"";return`https://${nJ}/#/${r}/${e.dnsname}?autoLogin=yes${s}`}}}function iJ({id:e}){const{sockets:t,isLoading:r,error:s}=rE(e),{data:a}=oE();return n.jsxs("section",{className:"mb-8",children:[n.jsx("header",{className:"max-w-xl mb-4",children:n.jsx("h3",{className:D(Et.sectionTitle,"mb-2"),children:"Services"})}),n.jsx(Lv,{data:t,loading:r,error:s,errorMessage:"Error encountered loading services.",emptyDataMessage:"This connector isn’t serving any services yet.",columns:[{label:"Name"},{label:"Type",className:lE},{label:"Status"},{screenReaderDescription:"Connect",className:cE}],children:n.jsx("tbody",{children:t.map(i=>n.jsx(oJ,{socket:i,orgSubdomain:a?.orgSubdomain},i.socketId))})})]})}function oJ({socket:e,orgSubdomain:t}){const r=aJ(e,t);return n.jsxs("tr",{className:"border-b last:border-b-0",children:[n.jsx("td",{className:Ut.cellBody,children:n.jsx("p",{className:"font-semibold",children:e.name})}),n.jsx("td",{className:D(Ut.cellBody,lE),children:e.socketType||n.jsx(kt,{})}),n.jsx("td",{className:Ut.cellBody,children:e.alive?n.jsxs("span",{children:[n.jsx(Fn,{status:"connected"}),n.jsx("span",{className:"ml-2",children:"Connected"})]}):n.jsxs("span",{children:[n.jsx(Fn,{status:"offline"}),n.jsx("span",{className:"ml-2",children:"Disconnected"})]})}),n.jsx("td",{className:D(Ut.cellBody,cE),children:r&&e.alive&&n.jsxs("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"link inline-flex items-center gap-1",children:[n.jsx(zx,{size:16}),"Connect"]})})]})}function lJ({connector:e,open:t,onOpenChange:r,onSaved:s}){const a=et(),[i,l]=f.useState(e.name),[u,d]=f.useState(e.description),[m,p]=f.useState(e.builtInSshServiceEnabled),[g,v]=f.useState(!1),y=async()=>{v(!0);try{await RQ({connectorId:e.connectorId,name:i,description:u,builtInSshServiceEnabled:m}),s(),r(!1),a.show({message:n.jsxs(n.Fragment,{children:["Connector ",n.jsx("strong",{children:i})," has been edited."]})})}catch{a.show({variant:"danger",message:"Failed to edit connector."})}finally{v(!1)}};return n.jsx(Re,{open:t,onOpenChange:r,title:"Edit connector",position:"center-center",children:n.jsxs(Re.Form,{cancelButton:!0,submitButton:"Save",loading:g,disabled:!i.trim(),onSubmit:y,children:[n.jsx("label",{htmlFor:"connector-name",className:"block font-medium mb-1",children:"Name"}),n.jsx(ln,{id:"connector-name",className:"w-full mb-4",placeholder:"Enter name",value:i,onChange:C=>l(C.target.value)}),n.jsx("label",{htmlFor:"connector-description",className:"block font-medium mb-1",children:"Description"}),n.jsx(ln,{id:"connector-description",className:"w-full mb-4",placeholder:"Enter description",value:u,onChange:C=>d(C.target.value)}),n.jsx("div",{className:"mb-3",children:n.jsx(yr,{id:"connector-ssh",label:"Enable built-in SSH service",checked:m,onChange:p})})]})})}const Bo="hidden md:table-cell",uE="text-right";function cJ({id:e,readonly:t}){const{connector:r}=nE(e),{tokens:s,isLoading:a,error:i,mutate:l}=VQ(e),[u,d]=f.useState(!1);return n.jsxs(mn,{className:"mb-24",children:[n.jsxs("header",{className:"pb-4 mb-8",children:[n.jsxs("div",{className:"text-lg font-medium space-x-2 mb-5 truncate flex",children:[n.jsx(ze,{href:"/admin/pam_connectors",className:"link",children:"Connectors"}),n.jsx("span",{className:"breadcrumb-divider",children:"/"}),n.jsx(ze,{href:`/admin/pam_connectors/${e}`,className:"link",children:r?.name??e}),n.jsx("span",{className:"breadcrumb-divider",children:"/"}),n.jsx("span",{children:"Tokens"})]}),n.jsxs("div",{className:"flex flex-wrap gap-2 items-center justify-between",children:[n.jsx(uJ,{}),!t&&n.jsx(ue,{intent:"primary",onClick:()=>d(!0),children:"Add token"})]})]}),n.jsx(Lv,{data:s,loading:a,error:i,errorMessage:"Error encountered loading tokens.",emptyDataMessage:"This connector has no tokens yet.",columns:[{label:"Name"},{label:"ID",className:Bo},{label:"Expires on",className:Bo},{label:"Created on",className:Bo},{label:"Created by"},{screenReaderDescription:"Actions",className:uE}],children:n.jsx("tbody",{children:s.map(m=>n.jsx(dJ,{token:m,connectorId:e,readonly:t,onDeleted:()=>l()},m.id))})}),u&&n.jsx(fJ,{connectorId:e,open:u,onOpenChange:d,onCreated:()=>l()})]})}function uJ(){return n.jsx("h1",{className:D(Et.pageTitle),children:"Tokens"})}function dJ({token:e,connectorId:t,readonly:r,onDeleted:s}){const[a,i]=f.useState(!1);return n.jsxs("tr",{className:"border-b last:border-b-0",children:[n.jsx("td",{className:Ut.cellBody,children:n.jsx("span",{className:"font-semibold",children:e.name})}),n.jsx("td",{className:D(Ut.cellBody,Bo),children:n.jsx(Rn,{primaryActionValue:e.id,primaryActionSubject:"token ID",className:"truncate",children:e.id})}),n.jsx("td",{className:D(Ut.cellBody,Bo,"whitespace-nowrap"),children:zc(e.expiresAt)??"Does not expire"}),n.jsx("td",{className:D(Ut.cellBody,Bo,"whitespace-nowrap"),children:zc(e.createdAt)??n.jsx(kt,{})}),n.jsx("td",{className:Ut.cellBody,children:e.createdBy||n.jsx(kt,{})}),n.jsxs("td",{className:D(Ut.cellBody,uE),children:[!r&&n.jsx(el,{ariaLabel:`Actions for token ${e.name}`,side:"bottom",align:"end",items:[{type:"item",label:"Delete…",intent:"danger",onSelect:()=>i(!0)}]}),a&&n.jsx(mJ,{token:e,connectorId:t,open:a,onOpenChange:i,onDeleted:s})]})]})}function mJ({token:e,connectorId:t,open:r,onOpenChange:s,onDeleted:a}){const i=et(),[l,u]=f.useState(!1),d=async()=>{u(!0);try{await HQ(t,e.id),a(),s(!1),i.show({message:"1 token has been deleted."})}catch{i.show({variant:"danger",message:"Failed to delete token."})}finally{u(!1)}};return n.jsx(Re,{open:r,onOpenChange:s,title:`Delete token ${e.name}?`,position:"center-center",children:n.jsx(Re.Form,{destructive:!0,autoFocus:"cancel",cancelButton:!0,submitButton:"Delete token",loading:l,onSubmit:d,children:n.jsx("p",{children:"Any connector authenticating with this token will lose access. This can’t be undone."})})})}const Pg=[{type:"string-constant",label:"7 days",value:"7"},{type:"string-constant",label:"30 days",value:"30"},{type:"string-constant",label:"60 days",value:"60"},{type:"string-constant",label:"90 days",value:"90"},{type:"string-constant",label:"Never",value:""}];function fJ({connectorId:e,open:t,onOpenChange:r,onCreated:s}){const a=et(),[i,l]=f.useState(""),[u,d]=f.useState("30"),[m,p]=f.useState(!1),[g,v]=f.useState(null),y=Pg.find(b=>b.value===u)??Pg[1],C=async()=>{p(!0);try{const b=u?Math.floor(Date.now()/1e3)+Number(u)*86400:void 0,{token:w}=await $Q(e,i,b);s(),v(w),a.show({message:"1 token has been added."})}catch{a.show({variant:"danger",message:"Failed to create token."})}finally{p(!1)}};return g?n.jsx(Re,{open:t,onOpenChange:r,title:"Token created",position:"center-center",children:n.jsxs(Re.Form,{cancelButton:"Done",children:[n.jsx("p",{className:"mb-3",children:"Copy this token now. For security, it won’t be shown again."}),n.jsx(Xo,{text:g,className:"w-full",autoFocus:!0})]})}):n.jsx(Re,{open:t,onOpenChange:r,title:"Add token",position:"center-center",children:n.jsxs(Re.Form,{cancelButton:!0,submitButton:"Save",loading:m,disabled:!i.trim(),onSubmit:C,children:[n.jsx("label",{htmlFor:"token-name",className:"block font-medium mb-1",children:"Name"}),n.jsx(ln,{id:"token-name",className:"w-full mb-4",placeholder:"Enter name",value:i,onChange:b=>l(b.target.value)}),n.jsx("label",{htmlFor:"token-expiration",className:"block font-medium mb-1",children:"Expiration"}),n.jsx(br,{values:Pg,selected:y,onUpdateSelected:b=>d(b.value??"")})]})})}const hJ="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAAw1BMVEUcGBYhHRsvKyk+OjhNSEdXUlFgW1tlYGBqZWUwKykmIiA5NDNHQ0JRTUxbVlY0MC5WUlE5NTNMSEdDPz1IREJDPj45NTQhHBtWUVEvKyo+OThDPj0+OjlIQ0JSTUwrJiU0MC9bV1YrJyU4NTJVUU9xbmt/fHqNiogqJiRHQ0FjX12Ni4jGxMHx7+z//fqqp6Tj4N3U0s+bmJZ/fXqbmZa4trOqp6WcmJbj4N5xbmzU0c+4tbNGQ0FiX13Gw8GOioiAfHp7hlWDAAAJf0lEQVR4AezBAQEAAAQAIOD/ZQ8sqAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH5k9eyxdx+IzfJAGIQhwavXcm8E17T7n/Hv5esY5FUK89xgshRJSWwLkoKNqvtxcXNxMp3NTX+w+Wy6iO8nAeX9Mugbo9UtR3Q3NX3D1uN3kYC7pX5stLjRcDZBP2Sb6Jww65vA+P9iqyJZOQ36uXV8rwmM/y8Wfe7+/23eLAHlVu2mSdMxtbLolNByjSGaJNcB7XSVzVskoA66Tui5kiqXutLsIXsCdrrexvHu/IvF7AnMv4uN7/wli5kTmH83G9/5SxYzJmChruqim7k6mj9kS0AM6irEooutOptmS4CpO+tyh67Uw32mBGzVx9Tx9vxLiFkSENXPuLjWWr2MsiTA5DyflRLm452AlbznY0qYj3cCTM7zWclhPg4JHAE4zWcur/n4JwxAI+f57JVg7J/AFiDBQ/IWoMXUP4ElYIKD4wv6L8E/gTeA7wN0ryRj/4RhU5LQ/gA9KskmQ8KQ7eV9gzZKMsqQMGQnyfkNGpQkZEgYskppKs8l+l+iewJrQM8n9F6Jxu4JnAMnsKLFRIlW/glDFpQmeL+hdfBPGDKlct4FSkf/hCHjAuAC4AIYDtYArAHYBbAL4ByAcwBOAjkJ5HcB/C6A3wby28AyeG+hdkpy9E/oiVUgfxHEIqD2PmqwDAnDVnou0f9yVoIqewLvgA4u7uvMR/+E/tgHPHlfYvPsCTwCOjD3S6z2T8DeeTwJ87EcCWh8x5Mwn9o/Af3nE70vsSpPAs7qY+P9GUEW8ySgNHVn7sdNtX8Ccn3I3vldf04gau/9c/msjuZ5EsBnBYNPCwffF4CnoOuEuuilvOhKTZk/AXxnEM5qNy2L/l5MrWz/fhN4CDR756VG2JVvmYDanH92sUoZv38Cni7OP7u4s4Tx+ycg1o2+EZpTWdzOvjJ9w877d5SA/alqLEgK1lSnfVncWnw6X+YmSTa/nCfxAyYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIA3htff2bsPLUdtKIzjmmazve960hNJBhu4CNet9rz/U2WY9GT2ALq+EuF8vzf4+4IQuBk7T9N0bo1WIrLF0qa37HKRDSsBTF6U9JeySM2Jh28rR39TV1YPJAHMqqT/ctXiZNOfF3SPwmbxE8AU9DW1Pcn485K+oqz0YBMw/oazguO/U+l4CaALaggOaF1SC2fDJIDHdBqllZxOo9LsBI9jDLINdbNRnoyjTtwifALomrqqtd/ZSZ2tQyeAdtSd06q/nHrIwydg/rIvX0695CETIHPUj8vY63+LdcAE2FJfheplQb2ZYAmQU3+54PJ8x+lACbAgH0by9GwUgRLA0R25a6glL+sgCZCTn1TyAtAoswAJoImE57MjT2mABNiR8Hw0Cc9HPgELAGc+O/KWRk8Yvz0Jz0eXnPnIJ+AWwF/JuAXoZh45YfwMcRjVriCGQj4BW0CGlegFupGJJ+AKwPBe9ArQ+CCfgHsABi18flIVNWH8liR9gn4klvdRE8ZvRSR7Bc2IKYuZMH6fiGerWiyI6XPMhPH7SDy19AJNX8QTcBMgeYm2xPQhZsL4EZdqkRJTGihh/HAA4ADAAYADAAcADgBsArEJxG0gbgPxIAgPgvAoGI+CLXuBFr5E1yETBODt4ApvB4/4NsCJrzE2QAI2AYLnJ3cToOUTBgwfCj3EThi/Unr5nBODjZ0wfqn0tyoy1hdD5BPGTHo+WvoQqwIkeMMSUIkfYlo+Afzno6UPsSpEAqTk5yh9iDkdIgEyJ71/viEvNkwCGPHVsyAPVagEOPJXT/mfiRNMgIL62oovMgv5BDH4qVj+NuAmZII8/Fj0kb88CybIw8/FHwXnz0+Qhz+MuOGv/5IJsKdu9pnys3DUiTNREsCW1K68Ud70ljo46EgJoHeS02lYJzAdvwTwGNDBCB9j5TGLmwD2o/Brp3el4Pj5CWB2jv6rXBl1Itoe7h3OPBtIApj0UNJfysPRqJPSdveR/sZVNhtWAmhj52mazq3RSkS2WNr0ll0uMvkEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAICROTu/uLyaTJMkmU6uLi8eqJPTdrWtHd1y9Xa11MNJgLOL59PkX65ePFSnY1aO/sVVZhAJcP48ud/VM3USWV7SvVyuhROeeCdg/I3JC8Hx36n0YBMw/sbkoeT4G3m0BDh7nbR7rBiMo1ZOSye8UnCfh5PkjtwZlFMneYwEeDtNupl67qSygjraZsET4E3S3Svp/yRxOnwC5t/DK8n5N5wOn4D59/BKcv4NpwMmwLOkr7eqn5p6qrNgCfBwmvQ1faj62FBvm2AJMEn6m7xT3VnysA6UAC0PT/hPhHRJHkodJAEeJn4eqK525KUIkgCTxM+V6AWgYQIkwIskET5/HHkqwiRgAZA9fyx5MyES8AhA+Pz5SN6K6AnjN0sS2fPHEIMRT8AtAMe7TrcADCv5BGwBGb6R3AI2SvkEXAFkF1BDLCZ+wrglLNP2BTQlljR+wqhdJw3JTXRBLEX8hFH7LkmEr6AlsZTxE0btMuG5VC00MWnxBOwBJbdQhpiMeAKeAzNMVAtLTB+iJ4zaNOGZqhZzYpqLJ+AukEP0LrCRRk8YNRwAOABwAAwJ9gDYA+AuAHcBeA6A5wB4EogngXgvAO8F4N3AA94NFHU2lb6FSoklDZWAXSA+EYRNgMg3rEticPETRu4s4Xio2q2IoQqQ4A3XgB/EvxfwWT7BH+4DflJdFOStDpGAJUD4Iaohb1Y+Aa7F90+15Baw8RMnAWbSZ48hTzZEAlyL758L8lKFSYDvEx+vpH8jyOkwCXA2kV49b8iDlU+AUD+yt6fe9uES4K30/XNWU091mATAbwUDfi0c8H8B8FPnv9t4q7xkW+rokMknRID/DDpSJ8cBJ+CJ0OMz5W/hqJUzw03AIjC7VnfEFoHymMVMgLcT4ddO7zjjl0+An2bCr53eO8b45RPg4dv/vIDT2Xdn6nTMztG/uJUZUAJcf3c5+/3P92eX312f/qXTy9Wnj45uuY+fVlb/DxNG5tf24EAAAAAAAMj/tRFUVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVRVxob9XBwO7lQAAAABJRU5ErkJggg==",J0="hello.ts.net",pJ=new Set(["hello.ipn.dev",J0]);function gJ(e){const t=dE(e),{data:r,error:s,mutate:a}=dt(()=>t?null:"/invite/"+e),i=xJ(r,s);return t?{data:{node:{name:J0,hostname:J0,os:"Linux"},inviter:{id:"ts-services",displayName:"Tailscale Services",loginName:"services@tailscale.com",domainName:"tailscale.com",sharedDomain:!1,profilePicURL:hJ}},error:void 0,errorCode:void 0,mutate:a}:{data:r,error:s,errorCode:i,mutate:a}}function dE(e){return pJ.has(e)}function xJ(e,t){if(e)return e.acceptError?e.acceptError:void 0;if(!t)return;if(!t.response)return"unknown";switch(t.response.status){case 410:return"expired";case 404:return"notFound";case 500:return"serverError";default:return"unknown"}}const mE="mb-8 text-center max-w-sm mx-auto",fE="text-xl text-center font-medium tracking-tight";function vJ(e){const{data:t}=ot();return t?n.jsxs("main",{className:"max-w-lg mx-auto py-4 @md:py-8 w-[94%]",children:[n.jsxs("header",{className:"flex items-center justify-between mb-16",role:"navigation",children:[n.jsx(ze,{href:"/admin",asChild:!0,children:n.jsx("a",{children:n.jsx(Zo,{className:"w-6 h-6"})})}),n.jsxs("div",{className:"flex items-center space-x-2",children:[n.jsx("span",{children:t.loginName}),n.jsx(Lr,{user:t,sizeClassName:"w-8 h-8"})]})]}),n.jsx(yJ,{...e,currentUser:t})]}):null}function yJ(e){const{id:t}=e.params,{data:r,errorCode:s,mutate:a}=gJ(t),[,i]=ft(),l=et(),[u,d]=f.useState(!1);function m(v){v.preventDefault();const y=e.currentUser.needsOnboarding?"/admin/welcome":"/admin/machines?q=shared%3Ain";if(dE(t)){d(!0),Ie.post("/machines",{state:"add-external"}).then(()=>{d(!1),l.show({message:"Accepted invite to share machine"}),i(y)}).catch(()=>{l.show({message:"Failed to accept invite",variant:"danger"}),a().then(()=>{d(!1)})});return}d(!0),Ie.post("/public/device-invites/-/accept",{invite:t}).then(()=>{d(!1),l.show({message:"Accepted invite to share machine"}),i(y)}).catch(()=>{l.show({message:"Failed to accept invite",variant:"danger"}),a().then(()=>{d(!1)})})}function p(){Ie.post(`/invite/${t}/decline`),i("/admin/machines")}const g=s?CJ(s,r):void 0;return g?n.jsx(bJ,{title:g.title,description:g.description}):r?n.jsxs(f.Fragment,{children:[n.jsxs("section",{children:[n.jsxs("header",{className:mE,children:[n.jsx(Lr,{user:r.inviter,className:"mx-auto mb-2 shadow",sizeClassName:"w-12 h-12"}),n.jsxs("h2",{className:fE,children:[n.jsx("span",{className:"font-semibold",children:r.inviter.loginName})," ","wants to share a device with you"]})]}),n.jsxs("div",{className:"flex bg-gray-100 dark:bg-gray-900 rounded-md py-3 pl-3 pr-4 mb-6",children:[n.jsx(wJ,{className:"w-6 h-6 mr-2"}),n.jsxs("div",{children:[n.jsx("h4",{className:"font-medium",children:r.node.name}),n.jsx("h6",{children:pr(r.node.os)})]})]}),r.isReferral&&n.jsxs("p",{className:"mb-6",children:["As a thank you for helping share Tailscale more widely, you will both receive ",n.jsx("strong",{children:"2 additional devices"})," to your device limits!"]}),n.jsx("p",{className:"mb-6",children:"Your devices will be able to access this device. It will not be visible to other members of your network, and you can remove it at any time."}),r.acceptorClientNeedsUpdate&&n.jsxs(rt,{intent:"warning",className:"mb-4",children:["You have devices running an older version of Tailscale which may not be able to access this machine. Please"," ",n.jsx("a",{className:"link-underline",href:"https://tailscale.com/kb/1067/update/",target:"_blank",rel:"noopener noreferrer",children:"update"})," ","your devices to the latest version of Tailscale."]}),n.jsx("h4",{className:"font-semibold mb-2",children:"Permissions"}),n.jsxs("ul",{className:"leading-loose",children:[n.jsxs("li",{children:[n.jsx(nn,{className:"inline mr-2 text-text-success",size:"1.25em"}),n.jsx("span",{className:"font-medium",children:"Can read"})," your email address and avatar"]}),n.jsxs("li",{children:[n.jsx(nn,{className:"inline mr-2 text-text-success",size:"1.25em"}),n.jsx("span",{className:"font-medium",children:"Can read"})," physical IP addresses of your devices on Tailscale"]}),n.jsxs("li",{children:[n.jsx(nn,{className:"inline mr-2 text-text-success",size:"1.25em"}),n.jsx("span",{className:"font-medium",children:"Can respond"})," to connections you initiate"]}),n.jsxs("li",{children:[n.jsx(Or,{className:"inline mr-2 text-red-400",size:"1.25em"}),n.jsx("span",{className:"font-medium",children:"Cannot initiate"})," new connections to your network"]})]}),r.includeExitNode&&n.jsx("p",{className:"mt-4",children:"You are also allowed to use this device as an exit node. Make sure you trust this user, as a shared exit node could capture your unencrypted traffic."})]}),n.jsxs("footer",{className:"mt-8 flex justify-between items-center",children:[n.jsx(Zn,{type:"usersAndDomain",className:"link-underline",children:"Report"}),n.jsxs("form",{action:"",onSubmit:m,children:[n.jsx(ue,{onClick:p,disabled:u,children:"Decline"}),n.jsx(ue,{intent:"primary",type:"submit",className:"ml-2",loading:u,children:"Accept invite"})]})]})]}):null}function bJ({title:e,description:t}){return n.jsxs("section",{className:"max-w-md mx-auto",children:[n.jsx("header",{className:mE,children:n.jsx("h2",{className:fE,children:e})}),n.jsx("p",{className:"text-center mb-6",children:t}),n.jsx("p",{className:"text-center mb-6",children:n.jsx(ze,{to:"/admin",className:"link-underline",children:"Return home"})})]})}function CJ(e,t){switch(e){case"notFound":case"expired":return{title:"This invite is no longer valid",description:"The link you followed has expired or already been used. Please contact whoever invited you to request a new invite."};case"sameDomain":return{title:"You can’t accept this invite",description:"This invite is for a machine already in your network. You already have access, or if you don’t, an ACL rule is restricting your access. Sharing is only for users outside your network."};case"notAuthorized":return{title:"You can’t accept this invite",description:"You don’t have permission to accept this invite. Contact an admin of your network for help."};case"alreadyAccepted":return{title:"This machine is already shared with you",description:n.jsxs(f.Fragment,{children:["This machine",t?` (${t.node.name})`:""," is already in your network. You can find it in"," ",n.jsx(ze,{to:"/admin/machines?q=shared%3Ain",className:"link-underline",children:"your machines page"}),"."]})};default:return{title:"Failed to load invite",description:n.jsxs(f.Fragment,{children:["We’re sorry. It seems we weren’t able to load your invite. Please try again later, or"," ",n.jsx(Zn,{type:"usersAndDomain",className:"link-underline",children:"contact our team"})," ","for help if the issue persists."]})}}}function wJ(e){const{className:t,iconSize:r,...s}=e;return n.jsx("div",{className:D("rounded-full bg-orange-400 dark:bg-orange-400/10 text-white dark:text-orange-0 inline-flex justify-center items-center",t),...s,children:n.jsx(ol,{size:r||"0.75em",strokeWidth:"2.4"})})}function xn(e){const{className:t,children:r,text:s,prompt:a=!0,copySuccessMessage:i="Copied to clipboard",copyFailureMessage:l="Failed to copy to clipboard",onClickCallback:u,allowWrap:d}=e,m=et(),[p,g]=Ai(!1,{timeout:750}),v=y=>{y.preventDefault(),g(!0),Rr(s).then(()=>{m.show({message:i}),u!==void 0&&u()}).catch(()=>{m.show({message:l,variant:"danger"})})};return n.jsxs("div",{className:D("relative flex items-center rounded-md max-w-full","select-text","transition-colors","bg-gray-50 dark:bg-gray-700","dark:border dark:border-border-interactive","overflow-hidden",t),"aria-label":`Copy ${s} to your clip board.`,children:[n.jsx("pre",{className:D("overflow-hidden pl-3 pr-10 py-3"),children:n.jsx("code",{className:D({"before:mr-2 before:text-text-muted before:content-['$'] flex":a,"whitespace-pre-wrap":d}),children:r||s})}),n.jsx("div",{className:D("absolute top-0 right-0 bottom-0 pl-12 pr-1.5",{"bg-gradient-to-r from-transparent via-gray-50 to-gray-50 dark:via-gray-700 dark:to-gray-700":!d}),children:n.jsx(ue,{className:D("!p-2 rounded","enabled:hover:bg-gray-200 enabled:dark:hover:bg-gray-500/20",{"mt-1.5":d,"relative top-1/2 -translate-y-1/2":!d}),onClick:v,iconOnly:!0,suffixIcon:p?n.jsx(nn,{}):n.jsx(Lc,{}),variant:"minimal",sizeVariant:"small"})})]})}xn.defaultProps={variant:"light"};const _ce=Object.freeze(Object.defineProperty({__proto__:null,default:xn},Symbol.toStringTag,{value:"Module"})),Ii={productArea:K.Machines,productSubArea:oe.ExitNodeQuickstart},X0="https://tailscale.com/kb/1103/exit-nodes",jJ="https://tailscale.com/kb/1104/enable-ip-forwarding",SJ=new Set(["linux","macOS","windows","iOS","android","tvOS"]);function kJ(e){return SJ.has(e)}function g6(e){const{id:t}=e,{data:r,error:s,handleAction:a,isPosting:i}=sn({refreshInterval:p=>{const g=p?.machines.find(v=>v.addresses.includes(t??""));return g&&g.advertisedExitNode&&!g.brokenIPForwarding?0:5e3}}),{access:l}=qt(de.DeviceRouting),u=Sn(l);f.useEffect(()=>{window.scrollTo(0,0)},[]),f.useEffect(()=>{O(R.ExitNodeQuickstartPageViewed,{eventProperties:Ii},{once:!0})},[]);const d=t?r?.machines.find(p=>p.addresses.includes(t)):void 0,m=f.useCallback(p=>{d&&(O(R.ExitNodeQuickstartAllowRoutingToggled,{eventProperties:{...Ii,type:p?"enable":"disable"}}),a("set-route-settings",d,{allowedIPs:d.allowedIPs,allowedExitNode:p}))},[a,d]);return s?n.jsx(De,{error:s}):r?t&&!d?n.jsx(De,{error:{message:`no machine found at ${t}`}}):d?n.jsx(NJ,{machine:d,canWriteRouting:u,isPosting:i,onToggleExitNode:m}):n.jsx(De,{error:{message:"no machine specified"}}):n.jsx(De,{loadingMessage:"Loading machine..."})}function NJ({machine:e,canWriteRouting:t,isPosting:r,onToggleExitNode:s}){const a=n.jsx("b",{children:e.name});return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"text-lg font-medium space-x-2 mb-5 truncate flex",children:[n.jsx(ze,{href:"/admin/machines",className:"link",children:"All Machines"}),n.jsx("span",{className:"breadcrumb-divider",children:"/"}),n.jsx(ze,{href:`/admin/machines/${e.addresses[0]}`,className:"link",onClick:()=>O(R.ExitNodeQuickstartBackToMachinesClicked,{eventProperties:Ii}),children:e.name}),n.jsx("span",{className:"breadcrumb-divider",children:"/"}),n.jsx("span",{children:"Set up exit node"})]}),n.jsx(is,{classes:"text-3xl mt-6 font-semibold",title:"Set up exit node"}),n.jsxs("p",{className:"mt-4 max-w-2xl",children:["Easily route all your internet traffic through ",a,". For more details, see the"," ",n.jsx("a",{className:"link",href:X0,target:"_blank",rel:"noopener noreferrer",onClick:()=>O(R.ExitNodeQuickstartDocsLinkClicked,{eventProperties:Ii}),children:"full exit node docs"}),"."]}),n.jsxs("div",{className:"max-w-2xl flex flex-col gap-8 pt-8",children:[n.jsxs(Tg,{number:1,title:"Advertise your machine as an exit node",description:n.jsxs(n.Fragment,{children:["On ",a," (",pr(e.os),"), advertise it as an exit node."]}),children:[n.jsx(EJ,{machine:e}),n.jsx(AJ,{machine:e})]}),n.jsx(Tg,{number:2,title:"Enable your exit node",children:n.jsx(TJ,{machine:e,canWriteRouting:t,isPosting:r,onToggle:s})}),n.jsx(Tg,{number:3,title:n.jsxs(n.Fragment,{children:["Use ",a," as an exit node"]}),description:n.jsxs(n.Fragment,{children:["Once enabled, go to the Tailscale client on your other devices and choose an exit node to route traffic through."," ",n.jsx("a",{className:"link",href:X0,target:"_blank",rel:"noopener noreferrer",children:"Learn more"})]}),children:e.allowedExitNode&&e.advertisedExitNode&&!e.brokenIPForwarding&&n.jsxs(rt,{intent:"success",children:["You're ready to use ",a," as an exit node!"]})})]}),n.jsx(IJ,{})]})}function EJ({machine:e}){switch(e.os){case"linux":return n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx("p",{children:"On the machine, run the following command:"}),n.jsx(xn,{text:`sudo tailscale set --advertise-exit-node sudo tailscale up`,className:"w-full",allowWrap:!0,onClickCallback:()=>O(R.ExitNodeQuickstartAdvertiseCommandCopied,{eventProperties:Ii})})]});case"macOS":return n.jsxs("p",{children:["Open the Tailscale menu bar app, go to ",n.jsx("b",{children:"Exit Nodes"}),", and select"," ",n.jsx("b",{children:"Run as exit node…"})]});case"windows":return n.jsxs("p",{children:["Open the Tailscale system tray menu, go to ",n.jsx("b",{children:"Exit nodes"}),", and select ",n.jsx("b",{children:"Run as exit node…"})]});case"android":case"iOS":case"tvOS":return n.jsxs("p",{children:["Open the Tailscale app, go to the ",n.jsx("b",{children:"Exit Node"})," section, and select"," ",n.jsx("b",{children:"Run as exit node"}),"."]});default:return n.jsxs("p",{children:["See the"," ",n.jsx("a",{className:"link",href:X0,target:"_blank",rel:"noopener noreferrer",children:"Exit Nodes docs"})," ","for instructions on advertising this device as an exit node."]})}}function AJ({machine:e}){const{advertisedExitNode:t,brokenIPForwarding:r}=e;return t?r?n.jsx(PJ,{machine:e}):n.jsxs("div",{className:"flex items-center gap-2 text-text-success",children:[n.jsx(nn,{size:18}),n.jsxs("span",{children:[n.jsx("b",{children:e.name})," is advertising as an exit node."]})]}):n.jsxs("div",{className:"flex items-center gap-2 text-text-muted",children:[n.jsx(ts,{size:"sm"}),n.jsxs("span",{children:["Waiting for ",n.jsx("b",{children:e.name})," to start advertising as an exit node…"]})]})}function PJ({machine:e}){return e.brokenIPForwarding?n.jsx(rt,{title:"IP forwarding is disabled",intent:"warning",children:n.jsxs("p",{children:["This machine has IP forwarding disabled and cannot relay traffic. Please"," ",n.jsx("a",{className:"link",href:jJ,target:"_blank",rel:"noopener noreferrer",onClick:()=>O(R.ExitNodeQuickstartFixIPForwardingLinkClicked,{eventProperties:Ii}),children:"enable IP forwarding on this machine"})," ","before enabling it as an exit node."]})}):null}function TJ({machine:e,canWriteRouting:t,isPosting:r,onToggle:s}){const{advertisedExitNode:a=!1,allowedExitNode:i=!1,brokenIPForwarding:l=!1}=e,[u,d]=f.useState(i);f.useEffect(()=>{d(i)},[i]);const p=r||!t||!i&&!(a&&!l),g=u!==i;let v="";return!a&&i&&(v="This machine is not advertised as an exit node. Uncheck it to disable exit node routing or readvertise the machine following the instructions in step 1."),n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsxs("div",{className:"relative",children:[n.jsx(yr,{id:"exit-node",label:`Allow exit node routing for ${e.name}`,labelClassName:"font-medium",checked:u,onChange:d,disabled:p}),n.jsx("p",{className:"pl-6 text-sm text-text-muted",children:"Check this to allow traffic to be routed through this machine."})]}),v&&n.jsx(rt,{intent:"warning",children:v}),n.jsx("div",{children:n.jsx(ue,{intent:"primary",sizeVariant:"small",disabled:!g||p,loading:r,onClick:()=>s(u),children:"Save"})})]})}function IJ(){return n.jsxs("section",{className:"max-w-2xl mt-8 pt-8 border-t",children:[n.jsx("h2",{className:"text-xl font-medium",children:"Going further"}),n.jsx("p",{className:"mt-4",children:"Once you've set up an exit node, try these next:"}),n.jsxs("ul",{className:"mt-3 flex flex-col gap-2 list-disc pl-5",children:[n.jsx(lm,{useCaseKey:"auto-approvers",title:"auto approvers",description:"Use autoApprovers in your tailnet policy to skip manual route approval for trusted users or tags.",url:"https://tailscale.com/kb/1337/policy-syntax#auto-approvers"}),n.jsx(lm,{useCaseKey:"lan-access",title:"local network access",description:"Enable Allow Local Network Access so connecting devices can still reach their own local network while using this exit node.",url:"https://tailscale.com/kb/1103/exit-nodes#local-network-access"}),n.jsx(lm,{useCaseKey:"grants",title:"grants",description:"Scope which users or groups can use this exit node using grants in your tailnet policy file.",url:"https://tailscale.com/kb/1458/grant-examples"}),n.jsx(lm,{useCaseKey:"suggested-exit-nodes",title:"suggested exit nodes",description:"Use suggested exit nodes to let Tailscale automatically pick the best exit node by location.",url:"https://tailscale.com/kb/1103/exit-nodes"})]})]})}function lm({useCaseKey:e,title:t,description:r,url:s}){return n.jsxs("li",{children:[r," ",n.jsx(Ge,{url:s,kbTopic:t,onClick:()=>{O(R.ExitNodeQuickstartGoingFurtherClicked,{eventProperties:{...Ii,type:e}})}})]})}function Tg({number:e,title:t,description:r,children:s}){return n.jsxs("section",{className:"flex gap-3",children:[n.jsx("div",{className:"shrink-0 w-8 h-8 rounded-full border flex items-center justify-center font-semibold",children:e}),n.jsxs("div",{className:"flex-1 flex flex-col gap-3",children:[n.jsx("h2",{className:"font-semibold text-xl leading-8",children:t}),r&&n.jsx("p",{children:r}),s]})]})}function DJ(){const{data:e,error:t,mutate:r}=dt("/dns"),[s,a]=f.useState(!1),i=et();function l(u,d){a(!0),r(u,!1),Ie.post("/dns",u).then(m=>m.data.data).then(m=>{r(m,!1),d&&i.show({message:"Updated connector DNS settings."}),a(!1)}).catch(m=>{const p=m.response?.data?.error;i.show({message:"Failed to update DNS settings"+(p===void 0?"":": "+p),variant:"danger"}),r(),a(!1)})}return{data:e,error:t,mutate:r,updateConnectorDNSSettings:l,isPosting:s}}function cm(e,t){switch(t.type){case"route:add":{const r={...e},{route:s,existing:a}=t;if(s.searchDomain)return r.domains.includes(s.searchDomain)||(r.domains=[...r.domains,s.searchDomain]),r.routes={...r.routes,[s.searchDomain]:x6(r.routes[s.searchDomain]||[],s,a)},r;const i=s.fallback?"fallbackResolvers":"resolvers";return r[i]=x6(r[i]||[],s,a),r}case"route:update":{if(!t.existing)return cm(e,{type:"route:add",route:t.route});if(t.existing.searchDomain!==t.route.searchDomain){const r=cm(e,{type:"route:add",route:t.route,existing:t.existing});return cm(r,{type:"route:remove",routes:[t.existing]})}else if(t.existing.resolver!==t.route.resolver||t.existing.useWithExitNode!==t.route.useWithExitNode)return cm(e,{type:"route:add",route:t.route,existing:t.existing});return e}case"route:remove":{const r={...e},{routes:s}=t;return s.forEach(a=>{if(a.searchDomain){const m=[...r.routes[a.searchDomain]||[]].filter(p=>p.address!==a.resolver);return r.routes={...r.routes,[a.searchDomain]:m},m.length===0&&(delete r.routes[a.searchDomain],r.domains=[...r.domains].filter(p=>p!==a.searchDomain)),r}const i=a.fallback?"fallbackResolvers":"resolvers",u=[...r[i]||[]].filter(d=>d.address!==a.resolver);r[i]=u}),r}case"toggle:resolvers":{const r={...e};return t.to==="global"&&r.fallbackResolvers.length>0?(r.resolvers=[...r.fallbackResolvers],r.fallbackResolvers=[]):t.to==="fallback"&&r.resolvers.length>0&&(r.fallbackResolvers=[...r.resolvers],r.resolvers=[]),r}case"magicdns:enable":return{...e,magicDNS:!0};case"magicdns:disable":return{...e,magicDNS:!1};default:return t}}function x6(e,t,r){const s=r&&{address:r.resolver,useWithExitNode:r.useWithExitNode},a={address:t.resolver,useWithExitNode:t.useWithExitNode},i=[...e],l=r&&r.searchDomain===t.searchDomain?i.findIndex(u=>u.address===s?.address):-1;return l===-1?i.push(a):i[l]=a,i}function Mce(e){return Object.keys(e.routes).some(t=>(e.routes[t]||0).length>0)}function _J(e,t,r){const s=structuredClone(e);return Object.entries(e.routes).forEach(([a,i])=>{!t.has(a)&&i.some(l=>l.address===r)&&(i.length===1?(delete s.routes[a],s.domains=s.domains.filter(l=>l!==a)):s.routes[a]=s.routes[a].filter(l=>l.address!==r))}),t.forEach(a=>{s.routes[a]?s.routes[a].some(i=>i.address===r)||s.routes[a].push({address:r}):(s.routes[a]=[{address:r}],s.domains.push(a))}),s}function jh(){return dt("/public/tailnet/-/dns/preferences")}const Sa={productArea:K.Machines,productSubArea:oe.SSHQuickstart},MJ="https://tailscale.com/docs/features/tailscale-ssh";function v6(e){const{id:t}=e,{data:r,error:s}=sn(),{data:a}=jh(),i=a?.magicDNS||!1,l=t?r?.machines.find(v=>v.addresses.includes(t)):void 0;if(t&&s)return n.jsx(De,{error:s});if(t&&!r)return n.jsx(De,{loadingMessage:"Loading machine..."});if(t&&!l)return n.jsx(De,{error:{message:`no machine found at ${t}`}});const d=`ssh ${l?Mv(l,i)||l.addresses[0]:"machine-name"}`,m=l?`Tailscale makes it easy to SSH to ${l.name} from other devices on your tailnet - here’s how to get started.`:"Tailscale makes it easy to SSH to other devices on your tailnet - here’s how to get started.",p=l?`On ${l.name}, run this command. It tells the Tailscale daemon to handle incoming SSH on port 22.`:"On the machine you want to SSH into, run this command. It tells the Tailscale daemon to handle incoming SSH on port 22.",g=l?`From another device on your tailnet, run this command to SSH into ${l.name}.`:"From the source device, SSH using the destination’s MagicDNS hostname (or its 100.x.y.z Tailscale IP).";return n.jsxs(n.Fragment,{children:[l?n.jsxs("div",{className:"text-lg font-medium space-x-2 mb-5 truncate flex",children:[n.jsx(ze,{href:"/admin/machines",className:"link",children:"All Machines"}),n.jsx("span",{className:"breadcrumb-divider",children:"/"}),n.jsx(ze,{href:`/admin/machines/${l.addresses[0]}`,className:"link",onClick:()=>O(R.SSHQuickstartBackToMachinesClicked,{eventProperties:Sa}),children:l.name}),n.jsx("span",{className:"breadcrumb-divider",children:"/"}),n.jsx("span",{children:"SSH quickstart"})]}):n.jsxs(ze,{href:"/admin/machines",className:"flex link items-center",onClick:()=>O(R.SSHQuickstartBackToMachinesClicked,{eventProperties:Sa}),children:[n.jsx(Li,{className:"pr-1",size:20}),"Back to All Machines"]}),n.jsx(is,{classes:"text-3xl mt-6 font-semibold",title:"Tailscale SSH quickstart"}),n.jsxs("p",{className:"mt-4 max-w-2xl",children:[m," For more details, read the"," ",n.jsx("a",{className:"link",href:MJ,target:"_blank",rel:"noopener noreferrer",onClick:()=>O(R.SSHQuickstartDocsLinkClicked,{eventProperties:Sa}),children:"full Tailscale SSH docs"}),"."]}),n.jsxs("div",{className:"max-w-2xl flex flex-col gap-8 pt-8",children:[n.jsx(Ig,{number:1,title:"Enable Tailscale SSH",description:p,children:n.jsx(xn,{text:"tailscale set --ssh",className:"w-full",allowWrap:!0,onClickCallback:()=>O(R.SSHQuickstartEnableCommandCopied,{eventProperties:Sa})})}),n.jsx(Ig,{number:2,title:"Allow SSH in your tailnet policy",description:"Your tailnet policy file needs a rule that permits SSH between your devices. Click below to add the default rule that lets every member SSH to their own devices.",children:n.jsx(RJ,{})}),n.jsx(Ig,{number:3,title:"Connect",description:g,children:n.jsx(xn,{text:d,className:"w-full",allowWrap:!0,onClickCallback:()=>O(R.SSHQuickstartConnectCommandCopied,{eventProperties:Sa})})})]}),n.jsx(LJ,{})]})}function LJ(){return n.jsxs("section",{className:"max-w-2xl mt-8 pt-8 border-t",children:[n.jsx("h2",{className:"text-xl font-medium",children:"Going further"}),n.jsx("p",{className:"mt-4",children:"Other ways to get more out of Tailscale SSH:"}),n.jsxs("ul",{className:"mt-3 flex flex-col gap-2 list-disc pl-5",children:[n.jsx(um,{useCaseKey:"check-mode",title:"Check mode",description:"Use Check mode to re-authenticate with your IdP on a schedule before SSH sessions",url:"https://tailscale.com/kb/1193/tailscale-ssh#configure-tailscale-ssh-with-check-mode"}),n.jsx(um,{useCaseKey:"session-recording",title:"Session recording",description:"Record SSH sessions to a recorder node for auditing and compliance purposes",url:"https://tailscale.com/kb/1246/tailscale-ssh-session-recording"}),n.jsx(um,{useCaseKey:"ssh-console",title:"SSH from your browser",description:"SSH to open a terminal from the admin console without needing a local client",url:"https://tailscale.com/kb/1216/tailscale-ssh-console"}),n.jsx(um,{useCaseKey:"restrict-access",title:"Restrict who can SSH where",description:"Scope SSH by user, group, tag, or destination instead of the default allow-self rule",url:"https://tailscale.com/kb/1337/policy-syntax#ssh"})]})]})}function um({useCaseKey:e,title:t,description:r,url:s}){return n.jsxs("li",{children:[r," ",n.jsx(Ge,{url:s,kbTopic:t,onClick:()=>{O(R.SSHQuickstartAdvancedUseCaseClicked,{eventProperties:{...Sa,type:e}})}}),"."]})}function Ig({number:e,title:t,description:r,children:s}){return n.jsxs("section",{className:"flex gap-3",children:[n.jsx("div",{className:"shrink-0 w-8 h-8 rounded-full border flex items-center justify-center font-semibold",children:e}),n.jsxs("div",{className:"flex-1 flex flex-col gap-3",children:[n.jsx("h2",{className:"font-semibold text-xl leading-8",children:t}),n.jsx("p",{children:r}),s]})]})}function RJ(){const{data:e,error:t,applyPatches:r}=Eu(),{access:s}=qt(de.ACLs),a=Sn(s),i=et(),[l,u]=f.useState(!1),d=f.useCallback(()=>{O(R.SSHQuickstartAddDefaultRuleClicked,{eventProperties:Sa}),u(!0),r([{type:"add-default-ssh"}]).then(()=>{i.show({message:"Added default SSH rule to your policy file"})}).catch(()=>{i.show({message:"Error enabling SSH",variant:"danger"})}).finally(()=>{u(!1)})},[r,i]);return t?n.jsx(De,{error:t}):e?e.sshEnabled?n.jsxs("div",{className:"flex items-center gap-2 text-text-muted",children:[n.jsx(nn,{className:"text-green-400",size:18}),n.jsx("span",{children:"Tailscale SSH is already allowed by your policy file."})]}):n.jsxs("div",{className:"flex flex-col gap-2 items-start",children:[n.jsx(ue,{intent:"primary",loading:l,onClick:d,disabled:!a,children:"Add default SSH rule"}),a?n.jsxs("p",{className:"text-text-muted text-sm",children:["Or edit the policy file yourself in"," ",n.jsx(ze,{href:"/admin/acls",className:"link",onClick:()=>O(R.SSHQuickstartAccessControlsLinkClicked,{eventProperties:Sa}),children:"Access controls"}),"."]}):n.jsx("p",{className:"text-text-muted text-sm",children:"You don’t have permission to edit your tailnet’s policy file. Ask a tailnet admin to add the default SSH rule."})]}):n.jsx(De,{loadingMessage:"Loading policy file..."})}const Pa={productArea:K.Machines,productSubArea:oe.SubnetRouterQuickstart},ex="https://tailscale.com/kb/1019/subnets",OJ="https://tailscale.com/kb/1104/enable-ip-forwarding",So="10.0.0.0/24",FJ=new Set(["0.0.0.0/0","::/0"]),BJ=new Set(["linux","macOS","windows","android","tvOS"]);function UJ(e){return BJ.has(e)}function Wv(e){return(e.advertisedIPs??[]).filter(t=>!FJ.has(t))}function y6(e){const{id:t}=e,{data:r,error:s,handleAction:a,isPosting:i}=sn({refreshInterval:g=>{const v=g?.machines.find(y=>y.addresses.includes(t??""));return v&&Wv(v).length>0&&!v.brokenIPForwarding?0:5e3}}),{access:l}=qt(de.DeviceRouting),u=Sn(l),[,d]=ft();f.useEffect(()=>{window.scrollTo(0,0)},[]),f.useEffect(()=>{O(R.SubnetRouterQuickstartPageViewed,{eventProperties:Pa},{once:!0})},[]);const m=t?r?.machines.find(g=>g.addresses.includes(t)):void 0,p=f.useCallback(g=>{m&&(O(R.SubnetRouterQuickstartSaved,{eventProperties:Pa}),a("set-route-settings",m,{allowedIPs:g,allowedExitNode:m.allowedExitNode}),d(`/admin/machines/${m.addresses[0]}`))},[a,m,d]);return s?n.jsx(De,{error:s}):r?t&&!m?n.jsx(De,{error:{message:`no machine found at ${t}`}}):m?n.jsx(VJ,{machine:m,canWriteRouting:u,isPosting:i,onSave:p}):n.jsx(De,{error:{message:"no machine specified"}}):n.jsx(De,{loadingMessage:"Loading machine..."})}function VJ({machine:e,canWriteRouting:t,isPosting:r,onSave:s}){const a=n.jsx("b",{children:e.name});return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"text-lg font-medium space-x-2 mb-5 truncate flex",children:[n.jsx(ze,{href:"/admin/machines",className:"link",children:"All Machines"}),n.jsx("span",{className:"breadcrumb-divider",children:"/"}),n.jsx(ze,{href:`/admin/machines/${e.addresses[0]}`,className:"link",onClick:()=>O(R.SubnetRouterQuickstartBackToMachinesClicked,{eventProperties:Pa}),children:e.name}),n.jsx("span",{className:"breadcrumb-divider",children:"/"}),n.jsx("span",{children:"Set up subnet router"})]}),n.jsx(is,{classes:"text-3xl mt-6 font-semibold",title:"Set up subnet router"}),n.jsxs("p",{className:"mt-4 max-w-2xl",children:["Set up this machine, ",a,", to reach devices on a network – including ones that don't have Tailscale installed. For more details, see the"," ",n.jsx("a",{className:"link",href:ex,target:"_blank",rel:"noopener noreferrer",onClick:()=>O(R.SubnetRouterQuickstartDocsLinkClicked,{eventProperties:Pa}),children:"full Subnet Routers docs"}),"."]}),n.jsxs("div",{className:"max-w-2xl flex flex-col gap-8 pt-8",children:[n.jsxs(b6,{number:1,title:"Advertise subnet routes from your machine",description:n.jsxs(n.Fragment,{children:["On ",a," (",pr(e.os),"), advertise the IP ranges you want to make available to your tailnet."]}),children:[n.jsx($J,{machine:e,onCommandCopied:()=>O(R.SubnetRouterQuickstartAdvertiseCommandCopied,{eventProperties:Pa})}),n.jsx(HJ,{machine:e,onFixForwardingClick:()=>O(R.SubnetRouterQuickstartFixIPForwardingLinkClicked,{eventProperties:Pa})})]}),n.jsx(b6,{number:2,title:"Approve your subnet routes",description:"Once your machine is advertising subnet routes, approve the ones you want your tailnet to use.",children:n.jsx(zJ,{machine:e,canWriteRouting:t,isPosting:r,onSave:s})})]}),n.jsx(WJ,{})]})}function $J({machine:e,onCommandCopied:t}){switch(e.os){case"linux":return n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsxs("p",{children:["On the machine, run the following command, replacing"," ",So," with your own network range (you can pass a comma-separated list of ranges):"]}),n.jsx(xn,{text:`sudo tailscale set --advertise-routes=${So} sudo tailscale up`,className:"w-full",allowWrap:!0,onClickCallback:t}),n.jsxs("p",{children:["Linux subnet routers also need IP forwarding enabled; see the"," ",n.jsx("a",{className:"link",href:ex,target:"_blank",rel:"noopener noreferrer",children:"setup docs"})," ","for details."]})]});case"macOS":return n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsxs("p",{children:["On the machine, run the following command, replacing"," ",n.jsx("code",{children:So})," with your own network range. IP forwarding is enabled automatically on macOS."]}),n.jsx(xn,{text:`sudo tailscale set --advertise-routes=${So}`,className:"w-full",allowWrap:!0,onClickCallback:t})]});case"windows":return n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsxs("p",{children:["In an elevated command prompt on the machine, run the following, replacing ",n.jsx("code",{children:So})," with your own network range:"]}),n.jsx(xn,{text:`tailscale set --advertise-routes=${So}`,className:"w-full",allowWrap:!0,onClickCallback:t})]});case"android":case"tvOS":return n.jsxs("p",{children:["Open the Tailscale app, go to the ",n.jsx("b",{children:"Subnet routes"})," section, and add the IP ranges you want to advertise."]});default:return n.jsxs("p",{children:["See the"," ",n.jsx("a",{className:"link",href:ex,target:"_blank",rel:"noopener noreferrer",children:"Subnet Routers docs"})," ","for instructions on advertising subnet routes from this device."]})}}function HJ({machine:e,onFixForwardingClick:t}){const r=Wv(e);return r.length===0?n.jsxs("div",{className:"flex items-center gap-2 text-text-muted",children:[n.jsx(ts,{size:"sm"}),n.jsxs("span",{children:["Waiting for ",n.jsx("b",{children:e.name})," to start advertising subnet routes…"]})]}):e.brokenIPForwarding?n.jsx(hE,{machine:e,onFixForwardingClick:t}):n.jsxs("div",{className:"flex items-center gap-2 text-text-success",children:[n.jsx(nn,{size:18}),n.jsxs("span",{children:[n.jsx("b",{children:e.name})," is advertising"," ",r.length===1?"1 subnet route":`${r.length} subnet routes`,"."]})]})}function hE({machine:e,className:t,onFixForwardingClick:r}){return e.brokenIPForwarding?n.jsx(rt,{title:"IP forwarding is disabled",intent:"warning",className:t,children:n.jsxs("p",{children:["This machine has IP forwarding disabled and cannot relay traffic to its subnets. Please"," ",n.jsx("a",{className:"link",href:OJ,target:"_blank",rel:"noopener noreferrer",onClick:r,children:"enable IP forwarding on this machine"})," ","before approving its subnet routes."]})}):null}function zJ({machine:e,canWriteRouting:t,isPosting:r,onSave:s}){const a=Wv(e),i=e.brokenIPForwarding??!1,[l,u]=f.useState(()=>new Set(e.allowedIPs??[])),d=[...e.allowedIPs??[]].sort().join(",");f.useEffect(()=>{u(new Set(e.allowedIPs??[]))},[d]);const m=f.useCallback((b,w)=>{O(R.SubnetRouterQuickstartRouteCheckboxChanged,{eventProperties:{...Pa,type:w?"approve":"unapprove"}}),u(N=>{const k=new Set(N);return w?k.add(b):k.delete(b),k})},[u]);let p="";t?i&&(p="This device cannot relay traffic until IP forwarding is enabled. See the warning above."):p="You don’t have permission to configure subnet routes. Ask a tailnet admin to approve these.";const g=r||!t||i,v=new Set(e.allowedIPs??[]),y=l.size!==v.size||![...l].every(b=>v.has(b)),C=n.jsx("div",{className:"mt-8 flex gap-3",children:n.jsx(ue,{intent:"primary",onClick:()=>s([...l]),disabled:g||!y,children:"Save"})});return a.length===0?n.jsx("div",{className:"flex flex-col",children:n.jsx(at,{empty:!0,children:n.jsxs("div",{className:"text-center text-text-muted",children:[n.jsx("p",{className:"font-semibold",children:"No routes detected"}),n.jsx("p",{children:"Once you’ve advertised them with the command above, they’ll appear here"})]})})}):n.jsxs("div",{className:"flex flex-col",children:[n.jsx("div",{className:"flex flex-col gap-3",children:a.map(b=>n.jsx(yr,{id:`subnet-route-${b}`,label:b,checked:l.has(b),onChange:w=>m(b,w),disabled:g},b))}),p&&n.jsx("p",{className:"mt-3 text-sm text-text-muted",children:p}),C]})}function WJ(){return n.jsxs("section",{className:"max-w-2xl mt-8 pt-8 border-t",children:[n.jsx("h2",{className:"text-xl font-medium",children:"Going further"}),n.jsx("p",{className:"mt-4",children:"Once you've set up your subnet router, try these next:"}),n.jsxs("ul",{className:"mt-3 flex flex-col gap-2 list-disc pl-5",children:[n.jsx(dm,{useCaseKey:"auto-approvers",title:"auto approvers",description:"Use autoApprovers in your tailnet policy to skip manual route approval for trusted users or tags.",url:"https://tailscale.com/kb/1337/policy-syntax#auto-approvers"}),n.jsx(dm,{useCaseKey:"acls",title:"access rules",description:"Add access rules to your tailnet policy so the right users and devices can reach the advertised subnets.",url:"https://tailscale.com/kb/1019/subnets#add-access-rules-for-the-advertised-subnet-routes"}),n.jsx(dm,{useCaseKey:"high-availability",title:"high availability",description:"Run multiple subnet routers advertising the same routes for automatic failover.",url:"https://tailscale.com/kb/1115/high-availability"}),n.jsx(dm,{useCaseKey:"site-to-site",title:"site-to-site networking",description:"Connect two or more separate networks together using subnet routers.",url:"https://tailscale.com/kb/1214/site-to-site"})]})]})}function dm({useCaseKey:e,title:t,description:r,url:s}){return n.jsxs("li",{children:[r," ",n.jsx(Ge,{url:s,kbTopic:t,onClick:()=>{O(R.SubnetRouterQuickstartGoingFurtherClicked,{eventProperties:{...Pa,type:e}})}})]})}function b6({number:e,title:t,description:r,children:s}){return n.jsxs("section",{className:"flex gap-3",children:[n.jsx("div",{className:"shrink-0 w-8 h-8 rounded-full border flex items-center justify-center font-semibold",children:e}),n.jsxs("div",{className:"flex-1 flex flex-col gap-3",children:[n.jsx("h2",{className:"font-semibold text-xl leading-8",children:t}),n.jsx("p",{children:r}),s]})]})}function KJ(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var C6={exports:{}},hc={};var w6;function GJ(){if(w6)return hc;w6=1;var e=ce,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function l(u,d,m){var p,g={},v=null,y=null;m!==void 0&&(v=""+m),d.key!==void 0&&(v=""+d.key),d.ref!==void 0&&(y=d.ref);for(p in d)s.call(d,p)&&!i.hasOwnProperty(p)&&(g[p]=d[p]);if(u&&u.defaultProps)for(p in d=u.defaultProps,d)g[p]===void 0&&(g[p]=d[p]);return{$$typeof:t,type:u,key:v,ref:y,props:g,_owner:a.current}}return hc.Fragment=r,hc.jsx=l,hc.jsxs=l,hc}var j6;function qJ(){return j6||(j6=1,C6.exports=GJ()),C6.exports}var pE=qJ(),S6={exports:{}};var k6;function YJ(){return k6||(k6=1,(function(e){(function(){var t={}.hasOwnProperty;function r(){for(var i="",l=0;l{const s=()=>{r(i=>(i+1)%4)},a=globalThis.setInterval(s,500);return()=>{globalThis.clearInterval(a)}},[]),n.jsxs(n.Fragment,{children:[e,".".repeat(t)]})}function Kv(e,t){const[r,s]=f.useState(0),a=Math.ceil(e.length/t);f.useEffect(()=>{const p=Math.ceil(e.length/t);s(g=>nX(g,0,p-1))},[e.length,t]);const i=()=>{r{r>0&&s(r-1)},u=()=>{r>0&&s(0)},d=()=>{r{const p=r*t,g=(r+1)*t;return e.slice(p,g)},[r,e,t]),currentPage:r,pageCount:a,nextPage:i,previousPage:l,isFirstPage:r===0,isLastPage:r===a-1,jumpToFirst:u,jumpToLast:d}}function nX(e,t,r){return Math.min(Math.max(e,t),r)}function rX(e){const{open:t,machineId:r,onOpenChange:s}=e,{data:a,isPosting:i,handleAction:l}=sn(),{data:u,updateConnectorDNSSettings:d}=DJ(),m=a?.machines.find(B=>B.id===r),[p,g]=f.useState(m?.allowedExitNode||!1),[v,y]=f.useState([]),[C,b]=f.useState(new Set),[w,N]=f.useState({invalidDomains:new Set,allDomainsInvalid:!1}),k=f.useMemo(()=>a?.machines.filter(B=>B.app==="sniproxy").map(B=>B.addresses[0]),[a?.machines]),E=f.useCallback(B=>{const W=new Set(C),U=new Set;B.forEach(Z=>{m?.addresses[0]&&u?.routes[Z]&&!u.routes[Z].every(re=>k?.includes(re.address))?U.add(Z):W.add(Z)}),b(W),N({invalidDomains:U,allDomainsInvalid:B.length>0&&U.size===B.length})},[C,m?.addresses,u?.routes,k]),T=f.useCallback(B=>{const W=new Set(C);W.delete(B),b(W)},[C]);f.useEffect(()=>{m&&(y([...m.allowedIPs.map(B=>({ip:B,allowed:!0})),...m.extraIPs.map(B=>({ip:B,allowed:!1}))].sort((B,W)=>B.ipv.filter(B=>B.allowed).map(B=>B.ip),[v]),I=f.useMemo(()=>u&&m&&_J(u,C,m.addresses[0]),[u,C,m]),F=f.useMemo(()=>!$m(_,m?.allowedIPs),[_,m?.allowedIPs]),z=f.useMemo(()=>!$m(I,u),[u,I]),H=f.useMemo(()=>!!m?.allowedExitNode!==p,[p,m?.allowedExitNode]),J=F||z||H,Y=()=>{const B=F||H;m&&B&&l("set-route-settings",m,{allowedIPs:v.filter(W=>W.allowed).map(W=>W.ip),allowedExitNode:p}),I&&z&&d(I,m?.app==="sniproxy"||!B)};return n.jsx(Re,{open:t,title:`Edit route settings of ${m?.name||"this device"}`,onOpenChange:s,children:m&&n.jsx(Re.Form,{disabled:!J,cancelButton:"Cancel",submitButton:"Save",onSubmit:()=>{Y(),s(!1)},children:m.app==="sniproxy"?n.jsxs(n.Fragment,{children:[n.jsxs("p",{children:["SNIProxy nodes route traffic directed to specific domains through themselves in order for the traffic to come from their egress ip. SNIProxy nodes cannot be subnet routers or exit nodes."," ",n.jsx(Ge,{kbTopic:"subnet routers",url:"https://tailscale.com/kb/1342/app-connectors-setup"})]}),n.jsx(N6,{className:"mt-6",machine:m,disabled:i,updateAllowedIPs:y,allowedIPs:v}),n.jsx(lX,{className:"mt-6",domainsList:C,addToDomainsSet:E,deleteFromDomainsSet:T,machine:m,invalidDomainsStatus:w})]}):n.jsxs(n.Fragment,{children:[n.jsx(vE,{machine:m}),n.jsx(Gv,{className:"mt-6",machine:m}),n.jsx(N6,{className:"mt-6",machine:m,disabled:i,updateAllowedIPs:y,allowedIPs:v}),n.jsx(oX,{className:"mt-6",machine:m,disabled:i,exitNodeStatus:p,updateAllowedExitNode:g})]})})})}function sX(e,t){const r=new Set;return Object.entries(e.routes).forEach(([s,a])=>{a.some(i=>i.address===t)&&r.add(s)}),r}function aX({allowedNotAdvertisedCount:e,notAllowedAdvertisedCount:t}){if(t===0&&e===0)return null;let r;if(t>0){const s=t>1?"routes are":"route is",a=e>1?"routes are":"route is";r=n.jsx("p",{children:`${t} ${s} advertised but not approved${e?`, and ${e} ${a} approved but not advertised anymore`:""}`})}else if(e>0){const s=e>1?"routes are":"route is";r=n.jsx("p",{children:`${e} ${s} approved but not advertised anymore`})}return n.jsx("div",{children:r})}function N6(e){const{className:t,machine:r,disabled:s,updateAllowedIPs:a,allowedIPs:i}=e,{advertisedIPs:l,hasSubnets:u}=r,[d,m]=f.useState(E6[0]),{filteredIPs:p,hasAllowedIPs:g,hasAllowedAllIPs:v,allowedNotAdvertisedCount:y,notAllowedAdvertisedCount:C}=f.useMemo(()=>{let W=0,U=0,Z=!1,re=!0,me=[];d.value==="all"&&(me=i);const L=new Set(l);for(const V of i)V.allowed?(Z=!0,d.value==="approved"&&me.push(V),L.has(V.ip)||W++):(re=!1,d.value==="unapproved"&&me.push(V),L.has(V.ip)&&U++);return{filteredIPs:me,hasAllowedIPs:Z,hasAllowedAllIPs:re,allowedNotAdvertisedCount:W,notAllowedAdvertisedCount:U}},[l,i,d.value]),b=f.useCallback(()=>{a(i.map(W=>({ip:W.ip,allowed:!0})))},[i,a]),w=f.useCallback(()=>{a(i.map(W=>({ip:W.ip,allowed:!1})))},[i,a]),N=f.useCallback(W=>()=>{a(i.map(U=>U.ip===W?{ip:U.ip,allowed:!U.allowed}:U))},[i,a]),k=100,E=i.length>k,{pageData:T,currentPage:_,pageCount:I,nextPage:F,previousPage:z,jumpToFirst:H,jumpToLast:J,isFirstPage:Y,isLastPage:B}=Kv(p,k);return n.jsxs("div",{className:t,children:[n.jsx("h3",{className:"font-semibold mb-2",children:"Subnet routes"}),n.jsxs("p",{className:"mb-3",children:["Connect to devices you can’t install Tailscale on by advertising IP ranges as subnet routes."," ",n.jsx(Ge,{kbTopic:"subnet routers",url:"https://tailscale.com/kb/1019/subnets"})]}),C||y?n.jsx(rt,{className:"mb-3",intent:"warning",icon:!1,children:n.jsx(aX,{allowedNotAdvertisedCount:y,notAllowedAdvertisedCount:C})}):null,n.jsx("div",{children:u?n.jsxs(n.Fragment,{children:[E?n.jsx("div",{className:"mb-2",children:n.jsx(br,{values:E6,selected:d,onUpdateSelected:m,placeholder:"Select...",disabled:s,variant:"minimal"})}):null,n.jsxs("div",{children:[T.length===0&&d.value!=="all"?n.jsx(at,{empty:!0,children:n.jsx(fn,{description:"No routes match this filter."})}):null,T.map(W=>n.jsx(iX,{ip:W.ip,advertised:l.includes(W.ip),allowed:W.allowed,disabled:s,toggleApproval:N(W.ip)},W.ip))]}),I>1?n.jsxs("div",{className:"py-4 border-b flex items-center font-medium",children:[n.jsx(ue,{type:"button",sizeVariant:"small",variant:"minimal",iconOnly:!0,disabled:Y,onClick:H,children:n.jsx(sw,{})}),n.jsx(ue,{type:"button",sizeVariant:"small",variant:"minimal",iconOnly:!0,disabled:Y,onClick:z,children:n.jsx(Li,{})}),n.jsxs("span",{className:"mx-2",children:["Page ",_+1," of ",I]}),n.jsx(ue,{type:"button",sizeVariant:"small",variant:"minimal",iconOnly:!0,disabled:B,onClick:F,children:n.jsx(js,{})}),n.jsx(ue,{type:"button",sizeVariant:"small",variant:"minimal",iconOnly:!0,disabled:B,onClick:J,children:n.jsx(aw,{})})]}):null,l.length>1&&n.jsxs("div",{className:"flex-1 flex items-center pt-2",children:[n.jsx(ue,{intent:"base",className:"mr-2",disabled:!g,onClick:w,sizeVariant:"small",type:"button",children:"Unapprove all"}),n.jsx(ue,{disabled:v,onClick:b,sizeVariant:"small",type:"button",intent:"base",children:"Approve all"})]})]}):n.jsx(at,{empty:!0,children:n.jsx(fn,{description:"This machine does not expose any routes."})})})]})}const E6=[{label:"Show all routes",type:"string-constant",value:"all"},{label:"Only approved routes",type:"string-constant",value:"approved"},{label:"Only unapproved routes",type:"string-constant",value:"unapproved"}];function iX(e){const{ip:t,advertised:r,allowed:s,disabled:a,toggleApproval:i}=e;return n.jsxs("li",{className:xE,children:[n.jsx("div",{children:n.jsx(yr,{id:t,className:"block mr-3",label:t,checked:s,onChange:i,disabled:a||s&&!r})}),n.jsx("div",{className:D("flex items-center",{"text-text-muted":!r}),children:!r&&n.jsx(Ee,{content:n.jsxs("span",{children:["This device no longer advertises this subnet route. Remove the route here, or re-run"," ",n.jsx("code",{className:bf,children:"tailscale up --advertise-routes"})," ","with ",n.jsx("code",{className:bf,children:t})," included."]}),children:n.jsx(Oa,{className:"mx-2 text-red-400",size:16,strokeWidth:"2"})})}),s&&!r&&n.jsx(ue,{type:"button",intent:"base",className:"ml-auto text-sm py-1 px-2 min-w-0",sizeVariant:"small",onClick:i,children:"Remove"})]})}const xE="flex items-center py-2 border-t h-11";function oX(e){const{className:t,machine:r,disabled:s,updateAllowedExitNode:a,exitNodeStatus:i}=e,{advertisedExitNode:l,allowedExitNode:u=!1,hasExitNode:d}=r;return n.jsxs("div",{className:t,children:[n.jsx("h3",{className:"font-semibold flex items-center mb-2",children:"Exit node"}),n.jsxs("p",{className:"mb-3",children:["Allow your network to route internet traffic through this machine."," ",n.jsx(Ge,{kbTopic:"exit nodes",url:"https://tailscale.com/kb/1103/exit-nodes"})]}),n.jsxs("div",{className:"flex items-center",children:[n.jsx(yr,{id:"exit-node",className:"mr-3",label:"Use as exit node",checked:i,onChange:()=>a(!i),disabled:s||!d}),!l&&n.jsx(Ee,{content:n.jsxs("span",{children:["This device",u?` no longer advertises itself as an exit node. Disable its exit node status here, or re-run `:" does not advertise itself as an exit node. Re-run ",n.jsx("code",{className:bf,children:"tailscale up"})," with the"," ",n.jsx("code",{className:bf,children:"--advertise-exit-node"})," flag",!u&&" to enable this option","."]}),children:u?n.jsx(Oa,{className:"text-text-danger",size:16}):n.jsx(bs,{size:16})})]})]})}const bf="bg-gray-200 dark:bg-gray-600 text-sm";function Gv(e){const{className:t,machine:r}=e,{allowedIPs:s,allowedExitNode:a,neverExpires:i}=r;return(s.length>0||a)&&!i?n.jsx(rt,{className:t,title:"Key expiry is enabled",intent:"warning",children:n.jsxs("p",{children:["If this machine’s"," ",n.jsx("a",{className:"link",href:"https://tailscale.com/kb/1028/key-expiry",target:"_blank",rel:"noreferrer noopener",children:"key expires"}),", your relayed traffic may be interrupted until you reauthenticate."]})}):null}function vE(e){const{className:t,machine:r}=e,{brokenIPForwarding:s}=r;return s?n.jsx(rt,{className:t,title:"Unable to relay traffic",intent:"warning",children:n.jsxs("p",{children:["This machine has IP forwarding disabled and cannot relay traffic. Please"," ",n.jsx("a",{className:"link",href:"https://tailscale.com/kb/1104/enable-ip-forwarding",target:"_blank",rel:"noreferrer noopener",children:"enable IP forwarding on this machine"})," ","to use relay features like subnets or exit nodes."]})}):null}function lX(e){const{className:t,domainsList:r,addToDomainsSet:s,deleteFromDomainsSet:a,machine:i,invalidDomainsStatus:l}=e,[u,d]=f.useState(""),m=f.useRef(null),p=g=>{g.key==="Enter"&&(g.preventDefault(),s(r9(u)),d(""))};return n.jsxs("div",{className:t,children:[n.jsx("h3",{className:"font-semibold flex items-center",children:"Domains"}),n.jsxs("p",{className:"mt-2",children:[i.app==="sniproxy"?"Entries will be added as Split DNS entries in the ":"A list of domains to route through this connector. Entries will be added as Split DNS entries in the ",n.jsx(ze,{to:"/admin/dns",children:"DNS settings page"}),"."," ",n.jsx(Ge,{kbTopic:"domains",url:"https://tailscale.com/kb/1342/app-connectors-setup"})]}),n.jsxs("div",{className:"flex mt-3",children:[n.jsx(ln,{className:"flex-1",id:"domains",value:u,onChange:({target:g})=>d(g.value),onKeyDown:p,ref:m}),n.jsx(ue,{className:"ml-2",type:"button",onClick:()=>{s(r9(u)),d(""),m.current?.focus()},children:"Add"})]}),n.jsx("p",{className:"text-text-muted mt-2",children:"Separate domains with commas to add more than one at a time."}),l.invalidDomains.size>0&&n.jsx(rt,{className:"mt-2",intent:"error",icon:!1,children:n.jsxs("p",{children:[`${l.allDomainsInvalid?"Couldn’t add":"Skipped adding"} `,n.jsx("strong",{children:Array.from(l.invalidDomains).join(", ")}),` because ${l.invalidDomains.size>1?"they’re":"it’s"} already in use by another Split DNS entry.`]})}),n.jsx("div",{className:"mt-2",children:Array.from(r).map(g=>n.jsxs("li",{className:xE,children:[n.jsx("p",{children:g}),n.jsx(ue,{intent:"base",className:"ml-auto text-sm",variant:"minimal",sizeVariant:"small",type:"button",onClick:()=>a(g),iconOnly:!0,children:n.jsx(Or,{className:"text-text-muted"})})]},g))})]})}const A6={productArea:K.Machines,productSubArea:oe.ExitNodeDialog};function cX(e){const{open:t,machineId:r,onOpenChange:s}=e,{data:a,isPosting:i,handleAction:l}=sn(),u=a?.machines.find(C=>C.id===r),[d,m]=f.useState(!1);f.useEffect(()=>{m(u?.allowedExitNode||!1)},[u]);const p=f.useMemo(()=>!!u&&d!==(u.allowedExitNode||!1),[u,d]),g=f.useCallback(C=>{O(R.ExitNodeDialogAllowRoutingChanged,{eventProperties:{...A6,type:C?"enable":"disable"}}),m(C)},[m]),v=f.useCallback(()=>{!u||!p||(O(R.ExitNodeDialogSaved,{eventProperties:A6}),l("set-route-settings",u,{allowedIPs:u.allowedIPs,allowedExitNode:d}))},[u,p,d,l]),y=u&&!u.advertisedExitNode&&u.allowedExitNode?"This machine is not advertised as an exit node. Uncheck it to disable exit node routing or readvertise the machine following the exit node docs.":"";return n.jsx(Re,{open:t,title:`Edit exit node settings of ${u?.name||"this device"}`,onOpenChange:s,onPointerDownOutside:C=>{C.preventDefault()},children:u&&n.jsxs(Re.Form,{disabled:!p,cancelButton:"Cancel",submitButton:"Save",onSubmit:()=>{v(),s(!1)},children:[n.jsxs("p",{children:["Allow your network to route internet traffic through this machine."," ",n.jsx(Ge,{kbTopic:"exit nodes",url:"https://tailscale.com/kb/1103/exit-nodes"})]}),n.jsx(vE,{className:"mt-6",machine:u}),n.jsx(Gv,{className:"mt-6",machine:u}),n.jsxs("div",{className:"mt-6 flex flex-col gap-3",children:[n.jsxs("div",{className:"relative",children:[n.jsx(yr,{id:"exit-node",label:`Allow exit node routing for ${u.name}`,labelClassName:"font-medium",checked:d,onChange:g,disabled:i}),n.jsx("p",{className:"pl-6 text-sm text-text-muted",children:"Check this to allow traffic to be routed through this machine."})]}),y&&n.jsx(rt,{intent:"warning",children:y})]})]})})}function uX(e){const{open:t,machineId:r,onOpenChange:s}=e,{data:a,isPosting:i,handleAction:l}=sn(),u=a?.machines.find(m=>m.id===r);function d(m){u&&l("set-tags",u,{tags:m}).then(()=>s(!1))}return n.jsx(Re,{open:t,onOpenChange:s,title:`Edit ACL tags for ${u?.name||"this device"}`,children:u&&n.jsx(dX,{machine:u,isPosting:i,onUpdateTags:d,closeDialog:()=>s(!1)})})}function dX(e){const{machine:t,isPosting:r,onUpdateTags:s,closeDialog:a}=e,{allowedTags:i}=t,{loaded:l,error:u,aclTags:d}=$i(),[,m]=ft(),[p,g]=f.useState(i),v=f.useMemo(()=>p.filter(y=>!d.all.has(y)),[p,d]);return n.jsxs(Re.Form,{loading:r,disabled:Vm(p,i)||v.length>0||p.length===0,cancelButton:!0,submitButton:"Save",onSubmit:()=>s(p),children:[n.jsxs("p",{children:[t.hasTags?n.jsxs(n.Fragment,{children:["Manage access to this machine by adding and removing tags. If you want a user to own this device, have them reauthenticate it. Make sure to update your ACLs accordingly."," "]}):n.jsxs(n.Fragment,{children:["Assigning tags will change the ownership of"," ",n.jsx("strong",{children:t.name})," from"," ",n.jsx("strong",{children:t.user})," to the tag(s) you select. Make sure to update your ACLs accordingly."," "]}),n.jsx(Ge,{kbTopic:"ACL tags",url:"https://tailscale.com/kb/1068/acl-tags"})]}),l?i.length===0&&d.all.size===0?n.jsxs(at,{className:"mt-4 mb-5 flex flex-col items-center",empty:!0,children:[n.jsx(fn,{className:"max-w-[250px]",description:"No tags defined. Define tags from the Access controls page"}),n.jsx(ue,{className:"mt-4",sizeVariant:"small",onClick:()=>{a(),m("/admin/acls/visual/tags")},children:"Go to Access controls"})]}):n.jsx(Iv,{className:"mt-4",tags:p,updateTags:g,disabled:r}):n.jsx(De,{error:u}),p.length===0&&t.hasTags&&n.jsx(rt,{className:"mt-6",intent:"warning",icon:!1,children:"You can’t save your changes because the only way to remove all tags from a machine is to reauthenticate it. The user who reauthenticates the machine will become its manager."}),v.length>0&&!Vm(p,i)&&n.jsxs(rt,{className:"mt-6",intent:"warning",icon:!1,children:["You can’t save your changes until all invalid tags are either removed or defined once again in"," ",n.jsx("a",{href:"/admin/acls",className:"link",target:"_blank",children:"the tailnet policy file"}),"."]})]})}function mX(e){const{machineId:t,open:r,onDelete:s,onOpenChange:a}=e,{data:i,handleAction:l}=sn(),u=i?.machines.find(p=>p.id===t),d=u?.name??"this device";function m(){u&&(l(u.isExternal?"remove-external":"delete-node",u)?.then(()=>{O(R.MachineRemoved,{eventProperties:{productArea:K.Machines}})}),a(!1),s?.())}return n.jsx(Re,{open:r,onOpenChange:a,title:`Remove ${d}`,restoreFocus:!1,children:n.jsx(Re.Form,{destructive:!0,cancelButton:!0,submitButton:"Remove machine",onSubmit:m,children:u&&n.jsxs(n.Fragment,{children:[n.jsx("p",{children:u.isExternal?"This machine will permanently be removed from your network. To re-add it, the owner will need to invite you again.":"This machine will permanently be removed from your network. To re-add it, you will need to re-authenticate to your tailnet from the device."}),u.acceptedShareCount>0&&n.jsxs(rt,{intent:"warning",className:"mt-4",children:["Access will also be removed for ",u.acceptedShareCount," ",yt("user",u.acceptedShareCount)," outside your network."]}),n.jsxs("p",{className:"text-text-muted mt-4",children:["Hold ",fX()," while clicking “Remove” to skip this confirmation."]})]})})})}function fX(){return yw()?"Alt":TF()?"the Option key":"Alt/Option"}function hX(e){const{machineId:t,open:r,onOpenChange:s}=e,{data:a,handleAction:i}=sn(),l=a?.machines.find(d=>d.id===t);function u(){l&&(i("extend-node-key",l),s(!1))}return n.jsx(Re,{open:r,onOpenChange:s,title:`Temporarily extend key for ${l?.name||"this device"}`,children:l&&n.jsx(pX,{machine:l,onSubmit:u})})}function pX(e){const{machine:t,onSubmit:r}=e;return n.jsxs(Re.Form,{destructive:!0,cancelButton:!0,submitButton:"Extend key",onSubmit:r,children:[n.jsx("p",{className:"mb-4",children:"This machine’s key has expired, and is no longer accessible via your Tailscale network."}),n.jsxs("p",{className:"mb-6",children:["You can extend the expired key to"," ",t.user&&`let ${t.user}`," regain access and re-authenticate the machine."]})]})}function gX(e){const{open:t,machineId:r,onOpenChange:s,onRenumber:a}=e,{data:i,isPosting:l,handleAction:u}=sn(),d=i?.machines.find(m=>m.id===r);return n.jsx(Re,{open:t,title:`Edit machine IP for ${d?.name||"this device"}`,onOpenChange:s,children:d?n.jsx(xX,{machine:d,isPosting:l,updateDeviceIPv4:m=>u("set-ipv4",d,{ipv4:m},p=>{throw p}).then(p=>(O(R.MachineIPv4Updated,{eventProperties:{productArea:K.Machines}}),s(!1),a?.(p?.addresses[0]||""),p)),onOpenChange:s}):n.jsx(De,{loadingMessage:"Loading machine...",error:i&&i.machines.length>0&&!d?{message:"Machine not found"}:void 0})})}function xX(e){const{machine:t,isPosting:r,onOpenChange:s,updateDeviceIPv4:a}=e,{addresses:i}=t,l=i.find(Hm)||"",[u,d]=f.useState(l),[m,p]=f.useState("");f.useEffect(()=>d(l),[l]);const v=!m&&u!==l,y=f.useCallback(({target:b})=>{const{value:w,selectionStart:N,selectionEnd:k}=b,E=w.replaceAll(/[^\d.]/g,"");b.value=E,b.selectionStart=N,b.selectionEnd=k,d(E),p("")},[]);function C(){if(!WN(u)){p("Invalid IP address");return}const w=k=>p(ml(k.message)),N=k=>{const T=k?.addresses?.find(Hm);if(T!==void 0){d(T);return}s(!1)};return a(u).then(N).catch(w)}return n.jsxs(Re.Form,{disabled:!v,loading:r,cancelButton:!0,submitButton:"Update IP",onSubmit:C,children:[n.jsx("p",{className:"mb-6",children:"This is the IP address that will be used to connect to this machine."}),n.jsx(rt,{intent:"warning",children:"This action will break any existing connections to this machine. You will need to reconnect to this machine using the new IP address. You may also need to flush your DNS cache."}),n.jsx("label",{htmlFor:"machine-ip",className:"block font-medium mt-4 mb-2",children:"Machine IP"}),n.jsx("div",{className:"flex mb-2",children:n.jsx(ln,{className:"w-full z-10",type:"text",id:"machine-ip",value:u,onChange:y,disabled:r})}),m&&n.jsx("p",{className:"text-text-danger mb-2",children:m})]})}function yE({machineId:e,refreshInterval:t}){const{data:r}=Rt(),{data:s,error:a}=dt(()=>r?.tailnetLockEnabled&&e?`/public/device/${e}/tailnet-lock`:null,{refreshInterval:t});return{data:s,error:a}}var Sh="Tabs",[vX]=Cr(Sh,[lh]),bE=lh(),[yX,qv]=vX(Sh),CE=f.forwardRef((e,t)=>{const{__scopeTabs:r,value:s,onValueChange:a,defaultValue:i,orientation:l="horizontal",dir:u,activationMode:d="automatic",...m}=e,p=oh(u),[g,v]=Mr({prop:s,onChange:a,defaultProp:i??"",caller:Sh});return n.jsx(yX,{scope:r,baseId:qn(),value:g,onValueChange:v,orientation:l,dir:p,activationMode:d,children:n.jsx(tt.div,{dir:p,"data-orientation":l,...m,ref:t})})});CE.displayName=Sh;var wE="TabsList",jE=f.forwardRef((e,t)=>{const{__scopeTabs:r,loop:s=!0,...a}=e,i=qv(wE,r),l=bE(r);return n.jsx(jj,{asChild:!0,...l,orientation:i.orientation,dir:i.dir,loop:s,children:n.jsx(tt.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});jE.displayName=wE;var SE="TabsTrigger",kE=f.forwardRef((e,t)=>{const{__scopeTabs:r,value:s,disabled:a=!1,...i}=e,l=qv(SE,r),u=bE(r),d=AE(l.baseId,s),m=PE(l.baseId,s),p=s===l.value;return n.jsx(Sj,{asChild:!0,...u,focusable:!a,active:p,children:n.jsx(tt.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":m,"data-state":p?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:d,...i,ref:t,onMouseDown:je(e.onMouseDown,g=>{!a&&g.button===0&&g.ctrlKey===!1?l.onValueChange(s):g.preventDefault()}),onKeyDown:je(e.onKeyDown,g=>{[" ","Enter"].includes(g.key)&&l.onValueChange(s)}),onFocus:je(e.onFocus,()=>{const g=l.activationMode!=="manual";!p&&!a&&g&&l.onValueChange(s)})})})});kE.displayName=SE;var NE="TabsContent",EE=f.forwardRef((e,t)=>{const{__scopeTabs:r,value:s,forceMount:a,children:i,...l}=e,u=qv(NE,r),d=AE(u.baseId,s),m=PE(u.baseId,s),p=s===u.value,g=f.useRef(p);return f.useEffect(()=>{const v=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(v)},[]),n.jsx(En,{present:a||p,children:({present:v})=>n.jsx(tt.div,{"data-state":p?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":d,hidden:!v,id:m,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:v&&i})})});EE.displayName=NE;function AE(e,t){return`${e}-trigger-${t}`}function PE(e,t){return`${e}-content-${t}`}var bX=CE,CX=jE,wX=kE,jX=EE;function Tu({tabs:e,defaultValue:t,value:r,onChange:s}){const i=!(r!==void 0&&s!==void 0)&&t!==void 0;return n.jsxs(bX,{defaultValue:i?t:e[0].id,value:r,onValueChange:s,children:[n.jsx(CX,{className:"flex overflow-x-auto overflow-y-hidden pb-px relative navigation after:absolute after:left-0 after:right-0 after:bottom-0 z-0 after:h-px after:bg-border-base",children:e.map(l=>n.jsxs(wX,{value:l.id,className:D("flex items-center icon-parent px-2 py-2 first:-ml-2 rounded-md font-medium","after:absolute after:bottom-0 after:right-2 after:left-2 after:h-px after:bg-text-primary after:z-10","select-none whitespace-nowrap relative top-px","state-active:text-text-primary state-active:after:visible","state-inactive:text-text-muted state-inactive:hover:text-text-base state-inactive:after:invisible","transition ease-in-out duration-150"),children:[l.icon&&n.jsx("span",{className:"shrink-0 mr-2",children:l.icon}),l.label]},l.id))}),e.map(l=>n.jsx(jX,{value:l.id,className:"mt-6 focus:outline-none",children:l.content},l.id))]})}const Lce=Object.freeze(Object.defineProperty({__proto__:null,default:Tu},Symbol.toStringTag,{value:"Module"}));function SX(e){const{machineId:t,open:r,onOpenChange:s}=e,{data:a,error:i}=yE({machineId:t,refreshInterval:3e3});return n.jsx(Re,{open:r,onOpenChange:s,title:"Sign machine",children:a?n.jsx(kX,{status:a,onCloseClick:()=>s(!1)}):n.jsx(De,{error:i})})}function kX({status:e,onCloseClick:t}){const[r,s]=f.useState("desktop"),[a,i]=f.useState(!1),[l,u]=Ai(!1),d=et(),m=e.signingURL,p=f.useCallback(()=>{if(!m){d.show({message:"An error occurred while generating the signing URL.",variant:"danger"});return}u(!0),Rr(m).then(()=>d.show({message:"Copied signing URL to clipboard"})).catch(()=>d.show({message:"Failed to copy signing URL to clipboard",variant:"danger"}))},[m,d,u]),g=f.useCallback(()=>{let v=!1;if(!m){d.show({message:"An error occurred while generating the signing URL.",variant:"danger"});return}window.addEventListener("blur",()=>v=!0,{once:!0}),window.open(m,"_self"),setTimeout(()=>{if(v){globalThis.localStorage.setItem("tailscale/tailnet-lock-deeplink","true");return}globalThis.localStorage.getItem("tailscale/tailnet-lock-deeplink")!=="true"&&i(!0)},1e3)},[d,m]);return e.lockedOut?n.jsxs(Re.Form,{children:[n.jsxs("p",{className:"mb-4",children:["With Tailnet Lock, machines can only join your tailnet once they are signed by a signing node."," ",n.jsx(Ge,{kbTopic:"Tailnet Lock",url:"https://tailscale.com/docs/features/tailnet-lock"})]}),n.jsx("div",{className:"mb-2",children:n.jsx(Tu,{value:r,onChange:v=>{u(!1),s(v)},tabs:[{id:"desktop",label:"Desktop",content:n.jsxs(Dg,{children:[n.jsxs("p",{className:"mb-4",children:["From a"," ",n.jsx(SF,{className:"inline align-bottom text-text-muted",size:22})," ","macOS or"," ",n.jsx(kF,{className:"inline align-bottom text-text-muted",size:22})," ","Windows signing node, use the links below."]}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(ue,{intent:"primary",onClick:g,children:"Sign this machine"}),n.jsx(ue,{variant:"minimal",onClick:p,prefixIcon:l?n.jsx(nn,{}):n.jsx(Lc,{}),children:"Copy signing URL"})]}),a&&n.jsx("p",{className:"text-text-muted",children:"Don’t have Tailscale installed? Copy the signing URL and open it from a signing node instead."})]})},{id:"mobile",label:"Mobile",content:n.jsxs(Dg,{children:[n.jsxs("p",{className:"mb-4",children:["From an"," ",n.jsx(NF,{className:"inline align-bottom text-text-muted",size:22})," ","iOS signing node, use the QR code or link below."]}),n.jsxs("div",{className:"flex flex-col gap-4",children:[e.signingQR?n.jsx("div",{className:"flex-1 flex flex-col gap-4",children:n.jsx("img",{className:"image-pixelated rounded-lg border overflow-hidden w-60 mx-auto",src:e.signingQR,alt:"QR code for signing this device"})}):n.jsx(rt,{intent:"warning",children:"Error generating the QR code. Use the signing URL instead."}),n.jsxs("div",{className:"flex-1 flex flex-col items-stretch w-full gap-4",children:[n.jsx(NX,{children:"Or"}),n.jsx(ue,{className:"",onClick:p,prefixIcon:l?n.jsx(nn,{}):n.jsx(Lc,{}),children:"Copy signing URL"})]})]})]})},{id:"cli",label:"CLI",content:n.jsxs(Dg,{children:[n.jsxs("p",{children:["From a signing node, use this"," ",n.jsx("a",{href:"https://tailscale.com/kb/1080/cli/#using-the-cli",className:"link",target:"_blank",rel:"noopener noreferrer",children:"Tailscale CLI"})," ","command."]}),n.jsx(xn,{className:"w-full p-1",text:e.signingCommand||"# error generating command",copySuccessMessage:"Copied command to clipboard"})]})}]})})]}):n.jsx(Re.Form,{submitButton:"Done",onSubmit:t,children:n.jsx(fn,{className:"py-6",icon:n.jsx(iw,{className:"text-text-success"}),title:"Signing complete",description:"This machine can now connect to your tailnet."})})}function NX({children:e}){return n.jsxs("div",{className:"flex items-center text-sm gap-2 uppercase tracking-wide",children:[n.jsx("hr",{className:"grow"}),n.jsx("p",{className:"shrink-0 text-text-muted",children:e}),n.jsx("hr",{className:"grow"})]})}function Dg({children:e}){return n.jsx("div",{className:"flex flex-col gap-4",children:e})}function dn(e){const{className:t,id:r,disabled:s,checked:a,sizeVariant:i,onChange:l}=e;function u(d){l(d.target.checked)}return n.jsx("input",{id:r,type:"checkbox",className:D("toggle",{"toggle-large":i==="large","toggle-small":i==="small"},t),disabled:s,checked:a,onChange:u})}dn.defaultProps={sizeVariant:"medium"};const Rce=Object.freeze(Object.defineProperty({__proto__:null,default:dn},Symbol.toStringTag,{value:"Module"}));function EX(e){const{open:t,machineId:r,onOpenChange:s}=e,{data:a,isPosting:i,handleAction:l}=sn(),u=a?.machines.find(d=>d.id===r);return n.jsx(Re,{open:t,title:`Edit machine name for ${u?.name||"this device"}`,onOpenChange:s,children:u&&n.jsx(AX,{machine:u,isPosting:i,updateDeviceName:d=>l("rename-node",u,{name:d},m=>{throw m}),onOpenChange:s})})}function AX(e){const{machine:t,isPosting:r,onOpenChange:s,updateDeviceName:a}=e,{name:i,automaticNameMode:l}=t,{data:u}=jh(),d=u?.magicDNS||!1,m=C7(t.hostname).toLowerCase().replaceAll(" ","-"),p=l?i:m,[g,v]=f.useState(l),[y,C]=f.useState(i),[b,w]=f.useState("");f.useEffect(()=>C(i),[i]);const N=y!==i,k=g!==l,E=!b&&(N||k);function T(F){v(F),C(F?p:i),w("")}function _(F){const{value:z,selectionStart:H,selectionEnd:J}=F.target,Y=z.toLowerCase().replaceAll(/[^\da-z-]/g,"-").replaceAll(/-+/g,"-");F.target.value=Y,F.target.selectionStart=H,F.target.selectionEnd=J,C(Y),w("")}function I(){const{isValid:F,error:z}=WZ(y),H=k&&g;if(!H&&!F){w(z||"");return}const J=W=>w(ml(W.message)),Y=W=>{const U=W?.name;if(H&&U!==void 0&&U!==m){C(U),w(`The name “${m}” ${U===m.replaceAll(/[^\da-z-]/g,"-")?"had invalid characters":"was already taken"}, so the machine was automatically assigned the name “${U}”.`);return}s(!1)};return a(H?"":y).then(Y).catch(J)}return n.jsxs(Re.Form,{disabled:!E,loading:r,cancelButton:!0,submitButton:"Update name",onSubmit:I,children:[n.jsxs("p",{className:"mb-6",children:["This name is shown in the admin panel",d?", in Tailscale clients, and used when generating MagicDNS names.":" and in Tailscale clients."]}),n.jsxs("div",{className:"flex items-center",children:[n.jsx(dn,{id:"auto-generate-checkbox",checked:g,onChange:T}),n.jsx("label",{htmlFor:"auto-generate-checkbox",className:"font-medium ml-3",children:"Auto-generate from OS hostname"})]}),n.jsx("label",{htmlFor:"machine-name",className:"block font-medium mt-6 mb-2",children:"Machine name"}),n.jsx("div",{className:"flex mb-2",children:n.jsx(ln,{className:"w-full z-10",type:"text",id:"machine-name",value:y,onChange:_,disabled:r||g})}),b&&n.jsx("p",{className:"text-text-danger mb-2",children:b}),d&&n.jsxs("div",{className:"text-text-muted",children:["This machine ",N?"will be":"is"," accessible as"," ",n.jsx("code",{className:P6,children:y})," using MagicDNS.",N&&n.jsxs(n.Fragment,{children:[" ",n.jsx("code",{className:P6,children:i})," will no longer point to this machine."]})]})]})}const P6="text-sm break-words bg-gray-200 dark:bg-gray-600 px-1 rounded";function Fs({time:e,className:t,children:r,format:s}){let a=T6("long",e);return s||(s="long"),r||(r=s==="long"?a:T6(s,e)),r===a&&(a=void 0),n.jsx(Ee,{content:a,side:"bottom",children:n.jsx("time",{dateTime:e.toISOString(),className:t,children:r})})}function T6(e,t){switch(e){default:case"long":return ws(t)+" at "+Hc(t);case"date":return ws(t);case"relative":return S7(t)}}function kh({connected:e,restricted:t,date:r,className:s,dot:a=!0}){if(e)return n.jsxs("span",{className:s,children:[a&&n.jsx(Fn,{status:"connected",className:"mr-2"}),"Connected"]});if(typeof r=="string"&&(r=new Date(r)),!r||!o2(r))return n.jsx("span",{className:D("text-text-disabled",s),children:"—"});const i=Yn();return Fc(i,r)<-10?null:t?n.jsxs("span",{className:s,children:[a&&n.jsx(Fn,{status:"restricted",className:"mr-2"}),"Restricted"]}):n.jsxs(Fs,{time:r,className:s,children:[a&&n.jsx(Fn,{status:"unknown",className:"mr-2"}),PX(r,i)]})}function PX(e,t){return bB(e,t)?Hc(e):Fc(t,e)<10080?`${Go(e)}, ${Hc(e)}`:PU(e,t)?Go(e):ws(e)}function TX(e){const{open:t,machineId:r,onOpenChange:s}=e,{data:a}=sn(),i=a?.machines.find(g=>g.id===r),{data:l}=ot(),u=et(),[d,m]=f.useState(!1);f.useEffect(()=>{t&&rG();const g=y=>{y.altKey&&m(!0)},v=y=>{y.altKey||m(!1)};return globalThis.addEventListener("keydown",g),globalThis.addEventListener("keyup",v),()=>{globalThis.removeEventListener("keydown",g),globalThis.removeEventListener("keyup",v)}},[t]);function p(g){if(!i)return;s(!1);const v=`tailscale-ssh-console-${l?.loginName??"unknown"}-${Math.floor(Math.random()*1e15).toString(36)}`;function y(C){u.show({message:C,variant:"danger"})}vG({username:g,machine:i,clientHostname:v,reportError:y,sneakersEffect:d})}return n.jsx(Re,{open:t,onOpenChange:s,title:`SSH to ${d?"Setec Astronomy":i?.name||"this device"}`,children:i&&n.jsx(IX,{machine:i,holdingOption:d,onSSH:p})})}function IX(e){const{machine:t,holdingOption:r,onSSH:s}=e,[a,i]=ph(void 0,`machine-ssh-user-name-${t.id}`),{sshUsernames:l=[],otherSSHUsernamesAllowed:u=!1}=t;return n.jsxs(Re.Form,{cancelButton:!0,submitButton:r?"Too many secrets":"Start SSH Session",onSubmit:()=>{a&&s(a)},disabled:!a,children:[n.jsxs("p",{children:["Connect from your browser to a device running Tailscale SSH."," ",n.jsx(Ge,{kbTopic:"Tailscale SSH",url:"https://tailscale.com/kb/1216/tailscale-ssh-console/"})]}),n.jsx(Br,{label:"Local username",className:"flex mt-6",id:"user-name",description:r?"My voice is my passport, verify me…":n.jsxs(n.Fragment,{children:["Username on ",t.name," that the Tailscale SSH session will use."]}),children:n.jsx(DX,{usernameCandidates:l,otherUsersAllowed:u,userName:a,setUserName:i})}),!t.connectedToControl&&n.jsxs(rt,{className:"mt-4",intent:"warning",children:[t.name," appears to be offline (last seen"," ",n.jsx(kh,{date:t.lastSeen,dot:!1}),"). It may not be possible to open an SSH session to it."]})]})}const ii="Other…​";function DX({usernameCandidates:e,otherUsersAllowed:t,userName:r,setUserName:s}){let a;r===void 0?e.length===1?a=e[0]:e.length===2&&e.includes("root")&&(a=e[e[0]==="root"?1:0]):e.includes(r)?a=r:t&&(a=ii);const[i,l]=f.useState(a),u=f.useRef(null),d=e.length>0,m=i===ii||!d;return f.useEffect(()=>{a!==void 0&&a!==ii&&a!==r&&s(a)}),n.jsxs(n.Fragment,{children:[d&&n.jsx(Pe,{side:"bottom",align:"start",asChild:!0,onCloseAutoFocus:p=>{i===ii&&(p.preventDefault(),u.current?.focus({preventScroll:!0}),u.current?.select())},trigger:n.jsx(ue,{id:m?void 0:"user-name",className:"flex items-center justify-center mr-2",suffixIcon:n.jsx(Nn,{}),children:i??"Select user…"}),children:n.jsxs(Pe.RadioGroup,{className:"min-w-[180px]",value:i,onValueChange:p=>{l(p),p!==ii&&s(p)},children:[e.map(p=>n.jsx(Pe.RadioItem,{value:p,children:p},p)),e.length>0&&t&&n.jsx(Pe.Separator,{}),t&&n.jsx(Pe.RadioItem,{value:ii,children:ii})]})}),m&&n.jsx(ln,{className:"grow",ref:u,type:"text",autoCorrect:"off",autoCapitalize:"off",placeholder:"Username",id:"user-name",value:r??"",onChange:p=>s(p.target.value)})]})}function _X(e,t){const{data:r,error:s,mutate:a}=dt(()=>`/public/device/${e}/device-invites`),i=et(),[l,u]=f.useState(!1),d=f.useCallback(g=>{const v=g.filter(y=>y.email?!r?.some(C=>!C.accepted&&C.email===y.email):!0);return v.length===0?(i.show(MX),new Promise(y=>y([]))):(u(!0),Ie.post(`/public/device/${e}/device-invites`,v).then(y=>{const C=y.data.data;return u(!1),a(),C.length===1&&!C[0].email?Rr(C[0].inviteUrl).then(()=>i.show(LX)).catch(()=>i.show(RX)):i.show(OX(C.length,g.length-v.length)),C}).catch(y=>{throw u(!1),i.show(FX(g.length)),y}))},[r,a,e,i]),m=f.useCallback(g=>Ie.post(`/public/device-invites/${g}/resend`).then(()=>{a(),i.show(BX)}).catch(v=>{throw i.show(UX),v}),[a,i]),p=f.useCallback(g=>Ie.delete(`/public/device-invites/${g.id}`).then(()=>{a(),t(),i.show(VX(g.accepted))}).catch(v=>{throw i.show($X(g.accepted)),v}),[a,t,i]);return{data:r,error:s,mutate:a,posting:l,postNodeInvites:d,resendNodeInvite:m,deleteNodeInvite:p}}const MX={message:"Did not send any emails. There are already pending share links for all recipients.",variant:"danger"},LX={message:"Share link created and copied to clipboard"},RX={message:"Share link created, but failed to copy to clipboard.",variant:"danger"},OX=(e,t)=>({message:t?`${e} ${yt("email",e)} sent. ${t} ${yt("email",t)} skipped because recipient was already sent a share link.`:`Emailed ${e} share ${yt("link",e)}`}),FX=e=>({variant:"danger",message:`Failed to email share ${yt("link",e)}`}),BX={message:"Re-sent share link"},UX={variant:"danger",message:"Failed to re-send share link"},VX=e=>({message:`Revoked ${e?"share":"share link"}`}),$X=e=>({message:`Failed to revoke ${e?"share":"share link"}. Try again later or contact support for help.`,variant:"danger"}),HX="Share links can only be sent to valid email addresses.";function zX(e,t){const[r,s]=f.useState(e);return f.useEffect(()=>{const a=setTimeout(()=>{s(e)},t);return()=>{clearTimeout(a)}},[e,t]),r}function I6(e,t){const r=f.useRef(e),s=f.useRef();return f.useEffect(()=>{r.current=e},[e]),f.useMemo(()=>((...a)=>{s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{r.current(...a)},t)}),[t])}function TE({restrictToDomains:e,setEmails:t,value:r,onChange:s,onBlur:a,...i}){const[l,u]=ce.useState(r||"");f.useEffect(()=>u(r||""),[r]);const d=zX(l,500),m=f.useCallback(p=>{let g=[],v=[];p.replaceAll(" ","").split(",").map(y=>y.toLowerCase()).filter((y,C,b)=>b.indexOf(y)===C).forEach(y=>{if(y!==""){if(!Cl(y)){v=v.concat(y);return}if(e){const C=y.split("@")[1];if(!e.includes(C)){v=v.concat(y);return}}g=g.concat(y)}}),t(g,v)},[e,t]);return f.useEffect(()=>m(d),[d,m]),n.jsx(ln,{value:l,onChange:p=>{u(p.target.value),s&&s(p)},onBlur:p=>{m(p.target.value),a?.(p)},...i})}function WX(e){const{machineId:t,refreshMachineData:r,open:s,onOpenChange:a}=e,{data:i}=sn(),l=i?.machines.find(u=>u.id===t);return n.jsx(Re,{open:s,onOpenChange:a,title:"Share machine",children:l&&n.jsx(KX,{machine:l,refreshMachineData:r})})}function KX({machine:e,refreshMachineData:t}){const{data:r,error:s,posting:a,postNodeInvites:i,resendNodeInvite:l,deleteNodeInvite:u}=_X(e.id,t),d=et(),m=!!(e.advertisedExitNode&&e.allowedExitNode),[p,g]=f.useState(""),[v,y]=f.useState(m),{acceptedInvites:C,notAcceptedInvites:b}=f.useMemo(()=>{let N=[],k=[];return r?.forEach(E=>{E.accepted?N=N.concat(E):k=k.concat(E)}),{acceptedInvites:N.sort(D6),notAcceptedInvites:k.sort(D6)}},[r]);function w(){d.show({message:"Failed to copy to clipboard.",variant:"danger"})}return s?n.jsx(De,{error:{message:"Failed to load sharing information. Please try again later or contact support."}}):n.jsxs(f.Fragment,{children:[n.jsxs("div",{className:"mb-4",children:["Share access to"," ",n.jsx("span",{className:"font-medium",children:e?.name||"this device"})," ","with external users, as allowed by ACLs. If you need multiple users in the same tailnet to access it, or if you want to share more than one machine with a user, invite users to your tailnet instead."," ",n.jsx(Ge,{kbTopic:"node sharing",url:"https://tailscale.com/docs/features/sharing"})]}),!e.canNat&&n.jsxs(rt,{intent:"warning",className:"mb-4",children:["This machine is running an older version of Tailscale, and may not be able to communicate with shared machines. Please"," ",n.jsx("a",{className:"link-underline",href:"https://tailscale.com/kb/1067/update/",target:"_blank",rel:"noopener noreferrer",children:"update"})," ","to the latest version of Tailscale."]}),n.jsx(Tu,{tabs:[{id:"email",label:"Share via email",content:n.jsx(GX,{advertisingExitNode:m,allowExitNode:v,setAllowExitNode:y,onSubmit:N=>i(N.map(k=>({email:k,allowExitNode:v}))).then(),loading:a}),icon:n.jsx(uu,{})},{id:"copy",label:"Copy share link",content:n.jsx(qX,{advertisingExitNode:m,allowExitNode:v,setAllowExitNode:y,onSubmit:N=>i([{allowExitNode:v,multiUse:N}]).then(),loading:a}),icon:n.jsx(cu,{})}]}),(r||[]).length>0?n.jsx("div",{className:"border rounded-md mt-4",children:n.jsx("ul",{className:"divide-y",children:[...C,...b].map(N=>n.jsx(YX,{invite:N,openMenu:p===N.id,onMenuOpenChange:k=>g(k?N.id:""),onCopyFailed:w,onResend:()=>l(N.id),onRevoke:()=>u(N)},`${N.id}-${N.accepted}`))})}):n.jsx(at,{empty:!0,className:"mt-4",children:n.jsx(fn,{description:"No external users have access"})})]})}function GX({advertisingExitNode:e,allowExitNode:t,setAllowExitNode:r,onSubmit:s,disabled:a,loading:i}){const[l,u]=f.useState(""),[d,m]=f.useState([]),[p,g]=f.useState(""),v=a||d.length===0||p!=="",y=f.useCallback((C,b)=>{m(C),g(b.length>0?HX:"")},[m,g]);return n.jsxs(Re.Form,{loading:i,disabled:v,onSubmit:()=>s(d).then(()=>{u(""),m([]),g("")}),children:[e&&n.jsxs("label",{className:"flex items-center gap-2 font-medium",children:[n.jsx(dn,{sizeVariant:"medium",checked:t,onChange:r}),"Allow use as an exit node"]}),n.jsx(Br,{help:"You can use commas to separate multiple email recipients.",className:"mt-4",error:p,children:n.jsxs("div",{className:"flex gap-2",children:[n.jsx(TE,{placeholder:"user@example.com",className:"w-full",setEmails:y,value:l,onChange:C=>u(C.target.value)}),n.jsx(ue,{type:"submit",intent:"primary",loading:i,disabled:v,children:"Share"})]})})]})}function qX({advertisingExitNode:e,allowExitNode:t,setAllowExitNode:r,onSubmit:s,disabled:a,loading:i}){const{data:l}=vt(),[u,d]=f.useState(!1),[m,p]=Ai(!1,{timeout:750});return n.jsxs("form",{className:"flex flex-col gap-4",children:[n.jsxs("div",{className:"flex flex-col gap-2 items-start",children:[e&&n.jsxs("label",{className:"flex items-center gap-2 font-medium",children:[n.jsx(dn,{sizeVariant:"medium",checked:t,onChange:r}),"Allow use as an exit node"]}),l.featureMultiUseSharing&&n.jsxs("label",{className:"flex items-center gap-2 font-medium",children:[n.jsx(dn,{sizeVariant:"medium",checked:u,onChange:d}),"Reusable link"]})]}),n.jsx(ue,{type:"submit",intent:"primary",className:"w-full",onClick:()=>s(u).then(()=>p(!0)),disabled:m||a,loading:i,children:m?"Copied!":u?"Copy reusable share link":"Copy share link"})]})}function YX(e){const t=Yn(),{invite:r,openMenu:s,onMenuOpenChange:a,onCopyFailed:i,onResend:l,onRevoke:u}=e,d=et(),[m,p]=Ai(!1,{timeout:750}),[g,v]=Ai(!1,{timeout:750}),y=f.useCallback(()=>Rr(r.inviteUrl).then(()=>p(!0)).catch(()=>i()),[r.inviteUrl,i,p]),C=r.lastEmailSentAt?new Date(r.lastEmailSentAt)>=Pw(t,{minutes:-1}):!1,b=f.useMemo(()=>r.accepted?[{type:"item",label:"Revoke access",intent:"danger",onSelect:u}]:[{label:"Copy share link",type:"item",className:D({"@md:hidden":!r.email}),hidden:r.accepted,onSelect:()=>y().then(()=>d.show({message:"Copied share link"}))},{label:"Resend email",type:"item",className:"@md:hidden",hidden:!r.email,disabled:C,icon:C?lw:void 0,onSelect:l},{label:`Invited on ${ws(new Date(r.created))}`,type:"item",disabled:!0},{type:"separator"},{type:"item",label:"Revoke invite",intent:"danger",onSelect:u}],[r.accepted,r.email,r.created,u,C,l,y,d]),w=f.useMemo(()=>r.accepted?r.acceptedBy?.loginName:r.email??ZX(r.inviteUrl),[r.accepted,r.acceptedBy?.loginName,r.email,r.inviteUrl]);return n.jsxs("li",{className:"flex justify-between items-center gap-4 h-14 px-4",children:[n.jsxs("div",{className:"flex flex-1 items-center gap-2 min-w-0",children:[n.jsx(Lr,{user:r.acceptedBy?.id?{id:`${r.acceptedBy.id}`,loginName:r.acceptedBy.loginName,displayName:r.acceptedBy.loginName,profilePicURL:r.acceptedBy.profilePicUrl}:void 0,className:"shrink-0",sizeClassName:"w-7 h-7",children:r.accepted?void 0:r.email?n.jsx(uu,{className:"text-text-muted w-1/2 h-1/2"}):n.jsx(cu,{className:"text-text-muted w-1/2 h-1/2"})}),n.jsxs("div",{className:"flex flex-col gap-0.5",children:[n.jsx("span",{title:w,className:D("flex-1 truncate",{"text-text-muted":!r.accepted}),children:w}),n.jsxs("div",{className:"flex gap-2",children:[r.allowExitNode&&n.jsxs(We,{variant:"tag",className:"text-sm",children:[n.jsx(nn,{className:"mr-1",width:"0.9em",height:"0.9em"}),"Exit node"]}),r.multiUse&&n.jsxs(We,{variant:"tag",className:"text-sm",children:[n.jsx(nn,{className:"mr-1",width:"0.9em",height:"0.9em"}),"Reusable"]})]})]})]}),n.jsxs("span",{className:"flex shrink-0 justify-between relative -mr-2",children:[!r.accepted&&(r.email?n.jsx(Ee,{content:C?"Share links can only be re-sent to the same email once per minute.":void 0,children:n.jsx(ue,{onClick:()=>l().then(()=>v(!0)),intent:"primary",variant:"minimal",sizeVariant:"small",className:"hidden @md:inline-block mr-2",disabled:C,children:g?"Re-sent!":"Re-send email"})}):n.jsx(ue,{onClick:y,intent:"primary",variant:"minimal",sizeVariant:"small",className:"hidden @md:inline-block mr-2",title:r.inviteUrl,children:m?"Copied!":"Copy share link"})),n.jsx(el,{ariaLabel:"Edit invite",items:b,open:s,onOpenChange:a,side:"bottom",align:"end",iconSize:"20",iconClassName:"text-text-muted",iconClassOverride:!0})]})]})}function ZX(e){return e.replace(DF()+"/admin/invite/","")}function D6(e,t){const r=new Date(e.created),s=new Date(t.created);return rb.id===r),[d,m]=f.useState([]),p=u?JSON.stringify([[...u.allowedIPs].sort(),[...u.extraIPs].sort()]):"";f.useEffect(()=>{if(!u){m([]);return}m([...u.allowedIPs.map(b=>({ip:b,allowed:!0})),...u.extraIPs.map(b=>({ip:b,allowed:!1}))].sort((b,w)=>b.ipd.filter(b=>b.allowed).map(b=>b.ip),[d]),v=f.useMemo(()=>{if(!u)return!1;const b=[...u.allowedIPs].sort(),w=[...g].sort();return b.length!==w.length||b.some((N,k)=>N!==w[k])},[u,g]),y=f.useCallback((b,w)=>{O(R.SubnetRouterDialogRouteCheckboxChanged,{eventProperties:{..._g,type:w?"approve":"unapprove"}}),m(N=>N.map(k=>k.ip===b?{...k,allowed:w}:k))},[m]),C=f.useCallback(()=>{!u||!v||(O(R.SubnetRouterDialogSaved,{eventProperties:_g}),l("set-route-settings",u,{allowedIPs:g,allowedExitNode:u.allowedExitNode}))},[u,v,g,l]);return n.jsx(Re,{open:t,title:`Edit subnet routes of ${u?.name||"this device"}`,onOpenChange:s,onPointerDownOutside:b=>{b.preventDefault()},children:u&&n.jsxs(Re.Form,{disabled:!v,cancelButton:"Cancel",submitButton:"Save",onSubmit:()=>{C(),s(!1)},children:[n.jsxs("p",{children:["Approve the IP ranges this machine advertises so your tailnet can route traffic to them."," ",n.jsx(Ge,{kbTopic:"subnet routers",url:QX})]}),n.jsx(hE,{className:"mt-6",machine:u,onFixForwardingClick:()=>O(R.SubnetRouterDialogFixIPForwardingLinkClicked,{eventProperties:_g})}),n.jsx(Gv,{className:"mt-6",machine:u}),d.length===0?n.jsx("p",{className:"mt-6 text-text-muted",children:"This machine isn’t advertising any subnet routes."}):n.jsx("div",{className:"mt-6 flex flex-col gap-3",children:d.map(b=>n.jsx(yr,{id:`subnet-route-${b.ip}`,label:n.jsx("code",{children:b.ip}),checked:b.allowed,onChange:w=>y(b.ip,w),disabled:i},b.ip))})]})})}function IE(e){const{onDelete:t,onRenumber:r}=e,{machineId:s,refreshMachineData:a,openDialog:i,triggerRef:l,setOpenDialog:u,closeOpenDialog:d}=Iu(),m=p=>g=>{if(g){s&&u(p,s);return}d(),requestAnimationFrame(()=>{l?.focus()})};return n.jsxs(n.Fragment,{children:[n.jsx(WX,{open:i==="sharing",machineId:s,refreshMachineData:a,onOpenChange:m("sharing")}),n.jsx(mX,{open:i==="remove-confirmation",machineId:s,onOpenChange:m("remove-confirmation"),onDelete:t}),n.jsx(rX,{open:i==="route-settings",machineId:s,onOpenChange:m("route-settings")}),n.jsx(cX,{open:i==="exit-node",machineId:s,onOpenChange:m("exit-node")}),n.jsx(JX,{open:i==="subnet-router",machineId:s,onOpenChange:m("subnet-router")}),n.jsx(EX,{open:i==="machine-name",machineId:s,onOpenChange:m("machine-name")}),n.jsx(gX,{open:i==="machine-ip",machineId:s,onOpenChange:m("machine-ip"),onRenumber:r}),n.jsx(uX,{open:i==="acl-tags",machineId:s,onOpenChange:m("acl-tags")}),n.jsx(hX,{machineId:s,open:i==="extend-key",onOpenChange:m("extend-key")}),n.jsx(TX,{machineId:s,open:i==="ssh",onOpenChange:m("ssh")}),n.jsx(SX,{machineId:s,open:i==="locked-out-instructions",onOpenChange:m("locked-out-instructions")})]})}const Iu=zf(e=>({machineId:void 0,refreshMachineData:function(){},triggerRef:void 0,openDialog:"none",setOpenDialog:(t,r,s,a)=>e({openDialog:t,machineId:r,refreshMachineData:s,triggerRef:a}),closeOpenDialog:()=>e({openDialog:"none",machineId:void 0,triggerRef:void 0})})),XX="absolute flex items-stretch border border-border-interactive bg-bg-base shadow-md cursor-pointer divide-x rounded-md active:shadow focus:outline-none focus:ring",_6="px-2 hover:bg-bg-menu-item-hover first:rounded-l-md focus:outline-none focus:ring",eee=e=>({openDialog:e.openDialog,setOpenDialog:e.setOpenDialog});function DE(e){const{machine:t,refreshMachineData:r,isPosting:s,minimalMenuButton:a,showQuickActions:i,handleAction:l,onDelete:u,splitRouteSettingsVariant:d}=e,{authorized:m,acceptedShareCount:p,neverExpires:g,expires:v,isExternal:y,tlTrusted:C,authURL:b}=t,[w,N]=f.useState(!1),[k,E]=f.useState(!1),{setOpenDialog:T}=Iu(eee),_=f.useRef(null),I=_.current||void 0,{loaded:F,assignable:z}=WS(),{access:H}=qt(de.Devices),{access:J}=qt(de.DeviceRouting),{access:Y}=qt(de.DeviceAllTags),{access:B}=qt(de.DeviceSharing),{access:W}=qt(de.AdminPanelSSH),{access:U}=qt(de.AuditLogs),Z=Sn(H),re=Sn(J),me=Sn(Y)||F&&z.size>0,L=Sn(B),V=Ho(U),P=Ho(W)&&((t.sshUsernames?.length??0)>0||t.otherSSHUsernamesAllowed===!0)&&m,q=Z||re||me||L||P;f.useEffect(()=>{if(!w)return;const Tt=Fe=>{Fe.altKey&&E(!0)},xe=Fe=>{Fe.altKey||E(!1)};return globalThis.addEventListener("keydown",Tt),globalThis.addEventListener("keyup",xe),()=>{globalThis.removeEventListener("keydown",Tt),globalThis.removeEventListener("keyup",xe)}},[w]);function Q(){l("authorize",t)}function ae(){window.open(vr(t.authURL),"_blank","noopener,noreferrer")}function X(Tt){O(R.OpenedMachineSSHSession,{sshProperties:{sessionSource:Tt}}),T("ssh",t.id,r,I)}function fe(){l("set-expires",t)}function he(){l("set-never-expires",t,{keyExpiryDisabled:!0})}function se(){if(O(R.MachineRemoveSelected,{eventProperties:{productArea:K.Machines}}),k){l(t.isExternal?"remove-external":"delete-node",t)?.then(()=>{O(R.MachineRemoved,{eventProperties:{productArea:K.Machines}})}),u?.();return}T("remove-confirmation",t.id)}const le=g?!1:new Date(v){if(Z){if(!C)return n.jsxs("p",{children:["You cannot remove this machine because it’s a Tailnet Lock signing node."," ",n.jsx(Ge,{url:"https://tailscale.com/kb/1226/tailnet-lock#remove-a-signing-node",kbTopic:"Tailnet Lock"})]})}else return n.jsx("p",{children:"You do not have permission to remove machines."})},ht=[{type:"item",label:"Approve",disabled:s,onSelect:Q,hidden:y||!Z||m},{type:"item",label:"SSH to machine…",hidden:!P,onSelect:()=>X("machine-action-menu")},{type:"link",label:"Set up SSH",hidden:P||!(t.os==="linux"||t.os==="macOS"),href:`/admin/machines/${t.addresses[0]}/ssh-setup`},{type:"separator",hidden:!P},{type:"item",label:"Edit machine name…",disabled:s,onSelect:()=>T("machine-name",t.id,r,I),hidden:y||!Z},{type:"item",label:"Edit machine IPv4…",disabled:s,onSelect:()=>{O(R.MachineEditIPv4Selected,{eventProperties:{productArea:K.Machines}}),T("machine-ip",t.id,r,I)},hidden:!Z},{type:"item",label:p>0?"Sharing settings…":"Share…",disabled:s,onSelect:()=>{T("sharing",t.id,r,I),O(R.OpenedShareFromDropdown,{})},hidden:!Ae},{type:"item",label:"Enable key expiry",hidden:y||!Z||!g,onSelect:fe,disabled:s},{type:"item",label:"Disable key expiry",hidden:y||!Z||g,onSelect:he,disabled:s},{type:"item",label:"Reauthorize machine",hidden:y||!Z||!le||!b,onSelect:ae,disabled:s},{type:"item",label:"Temporarily extend key…",hidden:y||!Z||!le,onSelect:()=>T("extend-key",t.id,r,I),disabled:s},{type:"link",label:"View recent activity",hidden:!V,href:`/admin/logs?targetSearch=${t.stableId}`,onNavigate:()=>O(R.MachineViewRecentActivitySelected,{eventProperties:{productArea:K.Machines}})},{type:"separator",hidden:y||!Z||!re},{type:"item",label:"Edit route settings…",hidden:y||!re||d!=="control",onSelect:()=>T("route-settings",t.id,r,I),disabled:s},{type:"link",label:"Set up exit node...",hidden:d==="control"||y||!re||t.advertisedExitNode||!kJ(t.os),href:`/admin/machines/${t.addresses[0]}/exit-node-setup`},{type:"item",label:"Edit exit node…",hidden:d==="control"||y||!re||!t.advertisedExitNode,onSelect:()=>{T("exit-node",t.id,r,I),O(R.ExitNodeDialogOpened,{})},disabled:s},{type:"link",label:"Set up subnet router...",hidden:d==="control"||y||!re||t.hasSubnets||!UJ(t.os),href:`/admin/machines/${t.addresses[0]}/subnet-router-setup`},{type:"item",label:"Edit subnet routes…",hidden:d==="control"||y||!re||!t.hasSubnets,onSelect:()=>{T("subnet-router",t.id,r,I),O(R.SubnetRouterDialogOpened,{})},disabled:s},{type:"item",label:"Edit ACL tags…",hidden:y||!me,onSelect:()=>T("acl-tags",t.id,r,I),disabled:s},{type:"separator",hidden:y||!Z||C},{type:"item",label:`Remove${k?"":"…"}`,intent:"danger",onSelect:se,disabled:!Z||C||s,disabledTooltipContent:ct()}];return n.jsxs("div",{className:D({"flex gap-2 flex-wrap":!a,[XX]:Te,"-mt-0.5 relative":a}),children:[Z&&!a&&!m&&n.jsx(ue,{intent:"primary",onClick:()=>Q(),children:"Approve"}),Ue?n.jsx("button",{disabled:s,onClick:()=>X("quick-action"),className:_6,children:"SSH…"}):!a&&P&&n.jsx(ue,{disabled:s,onClick:()=>X("button"),children:"SSH to machine…"}),Te?n.jsx("button",{disabled:s,onClick:()=>{T("sharing",t.id,r,I),O(R.OpenedShareFromQuickActions,{})},className:_6,"aria-label":`Share ${Ze}`,children:"Share…"}):!a&&Ae&&n.jsx(ue,{disabled:s,onClick:()=>{T("sharing",t.id,r,I),O(R.OpenedShareFromMachineHeader,{})},children:"Share…"}),n.jsx(el,{ariaLabel:`Actions for ${Ze}`,items:ht,open:w,onOpenChange:Tt=>{Tt&&O(R.MachineMenuOpened,{eventProperties:{productArea:K.Machines}}),N(Tt)},side:"bottom",buttonClassName:D({"!border-y-0 rounded-l-none group-hover:!shadow-none":Te||Ue}),ref:_,customTrigger:a?void 0:n.jsx(ue,{className:"min-w-0",ref:_,children:n.jsxs("div",{className:"flex items-center",children:[n.jsx(Xx,{className:"mr-2",size:16}),"Machine settings"]})})})]})}const on={className:"mr-1",variant:"tag"};function _E({machine:e,posturesToBadgeInConsole:t,splitRouteSettingsVariant:r}){const{badges:s}=RE(e,t);return n.jsxs("div",{children:[s.ownerSuspendedBadge&&n.jsx(Ee,{content:"This machine belongs to a suspended user. While it may appear connected, it cannot exchange traffic with other machines on the tailnet until the suspension is lifted.",children:n.jsxs(We,{...on,color:"gray",children:["Owner suspended",n.jsx(t2,{className:"ml-1",size:"0.9em"})]})}),s.ownerNeedsApprovalBadge&&n.jsx(Ee,{content:"The owner of this machine needs approval.",children:n.jsxs(We,{...on,color:"gray",children:["Owner needs approval",n.jsx(n2,{className:"ml-1",size:"0.9em"})]})}),s.ownerUnpaidBadge&&n.jsx(Ee,{content:"The owner of this machine is unpaid for because you have exceeded the number of users allowed by your plan. Upgrade your plan or delete some users in order to enable this machine.",children:n.jsxs(We,{...on,color:"gray",children:["Owner unpaid",n.jsx(Gx,{className:"ml-1",size:"0.9em"})]})}),s.unauthorizedBadge&&n.jsx(Ee,{content:"This machine cannot access the tailnet until approved.",children:n.jsx(We,{...on,color:"red",children:"Needs approval"})}),s.tlLockedOut&&n.jsx(Ee,{content:"This machine cannot access the tailnet until signed by a trusted Tailnet Lock key.",children:n.jsx(We,{...on,color:"red",children:"Locked out"})}),s.multipleConnectionsBadge&&n.jsx(Ee,{content:"Multiple cloned devices are trying to share a key. Reinstall.",children:n.jsx(We,{...on,color:"red",children:"Duplicate node key"})}),s.externalBadge&&n.jsx(Ee,{content:`You were invited to share this machine by someone outside your network. It is only visible to users invited by ${e.creator}.`,children:n.jsx(We,{...on,color:"orange",children:"Shared in"})}),s.sharedBadge&&n.jsx(Ee,{content:`This machine has been shared with ${e.acceptedShareCount} ${yt("user",e.acceptedShareCount)} outside your network.`,children:n.jsxs(We,{...on,color:"orange",children:["Shared out +",e.acceptedShareCount]})}),s.expiryBadge&&n.jsx(tee,{...e}),s.ephermeralBadge&&n.jsx(Ee,{content:`This machine is ephemeral and will be automatically removed shortly after going offline.`,children:n.jsx(We,{...on,color:"blue",children:"Ephemeral"})}),s.sshEnabled&&n.jsx(Ee,{content:"This device is running a Tailscale SSH server. Sources permitted in ACLs can SSH to this machine using Tailscale for authentication.",children:n.jsx(We,{...on,color:"green",children:"SSH"})}),s.funnelEnabled&&n.jsx(Ee,{content:"This device is running a Tailscale Funnel server, available to the open internet.",children:n.jsx(We,{...on,color:"green",children:"Funnel"})}),s.tlTrusted&&n.jsx(Ee,{content:"This machine can sign new nodes to approve their access to the tailnet.",children:n.jsx(We,{...on,color:"green",children:"Signing node"})}),s.subnetsBadge&&n.jsx(nee,{...e,splitRouteSettingsVariant:r}),s.exitNodeBadge&&n.jsx(ree,{...e,splitRouteSettingsVariant:r}),s.connectorBadge&&n.jsx(Ee,{content:"This machine is an app connector.",children:n.jsx(We,{...on,color:"blue",children:"Connector"})}),s.peerRelayBadge&&n.jsx(Ee,{content:"This device is available as a Tailscale Peer Relay. Sources permitted in ACLs can use this machine as a connectivity aid.",children:n.jsx(We,{...on,color:"blue",children:"Peer Relay"})}),s.adminPanelSSH&&n.jsx(Ee,{content:"This device is a browser running Tailscale SSH Console.",children:n.jsx(We,{...on,color:"green",children:"SSH Console"})}),s.tooManyRoutes&&n.jsx(Ee,{content:"This machine has reached the auto-approved subnet route limit.",children:n.jsx(We,{...on,color:"red",children:"Subnets limit reached"})}),s.failingPostures&&n.jsx(see,{machine:e,badgePostures:s.failingPostures})]})}function tee({expires:e,neverExpires:t}){const r=new Date(e),s=Yn(),a=t?!1:rs?`This machine will need to be reauthenticated ${i}`:`This machine’s key expired ${i} and needs to be reauthenticated.`,children:n.jsx(We,{...on,color:"gray",children:t?"Expiry disabled":ml(`${a?"expired":"expires"} ${i}`)})})}function ME(e){return e!=null&&e!=="control"}function Yv(e){return`Review this from the “${e}” option in the machine’s menu.`}const LE=Yv("Edit route settings...");function nee({advertisedIPs:e,allowedIPs:t,extraIPs:r,brokenIPForwarding:s=!1,splitRouteSettingsVariant:a}){const i=!Vm(e,t)||s,l=ME(a),u=l?Yv("Edit subnet routes…"):LE,d=l&&i?"yellow":"blue";return n.jsx(Ee,{content:s?`This machine is misconfigured and cannot relay traffic. ${u}`:i?`This machine has ${r.length>0?"unapproved":"non-advertised"} routes. ${u}`:"This machine advertises subnet routes.",children:n.jsxs(We,{...on,color:d,children:["Subnets",i&&n.jsx(Oa,{className:"ml-1",size:"1em",strokeWidth:"2.35"})]})})}function ree({advertisedExitNode:e,allowedExitNode:t,brokenIPForwarding:r,splitRouteSettingsVariant:s}){const a=e!==t||r,i=ME(s),l=i?Yv(e?"Edit exit node…":"Set up exit node"):LE,u=i&&a?"yellow":"blue";return n.jsx(Ee,{content:r?`This machine is misconfigured and cannot relay traffic. ${l}`:a?`This machine is ${t?"no longer advertising itself as an exit node":"requesting to be used as an exit node"}. ${l}`:"This machine is acting as an exit node.",children:n.jsxs(We,{...on,color:u,children:["Exit Node",a&&n.jsx(Oa,{className:"ml-1",size:"1em",strokeWidth:"2.35"})]})})}function see({machine:e,badgePostures:t}){if(t.length===0)return null;const r=(e.failingPostures||[]).filter(i=>!t.includes(i)),s="This machine is failing device posture "+yt("rule",t.length)+": "+t.join(", "),a=r.length>0?` (+${r.length} more)`:"";return n.jsx(Ee,{content:s+a,children:n.jsx(We,{...on,color:"red",children:"Failing device posture"})})}function RE(e,t){const r=f.useMemo(()=>{if(!e)return{};const s=new Date(e.expires),a=Yn(),i=(e.failingPostures||[]).filter(l=>(t||[]).includes(l));return{ownerSuspendedBadge:e.ownerDisabledStatus===en.Suspended,ownerNeedsApprovalBadge:e.ownerDisabledStatus===en.NeedsApproval,ownerUnpaidBadge:e.ownerDisabledStatus===en.Unpaid,unauthorizedBadge:!e.authorized,externalBadge:e.isExternal,sharedBadge:e.acceptedShareCount>0,expiryBadge:e.neverExpires||s0,badges:r}}function OE(e){const{machine:t,avatar:r}=e;return t.hasTags?n.jsx(Zv,{machine:t}):n.jsxs("div",{className:"flex items-center",children:[r&&n.jsx(Lr,{sizeClassName:"w-5 h-5 text-sm",className:"mr-2",user:r}),n.jsx(Ee,{content:t.user,children:t.user})]})}function Zv(e){const{machine:t}=e,{loaded:r,error:s,aclTags:a}=$i(),i=et();return f.useEffect(()=>{s!==void 0&&i.show({key:"acl-tags-load-error",message:n.jsxs(n.Fragment,{children:[n.jsx("strong",{children:"Failed to load tag information."}),n.jsx("br",{}),n.jsx(Zn,{type:"connectivity",className:"link-underline",children:"Contact support"})," ","if the issue persists."]}),variant:"danger"})},[i,s]),r?n.jsxs("div",{className:"-mt-1",children:[t.allowedTags.map(l=>n.jsx(V0,{tag:l,className:"mr-1 mt-1",invalid:a.all.has(l)?void 0:"not-defined"},l)),t.invalidTags.map(l=>n.jsx(V0,{tag:l,className:"mr-1 mt-1",invalid:a.all.has(l)?"not-tag-owner":"not-defined"},l))]}):n.jsx("div",{className:"-mt-1",children:t.allowedTags.map(l=>n.jsx(yq,{className:"mr-1 mt-1",tag:l},l))})}const M6=e=>e?"When tagged, a machine’s permissions change from matching its creator’s to what is defined in the tailnet policy file.":"By default, a machine’s permissions match its creator’s.",aee={"ip:publicAddress":"Public IP address that this device has most recently used to connect to the Tailscale control plane."};function iee({attributes:e,expiries:t}){const r=Object.entries(e).map(([s,a])=>({name:s,value:a,expiryTime:t?.[s]}));return n.jsxs(n.Fragment,{children:[n.jsx(Ao,{children:"Attributes"}),r.map(s=>n.jsxs(He,{label:s.name,tooltipLabel:aee[s.name],children:[s.value===null?n.jsx(kt,{}):oee(s.value),s.expiryTime&&n.jsxs("span",{className:"text-text-muted",children:[" ","(expires"," ",n.jsx(Fs,{time:new Date(s.expiryTime),format:"relative"}),")"]})]},s.name))]})}function oee(e){if(typeof e!="object")return String(e);if(e.type==="IpAddr")return e.value}function lee(e){const{type:t,previewFor:r,acl:s}=e,[a,i]=f.useState(""),[l,u]=f.useState(),{data:d,error:m}=Eu(),p=s||d?.acl,g=s?a:m||a;return f.useEffect(()=>{if(p===void 0)return;const v=uee(e,p);v!==void 0&&Ie.post(cee(e),v).then(y=>{i(""),u(y?.data?.data)}).catch(y=>{y.response&&y.response.data?i(y.response.data.error):y.request?i("We weren’t able to reach the server. Try again later."):i("An unknown error occurred. Try again later."),u(void 0)})},[t,r,p]),{data:l,error:g}}function cee(e){const t=e.previewFor??"";return`/public/tailnet/-/acl/preview?type=${e.type}&previewFor=${encodeURIComponent(t)}`}function uee(e,t){if(!(e.previewFor===void 0||e.previewFor===""))return t}function dee(e){const{services:t,showMachineRow:r=!0,total:s}=e,a=t.length,i=yt("endpoint",a),{query:l,setQuery:u}=ns();return n.jsxs(n.Fragment,{children:[t.length>0&&n.jsx(We,{variant:"status",className:"mb-4",children:s&&s>t.length?`Showing ${a} ${i} of ${s.toLocaleString()}`:`${a} ${i}`}),n.jsxs("table",{className:"tb",children:[n.jsx("thead",{children:n.jsxs("tr",{children:[n.jsx("th",{className:FE,children:"Endpoint"}),n.jsx("th",{className:D(BE,{"@md:w-1/12":!r}),children:"Type"}),r&&n.jsx("th",{className:UE,children:"Machine"}),n.jsx("th",{className:VE,children:"Access controls"}),n.jsx("th",{className:$E,children:n.jsx("span",{className:"sr-only",children:"Services action menu"})})]})}),n.jsx("tbody",{children:t.length>0?t.sort(bee).map(({service:d,machine:m})=>n.jsx(mee,{service:d,machine:m,showMachineRow:r},d.id)):n.jsx("tr",{children:n.jsx("td",{className:"flex-auto m-6",children:n.jsx(fn,{description:`No endpoints found matching “${l}”`,action:n.jsx("button",{className:"link",onClick:()=>u(""),children:"Clear search"})})})})})]})]})}const mee=ce.memo(e=>{const{service:t,machine:r,showMachineRow:s}=e,{port:a,description:i,type:l,proto:u,id:d}=t,{addresses:m,name:p,user:g,isExternal:v,hasTags:y}=r,C=m.length>0?m[0]:void 0,b=`${C}:${a}`,w=Cee(l),N=f.useMemo(()=>C?hee(l,a,C):void 0,[C,a,l]),k=n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"hover:text-text-primary truncate",children:n.jsx(ze,{to:`/admin/machines/${C}`,className:"font-medium stretched-link",children:p})}),n.jsx("div",{className:"text-text-muted truncate",children:y?n.jsx(Zv,{machine:r}):g})]});return C===void 0?null:n.jsxs("tr",{id:d,className:"w-full px-0.5 hover:bg-gray-0 dark:hover:bg-gray-800",children:[n.jsxs("td",{className:FE,children:[n.jsx("h3",{className:D("font-semibold break-all",{"text-text-muted":i===void 0}),children:i||`${u.toLowerCase()}/${a}`}),n.jsxs(We,{variant:"tag",className:"flex text-sm mr-1",children:[n.jsx("div",{className:"text-text-muted mr-1",children:C}),":",n.jsx("div",{className:"ml-1",children:a})]}),n.jsx(We,{variant:"tag",className:"text-sm",children:u}),s&&n.jsx("div",{className:"@md:hidden",children:k})]}),n.jsxs("td",{className:D(BE,{"@md:w-1/12":!s}),children:[n.jsx(Ee,{content:w!==l&&w,children:n.jsx("h3",{className:"font-semibold text-text-muted",children:l})}),n.jsx("div",{className:"@md:hidden",children:N})]}),s&&n.jsx("td",{className:UE,children:k}),n.jsx("td",{className:VE,children:v?n.jsx(Ee,{content:n.jsx("p",{children:"You have been invited to this endpoint on a shared machine. Full access previews aren’t available for external endpoints."}),children:n.jsx(We,{variant:"tag",color:"orange",className:"text-sm",children:"External"})}):n.jsx(Ee,{content:n.jsx(fee,{ipport:b}),children:n.jsx(bs,{size:20,className:"text-text-muted"})})}),n.jsx("td",{className:$E,children:N})]})}),FE="w-2/3 @md:w-1/5",BE="w-1/3 @md:w-1/6 flex flex-col justify-between items-end @md:items-start",UE="hidden @md:block w-1/4",VE="hidden @md:flex justify-center items-center text-center w-1/6",$E="hidden @md:flex justify-end items-center w-1/6 ml-auto mr-4";function fee(e){const{ipport:t}=e,{data:r,error:s}=lee({type:"ipport",previewFor:t}),a=r?.matches.flatMap(u=>u.users)||[],i=a.length===0,l=a.includes("*");return s?n.jsx(De,{error:{message:s}}):r?n.jsxs("div",{className:"text-left",children:[n.jsx("div",{className:"mb-1 font-semibold",children:"Who can access this endpoint?"}),i?n.jsx(n.Fragment,{children:"This service is not accessible to any users in your network."}):l?n.jsxs("div",{className:"flex items-center",children:[n.jsx(wi,{size:12,className:"mr-1"}),"All users in your network"]}):a.map(u=>n.jsxs("div",{className:"flex items-center m-auto",children:[u.startsWith("group:")?n.jsx(wi,{size:12,className:"mr-1"}):n.jsx(gw,{size:12,className:"mr-1"}),u]},u)),n.jsx("div",{className:"text-sm text-text-muted mt-2",children:"See “Access controls” tab for more details including group definitions."})]}):n.jsx(De,{loadingMessage:"Loading ACLs..."})}function hee(e,t,r){switch(e){case zt.SSH:return n.jsx(xee,{tailscaleAddress:r,servicePort:t});case zt.RDP:case zt.VNC:return vee(e,r,t);case zt.HTTP:case zt.HTTPS:return yee(r,t);default:return}}const pee="text-sm bg-gray-200 dark:bg-gray-900 px-1 rounded",gee="link font-medium mr-4";function xee(e){const{tailscaleAddress:t,servicePort:r}=e,s=et(),a=r===22?`ssh ${t}`:`ssh -p ${r} ${t}`,i=()=>{Rr(a).then(()=>s.show({message:"Command copied to clipboard"})).catch(()=>s.show({message:"Failed to copy command to clipboard"}))};return n.jsx(Ee,{content:n.jsx("code",{className:pee,children:a}),children:n.jsx("button",{onClick:i,className:D(gee,"mr-4"),children:"Copy ssh command"})})}function vee(e,t,r){const s=e===zt.RDP?yw()?`ms-rd:subscribe?url=${t}`:`rdp://full%20address=s:${t}`:`vnc://${t}:${r}`;return n.jsx(Ee,{content:`Note: A client ${e} app is required to directly launch from the endpoint.`,children:n.jsx("a",{href:s,rel:"noopener noreferrer",children:n.jsxs("button",{className:"link flex items-center font-semibold",children:["Launch ",n.jsx(uw,{className:"ml-2",size:20})]})})})}function yee(e,t){return e.includes(":")&&(e="["+e+"]"),n.jsx("a",{className:"link",href:t===443?`https://${e}`:`http://${e}:${t}`,target:"_blank",rel:"noopener noreferrer",children:n.jsxs("button",{className:"link flex items-center font-semibold",children:["Open ",n.jsx(uw,{className:"ml-2",size:20})]})})}function bee(e,t){const r=e.service.type,s=t.service.type;if(r===zt.Other&&s!==zt.Other)return 1;if(r!==zt.Other&&s===zt.Other)return-1;const a=L6.has(r),i=L6.has(s);return a&&!i?-1:!a&&i?1:e.service.port-t.service.port}const L6=new Set([zt.SSH,zt.VNC,zt.RDP]);function Cee(e){if(!Object.values(zt).includes(e))return e;switch(e){case zt.SSH:return"Secure Shell";case zt.DNS:return"Domain Name System";case zt.HTTP:return"Hypertext Transfer Protocol";case zt.HTTPS:return"Hypertext Transfer Protocol Secure";case zt.IPP:return"Internet Printing Protocol";case zt.RDP:return"Remote Desktop Protocol";case zt.VNC:return"Virtual Network Computing";case zt.Plex:return"Media Player";case zt.Other:return"Other"}}function wee(e){const{children:t,trigger:r,asChild:s,side:a,sideOffset:i=10,align:l,alignOffset:u,href:d}=e,m=du(d)?{target:"_blank",rel:"noopener noreferrer"}:{};return n.jsxs(fj,{openDelay:400,closeDelay:300,children:[n.jsx(hj,{href:d,asChild:s,...m,children:r}),n.jsx(Fa.Consumer,{children:p=>n.jsx(pj,{container:p,children:n.jsx(gj,{className:"hovercard bg-bg-base rounded-md px-3 py-3 z-50 max-w-sm",side:a,sideOffset:i,align:l,alignOffset:u,collisionPadding:12,"aria-live":"polite",children:t})})})]})}function Cf(e){const[t,r,s]=e.split(".");if(!t)return;const a=Number.parseInt(t,10);if(Number.isNaN(a))return;let i,l;if(!(r!==void 0&&(i=Number.parseInt(r,10),Number.isNaN(i)))&&!(s!==void 0&&(l=Number.parseInt(s,10),Number.isNaN(l))))return{major:a,minor:i,patch:l}}function jee(e,t){return e.majort.major?1:(e.minor||0)<(t.minor||0)?-1:(e.minor||0)>(t.minor||0)?1:(e.patch||0)<(t.patch||0)?-1:(e.patch||0)>(t.patch||0)?1:0}function See(e,t){return e===void 0||t===void 0?!1:t.major===e.major&&t.minor===e.minor&&t.patch!==0}function kee(e,t){const r=e.length,s=t.length;if(r===0)return s===0?0:-1;if(s===0)return 1;let a=0,i=0;for(;;){for(;;){const l=e[a],u=t[i];if(Ca(l)){if(Ca(u))break;return-1}if(Ca(u))return 1;if(lu)return 1;if(a++,i++,a===r||i===s)return a{t.availableUpdateVersion&&i===2&&l(0)},[t.availableUpdateVersion,i,l]);const{data:u}=dt(()=>i===1?`/public/device/${t.id}/update-status`:null,{refreshInterval:1e3});f.useEffect(()=>{switch(u?.status){case"not-updating":{a.show({key:`${t.name}-updated`,message:`${t.name} updated`}),l(2),s();break}case"error":{a.show({key:`${t.name}-update-failed`,message:`Failed to update ${t.name}`,variant:"danger"}),l(0);break}}},[u,t.name,a,l,s]);const d=f.useCallback(()=>{i!==1&&(l(1),r("update-client",t,void 0,()=>l(0)))},[t,i,r,l]),m=Cf(t.ipnVersion),p=Cf(t.availableUpdateVersion??""),g=See(m,p);let v="https://tailscale.com/kb/1067/update/";const y=t.os.toLowerCase();["windows","macos","ios","android","linux"].includes(y)&&(v+=`?tab=${y}`);let C,b="Update available",w=n.jsxs("p",{className:"mt-1",children:[g?"Patch release":"Version"," ",t.availableUpdateVersion," ","is available."," ",n.jsx("a",{className:"link",href:"https://tailscale.com/changelog/#client",target:"_blank",rel:"noopener noreferrer",children:"Read the release notes"})," ","to find out what’s new!"]});if(m&&Nee(m)==="unstable"&&(w=n.jsxs("p",{className:"mt-1",children:[g?"Patch release":"Version"," ",t.availableUpdateVersion," ","is available."]})),t.availableUpdateSecurity)C="danger",b="Security update available",w=n.jsxs("p",{className:"mt-1",children:["This machine is running a version with a known security vulnerability. It’s recommended to update to ",t.availableUpdateVersion,"."]});else if(t.availableUpdateVOOD){C="warning",b="Update recommended";let N;p?.minor&&m?.minor&&(N=Math.floor((p.minor-m.minor)/2)),w=n.jsxs("p",{className:"mt-1",children:["This machine is ",N??"multiple"," versions out of date. Version ",t.availableUpdateVersion," is available, and it is recommended to update."]})}return n.jsxs(wee,{trigger:n.jsx(Aee,{updating:i,intent:C,ariaLabel:`Update available for ${t.name||t.addresses[0]}`}),href:v,children:[n.jsx("h3",{className:"font-medium",children:b}),w,n.jsx(Pee,{machine:t,updating:i,onClick:()=>d(),className:"mt-2"}),n.jsx("div",{className:"mt-1 text-text-muted",children:n.jsx(Eee,{machine:t})})]})}function Eee(e){const{machine:t}=e;switch(t.os.toLowerCase()){case"macos":return n.jsxs("p",{style:{maxWidth:500},children:["On ",pr(t.os),", update Tailscale from the Mac App Store’s “Updates” page."]});case"ios":return n.jsxs(n.Fragment,{children:["On ",pr(t.os),", update Tailscale from the App Store’s “Updates” page. By default, apps will auto-update."]});case"windows":return n.jsxs(n.Fragment,{children:["On ",pr(t.os),", update Tailscale by downloading the Windows installer from"," ",n.jsx("a",{className:"link",href:"https://tailscale.com/kb/1067/update/?tab=windows",target:"_blank",rel:"noopener noreferrer",children:"our website"}),"."]});case"freebsd":return n.jsxs(n.Fragment,{children:[pr(t.os)," is community-maintained and updates are available from"," ",n.jsx("a",{className:"link",href:"https://www.freshports.org/security/tailscale/",target:"_blank",rel:"noopener noreferrer",children:"Fresh Ports"}),"."]});case"linux":{const r=t.parsedLinuxDistro?.toLowerCase();switch(r){case"ubuntu":case"debian":case"pop!":case"raspbian":return n.jsx(R6,{osVersion:r,command:"sudo apt-get update && sudo apt-get install tailscale"});case"amazon linux 2":return n.jsx(R6,{osVersion:r,command:"sudo yum update tailscale"});case"synology":return n.jsxs(n.Fragment,{children:["To update your ",pr(r)," machine, please check the Synology Package Center."]});default:return n.jsxs(n.Fragment,{children:["Follow"," ",n.jsx("a",{className:"link",href:"https://tailscale.com/kb/1067/update/?tab=linux",target:"_blank",rel:"noopener noreferrer",children:"these instructions"})," ","to update this machine."]})}}case"android":return n.jsxs(n.Fragment,{children:["On ",pr(t.os),", update Tailscale from the Play Store’s “Update” page. By default, apps will auto-update."]});default:return n.jsxs(n.Fragment,{children:["Follow"," ",n.jsx("a",{className:"link",href:"https://tailscale.com/kb/1067/update/",target:"_blank",rel:"noopener noreferrer",children:"these instructions"})," ","to update this machine."]})}}function R6(e){const{osVersion:t,command:r}=e;return n.jsxs(n.Fragment,{children:["On ",pr(t),", use this command to update Tailscale:",n.jsx(xn,{className:"mt-2 w-full",text:r})]})}function Aee(e){const{intent:t,className:r,ariaLabel:s,updating:a}=e;return a===1?n.jsx(ts,{size:"sm"}):n.jsx(_R,{size:"1.125em","aria-label":s,className:D(r,{"text-text-disabled":!t,"text-yellow-200 dark:text-yellow-400":t==="warning","text-text-danger":t==="danger"})})}function Pee(e){const{machine:t,updating:r,onClick:s,className:a}=e,i=Sn(qt(de.Devices).access);if(!t.autoUpdatesEnabled||t.os==="macOS")return null;let l;switch(r){case 0:{l="Start update";break}case 1:{l="Updating";break}case 2:{l="Updated";break}}return n.jsx(ue,{intent:"base",sizeVariant:"small",disabled:r!==0||!i||!t.connectedToControl,onClick:s,className:a,children:l})}function Tee(e,t,r){const{data:s,error:a,mutate:i,isLoading:l}=dt(e?.id&&t&&r?"/machine-cert?id="+encodeURIComponent(e.id)+"&domain="+encodeURIComponent(t):null,u=>e?.ipnVersion?e?.connectedToControl?Ie.get(u).then(d=>d.data?.data):Promise.resolve({notConnected:!0}):Promise.resolve({tooOld:!0}),{refreshInterval:0,errorRetryInterval:15e3});return{data:s,error:a,mutate:i,isLoading:l}}function Iee(e){const{data:t,error:r,mutate:s}=dt(()=>"/machine-debug?ip="+e);return{data:t,error:r,mutate:s}}function Dee(e){const{data:t,error:r,mutate:s}=dt("/public/tailnet/-/discovered-services",e),{setTailnetSettings:a,error:i}=Rt();return{error:r,data:t,setCollectServices:u=>(s({...t,collectServices:u},!1),a({servicesCollection:u}).then(()=>s()).then(()=>{if(i)throw i}).catch(d=>{throw s(),d}))}}function _ee(e){const[,t]=ft(),r=f.useCallback(()=>{t("/admin/machines",{replace:!0})},[t]),s=f.useCallback(a=>{t("/admin/machines/"+a,{replace:!0})},[t]);return n.jsxs(n.Fragment,{children:[n.jsx(Mee,{...e}),n.jsx(IE,{onDelete:r,onRenumber:s})]})}function Mee(e){const{id:t,readonly:r,onDelete:s}=e,{data:a,error:i,isPosting:l,mutate:u,handleAction:d}=sn({refreshInterval:30*1e3}),{data:m}=Dee(),{data:p}=Iee(t),{data:g}=vt(),{data:v}=Ss(),{data:y}=jh(),{data:C}=Rt(),{variant:b}=Fr("machines-dropdown-separate-subnet-router-and-exit-node",!0),w=a?.machines.find(P=>P.addresses.includes(t)),{data:N}=yE({machineId:w?.id}),{hasAnyBadges:k}=RE(w,C?.posturesToBadgeInConsole),{data:E,isLoading:T,error:_}=Tee(w,w?.fqdn,C?.httpsEnabled&&!w?.shareID),I=m?.services,F=f.useMemo(()=>w&&I?I.filter(P=>P.nodeId===w.id).map(P=>({service:P,machine:w})):[],[w,I]);if(i)return n.jsx(De,{error:i});if(!a)return n.jsx(De,{loadingMessage:"Loading machine information..."});if(!w){const q=a?.machines.find(ae=>ae.nodeKey===t)?.addresses[0];if(q)return n.jsx(_i,{to:`/admin/machines/${q}`,replace:!0});const Q={name:"NotFoundError",message:`no machine found at ${t}`};return n.jsx(De,{error:Q})}const z=w.user?v?.users.find(P=>P.loginName===w.user)||v?.externalUsers.find(P=>P.loginName===w.user):void 0,H=new Date(w.expires),J=w.neverExpires?!1:HHm(P)),re=w.addresses.find(P=>r2(P)),me=Object.values(p?.latency||{}).sort((P,q)=>P.latencyMs-q.latencyMs),L=w.name.slice(-1).match(/[a-z]/i),V=w.connectedToControl?"connected":w.ownerDisabledStatus?"restricted":"unknown";return n.jsxs(mn,{className:"mb-24",children:[n.jsxs("header",{className:"pb-4 mb-8",children:[n.jsxs("div",{className:"text-lg font-medium space-x-2 mb-5 truncate flex",children:[n.jsx(ze,{href:"/admin/machines",className:"link",children:"All Machines"}),n.jsx("span",{className:"breadcrumb-divider",children:"/"}),n.jsx(ze,{href:`/admin/machines/${U}`,children:n.jsx(vi,{ip:U})})]}),n.jsxs("div",{className:"flex flex-wrap gap-2 items-center justify-between",children:[n.jsxs("div",{className:"flex gap-3 items-center",children:[n.jsx(is,{title:w.name,classes:`${Et.pageSubTitle} truncate flex-shrink-0 max-w-full`}),n.jsx(Fn,{status:V,size:"large",className:D({"mt-[3px]":L})})]}),n.jsx("div",{className:"flex",children:n.jsx(DE,{machine:w,isPosting:l,handleAction:d,refreshMachineData:u,onDelete:s,splitRouteSettingsVariant:b})})]}),n.jsxs("div",{className:"flex border-t mt-4 pt-4",children:[n.jsxs("div",{className:"max-w-sm",children:[n.jsxs("div",{className:"text-text-muted mb-2",children:["Managed by",n.jsx(Ee,{content:M6(w.hasTags),children:n.jsx(Ee.InfoIcon,{className:"ml-1 relative -top-px"})})]}),n.jsx("div",{className:"mt-0.5",children:n.jsx(OE,{machine:w,avatar:z})})]}),k&&n.jsxs("div",{className:"max-w-sm border-l ml-4 pl-4",children:[n.jsx("p",{className:"text-text-muted mb-2",children:"Status"}),n.jsx(_E,{machine:w,posturesToBadgeInConsole:C?.posturesToBadgeInConsole,splitRouteSettingsVariant:b})]})]}),N?.lockedOut&&n.jsx(Ree,{machine:w})]}),n.jsx(Oee,{machine:w,readonly:r}),n.jsx(Fee,{machine:w,machines:a.machines}),n.jsxs("section",{className:"mb-8",children:[n.jsxs("header",{className:"max-w-xl mb-4",children:[n.jsx("h3",{className:D(Et.sectionTitle,"mb-2"),children:"Machine Details"}),n.jsx("p",{children:"Information about this machine’s network. Used to debug connection issues."})]}),n.jsxs("div",{className:D(Uo,"grid grid-cols-1 @lg:grid-cols-2 gap-y-2 @sm:gap-x-12"),children:[n.jsxs("div",{className:"flex flex-col gap-2",children:[w.hasTags&&n.jsx(He,{label:"ACL tags",tooltipLabel:M6(w.hasTags),noTruncation:!0,children:n.jsx(Zv,{machine:w})}),n.jsx(He,{label:"Creator",children:w.creator}),n.jsx(He,{label:"Machine name",noTruncation:!0,children:n.jsx(Rn,{primaryActionValue:w.name,primaryActionSubject:"hostname",children:w.name})}),n.jsx(He,{label:"OS hostname",tooltipLabel:Uee,children:C7(w.hostname)}),n.jsxs(He,{label:"OS",children:[pr(w.os),w.parsedOSVersion&&n.jsxs(n.Fragment,{children:[" ",w.parsedOSVersion]}),w.osVersion&&n.jsxs(n.Fragment,{children:[" (",w.osVersion,")"]})]}),n.jsx(He,{label:"Tailscale version",children:n.jsxs("div",{className:"flex items-center",children:[p2(w.ipnVersion)," ",w.availableUpdateVersion&&n.jsx("div",{className:"ml-1",children:n.jsx(HE,{machine:w,handleAction:d,refreshMachine:u})})]})}),n.jsx(He,{label:"ID",tooltipLabel:"ID for this machine. Used in the Tailscale API.",noTruncation:!0,children:w.stableId?n.jsx(Rn,{primaryActionValue:w.stableId,primaryActionSubject:"node ID",children:w.stableId}):n.jsx(kt,{})}),n.jsx(He,{label:"Node key",tooltipLabel:"Public key which uniquely identifies this machine.",noTruncation:!0,children:n.jsx(Rn,{primaryActionValue:w.nodeKey,primaryActionSubject:"node key",children:n.jsx("span",{children:w.nodeKey})})}),C?.tailnetLockEnabled&&n.jsx(He,{label:"Tailnet Lock key",tooltipLabel:"Public key which identifies this machine for Tailnet Lock. Use with the CLI to configure Tailnet Lock.",noTruncation:!0,children:N?.key?n.jsx(Rn,{primaryActionValue:N.key,primaryActionSubject:"Tailnet Lock key",children:N.key}):n.jsx(kt,{})}),n.jsx(He,{label:"Created",children:n.jsx(Fs,{time:Y})}),n.jsxs(He,{label:"Last seen",tooltipLabel:"The last time this machine was connected to the Tailscale control plane.",children:[n.jsx(kh,{connected:w.connectedToControl,date:w.lastSeen}),w.connectedToControlIPAddr&&n.jsxs(n.Fragment,{children:[" from ",w.connectedToControlIPAddr]})]}),n.jsx(He,{label:"Key expiry",children:w.neverExpires?"No expiry":n.jsxs("div",{className:"flex",children:[n.jsx(Fs,{time:H,format:"relative"}),J&&w.authURL&&n.jsx("button",{className:"text-text-primary ml-2",onClick:()=>window.open(vr(w.authURL),"_blank","noopener,noreferrer"),children:"Reauthenticate"})]})}),g.devicePosture&&B&&(B.needsUpgrade?n.jsx(He,{label:"Serial number",tooltipLabel:"Serial number collection was added in Tailscale v1.52.",children:n.jsx("ul",{className:"pl-3 -indent-3",children:n.jsx("li",{children:n.jsx("span",{className:"text-text-muted",children:"Upgrade client to collect"})})})}):B.notCollected?n.jsx(He,{label:"Serial number",tooltipLabel:n.jsxs(n.Fragment,{children:["This machine’s serial number will be collected when it reconnects."," ",w.connectedToControl&&n.jsx(n.Fragment,{children:"If you have just enabled posture-checking, you may need to restart Tailscale for serial numbers to be collected."})]}),children:n.jsx("ul",{className:"pl-3 -indent-3",children:n.jsx("li",{children:n.jsx("span",{className:"text-text-muted",children:"Waiting for machine to reconnect"})})})}):B.nodeDisabled?n.jsx(He,{label:"Serial number",tooltipLabel:n.jsxs("span",{children:["Serial number reporting was disabled on this machine when last collected"," ",W&&n.jsx(Fs,{time:W}),"."]}),children:n.jsx("ul",{className:"pl-3 -indent-3",children:n.jsx("li",{children:n.jsx("span",{className:"text-text-muted",children:"Disabled on this machine"})})})}):n.jsx(He,{label:"Serial number"+((B.serialNumbers?.length||0)>1?"s":""),tooltipLabel:W&&n.jsxs("span",{children:["Last updated on ",n.jsx(Fs,{time:W}),"."]}),children:n.jsx("ul",{className:"pl-3 -indent-3",children:B.serialNumbers?.length?B.serialNumbers.map(P=>n.jsx("li",{className:"select-all",children:P},P)):n.jsx("li",{children:n.jsx(kt,{})})})})),g.devicePosture&&B&&(B.hardwareAddresses?.length||0)>0&&n.jsx(He,{label:"Hardware address"+((B.hardwareAddresses?.length||0)>1?"es":""),tooltipLabel:W&&n.jsxs("span",{children:["Last updated on ",n.jsx(Fs,{time:W}),"."]}),children:n.jsx("ul",{className:"pl-3 -indent-3",children:B.hardwareAddresses?.length?B.hardwareAddresses.map(P=>n.jsx("li",{className:"select-all",children:P},P)):n.jsx("li",{children:n.jsx(kt,{})})})}),p?.attributes&&n.jsx(iee,{...p.attributes}),p?.postures&&p.postures.length>0&&n.jsx(Vee,{postures:p.postures}),n.jsx(Ao,{children:"Relays"}),n.jsx(He,{label:"Latency",tooltipLabel:"Latency from Tailscale relay (DERP) servers, used when machines cannot connect peer-to-peer. Checkmark indicates preferred relays.",children:n.jsx("ul",{children:me.length>0?me.map(P=>n.jsxs("li",{className:"whitespace-nowrap",children:[n.jsx("strong",{className:"font-medium",children:P.regionName}),":"," ",P.latencyMs.toFixed(2)," ms",P.preferred&&n.jsx(nn,{"aria-label":"Preferred Relay",className:"relative inline-block ml-1 -top-px",size:"1em"})]},P.regionName)):n.jsx("li",{children:n.jsx(kt,{})})})})]}),n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx(Ao,{children:"Addresses"}),n.jsx(He,{label:"Tailscale IPv4",tooltipLabel:"This machine’s IPv4 address within your tailnet (your private Tailscale network).",noTruncation:!0,children:Z?n.jsx(Rn,{primaryActionValue:Z,primaryActionSubject:"Tailscale IPv4 address",children:n.jsx(vi,{ip:Z})}):n.jsx(kt,{})}),n.jsx(He,{label:"Tailscale IPv6",tooltipLabel:"This machine’s IPv6 address within your tailnet (your private Tailscale network). Connections within your tailnet support IPv6 even if your ISP does not.",noTruncation:!0,children:re?n.jsx(Rn,{primaryActionValue:re,primaryActionSubject:"Tailscale IPv6 address",children:n.jsx(vi,{ip:re})}):n.jsx(kt,{})}),y&&n.jsx(Lee,{machine:w,dnsPreferences:y}),n.jsx(He,{label:"Endpoints",tooltipLabel:"This machine’s candidate IP addresses and port numbers (local and public) that peer devices can use to try to connect to it directly.",children:n.jsx("ul",{className:"pl-3 -indent-3",children:p?.endpoints&&p.endpoints.length>0?p.endpoints.map(P=>n.jsx("li",{className:"select-all",children:A$(P)},P)):n.jsx("li",{children:n.jsx(kt,{})})})}),n.jsx(Ao,{children:"Client Connectivity"}),n.jsx(He,{label:"Varies",tooltipLabel:"Whether the machine is behind a difficult NAT that varies the machine’s IP address depending on the destination.",children:bo(p?.mappingVariesByDestIP)}),n.jsx(He,{label:"IPv6",children:bo(p?.ipv6)}),n.jsx(He,{label:"UDP",children:bo(p?.udp)}),n.jsx(He,{label:"UPnP",children:bo(p?.upnp)}),n.jsx(He,{label:"PCP",children:bo(p?.pcp)}),n.jsx(He,{label:"NAT-PMP",children:bo(p?.pmp)}),E||T||_?n.jsxs(n.Fragment,{children:[n.jsx(Ao,{children:"TLS Certificate"}),n.jsx(He,{label:"Domain",children:E?.domain||w.fqdn}),_?n.jsx(He,{label:"Error",children:n.jsx("span",{className:"text-text-muted",children:"Could not retrieve status from machine"})}):null,T?n.jsx(He,{label:"Status",children:n.jsx("span",{className:"text-text-muted",children:n.jsx(tX,{label:"Loading"})})}):E?.valid?n.jsxs(He,{label:"Status",children:["Valid",E?.notAfter?n.jsxs(n.Fragment,{children:[" ","until"," ",n.jsx(Fs,{time:new Date(E.notAfter),format:"relative"})]}):null]}):E?.notConnected?n.jsx(He,{label:"Status",tooltipLabel:"TLS Certificate Status can only be refreshed when the machine is connected.",children:n.jsx("span",{className:"text-text-muted",children:"Machine not connected"})}):E?.shared?n.jsx(He,{label:"Status",children:n.jsx("span",{className:"text-text-muted",children:"Can’t check shared node cert status"})}):E?.tooOld?n.jsx(He,{label:"Status",tooltipLabel:"TLS Certificate Status reporting was added in Tailscale v1.56.",children:n.jsx("span",{className:"text-text-muted",children:"Upgrade client to check status"})}):E?.expired?n.jsx(He,{label:"Status",tooltipLabel:"A new certificate needs to be generated.",children:"Certificate expired"}):E?.missing?n.jsx(He,{label:"Status",tooltipLabel:"No certificate found. This either means that no certificate was generated, or the file containing the certificate has been moved.",children:"No certificate found"}):E?.error?n.jsx(He,{label:"Status",tooltipLabel:n.jsxs(n.Fragment,{children:["Please consider recreating your certificate.",n.jsx("br",{}),n.jsx("code",{children:E.error})]}),children:"Invalid certificate"}):(E&&console.error("Unable to render tlsCertStatus",E),null)]}):null]})]})]}),m?.collectServices===!0&&n.jsxs("section",{className:"mb-8",children:[n.jsxs("header",{className:"max-w-xl mb-4",children:[n.jsxs("h3",{className:"mb-2",children:[n.jsx("span",{className:Et.sectionTitle,children:"Endpoints"}),n.jsx(eX,{className:"ml-2 -top-px"})]}),n.jsxs("p",{children:["Live endpoints running on this machine."," ",n.jsx(Ge,{kbTopic:"services",url:"https://tailscale.com/kb/1100/services"})]})]}),F.length===0?n.jsx("div",{className:D(Uo,tx),children:"This machine is not reporting any endpoints."}):n.jsx(dee,{services:F,showMachineRow:!1})]})]})}function Lee({machine:e,dnsPreferences:t}){const r=Mv(e,t.magicDNS),s=Gk(e,t.magicDNS);return n.jsxs(n.Fragment,{children:[r&&n.jsx(He,{label:"Short domain",tooltipLabel:"Users of your tailnet can use this DNS short name to access this machine.",noTruncation:!0,children:n.jsx(Rn,{primaryActionValue:r,primaryActionSubject:"short domain",children:r})}),s&&n.jsx(He,{label:"Full domain",tooltipLabel:e.isExternal?"Users of your tailnet can use this DNS name to access this machine.":"Users of your tailnet, and those you’ve shared this device with, can use this DNS name to access this machine.",noTruncation:!0,children:n.jsx(Rn,{primaryActionValue:s,primaryActionSubject:"full domain",children:s})})]})}function Ree({machine:e}){const{setOpenDialog:t}=Iu();return n.jsxs(rt,{className:"mt-6",title:"Locked out by Tailnet Lock",intent:"warning",children:[n.jsx("p",{children:"This machine cannot access the network until signed by a trusted tailnet lock key."}),n.jsx("div",{className:"flex gap-2 flex-wrap mt-2 relative",children:n.jsx(ue,{className:"mt-2",onClick:()=>t("locked-out-instructions",e.id),prefixIcon:n.jsx(qx,{}),intent:"warning",sizeVariant:"small",children:"Sign machine"})})]})}function Oee(e){const{machine:t,readonly:r}=e,{setOpenDialog:s}=Iu(),[a,i]=f.useState(!1),l=f.useMemo(()=>t.extraIPs.length>5||t.allowedIPs.length>5,[t]);return n.jsxs("section",{className:"mb-8",children:[n.jsxs("header",{className:"flex justify-between mb-4",children:[n.jsxs("div",{className:"max-w-xl",children:[n.jsx("h3",{className:D(Et.sectionTitle,"mb-2"),children:"Subnets"}),n.jsxs("p",{children:["Subnets let you expose physical network routes onto Tailscale."," ",n.jsx(Ge,{kbTopic:"subnet routers",url:"https://tailscale.com/kb/1019/subnets"})]})]}),t.hasSubnets&&!t.isExternal&&!r&&n.jsx("div",{children:n.jsx(ue,{className:"mt-2",onClick:()=>s("route-settings",t.id),children:"Review"})})]}),t.isExternal?n.jsx("div",{className:D(Uo,tx),children:n.jsx(fn,{description:`This machine is a shared device. Shared devices cannot expose routes on your network.`})}):t.hasSubnets?n.jsxs("div",{className:D(Uo,"flex flex-col gap-4"),children:[n.jsxs("div",{className:"grid @sm:grid-cols-2 @md:grid-cols-4 gap-8 mr-2",children:[n.jsxs(wf,{title:"Approved",tooltip:"Traffic to these routes are being routed through this machine.",children:[n.jsxs("ul",{className:"leading-normal",children:[t.allowedIPs.length>0?n.jsxs(n.Fragment,{children:[t.allowedIPs.slice(0,5).map(u=>n.jsx("li",{children:u},u)),!a&&t.allowedIPs.length>5&&`+ ${t.allowedIPs.length-5} more`]}):n.jsx(kt,{}),a&&t.allowedIPs.slice(5).map(u=>n.jsx("li",{children:u},u))]}),n.jsx(Fo,{setOnEditOpenDialog:()=>s("route-settings",t.id)})]}),n.jsxs(wf,{title:"Awaiting Approval",tooltip:"This machine is advertising these routes, but they must be approved before traffic will be routed to them.",children:[n.jsxs("ul",{className:"leading-normal",children:[t.extraIPs.length>0?n.jsxs(n.Fragment,{children:[t.extraIPs.slice(0,5).map(u=>n.jsx("li",{children:u},u)),!a&&t.extraIPs.length>5&&n.jsxs("li",{children:["+ ",t.extraIPs.length-5," more"]})]}):n.jsx(kt,{}),a&&t.extraIPs.slice(5).map(u=>n.jsx("li",{title:"This IP is a subnet that has not been enabled.",children:u},u))]}),n.jsx(Fo,{setOnEditOpenDialog:()=>s("route-settings",t.id)})]})]}),l&&n.jsx("div",{className:"flex justify-center w-full -mb-2",children:n.jsx(ue,{variant:"minimal",className:"w-full font-normal",suffixIcon:a?n.jsx(rw,{}):n.jsx(Nn,{}),"aria-label":"See all subnets for this device.",onClick:()=>i(!a),children:a?"Collapse subnets":"Show all subnets"})})]}):n.jsx("div",{className:D(Uo,tx),children:n.jsx(fn,{description:"This machine does not expose any routes."})})]})}function Fee(e){const{machine:t,machines:r}=e,{data:s}=Hi(),{setOpenDialog:a}=Iu(),i=f.useMemo(()=>s?.appConnectors.filter(l=>t!==void 0&&l.nodeIDs?.includes(t.stableId)),[s,t]);return n.jsxs("section",{className:"mb-8",children:[n.jsx("header",{className:"flex justify-between mb-4",children:n.jsxs("div",{className:"max-w-xl",children:[n.jsx("h3",{className:D(Et.sectionTitle,"mb-2"),children:"Routing Settings"}),n.jsxs("p",{children:["Let this device route traffic for your tailnet."," ",n.jsx(Ge,{kbTopic:"route",url:"https://tailscale.com/kb/route/"})]})]})}),n.jsxs("div",{className:D(Uo,"grid @sm:grid-cols-2 @md:grid-cols-4 gap-8 mr-2"),children:[n.jsx(wf,{title:"Exit Node",tooltip:"Whether this machine can act as an exit node for your tailnet.",children:n.jsx(Bee,{machine:t,onEdit:()=>a("route-settings",t.id)})}),n.jsx(wf,{title:"Apps",tooltip:"This machine routes traffic for these apps.",children:n.jsx("ul",{className:"leading-normal",children:i?.length?i.map(l=>{const[u]=Rv(l,r.filter(d=>l.nodeIDs?.includes(d.stableId)));return n.jsx("li",{className:"items-center",children:n.jsxs(ze,{href:`/admin/apps/${l.name}`,className:"link","aria-label":`Detail view for ${l.name}`,children:[n.jsx(Fn,{className:"mr-1",status:u}),l.name]})},l.name)}):n.jsx(kt,{})})})]})]})}function wf(e){const{className:t,title:r,tooltip:s,children:a}=e;return n.jsxs("div",{className:t,children:[n.jsxs("span",{className:"text-text-muted",children:[r,n.jsx(Ee,{content:s,children:n.jsx(Ee.InfoIcon,{className:"relative -top-px text-text-muted hover:text-text-base ml-1"})})]}),n.jsx("div",{className:"mt-1",children:a})]})}function Bee({machine:e,onEdit:t}){const r={icon:null,message:""};return e.allowedExitNode!==e.advertisedExitNode?(r.icon=n.jsx(Oa,{className:"text-orange-500 relative top-[3px] mr-1.5",size:"1em"}),r.message=e.allowedExitNode?"Allowed, but not advertising":"Awaiting approval"):e.allowedExitNode?(r.icon=n.jsx(Wx,{className:"text-text-success relative top-[3px] mr-1.5",size:"1em"}),r.message="Allowed"):(r.icon=n.jsx(HR,{className:"text-text-muted relative top-[3px] mr-1.5",size:"1em"}),r.message="Not Allowed"),n.jsxs("div",{className:"flex items-start",children:[r.icon,n.jsxs("div",{className:"flex flex-col",children:[r.message,n.jsx(Fo,{setOnEditOpenDialog:t})]})]})}const Uee=n.jsxs(n.Fragment,{children:[n.jsx("p",{children:"OS hostname is published by the machine’s operating system and is used as the default name for the machine."}),n.jsx("p",{className:"pt-2",children:"The machine name may differ from the OS hostname if it conflicts with a machine already on the network or has manually been renamed by an admin."})]}),Uo="p-4 @md:p-6 border rounded-md",tx="flex items-center justify-center text-text-muted text-center";function Vee({postures:e}){const{data:t}=vt();if(t.postureTroubleshootingAlpha){const r=[],s=[];return e.sort((a,i)=>a.name>i.name?1:-1).forEach(a=>{a.isImpacting?r.push(a):s.push(a)}),n.jsxs(n.Fragment,{children:[r.length>0&&n.jsx(Mg,{heading:"Postures Impacting Connectivity",postures:r}),s.length>0&&n.jsx(Mg,{heading:"Postures Not Impacting Connectivity",postures:s})]})}else{const r=e.sort((s,a)=>s.name>a.name?1:-1);return n.jsx(Mg,{heading:"Postures",postures:r})}}function Mg({heading:e,postures:t}){return n.jsxs(n.Fragment,{children:[n.jsx(Ao,{children:e}),t.map(({name:r,isMatching:s,failingAssertions:a})=>n.jsxs(He,{label:r,children:[s?"matching":"not matching",!s&&n.jsx($ee,{failingAssertions:a})]},r))]})}function $ee({failingAssertions:e}){return n.jsx(Ee,{content:n.jsxs(n.Fragment,{children:["This device is failing the following assertion",e.length===1?"":"s",":",e.map(t=>n.jsxs(ce.Fragment,{children:[n.jsx("br",{}),t]},t))]}),children:n.jsx(eF,{size:"1.2em",className:"relative -top-px text-text-muted hover:text-text-base ml-1 cursor-default inline-flex"})})}const zE=e=>f.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M8.375 6.75L8.41667 7.70833L7.75 8.95833L6.70833 11L6.5 12.7083L7.25 15.125L8.95833 16.0833H11.5417L13.9583 14.25L15.0417 11.375L12.5417 8.33333L11.8333 6.625L8.375 6.75Z",fill:"#ECEFF1"}),f.createElement("path",{d:"M14.2918 9.12527C13.6251 8.16693 13.0835 7.5836 12.7918 6.37526C12.5001 5.16693 12.8751 5.50027 12.6251 4.4586C12.5001 3.91693 12.2918 3.54193 12.0835 3.25027C11.8335 2.9586 11.5418 2.79193 11.3751 2.75027C11.0001 2.54193 10.1251 2.2086 9.04181 2.79193C7.91681 3.37527 8.04181 4.62527 8.25014 7.16693C8.25014 7.3336 8.20847 7.54193 8.12514 7.7086C7.95847 8.0836 7.66681 8.41693 7.41681 8.7086C7.12514 9.12527 6.83347 9.54193 6.62514 10.0003C6.12514 10.9586 5.66681 12.1669 5.79181 12.6253C6.00014 12.5836 8.62514 16.5836 8.62514 16.6669C8.79181 16.6253 9.50014 16.6253 10.1251 16.6253C11.0001 16.5836 11.5001 16.5419 12.2085 16.7086C12.2085 16.5836 12.1668 16.4586 12.1668 16.3336C12.1668 16.0836 12.2085 15.8753 12.2501 15.5836C12.2918 15.3753 12.3335 15.1669 12.3751 14.9169C11.9585 15.2919 11.2085 15.7086 10.5001 15.8336C9.87514 15.9586 8.83347 15.7503 8.33347 15.1253C8.37514 15.1253 8.45847 15.1253 8.50014 15.0836C8.62514 15.0419 8.75014 15.0003 8.79181 14.9169C8.91681 14.7086 8.83347 14.5003 8.75014 14.3753C8.66681 14.2503 8.04181 13.7919 7.75014 13.5419C7.45847 13.2919 7.29181 13.1669 7.12514 13.0003C7.12514 13.0003 6.87514 12.7503 6.79181 12.6669C6.70847 12.5836 6.66681 12.5003 6.62514 12.4586C6.54181 12.2503 6.50014 12.0003 6.54181 11.6669C6.58347 11.2086 6.75014 10.8336 6.95847 10.4169C7.04181 10.2503 7.25014 9.91693 7.25014 9.91693C7.25014 9.91693 6.54181 11.6669 6.91681 12.2086C6.91681 12.2086 6.95847 11.6669 7.12514 11.1253C7.25014 10.7503 7.45847 10.2086 7.70847 9.91693C7.95847 9.62527 8.58347 8.54193 8.62514 7.87527C8.62514 7.5836 8.66681 7.29193 8.66681 7.0836C8.50014 6.91693 11.4168 6.50027 11.5835 6.9586C11.6251 7.12527 12.2085 8.62527 12.5418 9.41693C12.7085 9.79193 12.9168 10.1253 13.0418 10.5419C13.1668 11.0003 13.2501 11.6253 13.2501 12.2503C13.2501 12.3753 13.2501 12.5836 13.2085 12.7919C13.2918 12.7919 14.9168 11.0419 13.0001 9.5836C13.0001 9.5836 14.1668 10.1253 14.2085 11.2086C14.2501 12.0836 13.8751 12.7919 13.7918 12.9169C13.8335 12.9169 14.6668 13.2919 14.7085 13.2919C14.8751 13.2919 15.2085 13.1669 15.2085 13.1669C15.2501 13.0419 15.3751 12.7086 15.3751 12.5836C15.6668 11.6253 14.9585 10.0836 14.2918 9.12527Z",fill:"#263238"}),f.createElement("path",{d:"M8.99992 6.3776C9.29907 6.3776 9.54159 6.00451 9.54159 5.54427C9.54159 5.08403 9.29907 4.71094 8.99992 4.71094C8.70076 4.71094 8.45825 5.08403 8.45825 5.54427C8.45825 6.00451 8.70076 6.3776 8.99992 6.3776Z",fill:"#ECEFF1"}),f.createElement("path",{d:"M10.8748 6.45964C11.266 6.45964 11.5832 6.03058 11.5832 5.5013C11.5832 4.97203 11.266 4.54297 10.8748 4.54297C10.4836 4.54297 10.1665 4.97203 10.1665 5.5013C10.1665 6.03058 10.4836 6.45964 10.8748 6.45964Z",fill:"#ECEFF1"}),f.createElement("path",{d:"M9.30265 5.59877C9.26802 5.32481 9.11039 5.11909 8.95058 5.13929C8.79077 5.15949 8.68929 5.39796 8.72392 5.67192C8.75855 5.94588 8.91617 6.15159 9.07598 6.13139C9.23579 6.11119 9.33727 5.87273 9.30265 5.59877Z",fill:"#212121"}),f.createElement("path",{d:"M10.8332 6.20833C11.0633 6.20833 11.2498 5.96582 11.2498 5.66667C11.2498 5.36751 11.0633 5.125 10.8332 5.125C10.6031 5.125 10.4165 5.36751 10.4165 5.66667C10.4165 5.96582 10.6031 6.20833 10.8332 6.20833Z",fill:"#212121"}),f.createElement("path",{d:"M16.3749 14.8346C16.2083 14.7513 15.9166 14.6263 15.6666 14.2513C15.5416 14.043 15.5833 13.4596 15.3749 13.2096C15.2499 13.043 15.0833 13.1263 15.0416 13.1263C14.6666 13.2096 13.7916 13.793 13.2083 13.1263C13.1249 13.043 12.9999 12.918 12.7916 12.918C12.5833 12.918 12.4999 13.0013 12.4166 13.168C12.3333 13.3346 12.3333 13.4596 12.3333 13.8763C12.3333 14.2096 12.3333 14.5846 12.2916 14.8763C12.2083 15.5846 12.0833 16.0013 12.0833 16.418C12.0833 16.8763 12.2083 17.168 12.3749 17.293C12.4999 17.418 12.7083 17.5013 13.1666 17.5013C13.6249 17.5013 13.9166 17.3346 14.2083 17.043C14.4166 16.8346 14.5833 16.7513 15.1666 16.3346C15.6249 16.043 16.3333 15.668 16.4583 15.543C16.5416 15.4596 16.6666 15.418 16.6666 15.168C16.6666 14.9596 16.4999 14.8763 16.3749 14.8346Z",fill:"#FFC107"}),f.createElement("path",{d:"M8.00002 14.9635C7.58335 14.2969 7.54168 14.1719 7.25002 13.7552C7.00002 13.3385 6.45835 12.5469 6.12502 12.5469C5.87502 12.5469 5.75002 12.6719 5.58335 12.8385C5.41668 13.0052 5.25002 13.3802 4.95835 13.5885C4.70835 13.7969 4.00002 13.7552 3.83335 14.0052C3.66668 14.2552 4.00002 14.6302 4.00002 15.2552C4.00002 15.5052 3.79168 15.6719 3.75002 15.8385C3.70835 16.0469 3.66668 16.1719 3.75002 16.3385C3.91668 16.5885 4.12502 16.6719 5.54168 16.9635C6.29168 17.1302 7.00002 17.5469 7.45835 17.5885C7.91668 17.6302 8.70835 17.5885 8.70835 16.4635C8.75002 15.7969 8.37502 15.6302 8.00002 14.9635Z",fill:"#FFC107"}),f.createElement("path",{d:"M8.79159 7.41927C8.54159 7.2526 8.33325 7.08594 8.33325 6.83594C8.33325 6.58594 8.49992 6.5026 8.74992 6.29427C8.79159 6.2526 9.24992 5.83594 9.70825 5.83594C10.1666 5.83594 10.7083 6.1276 10.9166 6.21094C11.2916 6.29427 11.6666 6.3776 11.6249 6.66927C11.5833 7.08594 11.5416 7.16927 11.1249 7.3776C10.8333 7.46094 10.2916 7.91927 9.91658 7.91927C9.74992 7.91927 9.49992 7.91927 9.33325 7.8776C9.20825 7.83594 8.99992 7.6276 8.79159 7.41927Z",fill:"#FFC107"}),f.createElement("path",{d:"M8.70844 7.08404C8.79178 7.16737 8.91678 7.25071 9.04178 7.29237C9.12511 7.33404 9.25011 7.37571 9.25011 7.37571C9.41678 7.37571 9.54178 7.37571 9.62511 7.37571C9.83344 7.37571 10.1251 7.29237 10.4168 7.12571C10.7084 7.00071 10.7501 6.91737 10.9584 6.83404C11.1668 6.70904 11.3751 6.58404 11.2918 6.54237C11.2084 6.50071 11.1251 6.54237 10.8334 6.70904C10.5834 6.87571 10.3751 6.95904 10.1251 7.08404C10.0001 7.12571 9.83344 7.20904 9.70844 7.20904C9.58344 7.20904 9.45844 7.20904 9.33344 7.20904C9.20844 7.20904 9.12511 7.16737 9.00011 7.12571C8.91678 7.08404 8.87511 7.04237 8.83344 7.04237C8.75011 7.00071 8.58344 6.83404 8.50011 6.79237C8.50011 6.79237 8.41678 6.79237 8.45844 6.83404C8.58344 6.95904 8.62511 7.00071 8.70844 7.08404Z",fill:"#634703"}),f.createElement("path",{d:"M9.9585 6.16799C10.0002 6.25133 10.0835 6.25133 10.1252 6.29299C10.1668 6.33466 10.2085 6.33466 10.2085 6.33466C10.2502 6.29299 10.2085 6.20966 10.1668 6.20966C10.1668 6.12633 9.9585 6.12633 9.9585 6.16799Z",fill:"#634703"}),f.createElement("path",{d:"M9.29175 6.25C9.29175 6.29167 9.37508 6.33333 9.37508 6.29167C9.41675 6.25 9.45841 6.20833 9.50008 6.20833C9.58341 6.16667 9.54175 6.125 9.41675 6.125C9.33342 6.16667 9.33341 6.20833 9.29175 6.25Z",fill:"#634703"}),f.createElement("path",{d:"M13.3334 13.6254C13.3334 13.667 13.3334 13.7087 13.3334 13.7504C13.4167 13.917 13.6251 13.9587 13.7917 13.9587C14.0417 13.9587 14.2917 13.792 14.4167 13.6254C14.4167 13.5837 14.4584 13.542 14.5001 13.5004C14.5834 13.3754 14.6251 13.292 14.6667 13.2504C14.6667 13.2504 14.6251 13.2087 14.6251 13.167C14.5834 13.0837 14.4584 13.0004 14.2917 12.9587C14.1667 12.917 13.9584 12.8754 13.8751 12.8754C13.5001 12.8337 13.2917 12.9587 13.1667 13.0837C13.1667 13.0837 13.2084 13.0837 13.2084 13.1254C13.2917 13.2087 13.3334 13.292 13.3334 13.417C13.3751 13.5004 13.3334 13.542 13.3334 13.6254Z",fill:"#455A64"})),WE=e=>f.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.69999 1H11L12 18.9999H3.69999C2.20883 18.9999 1 17.7911 1 16.2999V3.69999C1 2.20883 2.20883 1 3.69999 1Z",fill:"url(#paint0_linear_22140_3595)"}),f.createElement("path",{d:"M16.2999 1H10.6468C9.90153 2.72968 8.5656 5.55623 8.50935 10.9632C8.5084 11.0098 8.51683 11.0561 8.53412 11.0994C8.5514 11.1427 8.57721 11.1821 8.61 11.2152C8.64278 11.2483 8.68189 11.2745 8.72499 11.2922C8.76809 11.3099 8.81431 11.3188 8.86091 11.3183H10.9246C10.9712 11.3183 11.0173 11.3276 11.0602 11.3458C11.1032 11.3639 11.142 11.3905 11.1745 11.424C11.2069 11.4574 11.2324 11.497 11.2492 11.5405C11.2661 11.5839 11.274 11.6303 11.2726 11.6769C11.2213 14.1354 11.4466 16.5918 11.9441 18.9999H16.2999C17.016 18.9999 17.7028 18.7155 18.2091 18.2091C18.7155 17.7028 18.9999 17.016 18.9999 16.2999V3.69999C18.9999 2.98391 18.7155 2.29715 18.2091 1.79081C17.7028 1.28446 17.016 1 16.2999 1Z",fill:"url(#paint1_linear_22140_3595)"}),f.createElement("path",{d:"M14.0428 6.23828V7.43359M5.99209 6.23828V7.43359M15.2522 12.6086C13.842 13.9688 11.9592 14.7289 9.99988 14.7289C8.04061 14.7289 6.15774 13.9688 4.74756 12.6086",stroke:"black",strokeWidth:.703122,strokeLinecap:"round"}),f.createElement("defs",null,f.createElement("linearGradient",{id:"paint0_linear_22140_3595",x1:1,y1:1800.99,x2:1,y2:1,gradientUnits:"userSpaceOnUse"},f.createElement("stop",{stopColor:"#1E73F2"}),f.createElement("stop",{offset:1,stopColor:"#19D3FD"})),f.createElement("linearGradient",{id:"paint1_linear_22140_3595",x1:8.50928,y1:1800.99,x2:8.50928,y2:1,gradientUnits:"userSpaceOnUse"},f.createElement("stop",{stopColor:"#DBE9F4"}),f.createElement("stop",{offset:1,stopColor:"#F7F6F6"})))),KE=e=>f.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M1 3.55638L8.35604 2.55461L8.35934 9.6501L1.0068 9.69194L1 3.55638ZM8.35253 10.4676L8.35831 17.5693L1.00577 16.5584L1.00536 10.42L8.35253 10.4676ZM9.24424 2.42351L18.9977 1V9.55982L9.24424 9.63732V2.42351ZM19 10.5344L18.9977 19.0557L9.24424 17.6791L9.23063 10.5185L19 10.5344Z",fill:"#00ADEF"})),Hee=e=>f.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M10 19C14.9706 19 19 14.9706 19 10C19 5.02944 14.9706 1 10 1C5.02944 1 1 5.02944 1 10C1 14.9706 5.02944 19 10 19Z",fill:"#232F3E"}),f.createElement("path",{d:"M8.03609 9.41914C8.03609 9.52988 8.04839 9.61953 8.06949 9.68457C8.0941 9.75137 8.12398 9.82344 8.16617 9.90078C8.18199 9.92363 8.18726 9.94824 8.18726 9.96934C8.18726 9.99922 8.16968 10.0291 8.13101 10.059L7.94292 10.1838C7.92007 10.1996 7.89371 10.2102 7.86558 10.2102C7.8357 10.2102 7.80581 10.1943 7.77593 10.168C7.7355 10.124 7.70035 10.0783 7.66871 10.0273C7.63531 9.96934 7.60367 9.91133 7.57554 9.85156C7.34175 10.1275 7.0482 10.2646 6.69488 10.2646C6.44351 10.2646 6.24312 10.1926 6.09722 10.0502C5.95132 9.90605 5.87574 9.71445 5.87574 9.47539C5.87574 9.22051 5.96538 9.01484 6.1482 8.8584C6.33101 8.70195 6.57359 8.62461 6.88121 8.62461C6.98316 8.62461 7.08863 8.6334 7.19761 8.64922C7.30835 8.66504 7.42261 8.68789 7.54214 8.71602V8.49805C7.54214 8.27129 7.49468 8.11133 7.40152 8.01992C7.3066 7.92676 7.14488 7.88281 6.9146 7.88281C6.80913 7.88281 6.70191 7.89512 6.59117 7.92148C6.48042 7.94785 6.3732 7.98125 6.26773 8.02344C6.23433 8.03926 6.19917 8.05156 6.16226 8.06211C6.14644 8.06738 6.13062 8.06914 6.1148 8.0709C6.07261 8.0709 6.05152 8.04102 6.05152 7.97773V7.83184C6.05152 7.78437 6.05679 7.74746 6.07261 7.72637C6.09546 7.7 6.12359 7.67715 6.15699 7.66309C6.26246 7.60859 6.38726 7.56465 6.53316 7.52773C6.68609 7.48906 6.84253 7.46973 7.00074 7.47148C7.35757 7.47148 7.61773 7.55234 7.78472 7.71406C7.94996 7.87578 8.03257 8.12012 8.03257 8.45059V9.4209L8.03609 9.41914ZM6.82144 9.87441C6.91988 9.87441 7.02183 9.85684 7.12906 9.81992C7.23628 9.78477 7.33296 9.71797 7.41382 9.62832C7.46128 9.57207 7.4982 9.50879 7.51578 9.43672C7.53335 9.36465 7.54566 9.27852 7.54566 9.17656V9.05176C7.45425 9.02891 7.36285 9.01309 7.26968 9.00078C7.17652 8.98848 7.0816 8.9832 6.98843 8.9832C6.78804 8.9832 6.64038 9.02188 6.54195 9.10273C6.44351 9.18359 6.39605 9.29785 6.39605 9.44727C6.39605 9.58789 6.4312 9.69336 6.50679 9.76367C6.57886 9.83926 6.68257 9.87441 6.82144 9.87441ZM9.22437 10.1979C9.16988 10.1979 9.13472 10.1891 9.11011 10.168C9.0855 10.1504 9.06441 10.1082 9.04683 10.052L8.34371 7.73867C8.32964 7.7 8.32085 7.65957 8.31734 7.61914C8.31734 7.57168 8.34195 7.54355 8.38941 7.54355H8.68296C8.73921 7.54355 8.77789 7.55234 8.79898 7.57344C8.82359 7.59102 8.84117 7.6332 8.85874 7.69121L9.36148 9.67227L9.82906 7.69121C9.84488 7.63144 9.86246 7.59277 9.88531 7.57344C9.92046 7.55059 9.96265 7.54004 10.0048 7.54355H10.2457C10.3019 7.54355 10.3423 7.55234 10.3652 7.57344C10.388 7.59102 10.4109 7.6332 10.4214 7.69121L10.8943 9.69687L11.4128 7.69121C11.4304 7.63144 11.4515 7.59277 11.4726 7.57344C11.5078 7.55059 11.5482 7.54004 11.5886 7.54355H11.8681C11.9156 7.54355 11.9437 7.56816 11.9437 7.61914C11.9437 7.63496 11.9402 7.64902 11.9367 7.6666C11.9314 7.69297 11.9244 7.71758 11.9156 7.74219L11.1949 10.0555C11.1773 10.1152 11.1562 10.1539 11.1316 10.1715C11.0982 10.1926 11.0578 10.2031 11.0173 10.2014H10.7589C10.7027 10.2014 10.664 10.1926 10.6394 10.1715C10.6166 10.1504 10.5955 10.1117 10.5832 10.052L10.1191 8.12187L9.65855 10.0502C9.64273 10.11 9.62515 10.1486 9.6023 10.1697C9.57769 10.1908 9.5355 10.1996 9.48277 10.1996L9.22437 10.1979ZM13.0705 10.2787C12.914 10.2787 12.7593 10.2611 12.6099 10.2242C12.4605 10.1891 12.3445 10.1486 12.2654 10.1047C12.2179 10.0783 12.1845 10.0484 12.1722 10.0203C12.1599 9.99395 12.1546 9.96582 12.1546 9.93594V9.78301C12.1546 9.71973 12.1793 9.68984 12.2232 9.68984C12.2408 9.68984 12.2584 9.69336 12.2777 9.69863C12.2953 9.70391 12.3234 9.71621 12.3533 9.72852C12.4552 9.77422 12.566 9.80938 12.682 9.83398C12.8015 9.85859 12.9175 9.86914 13.0388 9.86914C13.2269 9.86914 13.3746 9.83574 13.4765 9.7707C13.575 9.71094 13.6347 9.60195 13.633 9.48594C13.6347 9.40859 13.6066 9.33301 13.5521 9.27676C13.4976 9.22051 13.3957 9.16953 13.2498 9.12031L12.8156 8.98496C12.5976 8.91641 12.4359 8.81445 12.3375 8.68086C12.2408 8.55605 12.188 8.40312 12.188 8.24668C12.188 8.12187 12.2162 8.01113 12.2689 7.91445C12.3234 7.81953 12.3937 7.73516 12.4851 7.66836C12.5748 7.5998 12.6767 7.54883 12.7962 7.51191C12.9158 7.47676 13.0423 7.46094 13.1742 7.46094C13.2392 7.46094 13.3095 7.46445 13.3746 7.47324C13.4431 7.48203 13.5064 7.49434 13.5697 7.50664C13.6294 7.52246 13.6875 7.53652 13.7402 7.5541C13.7947 7.57168 13.8369 7.58926 13.8668 7.60859C13.9019 7.62617 13.9335 7.65254 13.9564 7.68418C13.9757 7.71406 13.9845 7.74746 13.9828 7.78262V7.92324C13.9828 7.98652 13.9582 8.01992 13.9142 8.01992C13.8738 8.01465 13.8351 8.00234 13.8 7.98477C13.6189 7.90566 13.4238 7.86523 13.2252 7.86875C13.0546 7.86875 12.9193 7.89512 12.8261 7.95313C12.733 8.00938 12.6855 8.09727 12.6855 8.21855C12.6855 8.30293 12.7154 8.375 12.7752 8.43125C12.8349 8.4875 12.9457 8.54551 13.1039 8.59648L13.5293 8.73008C13.7437 8.79863 13.9002 8.89531 13.9933 9.01836C14.0865 9.14141 14.1304 9.28203 14.1304 9.43672C14.1304 9.56504 14.1041 9.68281 14.0531 9.78477C13.9986 9.88672 13.9265 9.97637 13.8351 10.0484C13.7419 10.124 13.6312 10.1768 13.5029 10.2154C13.364 10.2576 13.2234 10.2787 13.0705 10.2787ZM13.6365 11.7324C12.6521 12.4602 11.2212 12.8451 9.99078 12.8451C8.26636 12.8451 6.71245 12.207 5.53999 11.1471C5.44683 11.0627 5.53121 10.9502 5.64195 11.0152C6.91109 11.7518 8.4773 12.1982 10.0962 12.1982C11.1896 12.1982 12.3884 11.9715 13.4941 11.5039C13.6576 11.4301 13.7982 11.6129 13.6365 11.7324ZM14.046 11.2666C13.9195 11.1049 13.2128 11.1893 12.8929 11.2279C12.798 11.2402 12.7822 11.1559 12.8701 11.0926C13.4326 10.6971 14.3572 10.8113 14.4662 10.9432C14.5734 11.0785 14.4363 12.0031 13.9089 12.4461C13.8281 12.5146 13.7507 12.4795 13.7859 12.3898C13.9054 12.0928 14.1726 11.4248 14.046 11.2666Z",fill:"white"})),zee=e=>f.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M6.94533 1.36349H12.3699L6.73867 18.0483C6.68079 18.2197 6.5706 18.3687 6.42362 18.4742C6.27663 18.5798 6.10025 18.6366 5.91929 18.6366H1.69763C1.56052 18.6366 1.42539 18.604 1.3034 18.5414C1.18141 18.4789 1.07607 18.3881 0.996101 18.2768C0.91613 18.1654 0.863826 18.0366 0.843514 17.901C0.823202 17.7654 0.835467 17.6269 0.879293 17.497L6.12575 1.95182C6.1836 1.7803 6.29381 1.63125 6.44084 1.52567C6.58787 1.42009 6.76432 1.3635 6.94533 1.36349Z",fill:"url(#paint0_linear_21186_27366)"}),f.createElement("path",{d:"M14.8288 12.5547H6.22669C6.14672 12.5546 6.06857 12.5786 6.00243 12.6236C5.93629 12.6685 5.88523 12.7324 5.85589 12.8067C5.82655 12.8811 5.82029 12.9627 5.83794 13.0407C5.85558 13.1187 5.89631 13.1895 5.95482 13.2441L11.4823 18.4032C11.6432 18.5534 11.8551 18.6368 12.0752 18.6368H16.9461L14.8288 12.5547Z",fill:"#0078D4"}),f.createElement("path",{d:"M6.94619 1.36329C6.7632 1.36259 6.58477 1.42041 6.43699 1.52832C6.2892 1.63623 6.17978 1.78857 6.12473 1.96308L0.886602 17.4827C0.839826 17.613 0.825142 17.7528 0.843789 17.89C0.862437 18.0273 0.913868 18.158 0.993732 18.2712C1.0736 18.3844 1.17954 18.4767 1.30261 18.5402C1.42568 18.6038 1.56225 18.6368 1.70077 18.6364H6.03139C6.19268 18.6076 6.34344 18.5365 6.46825 18.4303C6.59306 18.3242 6.68746 18.1868 6.74181 18.0322L7.78639 14.9537L11.5176 18.4339C11.674 18.5632 11.8701 18.6348 12.0731 18.6364H16.9258L14.7974 12.5543L8.59306 12.5558L12.3904 1.36329H6.94619Z",fill:"url(#paint1_linear_21186_27366)"}),f.createElement("path",{d:"M13.8737 1.95078C13.816 1.77954 13.7059 1.63074 13.5591 1.52534C13.4123 1.41994 13.2361 1.36326 13.0554 1.36328H7.00977C7.19048 1.36329 7.36665 1.41998 7.51345 1.52538C7.66025 1.63077 7.7703 1.77956 7.8281 1.95078L13.0748 17.4966C13.1186 17.6265 13.1309 17.7651 13.1106 17.9007C13.0903 18.0363 13.038 18.1652 12.9581 18.2766C12.8781 18.388 12.7727 18.4787 12.6507 18.5413C12.5287 18.6039 12.3936 18.6366 12.2564 18.6366H18.3023C18.4394 18.6366 18.5745 18.6039 18.6965 18.5413C18.8185 18.4786 18.9238 18.3879 19.0038 18.2765C19.0837 18.1651 19.136 18.0362 19.1563 17.9006C19.1765 17.765 19.1642 17.6265 19.1204 17.4966L13.8737 1.95078Z",fill:"url(#paint2_linear_21186_27366)"}),f.createElement("defs",null,f.createElement("linearGradient",{id:"paint0_linear_21186_27366",x1:8.92242,y1:2.64349,x2:3.28888,y2:19.2864,gradientUnits:"userSpaceOnUse"},f.createElement("stop",{stopColor:"#114A8B"}),f.createElement("stop",{offset:1,stopColor:"#0669BC"})),f.createElement("linearGradient",{id:"paint1_linear_21186_27366",x1:10.6831,y1:10.3993,x2:9.37993,y2:10.84,gradientUnits:"userSpaceOnUse"},f.createElement("stop",{stopOpacity:.3}),f.createElement("stop",{offset:.071,stopOpacity:.2}),f.createElement("stop",{offset:.321,stopOpacity:.1}),f.createElement("stop",{offset:.623,stopOpacity:.05}),f.createElement("stop",{offset:1,stopOpacity:0})),f.createElement("linearGradient",{id:"paint2_linear_21186_27366",x1:9.96539,y1:2.15786,x2:16.1493,y2:18.6331,gradientUnits:"userSpaceOnUse"},f.createElement("stop",{stopColor:"#3CCBF4"}),f.createElement("stop",{offset:1,stopColor:"#2892DF"})))),Wee=e=>f.createElement("svg",{width:20,height:16,viewBox:"0 0 20 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("g",{clipPath:"url(#clip0_21248_29967)"},f.createElement("path",{d:"M19.6749 6.59133C19.1845 6.26129 17.8961 6.12033 16.9594 6.37263C16.9089 5.43961 16.4278 4.65338 15.5477 3.96737L15.2219 3.74866L15.0048 4.07659C14.5779 4.72451 14.3981 5.58771 14.4618 6.37236C14.5121 6.85579 14.6803 7.39926 15.0048 7.79357C13.7856 8.50073 12.6619 8.3402 7.68533 8.3402H0.00172499C-0.0207541 9.46389 0.159872 11.6256 1.53453 13.3853C1.68633 13.5797 1.85294 13.7677 2.03357 13.9489C3.15117 15.068 4.83974 15.8887 7.3648 15.891C11.2169 15.8945 14.5174 13.8124 16.5249 8.77788C17.1855 8.78873 18.9293 8.89636 19.7828 7.24719C19.8036 7.21942 19.9999 6.80978 19.9999 6.80978L19.6746 6.59107L19.6749 6.59133ZM5.01614 5.56364H2.85551V7.72428H5.01614V5.56364ZM7.80751 5.56364H5.64687V7.72428H7.80751V5.56364ZM10.5989 5.56364H8.43824V7.72428H10.5989V5.56364ZM13.3902 5.56364H11.2296V7.72428H13.3902V5.56364ZM2.22477 5.56364H0.0641374V7.72428H2.22477V5.56364ZM5.01614 2.83469H2.85551V4.99532H5.01614V2.83469ZM7.80751 2.83469H5.64687V4.99532H7.80751V2.83469ZM10.5989 2.83469H8.43824V4.99532H10.5989V2.83469ZM10.5989 0.105469H8.43824V2.2661H10.5989V0.105469Z",fill:"#1D63ED"})),f.createElement("defs",null,f.createElement("clipPath",{id:"clip0_21248_29967"},f.createElement("rect",{width:20,height:15.7856,fill:"white",transform:"translate(0 0.105469)"})))),Kee=e=>f.createElement("svg",{width:18,height:16,viewBox:"0 0 18 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M11.6416 5.3127L13.0324 3.92196L13.1251 3.33636C10.5908 1.03191 6.56215 1.29321 4.27758 3.88159C3.64298 4.60049 3.17219 5.49676 2.92114 6.42227L3.41924 6.35209L6.20067 5.89342L6.41541 5.67381C7.65266 4.315 9.74462 4.1322 11.1732 5.28833L11.6416 5.3127Z",fill:"#EA4335"}),f.createElement("path",{d:"M15.0129 6.38091C14.6932 5.20372 14.0369 4.14546 13.1244 3.33594L11.1725 5.28784C11.9967 5.96131 12.4662 6.97588 12.4461 8.04002V8.3865C13.4055 8.3865 14.1833 9.16428 14.1833 10.1237C14.1833 11.0831 13.4055 11.8414 12.4461 11.8414H8.96685L8.62524 12.2123V14.2959L8.96685 14.6228H12.4461C14.9416 14.6423 16.9804 12.6545 16.9998 10.159C17.0116 8.64643 16.2658 7.22837 15.0129 6.38091Z",fill:"#4285F4"}),f.createElement("path",{d:"M5.49294 14.6173H8.96733V11.8358H5.49294C5.24539 11.8357 5.00565 11.7826 4.78054 11.6797L4.28762 11.8309L2.88713 13.2217L2.76514 13.695C3.55054 14.2881 4.5088 14.6215 5.49294 14.6173Z",fill:"#34A853"}),f.createElement("path",{d:"M5.49167 5.60159C2.99611 5.61647 0.985208 7.65162 1.00008 10.1471C1.00839 11.5407 1.65924 12.8525 2.76387 13.702L4.77927 11.6867C3.90488 11.2916 3.51633 10.2626 3.91138 9.38828C4.30636 8.51395 5.33543 8.1254 6.2097 8.52039C6.595 8.69444 6.90354 9.00305 7.0776 9.38828L9.093 7.37294C8.23548 6.25193 6.90304 5.59653 5.49167 5.60159Z",fill:"#FBBC05"})),Gee=e=>f.createElement("svg",{width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("g",{clipPath:"url(#clip0_21248_29974)"},f.createElement("path",{d:"M11.6931 11.2795C11.6686 11.2747 11.6437 11.2728 11.6188 11.2739C11.5757 11.2762 11.5336 11.2871 11.4949 11.306C11.4198 11.3423 11.3616 11.4061 11.3324 11.4843C11.3032 11.5624 11.3053 11.6488 11.3382 11.7254L11.3359 11.7286L12.0772 13.5194C12.7864 13.0669 13.3245 12.3909 13.6065 11.5983L11.6964 11.2755L11.6931 11.2795ZM8.72099 11.5333C8.70492 11.4627 8.66563 11.3996 8.6094 11.354C8.55317 11.3084 8.48326 11.2829 8.41087 11.2818C8.38949 11.2815 8.36815 11.2834 8.34715 11.2874L8.34394 11.2835L6.45041 11.6049C6.73476 12.3913 7.27066 13.0618 7.97497 13.5125L8.70874 11.7393L8.703 11.7324C8.73008 11.6696 8.73639 11.5999 8.72099 11.5333ZM10.3068 12.2287C10.2792 12.1771 10.238 12.134 10.1878 12.104C10.1376 12.074 10.0802 12.0582 10.0217 12.0583C9.96315 12.0583 9.90576 12.0743 9.85561 12.1044C9.80546 12.1346 9.76443 12.1777 9.7369 12.2294H9.73533L8.80417 13.9132C9.47089 14.1402 10.1876 14.177 10.8741 14.0196C11.0014 13.9907 11.1258 13.9559 11.2472 13.9153L10.3139 12.2286L10.3068 12.2287ZM13.2546 8.31733L11.8219 9.59964L11.8227 9.60373C11.7787 9.64221 11.7459 9.69189 11.7278 9.74749C11.7098 9.8031 11.7071 9.86255 11.7201 9.91955C11.7331 9.97655 11.7613 10.029 11.8017 10.0712C11.8421 10.1135 11.8932 10.144 11.9496 10.1596L11.9513 10.1673L13.807 10.7019C13.8873 9.86813 13.6933 9.031 13.2546 8.31751V8.31733ZM10.5929 8.46101C10.5956 8.51941 10.614 8.576 10.6463 8.62475C10.6786 8.67351 10.7234 8.71262 10.7761 8.73793C10.8288 8.76324 10.8874 8.77381 10.9456 8.76852C11.0038 8.76322 11.0596 8.74226 11.1068 8.70786L11.1125 8.71021L12.6801 7.59869C12.0834 7.0142 11.3112 6.64194 10.4822 6.53915L10.5911 8.46049L10.5929 8.46101ZM8.93272 8.7149C8.98001 8.74928 9.03574 8.77019 9.09397 8.77541C9.1522 8.78063 9.21076 8.76997 9.26341 8.74455C9.31607 8.71914 9.36084 8.67992 9.39297 8.63108C9.42511 8.58223 9.4434 8.52559 9.44589 8.46718L9.45389 8.46344L9.5628 6.53906C9.43133 6.55486 9.30075 6.57737 9.17158 6.60651C8.4844 6.76097 7.85407 7.10445 7.35176 7.59817L8.92968 8.71672L8.93272 8.7149ZM8.09153 10.169C8.14801 10.1536 8.19924 10.1231 8.23977 10.0809C8.2803 10.0386 8.3086 9.98615 8.32164 9.92907C8.33469 9.872 8.33199 9.81246 8.31384 9.7568C8.2957 9.70114 8.26278 9.65145 8.2186 9.61303L8.22017 9.60538L6.77957 8.3169C6.34009 9.03221 6.15145 9.87356 6.24346 10.708L8.09005 10.1752L8.09153 10.169ZM9.49074 10.735L10.0222 10.9905L10.552 10.7355L10.6836 10.1635L10.3169 9.7049H9.72673L9.35897 10.1628L9.49074 10.735Z",fill:"#326CE5"}),f.createElement("path",{d:"M18.8085 11.861L17.2942 5.28345C17.2535 5.11328 17.1755 4.95428 17.0659 4.8179C16.9562 4.68153 16.8177 4.57119 16.6603 4.49483L10.5307 1.56828C10.3718 1.49247 10.198 1.45313 10.022 1.45312C9.84597 1.45312 9.67217 1.49247 9.51331 1.56828L3.38493 4.4964C3.22746 4.5727 3.0889 4.68301 2.97924 4.81938C2.86959 4.95574 2.79159 5.11475 2.75086 5.28492L1.23899 11.8623C1.2017 12.0286 1.20158 12.201 1.23864 12.3673C1.24956 12.418 1.26382 12.4679 1.28132 12.5167C1.31091 12.5999 1.35008 12.6794 1.39805 12.7536C1.41883 12.7853 1.44073 12.8162 1.46455 12.8461L5.70653 18.1201C5.72504 18.1431 5.74547 18.164 5.76572 18.1853C5.83228 18.2562 5.90744 18.3185 5.98945 18.3707C6.09317 18.436 6.20621 18.4851 6.32469 18.5165C6.42185 18.5431 6.52208 18.5569 6.62282 18.5576H6.6888L13.4253 18.556C13.4663 18.5558 13.5072 18.5534 13.5479 18.5488C13.6063 18.5422 13.6641 18.5312 13.7208 18.516C13.7614 18.5052 13.8015 18.4924 13.8408 18.4775C13.8715 18.4658 13.9021 18.4541 13.9316 18.4399C13.9759 18.4187 14.0188 18.3949 14.0602 18.3685C14.1669 18.3013 14.262 18.2172 14.3416 18.1194L14.4709 17.9586L18.5821 12.8443C18.6609 12.7455 18.7228 12.6344 18.7653 12.5153C18.783 12.4664 18.7976 12.4163 18.8087 12.3655C18.8459 12.1992 18.8458 12.0267 18.8084 11.8605L18.8085 11.861ZM12.4506 14.4192C12.4679 14.4698 12.4883 14.5192 12.5117 14.5672C12.4742 14.6329 12.464 14.7106 12.4833 14.7837C12.5725 14.9879 12.6814 15.183 12.8086 15.366C12.8797 15.4596 12.9454 15.5572 13.0053 15.6584C13.02 15.6858 13.0393 15.7282 13.0533 15.7572C13.0797 15.8013 13.0966 15.8504 13.1029 15.9015C13.1091 15.9525 13.1047 16.0043 13.0897 16.0535C13.0748 16.1027 13.0497 16.1483 13.0161 16.1872C12.9825 16.2261 12.9411 16.2576 12.8946 16.2796C12.8481 16.3015 12.7975 16.3135 12.7461 16.3148C12.6947 16.3161 12.6436 16.3066 12.5961 16.2869C12.5486 16.2672 12.5057 16.2378 12.4702 16.2006C12.4348 16.1633 12.4075 16.1191 12.3901 16.0707C12.3762 16.042 12.3567 16.0037 12.3448 15.9766C12.3029 15.8667 12.2673 15.7544 12.2383 15.6404C12.1747 15.4271 12.0904 15.2205 11.9866 15.0236C11.9414 14.9627 11.8742 14.9219 11.7994 14.91C11.7876 14.8897 11.7442 14.81 11.7209 14.7689C10.6297 15.1821 9.42458 15.179 8.33556 14.7602L8.25255 14.9106C8.19329 14.9198 8.13819 14.9466 8.09445 14.9877C7.96936 15.1929 7.87374 15.4148 7.8104 15.6467C7.78165 15.7607 7.7463 15.873 7.70453 15.9829C7.69279 16.0098 7.67315 16.0476 7.65916 16.0761V16.0769L7.65855 16.0776C7.64124 16.1261 7.61395 16.1704 7.57846 16.2077C7.54297 16.245 7.50005 16.2744 7.45249 16.2941C7.40492 16.3138 7.35375 16.3233 7.30229 16.322C7.25083 16.3207 7.20021 16.3086 7.1537 16.2865C7.10719 16.2645 7.06583 16.2329 7.03228 16.1938C6.99872 16.1548 6.97372 16.1092 6.9589 16.0599C6.94407 16.0106 6.93973 15.9587 6.94618 15.9076C6.95262 15.8566 6.9697 15.8074 6.99631 15.7633C7.01013 15.7342 7.02865 15.6921 7.04325 15.6647C7.10309 15.5632 7.16873 15.4654 7.23986 15.3715C7.36928 15.1836 7.48046 14.9838 7.57189 14.7747C7.58162 14.7038 7.57025 14.6317 7.53921 14.5672L7.60596 14.4073C6.60197 13.8148 5.84951 12.8753 5.49053 11.7661L5.33069 11.7933C5.26867 11.7493 5.19556 11.7236 5.11965 11.719C4.90093 11.7609 4.6868 11.8239 4.48028 11.9072C4.37304 11.9554 4.26314 11.9975 4.15112 12.0332C4.12461 12.0405 4.08636 12.0478 4.05611 12.0544C4.05368 12.0553 4.05159 12.0563 4.04916 12.0569C4.04729 12.0572 4.0454 12.0574 4.04351 12.0575C3.99482 12.0735 3.94332 12.0791 3.89231 12.0741C3.84131 12.0691 3.79191 12.0535 3.74729 12.0282C3.70267 12.003 3.6638 11.9687 3.63319 11.9276C3.60257 11.8865 3.58087 11.8395 3.56948 11.7895C3.5581 11.7395 3.55727 11.6877 3.56705 11.6374C3.57684 11.5871 3.59702 11.5394 3.62631 11.4973C3.6556 11.4553 3.69335 11.4198 3.73714 11.3931C3.78093 11.3665 3.8298 11.3493 3.88063 11.3426L3.88593 11.3413L3.88914 11.3405C3.91983 11.3333 3.95911 11.3231 3.9871 11.3177C4.1038 11.3015 4.22133 11.292 4.33912 11.2894C4.56126 11.2748 4.78146 11.2387 4.99658 11.1814C5.06033 11.1408 5.1142 11.0865 5.15425 11.0223L5.30783 10.9775C5.14117 9.81985 5.40776 8.64143 6.05646 7.66824L5.93886 7.56341C5.93457 7.48733 5.90904 7.41398 5.86515 7.35168C5.6962 7.20645 5.51347 7.07807 5.31957 6.96837C5.21486 6.91497 5.11332 6.85559 5.01544 6.79053C4.99319 6.77393 4.96363 6.74898 4.93947 6.72934L4.93399 6.72552C4.85055 6.66558 4.79423 6.57506 4.77732 6.47372C4.76042 6.37239 4.78431 6.26848 4.84377 6.18471C4.87891 6.1417 4.92368 6.10758 4.97447 6.08511C5.02525 6.06263 5.08062 6.05245 5.13608 6.05537C5.22944 6.05938 5.31906 6.09319 5.39179 6.15185C5.41674 6.17141 5.4509 6.19757 5.47306 6.21661C5.55846 6.29737 5.63914 6.38298 5.7147 6.47302C5.86462 6.63773 6.03026 6.78742 6.20927 6.91995C6.27634 6.95522 6.35457 6.96281 6.42717 6.94107C6.47086 6.97295 6.51496 7.00429 6.55946 7.03512C7.20408 6.34992 8.03879 5.87304 8.95642 5.66572C9.17482 5.61625 9.39643 5.58219 9.61961 5.56376L9.6283 5.4087C9.68528 5.35806 9.72659 5.2922 9.74738 5.21887C9.75538 4.99631 9.7417 4.7735 9.70653 4.55359C9.6832 4.43834 9.66648 4.32186 9.65646 4.2047C9.65551 4.17802 9.65698 4.14116 9.65733 4.11074C9.65733 4.10726 9.65646 4.10379 9.65646 4.10048C9.65125 4.0492 9.65686 3.9974 9.67291 3.94841C9.68896 3.89943 9.71511 3.85436 9.74966 3.8161C9.78421 3.77785 9.82639 3.74726 9.87349 3.72632C9.9206 3.70538 9.97156 3.69455 10.0231 3.69453C10.0747 3.6945 10.1256 3.70529 10.1728 3.72618C10.2199 3.74708 10.2621 3.77762 10.2967 3.81584C10.3313 3.85406 10.3575 3.89911 10.3736 3.94808C10.3896 3.99705 10.3953 4.04885 10.3901 4.10014C10.3901 4.1323 10.3921 4.17489 10.3909 4.20444C10.3809 4.32158 10.3641 4.43804 10.3406 4.55324C10.3052 4.77319 10.2913 4.99605 10.2991 5.21869C10.3136 5.29312 10.3566 5.35893 10.4189 5.40209C10.4202 5.4286 10.4246 5.51709 10.4278 5.56585C11.5874 5.67131 12.6694 6.19411 13.4727 7.03712L13.6123 6.93742C13.6873 6.95029 13.7644 6.94192 13.8348 6.91326C14.0138 6.7805 14.1794 6.63064 14.3294 6.4658C14.4051 6.37572 14.486 6.29011 14.5716 6.20939C14.5941 6.1901 14.6281 6.1642 14.653 6.14455C14.6898 6.10826 14.7338 6.08011 14.7822 6.06193C14.8306 6.04376 14.8823 6.03596 14.9339 6.03905C14.9855 6.04214 15.0359 6.05605 15.0817 6.07986C15.1276 6.10368 15.168 6.13689 15.2002 6.17731C15.2324 6.21774 15.2558 6.26449 15.2688 6.31453C15.2817 6.36457 15.284 6.41678 15.2755 6.46777C15.267 6.51876 15.2479 6.56739 15.2194 6.61051C15.1909 6.65362 15.1536 6.69026 15.11 6.71804C15.0854 6.73795 15.0529 6.76567 15.0293 6.78323C14.9312 6.84834 14.8294 6.90772 14.7244 6.96107C14.5306 7.07083 14.3478 7.19921 14.1788 7.34438C14.1297 7.40198 14.1049 7.47654 14.11 7.55211C14.0896 7.57089 14.0179 7.63443 13.9799 7.66885C14.6304 8.63856 14.9024 9.81335 14.7441 10.9703L14.8922 11.0134C14.9292 11.08 14.984 11.1351 15.0504 11.1725C15.2656 11.2298 15.4859 11.2661 15.7082 11.2808C15.8258 11.2835 15.9433 11.2929 16.0599 11.3089C16.0907 11.3146 16.1353 11.3269 16.1668 11.3341C16.2176 11.3408 16.2665 11.358 16.3102 11.3847C16.354 11.4113 16.3918 11.4468 16.421 11.4889C16.4503 11.531 16.4705 11.5787 16.4802 11.629C16.49 11.6794 16.4891 11.7312 16.4777 11.7811C16.4663 11.8311 16.4446 11.8782 16.4139 11.9193C16.3833 11.9603 16.3444 11.9946 16.2998 12.0198C16.2551 12.045 16.2057 12.0606 16.1547 12.0656C16.1037 12.0706 16.0522 12.0649 16.0035 12.0489L15.9982 12.0482C15.9958 12.0476 15.9935 12.0462 15.991 12.0456C15.9608 12.039 15.9228 12.0324 15.8963 12.0255C15.7843 11.9895 15.6744 11.9471 15.5673 11.8984C15.3606 11.815 15.1462 11.752 14.9273 11.7102C14.8515 11.7078 14.7778 11.7352 14.722 11.7864C14.6698 11.7765 14.6176 11.7674 14.5652 11.759C14.2105 12.8751 13.4579 13.8219 12.4506 14.4192Z",fill:"#326CE5"}),f.createElement("path",{d:"M19.6078 12.0305L17.9557 4.85446C17.9113 4.66877 17.8262 4.49526 17.7066 4.34645C17.587 4.19765 17.4358 4.07725 17.264 3.99396L10.5769 0.801439C10.4036 0.718714 10.214 0.675781 10.0219 0.675781C9.82986 0.675781 9.64023 0.718714 9.4669 0.801439L2.78042 3.99588C2.60862 4.07909 2.45743 4.1994 2.33777 4.34813C2.21811 4.49686 2.13296 4.6703 2.08846 4.85594L0.439262 12.0324C0.402062 12.1978 0.398237 12.369 0.428012 12.5359C0.457786 12.7029 0.520562 12.8622 0.612665 13.0046C0.63535 13.0393 0.659427 13.0731 0.685503 13.1056L5.31358 18.86C5.43488 19.0081 5.58733 19.1276 5.76008 19.21C5.93284 19.2925 6.12164 19.3358 6.31306 19.3369L13.7348 19.3352C13.9262 19.3341 14.1149 19.2909 14.2877 19.2085C14.4605 19.1262 14.613 19.0068 14.7344 18.8589L19.3608 13.1039C19.4793 12.9547 19.5629 12.7809 19.6057 12.5953C19.6484 12.4096 19.6491 12.2167 19.6078 12.0307V12.0305ZM18.8084 12.3665C18.7973 12.4173 18.7828 12.4673 18.7651 12.5163C18.7226 12.6353 18.6606 12.7465 18.5817 12.8453L14.4706 17.9595L14.3414 18.1204C14.2617 18.2182 14.1666 18.3024 14.0598 18.3695C14.0185 18.3958 13.9758 18.4197 13.9317 18.4409C13.9019 18.4546 13.8717 18.4671 13.8408 18.4783C13.8015 18.4933 13.7613 18.5062 13.7206 18.517C13.6639 18.5323 13.6061 18.5433 13.5477 18.5499C13.507 18.5545 13.4661 18.5569 13.4252 18.557L6.68863 18.5586H6.62257C6.52186 18.558 6.42167 18.5442 6.32453 18.5176C6.2061 18.4862 6.09312 18.437 5.98946 18.3716C5.90739 18.3194 5.83217 18.2572 5.76555 18.1863C5.7453 18.1649 5.72488 18.144 5.70645 18.1211L1.46438 12.847C1.44074 12.8172 1.41858 12.7863 1.39789 12.7543C1.34992 12.6801 1.31075 12.6006 1.28116 12.5174C1.26365 12.4686 1.24939 12.4187 1.23848 12.368C1.20143 12.2017 1.20155 12.0293 1.23883 11.8631L2.75069 5.28549C2.79144 5.11535 2.86946 4.95637 2.97911 4.82004C3.08876 4.68371 3.22731 4.57342 3.38476 4.49714L9.51323 1.56928C9.67209 1.49347 9.84589 1.45412 10.0219 1.45412C10.1979 1.45412 10.3717 1.49347 10.5306 1.56928L16.66 4.49583C16.8175 4.57218 16.956 4.68253 17.0656 4.8189C17.1752 4.95528 17.2532 5.11428 17.2939 5.28445L18.8082 11.8619C18.8455 12.0281 18.8456 12.2005 18.8084 12.3667V12.3665Z",fill:"white"}),f.createElement("path",{d:"M16.1667 11.3349C16.1354 11.3277 16.0907 11.3154 16.0601 11.3097C15.9435 11.2936 15.8261 11.2841 15.7084 11.2814C15.4861 11.2668 15.2657 11.2307 15.0504 11.1734C14.984 11.136 14.9292 11.0809 14.8922 11.0142L14.7441 10.9711C14.9024 9.81415 14.6306 8.63937 13.9801 7.66963C14.018 7.63521 14.0898 7.57167 14.11 7.55299C14.105 7.47741 14.1297 7.40286 14.1789 7.34525C14.3479 7.20008 14.5306 7.0717 14.7245 6.96194C14.8294 6.90859 14.9312 6.84922 15.0293 6.7841C15.0529 6.76655 15.0853 6.73873 15.11 6.71891C15.1536 6.69114 15.1909 6.65451 15.2194 6.6114C15.2479 6.5683 15.267 6.51968 15.2756 6.4687C15.2841 6.41772 15.2818 6.36553 15.2688 6.3155C15.2558 6.26546 15.2325 6.21872 15.2003 6.17829C15.1681 6.13786 15.1278 6.10465 15.0819 6.08082C15.0361 6.05698 14.9857 6.04305 14.9341 6.03994C14.8825 6.03682 14.8308 6.04459 14.7825 6.06273C14.7341 6.08088 14.69 6.10899 14.6532 6.14525C14.6282 6.16498 14.5941 6.19088 14.5718 6.21018C14.4861 6.29089 14.4052 6.3765 14.3294 6.46659C14.1795 6.63143 14.0138 6.78128 13.8349 6.91405C13.7644 6.9427 13.6873 6.95108 13.6123 6.93821L13.4727 7.03791C12.6695 6.19489 11.5875 5.6721 10.4278 5.56663C10.4244 5.51787 10.4203 5.42956 10.4189 5.40288C10.3567 5.35969 10.3137 5.29388 10.2993 5.21948C10.2915 4.99684 10.3054 4.77398 10.3408 4.55403C10.3642 4.43885 10.3809 4.32242 10.3908 4.20531C10.3919 4.17576 10.3902 4.13282 10.3902 4.10092C10.3953 4.04964 10.3897 3.99784 10.3736 3.94887C10.3575 3.8999 10.3313 3.85485 10.2967 3.81663C10.2621 3.77841 10.2199 3.74787 10.1728 3.72697C10.1257 3.70607 10.0747 3.69529 10.0231 3.69531C9.9716 3.69534 9.92063 3.70617 9.87353 3.72711C9.82643 3.74805 9.78424 3.77864 9.74969 3.81689C9.71514 3.85514 9.689 3.90022 9.67294 3.9492C9.65689 3.99818 9.65129 4.04999 9.6565 4.10127C9.6565 4.10475 9.65728 4.10805 9.65737 4.11153C9.65702 4.14195 9.65554 4.1788 9.6565 4.2054C9.66651 4.32258 9.68323 4.4391 9.70656 4.55438C9.74174 4.77429 9.75542 4.99709 9.74741 5.21965C9.72659 5.29292 9.68528 5.35872 9.62833 5.40931L9.61964 5.56455C9.39647 5.58297 9.17486 5.61704 8.95645 5.6665C8.03893 5.87385 7.20431 6.3507 6.55976 7.03582C6.51514 7.00505 6.47092 6.9737 6.42712 6.94177C6.35454 6.96348 6.27635 6.9559 6.2093 6.92065C6.0303 6.78815 5.86466 6.63849 5.71473 6.4738C5.63926 6.38378 5.55866 6.29817 5.47336 6.21739C5.45102 6.19827 5.41686 6.1722 5.39183 6.1522C5.31909 6.09354 5.22947 6.05973 5.13611 6.05573C5.08064 6.05282 5.02526 6.06303 4.97448 6.08554C4.92369 6.10804 4.87892 6.14219 4.84381 6.18523C4.78434 6.26901 4.76045 6.37292 4.77736 6.47425C4.79426 6.57558 4.85059 6.66611 4.93403 6.72604L4.93968 6.73004C4.96367 6.74968 4.99322 6.7748 5.01547 6.79106C5.11335 6.85618 5.21489 6.91561 5.3196 6.96907C5.51348 7.07883 5.69619 7.20727 5.8651 7.35255C5.90898 7.4148 5.93454 7.48808 5.93889 7.56411L6.05632 7.66911C5.40768 8.64232 5.14115 9.82074 5.30786 10.9784L5.15428 11.023C5.1142 11.0871 5.06033 11.1413 4.99661 11.1818C4.78147 11.2393 4.56125 11.2756 4.33907 11.2902C4.22131 11.2929 4.1038 11.3024 3.98713 11.3186C3.95897 11.3238 3.91986 11.3337 3.88918 11.3413L3.88596 11.342L3.88075 11.3436C3.82994 11.3503 3.78108 11.3675 3.7373 11.3941C3.69353 11.4208 3.65579 11.4563 3.62652 11.4983C3.59725 11.5404 3.57708 11.5881 3.56731 11.6384C3.55753 11.6887 3.55837 11.7405 3.56976 11.7905C3.58115 11.8405 3.60285 11.8875 3.63346 11.9286C3.66408 11.9697 3.70293 12.0039 3.74755 12.0292C3.79216 12.0544 3.84154 12.07 3.89254 12.0751C3.94354 12.0801 3.99503 12.0744 4.04372 12.0584L4.04919 12.0576C4.05163 12.057 4.05371 12.0558 4.05615 12.0554C4.0864 12.0484 4.12447 12.0412 4.15106 12.034C4.26306 11.9982 4.37293 11.9561 4.48014 11.9079C4.68672 11.8246 4.90091 11.7615 5.11969 11.7197C5.19555 11.7243 5.2686 11.7501 5.33055 11.7942L5.49048 11.7668C5.8495 12.876 6.60202 13.8155 7.60608 14.408L7.53924 14.5679C7.57031 14.6324 7.58171 14.7045 7.57201 14.7754C7.48058 14.9844 7.36939 15.1842 7.23998 15.372C7.16883 15.4659 7.10315 15.5637 7.04328 15.6651C7.02868 15.6928 7.01017 15.7351 6.99617 15.764C6.9697 15.8081 6.95274 15.8572 6.94639 15.9082C6.94004 15.9593 6.94444 16.011 6.95931 16.0603C6.97418 16.1095 6.99918 16.155 7.03272 16.194C7.06625 16.233 7.10758 16.2645 7.15402 16.2865C7.20047 16.3086 7.25102 16.3206 7.30242 16.322C7.35381 16.3233 7.40492 16.3139 7.45244 16.2942C7.49997 16.2746 7.54286 16.2453 7.57836 16.2081C7.61387 16.1709 7.64119 16.1267 7.65858 16.0783L7.65919 16.0776V16.0768C7.6731 16.0481 7.69283 16.0104 7.70456 15.9836C7.74634 15.8737 7.78169 15.7614 7.81043 15.6474C7.87377 15.4155 7.96939 15.1936 8.09448 14.9884C8.13822 14.9473 8.19332 14.9204 8.25258 14.9112L8.33577 14.7608C9.42475 15.1796 10.6298 15.1826 11.7209 14.7694C11.7442 14.811 11.7877 14.8904 11.7991 14.9105C11.8741 14.9225 11.9413 14.9633 11.9864 15.0243C12.0903 15.2212 12.1747 15.4278 12.2383 15.6411C12.2673 15.7551 12.3029 15.8674 12.3448 15.9773C12.3567 16.0044 12.3761 16.0425 12.3902 16.0714C12.4075 16.1198 12.4348 16.164 12.4703 16.2013C12.5057 16.2385 12.5486 16.2679 12.5961 16.2876C12.6436 16.3073 12.6947 16.3168 12.7462 16.3155C12.7976 16.3143 12.8481 16.3022 12.8946 16.2803C12.9411 16.2583 12.9825 16.2268 13.0161 16.1879C13.0497 16.149 13.0748 16.1034 13.0897 16.0542C13.1047 16.005 13.1092 15.9532 13.1029 15.9022C13.0966 15.8512 13.0798 15.802 13.0534 15.7579C13.0394 15.7289 13.0201 15.6866 13.0056 15.6591C12.9457 15.5579 12.88 15.4603 12.8089 15.3667C12.6817 15.1837 12.5728 14.9886 12.4836 14.7844C12.4642 14.7113 12.4744 14.6336 12.5118 14.5679C12.4883 14.5199 12.4679 14.4705 12.4507 14.4199C13.458 13.8226 14.2105 12.8758 14.5652 11.7598C14.6127 11.7673 14.6953 11.7818 14.7222 11.7872C14.778 11.736 14.8516 11.7087 14.9273 11.711C15.1462 11.7528 15.3604 11.8158 15.5671 11.8992C15.6743 11.9479 15.7842 11.9903 15.8963 12.0263C15.9228 12.0332 15.9606 12.0398 15.991 12.0465C15.9936 12.0472 15.9958 12.0483 15.9983 12.0489L16.0035 12.0497C16.0521 12.0657 16.1036 12.0713 16.1546 12.0663C16.2056 12.0612 16.2549 12.0456 16.2995 12.0204C16.3441 11.9952 16.3829 11.961 16.4135 11.9199C16.4441 11.8788 16.4658 11.8318 16.4772 11.7819C16.4886 11.7319 16.4895 11.6802 16.4798 11.6299C16.47 11.5796 16.4499 11.5319 16.4207 11.4898C16.3914 11.4478 16.3538 11.4123 16.31 11.3856C16.2663 11.3589 16.2175 11.3416 16.1667 11.3349ZM12.6813 7.59853L11.1135 8.70996L11.108 8.70735C11.0608 8.74181 11.0051 8.76283 10.9469 8.76816C10.8886 8.77349 10.83 8.76295 10.7773 8.73765C10.7246 8.71234 10.6797 8.67323 10.6475 8.62446C10.6152 8.57569 10.5968 8.51909 10.5941 8.46068L10.5923 8.45981L10.4834 6.53865C11.3124 6.64157 12.0845 7.01396 12.6812 7.59853H12.6813ZM9.72794 9.7044H10.3179L10.6847 10.163L10.5532 10.7349L10.0234 10.9899L9.49196 10.7344L9.36019 10.1622L9.72794 9.7044ZM9.17288 6.60592C9.30211 6.57683 9.43275 6.55438 9.56427 6.53865L9.45519 8.46277L9.4472 8.46659C9.44473 8.52502 9.42646 8.58168 9.39434 8.63055C9.36222 8.67941 9.31745 8.71866 9.26479 8.74409C9.21213 8.76953 9.15356 8.78021 9.09532 8.77499C9.03707 8.76978 8.98133 8.74887 8.93403 8.71448L8.93098 8.71622L7.35306 7.5974C7.8554 7.10375 8.48572 6.76033 9.17288 6.60592ZM6.78088 8.31648L8.22147 9.60496L8.2199 9.61279C8.26406 9.65121 8.29696 9.70089 8.31509 9.75654C8.33322 9.81219 8.33591 9.87172 8.32286 9.92877C8.30982 9.98583 8.28153 10.0383 8.24102 10.0805C8.20051 10.1228 8.14929 10.1532 8.09283 10.1686L8.09135 10.1749L6.24476 10.7077C6.15275 9.87323 6.34139 9.03179 6.78088 8.31648ZM8.70969 11.7393L7.97601 13.5122C7.2718 13.0614 6.73603 12.3909 6.4518 11.6045L8.34515 11.2829L8.34837 11.2872C8.36928 11.2832 8.39053 11.2813 8.41182 11.2815C8.46491 11.2823 8.517 11.2962 8.56347 11.3219C8.60994 11.3476 8.64937 11.3843 8.67827 11.4289C8.70717 11.4734 8.72466 11.5244 8.72918 11.5773C8.73371 11.6302 8.72513 11.6834 8.70421 11.7322L8.70969 11.7393ZM10.8754 14.0192C10.1889 14.1767 9.47213 14.1399 8.80539 13.9129L9.73655 12.2291H9.73811C9.7658 12.1777 9.80689 12.1347 9.85703 12.1047C9.90718 12.0747 9.9645 12.0589 10.0229 12.0588C10.0813 12.0587 10.1387 12.0745 10.1889 12.1044C10.2391 12.1343 10.2803 12.1772 10.308 12.2286H10.315L11.2485 13.9152C11.1273 13.9556 11.003 13.9904 10.8754 14.0194V14.0192ZM12.0784 13.5194L11.3372 11.7284L11.3394 11.7252C11.3065 11.6486 11.3045 11.5622 11.3337 11.4841C11.3629 11.406 11.4211 11.3422 11.4961 11.306C11.5348 11.287 11.577 11.2761 11.62 11.2738C11.6449 11.2727 11.6698 11.2745 11.6943 11.2793L11.6975 11.2753L13.6077 11.5981C13.3258 12.3908 12.7876 13.0668 12.0784 13.5194ZM13.8083 10.7014L11.9525 10.1669L11.9507 10.1591C11.8944 10.1435 11.8433 10.113 11.8029 10.0707C11.7625 10.0285 11.7343 9.97604 11.7213 9.91905C11.7082 9.86205 11.7109 9.80259 11.729 9.74699C11.747 9.69138 11.7798 9.64171 11.8238 9.60323L11.8231 9.59949L13.2557 8.31735C13.6944 9.03079 13.8884 9.86785 13.8083 10.7015L13.8083 10.7014Z",fill:"white"})),f.createElement("defs",null,f.createElement("clipPath",{id:"clip0_21248_29974"},f.createElement("rect",{width:20,height:19.4133,fill:"white",transform:"translate(0 0.292969)"}))));function GE(e){const{bottomSVGClassName:t,topSVGClassName:r}=e;return n.jsxs(n.Fragment,{children:[n.jsxs("svg",{width:"471",height:"470",viewBox:"0 0 471 470",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:D("absolute -bottom-[370px] -left-[150px] z-10",t),children:[n.jsx("g",{opacity:"1",children:n.jsx("ellipse",{cx:"235.5",cy:"235",rx:"235.5",ry:"235",fill:"url(#paint0_linear_9388_24795)"})}),n.jsx("defs",{children:n.jsxs("linearGradient",{id:"paint0_linear_9388_24795",x1:"235.5",y1:"0",x2:"235.5",y2:"223",gradientUnits:"userSpaceOnUse",children:[n.jsx("stop",{stopColor:"currentColor",className:"text-gray-100 dark:text-gray-700"}),n.jsx("stop",{offset:"1",stopColor:"currentColor",className:"text-gray-100 dark:text-gray-700",stopOpacity:"0.5"})]})})]}),n.jsxs("svg",{className:D("absolute -top-[250px] -right-[30px] z-10 hidden @sm:block",r),width:"587",height:"391",viewBox:"0 0 587 391",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsxs("g",{opacity:"0.25",children:[n.jsx("path",{d:"M392 195.5C392 87.5283 304.248 -3.52492e-05 196 -3.05176e-05L196 391C304.248 391 392 303.472 392 195.5Z",fill:"url(#paint0_linear_9388_24790)"}),n.jsx("path",{d:"M196 195.5C196 87.5283 108.248 -3.52492e-05 -1.70912e-05 -3.05176e-05L0 391C108.248 391 196 303.472 196 195.5Z",fill:"url(#paint1_linear_9388_24790)"}),n.jsx("path",{d:"M587 195.5C587 87.5283 499.696 -3.52251e-05 392 -3.05176e-05L392 391C499.696 391 587 303.472 587 195.5Z",fill:"url(#paint2_linear_9388_24790)"})]}),n.jsxs("defs",{children:[n.jsxs("linearGradient",{id:"paint0_linear_9388_24790",x1:"244.246",y1:"263",x2:"244.246",y2:"391",gradientUnits:"userSpaceOnUse",children:[n.jsx("stop",{stopColor:"currentColor",className:"text-gray-300 dark:text-gray-600"}),n.jsx("stop",{offset:"1",stopColor:"currentColor",className:"text-gray-300 dark:text-gray-600",stopOpacity:"0.6"})]}),n.jsxs("linearGradient",{id:"paint1_linear_9388_24790",x1:"48.2462",y1:"263",x2:"48.2462",y2:"391",gradientUnits:"userSpaceOnUse",children:[n.jsx("stop",{stopColor:"currentColor",className:"text-gray-200 dark:text-gray-700"}),n.jsx("stop",{offset:"1",stopColor:"currentColor",className:"text-gray-200 dark:text-gray-700",stopOpacity:"0.6"})]}),n.jsxs("linearGradient",{id:"paint2_linear_9388_24790",x1:"440",y1:"263",x2:"440",y2:"391",gradientUnits:"userSpaceOnUse",children:[n.jsx("stop",{stopColor:"currentColor",className:"text-gray-400 dark:text-gray-500"}),n.jsx("stop",{offset:"1",stopColor:"currentColor",className:"text-gray-400 dark:text-gray-500",stopOpacity:"0.6"})]})]})]})]})}function qee(e){const{isOpen:t,setOpen:r,machineOSs:s}=e,{variant:a}=Fr("machines-page-add-devices-to-your-network-destination-change",!0),i=f.useMemo(()=>{const u=[...a==="variant1"?Zee:Yee];for(const d of u)d.installed=s.map(m=>m.toLocaleLowerCase()).includes(d.key.toLocaleLowerCase());return u.sort((d,m)=>!d.icon&&m.icon?1:d.icon&&!m.icon||d.installed&&!m.installed?-1:!d.installed&&m.installed?1:0),u},[s,a]);return n.jsxs(at,{elevated:!0,className:D("relative overflow-hidden rounded-xl",{"bg-gradient-to-b dark:bg-gradient-to-b from-white to-gray-100 dark:from-gray-1000 dark:to-gray-800":t,"py-4":!t}),children:[n.jsx(ue,{onClick:()=>{r(!t)},"aria-label":"Minimize",className:"absolute right-2 z-30 py-2 top-2",variant:"minimal",iconOnly:!0,children:t?n.jsx(Yx,{}):n.jsx(Qx,{})}),n.jsxs("div",{className:"relative z-20",children:[n.jsx("h3",{className:D({"text-lg font-semibold mb-2":t,"font-normal":!t}),children:"Add devices to your network"}),t?n.jsxs(n.Fragment,{children:[n.jsx("p",{children:"Tailscale works best when it’s installed on multiple devices. Explore what you can do with Tailscale in these environments."}),n.jsxs("div",{className:"flex flex-wrap",children:[n.jsx(Lg,{heading:"Operating systems",environments:i}),n.jsx(Lg,{heading:"Cloud providers",environments:Qee}),n.jsx(Lg,{heading:"Containers",environments:Jee})]})]}):null]}),n.jsx("div",{className:D("absolute top-0 left-0 w-full",{"h-96":!t,"h-full":t}),children:n.jsx(GE,{})})]})}const Yee=[{key:"linux",name:"Linux",icon:n.jsx(zE,{}),url:"https://tailscale.com/kb/1031/install-linux"},{key:"macos",name:"Mac",icon:n.jsx(WE,{}),url:"https://tailscale.com/kb/1016/install-mac"},{key:"windows",name:"Windows",icon:n.jsx(KE,{}),url:"https://tailscale.com/kb/1022/install-windows"},{key:"see-more-os",name:"See more",url:"https://tailscale.com/kb/1347/installation"}],Zee=[{key:"linux",name:"Linux",icon:n.jsx(zE,{}),url:"https://tailscale.com/download/linux"},{key:"macos",name:"Mac",icon:n.jsx(WE,{}),url:"https://tailscale.com/download/macos"},{key:"windows",name:"Windows",icon:n.jsx(KE,{}),url:"https://tailscale.com/download/windows"},{key:"see-more-os",name:"See more",url:"https://tailscale.com/download"}],Qee=[{key:"aws",name:"Add AWS VM",icon:n.jsx(Hee,{}),url:"/admin/machines/new-aws"},{key:"azure",name:"Microsoft Azure",icon:n.jsx(zee,{}),url:"https://tailscale.com/kb/1142/cloud-azure-linux"},{key:"gcp",name:"Google Cloud Platform",icon:n.jsx(Kee,{}),url:"https://tailscale.com/kb/1147/cloud-gce"},{key:"see-more-cloud",name:"See more",url:"https://tailscale.com/kb/1357/cloud-server"}],Jee=[{key:"docker",name:"Docker",icon:n.jsx(Wee,{}),url:"https://tailscale.com/kb/1282/docker"},{key:"kubernetes",name:"Kubernetes",icon:n.jsx(Gee,{}),url:"https://tailscale.com/kb/1185/kubernetes"}];function Lg(e){const{heading:t,environments:r}=e;return n.jsxs("div",{className:"mt-4 mr-8 last:mr-0 flex flex-col",children:[n.jsx("h4",{className:"font-normal text-gray-500 mb-1",children:t}),r.map(s=>n.jsx(Xee,{env:s},s.key))]})}function Xee(e){const{env:t}=e,{key:r,name:s,icon:a,url:i,installed:l}=t,u=()=>n.jsx("div",{className:"bg-green-300 h-4 w-4 rounded-full text-white flex items-center justify-center",children:n.jsx(nn,{size:12,strokeWidth:3})});return n.jsxs("a",{href:i,target:"_blank",rel:"noreferrer",className:D("my-1","button bg-bg-base rounded-lg text-left border-1 border-border-interactive hover:bg-gray-50 dark:hover:bg-gray-600","max-w-full w-64 px-4 py-2","flex gap-2"),onClick:()=>{O(R.AddDevicesBannerButtonClicked,{addDeviceBannerProperties:{buttonKey:r}})},children:[(a||l)&&n.jsx("span",{className:"flex-shrink-0",children:l?n.jsx(u,{}):a}),n.jsx("span",{className:D("flex-1 font-normal",{"text-text-base":!!a,"text-text-muted":!a}),children:s}),n.jsx("span",{className:"flex-shrink-0 text-gray-500",children:n.jsx(zx,{})})]})}const ete=e=>f.createElement("svg",{viewBox:"0 0 36 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M25.2889 9.14448L27.7871 4.81679C27.9281 4.57418 27.8429 4.26601 27.6035 4.12503C27.3642 3.98408 27.0527 4.06604 26.915 4.30863L24.384 8.69203C22.4529 7.8101 20.2793 7.31831 17.9417 7.31831C15.6041 7.31831 13.4304 7.8101 11.4993 8.69203L8.9683 4.30863C8.82733 4.06602 8.51914 3.98406 8.27653 4.12503C8.03391 4.26597 7.95195 4.57418 8.09292 4.81679L10.5912 9.14448C6.28317 11.4788 3.36526 15.8392 2.88332 20.9439H33C32.518 15.8392 29.6001 11.4788 25.2889 9.14448H25.2889ZM11.0272 16.7146C10.3289 16.7146 9.76499 16.1474 9.76499 15.4524C9.76499 14.7541 10.3322 14.1901 11.0272 14.1901C11.7256 14.1901 12.2895 14.7573 12.2895 15.4524C12.2929 16.1474 11.7256 16.7146 11.0272 16.7146ZM24.8528 16.7146C24.1545 16.7146 23.5906 16.1474 23.5906 15.4524C23.5906 14.7541 24.1578 14.1901 24.8528 14.1901C25.5512 14.1901 26.1151 14.7573 26.1151 15.4524C26.1185 16.1474 25.5512 16.7146 24.8528 16.7146Z",fill:"currentColor"})),tte=e=>f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 24",...e},f.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.7954 2.08851C20.3723 0.0101142 22.5646 0 22.5646 0C22.5646 0 22.8906 1.95403 21.3241 3.8364C19.6514 5.8464 17.7501 5.51751 17.7501 5.51751C17.7501 5.51751 17.3931 3.93677 18.7954 2.08851V2.08851ZM17.9507 6.88629C18.7619 6.88629 20.2675 5.77114 22.2273 5.77114C25.6007 5.77114 26.9279 8.17157 26.9279 8.17157C26.9279 8.17157 24.3323 9.4986 24.3323 12.7186C24.3323 16.3511 27.5657 17.6031 27.5657 17.6031C27.5657 17.6031 25.3054 23.9648 22.2524 23.9648C20.8502 23.9648 19.7601 23.0199 18.2826 23.0199C16.7771 23.0199 15.283 24 14.3098 24C11.522 24.0001 8 17.9653 8 13.1144C8 8.34171 10.9811 5.838 13.7773 5.838C15.5951 5.838 17.0057 6.88629 17.9507 6.88629V6.88629Z",fill:"currentColor"})),nte=e=>f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 24",...e},f.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 3.5C6 2.67157 6.67157 2 7.5 2H27.5C28.3284 2 29 2.67157 29 3.5V20.5C29 21.3284 28.3284 22 27.5 22H7.5C6.67157 22 6 21.3284 6 20.5V3.5ZM8.96967 4.96967C9.26256 4.67678 9.73744 4.67678 10.0303 4.96967L13.5303 8.46967C13.8232 8.76256 13.8232 9.23744 13.5303 9.53033L10.0303 13.0303C9.73744 13.3232 9.26256 13.3232 8.96967 13.0303C8.67678 12.7374 8.67678 12.2626 8.96967 11.9697L11.9393 9L8.96967 6.03033C8.67678 5.73744 8.67678 5.26256 8.96967 4.96967ZM13 15.2C12.5582 15.2 12.2 15.5582 12.2 16C12.2 16.4418 12.5582 16.8 13 16.8H20.5C20.9418 16.8 21.3 16.4418 21.3 16C21.3 15.5582 20.9418 15.2 20.5 15.2H13Z",fill:"currentColor"})),rte=e=>f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 24",...e},f.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.8794 12.7011C16.0168 10.3047 17.0395 6.40098 19.2618 2H8C6.89543 2 6 2.89543 6 4V20C6 21.1046 6.89543 22 8 22H19.3675C19.1836 20.8126 19.1204 19.6274 19.1251 18.5173C18.6765 18.5758 18.2212 18.6074 17.7647 18.6074C16.1518 18.6074 14.553 18.2135 13.2161 17.6272C11.8949 17.0477 10.7514 16.2451 10.1175 15.3648C9.88356 15.0399 9.95732 14.5868 10.2823 14.3528C10.6072 14.1189 11.0603 14.1926 11.2942 14.5176C11.7192 15.1078 12.6052 15.7759 13.7986 16.2993C14.9764 16.8159 16.3776 17.1574 17.7647 17.1574C18.2344 17.1574 18.7057 17.1182 19.1695 17.0463C19.2362 15.825 19.3653 14.7574 19.4682 13.9668H17.0882C16.4229 13.9668 15.8383 13.4198 15.8794 12.7011ZM20.578 18.2311C21.1884 18.0702 21.7723 17.8645 22.3133 17.6272C23.6346 17.0477 24.7781 16.2451 25.4119 15.3648C25.6459 15.0399 25.5721 14.5868 25.2472 14.3528C24.9222 14.1189 24.4691 14.1926 24.2352 14.5176C23.8102 15.1078 22.9243 15.7759 21.7309 16.2993C21.3857 16.4507 21.0213 16.587 20.6438 16.7041C20.7199 15.5944 20.844 14.6233 20.9397 13.8982C21.0365 13.164 20.4648 12.5168 19.7277 12.5168H17.346C17.5383 10.2196 18.5895 6.37024 20.8934 2H28C29.1046 2 30 2.89543 30 4V20C30 21.1046 29.1046 22 28 22H20.8358C20.6199 20.723 20.5588 19.4319 20.578 18.2311ZM12.5 6.275C12.9004 6.275 13.225 6.59959 13.225 7V9.35294C13.225 9.75335 12.9004 10.0779 12.5 10.0779C12.0996 10.0779 11.775 9.75335 11.775 9.35294V7C11.775 6.59959 12.0996 6.275 12.5 6.275ZM24.225 7C24.225 6.59959 23.9004 6.275 23.5 6.275C23.0996 6.275 22.775 6.59959 22.775 7V9.35294C22.775 9.75335 23.0996 10.0779 23.5 10.0779C23.9004 10.0779 24.225 9.75335 24.225 9.35294V7Z",fill:"currentColor"})),ste="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKQAAACkAQAAAAAxzrjsAAABDElEQVR4AdXXN2EoABSFUBzg3+V1wK/pGV8a43EAvdO+swLSSCQBT9SSrDHKOlI0VG0m3inbQK91g22Kd1qO5hZm3Sjgs4AbraINyVl1ojIynWu6eaLoUmiVa53opjkyF9mNMpsuAi1vdGQSCQzxRIMhuBrAbnTklpBa0pG6yXAWOE9UdQ40auNMa9NRy+1Gt1RxGeSR0krdIratEx25CCmZeaJkLEWWrW50oxENHR1puTZlwAJPVJVRAk7pRP8nOofOE92AicCsrRMVY2ZbDo80oFriBPVGK7ZNIZMbBaSNqFRv1FKzZZodKRozM4E6U7cl0pQ7ZQmylCstJ5pjA28UUGVrmOCB/rTP+gXQHjD2xZBwfgAAAABJRU5ErkJggg==",ate="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJQAAACUAQAAAABdRz15AAAA30lEQVR4Ac3WIQEDARTD0DiIf5d1kLENDP4DF/hoSemvvcsAZw0W4NEsN7dU62woSYNE76a1zT1lNGAodyvZLNK6GuA34GpVkg6rOprgQkzBq7W2EECmV1MMipZ0NGZsi40424YhZI28GgbbNnS7WkxsRCM62kb+lvJqgQ0oN/Jo00IdxLxaTWo4QTraaAqNgLMVjhi20dXYpuCGpkeTqVnLts5GZra2cTcdayWYR6uSyZrp1QATjKl0NEtCA8OzobqmAXvEBi1JvJvCEGF1tbK1WolXA5RtBGs3e/vf/QCH2f3Q1/HmqgAAAABJRU5ErkJggg==",ite=e=>f.createElement("svg",{viewBox:"0 0 36 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 2C7.34315 2 6 3.34315 6 5V19C6 20.6569 7.34315 22 9 22H28C29.6569 22 31 20.6569 31 19V5C31 3.34315 29.6569 2 28 2H9ZM17 5C16.4477 5 16 5.44772 16 6V18C16 18.5523 16.4477 19 17 19H20C20.5523 19 21 18.5523 21 18V6C21 5.44772 20.5523 5 20 5H17ZM23 6C23 5.44772 23.4477 5 24 5H27C27.5523 5 28 5.44772 28 6V18C28 18.5523 27.5523 19 27 19H24C23.4477 19 23 18.5523 23 18V6ZM10 7C9.44772 7 9 7.44772 9 8C9 8.55228 9.44772 9 10 9H13C13.5523 9 14 8.55228 14 8C14 7.44772 13.5523 7 13 7H10ZM20 8.5C20 9.32843 19.3284 10 18.5 10C17.6716 10 17 9.32843 17 8.5C17 7.67157 17.6716 7 18.5 7C19.3284 7 20 7.67157 20 8.5ZM25.5 10C26.3284 10 27 9.32843 27 8.5C27 7.67157 26.3284 7 25.5 7C24.6716 7 24 7.67157 24 8.5C24 9.32843 24.6716 10 25.5 10Z",fill:"currentColor"})),ote=e=>f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 36 24",...e},f.createElement("path",{d:"M6.5 3.27934L15.9055 1.99281V11.051H6.5V3.27934ZM17.0384 1.81427L29.5 0V10.9749H17.0384V1.81427ZM6.5 12.0094H15.9055V21.0938L6.5 19.7811V12.0094ZM17.0384 12.1301H29.5V23L17.0384 21.2409",fill:"currentColor"}));function lte(e,t,r){return{handleSurveyFormSubmit:async()=>{const{roleInOrganization:a,connectionToTailscale:i,useCaseReason:l}=e;try{await Ie.post("/public/events/survey/onboarding",{roleInOrganization:a?.value,connectionToTailscale:i?.value,useCaseReason:l?.value,stepIndex:t,stepTitle:r})}catch{}}}}function cte({stepIndex:e,stepTitle:t,setOnboardingSurveySubmitted:r,skipOnboarding:s}){const[a,i]=f.useState({roleInOrganization:void 0,connectionToTailscale:void 0,useCaseReason:void 0}),{handleSurveyFormSubmit:l}=lte(a,e,t),{variant:u}=Fr("reduce-steps-in-onboarding-v2",!0),d=u==="variant1"||u==="variant2"?"Submit":"Next: Add your first device",[m,p]=f.useState(!1),g=async()=>{if(!m){p(!0);try{await l()}finally{r(!0)}}},v=(b,w)=>{i({...a,[w]:{type:"string-constant",label:b.label,value:b.value}})},y=!a.useCaseReason||!a.roleInOrganization,C=IF();return n.jsxs("div",{className:"flex flex-col gap-6",children:[n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx("p",{children:"What is your primary reason for using Tailscale?"}),n.jsx(br,{className:"max-w-xs leading-6",values:qE,selected:a.useCaseReason,onUpdateSelected:b=>v(b,"useCaseReason"),placeholder:"Select one"})]}),n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx("p",{children:"What is your role?"}),n.jsx(br,{className:"max-w-xs leading-6",values:YE,selected:a.roleInOrganization,onUpdateSelected:b=>v(b,"roleInOrganization"),placeholder:"Select one"})]}),n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsxs("p",{children:["How did you hear about Tailscale?"," ",n.jsx("span",{className:"text-text-muted",children:"(optional)"})]}),n.jsx(br,{className:"max-w-xs leading-6",values:ute,selected:a.connectionToTailscale,onUpdateSelected:b=>v(b,"connectionToTailscale"),placeholder:"Select one"})]}),n.jsxs("div",{className:"flex gap-4 items-center",children:[n.jsx(ue,{className:"items-center",intent:"primary",disabled:y,loading:m,onClick:g,children:d}),C]}),n.jsxs("p",{className:"text-text-muted mt-2",children:["We use survey responses to provide you with relevant content and to improve our products and services. See our"," ",n.jsxs("a",{className:"link",href:"https://tailscale.com/privacy-policy",children:["Privacy Policy"," "]}),"for more information."]})]})}const qE=[{type:"string-constant",label:"Accessing a Regulated Environment",value:"Accessing a Regulated Environment"},{type:"string-constant",label:"AI Infrastructure Access",value:"AI Infrastructure Access"},{type:"string-constant",label:"Application Testing",value:"Application Testing"},{type:"string-constant",label:"Edge / IoT Connectivity",value:"Edge / IoT Connectivity"},{type:"string-constant",label:"Infrastructure Access",value:"Infrastructure Access"},{type:"string-constant",label:"Kubernetes / Service Mesh",value:"Kubernetes / Service Mesh"},{type:"string-constant",label:"Multi-cloud Connectivity",value:"Multi-cloud Connectivity"},{type:"string-constant",label:"Personal or At-Home Use",value:"Personal or At-Home Use"},{type:"string-constant",label:"VPN Replacement",value:"VPN Replacement"},{type:"string-constant",label:"Gaming",value:"Gaming"},{type:"string-constant",label:"Testing / Trying it out",value:"Testing / Trying it out"},{type:"string-constant",label:"Other",value:"Other"}],YE=[{type:"string-constant",label:"Engineer",value:"Engineer"},{type:"string-constant",label:"IT",value:"IT"},{type:"string-constant",label:"Security",value:"Security"},{type:"string-constant",label:"Founder / Executive",value:"Founder / Executive"},{type:"string-constant",label:"Manager",value:"Manager"},{type:"string-constant",label:"Product / Design",value:"Product / Design"},{type:"string-constant",label:"Sales / Marketing",value:"Sales / Marketing"},{type:"string-constant",label:"Personal user",value:"Personal user"},{type:"string-constant",label:"Student",value:"Student"},{type:"string-constant",label:"Other",value:"Other"}],ute=[{type:"string-constant",label:"Search",value:"Search"},{type:"string-constant",label:"YouTube",value:"YouTube"},{type:"string-constant",label:"Event/Meetup",value:"Event/Meetup"},{type:"string-constant",label:"Friend/Colleague",value:"Friend/Colleague"},{type:"string-constant",label:"AI Chatbot/LLM",value:"AI Chatbot/LLM"},{type:"string-constant",label:"Podcast",value:"Podcast"},{type:"string-constant",label:"Social Media",value:"Social Media"},{type:"string-constant",label:"Hacker News",value:"Hacker News"},{type:"string-constant",label:"At Work",value:"At Work"},{type:"string-constant",label:"Advertising",value:"Advertising"},{type:"string-constant",label:"Sales",value:"Sales"},{type:"string-constant",label:"Other",value:"Other"}],Rg="Onboarding survey backfill";function dte({completeSurvey:e}){const{dismissNotice:t}=mu(),[r,s]=f.useState(),[a,i]=f.useState();f.useEffect(()=>{O(R.OnboardingSurveyBackfillViewed,{},{once:!0})},[]);const[l,u]=f.useState(!1),d=async()=>{if(!l){u(!0),O(R.OnboardingSurveyBackfillSubmitted,{onboardingSurveyProperties:{stepTitle:Rg,useCaseReason:r?.value,roleInOrganization:a?.value}});try{await Ie.post("/public/events/survey/onboarding",{useCaseReason:r?.value,roleInOrganization:a?.value,stepIndex:0,stepTitle:Rg})}catch{}finally{e()}}},m=()=>{O(R.OnboardingSurveyBackfillDismissed,{onboardingSurveyProperties:{stepTitle:Rg}}),t(i2.OnboardingSurveyBackfill)},p=!r||!a;return n.jsx("div",{className:"grid gap-6 my-20",children:n.jsxs("div",{className:"rounded-2xl p-6 border bg-bg-base shadow-soft max-w-lg mx-auto w-full overflow-hidden @md:p-10",children:[n.jsx("h2",{className:"font-semibold tracking-tight leading-tight text-3xl mb-2",children:"Help us improve your experience"}),n.jsx("p",{className:"text-text-muted mb-6",children:"A few details about your use case and role help us surface what’s most relevant to you."}),n.jsxs("div",{className:"flex flex-col gap-6",children:[n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx("p",{children:"What is your primary reason for using Tailscale?"}),n.jsx(br,{className:"max-w-xs leading-6",values:qE,selected:r,onUpdateSelected:s,placeholder:"Select one"})]}),n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx("p",{children:"What is your role?"}),n.jsx(br,{className:"max-w-xs leading-6",values:YE,selected:a,onUpdateSelected:i,placeholder:"Select one"})]}),n.jsxs("div",{className:"flex gap-4 items-center",children:[n.jsx(ue,{intent:"primary",disabled:p,loading:l,onClick:d,children:"Submit"}),n.jsx(ze,{className:"whitespace-nowrap text-text-muted",href:"/admin/machines",onClick:m,children:"Dismiss"})]}),n.jsxs("p",{className:"text-text-muted mt-2",children:["We use survey responses to provide you with relevant content and to improve our products and services. See our"," ",n.jsxs("a",{className:"link",href:"https://tailscale.com/privacy-policy",children:["Privacy Policy"," "]}),"for more information."]})]})]})})}function mte(e){const{open:t,onOpenChange:r,newPlan:s}=e,a=()=>{r(!1)};return n.jsx(Re,{open:t,onOpenChange:a,onEscapeKeyDown:a,title:`Your ${Qs(s).replace(" "," ")} plan is now active`,size:"large",children:n.jsxs("section",{className:"flex flex-col justify-between gap-6",children:[n.jsx("p",{children:"Enjoy all the extra benefits and powerful features that come with it."}),n.jsx(ue,{className:"self-end !py-0",intent:"primary",variant:"minimal",suffixIcon:n.jsx(js,{}),onClick:a,children:"Next: Set up your network"})]})})}function fte(){return n.jsxs(at,{elevated:!0,children:[n.jsx("p",{className:"font-medium text-lg",children:"The billing panel is not available at this time"}),n.jsxs("p",{className:"mt-2",children:["Please try again later or reach out to"," ",n.jsx(Zn,{type:"billing",children:"to our support team"}),"."]})]})}function hte(){return n.jsxs(at,{className:"text-lg mt-12",elevated:!0,children:["Your network’s billing is not managed via the Tailscale admin console. Please"," ",n.jsx(Zn,{type:"billing",children:"contact support"})," if you would like information about your plan."]})}function pte(){const{data:e}=ot();return n.jsx("div",{className:"mt-auto pt-12 pb-16 text-center text-text-muted",children:n.jsxs("p",{children:["Not sure you want to subscribe?"," ",n.jsx(ze,{className:"link whitespace-nowrap",to:e?.needsOnboarding?"/admin/welcome":"/admin/machines",onClick:()=>O(R.OnboardingCheckoutSkipped,{}),children:"Skip and decide later"})]})})}function gte({className:e,trialEndDate:t}){const r=f.useMemo(()=>{const s=Yn();return(t&&new Date(t)>s?new Date(t):s).toLocaleString("default",{month:"long",day:"numeric"})},[t]);return n.jsx("div",{className:e,children:r})}function O6({plan:e,planChangeAction:t,inOnboarding:r}){if(r&&e)return`Purchase ${Qs(e)}`;switch(t){case Ir.Upgrade:return"Confirm upgrade";case Ir.Downgrade:return"Confirm downgrade";case Ir.Current:return"Confirm changes"}return"Confirm purchase"}function xte({plan:e,summarySection:t,customer:r,paymentCard:s,paymentIntentToken:a,onEditAddressClick:i,onEditPaymentClick:l,onContinueClick:u,planChangeAction:d,isPosting:m,returnUrl:p,purchaseGeoRestricted:g}){const v=hl(),[y,C]=f.useState(!1),[b,w]=f.useState(""),N=Yt(),k=Uv();return n.jsx(n.Fragment,{children:a?n.jsxs(wh,{stripe:k,options:{clientSecret:a,...$v(v.resolvedTheme)},children:[n.jsx(F6,{customer:r,onEditAddressClick:i,children:n.jsx(at,{children:n.jsx(VN,{options:{layout:"tabs"},onChange:E=>C(E.complete),onReady:()=>{O(R.StripePaymentElementLoaded,{eventProperties:{productArea:N?K.Onboarding:K.Billing,productSubArea:oe.Checkout}})}})})}),n.jsxs(B6,{summarySection:t,children:[n.jsx(QN,{error:b}),g&&n.jsx(nx,{}),n.jsx(YN,{text:O6({plan:e,inOnboarding:N,planChangeAction:d}),customer:r,disabled:!y||m||g,setError:w,withSetup:!0,returnUrl:p})]})]}):n.jsxs(n.Fragment,{children:[n.jsx(F6,{customer:r,onEditAddressClick:i,children:n.jsx(vte,{paymentCard:s,onEditClick:l})}),n.jsxs(B6,{summarySection:t,children:[g&&n.jsx(nx,{}),n.jsx(ue,{className:"w-full mt-5",intent:"primary",disabled:m||g,loading:m,onClick:u,children:O6({plan:e,inOnboarding:N,planChangeAction:d})})]})]})})}function F6({customer:e,onEditAddressClick:t,children:r}){return n.jsxs("div",{className:"w-full @md:max-w-lg space-y-4 mr-4",children:[n.jsx("h3",{className:Et.pageSubTitle,children:"Payment information"}),n.jsx(qN,{customer:e,onEditClick:t,showEmail:!0}),r]})}function B6({summarySection:e,children:t}){return n.jsxs("div",{className:"w-full @md:max-w-lg mt-10 @md:mt-0",children:[e,t]})}function vte({paymentCard:e,onEditClick:t}){const r=f.useCallback(()=>n.jsx(ue,{variant:"minimal",sizeVariant:"small",intent:"primary",onClick:()=>{O(R.EditPaymentMethodButtonClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.Checkout}}),t()},children:"Edit"}),[t]);return n.jsx(at,{className:"p-4 bg-bg-base",children:n.jsx("div",{className:"flex justify-between items-center",children:e?n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center",children:[n.jsx(cw,{className:"mr-3 text-text-muted"}),n.jsx("div",{children:n.jsxs("p",{className:"font-medium",children:[ml(e.brand)," ****",e.lastFour]})})]}),n.jsx(r,{})]}):n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"text-text-disabled",children:"—"}),n.jsx(r,{})]})})})}function nx(){const{data:e}=Nt(),t=e?.readableProductID,r=gu(t);return n.jsx("div",{className:"mt-4 p-4 bg-red-50 dark:bg-red-900/20 rounded-lg border border-red-200 dark:border-red-800",children:n.jsxs("p",{className:"text-red-700 dark:text-red-300 text-sm",children:["Hybrid plans are not available in your region. Please contact"," ",r?"sales":"support"," for assistance."]})})}function yte({planSummarySection:e,customer:t,updateCustomer:r,onContinueClick:s,isPosting:a,purchaseGeoRestricted:i,setPurchaseGeoRestricted:l}){const u=Yt(),d=f.useMemo(()=>Cl(t?.email||""),[t?.email]);return n.jsxs(n.Fragment,{children:[n.jsx(KN,{customerDetails:t,setCustomerDetails:r,setPurchaseGeoRestricted:l}),n.jsxs("div",{className:"w-full @md:max-w-lg mt-10 @md:mt-0",children:[e,i&&n.jsx(nx,{}),n.jsx(ue,{className:"w-full mt-5",intent:"primary",disabled:!t?.address||!t.name||!d||a||i,loading:a,onClick:()=>{O(R.ContinueToPaymentDetailsButtonClicked,{eventProperties:{productArea:u?K.Onboarding:K.Billing,productSubArea:oe.Checkout}}),s()},children:"Continue to payment details"})]})]})}function bte({product:e,name:t,subtitle:r,totalPriceText:s,itemized:a,billingInterval:i,appliedPromo:l,setAppliedPromo:u,displayPromo:d=!1,className:m}){const[p,g]=f.useState(""),[v,y]=ft(),[C]=rl(),b=Yt(),{step:w,goTo:N,api:k}=os(),{hasSeatReduction:E}=Qf();ce.useEffect(()=>{if(!u||!d)return;const B=C.get("promocode");B&&(O(R.PromoCodeAppliedFromURL,{eventProperties:{productArea:b?K.Onboarding:K.Billing,productSubArea:oe.Checkout},checkoutProperties:{targetPlan:e,promoCode:B}},{once:!0}),g(B),y(v,{replace:!0}))},[C,u,d,v,y,e,b]);const{data:T}=Nt(),_=T?.trialEnd?new Date(T.trialEnd):void 0,I=vu(T),{data:F,isLoading:z,constructPromo:H}=I7({code:p});ce.useEffect(()=>{!z&&p&&(F?.promoCodes?.length===1&&e&&u?u(H(F.promoCodes[0],e)):u&&u({isValid:!1,name:p}),g(""))},[z,p,F,u,H,e]);const J=f.useMemo(()=>{const B=a.reduce((W,U)=>W+(U.price||0),0);return Math.max(B,0)},[a]),Y=e&&e!=="mullvad";return n.jsxs(at,{className:m,children:[Y&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center gap-3",children:[n.jsx(Vv,{product:e,height:30}),n.jsxs("div",{children:[n.jsx("div",{className:"flex items-center gap-2",children:n.jsxs("h3",{className:"text-lg font-semibold leading-none",children:[t," Plan"]})}),r&&n.jsx("p",{className:"pt-1 text-text-muted",children:r}),s&&n.jsx("p",{className:"pt-1 text-text-muted",children:s})]})]}),n.jsx("hr",{className:"my-4 border-t"})]}),n.jsxs("div",{children:[n.jsx("h3",{className:"text-lg font-semibold",children:"Summary"}),a.map((B,W)=>n.jsxs("div",{"data-testid":`summary-line-${B.type}`,className:D("flex gap-2 mt-2",{"text-text-success":B.type==="discount","font-medium":B.type==="discount"}),children:[B.promo?n.jsxs("div",{className:"text-text-success",children:[n.jsxs("div",{className:"font-medium",children:["Promo code: ",B.promo.name]}),n.jsxs("div",{children:[IN(B.promo.discount?.duration?.duration,B.promo.discount?.duration?.months,B.promo.discount?.percentOff,B.promo.discount?.amountOff)," ","·"," ",n.jsx("button",{className:"underline text-text-danger hover:text-text-danger",onClick:()=>{u&&u(null),g("")},children:"Remove"})]})]}):B.name,B.tooltip&&n.jsx(Ee,{content:B.tooltip,side:"bottom",children:n.jsx(bs,{className:"text-text-muted",size:"0.9em"})}),B.type==="hybrid_seats"&&w!==2&&!E&&n.jsx("button",{className:"link",onClick:()=>N(2),children:"Edit"}),B.credits&&n.jsx("p",{className:"ml-auto",children:B.credits.toLocaleString()+" credits"}),n.jsx("span",{className:D("tabular-nums",{"ml-5":B.credits,"ml-auto":!B.credits}),children:B.price===void 0?k.isPosting?n.jsx(ts,{size:"sm"}):n.jsx("span",{className:"text-text-muted",children:"TBD"}):Ks(B.price)})]},W)),d?n.jsx(GN,{setCode:B=>{u?.(null),g(B)},appliedPromo:l}):null,n.jsx("hr",{className:"my-4 border-t"}),n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex gap-2 justify-between",children:[n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"font-medium text-lg",children:["Total per ",i]}),n.jsx("div",{"data-testid":"summary-total",className:"text-2xl mt-1 font-semibold",children:J===0?"$0":Ks(J)})]}),n.jsxs("div",{className:"flex-1",children:[n.jsx("div",{className:"font-medium text-lg",children:"Next payment on"}),n.jsx("div",{"data-testid":"summary-next-payment",children:n.jsx(gte,{className:"text-2xl mt-1 font-semibold",trialEndDate:_})})]})]}),I&&n.jsx("p",{className:"text-text-muted mt-2",children:"You’re in your free 2-week trial. You won’t be charged until your trial ends."}),n.jsxs("p",{className:"text-text-muted",children:[n.jsx("a",{className:"underline",href:"https://tailscale.com/kb/1182/billing-information/#sales-tax",target:"_blank",rel:"noreferrer noopener",children:"Learn more"})," ","about how Tailscale collects sales tax."]})]})]})]})}function Qv({invalidSeatCount:e}){const{data:t,setData:r}=os(),{data:s,currentHybridPlanSeatCount:a}=Nt(),i=f.useMemo(()=>Ote({planId:t.planId,seats:t.quantity,promo:t.appliedPromo}),[t.planId,t.appliedPromo,t.quantity]),l=t.planId,u=ef(l),d=Ks(u,!1),m=Qs(l),p=`${d} per seat / month`,{headerLabel:g,note:v,planChangeAction:y}=mQ(t.planId,t.quantity,a),C=v&&!e;return n.jsxs(n.Fragment,{children:[g&&y!==Ir.Current?n.jsx("h3",{className:D("mb-4",Et.pageSubTitle),children:g}):n.jsx(ZN,{}),C&&n.jsx(JN,{children:v}),dH(s)&&n.jsxs(rt,{intent:"success",className:"mb-4",children:["As a thank-you for upgrading from a legacy plan, your new plan includes a free ",uH,"-day trial — you won’t be charged until it ends."]}),n.jsx(bte,{product:t.planId,name:m,totalPriceText:p,billingInterval:t.billingInterval,itemized:[...i,{name:"Estimated sales tax",price:t.taxCents}],appliedPromo:t.appliedPromo,setAppliedPromo:b=>r({...t,appliedPromo:b}),displayPromo:!0})]})}function Cte(){const{data:e,setData:t,api:r,goTo:s}=os(),a=()=>{const i={planId:e.planId,quantity:e.quantity,customer:e.customer,createSetupIntent:!e.paymentCard};r.postSetup(i).then(l=>{t({...e,intentToken:l.intentToken??e.intentToken,taxCents:l.taxCents}),s(4)})};return n.jsx("div",{className:"@md:flex @md:space-x-5 mt-10 mx-auto justify-between",children:n.jsx(yte,{planSummarySection:n.jsx(Qv,{}),customer:e.customer,updateCustomer:i=>t({...e,customer:i}),isPosting:r.isPosting,onContinueClick:a})})}var Nh="Collapsible",[wte]=Cr(Nh),[jte,Jv]=wte(Nh),ZE=f.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:s,defaultOpen:a,disabled:i,onOpenChange:l,...u}=e,[d,m]=Mr({prop:s,defaultProp:a??!1,onChange:l,caller:Nh});return n.jsx(jte,{scope:r,disabled:i,contentId:qn(),open:d,onOpenToggle:f.useCallback(()=>m(p=>!p),[m]),children:n.jsx(tt.div,{"data-state":ey(d),"data-disabled":i?"":void 0,...u,ref:t})})});ZE.displayName=Nh;var QE="CollapsibleTrigger",JE=f.forwardRef((e,t)=>{const{__scopeCollapsible:r,...s}=e,a=Jv(QE,r);return n.jsx(tt.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":ey(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...s,ref:t,onClick:je(e.onClick,a.onOpenToggle)})});JE.displayName=QE;var Xv="CollapsibleContent",XE=f.forwardRef((e,t)=>{const{forceMount:r,...s}=e,a=Jv(Xv,e.__scopeCollapsible);return n.jsx(En,{present:r||a.open,children:({present:i})=>n.jsx(Ste,{...s,ref:t,present:i})})});XE.displayName=Xv;var Ste=f.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:s,children:a,...i}=e,l=Jv(Xv,r),[u,d]=f.useState(s),m=f.useRef(null),p=Ct(t,m),g=f.useRef(0),v=g.current,y=f.useRef(0),C=y.current,b=l.open||u,w=f.useRef(b),N=f.useRef(void 0);return f.useEffect(()=>{const k=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(k)},[]),kn(()=>{const k=m.current;if(k){N.current=N.current||{transitionDuration:k.style.transitionDuration,animationName:k.style.animationName},k.style.transitionDuration="0s",k.style.animationName="none";const E=k.getBoundingClientRect();g.current=E.height,y.current=E.width,w.current||(k.style.transitionDuration=N.current.transitionDuration,k.style.animationName=N.current.animationName),d(s)}},[l.open,s]),n.jsx(tt.div,{"data-state":ey(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!b,...i,ref:p,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":C?`${C}px`:void 0,...e.style},children:b&&a})});function ey(e){return e?"open":"closed"}var kte=ZE,Nte=JE,Ete=XE;function eA(e){const{children:t,className:r,triggerClassName:s,trigger:a,onOpenChange:i}=e,[l,u]=f.useState(e.open);return n.jsxs(kte,{className:r,open:l,onOpenChange:d=>{u(d),i?.(d)},children:[n.jsxs(Nte,{className:D("inline-flex items-center cursor-pointer hover:bg-bg-menu-item-hover focus-visible:bg-bg-menu-item-hover rounded pr-3 py-1 transition-colors",s),children:[n.jsx("span",{className:"ml-2 mr-1.5 state-open:rotate-90",children:n.jsx(js,{strokeWidth:3,className:"text-text-muted w-4"})}),a]}),n.jsx(Ete,{className:"mt-2",children:t})]})}const U6="text-text-muted w-4 ml-2";function Ate(e){const{triggerCols:t,expandCols:r,triggerClasses:s,expandedClasses:a,startExpanded:i,onExpandedChanged:l=()=>{}}=e,[u,d]=f.useState(i||!1);function m(p){d(p),l(p)}return n.jsxs("tbody",{className:"border-b last:border-0 isolate",children:[n.jsx("tr",{onClick:()=>r&&m(!u),className:D("hover:bg-gray-50 dark:hover:bg-gray-800",{"cursor-pointer":r},s),"aria-expanded":u,children:t(n.jsx("div",{className:"float-left",children:r&&(u?n.jsx(Nn,{strokeWidth:3,className:U6}):n.jsx(js,{strokeWidth:3,className:U6}))}))}),r&&n.jsx("tr",{className:D(a,{hidden:!u}),children:r})]})}const Oce=Object.freeze(Object.defineProperty({__proto__:null,CollapsibleTableRow:Ate,default:eA},Symbol.toStringTag,{value:"Module"}));function Pte(){const e=Yt();return f.useMemo(()=>n.jsx(eA,{trigger:"Frequently asked questions",triggerClassName:"font-medium",onOpenChange:()=>{O(R.HybridSeatsFAQToggled,{eventProperties:{productArea:e?K.Onboarding:K.Billing,productSubArea:oe.Checkout}},{throttleMs:5e3})},children:n.jsxs(at,{className:"space-y-4",children:[n.jsxs("div",{className:"space-y-0.5",children:[n.jsx("h4",{className:"font-medium",children:"What counts as an occupied seat? What counts as a vacant seat?"}),n.jsx("p",{children:"Upon inviting or provisioning a user, that user does not immediately occupy a seat. A user occupies a vacant seat when they first log into the admin console or when they first authenticate a device. A user vacates a seat when they leave the tailnet, or if their account is deleted, suspended, or deprovisioned by the IdP. Seats are reusable, meaning they can be continually vacated and occupied by different users."})]}),n.jsxs("div",{className:"space-y-0.5",children:[n.jsx("h4",{className:"font-medium",children:"What happens when a user joins a tailnet with full seats?"}),n.jsx("p",{children:"To help accommodate this user, your seat count will automatically increase by 1 to match the number of logged-in users. The cost of that extra seat is prorated."})]}),n.jsxs("div",{className:"space-y-0.5",children:[n.jsx("h4",{className:"font-medium",children:"How do you add and remove seats?"}),n.jsx("p",{children:"The tailnet Owner, Admin, or Billing Admin can increase or decrease the number of purchased seats per month. Seats can be added or removed at any time, but the total number of seats cannot decrease below the number of occupied seats. You’re charged for all seats on your tailnet, including vacant ones, so adjust accordingly."})]}),n.jsx("div",{children:n.jsx("a",{className:"link",href:"https://tailscale.com/pricing#what-is-seat-based-pricing-and-how-does-it-work",target:"_blank",rel:"noopener noreferrer",title:"Learn more about seat-based pricing","aria-label":"Learn more about seat-based pricing",onClick:()=>O(R.LearnMoreSeatsClicked,{eventProperties:{productArea:e?K.Onboarding:K.Billing,productSubArea:oe.Checkout}}),children:"Learn more about seats"})})]})}),[e])}function Tte({numOfSeats:e,setNumOfSeats:t,showSeatsError:r,currentOccupiedSeatCount:s,editingExistingHybridPlan:a,className:i}){const{loaded:l,currentHybridPlanSeatCount:u}=Nt();if(!l)return n.jsx(De,{});const d=Ite(e,s),{label:m,helpText:p}=Dte(a,s,u);return n.jsx(at,{className:i,children:n.jsx(Br,{error:r?d:"",label:m,help:p,children:n.jsx(bh,{id:"seat-amount",variant:"chevrons",step:1,steppers:"on",className:"w-28",min:0,error:r,onChange:g=>{t(g),O(R.HybridPlanSeatInputValueChanged,{eventProperties:{productArea:K.Billing,productSubArea:oe.Checkout}},{throttleMs:5e3})},value:e})})})}function Ite(e,t){return e===0?n.jsxs("p",{className:"text-pretty",children:["You cannot remove all your seats. To cancel your Tailscale plan,"," ",n.jsx(ze,{to:"/admin/settings/general#delete-tailnet",className:"underline",children:"delete your tailnet"}),"."]}):`Currently you have ${t} users who would need seats. To purchase fewer seats than that, remove users who have logged in during the last month.`}function Dte(e,t,r){const s=r-t;return e?{label:"New total seats",helpText:`Currently you have ${r} ${yt("total seat",r)} (${t} occupied, ${s} vacant).`}:{label:"Seats to purchase",helpText:`Currently you have ${t} users who would need seats.`}}function _te(){const{data:e,setData:t,goTo:r,api:s}=os(),a=Yt(),{loaded:i,billingUsage:l,data:u}=Nt(),d=Zs(u?.readableProductID??"personal");if(ce.useEffect(()=>{s.setPurchaseGeoRestricted?.(!1),t({...e,taxCents:void 0})},[]),!i)return n.jsx(De,{});const m=l?.usage.occupied_seats??Pu,p=e.quantity,g=pt({...e,quantity:w}),showSeatsError:g,currentOccupiedSeatCount:m,editingExistingHybridPlan:d}),n.jsx(Pte,{})]}),n.jsxs("div",{className:"w-full @md:max-w-lg mt-5 @md:mt-0",children:[n.jsx(Qv,{invalidSeatCount:g}),n.jsx(ue,{className:"w-full mt-5",intent:"primary",disabled:y,onClick:()=>{O(R.ContinueToPaymentDetailsButtonClicked,{eventProperties:{productArea:a?K.Onboarding:K.Billing,productSubArea:oe.Checkout}}),C?s.postSetup({planId:e.planId,quantity:e.quantity,customer:e.customer,createSetupIntent:!1}).then(()=>r(4)):r(3)},children:b})]})]})}function Mte(){const{data:e,setData:t,api:r,goTo:s}=os(),[,a]=ft(),[i,l]=f.useState(!1),u=Yt(),d=xu(e.planId),m=d===Ir.Downgrade,p=d===Ir.Upgrade;f.useEffect(()=>{e.taxCents===void 0&&e.customer&&e.paymentCard&&r.postSetup({planId:e.planId,quantity:e.quantity,customer:e.customer,createSetupIntent:!1})},[]);const g=()=>{const w={planId:e.planId,promoCode:e.appliedPromo?.name,promoId:e.appliedPromo?.id,quantity:e.quantity};r.postCheckout(w).then(()=>{const N=new URLSearchParams;p&&(N.set("newPlan",e.planId),e.quantity&&N.set("seats",String(e.quantity)));const k=N.toString();a(`/admin/settings/billing${k&&`?${k}`}`,{replace:!0})}).catch(()=>{l(!1)})},v=e.appliedPromo?.id,y=e.appliedPromo?.name,C=u?"/admin/welcome":"/admin/settings/billing",b=v?`${C}/checkout/${e.planId}-complete?promo=${v}&promocode=${y}&seats=${e.quantity}`:`${C}/checkout/${e.planId}-complete?seats=${e.quantity}`;return n.jsxs("div",{className:"@md:flex @md:space-x-5 mt-10 mx-auto justify-between",children:[n.jsx(xte,{plan:e.planId,isPosting:r.isPosting,planChangeAction:d,summarySection:n.jsx(Qv,{}),customer:e.customer,paymentCard:e.paymentCard,paymentIntentToken:e.intentToken,returnUrl:b,onEditAddressClick:()=>s(3),onEditPaymentClick:()=>r.postSetup({planId:e.planId,quantity:e.quantity,customer:e.customer,createSetupIntent:!0}).then(w=>t({...e,intentToken:w.intentToken??e.intentToken})),onContinueClick:()=>{const w=u?R.PurchasePlanButtonClicked:m?R.ConfirmDowngradeButtonClicked:R.ConfirmUpgradeButtonClicked;O(w,{eventProperties:{productArea:u?K.Onboarding:K.Billing,productSubArea:oe.Checkout}}),m?l(!0):g()},purchaseGeoRestricted:e.purchaseGeoRestricted}),n.jsx(Bv,{currentPlan:e.currentPlanId,newPlan:e.planId,open:i,onOpenChange:l,isPosting:r.isPosting,onConfirm:g})]})}function Lte(){const{step:e,goTo:t}=os(),[,r]=ft(),s=Yt(),a=[{label:"Plans",onClick:()=>{O(R.StepperPlansStepClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.Plans}}),r(`/admin/${s?"welcome":"settings/billing"}/plans`)}},{label:"Calculate",onClick:()=>{O(R.StepperCalculateStepClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.Plans}}),t(2)}},{label:"Billing details",onClick:()=>{O(R.StepperBillingDetailsStepClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.Plans}}),t(3)}},{label:"Payment",onClick:()=>{O(R.StepperPaymentStepClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.Plans}}),t(4)}}];return n.jsxs(mn,{children:[n.jsx(Hv,{currentStep:e,steps:a}),e===2&&n.jsx(_te,{}),e===3&&n.jsx(Cte,{}),e===4&&n.jsx(Mte,{}),s&&n.jsx(pte,{})]})}function Rte({plan:e,initialSeats:t}){const{postSetup:r,postCheckout:s,isPosting:a}=T7(),{billingInterval:i,currentHybridPlanSeatCount:l,data:u,billingUsage:d,loaded:m}=Nt();if(!m)return n.jsx(De,{});const p=d?.usage.occupied_seats??Pu,g=u?.readableProductID??"personal",v=t??(Zs(g)?l:p),C=Zs(g)&&g===e?l:void 0,b=Fte(u,e),w={postSetup:({planId:N,quantity:k,customer:E,createSetupIntent:T})=>r(N,k,E,T),postCheckout:({planId:N,quantity:k,promoCode:E,promoId:T})=>s(N,k,void 0,E??null,T??null),isPosting:a};return n.jsx(MN,{api:w,initialData:{planId:e,currentPlanId:g,quantity:v,originalQuantity:C,usersCount:d?.usage.active_users||0,billingInterval:i,customer:u?.customerDetails,paymentCard:u?.billingCard,activeTrial:u?.trialEnd&&u.status==="trialing",taxCents:void 0,intentToken:"",appliedPromo:null},initialStep:b,children:n.jsx(Lte,{})})}function Ote(e){const{planId:t,seats:r,promo:s}=e,a=ef(t),l=[{name:`${Ks(a,!1)} × ${r} ${yt("seat",r)}`,price:a*r,type:"hybrid_seats"}];if(s?.isValid){let u=0;s.discount?.amountOff?u=s.discount.amountOff:s.discount?.percentOff&&(u=s.discount.percentOff/100*l[0].price),l.push({name:"Promo code discount",price:-u,type:"discount",promo:s})}return l}function Fte(e,t){const r=e?.readableProductID===void 0||e?.readableProductID===t||e.type!=="hybrid",s=!!(e?.billingCard&&y2(e?.customerDetails));let a=3;return r?a=2:s&&(a=4),a}function tA({id:e}){const{data:t,error:r}=ot(),{data:s,loaded:a,error:i}=Nt(),{hasPlanDowngrade:l,hasSeatReduction:u,scheduledPlanTarget:d}=Qf(),m=Z8(),{data:p}=vt(),g=PN(),v=Yt(),y=B$(t,s),C=new URLSearchParams(m),b=e.replace(/-complete$/,""),w=e.endsWith("-complete"),N=C.get("seats"),k=N?Number.parseInt(N):Pu,E=C.get("promo")??void 0,T=C.get("promocode")??void 0,_=b!==s?.readableProductID,I=l&&!!d&&fl(d);return a?r||i?n.jsx(fte,{}):t&&!t.canEditBilling?n.jsx(gs,{to:"/admin/settings/billing",toastKey:"no-billing-permission",message:"You don’t have permission to edit billing settings.",timeout:8e3,variant:"danger"}):g?n.jsx(_i,{to:"/admin/settings/billing"}):y?p.billingManagedExternally?n.jsx(hte,{}):Zs(b)?l&&_?n.jsx(gs,{to:"/admin/settings/billing",toastKey:"scheduled-changes-block",message:"You have scheduled plan changes. Cancel them before making new plan changes.",variant:"danger"}):I&&!_?n.jsx(gs,{to:"/admin/settings/billing",toastKey:"scheduled-changes-block",message:"You have a scheduled downgrade to the Personal plan. Cancel it before editing seats.",variant:"danger"}):u&&!_?n.jsx(gs,{to:"/admin/settings/billing",toastKey:"scheduled-seat-changes-block",message:"You have a scheduled seat change. Cancel it before editing seats.",variant:"danger"}):w?n.jsx(Bte,{plan:b,seats:k,promoCode:T,promoId:E}):n.jsx(Rte,{plan:b,initialSeats:N&&k>0?k:void 0}):n.jsx(gs,{to:v?"/admin/welcome/plans":"/admin/settings/billing/plans",toastKey:"plan-type-mismatch",message:"This plan is not available. Please select from the available plans.",variant:"danger"}):n.jsx(gs,{to:"/admin/settings/billing",toastKey:"unable-to-checkout",message:"Checkout is unavailable for your current plan. Contact support for assistance.",timeout:8e3,variant:"danger"}):n.jsx(De,{})}function Bte({plan:e,seats:t,promoCode:r,promoId:s}){const{postCheckout:a}=T7(),[,i]=ft(),{data:l}=ot(),u=Yt(),m=xu(e)===Ir.Upgrade;return zv(()=>{const p=new URLSearchParams(globalThis.location.search).get("setup_intent_client_secret");a(e,t,p||void 0,r,s).then(()=>{const g=u&&l?.needsOnboarding?`/admin/welcome?purchasedPlan=${e}`:`/admin/settings/billing${m?`?newPlan=${e}`:""}`;i(g,{replace:!0})}).catch(()=>{i("/admin/settings/billing",{replace:!0})})}),n.jsx(De,{})}const Ute=Object.freeze(Object.defineProperty({__proto__:null,default:tA},Symbol.toStringTag,{value:"Module"})),V6=ce.lazy(()=>$e(()=>import("./hybrid-pricing-plans-view-DrCQIRex.js"),__vite__mapDeps([0,1,2,3]))),Vte=ce.lazy(()=>$e(()=>import("./pricing-plans-view-vMDVW4Ub.js"),__vite__mapDeps([4,2,1,3])));function nA(e){return n.jsx(pl,{experimentKey:"optimize-billing-plans-page",enabled:!0,variants:{control:n.jsx(V6,{}),variant1:n.jsx(Vte,{})},unenrolled:n.jsx(V6,{})})}const $te=Object.freeze(Object.defineProperty({__proto__:null,default:nA},Symbol.toStringTag,{value:"Module"}));function Hte(){const{data:e}=ot(),{data:t}=sn({refreshInterval:2e3}),[r,s]=f.useState(!1),[a,i]=f.useState({}),l=a.ownDevice?.id,u=a.otherDevice?.id,d=e?.loginName;return f.useEffect(()=>{!t||!d||(s(Array.isArray(t.machines)),!(l&&u)&&i(m=>{const p={...m};return p.ownDevice||(p.ownDevice=t.machines.find(g=>g.user===d)),p.otherDevice||(p.otherDevice=t.machines.find(g=>g.id!==p.ownDevice?.id&&!bw(g))),p}))},[l,u,t,d]),{ownDevice:a.ownDevice,otherDevice:a.otherDevice,hasFetched:r}}function rx(){rA(),O(R.OnboardingCompleted,{})}var ty=(e=>(e.OnboardingSurvey="Help us better understand your product needs and use-cases",e.FirstDeviceActivation="Let’s add your first device.",e.SecondDeviceActivation="Next, add a second device.",e.PingTutorial="Done! Your devices can now connect from anywhere.",e.Done="What’s next? Whatever you want.",e))(ty||{});function sx(e){e!==void 0&&(rA(),O(R.OnboardingSkipped,{onboardingProperties:{stepIndex:Bs(e)+1}}))}function rA(){yi("/self",e=>e&&{...e,user:{...e.user,needsOnboarding:!1}},{revalidate:!1}),Ie.post("/self",{onboardingCompleted:!0}).catch(()=>{yi("/self")})}const Bs=e=>{switch(e){case"Help us better understand your product needs and use-cases":return 0;case"Let’s add your first device.":return 1;case"Next, add a second device.":return 2;case"Done! Your devices can now connect from anywhere.":return 3;case"What’s next? Whatever you want.":return 4}},zte="Done! Your devices can now connect from anywhere.";function Wte({showPlans:e,checkoutPlanId:t,finishSetup:r}){const{data:s}=ot(),{data:a}=Rt(),{data:i}=vt(),[l,u]=rl(),[d,m]=f.useState(),{ownDevice:p,otherDevice:g,hasFetched:v}=Hte(),y=p?.id,C=g?.id,[b,w]=f.useState(!1),[N,k]=ft(),E=r&&s?.onboardingCompleted,T=!!(s&&!e&&!t),{variant:_}=Fr("reduce-steps-in-onboarding-v2",T),I=_==="variant1"||_==="variant2",F=I&&s!==void 0&&!s.onboardingCompleted&&!E,z=f.useCallback(()=>{rx(),k("/admin/machines")},[k]);f.useEffect(()=>{F&&b&&z()},[F,b,z]),f.useEffect(()=>{m(B=>{if(!v)return;if(!E&&!b&&!a?.personalization?.useCase)return"Help us better understand your product needs and use-cases";const W=y?C?"Done! Your devices can now connect from anywhere.":"Next, add a second device.":"Let’s add your first device.";return B===void 0||Bs(W)>Bs(B)?W:B})},[y,C,v,s,b,a?.personalization?.useCase,E]),f.useEffect(()=>{d!==void 0&&(O(R.OnboardingStepViewed,{onboardingProperties:{stepTitle:d,stepIndex:Bs(d)+1}}),Bs(d)>=Bs(zte)&&rx())},[d]);const[H,J]=f.useState(void 0);if(f.useEffect(()=>{const B=l.get("purchasedPlan");B&&(J(B),k(N,{replace:!0}))},[l,u,N,k]),f.useEffect(()=>{t&&!t?.endsWith("-complete")&&O(R.OnboardingCheckoutStarted,{checkoutProperties:{targetPlan:t}})},[t]),f.useEffect(()=>(document.body.classList.add("bg-gray-100","dark:bg-gray-1000"),()=>{document.body.classList.remove("bg-gray-100","dark:bg-gray-1000")}),[]),d===void 0||s===void 0)return null;if(e)return n.jsx(f.Suspense,{fallback:n.jsx(De,{loadingMessage:"Loading plans..."}),children:n.jsx(nA,{})});if(t)return n.jsx(f.Suspense,{fallback:n.jsx(De,{loadingMessage:"Loading checkout..."}),children:n.jsx(tA,{id:t})});const Y=i.featureOnboardingSurveyBackfill&&d==="Help us better understand your product needs and use-cases"&&s.onboardingCompleted===!0;return n.jsxs("div",{className:"@container flex flex-col h-full",children:[d==="Help us better understand your product needs and use-cases"?Y?n.jsx(dte,{completeSurvey:z}):n.jsx(Gte,{currentStep:d,setOnboardingSurveySubmitted:w}):n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid @lg:grid-flow-col @lg:grid-cols-2 gap-6 my-20",children:[n.jsxs("div",{className:"rounded-2xl p-6 border bg-bg-base shadow-soft max-w-2xl mx-auto w-full overflow-hidden @md:p-10",children:[n.jsx(sA,{className:"mb-8",steps:Object.values(ty),currentStepIndex:Bs(d)}),n.jsx("h2",{className:"font-semibold tracking-tight leading-tight text-3xl mb-6",children:d}),n.jsx("div",{children:n.jsx(Kte,{currentStep:d,user:s,ownDevice:p,otherDevice:g,setCurrentStep:m})})]}),n.jsx("div",{className:"flex order border shadow-soft bg-bg-base max-w-2xl mx-auto w-full overflow-hidden rounded-2xl p-10",children:n.jsx(qte,{firstDevice:p,secondDevice:g,completed:d==="What’s next? Whatever you want."})})]}),I?d==="What’s next? Whatever you want."?null:n.jsx("div",{className:"mt-auto pt-12 pb-16 text-center text-text-muted",children:n.jsx("p",{children:n.jsx(ze,{className:"link whitespace-nowrap",href:"/admin/machines",onClick:()=>sx(d),children:"Back to Machines"})})}):n.jsx("div",{className:"mt-auto pt-12 pb-16 text-center text-text-muted",children:n.jsxs("p",{children:["Already familiar with Tailscale?"," ",n.jsx(ze,{className:"link whitespace-nowrap",href:"/admin/machines",onClick:()=>sx(d),children:"Skip this introduction"})]})})]}),n.jsx(mte,{open:!!H,newPlan:H,onOpenChange:B=>{B||J(void 0)}})]})}function Kte(e){const{currentStep:t,user:r,ownDevice:s,otherDevice:a,setCurrentStep:i}=e;switch(t){case"Let’s add your first device.":return n.jsxs(n.Fragment,{children:[n.jsxs("p",{className:"mb-6",children:["Install Tailscale and sign in as ",n.jsx("strong",{children:r.loginName}),". Once you sign in on a device, it will be automatically added to your Tailscale network."]}),n.jsx(Yc,{onDownloadDevice:!0,secondDevice:!1,user:r})]});case"Next, add a second device.":return n.jsxs(n.Fragment,{children:[s&&n.jsxs("p",{className:"mb-2",children:["Your device (",n.jsx("strong",{children:s.name}),") was added to your network!"]}),n.jsx("p",{className:"mb-6",children:"Tailscale connects multiple devices together, so you’ll need it installed on more than one device. Open the link below on a second device and download Tailscale there too."}),n.jsx(Yc,{onDownloadDevice:!s,secondDevice:!0,user:r})]});case"Done! Your devices can now connect from anywhere.":return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"mb-6",children:"Every device in your Tailscale network has a private 100.x.y.z IP address that you can reach no matter where you are. And every protocol works — SSH, RDP, HTTP, Minecraft — use whatever you want while Tailscale is running."}),n.jsx(nne,{firstDevice:s,secondDevice:a,ownerLoginName:r.loginName,onNextStepClick:()=>i("What’s next? Whatever you want.")})]});case"What’s next? Whatever you want.":return n.jsxs("div",{children:["Connect all your devices, or read some of our guides to learn how to take advantage for all that Tailscale has to offer.",n.jsxs("div",{className:"mt-8",children:[n.jsx(mm,{...rne}),r.sharedDomain?n.jsx(mm,{...ine}):n.jsx(mm,{...ane}),n.jsx(mm,{...sne})]}),n.jsx(Vt,{to:"/admin/machines",className:"mt-8",onClick:rx,children:"Go to the admin console"})]})}}function Gte({currentStep:e,setOnboardingSurveySubmitted:t}){const{variant:r}=Fr("reduce-steps-in-onboarding-v2",!0),s=r==="variant1"||r==="variant2";return n.jsx("div",{className:"grid gap-6 my-20",children:n.jsxs("div",{className:"rounded-2xl p-6 border bg-bg-base shadow-soft max-w-lg mx-auto w-full overflow-hidden @md:p-10",children:[!s&&n.jsx(sA,{className:"mb-8",steps:Object.values(ty),currentStepIndex:Bs(e)}),n.jsx("h2",{className:"font-semibold tracking-tight leading-tight text-3xl mb-6",children:e}),n.jsx("div",{className:"flex flex-col gap-8 items-start",children:n.jsx(cte,{setOnboardingSurveySubmitted:t,skipOnboarding:sx.bind(null,e),stepIndex:Bs(e),stepTitle:"Help us better understand your product needs and use-cases"})})]})})}function sA(e){const{className:t,steps:r,currentStepIndex:s}=e;return n.jsx("div",{className:D(t,"flex"),children:r.map((a,i)=>n.jsx("div",{style:{height:4},className:D("w-8 rounded mr-1",{"bg-gray-600 dark:bg-gray-300":i===s,"bg-gray-300 dark:bg-gray-700":i!==s})},i))})}function qte(e){const{firstDevice:t,secondDevice:r,completed:s}=e;return n.jsx("div",{className:"w-full flex flex-col justify-center items-center font-medium text-text-muted",children:t?n.jsxs(n.Fragment,{children:[n.jsx($6,{device:t}),r?n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"w-1 h-24 border-l border-dashed border-border-interactive"}),n.jsx($6,{device:r}),s&&n.jsx("div",{className:"bg-green-400 rounded-full"})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"mt-16 mb-6",children:n.jsx(H6,{})}),n.jsx("span",{className:"text-text-muted",children:"Waiting for your second device"})]})]}):n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"my-8",children:n.jsx(H6,{})}),n.jsx("span",{className:"text-text-muted",children:"Waiting for your first device"})]})})}function $6(e){const{device:t}=e;return n.jsxs("div",{className:"flex justify-between p-6 border rounded-lg shadow-soft bg-gray-100 dark:bg-gray-900 py-3",style:{width:"20rem"},children:[n.jsxs("div",{className:"flex min-w-0",children:[n.jsx("div",{children:n.jsx(Fn,{status:t.connectedToControl?"connected":"unknown"})}),n.jsx("div",{className:"ml-2 font-semibold truncate",children:t.name})]}),t.addresses&&n.jsx("div",{className:"ml-1",children:t.addresses[0]})]})}function H6(){return n.jsx("div",{className:"pulse-circle"})}var aA=(e=>(e.Linux="Linux",e.Windows="Windows",e.MacOS="macOS",e.iOS="iPhone & iPad",e.Android="Android",e.Synology="Synology",e))(aA||{});const Yte=e=>{switch(e){case"macOS":return{downloadLink:"https://tailscale.com/download/macos",instructionsLink:"https://tailscale.com/download/mac"};case"iPhone & iPad":return{downloadLink:"https://apps.apple.com/us/app/tailscale/id1470499037?ls=1",instructionsLink:"https://tailscale.com/download/ios"};case"Android":return{downloadLink:"https://play.google.com/store/apps/details?id=com.tailscale.ipn",instructionsLink:"https://tailscale.com/download/android"};case"Windows":return{instructionsLink:"https://tailscale.com/download/windows"};case"Synology":return{instructionsLink:"https://tailscale.com/docs/integrations/synology"};case"Linux":return{instructionsLink:"https://tailscale.com/download/linux"}}},Zte=e=>{switch(e){case"Windows":return"Windows 10";case"macOS":return"macOS 12 Monterey";case"iPhone & iPad":return"iOS 15";case"Android":return"Android 6";case"Synology":return"DiskStation Manager 6";case"Linux":return}},Qte=(e,t=24)=>{switch(e){case"Windows":return n.jsx(ote,{width:t,height:t});case"macOS":return n.jsx(rte,{width:t,height:t});case"iPhone & iPad":return n.jsx(tte,{width:t,height:t});case"Android":return n.jsx(ete,{width:t,height:t});case"Linux":return n.jsx(nte,{width:t,height:t});case"Synology":return n.jsx(ite,{width:t,height:t});default:return e}},Jte=e=>{switch(e){case"Windows":return"our website";case"macOS":return"the Mac App Store";case"iPhone & iPad":return"the App Store";case"Android":return"the Google Play Store";case"Synology":return"Synology Package Center";case"Linux":return"";default:return e}};function Yc(e){const{onDownloadDevice:t,secondDevice:r,user:s,onMachinesPage:a}=e,[i,l]=f.useState(ene()),[u,d]=f.useState(""),[m,p]=f.useState(null),[g,v]=f.useState(""),y=f.useMemo(()=>i==="Linux"?"command":"link",[i]),C=f.useCallback(()=>{if(u.trim()){p(null);const k=`https://login.tailscale.com/a/${u.trim()}`;globalThis.location.href=k}else p("Please enter a valid code.")},[u]),b=f.useMemo(()=>{const k=[{id:"copyLink",label:`Copy ${y}`,content:n.jsx(z6,{platform:i,onDownloadDevice:t,secondDevice:r,user:s,onMachinesPage:a}),icon:n.jsx(cu,{})},{id:"readGuide",label:"Read guide",content:n.jsx(Xte,{platform:i}),icon:n.jsx($f,{})}];return!qs(s.domainName)&&r&&k.unshift({id:"emailLink",label:"Email link",content:n.jsx("div",{className:"mt-2",children:n.jsx(iA,{tailnetDomain:s.domainName,isSharedTailnet:s.sharedDomain,onMachinesPage:a})}),icon:n.jsx(uu,{})}),i==="Android"&&k.push({id:"inputCode",label:"Input code",content:n.jsx(Br,{label:"Input the code on your screen",className:"mt-2 w-full",error:m,children:n.jsxs("div",{className:"flex items-center gap-2 w-full mt-2",children:[n.jsx(ln,{type:"text",value:u,onChange:E=>d(E.target.value),placeholder:"E.g. t41lsc4l3",className:"flex-grow code-input","aria-label":"Enter code"}),n.jsx(ue,{onClick:C,intent:"primary",children:"Submit"})]})}),icon:n.jsx(qx,{})}),k},[s,y,i,t,r,a,u,m,C]),[w,N]=f.useState(!1);return f.useEffect(()=>{!w&&!g&&b.length>0&&(a&&O(R.AddClientDeviceDialogEmailTabViewed,{eventProperties:{productArea:K.Machines}}),v(b[0].id),N(!0))},[w,g,b,i,a]),n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"grid grid-cols-3 mb-6",children:Object.values(aA).map(k=>n.jsxs("button",{className:D("flex flex-wrap items-center border rounded font-semibold px-2 py-1 mr-2 mt-2",{"border-blue-400 dark:border-blue-500 text-text-primary":i===k,"border-border-interactive hover:border-border-interactive-hover":i!==k}),onClick:()=>l(k),children:[n.jsx("div",{className:"mr-1",children:Qte(k,24)}),k]},k))}),a?n.jsx(Tu,{tabs:b,value:g,onChange:k=>{switch(k){case"emailLink":{O(R.AddClientDeviceDialogEmailTabViewed,{eventProperties:{productArea:K.Machines}});break}case"copyLink":{O(R.AddClientDeviceDialogCopyTabViewed,{eventProperties:{productArea:K.Machines}});break}case"readGuide":{O(R.AddClientDeviceDialogGuideTabViewed,{eventProperties:{productArea:K.Machines}});break}}v(k)}}):n.jsx(z6,{platform:i,onDownloadDevice:t,secondDevice:r,user:s,onMachinesPage:a})]})}function z6(e){const{platform:t,onDownloadDevice:r,secondDevice:s,user:a,onMachinesPage:i}=e,l=et(),{downloadLink:u,instructionsLink:d}=Yte(t),m=u||d,p=Zte(t),g=Jte(t),v=t==="Android"||t==="iPhone & iPad",{data:y}=vt(),C=()=>{navigator.share!==void 0&&(i&&O(R.AddClientDeviceDialogShareButtonClicked,{eventProperties:{productArea:K.Machines}}),navigator.share({url:m}))};switch(t){case"Windows":case"macOS":case"iPhone & iPad":case"Android":case"Synology":return n.jsxs("div",{children:[!i&&n.jsxs("p",{children:[v&&s?"Scan the QR code, copy the download link, or read our ":`Download Tailscale from ${g}, send yourself an email with a download link, or read our `,n.jsx("a",{className:"link whitespace-nowrap",href:d,target:"_blank",rel:"noopener noreferrer",children:"installation guide"}),"."]}),r?n.jsx("p",{className:"mt-6",children:n.jsx("a",{href:m,target:"_blank",rel:"noopener noreferrer",children:n.jsxs(ue,{children:["Download Tailscale for ",t]})})}):n.jsxs("div",{className:"mt-6",children:[v&&n.jsx("div",{className:"flex justify-start items-center mb-6",children:n.jsxs("div",{className:"shrink-0",children:[t==="Android"&&n.jsx("img",{src:ste,className:"image-pixelated",alt:"",width:140,height:140}),t==="iPhone & iPad"&&n.jsx("img",{src:ate,className:"image-pixelated",alt:"",width:140,height:140})]})}),n.jsxs("div",{className:"w-full flex justify-center",children:[n.jsx(Xo,{text:m,buttonLabel:"Copy",onCopySuccess:()=>{i&&O(R.AddClientDeviceDialogCopyLinkButtonClicked,{eventProperties:{productArea:K.Machines}}),l.show({message:"Copied link to clipboard"})}}),navigator.share!==void 0&&n.jsx("button",{className:"flex-1 flex items-center input-wrapper link ml-2 px-2",onClick:C,children:n.jsx(JO,{size:16})})]})]}),p&&n.jsxs("p",{className:"text-text-muted mt-2",children:["Requires ",p," or later."]}),!v&&s&&y.featureOnboardingInvites&&!qs(a.domainName)&&!a.sharedDomain&&!i&&n.jsxs("div",{className:"mt-6",children:[n.jsx("h3",{className:Et.fieldLabel,children:"Send link via email"}),n.jsx(iA,{tailnetDomain:a.domainName,isSharedTailnet:a.sharedDomain})]})]});case"Linux":return n.jsxs(n.Fragment,{children:[!i&&n.jsxs("p",{children:["Use our install script, or read our"," ",n.jsx("a",{className:"link",href:d,target:"_blank",rel:"noopener noreferrer",children:"installation guide"}),"."]}),n.jsx(xn,{className:"mt-4 w-full",text:"curl -fsSL https://tailscale.com/install.sh | sh",variant:"dark"})]})}}function Xte(e){const{platform:t}=e;switch(t){case"Android":return n.jsxs("ol",{className:"list-decimal pl-6 flex flex-col gap-2",children:[n.jsx("li",{children:"Download and install the Tailscale app from the Play Store"}),n.jsx("li",{children:"Accept the prompts to install a VPN configuration"}),n.jsx("li",{children:"Sign in with your identity provider"})]});case"Linux":return n.jsxs(n.Fragment,{children:[n.jsx("p",{children:"Tailscale can be installed on a Linux machine with the single provided command:"}),n.jsx(xn,{className:"mt-4 w-full",text:"curl -fsSL https://tailscale.com/install.sh | sh",variant:"dark"})]});case"macOS":return n.jsxs("ol",{className:"list-decimal pl-6 flex flex-col gap-2",children:[n.jsxs("li",{children:["Download and install the Tailscale client using one of the following options:",n.jsxs("ul",{className:"list-disc pl-6 flex flex-col gap-2 mt-2",children:[n.jsxs("li",{children:[n.jsx("a",{href:"https://pkgs.tailscale.com/stable/#macos",className:"underline",children:"Standalone variant"})," ","from the Tailscale package server (recommended)."]}),n.jsxs("li",{children:[n.jsx("a",{href:"https://apps.apple.com/ca/app/tailscale/id1475387142",className:"underline",children:"Mac App Store"})," ","variant. The Tailscale client is free to download, but downloading any app from the Mac App Store may require an Apple ID with a valid credit card attached."]})]})]}),n.jsx("li",{children:"Follow the Tailscale onboarding flow, which will guide you to install the Tailscale VPN configuration."}),n.jsx("li",{children:"Sign in with your identity provider."})]});case"Synology":return n.jsxs("div",{children:[n.jsx("p",{children:"There are 2 ways to install Tailscale on Synology devices:"}),n.jsxs("ul",{className:"list-disc pl-6 flex flex-col gap-2 mt-2",children:[n.jsxs("li",{children:[n.jsx("a",{href:"https://tailscale.com/docs/integrations/synology#install-tailscale-on-dsm-manually",className:"underline",children:"Install Tailscale on DSM manually"})," ","(recommended)"]}),n.jsx("li",{children:n.jsx("a",{href:"https://tailscale.com/docs/integrations/synology#install-using-synology-package-center",className:"underline",children:"Install using Synology Package Center"})})]})]});case"Windows":return n.jsxs("ol",{className:"list-decimal pl-6 flex flex-col gap-2",children:[n.jsx("li",{children:"Download and run the Windows installer."}),n.jsxs("li",{children:["Select ",n.jsx("strong",{children:"Log in"})," from the Tailscale icon now in your system tray and authenticate in your browser."]}),n.jsx("li",{children:"Sign in with your identity provider."})]});case"iPhone & iPad":return n.jsxs("ol",{className:"list-decimal pl-6 flex flex-col gap-2",children:[n.jsx("li",{children:"Download and open the Tailscale iOS app."}),n.jsx("li",{children:"Accept the prompts to install a VPN configuration and allow push notifications."}),n.jsx("li",{children:"Sign in with your identity provider."})]})}}function iA(e){const{tailnetDomain:t,isSharedTailnet:r,onMachinesPage:s}=e,[a,i]=f.useState(r?t:""),[l,u]=f.useState(!1),{sendOnboardingInvite:d,posting:m}=uB();function p(g){Cl(g)?(u(!1),d(g).then(()=>i(""))):u(!0)}return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex gap-2 mt-2",children:[n.jsx(ln,{placeholder:"user@example.com",className:"w-full",value:a,onChange:g=>{i(g.target.value),u(!1)},disabled:r}),n.jsx(ue,{onClick:()=>{s&&O(R.AddClientDeviceDialogSendEmailButtonClicked,{eventProperties:{productArea:K.Machines}}),p(a)},disabled:m||!a||l,intent:"primary",children:"Send"})]}),n.jsxs("p",{className:"mt-2 text-gray-500",children:[!r&&`This email must belong to ${t}. `,"We’ll only use it to send you the install link and nothing else."]})]})}function ene(){const e=navigator.appVersion.toLowerCase(),t=navigator.platform.toLowerCase(),r=navigator.userAgent.toLowerCase();return/ipad|iphone|ipod/i.test(t)?"iPhone & iPad":e.includes("mac")?"macOS":e.includes("win")?"Windows":r.includes("android")?"Android":"Linux"}const W6=new Set(["windows","linux","macOS","iOS","android"]),tne=new Set(["windows","linux","macOS"]);function nne(e){const{firstDevice:t,secondDevice:r,ownerLoginName:s,onNextStepClick:a}=e,i=et();let l,u;if(t&&r){const w=[t,r];l=K6(w,s),u=K6(w,s,l?.id)}const[d,m]=f.useState({from:l,to:u}),p=()=>{d.from===t?m({from:r,to:t}):m({from:t,to:r})},g=()=>i.show({message:"Copied command to clipboard"}),v=n.jsx("div",{children:n.jsx(ue,{onClick:a,children:"Got it"})});if(!d.from||!d.to)return v;const y=d.from.os,C=oA(d.to);if(!W6.has(y)&&!W6.has(d.to.os))return v;const b=n.jsxs("div",{className:"flex items-center mt-8",children:[n.jsx(ue,{onClick:a,children:"Success, it works!"}),n.jsx("a",{className:"link font-medium ml-6",href:"https://tailscale.com/kb/1023/troubleshooting/",target:"_blank",rel:"noopener noreferrer",children:"Troubleshooting"})]});switch(y){case"windows":return n.jsxs(n.Fragment,{children:[n.jsxs("p",{className:"mb-4",children:["Try it out! Send a ping between your devices. From Command Prompt on"," ",n.jsx("strong",{children:d.from.name}),", run this command to ping"," ",n.jsx("strong",{children:d.to.name})," ",C&&n.jsx("button",{className:"link",onClick:p,children:"(swap)"})]}),n.jsx(Xo,{className:"font-mono text-code",text:`ping ${d.to.addresses[0]}`,buttonLabel:"Copy command",onCopySuccess:g}),n.jsxs("div",{className:"flex text-text-muted mt-2",children:[n.jsx(bs,{size:14,className:"inline-block text-text-muted mr-2 mt-1 -top-px relative"}),`If it works, you’ll see “Reply from ${d.to.addresses[0]}”`]}),b]});case"linux":case"macOS":return n.jsxs(n.Fragment,{children:[n.jsxs("p",{className:"mb-4",children:["Try it out! Send a ping between your devices. From a terminal on"," ",n.jsx("strong",{children:d.from.name}),", run this command to ping"," ",n.jsx("strong",{children:d.to.name})," ",C&&n.jsx("button",{className:"link",onClick:p,children:"(swap)"})]}),n.jsx(Xo,{className:"font-mono text-code",text:`ping ${d.to.addresses[0]} ${y==="linux"?"-c":"-t"} 4`,buttonLabel:"Copy command",onCopySuccess:g}),n.jsxs("div",{className:"flex text-text-muted mt-2",children:[n.jsx(bs,{size:14,className:"inline-block text-text-muted mr-2 mt-1 -top-px relative"}),`If it works, you’ll see “ bytes from ${d.to.addresses[0]}”`]}),b]});default:return v}}function K6(e,t,r){const s=e.filter(l=>l&&l.id!==r),a=s.filter(l=>l.user===t);if(a.length===0)return s[0];const i=a.find(l=>oA(l));return i||a[0]}function oA(e){return tne.has(e.os)&&e.connectedToControl===!0}function mm(e){const{title:t,description:r,link:s}=e;return n.jsxs("a",{href:s,className:"link mb-4 flex",target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:"mr-2 relative top-1",children:n.jsx(uO,{size:18})}),n.jsxs("div",{children:[n.jsx("div",{className:"font-medium",children:t}),n.jsx("div",{className:"text-text-muted mt-1",children:r})]})]})}const rne={title:"Set up DNS",description:"Tailscale gives devices 100.x.y.z IP addresses, but you can also set up DNS to more easily connect to your devices.",link:"/admin/dns"},sne={title:"Set up access controls",description:"By default, every device can talk to every device. You can define rules to limit which devices can talk to each other.",link:"/admin/acls"},ane={title:"Invite your team",description:"Tailscale is better with your team. Invite them to your network to share devices.",link:"/admin/users"},ine={title:"Share a node",description:"Sharing lets you give a Tailscale user on another network access to a device within your network, without exposing it publicly.",link:"https://tailscale.com/kb/1084/sharing"},one=Object.freeze(Object.defineProperty({__proto__:null,PlatformDownloadChooser:Yc,default:Wte},Symbol.toStringTag,{value:"Module"})),lne=ce.lazy(()=>$e(()=>import("./onboarding-v2-card-DsYPzP19.js"),[]));function cne(e){const{variant:t,deviceCount:r,user:s}=e,[,a]=ft(),i=ss(!1),l=t==="variant1"?()=>a("/admin/welcome/finish-setup"):()=>i.setTrue(),u=()=>a("/admin/machines/new-linux");return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"mt-6",children:n.jsx(ce.Suspense,{fallback:null,children:n.jsx(lne,{variant:t,deviceCount:r,onAddDevice:l,onAddLinuxServer:u})})}),t==="variant2"&&n.jsx(Re,{open:i.value,onOpenChange:i.toggle,title:"Add device",size:"large",children:n.jsxs("div",{className:"pb-2",children:[n.jsxs("p",{children:["To add a new device to your tailnet, install Tailscale on that device and log in as ",n.jsx("strong",{children:s.loginName}),"."]}),n.jsx("div",{className:"mt-4",children:n.jsx(Yc,{onDownloadDevice:!1,secondDevice:!0,user:s,onMachinesPage:!0})})]})})]})}function une({addresses:e,shortDomain:t,fullDomain:r,displayType:s="v4"}){const[a,i]=f.useMemo(()=>[e.filter(Hm),e.filter(r2)],[e]),l=n.jsxs("ul",{className:"flex flex-col divide-y",children:[t&&n.jsx(fm,{label:"short domain",value:t}),r&&n.jsx(fm,{label:"full domain",value:r}),i.map(d=>n.jsx(fm,{label:"IPv6 address",ip:!0,value:d},d)),a.map(d=>n.jsx(fm,{label:"IPv4 address",ip:!0,value:d},d))]});let u;return s==="hostname"&&t?u=n.jsx(G6,{domain:t}):s==="fqdn"&&r?u=n.jsx(G6,{domain:r}):s==="v4"&&a.length>0?u=n.jsx(vi,{ip:a[0]}):u=n.jsx(vi,{ip:i[0]}),n.jsxs(C2,{onOpenChange:d=>{d&&O(R.MachineAddressesDropdownOpened,{eventProperties:{productArea:K.Machines}})},children:[n.jsx(nj,{asChild:!0,children:n.jsx(ue,{variant:"minimal",className:"!p-0 !gap-1 !h-auto !leading-normal !font-normal !border-0 max-w-[85%] hover:!bg-transparent",suffixIcon:n.jsx(Nn,{}),"aria-label":"See all addresses for this device.",children:u})}),n.jsx(Fa.Consumer,{children:d=>n.jsx(w2,{container:d,children:n.jsx(j2,{className:"shadow-popover origin-radix-popover state-open:animate-scale-in state-closed:animate-scale-out bg-bg-base rounded-md z-50 max-w-sm",sideOffset:10,side:"top",children:l})})})]})}function fm({label:e,value:t,ip:r,disabled:s}){const a=et(),[i,l]=Ai(!1,{timeout:750}),u=f.useCallback(()=>{O(R.NewCopyCardClicked,{eventProperties:{type:e}}),l(!0),Rr(t).then(()=>{a.show({message:`Copied ${e} to clipboard`})}).catch(()=>{a.show({message:`Failed to copy ${e} to clipboard`,variant:"danger"})})},[e,t,a,l]);return n.jsx("li",{className:"flex items-center gap-2 group/address",children:n.jsxs("button",{className:D("relative flex items-center whitespace-nowrap pl-3 pr-10 py-2 w-60 rounded-none tabular-nums","focus:outline-none focus-visible:ring focus-visible:z-10","transition-colors","bg-bg-base group-hover/address:bg-bg-menu-item-hover","group-first/address:rounded-tl-md group-first/address:rounded-tr-md group-last/address:rounded-bl-md group-last/address:rounded-br-md"),onClick:u,disabled:s,"aria-label":`Copy ${t} to your clipboard`,children:[r?n.jsx(vi,{ip:t}):n.jsx("div",{className:"truncate m-w-full",children:t}),n.jsx("span",{className:D("absolute right-0 pl-6 pr-3 transition-colors","bg-gradient-to-r from-transparent via-[var(--address-row-bg)] to-[var(--address-row-bg)]"),children:i?n.jsx(nn,{size:16}):n.jsx(Lc,{size:16})})]})})}function G6({domain:e}){return n.jsx("span",{className:"inline-flex justify-start min-w-0 max-w-full",children:n.jsx("span",{className:"truncate",children:e})})}function lA(e){const{all:t,filtered:r,typeName:s,headers:a,json:i,description:l,buttonLabel:u,onExportDialogOpen:d,onExportComplete:m}=e,{data:p}=ot(),g=ss(!1),[v,y]=f.useState("filtered"),C=`${p?.domainName}-${yt(s)}`,b=f.useMemo(()=>r?.length?`Export data for ${r?.length} ${yt(s,r.length)} matching search`:"",[r,s]),w=f.useMemo(()=>`Export data for all ${yt(s)}`,[s]),N=f.useCallback(E=>{if(a===void 0)return JSON.stringify(E);const T=E.map(I=>a.map(F=>I[F.name]?`"${I[F.name]}"`:"").join(","));return[a.map(I=>`"${I.label}"`).join(","),...T].join(` `)},[a]),k=()=>{const E=new Date().toISOString().replaceAll(/[.:]/gi,"-"),T=`${C}-${E}.${i?"json":"csv"}`;let _;if(i){const I=new TextEncoder().encode(JSON.stringify({[s]:t}));_=new Blob([I],{type:"application/json"})}else{const I=v==="filtered"&&r?.length?N(r):N(t),F=new TextEncoder().encode(I);_=new Blob([F],{type:"text/csv"})}dne(_,T),m?.(),g.setFalse()};return n.jsxs("div",{className:"self-start hidden @md:block",children:[n.jsx(ue,{onClick:()=>{d?.(),g.setTrue()},iconOnly:!u,"aria-label":`Export ${yt(s)} data`,title:`Export ${yt(s)} data`,children:u||n.jsx(rO,{size:20})}),n.jsxs(Re,{open:g.value,title:`Export ${s} data to ${i?"JSON":"CSV"}`,onOpenChange:()=>{g.toggle(),y("filtered")},children:[n.jsx("p",{className:"mb-4",children:l||"Export a snapshot of the current state of your tailnet. This does not include historical data."}),r?.length&&t.length>r.length?n.jsxs(Pe,{asChild:!0,trigger:n.jsx(ue,{className:"flex items-center justify-center",suffixIcon:n.jsx(Nn,{}),children:v==="filtered"?b:w}),side:"bottom",align:"start",children:[n.jsx(Pe.Item,{onSelect:()=>y("all"),children:w}),n.jsx(Pe.Item,{onSelect:()=>y("filtered"),children:b})]}):null,n.jsx(ue,{className:"mt-4",onClick:()=>k(),children:"Download"})]})]})}const dne=(e,t)=>{const r=globalThis.URL.createObjectURL(e),s=document.createElement("a");s.setAttribute("name",t),s.setAttribute("href",r),s.setAttribute("download",t),document.body.append(s),s.click(),s.remove(),globalThis.URL.revokeObjectURL(r)},mne="data:image/svg+xml,%3csvg%20width='317'%20height='190'%20viewBox='0%200%20317%20190'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_61_1090)'%3e%3cpath%20d='M253.558%20190.158C218.512%20190.158%20190.116%20161.761%20190.116%20126.716L253.558%20126.716L253.558%20190.158Z'%20fill='%233F5DB3'/%3e%3cpath%20d='M317%20126.716C317%20161.761%20288.603%20190.158%20253.558%20190.158L253.558%20126.716L317%20126.716Z'%20fill='%23C2DAFF'/%3e%3cpath%20d='M317%2063.2737C317%2098.3191%20288.603%20126.716%20253.558%20126.716L253.558%2063.2737L317%2063.2737Z'%20fill='%233F5DB3'/%3e%3cpath%20d='M63.2314%20126.716C63.2314%2091.6706%2091.6281%2063.274%20126.674%2063.274L126.674%20126.716L63.2314%20126.716Z'%20fill='%2385AAF5'/%3e%3cpath%20d='M190.116%20126.716C190.116%20161.761%20161.719%20190.158%20126.674%20190.158L126.674%20126.716L190.116%20126.716Z'%20fill='%2385AAF5'/%3e%3cpath%20d='M317%20-0.168274C317%2034.8771%20288.603%2063.2738%20253.558%2063.2738L253.558%20-0.168273L317%20-0.168274Z'%20fill='%2385AAF5'/%3e%3cpath%20d='M317%20126.716C317%20161.761%20288.603%20190.158%20253.558%20190.158L253.558%20126.716L317%20126.716Z'%20fill='%2385AAF5'/%3e%3crect%20x='190.116'%20y='63.2737'%20width='63.4421'%20height='63.4421'%20rx='31.7211'%20fill='%2385AAF5'/%3e%3crect%20x='190.116'%20y='-0.168274'%20width='63.4421'%20height='63.4421'%20rx='31.7211'%20fill='%233F5DB3'/%3e%3crect%20x='63.2314'%20y='126.716'%20width='63.4421'%20height='63.4421'%20rx='31.7211'%20fill='%233F5DB3'/%3e%3crect%20x='-0.210449'%20y='126.716'%20width='63.4421'%20height='63.4421'%20rx='31.7211'%20fill='%2385AAF5'/%3e%3crect%20x='126.674'%20y='63.2737'%20width='63.4421'%20height='63.4421'%20rx='31.7211'%20fill='%233F5DB3'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_61_1090'%3e%3crect%20width='317'%20height='190'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",fne="data:image/svg+xml,%3csvg%20width='317'%20height='190'%20viewBox='0%200%20317%20190'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_41_1018)'%3e%3cpath%20d='M253.558%20190.158C218.512%20190.158%20190.116%20161.761%20190.116%20126.716L253.558%20126.716L253.558%20190.158Z'%20fill='%23C2DAFF'/%3e%3cpath%20d='M317%20126.716C317%20161.761%20288.603%20190.158%20253.558%20190.158L253.558%20126.716L317%20126.716Z'%20fill='%23C2DAFF'/%3e%3cpath%20d='M317%2063.2737C317%2098.3191%20288.603%20126.716%20253.558%20126.716L253.558%2063.2737L317%2063.2737Z'%20fill='%23C2DAFF'/%3e%3cpath%20d='M63.2314%20126.716C63.2314%2091.6706%2091.6281%2063.274%20126.674%2063.274L126.674%20126.716L63.2314%20126.716Z'%20fill='%23253570'/%3e%3cpath%20d='M190.116%20126.716C190.116%20161.761%20161.719%20190.158%20126.674%20190.158L126.674%20126.716L190.116%20126.716Z'%20fill='%23253570'/%3e%3cpath%20d='M317%20-0.168274C317%2034.8771%20288.603%2063.2738%20253.558%2063.2738L253.558%20-0.168273L317%20-0.168274Z'%20fill='%23253570'/%3e%3cpath%20d='M317%20126.716C317%20161.761%20288.603%20190.158%20253.558%20190.158L253.558%20126.716L317%20126.716Z'%20fill='%23253570'/%3e%3crect%20x='190.116'%20y='63.2737'%20width='63.4421'%20height='63.4421'%20rx='31.7211'%20fill='%23253570'/%3e%3crect%20x='190.116'%20y='-0.168274'%20width='63.4421'%20height='63.4421'%20rx='31.7211'%20fill='%23C2DAFF'/%3e%3crect%20x='63.2314'%20y='126.716'%20width='63.4421'%20height='63.4421'%20rx='31.7211'%20fill='%23C2DAFF'/%3e%3crect%20x='-0.210449'%20y='126.716'%20width='63.4421'%20height='63.4421'%20rx='31.7211'%20fill='%23253570'/%3e%3crect%20x='126.674'%20y='63.2737'%20width='63.4421'%20height='63.4421'%20rx='31.7211'%20fill='%23C2DAFF'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_41_1018'%3e%3crect%20width='317'%20height='190'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";function hne(){f.useEffect(()=>{O(R.MachinesEmptyStateViewed,{eventProperties:{productArea:K.Machines,productSubArea:oe.EmptyState}})},[]);const[e,t]=ph(!0,"tailscale/machines-empty-state-open");return n.jsxs(at,{className:D("relative bg-blue-0 dark:bg-blue-900 border-none",{"h-12":!e}),noPadding:!0,children:[n.jsx(ue,{onClick:()=>{t(!e)},"aria-label":e?"Minimize":"Expand",className:"absolute right-2 z-30 py-2 top-2",variant:"minimal",iconOnly:!0,children:e?n.jsx(Yx,{}):n.jsx(Qx,{})}),n.jsxs("div",{className:D("grid grid-cols-1 @md:grid-cols-2",{"h-auto":e,"h-12":!e}),children:[n.jsxs("section",{className:D("flex flex-col justify-center gap-4",{"p-9":e,"pl-6":!e}),children:[n.jsx("h4",{className:D("font-semibold",{"text-lg":e,"text-md":!e}),children:"Add your first device"}),e&&n.jsxs(n.Fragment,{children:[n.jsx("p",{className:"text-pretty",children:"The magic of Tailscale happens when it’s installed on multiple devices."}),n.jsx("div",{className:"flex gap-4",children:n.jsx($A,{fromEmptyState:!0})})]})]}),n.jsxs("section",{className:D("hidden @md:block rounded-tr-md rounded-br-md overflow-clip",{"h-12":!e,"h-full":e}),children:[n.jsx("img",{src:fne,alt:"","aria-hidden":"true",className:D("h-87 ml-auto pt-8 pr-0.5 dark:hidden",{hidden:!e})}),n.jsx("img",{src:mne,alt:"","aria-hidden":"true",className:D("h-87 ml-auto pt-8 pr-0.5",{"hidden dark:block":e,hidden:!e})})]})]})]})}function cA({data:e,query:t="",simpleFilters:r,paramFilters:s}){const[a,i]=pne(t,r,s);return{results:e.filter(i),queryWithoutFilters:a}}function pne(e,t,r){const s=e.split(" "),a=[],i=[];for(const u of s){const d=u.toLowerCase();if(!d.includes(":")){a.push(u);continue}const m=d.split(":")[0],p=t[d];if(typeof p=="function"){i.push(p);continue}const g=r[m];if(typeof g=="function"){const v=uA(d,m);if(!v.result)continue;i.push(y=>g(y,v.args));continue}a.push(u)}const l=u=>i.every(d=>d(u));return[a.join(" "),l]}function uA(e,t){const r=e.split(":");if(r.length<2)return{result:!1};const[s,...a]=r;if(s!==t)return{result:!1};const i=a.join(":").split(",");return i.length===0?{result:!1}:{result:!0,args:i}}function dA(e,t){return e.split(" ").filter(r=>r.startsWith(`${t}:`)).flatMap(r=>{const s=uA(r,t);return s.result?s.args:[]})}function mA(e,t,r){const s=e===""?[]:e.split(" ").filter(a=>!a.startsWith(`${t}:`));if(r.length>0){const a=`${t}:${r.join(",")}`;s.push(a)}return s.join(" ")}function Ha(e){return Array.isArray?Array.isArray(e):hA(e)==="[object Array]"}function gne(e){if(typeof e=="string")return e;if(typeof e=="bigint")return e.toString();const t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function ax(e){return e==null?"":gne(e)}function Wn(e){return typeof e=="string"}function Im(e){return typeof e=="number"}function xne(e){return e===!0||e===!1||vne(e)&&hA(e)=="[object Boolean]"}function fA(e){return typeof e=="object"}function vne(e){return fA(e)&&e!==null}function ar(e){return e!=null}function hm(e){return!e.trim().length}function hA(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const yne="Incorrect 'index' type",bne=e=>`Invalid value for key ${e}`,Cne=e=>`Pattern length exceeds max of ${e}.`,wne=e=>`Missing ${e} property in key`,jne=e=>`Property 'weight' in key '${e}' must be a positive integer`,q6=Object.prototype.hasOwnProperty;class Sne{constructor(t){this._keys=[],this._keyMap={};let r=0;t.forEach(s=>{const a=pA(s);this._keys.push(a),this._keyMap[a.id]=a,r+=a.weight}),this._keys.forEach(s=>{s.weight/=r})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function pA(e){let t=null,r=null,s=null,a=1,i=null;if(Wn(e)||Ha(e))s=e,t=Y6(e),r=ix(e);else{if(!q6.call(e,"name"))throw new Error(wne("name"));const l=e.name;if(s=l,q6.call(e,"weight")&&(a=e.weight,a<=0))throw new Error(jne(l));t=Y6(l),r=ix(l),i=e.getFn}return{path:t,id:r,weight:a,src:s,getFn:i}}function Y6(e){return Ha(e)?e:e.split(".")}function ix(e){return Ha(e)?e.join("."):e}function kne(e,t){const r=[];let s=!1;const a=(i,l,u,d)=>{if(ar(i))if(!l[u])r.push(d!==void 0?{v:i,i:d}:i);else{const m=l[u],p=i[m];if(!ar(p))return;if(u===l.length-1&&(Wn(p)||Im(p)||xne(p)||typeof p=="bigint"))r.push(d!==void 0?{v:ax(p),i:d}:ax(p));else if(Ha(p)){s=!0;for(let g=0,v=p.length;ge.score===t.score?e.idx{this._keysMap[r.id]=s})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Wn(this.docs[0])?this.docs.forEach((t,r)=>{this._addString(t,r)}):this.docs.forEach((t,r)=>{this._addObject(t,r)}),this.norm.clear())}add(t){const r=this.size();Wn(t)?this._addString(t,r):this._addObject(t,r)}removeAt(t){this.records.splice(t,1);for(let r=t,s=this.size();r=0;r-=1)this.records.splice(t[r],1);for(let r=0,s=this.records.length;r{const l=a.getFn?a.getFn(t):this.getFn(t,a.path);if(ar(l)){if(Ha(l)){const u=[];for(let d=0,m=l.length;dr),records:this.records}}}function gA(e,t,{getFn:r=Xe.getFn,fieldNormWeight:s=Xe.fieldNormWeight}={}){const a=new ny({getFn:r,fieldNormWeight:s});return a.setKeys(e.map(pA)),a.setSources(t),a.create(),a}function Dne(e,{getFn:t=Xe.getFn,fieldNormWeight:r=Xe.fieldNormWeight}={}){const{keys:s,records:a}=e,i=new ny({getFn:t,fieldNormWeight:r});return i.setKeys(s),i.setIndexRecords(a),i}function _ne(e=[],t=Xe.minMatchCharLength){const r=[];let s=-1,a=-1,i=0;for(let l=e.length;i=t&&r.push([s,a]),s=-1)}return e[i-1]&&i-s>=t&&r.push([s,i-1]),r}const fi=32;function Mne(e,t,r,{location:s=Xe.location,distance:a=Xe.distance,threshold:i=Xe.threshold,findAllMatches:l=Xe.findAllMatches,minMatchCharLength:u=Xe.minMatchCharLength,includeMatches:d=Xe.includeMatches,ignoreLocation:m=Xe.ignoreLocation}={}){if(t.length>fi)throw new Error(Cne(fi));const p=t.length,g=e.length,v=Math.max(0,Math.min(s,g));let y=i,C=v;const b=(z,H)=>{const J=z/p;if(m)return J;const Y=Math.abs(v-H);return a?J+Y/a:Y?1:J},w=u>1||d,N=w?Array(g):[];let k;for(;(k=e.indexOf(t,C))>-1;){const z=b(0,k);if(y=Math.min(z,y),C=k+p,w){let H=0;for(;H=Y;Z-=1){const re=Z-1,me=r[e[re]];if(w&&(N[re]=+!!me),W[Z]=(W[Z+1]<<1|1)&me,z&&(W[Z]|=(E[Z+1]|E[Z])<<1|1|E[Z+1]),W[Z]&I&&(T=b(z,re),T<=y)){if(y=T,C=re,C<=v)break;Y=Math.max(1,2*v-C)}}if(b(z+1,v)>y)break;E=W}const F={isMatch:C>=0,score:Math.max(.001,T)};if(w){const z=_ne(N,u);z.length?d&&(F.indices=z):F.isMatch=!1}return F}function Lne(e){const t={};for(let r=0,s=e.length;rr[0]-s[0]||r[1]-s[1]);const t=[e[0]];for(let r=1,s=e.length;re.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(Rne,t=>xA[t]):e=>e;class sy{constructor(t,{location:r=Xe.location,threshold:s=Xe.threshold,distance:a=Xe.distance,includeMatches:i=Xe.includeMatches,findAllMatches:l=Xe.findAllMatches,minMatchCharLength:u=Xe.minMatchCharLength,isCaseSensitive:d=Xe.isCaseSensitive,ignoreDiacritics:m=Xe.ignoreDiacritics,ignoreLocation:p=Xe.ignoreLocation}={}){if(this.options={location:r,threshold:s,distance:a,includeMatches:i,findAllMatches:l,minMatchCharLength:u,isCaseSensitive:d,ignoreDiacritics:m,ignoreLocation:p},t=d?t:t.toLowerCase(),t=m?Zc(t):t,this.pattern=t,this.chunks=[],!this.pattern.length)return;const g=(y,C)=>{this.chunks.push({pattern:y,alphabet:Lne(y),startIndex:C})},v=this.pattern.length;if(v>fi){let y=0;const C=v%fi,b=v-C;for(;y{const{isMatch:k,score:E,indices:T}=Mne(t,b,w,{location:i+N,distance:l,threshold:u,findAllMatches:d,minMatchCharLength:m,includeMatches:a,ignoreLocation:p});k&&(y=!0),v+=E,k&&T&&g.push(...T)});const C={isMatch:y,score:y?v/this.chunks.length:1};return y&&a&&(C.indices=ry(g)),C}}class za{constructor(t){this.pattern=t}static isMultiMatch(t){return Z6(t,this.multiRegex)}static isSingleMatch(t){return Z6(t,this.singleRegex)}search(t){return{isMatch:!1,score:1}}}function Z6(e,t){const r=e.match(t);return r?r[1]:null}class One extends za{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const r=t===this.pattern;return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class Fne extends za{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const s=t.indexOf(this.pattern)===-1;return{isMatch:s,score:s?0:1,indices:[0,t.length-1]}}}class Bne extends za{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const r=t.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,this.pattern.length-1]}}}class Une extends za{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const r=!t.startsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class Vne extends za{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const r=t.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class $ne extends za{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const r=!t.endsWith(this.pattern);return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class vA extends za{constructor(t,{location:r=Xe.location,threshold:s=Xe.threshold,distance:a=Xe.distance,includeMatches:i=Xe.includeMatches,findAllMatches:l=Xe.findAllMatches,minMatchCharLength:u=Xe.minMatchCharLength,isCaseSensitive:d=Xe.isCaseSensitive,ignoreDiacritics:m=Xe.ignoreDiacritics,ignoreLocation:p=Xe.ignoreLocation}={}){super(t),this._bitapSearch=new sy(t,{location:r,threshold:s,distance:a,includeMatches:i,findAllMatches:l,minMatchCharLength:u,isCaseSensitive:d,ignoreDiacritics:m,ignoreLocation:p})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class yA extends za{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let r=0,s;const a=[],i=this.pattern.length;for(;(s=t.indexOf(this.pattern,r))>-1;)r=s+i,a.push([s,r-1]);const l=!!a.length;return{isMatch:l,score:l?0:1,indices:a}}}const ox=[One,yA,Bne,Une,$ne,Vne,Fne,vA],Q6=ox.length,Hne="\0",zne="|";function Wne(e){const t=[],r=e.length;let s=0;for(;s=r)break;let a=s;for(;a=r||e[i]===" "){a++;break}if(e[i]==="$"&&(i+1>=r||e[i+1]===" ")){a+=2;break}}a++}t.push(e.substring(s,a)),s=a}else{for(;a{const a=s.replace(/\u0000/g,"|"),i=Wne(a.trim()).filter(u=>u&&!!u.trim()),l=[];for(let u=0,d=i.length;u!!(e[Sf.AND]||e[Sf.OR]),Yne=e=>!!e[cx.PATH],Zne=e=>!Ha(e)&&fA(e)&&!ux(e),J6=e=>({[Sf.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function bA(e,t,{auto:r=!0}={}){const s=a=>{if(Wn(a)){const d={keyId:null,pattern:a};return r&&(d.searcher=jf(a,t)),d}const i=Object.keys(a),l=Yne(a);if(!l&&i.length>1&&!ux(a))return s(J6(a));if(Zne(a)){const d=l?a[cx.PATH]:i[0],m=l?a[cx.PATTERN]:a[d];if(!Wn(m))throw new Error(bne(d));const p={keyId:ix(d),pattern:m};return r&&(p.searcher=jf(m,t)),p}const u={children:[],operator:i[0]};return i.forEach(d=>{const m=a[d];Ha(m)&&m.forEach(p=>{u.children.push(s(p))})}),u};return ux(e)||(e=J6(e)),s(e)}function dx(e,{ignoreFieldNorm:t=Xe.ignoreFieldNorm}){let r=1;return e.forEach(({key:s,norm:a,score:i})=>{const l=s?s.weight:null;r*=Math.pow(i===0&&l?Number.EPSILON:i,(l||1)*(t?1:a))}),r}function Qne(e,{ignoreFieldNorm:t=Xe.ignoreFieldNorm}){e.forEach(r=>{r.score=dx(r.matches,{ignoreFieldNorm:t})})}class Jne{constructor(t){this.limit=t,this.heap=[]}get size(){return this.heap.length}shouldInsert(t){return this.size0;){const s=t-1>>1;if(r[t].score<=r[s].score)break;const a=r[t];r[t]=r[s],r[s]=a,t=s}}_sinkDown(t){const r=this.heap,s=r.length;let a=t;do{t=a;const i=2*t+1,l=2*t+2;if(ir[a].score&&(a=i),lr[a].score&&(a=l),a!==t){const u=r[t];r[t]=r[a],r[a]=u}}while(a!==t)}}function Xne(e,t){const r=e.matches;t.matches=[],ar(r)&&r.forEach(s=>{if(!ar(s.indices)||!s.indices.length)return;const{indices:a,value:i}=s,l={indices:a,value:i};s.key&&(l.key=s.key.src),s.idx>-1&&(l.refIndex=s.idx),t.matches.push(l)})}function ere(e,t){t.score=e.score}function tre(e,t,{includeMatches:r=Xe.includeMatches,includeScore:s=Xe.includeScore}={}){const a=[];return r&&a.push(Xne),s&&a.push(ere),e.map(i=>{const{idx:l}=i,u={item:t[l],refIndex:l};return a.length&&a.forEach(d=>{d(i,u)}),u})}const nre=/\b\w+\b/g;function mx({isCaseSensitive:e=!1,ignoreDiacritics:t=!1}={}){return{tokenize(r){return e||(r=r.toLowerCase()),t&&(r=Zc(r)),r.match(nre)||[]}}}function rre(e,t,r){const s=new Map,a=new Map;let i=0;function l(u,d,m,p){const g=r.tokenize(u);if(!g.length)return;i++;const v=new Map;for(const y of g)v.set(y,(v.get(y)||0)+1);for(const[y,C]of v){const b={docIdx:d,keyIdx:m,subIdx:p,tf:C};let w=s.get(y);w||(w=[],s.set(y,w)),w.push(b),a.set(y,(a.get(y)||0)+1)}}for(const u of e){const{i:d,v:m,$:p}=u;if(m!==void 0){l(m,d,-1,-1);continue}if(p)for(let g=0;gl.docIdx!==t),i=s.length-a.length;i>0&&(e.fieldCount-=i,e.df.set(r,(e.df.get(r)||0)-i),a.length===0?(e.terms.delete(r),e.df.delete(r)):e.terms.set(r,a))}}class Wa{constructor(t,r,s){this.options={...Xe,...r},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new Sne(this.options.keys),this._docs=t,this._myIndex=null,this._invertedIndex=null,this.setCollection(t,s),this._lastQuery=null,this._lastSearcher=null}_getSearcher(t){if(this._lastQuery===t)return this._lastSearcher;const r=this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options,s=jf(t,r);return this._lastQuery=t,this._lastSearcher=s,s}setCollection(t,r){if(this._docs=t,r&&!(r instanceof ny))throw new Error(yne);if(this._myIndex=r||gA(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const s=mx({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});this._invertedIndex=rre(this._myIndex.records,this._myIndex.keys.length,s)}}add(t){if(ar(t)&&(this._docs.push(t),this._myIndex.add(t),this._invertedIndex)){const r=this._myIndex.records[this._myIndex.records.length-1],s=mx({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});sre(this._invertedIndex,r,this._myIndex.keys.length,s)}}remove(t=()=>!1){const r=[],s=[];for(let a=0,i=this._docs.length;a=0;a-=1)this._docs.splice(s[a],1);this._myIndex.removeAll(s)}return r}removeAt(t){this._invertedIndex&&X6(this._invertedIndex,t);const r=this._docs.splice(t,1)[0];return this._myIndex.removeAt(t),r}getIndex(){return this._myIndex}search(t,r){const{limit:s=-1}=r||{},{includeMatches:a,includeScore:i,shouldSort:l,sortFn:u,ignoreFieldNorm:d}=this.options;if(Wn(t)&&!t.trim()){let g=this._docs.map((v,y)=>({item:v,refIndex:y}));return Im(s)&&s>-1&&(g=g.slice(0,s)),g}const m=Im(s)&&s>0&&Wn(t);let p;if(m){const g=new Jne(s);Wn(this._docs[0])?this._searchStringList(t,{heap:g,ignoreFieldNorm:d}):this._searchObjectList(t,{heap:g,ignoreFieldNorm:d}),p=g.extractSorted(u)}else p=Wn(t)?Wn(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t),Qne(p,{ignoreFieldNorm:d}),l&&p.sort(u),Im(s)&&s>-1&&(p=p.slice(0,s));return tre(p,this._docs,{includeMatches:a,includeScore:i})}_searchStringList(t,{heap:r,ignoreFieldNorm:s}={}){const a=this._getSearcher(t),{records:i}=this._myIndex,l=r?null:[];return i.forEach(({v:u,i:d,n:m})=>{if(!ar(u))return;const{isMatch:p,score:g,indices:v}=a.searchIn(u);if(p){const y={item:u,idx:d,matches:[{score:g,value:u,norm:m,indices:v}]};r?(y.score=dx(y.matches,{ignoreFieldNorm:s}),r.shouldInsert(y.score)&&r.insert(y)):l.push(y)}}),l}_searchLogical(t){const r=bA(t,this.options),s=(u,d,m)=>{if(!("children"in u)){const{keyId:y,searcher:C}=u;let b;return y===null?(b=[],this._myIndex.keys.forEach((w,N)=>{b.push(...this._findMatches({key:w,value:d[N],searcher:C}))})):b=this._findMatches({key:this._keyStore.get(y),value:this._myIndex.getValueForItemAtKeyId(d,y),searcher:C}),b&&b.length?[{idx:m,item:d,matches:b}]:[]}const{children:p,operator:g}=u,v=[];for(let y=0,C=p.length;y{if(ar(u)){const m=s(r,u,d);m.length&&(i.has(d)||(i.set(d,{idx:d,item:u,matches:[]}),l.push(i.get(d))),m.forEach(({matches:p})=>{i.get(d).matches.push(...p)}))}}),l}_searchObjectList(t,{heap:r,ignoreFieldNorm:s}={}){const a=this._getSearcher(t),{keys:i,records:l}=this._myIndex,u=r?null:[];return l.forEach(({$:d,i:m})=>{if(!ar(d))return;const p=[];let g=!1,v=!1;if(i.forEach((y,C)=>{const b=this._findMatches({key:y,value:d[C],searcher:a});b.length?(p.push(...b),b[0].hasInverse&&(v=!0)):g=!0}),!(v&&g)&&p.length){const y={idx:m,item:d,matches:p};r?(y.score=dx(y.matches,{ignoreFieldNorm:s}),r.shouldInsert(y.score)&&r.insert(y)):u.push(y)}}),u}_findMatches({key:t,value:r,searcher:s}){if(!ar(r))return[];const a=[];if(Ha(r))r.forEach(({v:i,i:l,n:u})=>{if(!ar(i))return;const{isMatch:d,score:m,indices:p,hasInverse:g}=s.searchIn(i);d&&a.push({score:m,key:t,value:i,idx:l,norm:u,indices:p,hasInverse:g})});else{const{v:i,n:l}=r,{isMatch:u,score:d,indices:m,hasInverse:p}=s.searchIn(i);u&&a.push({score:d,key:t,value:i,norm:l,indices:m,hasInverse:p})}return a}}class are{static condition(t,r){return r.useTokenSearch}constructor(t,r){this.options=r,this.analyzer=mx({isCaseSensitive:r.isCaseSensitive,ignoreDiacritics:r.ignoreDiacritics});const s=this.analyzer.tokenize(t),a=r._invertedIndex,{df:i,fieldCount:l}=a;this.termSearchers=[],this.idfWeights=[];for(const u of s){this.termSearchers.push(new sy(u,{location:r.location,threshold:r.threshold,distance:r.distance,includeMatches:r.includeMatches,findAllMatches:r.findAllMatches,minMatchCharLength:r.minMatchCharLength,isCaseSensitive:r.isCaseSensitive,ignoreDiacritics:r.ignoreDiacritics,ignoreLocation:!0}));const d=i.get(u)||0,m=Math.log(1+(l-d+.5)/(d+.5));this.idfWeights.push(m)}}searchIn(t){if(!this.termSearchers.length)return{isMatch:!1,score:1};const r=[];let s=0,a=0,i=0;for(let d=0;d0?1-s/a:0,u={isMatch:!0,score:Math.max(.001,l)};return this.options.includeMatches&&r.length&&(u.indices=ry(r)),u}}Wa.version="7.3.0";Wa.createIndex=gA;Wa.parseIndex=Dne;Wa.config=Xe;Wa.match=function(e,t,r){return jf(e,{...Xe,...r}).searchIn(t)};Wa.parseQuery=bA;ay(qne);ay(are);Wa.use=function(...e){e.forEach(t=>ay(t))};function CA({data:e=[],query:t="",options:r}){const s=t.trim();return s===""||s.length<(r.minMatchCharLength||2)?{results:e}:{results:new Wa(e,r).search(s).map(u=>u.item)}}function ire({data:e,query:t="",posturesToBadge:r=[]}){const{results:s,queryWithoutFilters:a}=cA({data:e,query:t,simpleFilters:lre,paramFilters:cre(r)}),{results:i}=CA({data:s,query:a,options:ore}),l=a.trim().toLowerCase();if(l!==""){const u=[],d=[];for(const m of i)m.name.toLowerCase()===l?u.push(m):d.push(m);return{results:[...u,...d]}}return{results:i}}const ore={threshold:0,distance:80,ignoreLocation:!0,minMatchCharLength:1,keys:[{name:"name",weight:.8},{name:"stableId",weight:.8},{name:"hostname",weight:.5},{name:"addresses",weight:.5},{name:"postureIdentity.serialNumbers",weight:.5},{name:"user",weight:.5},{name:"os",weight:.2},{name:"ipnVersion",weight:.1}]},wA="property",jA="lastseen",SA="managedby",kA="shared",NA="disabled",EA="version",AA="os",PA="osversion",TA="postureidentity",IA="auto-update",DA="failingposture",lre={"is:external":e=>e.isExternal===!0,"is:internal":e=>!e.isExternal,"is:expired":e=>{if(e.neverExpires)return!1;const t=new Date;return new Date(e.expires)e.neverExpires===!0,"is:shared":e=>e.acceptedShareCount>0,"is:unauthorized":e=>!e.authorized,"is:exit-node":e=>e.hasExitNode===!0,"has:update-available":e=>e.availableUpdateVersion!==void 0,"has:subnet":e=>e.hasSubnets===!0,"has:subnets":e=>e.hasSubnets===!0,"has:suspended-owner":e=>e.ownerDisabledStatus===en.Suspended,"has:peer-relay":e=>e.peerRelay===!0,"has:tailscale-ssh":e=>e.sshEnabled===!0,"has:tailscale-funnel":e=>e.funnelEnabled===!0,"is:ephemeral":e=>e.isEphemeral===!0,"is:ssh-console":e=>e.adminPanelSSH===!0,"can:ssh":e=>(e.sshUsernames?.length??0)>0||e.otherSSHUsernamesAllowed===!0};function cre(e){return{[SA]:(t,r)=>{const s=r.includes("users"),a=r.includes("tags");if(t.hasTags)return a?!0:t.allowedTags.some(i=>{const l=i.replace(/^tag:/,"");return r.includes(l)});{if(s)return!0;const i=t.user.toLowerCase();return r.some(l=>i.includes(l.toLowerCase()))}},[EA]:(t,r)=>{const s=p2(t.ipnVersion),a=Cf(s);return a?r.some(i=>{if(i==="update-available")return t.availableUpdateVersion!==void 0;if(i==="security-update-available")return t.availableUpdateSecurity;const l=e8(jee,i,a,Cf);return l.fromOp?l.matched:t.ipnVersion.startsWith(i)}):r.includes("unknown")},[AA]:(t,r)=>{const s=t.os.toLowerCase();return r.some(a=>s===a.toLowerCase())},[PA]:(t,r)=>t.osVersion?r.some(s=>e8(kee,s,t.osVersion,void 0,"==").matched):r.includes("unknown"),[DA]:(t,r)=>{const a=r.includes("badged")?r.concat(e.map(i=>i.replace(/^posture:/,"").toLowerCase())):r;return t.failingPostures?.some(i=>{const l=i.replace(/^posture:/,"").toLowerCase();return a.includes(l)})??!1},[jA]:(t,r)=>{if(r.length!==1)return!1;const s=r[0];if(s==="connected")return t.connectedToControl===!0;if(s==="not-connected"||s==="disconnected")return!t.connectedToControl;const a=s.slice(0,1);if(a!=="<"&&a!==">")return!1;if(t.connectedToControl)return a==="<";const i=s.slice(1),l=Number.parseInt(i,10),u=i.slice(-1),d=Yn(),m=new Date(t.lastSeen||"");if(Number.isNaN(l)||!m.getTime())return!1;switch(u){case"m":return a===">"?Fc(d,m)>=l:Fc(d,m)"?Gm(d,m)>=l:Gm(d,m)"?w0(d,m)>=l:w0(d,m)"?Nb(d,m)>=l:Nb(d,m)"?Eb(d,m)>=l:Eb(d,m)r.some(s=>{switch(s){case"expired":{if(t.neverExpires)return!1;const a=new Date;return new Date(t.expires)r.some(s=>{switch(s){case"in":return t.isExternal;case"out":return t.acceptedShareCount>0;case"not-shared":return!t.isExternal&&!t.acceptedShareCount;default:return!1}}),[wA]:(t,r)=>r.some(s=>{switch(s){case"ephemeral-node":return t.isEphemeral;case"exit-node":return t.hasExitNode;case"subnet":return t.hasSubnets;case"peer-relay":return t.peerRelay;case"tailscale-ssh":return t.sshEnabled;case"tailscale-funnel":return t.funnelEnabled;case"expiry-disabled":return t.neverExpires;case"locked-out":return t.tlLockedOut;case"signing-node":return t.tlTrusted;case"connector":return t.appConnector;default:return!1}}),[TA]:(t,r)=>r.some(s=>{switch(s){case"needs-upgrade":return t.postureIdentity?.needsUpgrade===!0;case"not-collected":return t.postureIdentity?.notCollected===!0;case"not-enabled":return t.postureIdentity?.nodeDisabled===!0;case"has-posture-identity":return(t.postureIdentity?.serialNumbers?.length||-1)>0||(t.postureIdentity?.hardwareAddresses?.length||-1)>0;case"empty-posture-identity":return t.postureIdentity&&!t.postureIdentity.notCollected&&!t.postureIdentity.nodeDisabled&&!t.postureIdentity.needsUpgrade&&(t.postureIdentity.serialNumbers?.length||0)===0&&(t.postureIdentity.hardwareAddresses?.length||0)===0;default:return!1}}),[IA]:(t,r)=>r.some(s=>{switch(s){case"enabled":return t.autoUpdatesEnabled;case"disabled":return!t.autoUpdatesEnabled;default:return!1}}),owner:(t,r)=>{const s=t.user.toLowerCase();return r.some(a=>s.includes(a.toLowerCase()))},tag:(t,r)=>t.allowedTags.some(s=>{const a=s.replace(/^tag:/,"");return r.includes(a)})}}function e8(e,t,r,s,a){const{op:i,val:l}=ure(t,a),u=s?s(l):l;if(u===void 0)return{fromOp:!1,matched:!1};const d=e(r,u);switch(i){case"==":return{fromOp:!0,matched:d===0};case"!=":return{fromOp:!0,matched:d!==0};case">=":return{fromOp:!0,matched:d>=0};case"<=":return{fromOp:!0,matched:d<=0};case">":return{fromOp:!0,matched:d>0};case"<":return{fromOp:!0,matched:d<0};default:return{fromOp:!1,matched:!1}}}function ure(e,t){switch(e.charAt(0)){case">":return e.charAt(1)==="="?{op:">=",val:e.slice(2)}:{op:">",val:e.slice(1)};case"<":return e.charAt(1)==="="?{op:"<=",val:e.slice(2)}:{op:"<",val:e.slice(1)};case"=":return e.charAt(1)==="="?{op:"==",val:e.slice(2)}:{op:"==",val:e.slice(1)};case"!":return e.charAt(1)==="="?{op:"!=",val:e.slice(2)}:{op:"!=",val:e.slice(1)};default:return{op:t,val:e}}}function _A({className:e,onClick:t,disabled:r}){return n.jsx("div",{className:D("p-3",e),children:n.jsx(ue,{"aria-live":"polite",className:"w-full",sizeVariant:"small",disabled:r,onClick:t,children:"Apply"})})}function MA({label:e,values:t,selected:r,onUpdateSelected:s,searchClassName:a}){const[i,l]=f.useState(""),[u,d]=f.useState(t),[m,p]=f.useState(!1),{addSelectedItem:g,removeSelectedItem:v,getDropdownProps:y,selectedItems:C}=mi({initialSelectedItems:r||[]}),b=f.useCallback(I=>t.filter(F=>F.label.toLowerCase().includes(I)),[t]),{getMenuProps:w,getInputProps:N,getItemProps:k}=Ln({inputValue:i,items:b(i.toLowerCase())});f.useEffect(()=>{p(!Vm(r||[],C))},[C,r]);const E=I=>{I=I.toLowerCase(),l(I),d(b(I))},T=(I,F)=>{F.key==="Enter"&&(F.metaKey===!0?s(C):_(I))},_=I=>{C.includes(I)?v(I):g(I)};return n.jsxs("div",{className:"rounded-md bg-bg-base max-w-xs",children:[n.jsx("div",{className:"flex items-center border-b",children:n.jsxs("div",{className:"relative w-full p-0.5",children:[n.jsx("input",{type:"text","aria-label":`Search ${e}...`,className:D("pl-10 h-10 w-full bg-bg-base rounded-b-none input border-0",a),placeholder:`Search ${e}...`,...N(y({onChange:I=>E(I.target.value)}))}),n.jsx(Jx,{size:20,className:"inline-block text-text-muted mr-2 absolute left-3 top-3"})]})}),n.jsxs("div",{className:"bg-bg-base overflow-hidden rounded-b-md",children:[n.jsx("ul",{className:D("max-h-[14rem] overflow-y-auto"),tabIndex:-1,...w(),children:u.length===0?n.jsx("p",{className:"text-text-disabled p-3",children:"No results"}):u.map((I,F)=>n.jsx("li",{className:"flex px-3 py-2 hover:bg-bg-menu-item-hover",onClick:z=>{z.target===z.currentTarget&&_(I)},children:n.jsx(yr,{checked:C.includes(I),label:I.label,description:I.description,...k({index:F,item:I,onChange:()=>_(I),onKeyDown:z=>T(I,z)})})},`select-item-${F}`))}),u.length>0&&n.jsx(_A,{className:"border-t",onClick:()=>s(C),disabled:!m})]})]})}function LA({values:e,selected:t,onUpdateSelected:r}){const[s,a]=f.useState(t),[i,l]=f.useState("");return f.useEffect(()=>{a(t),l("")},[t]),n.jsxs("div",{className:"max-w-xs flex flex-col",children:[n.jsx(br,{className:"mt-3 mx-3",values:e,selected:s,onUpdateSelected:u=>{a(u),l("")},placeholder:"Select…"}),s&&(s.type==="text-input"?n.jsx(ln,{name:"text-input",className:"pt-3 px-3 block tabular-nums",type:"text",placeholder:s.placeholder,value:s.value||"",onChange:u=>a({...s,value:u.target.value}),onBlur:u=>l(s.hasValidationError?s.hasValidationError(u.target.value):"")}):s.type==="date-input"?n.jsx(ln,{name:"date-input",className:"pt-3 px-3 block tabular-nums",type:"datetime-local",value:s.value?.toUpperCase()||"",onChange:u=>a({...s,value:u.target.value})}):s.type==="string-constant"?null:s),i&&n.jsx("div",{className:"mt-2 mx-3 text-text-danger",children:i}),n.jsx(_A,{onClick:()=>s?r(s):void 0,disabled:i!==""||!s?.value||s===t})]})}function dre({prefix:e,config:t,className:r,onSelectionChanged:s=()=>{}}){const a=ss(!1),{selected:i,onUpdateSelected:l}=UA(e,t),u=i.length>0,d=m=>{const p=i;l(m),a.setFalse(),s(p,m)};return n.jsxs("div",{className:D(mre,FA,{"border-gray-400 dark:!border-gray-500":u},r),children:[t.type==="single-select"?n.jsx(br,{className:Fg(u),values:t.values,selected:u?i[0]:void 0,onUpdateSelected:m=>d([m]),children:n.jsx("div",{children:n.jsx(Og,{title:t.title,selected:i})})}):t.type==="dropdown-select"?n.jsx(Ni,{open:a.value,onOpenChange:a.set,sideOffset:5,align:"start",className:"py-0",asChild:!0,content:n.jsx(LA,{values:t.values,selected:i.length>0?i[0]:void 0,onUpdateSelected:m=>d([m])}),children:n.jsx("button",{className:Fg(u),children:n.jsx(Og,{title:t.title,selected:i})})}):t.type==="checkbox-select"?n.jsx(Ni,{open:a.value,onOpenChange:a.set,sideOffset:5,align:"start",className:"py-0",asChild:!0,content:n.jsx(MA,{label:t.title,values:t.values,selected:i,onUpdateSelected:d}),children:n.jsx("button",{className:Fg(u),children:n.jsx(Og,{title:t.title,selected:i})})}):t,u&&n.jsx("button",{className:D(OA,RA,pre,"group flex-shrink-0"),"aria-label":"Clear selected values",onClick:()=>d([]),children:n.jsx(Or,{size:18,className:"text-text-muted ml-1.5 mr-2"})})]})}function Og({title:e,selected:t}){const r=f.useMemo(()=>t.length>2?`${t.slice(0,2).map(t8).join(", ")} and ${t.length-2} more`:t.map(t8).join(", "),[t]);return n.jsxs("div",{className:"flex min-w-0 items-center",children:[n.jsx("div",{className:"flex-shrink-0",children:ml(e)}),t.length>0&&n.jsxs("div",{className:"font-medium min-w-0 truncate max-w-[350px]",children:[": ",r]}),n.jsx(Nn,{size:20,className:"text-text-muted ml-1 flex-shrink-0"})]})}const mre="flex border border-border-interactive min-w-0",RA="hover:bg-bg-menu-item-hover",OA="leading-8 flex min-w-0 items-center",fre="pr-2 pl-3",FA="rounded-full",hre="rounded-l-full border-r border-gray-400 dark:border-gray-500",pre="rounded-r-full",BA="!min-w-60",Fg=e=>D(OA,RA,fre,"group",{[FA]:!e,[hre]:e});function gre({filterConfigs:e,openFilters:t,setOpenFilters:r,onOpenChange:s=()=>{},onCategorySelected:a,onFilterAdded:i}){const l=ss(!1),[u,d]=f.useState();return n.jsx(Pe,{asChild:!0,side:"bottom",align:"start",sideOffset:6,open:l.value,onOpenChange:m=>{m&&d(void 0),l.set(m),s(m)},trigger:n.jsx(ue,{className:"flex items-center flex-shrink-0",prefixIcon:n.jsx(mO,{}),suffixIcon:n.jsx(Nn,{}),children:"Filters"}),children:u&&e[u]?n.jsx(xre,{prefix:u,config:e[u],onBackButtonSelect:()=>d(void 0),closeBuilder:()=>{r([...t,u]),i?.(u),l.setFalse()}}):n.jsx("div",{className:D("flex flex-col",BA),children:Object.entries(e).filter(([m])=>!t.includes(m)).map(([m,p])=>n.jsxs(Pe.Item,{className:Fv,onSelect:g=>{d(m),a?.(m),g.preventDefault()},children:[n.jsx(VR,{size:16}),p.title]},m))})})}function xre({prefix:e,config:t,onBackButtonSelect:r,closeBuilder:s}){const{onUpdateSelected:a}=UA(e,t),i=l=>{a(l),s()};return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:D("flex items-center pl-2 pr-3 gap-1 min-h-9",BA),children:[n.jsx(ue,{className:"!h-7",onClick:r,iconOnly:!0,variant:"minimal",children:n.jsx(Li,{})}),n.jsx("div",{className:"font-medium",children:t.title})]}),n.jsx("hr",{className:"border-t mt-1"}),t.type==="single-select"?n.jsx(HY,{values:t.values,onUpdateSelected:l=>i([l])}):t.type==="dropdown-select"?n.jsx(LA,{values:t.values,onUpdateSelected:l=>i([l])}):t.type==="checkbox-select"?n.jsx(MA,{label:t.title,values:t.values,onUpdateSelected:i,searchClassName:"rounded-none"}):t]})}function UA(e,t){const{query:r,setQuery:s}=ns();return{selected:f.useMemo(()=>vre(r,e,t),[r,e,t]),onUpdateSelected:l=>{s(yre(r,e,l))}}}function vre(e,t,r){const a=dA(e,t).reduce((i,l)=>{let u;return r.values.find(d=>(u=bre(d,l),u)),u?i.concat(u):i},[]);return a.length>1&&r.type!=="checkbox-select"?[a[0]]:a}function yre(e,t,r){const s=r.map(a=>Cre(a));return mA(e,t,s)}function bre(e,t){switch(t=t.toLowerCase(),e.type){case"string-constant":return t!==e.value.toLowerCase()?void 0:e;case"text-input":{const r=(e.prefix||"").toLowerCase();return t.startsWith(r)?{...e,value:t.replace(r,"")}:void 0}case"date-input":{const r=(e.prefix||"").toLowerCase();if(!t.startsWith(r))return;t=t.replace(r,"");const s=new Date(t);return Number.isNaN(s)?void 0:{...e,value:t}}}}function Cre(e){switch(e.type){case"string-constant":return e.value;case"text-input":case"date-input":return`${e.prefix||""}${e.value}`}}function t8(e){switch(e.type){case"string-constant":return e.label;case"text-input":return`${e.label} ${e.value}`;case"date-input":return`${e.label} ${e.value?.toUpperCase()}`}}function wre(){const{query:e,setQuery:t,tmpQuery:r,setTmpQuery:s}=ns(),a=jre(),i=Object.keys(a),[l,u]=f.useState(i.filter(p=>e.includes(`${p.toLowerCase()}:`)));function d(p){p.preventDefault(),O(R.MachinesSearchSubmitted,{eventProperties:{productArea:K.Machines}}),t(r)}function m(){t(""),s("")}return n.jsxs("div",{className:"flex-1",children:[n.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-2 @sm:flex-nowrap items-center",children:[n.jsx("form",{className:"w-full flex-shrink-0 max-w-2xl @sm:flex-shrink",onSubmit:d,children:n.jsx(Nu,{type:"text",name:"query",placeholder:"Search by name, owner, tag, version...",onChange:p=>s(p.target.value),onFocus:()=>O(R.MachinesSearchFocused,{eventProperties:{productArea:K.Machines}},{once:!0}),onClearClick:m,value:r})}),l.length!==i.length&&n.jsx(gre,{filterConfigs:a,openFilters:l,setOpenFilters:u,onOpenChange:p=>{p&&O(R.MachinesFilterDropdownOpened,{eventProperties:{productArea:K.Machines}})},onCategorySelected:p=>O(R.MachinesFilterCategorySelected,{eventProperties:{productArea:K.Machines,type:p}}),onFilterAdded:p=>O(R.MachinesFilterAdded,{eventProperties:{productArea:K.Machines,type:p}})}),n.jsx(Ge,{kbTopic:"Machines filters",url:"https://tailscale.com/docs/features/access-control/device-management/how-to/filter"})]}),l.length>0&&n.jsx("div",{className:"flex flex-wrap mt-4 gap-x-4 gap-y-2",children:l.map(p=>n.jsx(dre,{prefix:p,config:a[p]},p))})]})}function jre(){const{data:e}=Ss(),{aclTags:t}=$i(),{data:r}=sn(),{data:s}=Rt(),{data:a}=ot(),i=a?.loginName||"",l=f.useMemo(()=>r?.machines||[],[r?.machines]),u=f.useMemo(()=>{if(!e)return[];const w=[];for(const N of e.users)N.status!==Je.Invited&&w.push({type:"string-constant",label:N.displayName||N.loginName,value:N.loginName});return w.sort((N,k)=>N.value===i?-1:k.value===i?1:N.label.localeCompare(k.label)),w},[e,i]),d=f.useMemo(()=>Array.from(t.all.values()).map(w=>({type:"string-constant",label:w,value:w.replace("tag:","")})),[t.all]),m=s?.tailnetLockEnabled?[{type:"string-constant",label:"Signing node",value:"signing-node"}]:[],p=s?.tailnetLockEnabled?[{type:"string-constant",label:"Locked out",value:"locked-out"}]:[],g=s?.postureIdentityCollectionOn?{[TA]:{title:"Posture Identity",type:"single-select",values:[{type:"string-constant",label:"Needs upgrade",value:"needs-upgrade"},{type:"string-constant",label:"Not collected",value:"not-collected"},{type:"string-constant",label:"Not enabled on machine",value:"not-enabled"},{type:"string-constant",label:"Has posture identity",value:"has-posture-identity"},{type:"string-constant",label:"Empty posture identity",value:"empty-posture-identity"}]}}:{},v=l.some(w=>w.ownerDisabledStatus===en.Unpaid)?[{type:"string-constant",label:"User unpaid",value:"user-unpaid"}]:[],y=f.useMemo(()=>{const w=new Set(l.flatMap(N=>N.failingPostures||[]));return Array.from(w).sort().map(N=>({type:"string-constant",label:N,value:N.replace("posture:","")}))},[l]),C=(s?.posturesToBadgeInConsole||[]).length>0?[{type:"string-constant",label:"Badged",value:"badged",description:"Postures configured to alert in the console"}]:[],b=y.length>0?{[DA]:{title:"Failing posture",type:"checkbox-select",values:C.concat(y)}}:{};return{[wA]:{title:"Property",type:"single-select",values:[{type:"string-constant",label:"Ephemeral node",value:"ephemeral-node"},{type:"string-constant",label:"Exit node",value:"exit-node"},{type:"string-constant",label:"Subnet",value:"subnet"},{type:"string-constant",label:"Peer Relay",value:"peer-relay"},{type:"string-constant",label:"Tailscale SSH",value:"tailscale-ssh"},{type:"string-constant",label:"Tailscale Funnel",value:"tailscale-funnel"},{type:"string-constant",label:"Expiry disabled",value:"expiry-disabled"},{type:"string-constant",label:"Connector",value:"connector"},...m,...p]},[jA]:{title:"Last seen",type:"dropdown-select",values:[{type:"string-constant",label:"Currently connected",value:"connected"},{type:"string-constant",label:"Not currently connected",value:"not-connected"},{type:"text-input",label:"In the last",prefix:"<",placeholder:"e.g. 5m, 24h, 7d, 4w",hasValidationError:n8},{type:"text-input",label:"Before the last",prefix:">",placeholder:"e.g. 5m, 24h, 7d, 4w",hasValidationError:n8}]},[SA]:{title:"Managed by",type:"checkbox-select",values:[{type:"string-constant",label:"Users",value:"users",description:"Laptops, mobiles, tablets"},{type:"string-constant",label:"Tags",value:"tags",description:"Resources: servers, NAS, apps..."},...u,...d]},[kA]:{title:"Shared",type:"single-select",values:[{type:"string-constant",label:"Not shared",value:"not-shared"},{type:"string-constant",label:"Shared with me",value:"in"},{type:"string-constant",label:"Shared by me",value:"out"}]},[NA]:{title:"Disabled",type:"single-select",values:[{type:"string-constant",label:"Expired",value:"expired"},{type:"string-constant",label:"Needs approval",value:"needs-approval"},{type:"string-constant",label:"User suspended",value:"user-suspended"},{type:"string-constant",label:"User needs approval",value:"user-needs-approval"},...v,...p]},[EA]:{title:"Version",type:"dropdown-select",values:[{type:"text-input",label:"Is",prefix:"=",placeholder:"1.20.3"},{type:"text-input",label:"Is not",prefix:"!=",placeholder:"1.20.3"},{type:"text-input",label:"Same or newer than",prefix:">=",placeholder:"1.20.3"},{type:"text-input",label:"Newer than",prefix:">",placeholder:"1.20.3"},{type:"text-input",label:"Same or older than",prefix:"<=",placeholder:"1.20.3"},{type:"text-input",label:"Older than",prefix:"<",placeholder:"1.20.3"},{type:"string-constant",label:"Update available",value:"update-available"},{type:"string-constant",label:"Security update available",value:"security-update-available"}]},[AA]:{title:"OS",type:"checkbox-select",values:[{type:"string-constant",label:"Windows",value:"windows"},{type:"string-constant",label:"macOS",value:"macOS"},{type:"string-constant",label:"Linux",value:"linux"},{type:"string-constant",label:"iOS",value:"iOS"},{type:"string-constant",label:"Android",value:"android"},{type:"string-constant",label:"tvOS",value:"tvOS"},{type:"string-constant",label:"FreeBSD",value:"freebsd"},{type:"string-constant",label:"Illumos",value:"illumos"},{type:"string-constant",label:"OpenBSD",value:"openbsd"},{type:"string-constant",label:"NetBSD",value:"netbsd"},{type:"string-constant",label:"Solaris",value:"solaris"},{type:"string-constant",label:"AIX",value:"aix"},{type:"string-constant",label:"JS",value:"js"},{type:"string-constant",label:"Unknown",value:""}]},[PA]:{title:"OS Version",type:"dropdown-select",values:[{type:"text-input",label:"Is",prefix:"=",placeholder:"1.20.3"},{type:"text-input",label:"Is not",prefix:"!=",placeholder:"1.20.3"},{type:"text-input",label:"Same or newer than",prefix:">=",placeholder:"1.20.3"},{type:"text-input",label:"Newer than",prefix:">",placeholder:"1.20.3"},{type:"text-input",label:"Same or older than",prefix:"<=",placeholder:"1.20.3"},{type:"text-input",label:"Older than",prefix:"<",placeholder:"1.20.3"},{type:"string-constant",label:"Unknown",value:"unknown"}]},[IA]:{title:"Auto-update",type:"single-select",values:[{type:"string-constant",label:"Enabled",value:"enabled"},{type:"string-constant",label:"Disabled",value:"disabled"}]},...g,...b}}function n8(e){const t=Number.parseInt(e.slice(0,-1),10),r=e.slice(-1);return Number.isNaN(t)?"Must be formatted like “5m”, “24h”":Sre.has(r)?"":"Unit must be: “m”, “h”, “d”, “w”, or “y”"}const Sre=new Set(["m","h","d","w","y"]),kre=4;function VA(e){const t=e.pageCount>kre;return n.jsxs("div",{className:"flex items-center",children:[t&&n.jsx(ue,{variant:"minimal",sizeVariant:"small",className:"px-1.5",iconOnly:!0,"aria-label":"First page",disabled:e.isFirstPage,onClick:()=>{e.jumpToFirst(),window.scrollTo(0,0)},children:n.jsx(sw,{})}),n.jsx(ue,{variant:"minimal",sizeVariant:"small",className:"px-1.5",iconOnly:!0,"aria-label":"Previous page",disabled:e.isFirstPage,onClick:()=>{e.previousPage(),window.scrollTo(0,0)},children:n.jsx(Li,{})}),n.jsxs("p",{className:"font-medium mx-2",children:["Page ",e.currentPage+1," of ",e.pageCount]}),n.jsx(ue,{variant:"minimal",sizeVariant:"small",className:"px-1.5",iconOnly:!0,"aria-label":"Next page",disabled:e.isLastPage,onClick:()=>{e.nextPage(),window.scrollTo(0,0)},children:n.jsx(js,{})}),t&&n.jsx(ue,{variant:"minimal",sizeVariant:"small",className:"px-1.5",iconOnly:!0,"aria-label":"Last page",disabled:e.isLastPage,onClick:()=>{e.jumpToLast(),window.scrollTo(0,0)},children:n.jsx(aw,{})})]})}function Nre(e){const{data:t,error:r,isPosting:s,mutate:a,handleAction:i}=sn({refreshInterval:3e4});let l;if(r)l=n.jsx(De,{error:r});else if(t){const d=(t.machines||[]).sort(qk);l=n.jsx(Pre,{allMachines:d,isPosting:s,readonly:e.readonly,handleAction:i,refreshMachineData:a})}else l=n.jsx(De,{loadingMessage:"Loading machines..."});const{variant:u}=Fr("replace-learn-more-ctas-with-descriptive-ctas",!0);return n.jsx(mn,{className:"mb-24",title:"Machines",description:"Manage the devices connected to your tailnet.",learnMoreUrl:"https://tailscale.com/kb/manage-devices/",learnMoreLabel:u==="variant1"?"See how to manage devices":void 0,additionalHeader:n.jsx($A,{}),children:l})}const $A=({fromEmptyState:e})=>{const t=ss(!1),{data:r}=ot(),[,s]=ft(),a=i=>{const{title:l,subtitle:u,icon:d,action:m}=i;return n.jsxs(Pe.Item,{className:"w-80 grid grid-cols-[auto_1fr] gap-3 py-3 icon-parent",stopPropagation:!0,onSelect:m,children:[d,n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("h3",{className:"font-semibold",children:l}),n.jsx("p",{className:"text-pretty",children:u})]})]})};return r?n.jsxs("div",{className:"flex justify-end items-end",children:[n.jsxs(Pe,{asChild:!0,trigger:n.jsx(ue,{intent:"primary",sizeVariant:"medium",suffixIcon:n.jsx(Nn,{}),children:"Add device"}),onOpenChange:i=>{i&&O(R.AddDeviceButtonClicked,{eventProperties:{productArea:K.Machines,productSubArea:e?oe.EmptyState:void 0}})},align:"end",side:"top",children:[n.jsx(a,{title:"Linux server",subtitle:"Use this for services running on VMs, containers, and functions",icon:n.jsx(ol,{className:"text-text-muted mt-px"}),action:()=>{O(R.AddLinuxServerClicked,{eventProperties:{productArea:K.Machines}}),s("/admin/machines/new-linux")}}),n.jsx(Pe.Separator,{}),n.jsx(a,{title:"Client device",subtitle:"Use this for user-owned client devices like macOS, Windows, Linux, iOS, and Android",icon:n.jsx(Zx,{className:"text-text-muted mt-px"}),action:()=>{O(R.AddClientDeviceClicked,{eventProperties:{productArea:K.Machines}}),t.setTrue()}})]}),n.jsx(Re,{open:t.value,onOpenChange:t.toggle,title:"Add device",size:"large",children:n.jsxs("div",{className:"pb-2",children:[n.jsxs("p",{children:["To add a new device to your tailnet, install Tailscale on that device and log in as ",n.jsx("strong",{children:r.loginName}),"."]}),n.jsx("div",{className:"mt-4",children:n.jsx(Yc,{onDownloadDevice:!1,secondDevice:!0,user:r,onMachinesPage:!0})})]})})]}):null},Ere=100,Are=1;function Pre(e){const{allMachines:t,isPosting:r,readonly:s,handleAction:a,refreshMachineData:i}=e,{data:l}=ot(),{data:u}=Rt(),{query:d,setQuery:m}=ns(),{results:p}=ire({data:t,query:d,posturesToBadge:u?.posturesToBadgeInConsole}),g=Kv(p,Ere),[v,y]=U2(!0,"tailscale/add-devices-banner-open"),C=p.length,b=t.length,w=t.some(F=>F.upgradeWindowsWarningNov2022===!0),N=t.map(F=>F.os),k=bO(R.MachinesDownloadClicked,{eventProperties:{productArea:K.Machines}}),onExportComplete:()=>O(R.MachinesCSVDownloaded,{eventProperties:{productArea:K.Machines}})})]}),b>0?n.jsxs(n.Fragment,{children:[n.jsxs(We,{variant:"status",className:"mb-8",children:[C," ",yt("machine",C)]}),w&&n.jsxs(rt,{intent:"warning",className:"mb-4",children:[n.jsxs("p",{className:"mb-2",children:[n.jsxs("strong",{className:"font-medium",children:[n.jsx("a",{className:"link-underline",href:"https://tailscale.com/kb/1067/update/",target:"_blank",rel:"noopener noreferrer",children:"Update"})," ","Windows nodes to v1.32.3"]})," ","to remediate security vulnerabilities."]}),n.jsxs("p",{children:[n.jsx(ze,{to:"/admin/machines?q=os%3Awindows+version%3A<1.32.3",className:"font-medium link-underline",children:"View machines"})," ","or"," ",n.jsx("a",{href:"https://tailscale.com/blog/windows-security-vulnerabilities/",className:"font-medium link-underline",target:"_blank",rel:"noopener noreferrer",children:"learn more"})]})]}),n.jsx(Tre,{machines:g.pageData,isPosting:r,readonly:s,handleAction:a,refreshMachineData:i,onClearSearchClick:I,tailnetSettings:u}),n.jsx("div",{className:"flex justify-between mt-4",children:C>0&&g.pageCount>1&&n.jsx(VA,{...g})})]}):null,!_&&(k?n.jsx(hne,{}):n.jsx(qee,{isOpen:v,setOpen:y,machineOSs:N})),n.jsx(IE,{})]}):null}const HA="@md:w-1/3 flex-auto @md:flex-initial @md:shrink-0 w-0 text-ellipsis",zA="hidden @md:block @md:w-1/4",WA="hidden @md:block w-1/4 @lg:w-1/5",KA="hidden @lg:block @lg:flex-auto @lg:w-1/6",GA=D(Ut.cellAction,"w-1/6 @lg:w-12");function Tre(e){const{machines:t,isPosting:r,readonly:s,onClearSearchClick:a,handleAction:i,refreshMachineData:l,tailnetSettings:u}=e,{data:d}=jh(),m=d?.magicDNS||!1,{variant:p}=Fr("machines-dropdown-separate-subnet-router-and-exit-node",!0);return n.jsxs("table",{className:"tb",children:[n.jsx("thead",{children:n.jsxs("tr",{children:[n.jsx("th",{className:HA,children:"Machine"}),n.jsx("th",{className:zA,children:m?n.jsxs("span",{className:"flex items-center gap-1",children:["Addresses",n.jsx(Ee,{content:"Since MagicDNS is enabled, access a device signed in to your network by using its machine name. IP addresses are also available.",children:n.jsx(bs,{size:14,tabIndex:0})})]}):"IP"}),n.jsx("th",{className:WA,children:"Version"}),n.jsx("th",{className:KA,children:"Last Seen"}),n.jsx("th",{className:GA,children:n.jsx("span",{className:"sr-only",children:"Machines action menu"})})]})}),n.jsx("tbody",{children:t.length>0?t.map(g=>n.jsx(Ire,{machine:g,isPosting:r,readonly:s,handleAction:i,refreshMachineData:l,magicDNSEnabled:m,splitRouteSettingsVariant:p,tailnetSettings:u},g.id)):n.jsx("tr",{children:n.jsx("td",{className:"flex-auto max-w-full px-4 my-5 text-center",children:n.jsx(fn,{description:"No machines match your search",action:n.jsx("a",{href:"#",className:"link",onClick:g=>{g.preventDefault(),a()},children:"Clear search"})})})})})]})}const Ire=ce.memo(e=>{const{machine:t,isPosting:r,handleAction:s,refreshMachineData:a,magicDNSEnabled:i,splitRouteSettingsVariant:l,tailnetSettings:u}=e,d=t.addresses[0],m=bw(t),p="/admin/machines/"+d,[g,v]=f.useState(!1),y=t.connectedToControl?"connected":t.ownerDisabledStatus?"restricted":"unknown";return n.jsxs("tr",{id:t.nodeKey.replace("nodekey:","").slice(0,16),className:"w-full px-0.5 group hover:bg-gray-0 dark:hover:bg-gray-800",onMouseEnter:()=>v(!0),onMouseLeave:()=>v(!1),children:[n.jsxs("td",{className:HA,children:[n.jsxs("div",{className:"relative",children:[n.jsxs("div",{className:"items-center",children:[n.jsxs("p",{className:"font-semibold hover:text-text-primary",children:[n.jsx(Fn,{className:"relative -top-px @lg:hidden mr-2",status:y}),n.jsx(ze,{href:p,className:"stretched-link","aria-label":`Detail view for ${t.name||d}`,onClick:()=>O(R.MachineDetailClicked,{eventProperties:{productArea:K.Machines}}),children:t.name||"unknown"}),m&&n.jsx(Ee,{content:"This is a test server that can only be reached over Tailscale. Remove it at any time from the machine menu.",side:"top",align:"start",children:n.jsx(Kx,{className:"relative inline-block hover:text-text-muted ml-1",strokeWidth:"2",size:"1.05em",style:{top:-1}})})]}),n.jsxs("div",{className:"@md:hidden flex gap-1 truncate",children:[n.jsxs(n.Fragment,{children:[t.addresses.length," ",yt("address",t.addresses.length)]}),t.os&&n.jsxs(n.Fragment,{children:[n.jsx("span",{children:"·"}),n.jsx("span",{className:"@md:hidden text-text-muted",title:t.ipnVersion,children:pr(t.os)})]})]})]}),n.jsx("div",{className:D({"mt-1":t.hasTags}),children:n.jsx(OE,{machine:t})})]}),n.jsx("div",{className:"my-1",children:n.jsx(_E,{machine:t,posturesToBadgeInConsole:u?.posturesToBadgeInConsole,splitRouteSettingsVariant:l})})]}),n.jsx("td",{className:zA,children:n.jsx(une,{addresses:t.addresses,shortDomain:Mv(t,i),fullDomain:Gk(t,i)})}),n.jsxs("td",{className:WA,children:[t.os?n.jsxs("div",{className:"flex items-center relative",children:[t.availableUpdateVersion&&n.jsx("div",{className:"absolute top-0.5 -left-6",children:n.jsx(HE,{machine:t,handleAction:s,refreshMachine:a})}),n.jsx("div",{children:p2(t.ipnVersion)})]}):n.jsx(Ut.NullValue,{}),n.jsxs("div",{className:"truncate",children:[pr(t.os)," ",E$(t)]})]}),n.jsx("td",{className:KA,children:n.jsx(kh,{connected:t.connectedToControl,restricted:y==="restricted",date:t.lastSeen})}),n.jsx("td",{className:D(GA,"justify-items-end items-center @md:items-start"),children:n.jsx(DE,{machine:t,isPosting:r,handleAction:s,showQuickActions:g,refreshMachineData:a,splitRouteSettingsVariant:l,minimalMenuButton:!0})})]})}),Dre=[{name:"name",label:"Device name"},{name:"stableId",label:"Device ID"},{name:"user",label:"Managed by"},{name:"creator",label:"Creator"},{name:"os",label:"OS"},{name:"osVersion",label:"OS Version"},{name:"fqdn",label:"Domain"},{name:"ipnVersion",label:"Tailscale version"},{name:"allowedTags",label:"Tags"},{name:"created",label:"Created"},{name:"lastSeen",label:"Last seen"},{name:"expires",label:"Key expiry"},{name:"addresses",label:"Tailscale IPs"},{name:"endpoints",label:"Endpoints"},{name:"hasSubnets",label:"Subnet router"},{name:"allowedIPs",label:"Approved subnet routes"},{name:"extraIPs",label:"Unapproved subnet routes"},{name:"advertisedExitNode",label:"Exit node"},{name:"isEphemeral",label:"Ephemeral"},{name:"isExternal",label:"Shared in"},{name:"sshEnabled",label:"Tailscale SSH"},{name:"funnelEnabled",label:"Funnel"}],Fce=e=>e.type==="auth",Bce=e=>Object.entries(e.rules).every(([t,r])=>t.trim()&&r.trim())&&!!e.issuer.trim(),r8=50,Uce=e=>e===""?"":e.length>r8?`Descriptions can be a maximum of ${r8} characters.`:I$(e)?"":"Only alphanumeric characters are allowed.";function Vce(){const{data:e,error:t,mutate:r,isLoading:s}=dt("/public/tailnet/-/keys?all=true&includeInvalid=true"),{isPosting:a,newKey:i,updateKey:l,revokeKey:u}=_re(r);return{data:e?Lre(e.keys??[]):void 0,error:t,isPosting:a,isLoading:s,newKey:i,updateKey:l,revokeKey:u,mutate:r}}function _re(e){const t=ss(!1),r=et();function s(l){return t.setTrue(),Ie.post("/public/tailnet/-/keys/",l).then(u=>(t.setFalse(),e(),u.data.data)).catch(()=>{t.setFalse(),r.show({message:"Failed to generate new key.",variant:"danger"})})}function a(l,u){return t.setTrue(),Ie.put(`/public/tailnet/-/keys/${l}`,u).then(d=>(t.setFalse(),e(),d.data.data)).catch(()=>{t.setFalse(),r.show({message:"Failed to update key.",variant:"danger"})})}function i(l){return t.setTrue(),Ie.delete(`/public/tailnet/-/keys/${l}`).then(()=>{t.setFalse(),r.show({message:`Credential ${l} has been revoked`}),e()}).catch(()=>{t.setFalse(),r.show({message:"Failed to revoke credential.",variant:"danger"})})}return{isPosting:t.value,newKey:s,updateKey:a,revokeKey:i}}function qA(){const{data:e,error:t,mutate:r,isLoading:s}=dt("/public/tailnet/-/keys?includeInvalid=true"),a=e?Mre(e.keys??[]):void 0,i=ss(!1),l=et();function u(m){return i.setTrue(),Ie.post("/public/tailnet/-/keys",m).then(p=>(i.setFalse(),r(),p.data.data)).catch(()=>{i.setFalse(),l.show({message:"Failed to generate new key.",variant:"danger"})})}function d(m){return i.setTrue(),Ie.delete(`/public/tailnet/-/keys/${m}`).then(()=>{i.setFalse(),l.show({message:`Credential ${m} has been revoked`}),r()}).catch(()=>{i.setFalse(),l.show({message:"Failed to revoke credential.",variant:"danger"})})}return{data:a,error:t,isPosting:i.value,isLoading:s,newKey:u,revokeKey:d}}function Mre(e){const t=[],r=[],s=[],a=[];for(const i of e)i.keyType==="auth"?i.invalid?r.push(s8(i)):t.push(s8(i)):i.keyType==="api"&&(i.invalid?a.push(a8(i)):s.push(a8(i)));return{authKeys:t,invalidAuthKeys:r,apiKeys:s,invalidApiKeys:a}}function Lre(e){return e.filter(t=>t.keyType==="client"||t.keyType==="federated").map(Rre)}function s8(e){const t=e.capabilities?.devices?.create;return{type:"auth",id:e.id,created:e.created,expiry:e.expires,revoked:e.revoked,updated:e.updated,description:e.description,creator:e.creator,authkey:{reusable:t?.reusable,ephemeral:t?.ephemeral,preauthorized:t?.preauthorized,tags:t?.tags,forAdminPanel:t?.forAdminPanel}}}function a8(e){return{type:"api",id:e.id,created:e.created,expiry:e.expires,revoked:e.revoked,updated:e.updated,description:e.description,creator:e.creator,apikey:{api:"control"}}}function Rre(e){const t=e.customClaimRules||{};return e.subject&&(t.sub=e.subject),{type:"client",id:e.id,created:e.created,expiry:e.expires,revoked:e.revoked,updated:e.updated,description:e.description,creator:e.creator,oauthclient:{scopes:e.scopes,tags:e.tags},federatedIdentity:e.audience&&e.issuer?{id:e.id,audience:e.audience,issuer:e.issuer,rules:t,lastTokenExchangeError:e.lastTokenExchangeError}:void 0}}const Ore=1;function Fre(){const{loaded:e,error:t}=$i(),{isPosting:r,newKey:s}=qA(),[a,i]=f.useState(!0),[l,u]=f.useState(!1),[d,m]=f.useState(!1),[p,g]=f.useState([]),v=async()=>{const y=await s({keyType:"auth",description:"auto-generated from Linux machine wizard",capabilities:{devices:{create:{reusable:!1,ephemeral:l,preauthorized:!1,tags:a?p:[]}}},expirySeconds:3600*Ore});if(!y)return;let C="--ssh";d&&(C+=" --advertise-exit-node"),O(R.OpenedAWSCloudFormationQuickStart,{}),globalThis.location.href="https://us-east-2.console.aws.amazon.com/cloudformation/home#/stacks/quickcreate?templateURL=https%3A%2F%2Ftailscale-cloudformation-templates.s3.amazonaws.com%2Fsingle_instance_stack_v2.yml¶m_ExtraArgs="+encodeURIComponent(C)+"¶m_AuthKey="+encodeURIComponent(y.key)};return n.jsxs(n.Fragment,{children:[n.jsxs(ze,{href:"/admin/machines",className:"flex link items-center",children:[n.jsx(Li,{className:"pr-1",size:20}),"Back to All Machines"]}),n.jsx(is,{classes:"text-3xl mt-6 font-semibold",title:"Add AWS VM"}),n.jsx("p",{className:"mt-4",children:"Select preferences for your AWS EC2 instance."}),n.jsxs("div",{className:"max-w-2xl flex flex-col gap-4 pt-4",children:[n.jsxs("div",{className:"flex justify-between items-start gap-3 pb-4 border-b",children:[n.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[n.jsx("h3",{className:"font-semibold text-xl",children:"Tags"}),n.jsxs("p",{children:["Authenticate and control access to the device using a tag. Tagging a device disables node key expiry for that device."," ",n.jsx("a",{className:"link whitespace-nowrap",href:"https://tailscale.com/kb/1068/acl-tags",children:"Learn more"})]}),e?n.jsx(Iv,{tags:p,updateTags:g,disabled:r||!a}):n.jsx(De,{error:t})]}),n.jsx(dn,{checked:a,sizeVariant:"large",onChange:i})]}),n.jsxs("div",{className:"flex justify-between items-start gap-3 pb-4 border-b",children:[n.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[n.jsx("h3",{className:"font-semibold text-xl",children:"Ephemeral"}),n.jsxs("p",{children:["Automatically remove the device from your tailnet when it goes offline."," ",n.jsx("a",{className:"link whitespace-nowrap",href:"https://tailscale.com/kb/1111/ephemeral-nodes",children:"Learn more"})]})]}),n.jsx(dn,{checked:l,sizeVariant:"large",onChange:u})]}),n.jsxs("div",{className:"flex justify-between items-start gap-3 pb-4",children:[n.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[n.jsx("h3",{className:"font-semibold text-xl",children:"Use as exit node"}),n.jsxs("p",{children:["Route traffic through this device on your Tailscale network."," ",n.jsx("a",{className:"link whitespace-nowrap",href:"https://tailscale.com/kb/1103/exit-nodes",children:"Learn more"})]})]}),n.jsx(dn,{checked:d,sizeVariant:"large",onChange:m})]}),n.jsx(rt,{intent:"info",style:{marginBottom:20},children:"The link below contains an auth key that will be valid for 1 hour. Please ensure that you finish launching your instance in this timeframe and refrain from sharing the link with others."}),n.jsx("div",{className:"flex flex-col gap-3 justify-start items-start pr-[3.75rem]",children:n.jsx(ue,{onClick:v,intent:"primary",children:"Continue to AWS"})})]})]})}const Bre="https://tailscale.com/kb/pam",iy=[{id:"linux",label:"Linux"},{id:"aws",label:"AWS EC2"},{id:"docker",label:"Docker"},{id:"kubernetes",label:"Kubernetes"}];function Ure(e,t){switch(e){case"linux":return`sh <(curl -fsSL https://tailscale.border0.com/tailzero/install.sh) --invite ${t}`;case"docker":return`docker run -ti -v tailzero-volume:/var/lib/tailzero ghcr.io/borderzero/tailzero --border0-invite-code ${t}`;case"kubernetes":return`helm repo add border0 https://borderzero.github.io/helm-charts && helm repo update helm install tailzero-connector border0/tailzero-connector \\ --namespace default \\ --set config.inviteCode="${t}"`;case"aws":return`sh <(curl -fsSL https://tailscale.border0.com/tailzero/install.sh) --invite ${t}`}}function Vre(e){return`To install and run the connector on ${iy.find(r=>r.id===e)?.label??"your platform"}, copy-paste the following command into a terminal, and then run the command.`}function $re(){const[,e]=ft(),[t,r]=rl(),s=t.get("platform"),a=iy.some(d=>d.id===s)?s:null,i=t.get("nonce"),l=t.get("step")==="launch"&&a?1:0,u=()=>e("/admin/pam_connectors");return n.jsxs(mn,{title:"Add connector",className:"max-w-2xl",children:[n.jsxs("div",{className:"inline-block mb-4",children:[n.jsx(ze,{href:"/admin/pam_connectors",className:"link",children:"Connectors"}),n.jsx("span",{className:"text-text-muted",children:" / Add connector"})]}),n.jsx(Hre,{currentStep:l}),l===0?n.jsx(zre,{platform:a??void 0,setPlatform:d=>r({platform:d},{replace:!0}),onContinue:()=>r({platform:a,step:"launch",nonce:V2()}),onCancel:u}):n.jsx(Kre,{platform:a,nonce:i,onCancel:u,onDone:u})]})}function Hre({currentStep:e}){const t="rounded-full w-6 h-6 flex justify-center items-center text-sm",r="border border-gray-400 text-text-muted",s="bg-gray-900 dark:bg-gray-100 text-white dark:text-gray-900";return n.jsxs("div",{className:"flex items-center gap-[0.3125rem] font-medium mt-6 mb-8",children:[n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:`${t} ${e===0?s:r}`,children:"1"}),n.jsx("div",{className:e===0?"text-text-primary":"text-text-muted",children:"Select platform"})]}),n.jsx("div",{className:"border-b border-gray-400 w-16 min-w-16 my-auto"}),n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx("div",{className:`${t} ${e===1?s:r}`,children:"2"}),n.jsx("div",{className:e===1?"text-text-primary":"text-text-muted",children:"Launch connector"})]})]})}function zre({platform:e,setPlatform:t,onContinue:r,onCancel:s}){return n.jsxs("div",{children:[n.jsx("h3",{className:"font-medium mb-3",children:"Select your platform"}),n.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 max-w-xl",children:iy.map(a=>n.jsx(Wre,{platform:a,selected:e===a.id,onSelect:()=>t(a.id)},a.id))}),n.jsxs("div",{className:"flex gap-3 mt-6",children:[n.jsx(ue,{intent:"primary",disabled:!e,onClick:r,children:"Continue"}),n.jsx(ue,{onClick:s,children:"Cancel"})]})]})}function Wre({platform:e,selected:t,onSelect:r}){return n.jsxs("label",{className:"flex items-center gap-3 rounded-md border px-4 py-3 cursor-pointer "+(t?"border-blue-500 dark:border-blue-400":"border-border-interactive hover:bg-bg-menu-item-hover"),children:[n.jsx("input",{type:"radio",name:"platform",checked:t,onChange:r,className:"accent-blue-500"}),n.jsx(qR,{size:20,className:"text-text-muted"}),n.jsx("span",{className:"font-medium",children:e.label})]})}function Kre({platform:e,nonce:t,onCancel:r,onDone:s}){const{token:a,error:i}=OQ(t),{connectorId:l}=FQ(a??null),{isConnected:u}=BQ(l??null),d=a?Ure(e,a):"";return n.jsxs("div",{children:[n.jsx("h3",{className:"font-medium mb-1",children:"Launch new connector"}),n.jsxs("p",{className:"text-text-muted mb-4",children:[Vre(e)," ",n.jsx("a",{href:Bre,target:"_blank",rel:"noopener noreferrer",className:"link",children:"Learn more"})]}),i?n.jsx("p",{className:"text-text-danger",children:"Failed to create connector install token. Please try again."}):d?n.jsx(xn,{text:d,prompt:!1,allowWrap:!0,className:"w-full"}):n.jsxs("div",{className:"flex items-center gap-2 text-text-muted",children:[n.jsx(ts,{size:"sm"})," Generating install command…"]}),n.jsx("div",{className:"mt-4",children:u?n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(Wx,{size:18,className:"text-green-500"}),n.jsx("span",{children:"Your connector is now online."}),l&&n.jsx(ze,{href:`/admin/pam_connectors/${l}`,className:"link",children:"View connector"})]}):n.jsxs("div",{className:"flex items-center gap-2 text-text-muted",children:[n.jsx(ts,{size:"sm"}),n.jsx("span",{children:"Waiting for the connector to come online."})]})}),n.jsxs("div",{className:"flex gap-3 mt-6",children:[n.jsx(ue,{intent:"primary",disabled:!u,onClick:s,children:"Done"}),n.jsx(ue,{onClick:r,children:"Cancel"})]})]})}const Gre=7,i8=1,o8=90;function qre(){const{loaded:e,error:t}=$i(),{isPosting:r,newKey:s}=qA(),[a,i]=f.useState(!0),[l,u]=f.useState(!1),[d,m]=f.useState(!1),[p,g]=f.useState([]),[v,y]=f.useState(!1),[C,b]=f.useState(Gre),[w,N]=f.useState(!1),[k,E]=f.useState(),[T,_]=f.useState(!0),[I,F]=f.useState(!0),z=f.useMemo(()=>{const J=[];return k?J.push(`--auth-key=${k}`):(l&&J.push("--state=mem:"),a&&J.push(`--advertise-tags=${p.map(Y=>`tag:${Y}`).join(",")}`)),d&&J.push("--advertise-exit-node"),`curl -fsSL https://tailscale.com/install.sh | sh && sudo tailscale up ${J.join(" ")}`},[l,a,p,d,k]);f.useEffect(()=>{_(!0),N(!1)},[a,l,p,v,C]),f.useEffect(()=>{w&&v&&_(!1)},[w,v]);const H=async()=>{O(R.AddLinuxServerGenerateScriptClicked,{eventProperties:{productArea:K.Machines}}),N(!1);const J=await s({keyType:"auth",description:"auto-generated from Linux machine wizard",capabilities:{devices:{create:{reusable:v,ephemeral:l,preauthorized:!1,tags:a?p:[]}}},expirySeconds:1440*60*C});J&&(E(J.key),N(!0),F(!1))};return n.jsxs(n.Fragment,{children:[n.jsxs(ze,{href:"/admin/machines",className:"flex link items-center",children:[n.jsx(Li,{className:"pr-1",size:20}),"Back to All Machines"]}),n.jsx(is,{classes:"text-3xl mt-6 font-semibold",title:"Add Linux server"}),n.jsx("p",{className:"mt-4",children:"Select preferences for your server to generate an install script."}),n.jsxs("div",{className:"max-w-2xl flex flex-col gap-4 pt-4",children:[n.jsxs("h2",{className:"font-semibold text-xl flex",children:[n.jsx("div",{className:"w-8 text-center",children:"1."}),"Set up device"]}),n.jsxs("div",{className:"flex justify-between items-start gap-3 pb-4 border-b ml-8",children:[n.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[n.jsx("h3",{className:"font-semibold text-xl",children:"Tags"}),n.jsxs("p",{children:["Authenticate and control access to the device using a tag. Tagging a device disables node key expiry for that device."," ",n.jsx("a",{className:"link whitespace-nowrap",href:"https://tailscale.com/kb/1068/acl-tags",children:"Learn more"})]}),e?n.jsx(Iv,{tags:p,updateTags:g,disabled:r||!a}):n.jsx(De,{error:t})]}),n.jsx(dn,{checked:a,sizeVariant:"large",onChange:i})]}),n.jsxs("div",{className:"flex justify-between items-start gap-3 pb-4 border-b ml-8",children:[n.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[n.jsx("h3",{className:"font-semibold text-xl",children:"Ephemeral"}),n.jsxs("p",{children:["Automatically remove the device from your tailnet when it goes offline."," ",n.jsx("a",{className:"link whitespace-nowrap",href:"https://tailscale.com/kb/1111/ephemeral-nodes",children:"Learn more"})]})]}),n.jsx(dn,{checked:l,sizeVariant:"large",onChange:u})]}),n.jsxs("div",{className:"flex justify-between items-start gap-3 pb-4 ml-8",children:[n.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[n.jsx("h3",{className:"font-semibold text-xl",children:"Use as exit node"}),n.jsxs("p",{children:["Route traffic through this device on your Tailscale network."," ",n.jsx("a",{className:"link whitespace-nowrap",href:"https://tailscale.com/kb/1103/exit-nodes",children:"Learn more"})]})]}),n.jsx(dn,{checked:d,sizeVariant:"large",onChange:m})]}),n.jsxs("h2",{className:"font-semibold text-xl flex",children:[n.jsx("div",{className:"w-8 text-center",children:"2."}),"Set up authentication key"]}),n.jsxs("div",{className:"flex justify-between items-start gap-3 pb-4 border-b ml-8",children:[n.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[n.jsx("h3",{className:"font-semibold text-xl",children:"Reusable"}),n.jsxs("p",{children:["Use this key to authenticate more than one device."," ",n.jsx("a",{className:"link whitespace-nowrap",href:"https://tailscale.com/kb/1085/auth-keys#types-of-auth-keys",children:"Learn more"})]}),n.jsx(rt,{intent:"info",children:"Use this as part of automation to set up multiple devices."})]}),n.jsx(dn,{checked:v,sizeVariant:"large",onChange:y})]}),n.jsxs("div",{className:"flex flex-col gap-3 items-start pb-4 ml-8 pr-[3.75rem]",children:[n.jsx("h3",{className:"font-semibold text-xl",children:"Auth key expiration"}),n.jsxs("p",{children:["Set a time period to authenticate devices with this auth key. This will not affect the node key expiry of any device authenticated with this auth key."," ",n.jsx("a",{className:"link whitespace-nowrap",href:"https://tailscale.com/kb/1085/auth-keys#key-expiry",children:"Learn more"})]}),n.jsxs("div",{className:"flex mt-4",children:[n.jsx(bh,{inputClassName:"rounded-r-none",min:i8,max:o8,onChange:b,value:C,size:16}),n.jsx("div",{className:"flex items-center px-3 bg-gray-50 dark:bg-gray-900 text-text-muted border rounded-r border-l-0 border-border-interactive",children:"days"})]}),n.jsxs("p",{className:"text-gray-500",children:["Must be between ",i8," and ",o8," days."]}),n.jsxs(rt,{intent:"info",children:["Set the key expiry no longer than needed, to reduce impact if it is lost. To continuously add devices to your tailnet, such as with third-party integrations,"," ",n.jsx(ze,{className:"link",href:"/admin/settings/oauth",children:"use an OAuth client"}),"."]})]}),n.jsxs("h2",{className:"font-semibold text-xl flex",children:[n.jsx("div",{className:"w-8 text-center",children:"3."}),"Generate install script"]}),n.jsxs("div",{className:"flex flex-col gap-3 ml-8 justify-start items-start pr-[3.75rem]",children:[n.jsxs(ue,{onClick:H,intent:T?"primary":"base",disabled:!T,children:[I?"Generate":"Re-generate"," install script"]}),n.jsxs("div",{className:D("flex flex-col gap-3",{hidden:!w}),children:[n.jsx("p",{children:"In your terminal, run:"}),n.jsx(xn,{text:z,className:"w-full p-2",allowWrap:!0})]})]})]})]})}const Yre=[{key:"send-files",title:"Send files to different devices",description:"Taildrop allows you to share files seamlessly with any of your devices.",cards:[{type:"kbArticle",title:"Taildrop",desc:"Taildrop lets you send files between your personal devices on a Tailscale network (known as a tailnet).",link:"https://tailscale.com/docs/features/taildrop"}]},{key:"home-network",title:"Access my home network",description:"Tailscale allows you to make your entire home network available securely, wherever you are.",cards:[{type:"kbArticle",title:"Subnet routers",desc:"Subnet routers are devices with Tailscale installed that act as gateways to local networks that they’re a part of.",link:"https://tailscale.com/docs/features/subnet-routers"}]},{key:"cloud-storage",title:"Host my own cloud storage",description:"Install Tailscale on a NAS to be able to access your files from anywhere in the world.",cards:[{type:"kbArticle",title:"Connect to network attached storage (NAS)",desc:"Tailscale makes it easy to securely connect to your Network-Attached Storage (NAS) devices over WireGuard®.",link:"https://tailscale.com/docs/integrations/nas"}]},{key:"apple-tv",title:"Install Tailscale on my Apple TV",description:"An Apple TV can allow you to acess your home network, route internet traffic through it, or access media servers on your tailnet.",cards:[{type:"kbArticle",title:"Install Tailscale on an Apple TV",desc:"You can add your Apple TV to your Tailscale network (known as a tailnet) to access your media server content remotely, route your Apple TV traffic through an exit node, or advertise your Apple TV as an exit node.",link:"https://tailscale.com/docs/install/appletv"}]},{key:"other",title:"Other"}],Zre=[{key:"exit-node",title:"Secure traffic over an unsecure network",description:"An exit node allows you to securely route traffic over an unsecure network through a device on your tailnet.",cards:[{type:"kbArticle",title:"Exit nodes",desc:"Explore how to set up exit nodes in Tailscale for secure and private internet access, enhancing your network’s functionality and security.",link:"https://tailscale.com/docs/features/exit-nodes/how-to/setup"}]},{key:"add-device",title:"Add devices to my network",description:"Install Tailscale on more machines to expand your tailnet.",cards:[{type:"kbArticle",title:"Tailscale quickstart",desc:"Devices that you want to make available in your Tailscale network (known as a tailnet) such as personal computers, mobile devices, and servers must be added to the tailnet.",link:"https://tailscale.com/docs/features/access-control/device-management/how-to/set-up"},{type:"video",link:"https://www.youtube.com/watch?v=sPdvyR7bLqI",youtubeID:"sPdvyR7bLqI"}]},{key:"subnet-router",title:"Connect to a VPC or VLAN",description:"Use subnet routers to transparently add any networked device to your tailnet",cards:[{type:"kbArticle",title:"Subnet routers",desc:"Discover how to configure subnets for your Tailscale network, enabling efficient and secure communication across devices.",link:"https://tailscale.com/docs/features/subnet-routers/how-to/setup"}]},{key:"ssh",title:"Connect to a device using SSH",description:"Securely connect to your devices using Tailscale SSH.",cards:[{type:"kbArticle",title:"SSH",desc:"Learn how to utilize Tailscale SSH to securely access your devices remotely with ease.",link:"https://tailscale.com/docs/features/tailscale-ssh"},{type:"video",link:"https://www.youtube.com/watch?v=08clF9srJ2k",youtubeID:"08clF9srJ2k"}]},{key:"app-connector",title:"Route a website through a designated machine",description:"Use app connectors to route traffic through a specific device.",cards:[{type:"kbArticle",title:"App connectors",desc:"Control access to your third-party SaaS applications, without requiring any end user configuration.",link:"https://tailscale.com/docs/features/app-connectors/how-to/setup"}]},{key:"other",title:"Other"}],Qre=[{icon:n.jsx(uF,{}),text:"Yes",responseType:"yes"},{icon:n.jsx(lF,{}),text:"No",responseType:"no"},{icon:n.jsx(Or,{}),text:"I’m not interested in this use case",responseType:"not-interested"}];function l8({useCase:e}){const[t,r]=f.useState({}),s="https://tailscale.com/docs",a=(l,u,d,m)=>{l.preventDefault(),O(R.UseCaseCardClicked,{gettingStartedProperties:{useCaseTitle:u.title,useCaseKey:u.key,useCaseCardType:d,useCaseCardLink:m}}),window.open(m,"_blank","noopener,noreferrer")},i=(l,u,d)=>{l.preventDefault(),O(R.UseCaseFeedbackClicked,{gettingStartedProperties:{useCaseTitle:u.title,useCaseKey:u.key,useCaseFeedback:d}}),r(m=>({...m,[u.key]:!0}))};return n.jsxs("div",{children:[n.jsx("p",{className:"text-text-muted",children:e.description}),n.jsxs("div",{className:"flex flex-wrap space-x-4",children:[e.key==="other"&&n.jsxs("div",{children:[n.jsx("div",{className:"pb-4 text-text-muted",children:"Don’t see your use case listed here?"}),n.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",onClick:l=>a(l,e,"kbArticle",s),children:n.jsx(ue,{intent:"primary",children:"Search our knowledge base"})})]}),e.cards?.map((l,u)=>{let d,m;switch(l.type){case"kbArticle":{d=n.jsx($f,{size:"16"}),m="Read guide";break}case"video":{d=n.jsx(BR,{size:"16"}),m="Watch video";break}}return n.jsx("a",{href:l.link,target:"_blank",rel:"noopener noreferrer",onClick:p=>a(p,e,l.type,l.link),className:"w-[calc(50%-1rem)]",children:n.jsxs(at,{className:"flex flex-col items-start my-4 p-2 dark:!bg-gray-1000",children:[n.jsxs("div",{className:"flex justify-between items-center mb-2 w-full",children:[n.jsxs("div",{className:"flex items-center",children:[n.jsx("span",{className:"mr-2 text-text-muted",children:d}),n.jsx("span",{children:m})]}),n.jsx("span",{className:"text-text-muted",children:n.jsx(zx,{size:"16"})})]}),l.type==="video"&&n.jsx("img",{alt:"video thumbnail",src:`https://img.youtube.com/vi/${l.youtubeID}/0.jpg`}),l.type==="kbArticle"&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"pt-2",children:l.title}),n.jsx("div",{className:"text-text-muted pt-2",children:l.desc})]})]})},u)})]}),n.jsxs("div",{className:"p-4 pt-20 text-text-muted",children:[n.jsx("div",{className:"mb-2",children:n.jsx("p",{children:"Was this helpful?"})}),t[e.key]?n.jsx("div",{className:"",children:"Thank you for your feedback"}):n.jsx("div",{className:"flex space-x-4",children:Qre.map(l=>n.jsxs("button",{className:"flex items-center space-x-1 cursor-pointer hover:text-text-base",onClick:u=>i(u,e,l.responseType),children:[ce.cloneElement(l.icon,{size:16}),n.jsx("span",{children:l.text})]},l.responseType))})]})]})}function c8(){const{data:e}=Rt(),t=e&&Bi(e)?Zre:Yre,[r,s]=f.useState(t[0]),a=i=>{O(R.UseCaseClicked,{gettingStartedProperties:{useCaseTitle:i.title,useCaseKey:i.key}}),s(i)};return n.jsxs(mn,{title:"Resource hub",description:"Explore what you can do with Tailscale",children:[n.jsx("div",{className:"text-xl font-medium tracking-tight leading-tight mb-4 mt-8",children:"I want to..."}),n.jsxs("div",{className:"@lg:grid @lg:grid-cols-5 border gap-1 mt-4",children:[n.jsx("div",{className:"col-span-2 bg-gray-0 dark:bg-gray-1000",children:t.map((i,l)=>n.jsxs("div",{children:[n.jsx("button",{className:`w-full cursor-pointer ${l===0?"":"border-t"} ${r&&r.title===i.title?"bg-bg-base":"border-r"}`,onClick:()=>a(i),children:n.jsx("div",{className:"flex",children:n.jsx("div",{className:"flex items-center m-2 py-3 pl-4",children:i.title})})}),r&&r.title===i.title&&n.jsx("div",{className:"@lg:hidden pb-6 px-8",children:n.jsx(l8,{useCase:r})})]},l))}),n.jsx("div",{className:"hidden @lg:block col-span-3 py-6 px-8",children:n.jsx(l8,{useCase:r})})]})]})}const Cn=e=>n.jsx(e,{className:"text-text-muted",size:20}),Eh=[{label:"Set up my personal homelab",value:"Personal or At-Home Use",subtitleQualifier:"at-home",description:"Connect and manage your home network devices from anywhere"},{label:"Replace my VPN",value:"VPN Replacement",subtitleQualifier:"VPN",description:"Replace your legacy corporate VPN for faster, simpler, secure remote access"},{label:"Set up AI infrastructure",value:"AI Infrastructure Access",subtitleQualifier:"AI",description:"Secure access to AI infrastructure, GPU clusters, and private LLM deployments"},{label:"Set up test environments",value:"Application Testing",subtitleQualifier:"testing",description:"Share private dev/staging environments with testers"},{label:"Access a regulated environment",value:"Accessing a Regulated Environment",subtitleQualifier:"regulated",description:"Connect to auditable compliance systems such as bank or healthcare"},{label:"Set up infrastructure access",value:"Infrastructure Access",subtitleQualifier:"infrastructure access",description:"Allow engineers to securely access servers, databases, or resources"}],YA=[{icon:Cn(fw),title:"Access NAS, media servers, or file shares remotely",url:"https://tailscale.com/docs/use-cases/personal-or-at-home-use/access-nas-media-file-servers",useCases:["Personal or At-Home Use"]},{icon:Cn($O),title:"Remote access to devices that can't run Tailscale (printers, cameras)",url:"https://tailscale.com/docs/use-cases/personal-or-at-home-use/access-devices-without-tailscale",useCases:["Personal or At-Home Use"]},{icon:Cn(hO),title:"Share a private game server (e.g. Minecraft) with friends",url:"https://tailscale.com/docs/use-cases/personal-or-at-home-use/share-private-game-server",useCases:["Personal or At-Home Use"]},{icon:Cn(qx),title:"Secure remote access to internal corporate apps and data",url:"https://tailscale.com/docs/use-cases/vpn-replacement/secure-access",useCases:["VPN Replacement"]},{icon:Cn(gR),title:"Secure remote access for employees to on-prem or in-office resources",url:"https://tailscale.com/docs/use-cases/vpn-replacement/remote-workers",useCases:["VPN Replacement"]},{icon:Cn(JR),title:"Automating employee onboarding/offboarding",url:"https://tailscale.com/docs/use-cases/vpn-replacement/employee-onboarding-offboarding",useCases:["VPN Replacement"]},{icon:Cn(WO),title:"Connect your inference/training server (includes multi-tenant delivery)",url:"https://tailscale.com/docs/use-cases/ai-infrastructure-access/connect-inference-servers",useCases:["AI Infrastructure Access"]},{icon:Cn(hR),title:"Set up your training cluster with Kubernetes",url:"https://tailscale.com/docs/use-cases/ai-infrastructure-access/secure-ai-training-cluster",useCases:["AI Infrastructure Access"]},{icon:Cn(mR),title:"Govern and create visibility into your AI tools (Aperture)",url:"https://tailscale.com/docs/use-cases/ai-infrastructure-access/centralize-llm-access-and-spending",useCases:["AI Infrastructure Access"]},{icon:Cn(ol),title:"Share a local dev server with teammates",url:"https://tailscale.com/docs/use-cases/application-testing/share-local-dev-server-with-team",useCases:["Application Testing"]},{icon:Cn(bF),title:"Expose a local server to the public internet (e.g. webhook testing)",url:"https://tailscale.com/docs/use-cases/application-testing/share-local-dev-server-with-internet",useCases:["Application Testing"]},{icon:Cn(Hf),title:"Localization/geo-specific testing",url:"https://tailscale.com/docs/use-cases/application-testing/geo-specific-testing",useCases:["Application Testing"]},{icon:Cn(kO),title:"Provide a static egress IP for allowlisting",url:"https://tailscale.com/docs/use-cases/regulated-environment/static-egress-ip-allowlist",useCases:["Accessing a Regulated Environment"]},{icon:Cn(EF),title:"Enforce device compliance before granting access",url:"https://tailscale.com/docs/use-cases/regulated-environment/enforce-device-compliance",useCases:["Accessing a Regulated Environment"]},{icon:Cn(lO),title:"Record SSH sessions for compliance and audit",url:"https://tailscale.com/docs/use-cases/infrastructure-access/record-ssh-sessions-compliance",useCases:["Infrastructure Access"]},{icon:Cn(mF),title:"Manage least-privilege access and just-in-time access to production environments",url:"https://tailscale.com/docs/use-cases/infrastructure-access/manage-least-priviledged-and-jit-access",useCases:["Infrastructure Access"]},{icon:Cn(ZR),title:"Manage access across multi-cloud or multi-region cloud environments",url:"https://tailscale.com/docs/use-cases/infrastructure-access/access-multi-cloud-or-multi-region-cloud-envs",useCases:["Infrastructure Access"]}],Dm=Eh.map(e=>({type:"string-constant",label:e.label,value:e.value,description:e.description})),oy=f.createContext(null);function Jre({children:e}){const{data:t}=Rt(),r=f.useMemo(()=>{const u=t?.personalization?.useCase,d=Dm.find(p=>p.value===u);if(d)return d;if(!t)return null;const m=Bi(t)?"VPN Replacement":"Personal or At-Home Use";return Dm.find(p=>p.value===m)??Dm[0]},[t]),[s,a]=f.useState(),i=s??r,l=f.useMemo(()=>{if(!i)return null;const u=Eh.find(m=>m.value===i.value)?.subtitleQualifier??"",d=YA.filter(m=>m.useCases.includes(i.value));return{selected:i,setSelected:a,subtitleQualifier:u,guides:d}},[i]);return n.jsx(oy.Provider,{value:l,children:e})}function u8({className:e,layout:t="horizontal"}){const r=f.useContext(oy);if(!r)return null;const s=t==="horizontal";return n.jsxs("div",{className:D("flex flex-col gap-1",s&&"@lg:flex-row @lg:items-center @lg:gap-3 @lg:flex-shrink-0",e),children:[n.jsx("label",{children:"What do you want to do?"}),n.jsx(br,{buttonClassName:"min-w-[220px] !bg-bg-base",values:Dm,selected:r.selected,onUpdateSelected:a=>{const i=a;i.value!==r.selected.value&&O(R.SolutionGuidesUseCaseChanged,{eventProperties:{productArea:K.ResourceHub},solutionGuidesProperties:{useCase:i.value,previousUseCase:r.selected.value}}),r.setSelected(i)}})]})}function Xre({className:e,layout:t="horizontal"}){const r=f.useContext(oy);if(!r)return null;const s=t==="horizontal";return n.jsxs("div",{className:D("flex flex-col gap-3",e),children:[n.jsxs("p",{children:["Try these solution guides for popular ",r.subtitleQualifier," use cases:"]}),n.jsx("div",{className:D("grid grid-cols-1 gap-3",s&&"@lg:grid-cols-3"),children:r.guides.map((a,i)=>n.jsx(ese,{guide:a,useCase:r.selected.value},i))}),n.jsxs("p",{className:"text-text-muted",children:["Not seeing what you want? Get started with this"," ",n.jsx("a",{href:"https://www.youtube.com/watch?v=sPdvyR7bLqI",target:"_blank",rel:"noopener noreferrer",onClick:()=>{O(R.SolutionGuidesVideoLinkClicked,{eventProperties:{productArea:K.ResourceHub},solutionGuidesProperties:{useCase:r.selected.value}})},className:"link",children:n.jsx("span",{className:"whitespace-nowrap",children:"10-minute video"})})]})]})}function ese({guide:e,useCase:t}){return n.jsxs("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:()=>{O(R.SolutionGuidesTileClicked,{eventProperties:{productArea:K.ResourceHub},solutionGuidesProperties:{useCase:t,guideTitle:e.title,guideUrl:e.url}})},className:"flex items-center gap-3 px-3 py-3 rounded-md bg-bg-base border hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:[n.jsx("span",{className:"self-start text-text-muted",children:e.icon}),n.jsx("span",{className:"self-start flex-1 text-text-base",children:e.title}),n.jsx(js,{size:24,className:"flex-shrink-0 self-center text-text-primary","aria-hidden":!0})]})}const d8="rounded-md shadow-soft max-w-[275px]";function ZA({task:e,step:t}){const r=t.image!==void 0;return n.jsxs("div",{className:D("grid grid-cols-1 gap-4 @md:gap-6 mt-2 @md:mt-0 @md:px-4 @md:py-2",{"@md:grid-cols-[minmax(0,1fr)_275px]":r}),children:[n.jsxs("div",{className:"flex flex-col gap-3 items-start",children:[n.jsx("h3",{className:"text-lg font-medium",children:t.heading}),n.jsx("div",{children:t.body}),t.action,t.helpLink&&n.jsx(Ge,{label:t.helpLink.label,url:t.helpLink.href,kbTopic:t.helpLink.kbTopic,onClick:()=>{t.helpLink&&O(R.ResourceHubHelpLinkClicked,{eventProperties:{productArea:K.ResourceHub},resourceHubProperties:{taskTitle:e.title,stepHeading:t.heading,actionLabel:t.helpLink.label}})}})]}),t.image&&n.jsxs("div",{children:[n.jsx("img",{src:t.image.src,alt:t.image.alt,className:D("block dark:hidden",d8)}),n.jsx("img",{src:t.image.srcDark,alt:t.image.alt,className:D("hidden dark:block",d8)})]})]})}const tse="/admin/assets/step-four-dark-DGSKIKZb.png",nse="/admin/assets/step-four-DOT2FFYg.png",rse="/admin/assets/step-one-dark-CE0h2hXm.png",sse="/admin/assets/step-one-B_yu3S5w.png",ase="/admin/assets/step-three-dark-BjM0YYTt.png",ise="/admin/assets/step-three-DfViaKzH.png",ose="/admin/assets/step-two-one-dark-DL1NO8KF.png",lse="/admin/assets/step-two-one-DbPptHu3.png",cse="/admin/assets/step-two-two-dark-B4QxXyq7.png",use="/admin/assets/step-two-two-X164xCRY.png",dse=[{id:0,icon:n.jsx(LO,{size:18}),title:"Connect your devices",duration:"5 mins",steps:[{heading:"Add user devices",body:"Once you install Tailscale on devices like your laptop or phone, they’ll be added to your tailnet, a private network that encrypts all traffic between devices.",action:n.jsx(Vt,{intent:"primary",href:"https://tailscale.com/download",onClick:()=>O(R.ResourceHubStepActionClicked,{eventProperties:{productArea:K.ResourceHub},resourceHubProperties:{taskTitle:"Connect your devices",stepHeading:"Add user devices",actionLabel:"Install Tailscale"}}),children:"Install Tailscale"}),image:{src:sse,srcDark:rse,alt:"Add devices illustration"}}]},{id:1,icon:n.jsx(iF,{size:18}),title:"Tag non-user devices",duration:"7 mins",steps:[{heading:"Step 1: Create tags",body:n.jsxs(n.Fragment,{children:["Tags give your devices an identity based on what they do, like"," ",n.jsx(We,{variant:"tag",color:"outline",className:"bg-bg-menu-item-hover",children:"tag:prod"})," ","for production servers or"," ",n.jsx(We,{variant:"tag",color:"outline",className:"bg-bg-menu-item-hover",children:"tag:staging"})," ","for staging environments. This lets you write access rules around purpose rather than individual devices."]}),action:n.jsx(Vt,{intent:"primary",to:"/admin/acls/visual/tags",onClick:()=>O(R.ResourceHubStepActionClicked,{eventProperties:{productArea:K.ResourceHub},resourceHubProperties:{taskTitle:"Tag non-user devices",stepHeading:"Step 1: Create tags",actionLabel:"Create tags"}}),children:"Create tags"}),helpLink:{label:"Why must I tag non-user devices?",href:"https://tailscale.com/docs/features/tags#use-cases",kbTopic:"Group devices with tags"},image:{src:lse,srcDark:ose,alt:"Create tags illustration"}},{heading:"Step 2: Add and tag non-user devices",body:n.jsxs(n.Fragment,{children:["When you add a tagged non-user device to your tailnet, its identity isn’t tied to any user, so access stays intact no matter who joins or leaves.",n.jsx("span",{className:"block mt-4",children:"Bring these devices into your tailnet by running a few commands in your CLI, then authenticate with an auth key that has tags enabled."})]}),action:n.jsx(hse,{}),helpLink:{label:"How do I use auth keys with tags?",href:"https://tailscale.com/docs/features/access-control/auth-keys",kbTopic:"Auth keys"},image:{src:use,srcDark:cse,alt:"Tag devices illustration"}}]},{id:2,icon:n.jsx(EO,{size:18}),title:"Set up access controls",duration:"10 mins",steps:[{heading:"Create access rules",body:n.jsxs(n.Fragment,{children:["Access rules let you decide which users and devices can reach each other, so they can only access what’s deemed necessary.",n.jsx("span",{className:"block mt-4",children:"By default, users will have access to all devices."})]}),action:n.jsx(Vt,{intent:"primary",to:"/admin/acls/visual/general-access-rules",onClick:()=>O(R.ResourceHubStepActionClicked,{eventProperties:{productArea:K.ResourceHub},resourceHubProperties:{taskTitle:"Set up access controls",stepHeading:"Create access rules",actionLabel:"Add rule"}}),children:"Add rule"}),helpLink:{label:"How should I configure access?",href:"https://tailscale.com/docs/reference/examples/grants",kbTopic:"Manage permissions using ACLs"},image:{src:ise,srcDark:ase,alt:"Access rules illustration"}}]},{id:3,icon:n.jsx(wi,{size:18}),title:"Invite users",duration:"2 mins",steps:[{heading:"Invite users",body:"Adding your team, contractors, or vendors to your tailnet gives them secure access to the resources they need. Assign each person a role so you control what they can see and do.",action:n.jsx(Vt,{intent:"primary",to:"/admin/users",onClick:()=>O(R.ResourceHubStepActionClicked,{eventProperties:{productArea:K.ResourceHub},resourceHubProperties:{taskTitle:"Invite users",stepHeading:"Invite users",actionLabel:"Manage users"}}),children:"Manage users"}),image:{src:nse,srcDark:tse,alt:"Invite users illustration"}}]}],mse=[{id:0,icon:n.jsx(ZO,{size:18}),title:"Send files between devices",duration:"2 mins",steps:[{heading:"Share files with Taildrop",body:"Taildrop lets you share files seamlessly between any of your personal devices on a Tailscale network (known as a tailnet).",action:n.jsx(Vt,{intent:"primary",href:"https://tailscale.com/docs/features/taildrop",onClick:()=>O(R.ResourceHubStepActionClicked,{eventProperties:{productArea:K.ResourceHub},resourceHubProperties:{taskTitle:"Send files between devices",stepHeading:"Share files with Taildrop",actionLabel:"Read guide"}}),children:"Read guide"})}]},{id:1,icon:n.jsx(dw,{size:18}),title:"Access your home network",duration:"10 mins",steps:[{heading:"Reach your home network from anywhere",body:"Set up a subnet router to make your entire home network securely available wherever you are.",action:n.jsx(Vt,{intent:"primary",href:"https://tailscale.com/docs/features/subnet-routers",onClick:()=>O(R.ResourceHubStepActionClicked,{eventProperties:{productArea:K.ResourceHub},resourceHubProperties:{taskTitle:"Access your home network",stepHeading:"Reach your home network from anywhere",actionLabel:"Read guide"}}),children:"Read guide"})}]},{id:2,icon:n.jsx(ol,{size:18}),title:"Host your own cloud storage",duration:"10 mins",steps:[{heading:"Connect to network-attached storage (NAS)",body:"Install Tailscale on a NAS to access your files from anywhere in the world over an encrypted WireGuard® connection.",action:n.jsx(Vt,{intent:"primary",href:"https://tailscale.com/docs/integrations/nas",onClick:()=>O(R.ResourceHubStepActionClicked,{eventProperties:{productArea:K.ResourceHub},resourceHubProperties:{taskTitle:"Host your own cloud storage",stepHeading:"Connect to network-attached storage (NAS)",actionLabel:"Read guide"}}),children:"Read guide"})}]},{id:3,icon:n.jsx(fw,{size:18}),title:"Install Tailscale on Apple TV",duration:"5 mins",steps:[{heading:"Add an Apple TV to your tailnet",body:"Add your Apple TV to your tailnet to access your media server remotely, route Apple TV traffic through an exit node, or advertise the Apple TV as an exit node.",action:n.jsx(Vt,{intent:"primary",href:"https://tailscale.com/docs/install/appletv",onClick:()=>O(R.ResourceHubStepActionClicked,{eventProperties:{productArea:K.ResourceHub},resourceHubProperties:{taskTitle:"Install Tailscale on Apple TV",stepHeading:"Add an Apple TV to your tailnet",actionLabel:"Read guide"}}),children:"Read guide"})}]}];function QA(){const[e,t]=ph(0,"resource-hub-last-seen-task");return{lastSeenTask:e,setLastSeenTask:t}}const fse=[{label:"Linux",href:"https://tailscale.com/docs/install/linux"},{label:"Windows with MSI",href:"https://tailscale.com/docs/install/windows/msi"},{label:"A subnet router",href:"https://tailscale.com/docs/features/subnet-routers/how-to/setup"}];function hse(){return n.jsx(Pe,{asChild:!0,align:"start",trigger:n.jsx(ue,{suffixIcon:n.jsx(Nn,{size:16,"aria-hidden":!0}),children:"Open guide for..."}),children:fse.map(e=>n.jsx(Pe.Item,{onSelect:()=>{O(R.ResourceHubInstallOptionClicked,{eventProperties:{productArea:K.ResourceHub},resourceHubProperties:{taskTitle:"Tag non-user devices",stepHeading:"Step 2: Add and tag non-user devices",actionLabel:e.label}}),window.open(e.href,"_blank","noopener,noreferrer")},children:e.label},e.href))})}function pse({tasks:e,className:t}){const{lastSeenTask:r,setLastSeenTask:s}=QA(),[a,i]=f.useState(e[r]?.id??null);return n.jsx("ul",{className:D("flex flex-col gap-4",t),children:e.map(l=>{const u=l.id===a,d=`resource-hub-task-${l.id}-panel`;return n.jsxs("li",{children:[n.jsxs("button",{type:"button",onClick:()=>{s(l.id);const m=!u;i(m?l.id:null),m&&O(R.ResourceHubTaskOpened,{eventProperties:{productArea:K.ResourceHub},resourceHubProperties:{taskTitle:l.title}},{throttleMs:1e3})},"aria-expanded":u,"aria-controls":d,className:"w-full max-w-80 flex items-center gap-3 py-2 text-left leading-tight",children:[n.jsxs("span",{className:"flex gap-2 items-center min-w-0",children:[n.jsx(js,{size:16,"aria-hidden":!0,className:D("flex-shrink-0 transition-transform",{"rotate-90":u})}),n.jsx("span",{"aria-hidden":!0,className:D("flex-shrink-0",{"text-text-muted":!u}),children:l.icon}),n.jsx("span",{className:D("truncate",{"font-medium":u}),children:l.title})]}),n.jsx(We,{variant:"tag",color:"gray",children:l.duration})]}),u&&n.jsx("div",{id:d,role:"region","aria-label":l.title,className:"flex flex-col gap-4 pb-6 pl-1",children:l.steps.map((m,p)=>n.jsx(ZA,{task:l,step:m},p))})]},l.id)})})}function gse({tasks:e,className:t}){const{lastSeenTask:r,setLastSeenTask:s}=QA(),[a,i]=f.useState(e[r]),l=u=>{u.id!==a.id&&(O(R.ResourceHubTaskOpened,{eventProperties:{productArea:K.ResourceHub},resourceHubProperties:{taskTitle:u.title}},{throttleMs:1e3}),s(u.id),i(u))};return n.jsxs("div",{className:D("grid grid-cols-[auto_1fr] gap-6",t),children:[n.jsx(xse,{tasks:e,selectedTaskId:a.id,onSelect:l}),n.jsx("div",{className:"flex flex-col gap-6",children:a.steps.map((u,d)=>n.jsx(ZA,{task:a,step:u},d))})]})}function xse({tasks:e,selectedTaskId:t,onSelect:r}){return n.jsx("ul",{children:e.map((s,a)=>{const i=s.id===t;return n.jsx("li",{className:D({"mb-1":ar(s),"aria-current":i?"true":void 0,className:D("min-w-80 w-full px-3 py-2 flex justify-between items-center gap-3 rounded-md text-left","hover:bg-bg-menu-item-hover transition-colors",{"bg-bg-menu-item-hover":i}),children:[n.jsxs("span",{className:"flex gap-2 items-center",children:[n.jsx("span",{"aria-hidden":!0,className:D({"text-text-muted":!i}),children:s.icon}),n.jsx("span",{className:D({"font-medium":i}),children:s.title})]}),n.jsx(We,{variant:"tag",color:"gray",children:s.duration})]})},s.id)})})}function vse(){const{data:e}=Rt();if(!e)return n.jsx(mn,{title:"Resource hub",children:n.jsx(De,{})});const t=Bi(e),r=t?dse:mse,a=[{id:1,order:1,title:t?"Configure your network setup":"Ways to use Tailscale on your home network",content:n.jsxs(n.Fragment,{children:[n.jsx(gse,{tasks:r,className:"hidden @lg:grid"}),n.jsx(pse,{tasks:r,className:"@lg:hidden"})]})},{id:2,order:2,title:"See what’s possible",titleAccessory:n.jsx(u8,{className:"hidden @md:flex"}),content:n.jsxs("div",{className:"flex flex-col gap-3",children:[n.jsx(u8,{className:"@md:hidden"}),n.jsx(Xre,{layout:"horizontal"})]})}];return n.jsx(mn,{title:"Resource hub",children:n.jsx(Jre,{children:n.jsx("div",{className:"flex flex-col gap-6 max-w-280 mx-auto mt-8",children:a.map(i=>n.jsx(yse,{section:i},i.id))})})})}function yse({section:e}){return n.jsxs(at,{noPadding:!0,children:[n.jsxs("div",{className:"px-6 py-4 bg-bg-app border-b flex gap-4 items-center justify-between",children:[n.jsxs("div",{className:"font-semibold flex gap-2 items-center",children:[n.jsx("span",{className:"w-5 h-5 text-sm bg-gray-800 text-white dark:bg-gray-200 dark:text-gray-800 text-center leading-relaxed rounded-full",children:e.order}),n.jsx("h2",{className:"text-lg",children:e.title})]}),e.titleAccessory]}),n.jsx("div",{className:"p-4 @md:p-6",children:e.content})]})}function bse(){const{data:e}=Rt(),{inSegment:t,isLoading:r}=Xs({isSharedDomain:!1,isBusiness:!0});return r||e===void 0?n.jsx(De,{loadingMessage:"Loading..."}):n.jsx(pl,{experimentKey:"resource-hub-tab-improve-resource-hub-awareness",variants:{control:n.jsx(c8,{}),variant1:n.jsx(vse,{})},enabled:t,unenrolled:n.jsx(c8,{}),loadingDisplay:n.jsx(De,{loadingMessage:"Loading..."})})}const JA={hybrid_standard:1,ds_hybrid_standard:1,aws_private_offer_hybrid_standard:1,azure_private_offer_hybrid_standard:1,reseller_hybrid_standard:1,aws_self_serve_hybrid_standard:1,hybrid_premium:2,ds_hybrid_premium:2,aws_private_offer_hybrid_premium:2,azure_private_offer_hybrid_premium:2,reseller_hybrid_premium:2,aws_self_serve_hybrid_premium:2,ds_hybrid_enterprise:3,aws_private_offer_hybrid_enterprise:3,azure_private_offer_hybrid_enterprise:3,reseller_hybrid_enterprise:3,enterprise_trial:3};function m8(e){return JA[e]??-1}function Cse(e){const{data:t}=Nt(),r=t?.readableProductID||"personal",s=M$(r),a=JA[e],i=a<=1?"Standard, Premium, or Enterprise plans":a===2?"Premium or Enterprise plans":"Enterprise plan";return s?`You’re on the legacy ${Qs(r)} plan. This functionality is only available on the new ${i}.`:`This functionality is only available on the ${i}.`}function ly({plan:e,className:t}){const{data:r}=Nt(),s=m8(r?.readableProductID??""),a=m8(e);return s>=a?null:n.jsx(Ee,{sideOffset:16,content:n.jsx(wse,{plan:e}),children:n.jsx(We,{className:D("relative",t),variant:"status",color:"purple",children:n.jsxs("div",{className:"flex gap-1 items-center",children:[n.jsx(rF,{size:10}),n.jsx("p",{children:Qs(e)})]})})})}function wse({plan:e}){const{data:t}=Nt(),r=gu(t?.readableProductID),s=Cse(e);return n.jsxs("div",{className:"max-w-48",children:[s," ",r?n.jsx(u0,{className:"link",eventProperties:{productArea:K.Billing,productSubArea:oe.RequiredHybridPlanBadge},children:"Contact sales"}):n.jsx(ze,{href:"/admin/settings/billing/plans",className:"link",onClick:()=>{O(R.ViewPlansFromRequiredHybridPlanBadgeClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.RequiredHybridPlanBadge}})},children:"View plans"})]})}function jse(e){const{onSubmit:t,open:r,onOpenChange:s,disabled:a}=e,{data:i,error:l,currentTailnetID:u,isLoading:d}=ot(),{data:m,error:p,isLoading:g}=sn(),v=m?.machines.length||0,{data:y,error:C,isLoading:b}=Ss(),w=y?.users.reduce((P,q)=>q.orgTailnetId===u?P+1:P,0)||1,N=d||g||b,{error:k,data:E}=Nt(),T=!E||E.readableProductID==="personal"||E.upcomingInvoice?.amountDue===0,[_,I]=f.useState(!1),[F,z]=f.useState(!1),[H,J]=f.useState(!1),[Y,B]=f.useState("");if(!i)return null;const W=Y.toLowerCase().trim()===i.domainName.toLowerCase().trim(),U=w>1,Z=v>0,re=U||Z,me=(_||!U)&&(F||!Z)&&(H||!re),L=n.jsxs("a",{className:"link",href:"/admin/users",target:"_blank",rel:"noopener noreferrer",children:[w," users"]}),V=n.jsx("a",{className:"link",href:"/admin/machines",target:"_blank",rel:"noopener noreferrer",children:v>1?`${v} machines`:"1 machine"});return n.jsx(Re,{open:r,onOpenChange:s,title:"Delete tailnet",children:N||p||l||C||k?n.jsx(De,{error:p||l||C||k}):n.jsxs(Re.Form,{disabled:!W||!me||a,cancelButton:"Close",submitButton:"Delete",destructive:!0,onSubmit:()=>t(u||""),children:[w===1&&v===0?n.jsxs("p",{children:["The tailnet ",n.jsx("strong",{children:i.domainName})," will be deleted, and your user will be removed from all external tailnets."]}):w===1&&v>0?n.jsxs("p",{children:["The tailnet ",n.jsx("strong",{children:i.domainName})," will be deleted, and your user will be removed from all external tailnets."," ",V," will also be removed from this tailnet."]}):w>1&&v===0?n.jsxs("p",{children:["The tailnet ",n.jsx("strong",{children:i.domainName})," and ",L," will be deleted, and users will be removed from all external tailnets."]}):n.jsxs("p",{children:["The tailnet ",n.jsx("strong",{children:i.domainName})," and ",L," will be deleted, and users will be removed from all external tailnets."," ",V," will also be removed from this tailnet."]}),n.jsx("p",{className:"mt-2 text-text-danger",children:"Warning: This action cannot be undone."}),E!==void 0&&!T&&n.jsx(Sse,{subscription:E}),n.jsx("h3",{className:"font-semibold mt-6 mb-2",children:"Confirmation"}),Z&&n.jsx(yr,{id:"delete-n-machines",className:"w-full mb-2",checked:F,onChange:z,label:n.jsxs(n.Fragment,{children:["Remove ",V]})}),U&&n.jsx(yr,{id:"delete-n-users",className:"w-full mb-2",checked:_,onChange:I,label:n.jsxs(n.Fragment,{children:["Delete ",L]})}),re&&n.jsx(yr,{id:"delete-tailnet",className:"w-full mb-2",checked:H,onChange:J,label:`Delete the ${i.domainName} tailnet`}),n.jsxs("p",{className:"mb-2 mt-2",children:["Enter the tailnet name (",n.jsx("strong",{children:i.domainName}),") to confirm."]}),n.jsx("div",{className:"flex mb-2",children:n.jsx(ln,{className:"w-full z-10",type:"text",id:"delete-user-name",autoComplete:"off",autoCorrect:"off",value:Y,onChange:P=>{const{value:q}=P.target;B(q)}})})]})})}function Sse(e){const{subscription:t}=e,r=t.readableProductID||"personal";let s;t.upcomingInvoice?.dueDate!==void 0&&(s=ws(new Date(t?.upcomingInvoice?.dueDate)));let a="subscription";return t.status==="trialing"&&(a="trial"),n.jsxs(n.Fragment,{children:[n.jsx("h3",{className:"font-semibold mt-6",children:"Billing"}),n.jsxs("p",{className:"mt-2",children:["Your ",n.jsxs("strong",{children:[Qs(r)," plan"]})," ",t?.status==="trialing"?"trial":"plan"," is"," ",s===void 0?"still active":n.jsxs(n.Fragment,{children:["set to renew on ",n.jsx("strong",{children:s})]}),". If you delete your tailnet, your ",a," will be cancelled immediately. You won’t be able to use the rest of your ",a,"."]}),t.readableProductID==="personal_pro"&&n.jsxs("p",{className:"text-text-muted mt-2",children:["Remember, you can always cancel your subscription and"," ",n.jsx("a",{href:"https://tailscale.com/pricing/",title:"Read what’s included in the free tier",target:"_blank",rel:"noreferrer",className:"link",children:"keep using the free tier"}),"."]})]})}function Po(e){const{title:t,id:r,description:s,kbLink:a,children:i,className:l,badge:u,badgeExtra:d,headerAction:m}=e;return n.jsxs("div",{className:l,id:r,children:[n.jsx("header",{children:n.jsxs("div",{className:"flex justify-between items-end",children:[n.jsxs("div",{className:"max-w-2xl",children:[n.jsxs("h3",{className:Et.sectionTitle,id:Au(t),children:[t,n.jsx(kse,{badge:u}),d]}),n.jsxs("p",{className:"mt-1",children:[s," ",a&&n.jsx(Ge,{kbTopic:t,url:a})]})]}),m&&n.jsx("div",{className:"shrink-0 ml-4",children:m})]})}),n.jsx("div",{className:"mt-4",children:i})]})}function $ce({children:e}){return n.jsx("div",{className:"border rounded-lg px-6 pb-6 divide-y flex flex-col gap-6 max-w-2xl bg-gray-50 dark:bg-gray-900",children:e})}function Hce(e){const{title:t,description:r,kbLink:s,children:a,...i}=e;return n.jsxs("div",{className:"pt-6",...i,children:[n.jsxs("header",{className:"max-w-2xl",children:[n.jsx("h4",{className:"font-medium",children:t}),n.jsxs("p",{className:"mt-2",children:[r," ",s&&n.jsx(Ge,{kbTopic:t,url:s})]})]}),n.jsx("div",{className:"mt-4",children:a})]})}const kse=ce.memo(function({badge:t}){return!t||t==="none"?null:typeof t!="string"?n.jsx("span",{className:"ml-2 -mt-1 inline-flex",children:t}):t==="beta"?n.jsx("span",{className:"ml-2 -mt-1 inline-flex",children:n.jsx(Qo,{})}):t==="alpha"?n.jsx("span",{className:"ml-2 -mt-1 inline-flex",children:n.jsx(k2,{})}):null});function Nse(){return n.jsx(Po,{title:"Public IP addresses for device posture",description:"Use the public IP address a device uses to connect to Tailscale as a Device Posture attribute.",className:"md:flex md:justify-between md:items-center",badge:n.jsx(We,{className:"ml-2 mr-1",variant:"status",color:"yellow",children:"Beta"}),badgeExtra:n.jsx(ly,{plan:"hybrid_standard"}),children:n.jsx(dn,{checked:!1,disabled:!0,sizeVariant:"large",onChange:()=>{}})})}function f8({enabled:e,fallback:t=null,children:r}){return e?r:t}function Ese(){return n.jsx(Po,{title:"Regional Routing",description:"Route traffic to the closest available subnet router or app connector region. Available on the Premium plan and above.",kbLink:"https://tailscale.com/kb/1264/regional-routing/",className:"@md:flex @md:justify-between @md:items-center",badge:n.jsx(ly,{plan:"hybrid_premium"}),children:n.jsx(dn,{checked:!1,disabled:!0,sizeVariant:"large",onChange:()=>{}})})}function Ase(){const{data:e,setTailnetSettings:t}=Rt(),{data:r}=vt(),{data:s}=ot(),a=I=>t({fileSharing:I},`File sharing ${I?"enabled":"disabled"}`),i=I=>t({servicesCollection:I},`Services collection ${I?"enabled":"disabled"}`),l=I=>t({devicePostureIPAddress:I},`Public IP addresses for device posture ${I?"enabled":"disabled"}`),u=I=>t({regionalRoutingOn:I},`Regional routing ${I?"enabled":"disabled"}`),{access:d}=qt(de.FeatureSettings),m=Sn(d),p=!s?.isAdmin&&!s?.isOwner,[g,v]=f.useState(!1),[y,C]=f.useState(e?.displayName||""),[b,w]=f.useState(null);f.useEffect(()=>{C(e?.displayName||"")},[e?.displayName]);const N=f.useMemo(()=>{if(y.trim()==="")return null;if(y.length>65)return"Display name must be 65 characters or less";const I=/^[a-zA-Z0-9' -]+$/g;return y!==s?.domainName&&!I.test(y)?"Name can only contain letters, numbers, spaces, apostrophes, and hyphens":null},[y,s?.domainName]);f.useEffect(()=>{w(null);const I=setTimeout(()=>{w(N)},700);return()=>clearTimeout(I)},[y,N]);const k=f.useCallback(I=>{I.preventDefault(),!(N||y.trim()==="")&&t({displayName:y},"Display name changed",{showBadRequestErrorServerMessage:!0,disableOptimisticUpdate:!0})},[t,y,N]),E=p||!!N||y.trim()===""||y===(e?.displayName||"")||y===(s?.domainName||""),T=f.useCallback(()=>{t({displayName:""},"Display name reset to default",{showBadRequestErrorServerMessage:!0,disableOptimisticUpdate:!0}),v(!1)},[t]),_=e?.displayName&&e.displayName!==s?.domainName;return n.jsxs("div",{className:"space-y-10",children:[n.jsxs("div",{children:[n.jsx(Po,{title:"Unique IDs",description:void 0,children:n.jsxs(at,{noPadding:!0,children:[n.jsxs("div",{className:"flex flex-col @md:flex-row p-4 gap-4 items-start",children:[n.jsxs("div",{className:"flex-1 min-w-[50%]",children:[n.jsx("h5",{className:"font-medium",children:"Tailnet ID"}),n.jsx("p",{className:"text-text-muted",children:"A unique ID to identify this tailnet in API calls."})]}),n.jsx(xn,{text:e?.stableTailnetID||"",className:"w-72",prompt:!1})]}),e?.shouldShowLegacyID&&n.jsxs("div",{className:"border-t flex flex-col @md:flex-row p-4 gap-4 items-start",children:[n.jsxs("div",{className:"flex-1 min-w-[50%]",children:[n.jsx("h5",{className:"font-medium",children:"Legacy ID"}),n.jsx("p",{className:"text-text-muted",children:"A unique ID used to identify this tailnet. While it can still be used for API calls, the Tailnet ID is now the preferred identifier."})]}),n.jsx(xn,{text:s?.domainName||"",className:"w-72",prompt:!1})]}),e?.stableOrgID&&n.jsxs("div",{className:"border-t flex flex-col @md:flex-row p-4 gap-4 items-start",children:[n.jsxs("div",{className:"flex-1 min-w-[50%]",children:[n.jsx("h5",{className:"font-medium",children:"Organization ID"}),n.jsx("p",{className:"text-text-muted",children:"A unique ID to identify this tailnet’s organization."})]}),n.jsx(xn,{text:e?.stableOrgID||"",className:"w-72",prompt:!1})]})]})}),n.jsxs(Po,{title:"Display",description:"Set a display name to easily recognize this tailnet.",className:"mt-10",children:[n.jsxs("div",{className:"",children:[n.jsx("form",{onSubmit:k,children:n.jsx(Br,{error:b,children:n.jsx(Ee,{content:p?"You do not have permission to edit this feature.":"",children:n.jsxs("div",{className:"flex items-center gap-2",children:[n.jsx(ln,{className:"w-1/2",type:"text",value:y,onChange:I=>C(I.target.value),name:"displayName",autoCapitalize:"off",autoComplete:"off",disabled:p,error:!!b,"aria-label":"tailnet-display-name-input"}),y!==(e?.displayName||"")&&n.jsx(ue,{type:"submit",disabled:E,children:"Save"})]})})})}),_&&n.jsx("div",{className:"mt-4",children:n.jsx(Ee,{content:p?"You do not have permission to edit this feature.":"",children:n.jsx(ue,{sizeVariant:"small",disabled:p,onClick:()=>v(!0),children:"Reset tailnet name…"})})})]}),n.jsx(Re,{open:g,onOpenChange:v,title:"Reset tailnet display name",children:n.jsxs(Re.Form,{cancelButton:!0,submitButton:"Reset to default",onSubmit:T,children:[n.jsxs("p",{children:["Are you sure you want to reset your tailnet display name back to"," ",n.jsx("strong",{children:s?.domainName||"default"}),"?"]}),n.jsx("p",{className:"mt-2 text-text-muted",children:"This will remove your custom display name and show the original name instead."})]})})]})]}),n.jsx(f8,{enabled:r.featureSeeGeoSteering&&!r.featureTrafficSteering,fallback:n.jsx(Ese,{}),children:n.jsx(Po,{title:"Regional Routing",description:"Route traffic to the closest available subnet router or app connector region. Available on the Premium plan and above.",kbLink:"https://tailscale.com/kb/1264/regional-routing/",className:"@md:flex @md:justify-between @md:items-center",children:n.jsx(Ee,{content:!m&&Ea,children:n.jsx(dn,{checked:e?.regionalRoutingOn||!1,onChange:u,sizeVariant:"large",disabled:e===void 0||!m})})})}),r.featureHTTPS&&n.jsx(ui,{className:"mt-12",title:"HTTPS",description:"Allow users to provision HTTPS certificates for their devices.",kbLink:"https://tailscale.com/kb/1153/enabling-https/",children:n.jsx(Vt,{to:"/admin/dns",children:"Manage"})}),n.jsx(h8,{}),n.jsxs("div",{children:[n.jsx("h2",{className:Et.pageSubTitle,id:"feature-previews",children:"Feature previews"}),n.jsxs("p",{className:"mt-3 mb-10",children:["Get early access to features. Feature previews are available for testing, but still in development. Please"," ",n.jsx(Zn,{type:"feedback",children:"share feedback"})," ","on how we could make them work better."]})]}),(r.featureBorder0MilestoneTwo||r.featureBorder0MilestoneThree)&&n.jsx(Tse,{readonly:!m}),n.jsx(ui,{title:"Mullvad VPN",description:"Allow users on your network to use Mullvad VPN endpoints as exit-nodes.",kbLink:"https://tailscale.com/kb/1258/mullvad-exit-nodes/",badge:"Beta",badgeExtra:n.jsxs(We,{className:"ml-2",variant:"status",color:"gray",children:[r.featureFreeMullvad&&n.jsxs(n.Fragment,{children:[n.jsx(yO,{className:"mr-1",size:"0.9em"}),"15 free devices"]}),!r.featureFreeMullvad&&n.jsxs(n.Fragment,{children:[n.jsx(Gx,{className:"mr-1",size:"0.9em"}),"Paid add-on"]})]}),children:n.jsx(Vt,{to:"/admin/settings/general/mullvad",children:"Configure"})}),n.jsx(ui,{title:"Send Files",description:`Allow users on your network to send files between their own devices using Taildrop, Tailscale’s built-in file sharing feature.`,kbLink:"https://tailscale.com/kb/1106/taildrop/",badge:"Alpha",children:n.jsx(Ee,{content:!m&&Ea,children:e&&n.jsx(dn,{checked:e.fileSharing||!1,onChange:a,sizeVariant:"large",disabled:!m})})}),n.jsx(ui,{title:"Services Collection",description:`Collect and display information about services running on your network in the admin panel.`,kbLink:"https://tailscale.com/kb/1100/services",badge:"Alpha",children:n.jsx(Ee,{content:!m&&Ea,children:e&&n.jsx(dn,{checked:e.servicesCollection||!1,onChange:i,sizeVariant:"large",disabled:!m})})}),r.featureIngress&&n.jsx(ui,{title:"Funnel",description:`Allow users on your network to route traffic from the wider internet to their Tailscale nodes.`,kbLink:"https://tailscale.com/kb/1223/tailscale-funnel",badge:"Beta",children:n.jsx(Vt,{to:"/admin/acls",children:"Manage"})}),n.jsx(f8,{enabled:r.featureSeeDevicePostureIPAddress||r.featureDevicePostureIPAddress,fallback:n.jsx(Nse,{}),children:n.jsx(ui,{title:"Public IP addresses for device posture",description:"Use the public IP address a device uses to connect to Tailscale as a Device Posture attribute. Note that this feature preview introduces personally identifiable information to Device Posture attributes.",badge:"Beta",children:n.jsx(Ee,{content:!m&&Ea,children:e&&n.jsx(dn,{checked:e.devicePostureIPAddress||!1,onChange:l,sizeVariant:"large",disabled:!m})})})}),n.jsx(h8,{}),n.jsx(Po,{title:"Delete tailnet",id:"delete-tailnet",description:"Permanently delete this tailnet. This action cannot be undone.",kbLink:"https://tailscale.com/kb/1237/delete-tailnet/",className:"mt-8",children:n.jsx(Pse,{})})]})}function h8(){return n.jsx("hr",{className:"border-t"})}function Pse(){const e=et(),[t,r]=f.useState(!1),[s,a]=f.useState(!1),{access:i}=qt(de.TailnetDeletion),l=Sn(i);!l&&t&&r(!1);const u=f.useCallback(d=>(a(!0),Ie.delete(`/public/tailnet/${encodeURIComponent(d)}`).then(()=>{a(!1),globalThis.location.href=vr(`/logout?next_url=${encodeURIComponent(gr?globalThis.location.origin+"/admin/deleted":"/deleted")}`)}).catch(m=>{a(!1);const p=m.response?.status===400?m.response.data.error:"Failed to delete tailnet. Try again later or contact support for help.";e.show({message:p,variant:"danger"})})),[e,a]);return n.jsxs(n.Fragment,{children:[l?n.jsx(ue,{intent:"danger",sizeVariant:"medium",onClick:()=>r(!0),children:"Delete tailnet…"}):n.jsx(rt,{className:"max-w-fit",children:n.jsxs("p",{children:["Only"," ",n.jsx(ze,{href:`/admin/users?q=${encodeURIComponent("role:owner")}`,className:"link",children:"the tailnet owner"})," ","can delete a tailnet."]})}),n.jsx(jse,{open:t,disabled:s,onSubmit:u,onOpenChange:r})]})}function ui(e){const{className:t,title:r,description:s,badge:a,badgeExtra:i,kbLink:l,onKbLinkClick:u,children:d}=e;return n.jsxs("div",{className:t,children:[n.jsxs("div",{className:"flex flex-row items-center",children:[n.jsx("h3",{className:Et.sectionTitle,id:Au(r),children:r}),n.jsxs("div",{children:[a&&n.jsx(We,{className:"ml-2",variant:"status",color:"yellow",children:a}),i]})]}),n.jsxs("div",{className:"@md:flex @md:flex-row @md:justify-between mt-2 mb-4",children:[n.jsxs("p",{className:"max-w-lg text-text-muted mb-4 @md:mb-0",children:[s," ",l&&n.jsx(Ge,{kbTopic:r,url:l,onClick:u})]}),n.jsx("div",{className:"ml-2",children:d})]})]})}function Tse({readonly:e}){const{data:t,isLoading:r,isEnabling:s,isReprovisioning:a,enable:i,reprovision:l}=oE(),u={productArea:K.Settings,productSubArea:oe.PAM};if(r)return n.jsx(De,{loadingMessage:"Loading Border0 provisioning settings..."});const d=t?.servicesMissingGrant??[],m=t?.servicesMissingGrantCount??d.length,p=t?.enabled&&(!t.hasTag||!t.hasServiceAutoApprove||d.length>0),g=t?.orgSubdomain,v=g&&`https://api.border0.com/api/v1/auth/oauth/login?org=${g}&redirectTo=admin-portal`;return n.jsxs("div",{children:[n.jsx(ui,{title:"Privileged Access Management by Border0",description:"Enable privileged access management powered by Border0 for secure, audited access to resources in your tailnet.",kbLink:"https://tailscale.com/docs/border0",onKbLinkClick:()=>O(R.PAMLearnMoreLinkClicked,{eventProperties:u}),badge:"Beta",children:s?n.jsx(ue,{loading:!0,disabled:!0,children:"Enable"}):t?.enabled?n.jsx(Vt,{href:v??"https://portal.border0.com",onClick:()=>O(R.PAMLaunchButtonClicked,{eventProperties:u}),children:"Launch Border0 Portal"}):n.jsx(Ee,{content:e?Ea:void 0,children:n.jsx(ue,{onClick:()=>{O(R.PAMEnableButtonClicked,{eventProperties:u}),i()},disabled:e,children:"Enable"})})}),t?.enabled&&t.authorizationMissing&&n.jsx(rt,{color:"warning",className:"mt-4",children:n.jsxs("div",{className:"@md:flex @md:flex-row @md:items-center @md:justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"font-medium",children:"Border0 can no longer connect to your tailnet"}),n.jsx("p",{className:"mt-1 text-sm",children:"Border0 can no longer connect to your tailnet because its authorization was revoked. Reconnect Border0 to restore the integration."})]}),n.jsx(Ee,{content:e?Ea:void 0,children:n.jsx(ue,{intent:"primary",onClick:()=>{O(R.PAMReconnectButtonClicked,{eventProperties:u}),l()},loading:a,disabled:e,className:"mt-3 @md:mt-0 @md:ml-4 flex-shrink-0",children:"Reconnect"})})]})}),p&&n.jsxs(rt,{color:"warning",className:"mt-4",children:[n.jsx("p",{className:"font-medium",children:"Setup incomplete"}),n.jsxs("ul",{className:"list-disc ml-4 mt-1 text-sm",children:[!t.hasTag&&n.jsxs("li",{children:["Add ",n.jsx("code",{className:"text-xs",children:"tag:border0-managed"})," to your policy file's ",n.jsx("code",{className:"text-xs",children:"tagOwners"})]}),!t.hasServiceAutoApprove&&n.jsxs("li",{children:["Enable auto approval for services with tag"," ",n.jsx("code",{className:"text-xs",children:"tag:border0-managed"})," in your policy file's"," ",n.jsx("code",{className:"text-xs",children:"autoApprovers"})]}),d.length>0&&n.jsxs("li",{children:["Add a grant so PAM resources are reachable over your tailnet. Set ",n.jsx("code",{className:"text-xs",children:"dst"})," to"," ",n.jsx("code",{className:"text-xs",children:"tag:border0-managed"})," to allow access to all of them, or scope"," ",n.jsx("code",{className:"text-xs",children:"dst"})," to individual services. See the"," ",n.jsx("a",{href:"https://tailscale.com/docs/border0/get-started#step-4-grant-network-access-in-your-tailnet-policy",target:"_blank",rel:"noreferrer",className:"link",children:"documentation"})," ","for details.",n.jsx("p",{className:"mt-1",children:m===1?"This service is not reachable yet:":"These services are not reachable yet:"}),n.jsxs("ul",{className:"list-disc ml-4 mt-1",children:[d.map(y=>n.jsx("li",{children:n.jsx("code",{className:"text-xs",children:y})},y)),m>d.length&&n.jsxs("li",{children:["and"," ",m-d.length," ","more"]})]})]})]})]})]})}function Ise(e,t){O(e,{eventProperties:{productArea:K.Settings,productSubArea:oe.TrustCredentials},trustCredentialsProperties:t})}function zce(e,t){O(e,{eventProperties:{productArea:K.Settings,productSubArea:oe.TrustCredentials},trustCredentialsProperties:t})}const Dse=ce.lazy(()=>$e(()=>import("./billing-view-router-BO-1d498.js"),[])),_se=ce.lazy(()=>$e(()=>import("./contact-preferences-view-DpYyBrRr.js"),[])),Mse=ce.lazy(()=>$e(()=>import("./device-management-view-DFye15Ac.js"),__vite__mapDeps([5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]))),Lse=ce.lazy(()=>$e(()=>import("./policy-file-management-view-DZXvl-HX.js"),[])),Rse=ce.lazy(()=>$e(()=>import("./domains-view-DevR-Xtz.js"),[])),Ose=ce.lazy(()=>$e(()=>import("./enable-tailnet-lock-BTqzddrX.js"),__vite__mapDeps([20,21,10,6]))),Fse=ce.lazy(()=>$e(()=>import("./mullvad-configure-view-29-EPzUg.js"),__vite__mapDeps([22,21]))),Bse=ce.lazy(()=>$e(()=>import("./keys-view-Q65EOKro.js"),[])),Use=ce.lazy(()=>$e(()=>import("./trust-credentials-view-CbVjqjvZ.js"),__vite__mapDeps([23,24,25]))),Vse=ce.lazy(()=>$e(()=>import("./user-management-view-D1L1nR1s.js"),__vite__mapDeps([26,27,28]))),$se=ce.lazy(()=>$e(()=>import("./switch-idp-view-xQfOIBPV.js"),__vite__mapDeps([29,28,30,11,12]))),Hse=ce.lazy(()=>$e(()=>import("./edit-idp-view-qCa9Xw8v.js"),__vite__mapDeps([31,28,11,12,30]))),zse=ce.lazy(()=>$e(()=>import("./webhooks-view-BGyRMCcI.js"),[])),Wse=ce.lazy(()=>$e(()=>import("./device-posture-integrations-selection-view-_0UbSYGr.js"),__vite__mapDeps([32,7,8,9,10,11,12,13,14,15,16,17,18,19]))),Kse=ce.lazy(()=>$e(()=>import("./device-posture-crowdstrike-view-D0uMNoPh.js"),__vite__mapDeps([8,9,10,11,12]))),Gse=ce.lazy(()=>$e(()=>import("./device-posture-fleet-view-B6qeZQoC.js"),__vite__mapDeps([13,9,10,11,12]))),qse=ce.lazy(()=>$e(()=>import("./device-posture-huntress-view-BF3BMM9j.js"),__vite__mapDeps([14,9,10,11,12]))),Yse=ce.lazy(()=>$e(()=>import("./device-posture-intune-view-KMzz2pd-.js"),__vite__mapDeps([15,9,10,11,12]))),Zse=ce.lazy(()=>$e(()=>import("./device-posture-jamf-view-DNoTqVFj.js"),__vite__mapDeps([16,9,10,11,12]))),Qse=ce.lazy(()=>$e(()=>import("./device-posture-kandji-view-Bh8z5plg.js"),__vite__mapDeps([17,9,10,11,12]))),Jse=ce.lazy(()=>$e(()=>import("./device-posture-kolide-view-CGVWcq-C.js"),__vite__mapDeps([18,9,10,11,12]))),Xse=ce.lazy(()=>$e(()=>import("./device-posture-sentinelone-view-CN6nJ_Pl.js"),__vite__mapDeps([19,9,10,11,12])));var Ke=(e=>(e.General="general",e.UserManagement="user-management",e.SwitchIDP="switch-idp",e.EditIDP="user-management/edit-idp",e.DeviceManagement="device-management",e.DevicePosture="device-management/posture",e.DevicePostureSetupCrowdStrike="posture-crowdstrike",e.DevicePostureSetupFleet="posture-fleet",e.DevicePostureSetupHuntress="posture-huntress",e.DevicePostureSetupIntune="posture-intune",e.DevicePostureSetupJamfPro="posture-jamfpro",e.DevicePostureSetupKandji="posture-kandji",e.DevicePostureSetupKolide="posture-kolide",e.DevicePostureSetupSentinelOne="posture-sentinelone",e.PolicyFileManagement="policy-file-management",e.Domains="domains",e.EnableTailnetLock="enable-tailnet-lock",e.Billing="billing",e.Keys="keys",e.Webhooks="webhooks",e.TrustCredentials="trust-credentials",e.ContactPreferences="contact-preferences",e.ConfigureMullvad="configure-mullvad",e))(Ke||{});function Gt(e){const{page:t,tab:r}=e,{data:s}=vt(),{data:a}=ot(),i=s.featureDomainClaim&&a?.sharedDomain===!1&&!a?.domainName.endsWith(".github"),l=rae(t),u=sae(t),d=globalThis.location.search,m=f.useCallback(()=>{u&&_F(u)},[u]);return n.jsxs(mn,{className:"@md:flex @md:mt-16 sidenav:mt-0",children:[n.jsx(eae,{className:"mb-10 @md:mr-20 @lg:mr-40",selectedPage:t,showDomainsSettings:i}),n.jsxs("div",{className:"flex-1",children:[l&&n.jsxs(ze,{className:"flex items-center font-small mb-4 text-text-muted hover:text-gray-700 dark:hover:text-gray-300",to:`/admin/settings/${l}${d}${u}`,onClick:m,children:["← Back to ",nl(l).toLowerCase()]}),n.jsxs("div",{className:D(Et.pageTitle,"flex items-center"),children:[n.jsx(is,{title:nl(t),classes:"mr-2"}),nae(t)]}),Bg(t)&&n.jsx("div",{className:"mt-2 mb-10",children:Bg(t)}),n.jsx("div",{className:Bg(t)?"mt-10":"mt-6",children:n.jsx(f.Suspense,{fallback:n.jsx(De,{}),children:aae(t,r,i)})})]})]})}function eae(e){const{className:t,selectedPage:r,showDomainsSettings:s}=e,[,a]=ft(),{data:i}=vt();return n.jsxs("div",{className:t,children:[n.jsxs("div",{className:"hidden @md:block",children:[n.jsxs("div",{className:"flex flex-row mb-10 text-lg",children:[n.jsx(dw,{className:"text-text-muted",size:20}),n.jsxs("div",{className:"ml-3",children:[n.jsx("h2",{className:"text-text-muted font-medium",children:"Tailnet Settings"}),n.jsx(hs,{page:"general",selectedPage:r}),n.jsx(hs,{permission:de.FeatureSettings,page:"user-management",selectedPage:r}),n.jsx(hs,{permission:de.FeatureSettings,page:"device-management",selectedPage:r}),n.jsx(hs,{permission:de.ACLs,page:"policy-file-management",selectedPage:r}),s&&n.jsx(hs,{permission:de.AccountSettings,page:"domains",selectedPage:r}),n.jsx(hs,{permission:de.TailnetKeys,page:"trust-credentials",selectedPage:r}),i.webhooks&&n.jsx(hs,{permission:de.Webhooks,page:"webhooks",selectedPage:r}),i.emailPreferences&&n.jsx(hs,{permission:de.AccountSettings,page:"contact-preferences",selectedPage:r}),!i.billingManagedExternally&&n.jsx(hs,{permission:de.Billing,page:"billing",selectedPage:r})]})]}),n.jsxs("div",{className:"flex flex-row mb-10 text-lg",children:[n.jsx(gw,{className:"text-text-muted",size:20}),n.jsxs("div",{className:"ml-3",children:[n.jsx("h2",{className:"text-text-muted font-medium",children:"Personal Settings"}),n.jsx(hs,{permission:de.Keys,page:"keys",selectedPage:r})]})]})]}),n.jsx("div",{className:"select-with-arrow @md:hidden mb-4",children:n.jsxs("select",{className:"select text-lg",value:r,onChange:({target:l})=>a(`/admin/settings/${l.value}`),children:[n.jsxs("optgroup",{label:"Tailnet Settings",children:[n.jsx(wa,{page:"general"}),n.jsx(wa,{permission:de.FeatureSettings,page:"user-management"}),n.jsx(wa,{permission:de.FeatureSettings,page:"device-management"}),n.jsx(wa,{permission:de.TailnetKeys,page:"trust-credentials"}),i.webhooks&&n.jsx(wa,{permission:de.TailnetKeys,page:"webhooks"}),i.emailPreferences&&n.jsx(wa,{permission:de.AccountSettings,page:"contact-preferences"}),!i.billingManagedExternally&&n.jsx(wa,{permission:de.Billing,page:"billing"})]}),n.jsx("optgroup",{label:"Personal Settings",children:n.jsx(wa,{permission:de.Keys,page:"keys"})})]})})]})}function hs(e){const{permission:t,page:r,selectedPage:s}=e,[a]=ft(),i=`/admin/settings/${r}`,l=r===s||a.startsWith(i),u=n.jsx(ze,{className:D("flex font-medium mt-3.5",{"text-text-primary":l,"text-text-base":!l}),to:`/admin/settings/${r}`,children:nl(r)});return t===void 0?u:n.jsx(Se,{permission:t,noAccess:()=>n.jsx(Ee,{content:Sw,children:n.jsx("div",{className:"cursor-not-allowed flex font-medium mt-3 text-text-disabled",children:nl(r)})}),readWrite:()=>u})}function wa(e){const{permission:t,page:r}=e;return t===void 0?n.jsx("option",{value:r,children:nl(r)}):n.jsx(tae,{permission:t,page:r})}function tae(e){const{access:t}=qt(e.permission);return n.jsx("option",{value:e.page,disabled:!t||!Ho(t),children:nl(e.page)})}function nl(e){switch(e){case"billing":return"Billing";case"keys":return"Keys";case"general":return"General";case"user-management":return"User management";case"device-management":return"Device management";case"policy-file-management":return"Policy file management";case"domains":return"Domains";case"device-management/posture":return"Add a device posture integration";case"posture-crowdstrike":return"CrowdStrike Falcon Integration";case"posture-fleet":return"Fleet Integration";case"posture-huntress":return"Huntress Integration";case"posture-intune":return"Microsoft Intune Integration";case"posture-jamfpro":return"Jamf Pro Integration";case"posture-kandji":return"Kandji Integration";case"posture-kolide":return"1Password XAM (Kolide) Integration";case"posture-sentinelone":return"SentinelOne Integration";case"webhooks":return"Webhooks";case"trust-credentials":return"Trust credentials";case"contact-preferences":return"Contact preferences";case"enable-tailnet-lock":return"Enable Tailnet Lock";case"configure-mullvad":return"Configure Mullvad VPN";case"switch-idp":return"Switch identity provider";case"user-management/edit-idp":return"Edit details"}}function nae(e){switch(e){case"device-management/posture":return n.jsx(ly,{plan:"hybrid_standard"});case"switch-idp":return n.jsx(Qo,{});case"user-management/edit-idp":return n.jsx(Qo,{});default:return null}}function Bg(e){switch(e){case"billing":return n.jsx("p",{children:"View and manage your billing plan."});case"general":return n.jsx("p",{children:"Manage your tailnet account settings."});case"policy-file-management":return n.jsx("p",{children:"Manage how your policy file is maintained."});case"domains":return n.jsx("p",{children:"Manage domains in your network."});case"user-management":return n.jsx("p",{children:"Manage your tailnet user settings."});case"device-management":return n.jsx("p",{children:"Manage your tailnet device settings."});case"device-management/posture":return n.jsxs(n.Fragment,{children:["Device posture integrations synchronize data from third-party systems, which can be used as device attributes in your policy file."," ",n.jsx(Ge,{kbTopic:"Device posture",url:"https://tailscale.com/kb/1288/device-posture#edr-and-mdm-integrations"})]});case"posture-crowdstrike":return n.jsxs(n.Fragment,{children:["Configure a CrowdStrike Falcon integration to use Zero Trust Assessment score as part of device posture management in Tailscale."," ",n.jsx(Ge,{kbTopic:"Use CrowdStrike ZTA scores to restrict device access",url:"https://tailscale.com/kb/1289/crowdstrike-zta/"})]});case"posture-fleet":return n.jsxs(n.Fragment,{children:["Configure a Fleet integration to use device attributes from Fleet as part of your Tailscale access policy."," ",n.jsx(Ge,{kbTopic:"Use Fleet to restrict device access",url:"https://tailscale.com/kb/1653/fleet"})]});case"posture-huntress":return n.jsxs(n.Fragment,{children:["Configure a Huntress integration to use device attributes from Huntress as part of your Tailscale access policy."," ",n.jsx(Ge,{kbTopic:"Use Huntress to restrict device access",url:"https://tailscale.com/kb/1652/huntress"})]});case"posture-intune":return n.jsxs(n.Fragment,{children:["Configure a Microsoft Intune integration to use device attributes from Intune as part of your Tailscale access policy."," ",n.jsx(Ge,{kbTopic:"Use Intune to restrict device access",url:"https://tailscale.com/kb/1410/intune/"})]});case"posture-jamfpro":return n.jsxs(n.Fragment,{children:["Configure a Jamf Pro integration to use device attributes from Jamf as part of your Tailscale access policy."," ",n.jsx(Ge,{kbTopic:"Use Jamf Pro to restrict device access",url:"https://tailscale.com/kb/1409/jamf-pro/"})]});case"posture-kandji":return n.jsxs(n.Fragment,{children:["Configure a Kandji integration to use device attributes from Kandji as part of your Tailscale access policy."," ",n.jsx(Ge,{kbTopic:"Use Kandji to restrict device access",url:"https://tailscale.com/kb/1405/kandji/"})]});case"posture-kolide":return n.jsxs(n.Fragment,{children:["Configure a 1Password XAM (Kolide) integration to use device attributes from XAM as part of your Tailscale access policy."," ",n.jsx(Ge,{kbTopic:"Use Kolide to restrict device access",url:"https://tailscale.com/kb/1407/kolide/"})]});case"posture-sentinelone":return n.jsxs(n.Fragment,{children:["Configure a SentinelOne integration to use device attributes from SentinelOne as part of your Tailscale access policy."," ",n.jsx(Ge,{kbTopic:"Use SentinelOne to restrict device access",url:"https://tailscale.com/kb/1390/sentinelone/"})]});case"enable-tailnet-lock":return n.jsxs("p",{children:["Tailnet Lock lets you cryptographically verify that no node is added to your tailnet without being signed by other trusted nodes."," ",n.jsx(Ge,{kbTopic:"Tailnet Lock",url:"https://tailscale.com/kb/1226/tailnet-lock/"})]});case"keys":return n.jsxs(n.Fragment,{children:[n.jsx("p",{children:"View and manage your Auth keys and API access tokens."}),n.jsxs("p",{className:"mt-2",children:["Your private device keys are not included here: they are always private, stay on your device, and are never shared with Tailscale."," ",n.jsx(Ge,{kbTopic:"managing Auth key and API access tokens",url:"https://tailscale.com/blog/tailscale-key-management/"})]})]});case"webhooks":return n.jsxs("p",{children:["Get notified of changes and misconfigurations in your tailnet."," ",n.jsx(Ge,{kbTopic:"webhooks",url:"https://tailscale.com/kb/1213/webhooks/"})]});case"trust-credentials":return n.jsxs("p",{children:["Provide fine grained access to the Tailscale API using OAuth or OIDC tokens."," ",n.jsx(Ge,{kbTopic:"trust credentials",url:"https://tailscale.com/kb/1623/trust-credentials",onClick:()=>Ise(R.TrustCredentials.LearnMoreClicked)})]});case"contact-preferences":return n.jsxs("p",{children:["Define points of contact for different kinds of transactional emails. We will only use these to send essential communications related to the functioning of your tailnet, not marketing-related content. As such, you can’t opt out, and all emails must be verified."," ",n.jsx(Ge,{kbTopic:"contact preferences",url:"https://tailscale.com/kb/1224/contact-preferences/"})]});case"configure-mullvad":return n.jsxs("p",{children:["Configure Mullvad VPN endpoints as exit nodes for certain devices in your tailnet."," ",n.jsx(Ge,{kbTopic:"Mullvad exit nodes",url:"https://tailscale.com/kb/1258/mullvad-exit-nodes"})]});case"switch-idp":return null;case"user-management/edit-idp":return n.jsx("p",{})}}function rae(e){switch(e){case"general":case"device-management":case"policy-file-management":case"domains":case"billing":case"contact-preferences":case"keys":case"trust-credentials":case"user-management":case"webhooks":return null;case"configure-mullvad":return"general";case"device-management/posture":case"enable-tailnet-lock":return"device-management";case"posture-crowdstrike":case"posture-fleet":case"posture-huntress":case"posture-intune":case"posture-jamfpro":case"posture-kandji":case"posture-kolide":case"posture-sentinelone":return"device-management/posture";case"switch-idp":case"user-management/edit-idp":return"user-management"}}function sae(e){return e==="device-management/posture"?"#posture-integrations":""}function aae(e,t,r){switch(e){case"billing":return n.jsx(Se,{permission:de.Billing,noAccess:Ne,readWrite:s=>n.jsx(Dse,{tab:t,...s})});case"general":return n.jsx(Ase,{});case"user-management":return n.jsx(Se,{permission:de.FeatureSettings,noAccess:Ne,readWrite:Vse});case"switch-idp":return n.jsx(Se,{permission:de.FeatureSettings,noAccess:Ne,readWrite:$se});case"user-management/edit-idp":return n.jsx(Se,{permission:de.FeatureSettings,noAccess:Ne,readWrite:Hse});case"policy-file-management":return n.jsx(Se,{permission:de.ACLs,noAccess:Ne,readWrite:Lse});case"domains":return r?n.jsx(Se,{permission:de.AccountSettings,noAccess:Ne,readWrite:Rse}):n.jsx(Ne,{});case"device-management":return n.jsx(Se,{permission:de.FeatureSettings,noAccess:Ne,readWrite:Mse});case"device-management/posture":return n.jsx(Se,{permission:de.FeatureSettings,noAccess:Ne,readWrite:Wse});case"posture-crowdstrike":return n.jsx(Se,{permission:de.FeatureSettings,noAccess:Ne,readWrite:Kse});case"posture-fleet":return n.jsx(Se,{permission:de.FeatureSettings,noAccess:Ne,readWrite:Gse});case"posture-huntress":return n.jsx(Se,{permission:de.FeatureSettings,noAccess:Ne,readWrite:qse});case"posture-intune":return n.jsx(Se,{permission:de.FeatureSettings,noAccess:Ne,readWrite:Yse});case"posture-jamfpro":return n.jsx(Se,{permission:de.FeatureSettings,noAccess:Ne,readWrite:Zse});case"posture-kandji":return n.jsx(Se,{permission:de.FeatureSettings,noAccess:Ne,readWrite:Qse});case"posture-kolide":return n.jsx(Se,{permission:de.FeatureSettings,noAccess:Ne,readWrite:Jse});case"posture-sentinelone":return n.jsx(Se,{permission:de.FeatureSettings,noAccess:Ne,readWrite:Xse});case"enable-tailnet-lock":return n.jsx(Se,{permission:de.FeatureSettings,noAccess:Ne,readWrite:Ose});case"keys":return n.jsx(Se,{permission:de.Keys,noAccess:Ne,readWrite:Bse});case"webhooks":return n.jsx(Se,{permission:de.TailnetKeys,noAccess:Ne,readWrite:zse});case"trust-credentials":return n.jsx(Se,{permission:de.TailnetKeys,noAccess:Ne,readWrite:Use});case"contact-preferences":return n.jsx(Se,{permission:de.AccountSettings,noAccess:Ne,readWrite:_se});case"configure-mullvad":return n.jsx(Se,{permission:de.FeatureSettings,noAccess:Ne,readWrite:Fse})}}function iae(e){const{open:t,onOpenChange:r}=e;return n.jsx(Re,{open:t,onOpenChange:r,title:"Cannot restore user",children:n.jsx(Re.Form,{disabled:!0,submitButton:!1,cancelButton:"Close",children:"You cannot restore this suspended user because all your seats are occupied. Delete or suspend another user to restore this one."})})}function oae(e){return n.jsx(Ee,{content:"Users become idle when it’s been 7 days since they last signed in or had an active device running Tailscale.",children:n.jsxs(We,{className:e.className,variant:"tag",color:"gray",children:[n.jsx(jF,{className:"mr-1",size:"0.9em"}),"Idle"]})})}function kf(e){switch(e){case"admin":return"Admin";case"network-admin":return"Network admin";case"it-admin":return"IT admin";case"auditor":return"Auditor";case"billing-admin":return"Billing admin";case"device-admin":return"Device admin";case"member":return"Member"}}function cy(){const{data:e}=vt();return f.useMemo(()=>{const t=["member","admin"];return e.featureAllUserRoles&&t.push("billing-admin","it-admin","auditor","network-admin"),e.featureAllUserRoles&&e.deviceAdminRole&&t.push("device-admin"),t},[e?.featureAllUserRoles,e?.deviceAdminRole])}function Ah(){const e=et(),[t,r]=f.useState(!1);function s(u){return r(!0),Ie.post("/public/tailnet/-/user-invites",u).then(d=>(r(!1),d.data.data)).catch(d=>{throw r(!1),d})}function a(u,d){return s(u).then(m=>(m.length===1&&!m[0].email&&m[0].inviteUrl?Rr(m[0].inviteUrl).then(()=>e.show(lae)).catch(()=>e.show(cae)):e.show(uae(m.length,d)),m)).catch(m=>{throw e.show(dae(u.length,d)),m})}function i(u){return r(!0),Ie.post(`/public/user-invites/${encodeURIComponent(u)}/resend`).then(()=>{r(!1),e.show(mae)}).catch(d=>{throw r(!1),e.show(fae),d})}function l(u){return r(!0),Ie.delete(`/public/user-invites/${encodeURIComponent(u)}`).then(()=>{r(!1),e.show(hae)}).catch(d=>{throw r(!1),e.show(pae),d})}return{postUserInvites:s,postUserInvitesWithToast:a,resendUserInvite:i,deleteUserInvite:l,posting:t}}const lae={message:"Invite created and copied to clipboard"},cae={message:"Invite created, but failed to copy to clipboard.",variant:"danger"},uae=(e,t)=>({message:t?`${e} ${yt("invite",e)} sent. ${t} ${yt("invite",t)} ignored because recipient is already invited or present.`:`${yt("Invite",e)} sent`}),dae=(e,t)=>({variant:"danger",message:`Failed to send ${yt("invite",e+t)}`}),mae={message:"Resent invite"},fae={variant:"danger",message:"Failed to resend invite"},hae={message:"Deleted invite"},pae={variant:"danger",message:"Failed to delete invite"},gae="Invites can only be sent to valid email addresses.",xae=e=>`Invites can only be sent to valid @${e} email addresses.`,vae="All recipients have already been invited or are already present.";function XA(e){const t=cy();return n.jsx(Pe,{asChild:!0,onOpenChange:e.onOpenChange,trigger:n.jsx(ue,{className:"flex items-center gap-2",suffixIcon:n.jsx(vw,{}),children:kf(e.role)}),side:"bottom",align:"center",children:n.jsx(Pe.RadioGroup,{value:e.role,onValueChange:r=>e.onRoleChange(r),children:t.map(r=>n.jsx(Pe.RadioItem,{value:r,children:kf(r)},r))})})}const eP=f.createContext({swrOptions:{...ww,revalidateOnFocus:!0},setDisableRevalidateOnFocus:()=>{}}),uy=()=>{const e=f.useContext(eP);if(!e)throw new Error("useDynamicSwrConfig must be used within a SWRDynamicConfigProvider");return e},yae=({children:e})=>{const[t,r]=f.useState(!1),s=f.useMemo(()=>({...ww,revalidateOnFocus:!t}),[t]),a=f.useMemo(()=>({swrOptions:s,setDisableRevalidateOnFocus:r}),[s,r]);return n.jsx(eP.Provider,{value:a,children:n.jsx(sD,{value:s,children:e})})};function Ph({className:e}){const{loaded:t,billingUsage:r,currentHybridPlanSeatCount:s,data:a}=Nt(),{shouldUseHybridEligibleUI:i,isLoading:l}=bl();if(!t||l||!i||a?.readableProductID==="enterprise_trial"||v2(a?.readableProductID))return null;const d=fl(a?.readableProductID||"personal"),m=r?.usage.occupied_seats||Pu,v=(d?Xf("personal"):s===0?1:s)-m,y=bae(d,v),C=wae(d,v);return n.jsxs(rt,{intent:"info",className:e,icon:d?!1:n.jsx(pF,{}),title:y,titleSuffix:n.jsx(Cae,{occupiedSeats:m,vacantSeats:v,isPersonal:d}),children:[n.jsx("p",{children:C}),n.jsx("a",{className:"link",href:"https://tailscale.com/pricing#what-is-seat-based-pricing-and-how-does-it-work",target:"_blank",rel:"noopener noreferrer",title:"Learn more about seat-based pricing","aria-label":"Learn more about seat-based pricing",onClick:()=>O(R.LearnMoreSeatsClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}}),children:"Learn more about seats"})]})}function bae(e,t){const r=t===0,s=t===1;return r?e?"No available seats":"Additional seat cost":e?s?"Last available seat":"Available seats":`${t} Available seats`}function Cae({isPersonal:e,occupiedSeats:t,vacantSeats:r}){const s=t+r;return e?n.jsx("div",{className:"flex gap-1 items-center",children:Array.from({length:s},(a,i)=>{if(!(i{O(R.InviteExternalUserRoleSelected,{userInviteProperties:{toBeAssignedRole:v},eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}}),m(v)};return n.jsx(Re,{trigger:t,open:r,onOpenChange:v=>{m("member"),s(v),u(v),v?O(R.InviteExternalUserDialogOpened,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}}):O(R.InviteExternalUserDialogClosed,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})},title:"Invite external user",children:n.jsxs("div",{className:"flex flex-col gap-5",children:[n.jsxs("p",{children:["Invite users to join this tailnet and access its machines, as allowed by ACLs. If you only want to give a user access to one machine, share the machine instead."," ",n.jsx(Ge,{kbTopic:"Inviting users vs sharing a device",url:"https://tailscale.com/kb/1388/inviting-vs-sharing",onClick:()=>{O(R.InviteExternalUserDocsLinkClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})}})]}),n.jsx(Ph,{}),n.jsx(Tu,{onChange:v=>{O(R.InviteExternalUserTabSelected,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog,type:v}})},tabs:[{id:"copy",label:"Copy invite link",content:n.jsx(jae,{role:d,onRoleChange:g,onRoleDropdownOpenChange:v=>{v&&O(R.InviteExternalUserRoleDropdownClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})},onSubmit:()=>{O(R.InviteExternalUserCopyLinkButtonClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}}),i([{role:d}],0).then(p)},posting:l}),icon:n.jsx(cu,{})},{id:"email",label:"Invite via email",content:n.jsx(tP,{role:d,onRoleChange:g,onRoleDropdownOpenChange:v=>{v&&O(R.InviteExternalUserRoleDropdownClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})},onInputBlur:()=>{O(R.InviteExternalUserEmailInputBlurred,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})},users:e.users,posting:l,submitButton:"Invite",footerClassName:"!justify-start !mt-4",onPostInvites:(v,y)=>(O(R.InviteExternalUserSendInviteButtonClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}}),i(v.map(C=>({email:C,role:d})),y).then(p))}),icon:n.jsx(uu,{})}]})]})})}function tP({users:e,role:t,onRoleChange:r,onPostInvites:s,restrictToDomains:a,posting:i,onRoleDropdownOpenChange:l,onInputBlur:u,...d}){const[m,p]=f.useState([]),[g,v]=f.useState(""),y=f.useCallback(()=>{const C=m.filter(b=>!e.some(w=>w.loginName===b||w.inviteEmail===b));C.length===0?v(vae):s(C,m.length-C.length)},[m,s,e]);return n.jsx(Re.Form,{...d,onSubmit:y,disabled:m.length===0||g!=="",loading:i,autoFocus:"submit",children:n.jsx(Br,{help:"You can use commas to separate multiple email recipients.",error:g,children:n.jsxs("div",{className:"flex gap-2",children:[n.jsx(TE,{autoFocus:!0,placeholder:"user@example.com",className:"w-full",restrictToDomains:a,onBlur:u,setEmails:f.useCallback((C,b)=>{p(C),v(b.length>0?a?xae(a[0]):gae:"")},[p,v,a])}),n.jsx(XA,{role:t,onRoleChange:r,onOpenChange:l})]})})})}function jae({role:e,onRoleChange:t,onRoleDropdownOpenChange:r,onSubmit:s,posting:a}){return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex gap-5 justify-between",children:[n.jsxs("dl",{children:[n.jsx("dt",{className:"font-medium",children:"Select role"}),n.jsx("dd",{className:"text-text-muted",children:"Signing up via the link will grant this role."})]}),n.jsx(XA,{role:e,onRoleChange:t,onOpenChange:r})]}),n.jsx(ue,{intent:"primary",sizeVariant:"medium",className:"mt-4",loading:a,onClick:s,children:"Copy invite link"})]})}function Wi(){const{data:e}=vt(),{data:t,error:r,mutate:s}=dt(e.provisioningSupported?"/public/tailnet/-/provisioning":null),[a,i]=f.useState(null),[l,u]=f.useState(!1),d=et(),m=f.useCallback(async()=>(u(!0),await new Promise(C=>{setTimeout(C,500)}),Ie.post("/public/tailnet/-/provisioning").then(C=>{const b=C.data.data;u(!1),i(b),s(w=>{if(w===void 0)return w;const k=[...w.syncDetails.keys??[],{id:b.id,created:b.created}];return{...w,provisioningEnabled:!0,syncDetails:{...w.syncDetails,keys:k}}},!1)}).catch(C=>{let b=C.message;C.response?.data?.error==="provisioning can’t be enabled"&&(b="Provisioning can’t be enabled, there are pending users."),u(!1),d.show({message:b,variant:"danger"})})),[s,d]),p=f.useCallback(()=>{i(null)},[]),g=f.useCallback(async C=>(s(b=>{if(b===void 0)return b;const w=b.syncDetails.keys?.filter(N=>N.id!==C);return{...b,syncDetails:{...b.syncDetails,keys:w}}},!1),Ie.delete(`/public/tailnet/-/provisioning/${C}`).then(()=>s()).catch(b=>d.show({message:b.message,variant:"danger"}))),[s,d]),v=f.useCallback(async()=>(s(C=>C&&{...C,provisioningEnabled:!1,syncDetails:{}},!1),Ie.delete("/public/tailnet/-/provisioning/all").then(()=>s()).catch(C=>d.show({message:C.message,variant:"danger"}))),[s,d]),y=t?.provisioningEnabled&&(t.syncDetails.keys||[]).length<2;return{data:t,error:r,mutate:s,fullKey:a,createKey:m,isCreating:l,revokeKey:g,clearFullKey:p,disableProvisioning:v,canGenerateNewKeys:y}}function nP(e,t=[]){f.useEffect(()=>{e.current&&e.current.focus()},t)}var oi={},pc={},p8;function rP(){if(p8)return pc;p8=1,Object.defineProperty(pc,"__esModule",{value:!0}),pc.isEmail=void 0;const e={requireTld:!0,allowUnderscores:!1,allowTrailingDot:!1},t={allowDisplayName:!1,requireDisplayName:!1,allowUtf8LocalPart:!0,requireTld:!0},r=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\,\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF\s]*<(.+)>$/i,s=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,a=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,i=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,l=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i;function u(p,g){let v=0,y;const C=encodeURI(p).split(/%..|./).length-1;return g&&(v=Number(g.min)||0,y=Number(g.max)),C>=v&&(typeof y>"u"||C<=y)}function d(p,g){g=Object.assign(Object.assign({},e),g),g.allowTrailingDot&&p[p.length-1]==="."&&(p=p.substring(0,p.length-1));const v=p.split(".");if(g.requireTld){const y=""+v.pop();if(!v.length||!/^([a-z\u00a1-\uffff]{2,}|xn[a-z0-9-]{2,})$/i.test(y)||/[\s\u2002-\u200B\u202F\u205F\u3000\uFEFF\uDB40\uDC20]/.test(y))return!1}for(let y,C=0;Cs(this,void 0,void 0,function*(){var st,mt;const At=[];let Qe="";const lt=new RegExp(k,"g"),wt=H||l.isEmail,Mt=_t=>{if(!N){for(let pt=0,vn=Q.length;ptvn))];for(;pt.length;){const vn=wt(""+pt[0].trim());if(typeof vn=="boolean")if(vn)Mt(""+((st=pt.shift())===null||st===void 0?void 0:st.trim()));else if(b)if(wt(""+pt[0].trim(),{allowDisplayName:b})){const An=w?(mt=pt.shift())===null||mt===void 0?void 0:mt.split("<")[1].split(">")[0]:pt.shift();Mt(""+An)}else pt.length===1?Qe=""+pt.shift():pt.shift();else Qe=""+pt.shift();else se(!0),(yield H?.(xe))===!0?(Mt(""+pt.shift()),se(!1)):pt.length===1?Qe=""+pt.shift():pt.shift()}}else{if(F&&!F({emailCnt:Q.length})){z?.();return}if(Fe){const _t=wt(xe);if(typeof _t=="boolean")if(_t)Mt(xe);else if(b)if(wt(xe,{allowDisplayName:b})){const vn=w?xe.split("<")[1].split(">")[0]:xe;Mt(vn)}else Qe=xe;else Qe=xe;else se(!0),(yield H?.(xe))===!0?Mt(xe):Qe=xe,se(!1)}else Qe=xe}ae([...Q,...At]),fe(Qe),At.length&&J?.([...Q,...At]),L!==Qe&&Y?.(Qe)}),[b,N,k,Q,F,L,J,Y,z,w,H]),Ae=i.useCallback(xe=>s(this,void 0,void 0,function*(){yield le(xe)}),[le]),Te=i.useCallback((xe,Fe)=>{if(Fe)return;const st=[...Q.slice(0,xe),...Q.slice(xe+1)];ae(st),J?.(st)},[Q,J]),Ue=i.useCallback(xe=>{switch(U?.(xe),xe.key){case"Enter":xe.preventDefault();break;case"Backspace":xe.currentTarget.value||Te(Q.length-1,!1);break}},[Q.length,U,Te]),Ze=i.useCallback(xe=>s(this,void 0,void 0,function*(){Z?.(xe),xe.key==="Enter"&&(yield le(xe.currentTarget.value,!0))}),[le,Z]),ct=i.useCallback(xe=>s(this,void 0,void 0,function*(){return yield Ae(xe.currentTarget.value)}),[Ae]),ht=i.useCallback(xe=>s(this,void 0,void 0,function*(){q(!1),me||(yield le(xe.currentTarget.value,!0)),W?.()}),[me,le,W]),Tt=i.useCallback(()=>{q(!0),B?.()},[B]);return i.useEffect(()=>{fe(E)},[E]),i.useEffect(()=>{fe(L??"")},[L]),i.useEffect(()=>{var xe;if(H)s(this,void 0,void 0,function*(){var Fe,st,mt,At,Qe;se(!0);const lt=[];try{for(var wt=!0,Mt=a((Qe=d.emails)!==null&&Qe!==void 0?Qe:[]),_t;_t=yield Mt.next(),Fe=_t.done,!Fe;){At=_t.value,wt=!1;try{const pt=At;(yield H(pt))&<.push(pt)}finally{wt=!0}}}catch(pt){st={error:pt}}finally{try{!wt&&!Fe&&(mt=Mt.return)&&(yield mt.call(Mt))}finally{if(st)throw st.error}}ae(lt),se(!1)});else{const Fe=(xe=d.emails)===null||xe===void 0?void 0:xe.filter(st=>(0,l.isEmail)(st));ae(Fe??[])}},[d.emails,H]),i.createElement("div",{className:`${g} ${v?"":"react-multi-email"} ${P?"focused":""} ${X===""&&Q.length===0?"empty":"fill"}`,style:p,onClick:()=>{var xe;return(xe=V.current)===null||xe===void 0?void 0:xe.focus()}},he&&re?.(),y?i.createElement("span",{"data-placeholder":!0},y):null,i.createElement("div",{className:"data-labels",style:{opacity:he?.45:1,display:"contents",flexWrap:"inherit"}},Q.map((xe,Fe)=>I(xe,Fe,Te))),i.createElement("input",{id:m,style:{opacity:he?.45:1},ref:V,type:"text",value:X,onFocus:Tt,onBlur:ht,onChange:ct,onKeyDown:Ue,onKeyUp:Ze,autoFocus:C,className:T,autoComplete:_}))}return Hn.ReactMultiEmail=u,Hn}var x8;function kae(){return x8||(x8=1,(function(e){var t=oi&&oi.__createBinding||(Object.create?(function(s,a,i,l){l===void 0&&(l=i);var u=Object.getOwnPropertyDescriptor(a,i);(!u||("get"in u?!a.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return a[i]}}),Object.defineProperty(s,l,u)}):(function(s,a,i,l){l===void 0&&(l=i),s[l]=a[i]})),r=oi&&oi.__exportStar||function(s,a){for(var i in s)i!=="default"&&!Object.prototype.hasOwnProperty.call(a,i)&&t(a,s,i)};Object.defineProperty(e,"__esModule",{value:!0}),r(rP(),e),r(Sae(),e)})(oi)),oi}var Nae=kae();const Eae=["relative appearance-none rounded-md bg-bg-base border border-border-interactive","py-3 px-3 flex flex-wrap items-center content-start gap-2 w-full overflow-auto","hover:border-border-interactive-hover transition-colors","focus-within:outline focus-within:outline-2 focus-within:outline-outline-focus focus-within:border-border-focus outline-offset-0","[&>span[data-placeholder]]:text-sm [&>span[data-placeholder]]:text-text-disabled [&>span[data-placeholder]]:absolute [&>span[data-placeholder]]:left-3 [&>span[data-placeholder]]:top-4 [&>span[data-placeholder]]:leading-tight [&>span[data-placeholder]]:pointer-events-none [&>span[data-placeholder]]:hidden","[&.empty>span[data-placeholder]]:inline [&.fill>span[data-placeholder]]:hidden"],Aae=["flex-1 outline-none border-0 bg-transparent","text-sm leading-tight text-text-base","py-1 px-0 min-w-[6rem]"];function sP({emails:e,onChange:t,placeholder:r,ariaLabel:s,className:a,getChip:i,readOnly:l=!1,disabled:u=!1,validateEmail:d}){const m=e.length===0,p=l||u,g=D(...Eae,{empty:m,fill:!m},{"hover:border-border-interactive cursor-not-allowed":l||u,"bg-gray-0 dark:bg-gray-800":u},a),v=ce.useCallback((y,C,b)=>n.jsx(xl,{onRemove:p?void 0:()=>b(C),readOnly:p,children:y},`${y}-${C}`),[p]);return n.jsx(Nae.ReactMultiEmail,{emails:e,onChange:p?void 0:t,getLabel:i||v,placeholder:r,noClass:!0,className:g,inputClassName:D(...Aae,{"hidden pointer-events-none":p}),validateEmail:d,"aria-label":s,"aria-readonly":l,"aria-disabled":u})}function my({open:e,onOpenChange:t,trigger:r}){const{setDisableRevalidateOnFocus:s}=uy(),a=i=>{t(i),s(i),i||O(R.InviteYourTeamDialogClosed,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})};return f.useEffect(()=>{e&&O(R.InviteYourTeamDialogOpened,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})},[e]),n.jsx(Re,{trigger:r,open:e,onOpenChange:a,title:"Invite your team",children:n.jsx(Pae,{onOpenChange:a})})}function Pae({onOpenChange:e}){const{data:t}=vt(),{data:r}=ot(),s=r?.domainName||"";return t.featureCanSendEmail?qs(s)?n.jsx(Dae,{onOpenChange:e}):n.jsx(_ae,{onOpenChange:e}):n.jsx(Tae,{onOpenChange:e})}function Tae({onOpenChange:e}){const{data:t}=ot(),{data:r}=Wi(),s=r?.provisioningEnabled,a=t?.domainName||"",l=`${t?.loginName||""} is using Tailscale to securely connect our devices in a virtual private network. Install Tailscale on your device, then sign in with your ${Uae(a)} account to join our network. https://www.tailscale.com/download`;return n.jsxs(Ih,{children:[s?n.jsx(Iae,{}):n.jsx("p",{children:"Your team will need to download one of the Tailscale apps onto their devices to join the network."}),n.jsx(Ph,{}),n.jsx(aP,{template:l}),n.jsx(Th,{onOpenChange:e})]})}function Iae(){const{data:e}=Wi(),{data:t}=ot(),{provider:r,syncDetails:s}=e||{},a=t?.domainName||"",i=s?.providerGroupsUrl?n.jsxs("a",{href:s.providerGroupsUrl,className:"link",target:"_blank",rel:"noopener noreferrer",onClick:()=>{O(R.InviteYourTeamAdminConsoleLinkClicked,{userInviteProperties:{provider:r},eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})},children:[r," admin console"]}):n.jsxs(n.Fragment,{children:[r," admin console"]});return n.jsxs("p",{children:["Add users from the ",i,". Once added, your team members must download Tailscale and sign in with their"," ",qs(a)?n.jsxs(n.Fragment,{children:[n.jsx(or,{children:oP(a)})," GitHub account."]}):n.jsxs(n.Fragment,{children:[n.jsxs(or,{children:["@",a]})," email."]})," ",n.jsx(Ge,{kbTopic:"inviting team members",url:"https://tailscale.com/kb/1064/invite-team-members",onClick:()=>{O(R.InvitingYourTeamLearnMoreDocsLinkClicked,{userInviteProperties:{provider:r},eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})}})]})}function Dae({onOpenChange:e}){const{data:t}=ot(),r=t?.loginName||"",s=t?.domainName||"",a=`${r} is using Tailscale to securely connect our devices in a virtual private network. To join our organization’s Tailscale network, follow this link and sign up with your GitHub account. https://login.tailscale.com`;return n.jsxs(Ih,{children:[n.jsxs("div",{children:[n.jsxs("p",{children:["The ",n.jsx(or,{children:Vae(s)})," tailnet is linked to a GitHub organization. Add members to the GitHub org to grant them access."]}),n.jsx("a",{href:"https://docs.github.com/en/organizations/managing-membership-in-your-organization/inviting-users-to-join-your-organization",target:"_blank",rel:"noopener noreferrer",className:"link",onClick:()=>{O(R.InviteYourTeamGithubDocsLinkClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})},children:"Go to Github docs"})]}),n.jsx(Ph,{}),n.jsx(aP,{template:a}),n.jsx(Th,{onOpenChange:e})]})}function _ae({onOpenChange:e}){const[t,r]=f.useState("member"),[s,a]=f.useState([]),[i,l]=f.useState([]),[u,d]=f.useState([]),[m,p]=f.useState(!1),[g,v]=f.useState(!1),{data:y}=ot(),{mutate:C}=Ss(),{postUserInvites:b,posting:w}=Ah(),N=y?.domainName||"",k=!w&&u.length>0,E=()=>{r("member"),a([]),l([]),d([]),p(!1),v(!1),e(!1)},T=()=>{k&&b(u.map(I=>({email:I,role:t}))).then(()=>{C(),v(!1)}).catch(()=>{v(!0)}).finally(()=>p(!0))},_=()=>{p(!1),v(!1)};return m?n.jsx(Mae,{emails:u,hasError:g,onClose:E,onRetry:_}):n.jsxs(Ih,{children:[n.jsx("p",{children:"Send your teammates an email invitation to join your tailnet."}),n.jsx(Ph,{}),n.jsx(Rae,{role:t,onRoleChange:r}),n.jsx(Oae,{inputEmails:s,setInputEmails:a,setExistingEmails:l,setEmailsToInvite:d}),n.jsx(Fae,{existingEmails:i,inputEmails:s,emailsToInvite:u,domain:N}),n.jsxs(iP,{children:[n.jsx(ue,{intent:"base",onClick:()=>{O(R.InviteYourTeamCancelButtonClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}}),E()},disabled:w,children:"Cancel"}),n.jsx(ue,{intent:"primary",onClick:()=>{O(R.InviteYourTeamSendInvitesButtonClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}}),T()},disabled:!k,loading:w,children:"Send invites"})]})]})}function Mae({emails:e,hasError:t,onClose:r,onRetry:s}){const{data:a}=ot(),{data:i}=vt(),l=f.useRef(null),u=f.useRef(null),d=a?.domainName||"",m=e.length,p=yt("member",m),g=i.featureExternalUserInvites;return nP(t?u:l,[t]),f.useEffect(()=>{O(R.InviteYourTeamSubmitResultViewed,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})},[]),n.jsxs(Ih,{children:[t?n.jsxs(rt,{intent:"error",children:["There was an issue inviting the following"," ",m.toLocaleString()," team ",p,". Please try again in a few minutes."]}):n.jsxs(rt,{intent:"success",children:["Email invitations sent to the following ",m.toLocaleString()," ","team ",p,":"]}),n.jsx(sP,{readOnly:!0,ariaLabel:"Teammate emails successfully invited",className:"min-h-[6rem] max-h-[12rem]",emails:e,getChip:v=>n.jsx("div",{className:"w-full",children:n.jsx(xl,{readOnly:!0,children:v})},v)}),g&&n.jsxs("p",{className:"text-text-muted",children:["Looking to invite team members outside of the"," ",n.jsx(or,{children:d})," domain? Use the"," ",n.jsx(or,{children:"Invite users"})," button on the"," ",n.jsx(or,{children:"Users page"})," and select"," ",n.jsx(or,{children:"Outside my org"})," to create an invite link."]}),n.jsxs(iP,{children:[n.jsx(Th,{onOpenChange:()=>r(),ref:l,intent:t?"base":"primary"}),t&&n.jsx(ue,{intent:"primary",onClick:()=>{O(R.InviteYourTeamRetryButtonClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}}),s()},ref:u,children:"Retry"})]})]})}const Lae={member:"Cannot access the admin console. Can connect to nodes in the tailnet as allowed by access control policies",admin:"Perform any action in the admin console","billing-admin":"Manage the pricing plan and billing information","it-admin":"Manage users and devices",auditor:"View all configurations in the tailnet but cannot modify them","network-admin":"Manage network configuration","device-admin":"Manage devices."};function Rae({role:e,onRoleChange:t}){const r=f.useRef(null),a=cy().map(i=>({role:i,description:Lae[i]}));return nP(r),n.jsxs(Dh,{children:[n.jsx("h4",{className:"font-medium",children:"Role"}),n.jsx(Pe,{asChild:!0,onOpenChange:i=>{i&&O(R.InviteYourTeamRoleDropdownClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})},trigger:n.jsx(ue,{ref:r,className:"flex justify-between items-center gap-2",sizeVariant:"large",suffixIcon:n.jsx(vw,{}),children:kf(e)}),side:"bottom",align:"center",children:n.jsx(Pe.RadioGroup,{value:e,onValueChange:i=>{O(R.InviteYourTeamRoleSelected,{userInviteProperties:{toBeAssignedRole:i},eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}}),t(i)},children:a.map((i,l)=>{const u=l===a.length-1;return n.jsxs("div",{children:[n.jsx(Pe.RadioItem,{value:i.role,className:"w-trigger py-4",children:n.jsxs("div",{className:"w-full flex flex-col gap-1 select-none",children:[n.jsx(or,{children:kf(i.role)}),n.jsx("p",{className:"text-text-muted",children:i.description})]})}),n.jsx(Pe.Separator,{noMargin:!0,hidden:u})]},i.role)})})})]})}function Oae({inputEmails:e,setInputEmails:t,setExistingEmails:r,setEmailsToInvite:s}){const{data:a}=ot(),{data:i}=Ss(),{data:l}=Rt(),{data:u}=vt(),d=a?.domainName||"",m=u.featureExternalUserInvites,p=f.useMemo(()=>{const C=(l?.domainAliases||[]).map(b=>b.toLowerCase());return new Set([d.toLowerCase(),...C])},[d,l?.domainAliases]),g=f.useMemo(()=>{const C=new Set;return i?.users?.forEach(b=>{b.loginName&&C.add(b.loginName.toLowerCase()),b.inviteEmail&&C.add(b.inviteEmail.toLowerCase())}),C},[i?.users]),v=C=>{t(C);const b=[],w=[];C.forEach(N=>{g.has(N.toLowerCase())?b.push(N):p.has(lP(N).toLowerCase())&&w.push(N)}),r(b),s(w)},y=f.useCallback((C,b,w)=>{const N=$ae(C,p,g),k=()=>{O(R.InviteYourTeamEmailChipDeleted,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}}),w(b)};return n.jsx(xl,{intent:N,onRemove:k,children:C},C)},[p,g]);return n.jsxs(Dh,{children:[n.jsxs("div",{className:"flex justify-between items-baseline",children:[n.jsx("h4",{className:"font-medium",children:"Teammate emails"}),n.jsx(Ee,{asChild:!1,content:n.jsx("p",{children:m?n.jsxs(n.Fragment,{children:["You can only invite team members in the same domain. To invite someone outside of the ",n.jsx(or,{children:d})," domain, use the ",n.jsx(or,{children:"Invite users"})," button on the"," ",n.jsx(or,{children:"Users page"})," and select"," ",n.jsx(or,{children:"Outside my org"})," to create an invite link."]}):n.jsxs(n.Fragment,{children:["You can only invite team members in"," ",n.jsx(or,{children:d})," domain because your org has external invites disabled."]})}),children:n.jsxs("div",{className:"flex justify-end items-center gap-1 text-sm text-text-muted",children:[n.jsxs("p",{children:["Must be part of ",d]}),n.jsx(bs,{size:16})]})})]}),n.jsx(sP,{ariaLabel:"Teammate emails input",placeholder:"user@example.com, user@example.com",className:"min-h-[6rem] max-h-[12rem]",emails:e,onChange:C=>{C.length>0&&O(R.InviteYourTeamEmailsAdded,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}},{throttleMs:5e3}),v(C)},getChip:y}),n.jsxs("div",{className:"flex justify-between items-center",children:[n.jsx("p",{className:"text-text-muted text-sm",children:"You can use commas to separate multiple email recipients."}),n.jsx(Bae,{onClick:()=>{O(R.InviteYourTeamEmailsCleared,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}}),t([]),r([]),s([])},disabled:e.length===0})]})]})}const Fae=({inputEmails:e,existingEmails:t,emailsToInvite:r,domain:s})=>{const a=t?.length||0,i=e?.length?e.length-(r?.length||0)-a:0;return f.useEffect(()=>{(a>0||i>0)&&O(R.InviteYourTeamValidationWarningViewed,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})},[]),!Array.isArray(t)||!Array.isArray(e)||!Array.isArray(r)||a===0&&i<=0?null:n.jsxs(Dh,{children:[i>0&&n.jsxs(rt,{intent:"warning",children:[i.toLocaleString()," of the emails you entered"," ",n9(i)," outside the ",n.jsx(or,{children:s})," ","domain. Since team invites are limited to members within the same domain, no invitations will be sent to those addresses."]}),a>0&&n.jsxs(rt,{intent:"primary",children:[a.toLocaleString()," of the emails you entered"," ",n9(a)," already on your team or have pending invites. No new invitations will be sent to those addresses."]})]})};function aP({template:e}){return n.jsxs(Dh,{children:[n.jsx("h4",{className:"font-medium",children:"Invite template"}),n.jsx(xn,{text:e,prompt:!1,allowWrap:!0,onClickCallback:()=>{O(R.InviteYourTeamEmailTemplateCopied,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})},children:n.jsx("div",{className:"flex flex-col gap-4 text-base font-sans",children:e})})]})}const Th=ce.forwardRef(({onOpenChange:e,...t},r)=>n.jsx(ue,{ref:r,intent:"primary",className:"self-end",onClick:()=>{O(R.InviteYourTeamCloseButtonClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}}),e(!1)},...t,children:"Close"}));Th.displayName="CloseButton";const Bae=({onClick:e,disabled:t,...r})=>n.jsx("button",{className:D("link text-sm hover:cursor-pointer",{invisible:t}),onClick:e,...r,children:"Clear"});function Ih({children:e,className:t,...r}){return n.jsx("div",{className:D("flex flex-col gap-6",t),...r,children:e})}function Dh({children:e,className:t,...r}){return n.jsx("div",{className:D("flex flex-col gap-2",t),...r,children:e})}function iP({children:e,className:t,...r}){return n.jsx("div",{className:D("flex items-center justify-end gap-3",t),...r,children:e})}function or({children:e,...t}){return n.jsx("span",{className:"font-medium",...t,children:e})}const Uae=e=>e?qs(e)?`${oP(e)} GitHub`:`@${e} email`:"";function Vae(e){return e?e.trim().toLowerCase():""}const oP=e=>e?e.replace(/\.org\.github$/,""):"";function lP(e){return Cl(e)?e.slice(e.lastIndexOf("@")+1).trim().toLowerCase():""}function $ae(e,t,r){const s=e.toLowerCase(),a=lP(s),i=t.has(a),l=r.has(s);return i?l?"primary":"base":"warning"}const fy="flex justify-end items-end";function Hae(){const{data:e}=ot(),{data:t}=vt(),{data:r}=Rt(),{inSegment:s}=Xs({isBusiness:!0,permissions:[{permission:de.UserInvites,access:"write"}]}),a=t.featureExternalUserInvites,i=r?.isAPITailnet;return!e||!s?null:a&&!i?n.jsx(zae,{}):a?n.jsx(Kae,{}):n.jsx(Wae,{})}const v8=f.memo(e=>{const{title:t,subtitle:r,icon:s,action:a}=e;return n.jsxs(Pe.Item,{className:"w-80 grid grid-cols-[auto_1fr] gap-4 py-3 ",stopPropagation:!0,onSelect:a,children:[s,n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsx("h3",{className:"font-semibold",children:t}),n.jsx("p",{className:"text-pretty",children:r})]})]})}),zae=f.memo(()=>{const{data:e}=ot(),{data:t,mutate:r}=Ss(),[s,a]=f.useState(!1),[i,l]=f.useState(!1),u=e?.domainName??"";return n.jsxs("div",{className:fy,children:[n.jsxs(Pe,{asChild:!0,trigger:n.jsx(ue,{intent:"primary",sizeVariant:"medium",className:"select-none",suffixIcon:n.jsx(Nn,{}),children:"Invite users"}),onOpenChange:d=>{d&&cP()},align:"end",side:"bottom",children:[n.jsx(v8,{title:"In my org",subtitle:`Use this to invite team members on the ${u} domain`,icon:n.jsx(ow,{className:"text-text-muted w-6"}),action:()=>{O(R.InMyOrgMenuItemClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.PageHeader}}),a(!0)}}),n.jsx(Pe.Separator,{}),n.jsx(v8,{title:"Outside my org",subtitle:`Use this to invite users outside of ${u} domain`,icon:n.jsx(Hf,{className:"text-text-muted w-6"}),action:()=>{l(!0),O(R.OutsideMyOrgMenuItemClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.PageHeader}})}})]}),n.jsx(my,{open:s,onOpenChange:a}),n.jsx(dy,{users:t?.users||[],mutateUsers:r,open:i,onOpenChange:l})]})}),Wae=f.memo(()=>{const[e,t]=f.useState(!1);return n.jsx("div",{className:fy,children:n.jsx(my,{trigger:uP,open:e,onOpenChange:t})})}),Kae=f.memo(()=>{const{data:e,mutate:t}=Ss(),[r,s]=f.useState(!1);return n.jsx("div",{className:fy,children:n.jsx(dy,{trigger:uP,users:e?.users||[],mutateUsers:t,open:r,onOpenChange:s})})}),cP=()=>{O(R.InviteUsersButtonClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.PageHeader}})},uP=n.jsx(ue,{intent:"primary",sizeVariant:"medium",className:"select-none",onClick:cP,children:"Invite users"});function Gae(e){const{user:t}=e;return n.jsxs(We,{className:D(e.className,"pointer-events-none","select-none"),variant:"tag",color:"gray",children:[t.inviteUrl?n.jsx(cu,{className:"mr-1",size:"0.9em"}):t.inviteEmail&&n.jsx(uu,{className:"mr-1",size:"0.9em"}),"Invited"]})}function qae(e){return n.jsx(Ee,{content:"Needs Approval users can’t log in and connect to machines in the tailnet.",children:n.jsxs(We,{className:D(e.className,"text-sm"),variant:"tag",color:"gray",children:[n.jsx(n2,{className:"mr-1",size:"0.9em"}),"Needs Approval"]})})}function Yae(e){return n.jsx(Ee,{content:"Users are provisioned-only when they have been added to the tailnet via provisioning sync but have not yet logged in.",children:n.jsx(We,{className:e.className,variant:"tag",color:"gray",children:"Provisioned-only"})})}function y8(e){const t=e.global===!0?"This user was suspended by their primary tailnet, which means they can’t log in and connect to machines in this tailnet.":"Suspended users can’t log in and connect to machines in the tailnet.";return n.jsx(Ee,{content:t,children:n.jsxs(We,{className:D(e.className,"text-sm"),variant:"tag",color:"gray",children:[n.jsx(t2,{className:"mr-1",size:"0.9em"}),"Suspended"]})})}function Zae(e){return n.jsx(Ee,{content:"Unpaid users can’t log in and connect to machines in the tailnet.",children:n.jsxs(We,{className:D(e.className,"text-sm"),variant:"tag",color:"gray",children:[n.jsx(Gx,{className:"mr-1",size:"0.9em"}),"Unpaid"]})})}const Qae=async e=>{const r=(await Ie.get(e)).data.data;return{userGroups:r.policyGroups??[],userAutoGroups:r.autoGroups??[],userSyncedGroups:r.syncedGroups??[],allGroups:r.allGroups??[]}};function Jae(e){const{data:t,error:r,mutate:s}=dt(`/public/users/${encodeURIComponent(e)}/groups`,Qae);return{data:t,error:r,mutate:s}}const Xae=e=>f.createElement("svg",{width:"16px",height:"16px",viewBox:"0 0 56 56",...e},f.createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd",transform:"matrix(2.7742681,0,0,2.7742681,-49.798152,-43.154083)"},f.createElement("rect",{id:"Rectangle",x:6,y:6,width:44,height:44}),f.createElement("path",{d:"m 28.222656,20.384615 c 0.832031,0 1.875,-0.579784 2.496094,-1.352829 0.5625,-0.700572 0.972656,-1.678957 0.972656,-2.657342 0,-0.132867 -0.01172,-0.265735 -0.03516,-0.374444 -0.925781,0.03624 -2.039063,0.640178 -2.707031,1.44946 -0.527344,0.61602 -1.007813,1.582326 -1.007813,2.57279 0,0.144946 0.02344,0.289892 0.03516,0.338208 0.05859,0.01208 0.152344,0.02416 0.246094,0.02416 z M 25.292969,35 c 1.136718,0 1.640625,-0.785124 3.058593,-0.785124 1.441407,0 1.757813,0.760966 3.023438,0.760966 1.242187,0 2.074219,-1.183725 2.859375,-2.343293 0.878906,-1.328671 1.242187,-2.633185 1.265625,-2.693579 -0.08203,-0.02416 -2.460938,-1.026701 -2.460938,-3.841068 0,-2.439924 1.875,-3.539097 1.980469,-3.623649 -1.242187,-1.835982 -3.128906,-1.884298 -3.644531,-1.884298 -1.394531,0 -2.53125,0.869676 -3.246094,0.869676 -0.773437,0 -1.792969,-0.82136 -3,-0.82136 -2.296875,0 -4.628906,1.95677 -4.628906,5.652892 0,2.294978 0.867187,4.722823 1.933594,6.293071 C 23.347656,33.912905 24.144531,35 25.292969,35 Z",fill:"#000000",fillRule:"nonzero"}))),eie=e=>f.createElement("svg",{width:19,height:18,viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M17 8.18371C17 7.63989 16.9551 7.09314 16.8591 6.55814H9.16046V9.63879H13.5691C13.3862 10.6324 12.7983 11.5113 11.9376 12.0698V14.0687H14.5678C16.1123 12.6754 17 10.6177 17 8.18371Z",fill:"#4285F4"}),f.createElement("path",{d:"M9.16042 16C11.3617 16 13.2182 15.2916 14.5707 14.0687L11.9406 12.0698C11.2088 12.5578 10.2641 12.8341 9.16342 12.8341C7.03409 12.8341 5.22865 11.4261 4.58085 9.53299H1.8667V11.5936C3.25227 14.2951 6.07438 16 9.16042 16V16Z",fill:"#34A853"}),f.createElement("path",{d:"M4.57786 9.53298C4.23596 8.53941 4.23596 7.46353 4.57786 6.46996V4.40933H1.8667C0.709065 6.66985 0.709065 9.33309 1.8667 11.5936L4.57786 9.53298V9.53298Z",fill:"#FBBC04"}),f.createElement("path",{d:"M9.16042 3.16589C10.3241 3.14825 11.4487 3.57743 12.2914 4.36523L14.6217 2.0812C13.1462 0.72312 11.1878 -0.0235267 9.16042 -1.02057e-05C6.07438 -1.02057e-05 3.25227 1.70493 1.8667 4.40932L4.57785 6.46995C5.22265 4.57394 7.03109 3.16589 9.16042 3.16589V3.16589Z",fill:"#EA4335"})),tie=e=>f.createElement("svg",{width:17,height:17,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M0 0H7.57886V7.57886H0V0Z",fill:"#F25022"}),f.createElement("path",{d:"M0 8.42114H7.57886V16H0V8.42114Z",fill:"#00A4EF"}),f.createElement("path",{d:"M8.42114 0H16V7.57886H8.42114V0Z",fill:"#7FBA00"}),f.createElement("path",{d:"M8.42114 8.42114H16V16H8.42114V8.42114Z",fill:"#FFB900"})),nie=e=>f.createElement("svg",{width:18,height:19,viewBox:"0 0 18 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("g",{clipPath:"url(#clip0_155_1986)"},f.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.90029 0.129883L9.53029 4.68988C9.35529 4.66988 9.18029 4.65988 9.00029 4.65988C8.77529 4.65988 8.55529 4.67488 8.34029 4.70988L8.13029 2.49988C8.12529 2.42988 8.18029 2.36988 8.25029 2.36988H8.62529L8.44529 0.134883C8.44029 0.0648828 8.49529 0.00488281 8.56029 0.00488281H9.78529C9.85529 0.00488281 9.91029 0.0648828 9.90029 0.134883V0.129883ZM6.81029 0.354883C6.79029 0.289883 6.72029 0.249883 6.65529 0.274883L5.50529 0.694883C5.44029 0.719883 5.41029 0.794883 5.44029 0.854883L6.37529 2.89488L6.02029 3.02488C5.95529 3.04988 5.92529 3.12488 5.95529 3.18488L6.91029 5.18988C7.25529 4.99988 7.63029 4.85488 8.02529 4.76488L6.81529 0.354883H6.81029ZM3.99029 1.62488L6.63529 5.35488C6.30029 5.57488 5.99529 5.83488 5.73529 6.13488L4.15029 4.57488C4.10029 4.52488 4.10529 4.44488 4.15529 4.39988L4.44529 4.15988L2.87029 2.56488C2.82029 2.51488 2.82529 2.43488 2.88029 2.38988L3.81529 1.60488C3.87029 1.55988 3.94529 1.56988 3.98529 1.62488H3.99029ZM1.77029 3.78488C1.71529 3.74488 1.63529 3.76488 1.60029 3.82488L0.990293 4.88488C0.955293 4.94488 0.980293 5.01988 1.04029 5.04988L3.07029 6.00988L2.88029 6.33488C2.84529 6.39488 2.87029 6.47488 2.93529 6.49988L4.95529 7.42488C5.10029 7.04988 5.29529 6.69988 5.53529 6.38488L1.77029 3.78488ZM0.275293 6.66488C0.285293 6.59488 0.355293 6.55488 0.420293 6.56988L4.84529 7.72488C4.73029 8.09988 4.66529 8.49488 4.65529 8.90488L2.44029 8.72488C2.37029 8.71988 2.32029 8.65488 2.33529 8.58488L2.40029 8.21488L0.165293 8.00488C0.0952933 7.99988 0.0502933 7.93488 0.0602933 7.86488L0.270293 6.65988L0.275293 6.66488ZM0.110293 9.65488C0.0402933 9.65988 -0.00470669 9.72488 0.00529331 9.79488L0.220293 10.9999C0.230293 11.0699 0.300293 11.1099 0.365293 11.0949L2.53529 10.5299L2.60029 10.8999C2.61029 10.9699 2.68029 11.0099 2.74529 10.9949L4.88529 10.4049C4.76029 10.0349 4.68029 9.63988 4.66029 9.23488L0.105293 9.65488H0.110293ZM0.820293 12.8249C0.785293 12.7649 0.810293 12.6899 0.870293 12.6599L5.00029 10.6999C5.15529 11.0699 5.36529 11.4149 5.61529 11.7249L3.80529 13.0149C3.75029 13.0549 3.67029 13.0399 3.63529 12.9799L3.44529 12.6499L1.60029 13.9249C1.54529 13.9649 1.46529 13.9449 1.43029 13.8849L0.815293 12.8249H0.820293ZM5.82529 11.9649L2.61029 15.2199C2.56029 15.2699 2.56529 15.3499 2.62029 15.3949L3.56029 16.1799C3.61529 16.2249 3.69029 16.2149 3.73029 16.1599L5.03029 14.3299L5.32029 14.5749C5.37529 14.6199 5.45529 14.6099 5.49529 14.5499L6.75529 12.7199C6.41529 12.5099 6.10029 12.2549 5.83029 11.9649H5.82529ZM5.19029 17.1899C5.12529 17.1649 5.09529 17.0899 5.12529 17.0299L7.03029 12.8699C7.38029 13.0499 7.76029 13.1849 8.15529 13.2599L7.59529 15.4099C7.58029 15.4749 7.50529 15.5149 7.44029 15.4899L7.08529 15.3599L6.49029 17.5249C6.47029 17.5899 6.40029 17.6299 6.33529 17.6049L5.18529 17.1849L5.19029 17.1899ZM8.47029 13.3149L8.10029 17.8749C8.09529 17.9449 8.15029 18.0049 8.21529 18.0049H9.44029C9.51029 18.0049 9.56529 17.9449 9.55529 17.8749L9.37529 15.6399H9.75029C9.82029 15.6399 9.87529 15.5799 9.87029 15.5099L9.66029 13.2999C9.44529 13.3349 9.22529 13.3499 9.00029 13.3499C8.82029 13.3499 8.64529 13.3399 8.47029 13.3149ZM12.8803 0.969883C12.9103 0.904883 12.8803 0.834883 12.8153 0.809883L11.6653 0.389883C11.6003 0.364883 11.5303 0.404883 11.5103 0.469883L10.9153 2.63488L10.5603 2.50488C10.4953 2.47988 10.4253 2.51988 10.4053 2.58488L9.84529 4.73488C10.2453 4.81488 10.6203 4.94988 10.9703 5.12488L12.8803 0.969883ZM15.3903 2.78488L12.1753 6.03988C11.9053 5.74988 11.5953 5.49488 11.2503 5.28488L12.5103 3.45488C12.5503 3.39988 12.6303 3.38488 12.6853 3.42988L12.9753 3.67488L14.2753 1.84488C14.3153 1.78988 14.3953 1.77988 14.4453 1.82488L15.3853 2.60988C15.4403 2.65488 15.4403 2.73488 15.3953 2.78488H15.3903ZM17.1303 5.34488C17.1953 5.31488 17.2153 5.23988 17.1803 5.17988L16.5653 4.11988C16.5303 4.05988 16.4503 4.04488 16.3953 4.07988L14.5503 5.35488L14.3603 5.02988C14.3253 4.96988 14.2453 4.94988 14.1903 4.99488L12.3803 6.28488C12.6303 6.59488 12.8353 6.93988 12.9953 7.30988L17.1253 5.34988L17.1303 5.34488ZM17.7803 7.00488L17.9903 8.20988C18.0003 8.27988 17.9553 8.33988 17.8853 8.34988L13.3303 8.77488C13.3103 8.36488 13.2303 7.97488 13.1053 7.60488L15.2453 7.01488C15.3103 6.99488 15.3803 7.03988 15.3903 7.10988L15.4553 7.47988L17.6253 6.91488C17.6903 6.89988 17.7603 6.93988 17.7703 7.00988L17.7803 7.00488ZM17.5753 11.4299C17.6403 11.4449 17.7103 11.4049 17.7203 11.3349L17.9303 10.1299C17.9403 10.0599 17.8953 9.99988 17.8253 9.98988L15.5903 9.77988L15.6553 9.40988C15.6653 9.33988 15.6203 9.27988 15.5503 9.26988L13.3353 9.08988C13.3253 9.49988 13.2603 9.89488 13.1453 10.2699L17.5703 11.4249L17.5753 11.4299ZM16.3953 14.1799C16.3603 14.2399 16.2803 14.2549 16.2253 14.2199L12.4603 11.6199C12.7003 11.3049 12.8953 10.9549 13.0403 10.5799L15.0603 11.5049C15.1253 11.5349 15.1503 11.6099 15.1153 11.6699L14.9253 11.9949L16.9553 12.9549C17.0153 12.9849 17.0403 13.0599 17.0053 13.1199L16.3953 14.1799ZM11.3603 12.6449L14.0053 16.3749C14.0453 16.4299 14.1253 16.4399 14.1753 16.3949L15.1103 15.6099C15.1653 15.5649 15.1653 15.4849 15.1203 15.4349L13.5453 13.8399L13.8353 13.5999C13.8903 13.5549 13.8903 13.4749 13.8403 13.4249L12.2553 11.8649C11.9903 12.1649 11.6903 12.4299 11.3553 12.6449H11.3603ZM11.3353 17.7249C11.2703 17.7499 11.2003 17.7099 11.1803 17.6449L9.97029 13.2349C10.3653 13.1449 10.7403 12.9999 11.0853 12.8099L12.0403 14.8149C12.0703 14.8799 12.0403 14.9549 11.9753 14.9749L11.6203 15.1049L12.5553 17.1449C12.5853 17.2099 12.5553 17.2799 12.4903 17.3049L11.3403 17.7249H11.3353Z",fill:"#191919"})),f.createElement("defs",null,f.createElement("clipPath",{id:"clip0_155_1986"},f.createElement("rect",{width:18,height:18.5,fill:"white"})))),rie=e=>f.createElement("svg",{width:18,height:19,viewBox:"0 0 18 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("g",{clipPath:"url(#clip0_190_1078)"},f.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.90029 0.879883L9.53029 5.43988C9.35529 5.41988 9.18029 5.40988 9.00029 5.40988C8.77529 5.40988 8.55529 5.42488 8.34029 5.45988L8.13029 3.24988C8.12529 3.17988 8.18029 3.11988 8.25029 3.11988H8.62529L8.44529 0.884883C8.44029 0.814883 8.49529 0.754883 8.56029 0.754883H9.78529C9.85529 0.754883 9.91029 0.814883 9.90029 0.884883V0.879883ZM6.81029 1.10488C6.79029 1.03988 6.72029 0.999883 6.65529 1.02488L5.50529 1.44488C5.44029 1.46988 5.41029 1.54488 5.44029 1.60488L6.37529 3.64488L6.02029 3.77488C5.95529 3.79988 5.92529 3.87488 5.95529 3.93488L6.91029 5.93988C7.25529 5.74988 7.63029 5.60488 8.02529 5.51488L6.81529 1.10488H6.81029ZM3.99029 2.37488L6.63529 6.10488C6.30029 6.32488 5.99529 6.58488 5.73529 6.88488L4.15029 5.32488C4.10029 5.27488 4.10529 5.19488 4.15529 5.14988L4.44529 4.90988L2.87029 3.31488C2.82029 3.26488 2.82529 3.18488 2.88029 3.13988L3.81529 2.35488C3.87029 2.30988 3.94529 2.31988 3.98529 2.37488H3.99029ZM1.77029 4.53488C1.71529 4.49488 1.63529 4.51488 1.60029 4.57488L0.990293 5.63488C0.955293 5.69488 0.980293 5.76988 1.04029 5.79988L3.07029 6.75988L2.88029 7.08488C2.84529 7.14488 2.87029 7.22488 2.93529 7.24988L4.95529 8.17488C5.10029 7.79988 5.29529 7.44988 5.53529 7.13488L1.77029 4.53488ZM0.275293 7.41488C0.285293 7.34488 0.355293 7.30488 0.420293 7.31988L4.84529 8.47488C4.73029 8.84988 4.66529 9.24488 4.65529 9.65488L2.44029 9.47488C2.37029 9.46988 2.32029 9.40488 2.33529 9.33488L2.40029 8.96488L0.165293 8.75488C0.0952933 8.74988 0.0502933 8.68488 0.0602933 8.61488L0.270293 7.40988L0.275293 7.41488ZM0.110293 10.4049C0.0402933 10.4099 -0.00470669 10.4749 0.00529331 10.5449L0.220293 11.7499C0.230293 11.8199 0.300293 11.8599 0.365293 11.8449L2.53529 11.2799L2.60029 11.6499C2.61029 11.7199 2.68029 11.7599 2.74529 11.7449L4.88529 11.1549C4.76029 10.7849 4.68029 10.3899 4.66029 9.98488L0.105293 10.4049H0.110293ZM0.820293 13.5749C0.785293 13.5149 0.810293 13.4399 0.870293 13.4099L5.00029 11.4499C5.15529 11.8199 5.36529 12.1649 5.61529 12.4749L3.80529 13.7649C3.75029 13.8049 3.67029 13.7899 3.63529 13.7299L3.44529 13.3999L1.60029 14.6749C1.54529 14.7149 1.46529 14.6949 1.43029 14.6349L0.815293 13.5749H0.820293ZM5.82529 12.7149L2.61029 15.9699C2.56029 16.0199 2.56529 16.0999 2.62029 16.1449L3.56029 16.9299C3.61529 16.9749 3.69029 16.9649 3.73029 16.9099L5.03029 15.0799L5.32029 15.3249C5.37529 15.3699 5.45529 15.3599 5.49529 15.2999L6.75529 13.4699C6.41529 13.2599 6.10029 13.0049 5.83029 12.7149H5.82529ZM5.19029 17.9399C5.12529 17.9149 5.09529 17.8399 5.12529 17.7799L7.03029 13.6199C7.38029 13.7999 7.76029 13.9349 8.15529 14.0099L7.59529 16.1599C7.58029 16.2249 7.50529 16.2649 7.44029 16.2399L7.08529 16.1099L6.49029 18.2749C6.47029 18.3399 6.40029 18.3799 6.33529 18.3549L5.18529 17.9349L5.19029 17.9399ZM8.47029 14.0649L8.10029 18.6249C8.09529 18.6949 8.15029 18.7549 8.21529 18.7549H9.44029C9.51029 18.7549 9.56529 18.6949 9.55529 18.6249L9.37529 16.3899H9.75029C9.82029 16.3899 9.87529 16.3299 9.87029 16.2599L9.66029 14.0499C9.44529 14.0849 9.22529 14.0999 9.00029 14.0999C8.82029 14.0999 8.64529 14.0899 8.47029 14.0649ZM12.8803 1.71988C12.9103 1.65488 12.8803 1.58488 12.8153 1.55988L11.6653 1.13988C11.6003 1.11488 11.5303 1.15488 11.5103 1.21988L10.9153 3.38488L10.5603 3.25488C10.4953 3.22988 10.4253 3.26988 10.4053 3.33488L9.84529 5.48488C10.2453 5.56488 10.6203 5.69988 10.9703 5.87488L12.8803 1.71988ZM15.3903 3.53488L12.1753 6.78988C11.9053 6.49988 11.5953 6.24488 11.2503 6.03488L12.5103 4.20488C12.5503 4.14988 12.6303 4.13488 12.6853 4.17988L12.9753 4.42488L14.2753 2.59488C14.3153 2.53988 14.3953 2.52988 14.4453 2.57488L15.3853 3.35988C15.4403 3.40488 15.4403 3.48488 15.3953 3.53488H15.3903ZM17.1303 6.09488C17.1953 6.06488 17.2153 5.98988 17.1803 5.92988L16.5653 4.86988C16.5303 4.80988 16.4503 4.79488 16.3953 4.82988L14.5503 6.10488L14.3603 5.77988C14.3253 5.71988 14.2453 5.69988 14.1903 5.74488L12.3803 7.03488C12.6303 7.34488 12.8353 7.68988 12.9953 8.05988L17.1253 6.09988L17.1303 6.09488ZM17.7803 7.75488L17.9903 8.95988C18.0003 9.02988 17.9553 9.08988 17.8853 9.09988L13.3303 9.52488C13.3103 9.11488 13.2303 8.72488 13.1053 8.35488L15.2453 7.76488C15.3103 7.74488 15.3803 7.78988 15.3903 7.85988L15.4553 8.22988L17.6253 7.66488C17.6903 7.64988 17.7603 7.68988 17.7703 7.75988L17.7803 7.75488ZM17.5753 12.1799C17.6403 12.1949 17.7103 12.1549 17.7203 12.0849L17.9303 10.8799C17.9403 10.8099 17.8953 10.7499 17.8253 10.7399L15.5903 10.5299L15.6553 10.1599C15.6653 10.0899 15.6203 10.0299 15.5503 10.0199L13.3353 9.83988C13.3253 10.2499 13.2603 10.6449 13.1453 11.0199L17.5703 12.1749L17.5753 12.1799ZM16.3953 14.9299C16.3603 14.9899 16.2803 15.0049 16.2253 14.9699L12.4603 12.3699C12.7003 12.0549 12.8953 11.7049 13.0403 11.3299L15.0603 12.2549C15.1253 12.2849 15.1503 12.3599 15.1153 12.4199L14.9253 12.7449L16.9553 13.7049C17.0153 13.7349 17.0403 13.8099 17.0053 13.8699L16.3953 14.9299ZM11.3603 13.3949L14.0053 17.1249C14.0453 17.1799 14.1253 17.1899 14.1753 17.1449L15.1103 16.3599C15.1653 16.3149 15.1653 16.2349 15.1203 16.1849L13.5453 14.5899L13.8353 14.3499C13.8903 14.3049 13.8903 14.2249 13.8403 14.1749L12.2553 12.6149C11.9903 12.9149 11.6903 13.1799 11.3553 13.3949H11.3603ZM11.3353 18.4749C11.2703 18.4999 11.2003 18.4599 11.1803 18.3949L9.97029 13.9849C10.3653 13.8949 10.7403 13.7499 11.0853 13.5599L12.0403 15.5649C12.0703 15.6299 12.0403 15.7049 11.9753 15.7249L11.6203 15.8549L12.5553 17.8949C12.5853 17.9599 12.5553 18.0299 12.4903 18.0549L11.3403 18.4749H11.3353Z",fill:"#FEFEFE"})),f.createElement("defs",null,f.createElement("clipPath",{id:"clip0_190_1078"},f.createElement("rect",{width:18,height:19,fill:"white"})))),sie=e=>f.createElement("svg",{width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("g",{clipPath:"url(#clip0_357_535)"},f.createElement("path",{d:"M9.00405 0C4.03685 0 0 4.02876 0 8.99596C0 13.9712 4.02876 18 9.00405 18C13.9793 18 18.0081 13.9712 18.0081 8.99596C18.0081 4.02876 13.9793 0 9.00405 0Z",fill:"#1C1F2A"}),f.createElement("path",{d:"M10.3472 12.1835C10.3472 12.3534 10.2582 12.4424 10.0883 12.4424H8.47035C8.30046 12.4424 8.21147 12.3534 8.21147 12.1835V8.28417H6.97372C6.80383 8.28417 6.71484 8.19518 6.71484 8.02529V6.40731C6.71484 6.23743 6.80383 6.14844 6.97372 6.14844H10.1288C10.2987 6.14844 10.3391 6.23743 10.3391 6.35877V12.1835H10.3472Z",fill:"white"})),f.createElement("defs",null,f.createElement("clipPath",{id:"clip0_357_535"},f.createElement("rect",{width:18,height:18,fill:"white"})))),aie=e=>f.createElement("svg",{height:19,style:{enableBackground:"new 0 0 512 512"},viewBox:"0 0 512 512",width:19,xmlSpace:"preserve",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",...e},f.createElement("g",{id:"_x32_39-openid"},f.createElement("g",null,f.createElement("path",{d:"M234.849,419v6.623c-79.268-9.958-139.334-53.393-139.334-105.757 c0-39.313,33.873-73.595,84.485-92.511L178.023,180C88.892,202.497,26.001,256.607,26.001,319.866 c0,76.288,90.871,139.128,208.95,149.705l0.018-0.009V419H234.849z",style:{fill:"#B2B2B2"}}),f.createElement("polygon",{points:"304.772,436.713 304.67,436.713 304.67,221.667 304.67,213.667 304.67,42.429 234.849,78.25 234.849,221.667 234.969,221.667 234.969,469.563 ",style:{fill:"#F7931E"}}),f.createElement("path",{d:"M485.999,291.938l-9.446-100.114l-35.938,20.331C415.087,196.649,382.5,177.5,340,177.261 l0.002,36.406v7.498c3.502,0.968,6.923,2.024,10.301,3.125c14.145,4.611,27.176,10.352,38.666,17.128l-37.786,21.254 L485.999,291.938z",style:{fill:"#B2B2B2"}}))),f.createElement("g",{id:"Layer_1"}));function Wce(e){const{className:t,provider:r,noPadding:s,iconSize:a,providerClassName:i,noBackground:l}=e,u=n.jsx(hy,{provider:r,iconSize:a});return n.jsxs("div",{className:D(t,"rounded border border-border-interactive inline-flex items-center font-medium",!s&&"py-2 px-4",!l&&"bg-gray-0 dark:bg-gray-900"),children:[u&&n.jsx("span",{className:"mr-2",children:u}),n.jsx("span",{className:i,children:r})]})}function hy({provider:e,iconSize:t}){const{resolvedTheme:r}=hl(),s=r==="dark";switch(e.toLowerCase()){case"google":return n.jsx(eie,{...t?{width:t,height:t}:{width:"1.1em",height:"1.1em"}});case"microsoft":case"custom microsoft":return n.jsx(tie,{...t&&{width:t,height:t}});case"github":return n.jsx(gO,{...t?{width:t,height:t}:{width:"1.1em",height:"1.1em"}});case"okta":{const a=s?rie:nie;return n.jsx(a,{...t&&{width:t,height:t}})}case"apple":return n.jsx(Xae,{...t&&{width:t,height:t}});case"custom oidc":case"oidc":return n.jsx(aie,{...t&&{width:t,height:t}});case"onelogin":return n.jsx(sie,{...t&&{width:t,height:t}})}return null}function iie(e){return e.length>0&&Array.isArray(e[0])}function dP(e){const{title:t,items:r,multiselect:s,sizeVariant:a="medium",disabled:i=!1,selectedValues:l,updateSelectedValues:u}=e,d=iie(r)?r:[r],m=g=>v=>{let y;v?y=s?[...l,g]:[g]:y=l.filter(C=>C!==g),u(y)},p=d.flat();return n.jsxs(mS,{modal:!0,children:[n.jsx(fS,{asChild:!0,children:n.jsx(ue,{className:"flex items-center",disabled:i||p.length===0,sizeVariant:a,suffixIcon:n.jsx(Nn,{}),children:t})}),n.jsx(R2,{children:n.jsx(hS,{className:"dropdown bg-bg-base rounded-md overflow-y-auto max-h-80 max-w-xs z-50",sideOffset:10,children:d.map((g,v)=>n.jsxs(ce.Fragment,{children:[g.map((y,C)=>n.jsx(oie,{item:y,selected:l.includes(y.value),setSelection:m(y.value),isLastItem:C===g.length-1,isGroupItem:d.length>1},y.value)),vr(!1)}):"You don’t have permission to edit tailnet ACLs."})}function cie({user:e,closeDialog:t}){const{isPosting:r,applyPatches:s}=Eu(),{data:a,error:i,mutate:l}=Jae(e.stableId),{data:u}=Wi(),[,d]=ft(),m=et(),p=f.useMemo(()=>a?.userGroups.sort()||[],[a?.userGroups]),[g,v]=f.useState(p);f.useEffect(()=>v(p),[p]);const y=k=>v(k.sort()),C=f.useCallback(k=>()=>v(g.filter(E=>E!==k)),[g]),b=f.useCallback(k=>{const E=uie(e,p,k);s(E).then(()=>{l(),m.show({message:"Updated user’s ACL groups"})}).catch(()=>m.show({message:"Failed to update user’s ACL groups",variant:"danger"}))},[e,p,s,l,m]);if(!a||i)return n.jsx(De,{error:i});const w=a.userSyncedGroups||[],N=g.length>0||w.length>0;return n.jsxs(Re.Form,{cancelButton:!0,submitButton:"Save",onSubmit:()=>b(g),loading:r,disabled:g.toString()===p.toString(),children:[n.jsxs("p",{children:["Groups can be used in the"," ",n.jsx(ze,{className:"link",href:"/admin/acls",children:"tailnet policy file"})," ","to define shared permissions for a set of users."," ",n.jsx(Ge,{kbTopic:"ACL groups",url:"https://tailscale.com/kb/1018/acls/#groups"})," "]}),!N&&a.allGroups.length===0?n.jsx(at,{className:"mt-4 mb-5 flex flex-col items-center",empty:!0,children:n.jsx(fn,{description:`This user is not a member of any groups, and no groups are defined in the tailnet policy file.`,action:n.jsx(ue,{sizeVariant:"small",onClick:()=>{t(),d("/admin/acls")},children:"Go to tailnet policy file"})})}):n.jsxs(n.Fragment,{children:[N?n.jsxs("ul",{className:"mt-4 mb-5 border-y divide-y",children:[w.map(k=>n.jsx(b8,{group:k,icon:u?.provider?n.jsx(hy,{provider:u.provider}):void 0,actionTooltip:`This group is synced from ${u?.provider||"your auth provider"} and can only be edited there.`},k)),g.map(k=>n.jsx(b8,{group:k,onDelete:C(k)},k))]}):n.jsx(at,{className:"mt-4 mb-5",empty:!0,children:n.jsx(fn,{description:"This user is not a member of any groups."})}),a.allGroups.length>0&&n.jsx("div",{className:"mb-5",children:n.jsx(dP,{title:"Add to a group",items:a.allGroups.sort().map(k=>({value:k,left:n.jsx(Lr,{group:k,className:"mr-2",sizeClassName:"w-5 h-5"})})),selectedValues:g,updateSelectedValues:y,sizeVariant:"small",multiselect:!0})})]}),a.userAutoGroups.length>0&&n.jsxs("div",{className:"flex flex-wrap items-baseline",children:[n.jsx("p",{className:"text-text-muted mr-2",children:"This user is also automatically a part of:"}),a.userAutoGroups.sort().map(k=>n.jsx(We,{variant:"tag",className:"mr-2",children:k},k))]})]})}function b8({group:e,icon:t,actionTooltip:r,onDelete:s}){const a=s===void 0;return n.jsxs("li",{className:"flex justify-between items-center h-12",children:[n.jsxs("div",{className:"flex items-center",children:[t?n.jsx("div",{className:"w-6 mx-1",children:t}):n.jsx(Lr,{group:e,className:"mr-2",sizeClassName:"w-6 h-6"}),e]}),n.jsx(Ee,{content:r,side:"bottom",children:n.jsx(ue,{iconOnly:!0,variant:"minimal",onClick:s,disabled:a,children:n.jsx(Or,{size:18})})})]},e)}function uie(e,t,r){const s=e.loginName,a=[],i=new Set(t);return r.forEach(l=>i.has(l)?i.delete(l):a.push({type:"add-user-to-group",key:l,value:s})),i.forEach(l=>a.push({type:"remove-user-from-group",key:l,value:s})),a}function ko(e,t){switch(e){case"delete_user":switch(t){case"present":return"Delete";case"present_continuous":return"Deleting";case"noun":return"Deletion";default:return t}case"suspend_user":switch(t){case"present":return"Suspend";case"present_continuous":return"Suspending";case"noun":return"Suspension";default:return t}case"restore_user":switch(t){case"present":return"Restore";case"present_continuous":return"Restoring";case"noun":return"Restoration";default:return t}default:return e}}function Ug(e){const{user:t,onSubmit:r,open:s,onOpenChange:a,disabled:i}=e,{currentTailnetID:l}=ot(),[u,d]=f.useState(""),[m,p]=f.useState(!1),g=e.action==="delete_user",{data:v}=sn(),[y,C]=f.useMemo(()=>{const b=v?.machines.filter(N=>N.user===t.loginName)||[],w=b.some(N=>N.hasTags||N.hasExitNode||N.hasSubnets||N.acceptedShareCount>0);return[b,w]},[v?.machines,t.loginName]);return n.jsx(Re,{open:s,onOpenChange:a,title:ko(e.action,"present")+" user",children:n.jsxs(Re.Form,{disabled:g&&!m||i,cancelButton:!0,submitButton:{children:`${ko(e.action,"present")} user`,intent:e.action==="restore_user"?"primary":"danger"},onSubmit:r,children:[n.jsxs("p",{className:"mb-6",children:[ko(e.action,"present_continuous")," ",n.jsxs("span",{className:"font-semibold",children:[t.loginName," ",t.isAdmin&&"(admin)"," "]})," ","will ",ko(e.action,"present").toLowerCase()," all the machines they own.",C&&n.jsxs("span",{children:[" ",ko(e.action,"present_continuous")," machines that expose network features like subnet routes or exit nodes may affect other users of your network."]})]}),n.jsx("h3",{className:"font-semibold mb-2",children:"Machines"}),n.jsx("div",{children:y.length>0?n.jsx(die,{userMachines:y}):n.jsx(at,{empty:!0,children:n.jsx(fn,{description:"This user does not own any machines"})})}),t.orgTailnetId===l&&n.jsxs("div",{children:[n.jsx("br",{}),n.jsx("p",{children:"The user will also be removed from all external tailnets."})]}),g&&n.jsxs(n.Fragment,{children:[n.jsxs("p",{className:"mb-2 mt-6",children:["Type ",n.jsx("span",{className:"font-semibold",children:t.loginName})," to confirm ",ko(e.action,"noun").toLowerCase(),":"]}),n.jsx("div",{className:"flex mb-2",children:n.jsx(ln,{className:"w-full z-10",type:"text",id:"delete-user-name",autoComplete:"off",autoCorrect:"off",value:u,onChange:b=>{const{value:w}=b.target;d(w),p(w.toLowerCase().trim()===t.loginName.toLowerCase().trim())}})})]})]})})}function die(e){const{userMachines:t}=e,r=f.useMemo(()=>t.sort(qk),[t]);return n.jsxs(n.Fragment,{children:[n.jsx("ul",{children:r.slice(0,5).map((s,a)=>n.jsx(mie,{machine:s},a))}),n.jsx("div",{className:"text-text-muted py-2 items-center border-t",children:r.length>6?n.jsxs(n.Fragment,{children:[n.jsx("a",{className:"link",href:`/admin/machines?q=${r[0].user}`,target:"_blank",rel:"noopener noreferrer",children:"View all"})," ","· Showing 5 of ",r.length]}):n.jsx("a",{className:"link",href:`/admin/machines?q=${r[0].user}`,target:"_blank",rel:"noopener noreferrer",children:"View more details"})})]})}function mie(e){const{machine:t}=e,r=fie(t);return n.jsxs("li",{className:"flex items-center py-2 border-t",children:[n.jsx("a",{className:"link truncate",href:`/admin/machines/${t.addresses[0]}`,target:"_blank",rel:"noreferrer noopener",children:t.name}),r&&n.jsx("div",{className:"ml-auto pl-2",children:n.jsx(Ee,{content:r,children:n.jsx(Oa,{size:"1.125rem"})})})]})}function fie(e){const t=[];e.hasTags&&t.push("has ACL tags"),e.hasExitNode&&t.push("is an exit node"),e.hasSubnets&&t.push("advertises subnet routes"),e.acceptedShareCount>0&&t.push("is shared with other users");const r=t.length;if(r===0)return null;let s=".";return r>1&&(s=" and "+t.pop()+"."),"This machine "+t.join(", ")+s}function hie(e){const{currentTailnet:t}=ot(),{user:r,currentUser:s,setUserRole:a,open:i,onOpenChange:l,isPosting:u}=e,[d,m]=f.useState(r.role),p=ss(!1),g=r.isOwner,v=cy(),y=b=>()=>m(b),C=b=>v.includes(b)||d===b;return n.jsxs(n.Fragment,{children:[n.jsx(Re,{open:!p.value&&i,title:"Edit role",onOpenChange:l,children:n.jsxs(Re.Form,{loading:u,disabled:d===r.role||g,cancelButton:!0,submitButton:"Save",onSubmit:()=>{d==="owner"?p.setTrue():a(d).then(()=>l(!1))},children:[n.jsx("div",{className:"mb-4",children:n.jsxs("p",{children:["Change ",n.jsx("strong",{children:r.displayName}),"‘s role."," ",n.jsx(Ge,{kbTopic:"user roles",url:"https://tailscale.com/kb/1138/user-roles"})]})}),t&&s.isOwner&&(t.tailnetID===r.orgTailnetId||s.orgTailnetId===r.orgTailnetId||qs(t.tailnetName))&&n.jsxs("label",{className:"flex mt-3",children:[n.jsx("input",{type:"radio",name:"keytype",className:"radio mt-1",disabled:g,checked:d==="owner",onChange:y("owner")}),n.jsxs("div",{className:"ml-2",children:[n.jsx("strong",{className:"font-medium block",children:"Owner"}),n.jsx("span",{className:"text-text-muted leading-none",children:"Has complete access to the tailnet. There can only be one Owner."})]})]}),n.jsxs("label",{className:"flex mt-3",children:[n.jsx("input",{type:"radio",name:"keytype",className:"radio mt-1",disabled:g,checked:d==="admin",onChange:y("admin")}),n.jsxs("div",{className:"ml-2",children:[n.jsx("strong",{className:"font-medium block",children:"Admin"}),n.jsx("span",{className:"text-text-muted leading-none",children:"Can view the admin console, manage billing, network, machine, and user settings."})]})]}),C("network-admin")&&n.jsxs("label",{className:"flex mt-3",children:[n.jsx("input",{type:"radio",name:"keytype",className:"radio mt-1",disabled:g,checked:d==="network-admin",onChange:y("network-admin")}),n.jsxs("div",{className:"ml-2",children:[n.jsx("strong",{className:"font-medium block",children:"Network admin"}),n.jsx("span",{className:"text-text-muted leading-none",children:"Can view the admin console and manage ACLs and network settings. Cannot manage machines or users."})]})]}),C("it-admin")&&n.jsxs("label",{className:"flex mt-3",children:[n.jsx("input",{type:"radio",name:"keytype",className:"radio mt-1",disabled:g,checked:d==="it-admin",onChange:y("it-admin")}),n.jsxs("div",{className:"ml-2",children:[n.jsx("strong",{className:"font-medium block",children:"IT admin"}),n.jsx("span",{className:"text-text-muted leading-none",children:"Can view the admin console and manage machines and users. Cannot manage ACLs or network settings."})]})]}),C("billing-admin")&&n.jsxs("label",{className:"flex mt-3",children:[n.jsx("input",{type:"radio",name:"keytype",className:"radio mt-1",disabled:g,checked:d==="billing-admin",onChange:y("billing-admin")}),n.jsxs("div",{className:"ml-2",children:[n.jsx("strong",{className:"font-medium block",children:"Billing admin"}),n.jsx("span",{className:"text-text-muted leading-none",children:"Can view the admin console and manage billing."})]})]}),C("device-admin")&&n.jsxs("label",{className:"flex mt-3",children:[n.jsx("input",{type:"radio",name:"keytype",className:"radio mt-1",disabled:g,checked:d==="device-admin",onChange:y("device-admin")}),n.jsxs("div",{className:"ml-2",children:[n.jsx("strong",{className:"font-medium block",children:"Device admin"}),n.jsx("span",{className:"text-text-muted leading-none",children:"Can view the admin console and manage machines. Cannot manage users, ACLs, or network settings."})]})]}),C("auditor")&&n.jsxs("label",{className:"flex mt-3",children:[n.jsx("input",{type:"radio",name:"keytype",className:"radio mt-1",disabled:g,checked:d==="auditor",onChange:y("auditor")}),n.jsxs("div",{className:"ml-2",children:[n.jsx("strong",{className:"font-medium block",children:"Auditor"}),n.jsx("span",{className:"text-text-muted leading-none",children:"Can view the admin console."})]})]}),n.jsxs("label",{className:"flex mt-3",children:[n.jsx("input",{type:"radio",name:"keytype",className:"radio mt-1",disabled:g,checked:d==="member",onChange:y("member")}),n.jsxs("div",{className:"ml-2",children:[n.jsx("strong",{className:"font-medium block",children:"Member"}),n.jsx("span",{className:"text-text-muted leading-none",children:"Cannot view the admin console."})]})]})]})}),n.jsx(Re,{open:p.value&&i,onOpenChange:l,title:"Transfer ownership",children:n.jsx(Re.Form,{destructive:!0,autoFocus:"cancel",loading:u,cancelButton:{onClick:p.setFalse},submitButton:"Transfer ownership",onSubmit:()=>{a("owner").finally(()=>{p.setFalse(),l(!1)})},children:n.jsxs("p",{children:["Changing ",n.jsx("strong",{children:r.displayName}),"‘s role to"," ",n.jsx("strong",{children:"Owner"})," will transfer ownership of"," ",n.jsx("strong",{children:r.domainName})," to them. Your role will change to Admin."]})})})]})}const pie=e=>f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-circle-user",...e},f.createElement("circle",{cx:12,cy:12,r:10}),f.createElement("circle",{cx:12,cy:10,r:3}),f.createElement("path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662"})),gie=e=>f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"lucide lucide-contact",...e},f.createElement("path",{d:"M16 2v2"}),f.createElement("path",{d:"M7 22v-2a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2"}),f.createElement("path",{d:"M8 2v2"}),f.createElement("circle",{cx:12,cy:11,r:3}),f.createElement("rect",{x:3,y:4,width:18,height:18,rx:2})),xie=e=>f.createElement("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"150 0 329 219",...e},f.createElement("rect",{x:446.82,y:12.87,width:59.58,height:122.12,rx:29.79,fill:"#C2DAFF",className:"fill-[#C2DAFF] dark:fill-[#85AAF5]"}),f.createElement("rect",{x:209.94,y:130.9,width:59.37,height:118.74,rx:29.69,fill:"#253570",className:"fill-[#253570] dark:fill-[#3F5DB3]"}),f.createElement("rect",{x:328.2,y:140.64,width:59.37,height:167.43,rx:27.97,fill:"#253570",className:"fill-[#253570] dark:fill-[#3F5DB3]"}),f.createElement("rect",{x:446.94,y:134.7,width:59.37,height:235.11,rx:27.97,fill:"#253570",className:"fill-[#253570] dark:fill-[#3F5DB3]"}),f.createElement("rect",{x:268.83,y:190.51,width:59.37,height:59.37,rx:29.69,fill:"#253570",className:"fill-[#253570] dark:fill-[#3F5DB3]"}),f.createElement("rect",{x:268.83,y:131.14,width:59.37,height:59.37,rx:29.69,fill:"#C2DAFF",className:"fill-[#C2DAFF] dark:fill-[#85AAF5]"}),f.createElement("rect",{x:150.09,y:158.86,width:59.37,height:59.37,rx:29.69,fill:"#C2DAFF",className:"fill-[#C2DAFF] dark:fill-[#85AAF5]"}),f.createElement("rect",{x:327.97,y:81.11,width:59.29,height:59.29,rx:29.65,fill:"#C2DAFF",className:"fill-[#C2DAFF] dark:fill-[#85AAF5]"}),f.createElement("rect",{x:387.57,y:71.77,width:59.37,height:118.74,rx:29.69,fill:"#C2DAFF",className:"fill-[#C2DAFF] dark:fill-[#85AAF5]"}),f.createElement("rect",{x:387.26,y:190.51,width:59.37,height:59.37,rx:29.69,fill:"#C2DAFF",className:"fill-[#C2DAFF] dark:fill-[#85AAF5]"}),f.createElement("rect",{x:387.24,y:12.31,width:59.37,height:59.37,rx:29.69,fill:"#253570",className:"fill-[#253570] dark:fill-[#3F5DB3]"}));function vie(){const{data:e}=ot(),{inSegment:t,dismiss:r}=Xs({isBusiness:!0,isAPITailnet:!1,permissions:[{permission:de.UserInvites,access:"write"}],dismissNoticeKey:"InviteTeamBanner",minBreakpoint:"sm"});return!e||!t?null:n.jsx(yie,{onDismiss:r})}function yie({onDismiss:e}){const[t,r]=f.useState(!1);return f.useEffect(()=>{O(R.InviteYourTeamBannerViewed,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteYourTeamBanner}})},[]),n.jsxs(at,{className:"grid grid-cols-2 gap-x-36 mt-6 !rounded-lg border-none bg-blue-0 dark:bg-blue-900",noPadding:!0,children:[n.jsxs("div",{className:"flex flex-col justify-center gap-4 ml-10",children:[n.jsx("h3",{className:"text-lg font-semibold text-pretty leading-none",children:"Invite your team"}),n.jsx("p",{children:"The magic of Tailscale happens when multiple people are on your network."}),n.jsxs("div",{className:"flex gap-4",children:[n.jsx(my,{open:t,onOpenChange:r,trigger:n.jsx(ue,{intent:"primary",onClick:()=>{O(R.SendInvitesButtonClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteYourTeamBanner}})},children:"Send invites"})}),n.jsx(ue,{intent:"primary",className:"dark:text-text-base",variant:"minimal",onClick:()=>{e(),O(R.InviteYourTeamBannerDismissButtonClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteYourTeamBanner}})},children:"Dismiss"})]})]}),n.jsx(xie,{className:"h-full max-h-56 ml-auto rounded-r-lg"})]})}function bie(e){const{trigger:t,users:r,open:s,onOpenChange:a}=e,{data:i}=vt(),{data:l}=ot(),{data:u}=Rt(),{postUserInvitesWithToast:d,posting:m}=Ah(),{setDisableRevalidateOnFocus:p}=uy(),[g,v]=f.useState("member"),y=l?.domainName||"",C=f.useMemo(()=>(u?.domainAliases||[]).map(N=>N.toLowerCase()),[u?.domainAliases]);function b(){v("member")}function w(N){O(R.WelcomeEmailRoleSelected,{userInviteProperties:{toBeAssignedRole:N},eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}}),v(N)}return n.jsx(Re,{trigger:t,open:s,onOpenChange:N=>{b(),a(N),p(N),N&&O(R.WelcomeEmailDialogOpened,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})},title:"Send welcome email",children:i.featureCanSendEmail?qs(y)?n.jsx(jie,{currentUser:l}):n.jsxs(n.Fragment,{children:[n.jsxs("p",{className:"mb-6",children:["Send your team members a welcome email. It will include a link to downloading Tailscale, and instructions for joining this tailnet using their ",n.jsx("span",{className:"font-medium",children:y})," email."]}),n.jsx(Cie,{className:"mb-6",users:(e.users||[]).length}),n.jsx(tP,{cancelButton:!0,submitButton:"Send welcome email",users:r,role:g,onRoleChange:w,onRoleDropdownOpenChange:N=>{N&&O(R.WelcomeEmailRoleDropdownClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})},onInputBlur:()=>{O(R.WelcomeEmailEmailInputBlurred,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})},onPostInvites:(N,k)=>d(N.map(E=>({email:E,role:g})),k).then(()=>{e.mutateUsers(),b(),a(!1)}),restrictToDomains:[y,...C],posting:m})]}):n.jsx(wie,{currentUser:l})})}function Cie({users:e,className:t}){const{data:r}=vt(),{shouldUseHybridEligibleUI:s}=bl();return e<=Xf("personal")||r.trialBanner||r.userEnforcementDisabled||s?null:n.jsx(rt,{intent:"warning",className:t,children:"Inviting more users will put you over the limit of your billing plan. You can invite them anyway, but they’ll only be able to become active if you upgrade your plan or delete some users."})}function wie({currentUser:e}){const{data:t}=Nt(),{data:r}=Wi(),s=et(),a=e.domainName,i=r?.provisioningEnabled,l=t?.status==="active"||t?.status==="trialing",u=f.useCallback(()=>{O(R.InviteLinkCopied,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})},[]),d=f.useCallback(()=>{O(R.InviteTeamMailtoLinkClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})},[]),m=f.useCallback(()=>{s.show({message:"Failed to copy to clipboard.",variant:"danger"})},[s]);return n.jsxs(n.Fragment,{children:[n.jsxs("p",{className:"mb-5",children:[i?n.jsxs(n.Fragment,{children:["Add users from the"," ",r.syncDetails.providerGroupsUrl?n.jsxs("a",{href:r.syncDetails.providerGroupsUrl,className:"link",target:"_blank",rel:"noopener noreferrer",onClick:()=>{O(R.WelcomeEmailAdminConsoleLinkClicked,{userInviteProperties:{provider:r.provider},eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})},children:[r.provider," admin console"]}):n.jsxs(n.Fragment,{children:[r.provider," admin console"]}),". Once added, your team members must download Tailscale and sign in with their"," "]}):n.jsxs(n.Fragment,{children:["To join this tailnet, your team members must download Tailscale and sign in with their"," "]}),qs(a)?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"font-medium",children:py(a)})," ","GitHub account."]}):n.jsxs(n.Fragment,{children:[n.jsxs("span",{className:"font-medium",children:["@",a]})," email."]})," ",n.jsx(Ge,{kbTopic:"inviting team members",url:"https://tailscale.com/kb/1064/invite-team-members",onClick:()=>{O(R.WelcomeEmailLearnMoreDocsLinkClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})}})]}),n.jsxs("div",{className:"mb-5",children:[n.jsx("p",{children:"Copy the link below and send it to them:"}),n.jsx(Xo,{className:"my-1",text:"https://tailscale.com/download",onCopySuccess:u,onCopyFailed:m}),n.jsx("a",{className:"link",href:`mailto:?subject=${Sie}&body=${kie(a,qs(a))}`,onClick:d,children:"Email download link to your team"})]}),n.jsx("p",{className:"text-text-muted",children:l?n.jsxs(n.Fragment,{children:["Remember, you can adjust the number of users you’re paying for from"," ",n.jsx(ze,{to:"/admin/settings/billing",className:"link",onClick:()=>{O(R.WelcomeEmailBillingPageLinkClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})},children:"the billing page"}),"."]}):n.jsxs(n.Fragment,{children:["Remember, you can try out Tailscale with your team and"," ",n.jsx(ze,{className:"link",to:"/admin/settings/billing/plans",onClick:()=>{O(R.WelcomeEmailUpgradePlanLinkClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})},children:"upgrade to a paid plan"})," ","once you’re ready."]})})]})}function jie({currentUser:e}){return n.jsxs("p",{className:"mb-5",children:["You can invite anyone to become a member of your GitHub organization. Once added, they can log in to Tailscale with GitHub and select"," ",n.jsx("span",{className:"font-medium",children:py(e.domainName)}),".",n.jsx("p",{children:n.jsx(Ge,{kbTopic:"inviting users to join your organization",url:"https://docs.github.com/en/organizations/managing-membership-in-your-organization/inviting-users-to-join-your-organization",onClick:()=>{O(R.WelcomeEmailGithubDocsLinkClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.InviteDialog}})}})})]})}const Sie="Join our private Tailscale network",kie=(e,t)=>encodeURIComponent(`${e} is using Tailscale to securely connect our devices in a virtual private network. To join our network: 1. Install Tailscale on your device: https://tailscale.com/download 2. Sign in with your ${t?`${py(e)} GitHub account`:`@${e} email`} Once you sign in, your device will automatically join our network. `),py=e=>e.replace(/\.org\.github$/,"");function Nie(){const{data:e,isLoading:t}=Rt(),r=e&&Bi(e);return t?n.jsx(De,{}):r?n.jsx(vie,{}):n.jsx(Eie,{})}function Eie(){const{data:e,mutate:t}=Ss(),{data:r}=Rt(),{data:s}=ot(),{data:a}=Wi(),{data:i}=vt(),[l,u]=f.useState(!1),[d,m]=f.useState(!1);if(!s)return null;function p(b){return n.jsx("div",{className:"flex-1 flex flex-col",children:n.jsxs("div",{className:D("flex gap-2 items-start",{"@md:flex-col":b.flushLeftWhenBig}),children:[n.jsx("div",{className:"top-px relative",children:b.icon}),n.jsxs("div",{className:"break-all",children:[n.jsx("h3",{className:"font-medium",children:b.title}),n.jsx("p",{className:"mt-0.5 text-text-muted",children:b.children}),b.action]})]})})}function g(){return n.jsxs(p,{icon:n.jsx(pie,{className:"w-5 h-auto"}),action:n.jsx(bie,{trigger:n.jsx(ue,{sizeVariant:"small",className:"mt-3",onClick:()=>{O(R.SendWelcomeEmailClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.PageHeader}})},children:"Send welcome email"}),users:e?.users||[],mutateUsers:t,open:d,onOpenChange:m}),title:"Invite team members",flushLeftWhenBig:!0,children:[a&&a.provisioningEnabled?"Synced users and groups automatically join this tailnet":n.jsxs(n.Fragment,{children:["People trying to log in with an"," ",n.jsxs("span",{className:"font-medium",children:["@",s?.domainName]})," ","email",r?.usersApprovalOn?" will automatically request to join this tailnet":" will automatically join this tailnet"]}),". You can also prompt them by sending them an invite."]})}function v(b){return n.jsxs(p,{icon:n.jsx(gie,{className:"w-5 h-auto"}),action:n.jsx(dy,{trigger:n.jsx(ue,{sizeVariant:"small",intent:b.sharedDomain?"primary":"base",className:"mt-3",onClick:()=>{O(R.InviteExternalUserClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.PageHeader}})},children:"Invite external users"}),users:e?.users||[],mutateUsers:t,open:l,onOpenChange:u}),title:b.sharedDomain?"Invite users":"Invite external users",flushLeftWhenBig:!0,children:["You can invite",!b.sharedDomain&&" external"," users by generating an invite link to share with them."]})}function y(b){const[w,N]=f.useState(b.open);return n.jsxs("div",{className:b.className,children:[n.jsxs("button",{className:D("font-medium w-full flex items-center gap-2 pt-5 px-5 hover:cursor-pointer @md:hidden @md:pointer-events-none",{"pb-5":!w}),onClick:()=>N(k=>!k),children:[n.jsx(js,{size:20,className:D("text-text-disabled mt-px transition-transform",{"rotate-90":w})}),n.jsx("span",{className:"text-lg",children:b.title})]}),n.jsx("div",{className:D("@md:!block",{hidden:!w}),children:b.children})]})}const C=i.featureExternalUserInvites;return n.jsxs("div",{className:"border rounded-lg mt-6 divide-y @lg:divide-y-0 @lg:divide-x @lg:flex",children:[n.jsx(y,{title:"Invite users",className:"flex-1",children:n.jsx("div",{className:"flex flex-col p-5 gap-5 @md:flex-row",children:!s.sharedDomain&&C?n.jsxs(n.Fragment,{children:[!r?.isAPITailnet&&n.jsx(g,{}),n.jsx(v,{})]}):C?n.jsx(v,{sharedDomain:!0}):n.jsx(g,{})})}),n.jsx(y,{title:"User management",className:D("flex-1",{"@lg:max-w-[40%]":!s.sharedDomain},{"@lg:max-w-[50%]":s.sharedDomain}),children:n.jsxs("div",{className:"flex flex-col p-5 gap-5",children:[!s.sharedDomain&&r?.provider&&n.jsxs(p,{icon:r.provider&&n.jsx(hy,{provider:r.provider,iconSize:"20"}),title:r.provider==="Custom OIDC"?"Using a custom OIDC provider":r.provider==="Custom Microsoft"?"Using a custom Microsoft provider":r.provider+" is your identity provider",children:["Members of"," ",n.jsx("span",{className:"font-medium",children:r?.displayName||s.domainName}),r.provider==="Custom OIDC"?" use a custom OIDC provider to join and log in to this tailnet.":" use this identity provider to join and log in to this tailnet."]}),a&&a.provisioningEnabled?n.jsxs(p,{icon:n.jsx(wi,{size:"20"}),title:"Provisioning users",children:["Users are managed via the"," ",a.syncDetails.providerGroupsUrl?n.jsxs("a",{href:a.syncDetails.providerGroupsUrl,className:"link",target:"_blank",rel:"noopener noreferrer",onClick:()=>{O(R.UsersHeaderAdminConsoleLinkClicked,{userInviteProperties:{provider:a.provider},eventProperties:{productArea:K.Users,productSubArea:oe.PageHeader}})},children:[a.provider," admin console"]}):n.jsxs(n.Fragment,{children:[a.provider," admin console"]}),"."]}):n.jsx(p,{icon:r?.usersApprovalOn?n.jsx(n2,{size:"20"}):n.jsx(wF,{size:"20"}),title:r?.usersApprovalOn?"Approval is required":"Approval is not required",flushLeftWhenBig:s.sharedDomain,children:s.sharedDomain?r?.usersApprovalOn?"Invited users can only join after being approved by an admin.":"Invited users can join without manual approval from admins.":r?.usersApprovalOn?"Users can only join after being approved by an admin.":"Users can join without manual approval from admins."}),n.jsx(ze,{className:"link",href:"/admin/settings/user-management",onClick:()=>{O(R.UsersHeaderEditSettingsLinkClicked,{eventProperties:{productArea:K.Users,productSubArea:oe.PageHeader}})},children:"Edit in Settings"})]})})]})}function Aie({data:e,query:t=""}){const{results:r,queryWithoutFilters:s}=cA({data:e,query:t,simpleFilters:{},paramFilters:Tie}),{results:a}=CA({data:r,query:s,options:Pie});return{results:a}}const Pie={threshold:0,distance:80,ignoreLocation:!0,keys:[{name:"displayName",weight:.8},{name:"loginName",weight:.5}]},Tie={status:(e,t)=>t.some(r=>{switch(r){case"occupyingseat":return e.occupyingSeat===!0;case"notoccupyingseat":return e.occupyingSeat===!1;default:return(e.status||"none")===r}}),role:(e,t)=>{const r=`${e.role}`;return t.some(s=>r===s.toLowerCase())}};function Iie(e,t,r,s){const a=new Set(dA(e,t).map(l=>l.toLowerCase()));let i=r.map(l=>l.value).filter(l=>a.has(l.toLowerCase()));return i.length>1&&!s&&(i=[]),i}function Die(e,t,r){return mA(e,t,r)}function C8(e){const{title:t,items:r,query:s,disabled:a,filterPrefix:i,sizeVariant:l,updateQuery:u,multiselect:d=!1}=e,m=f.useMemo(()=>Array.isArray(r[0])?r.flat():r,[r]),p=f.useMemo(()=>Iie(s,i,m,d),[s,i,m,d]),g=v=>{u(Die(s,i,v))};return n.jsx(dP,{title:t,items:r,multiselect:d,disabled:a,selectedValues:p,updateSelectedValues:g,sizeVariant:l})}function _ie(){const{data:e,error:t,handleAction:r,setUserRole:s,isPosting:a,mutate:i}=Ss(),{data:l,mutate:u}=ot(),{access:d}=qt(de.UserInvites),m=Sn(d);f.useState(!1);const p=(C,b)=>r(C,b).then(()=>{C.id===l?.id&&u()}),{variant:g}=Fr("replace-learn-more-ctas-with-descriptive-ctas",!0),v=(C,b)=>s(C,b).then(()=>{(b==="owner"||C.id===l?.id)&&u()});let y;return l?(t?y=n.jsx(De,{error:t}):e?y=n.jsx(Lie,{currentUser:l,users:e?.users,isPosting:a,handleAction:p,setUserRole:v,mutate:i,className:"mt-8"}):y=n.jsx(De,{loadingMessage:"Loading users..."}),n.jsxs(mn,{title:"Users",description:"Manage the users in your network and their permissions.",learnMoreUrl:"https://tailscale.com/kb/1138/user-roles/",learnMoreLabel:g==="variant1"?"See how user roles work":void 0,additionalHeader:n.jsx(Hae,{}),children:[m&&n.jsx(Nie,{}),n.jsx("section",{children:y})]})):null}const Mie=100,mP=D(Ut.cellExpand,"flex items-center"),fP="hidden @sm:flex items-center @sm:w-1/5 @md:w-1/6",hP="hidden @md:flex items-center @md:w-1/6",pP="hidden @md:flex items-center @md:w-1/6",gP=D(Ut.cellAction,"items-center w-8");function Lie(e){const{data:t}=vt(),{shouldUseHybridEligibleUI:r}=bl(),{data:s}=Wi(),{billingUsage:a,data:i}=Nt(),l=e.users.sort((z,H)=>z.displayName.localeCompare(H.displayName)),u=e.users.some(z=>z.status===Je.OverBillingLimit),d=Rie({shouldUseHybridEligibleUI:r,readableProductID:i?.readableProductID,occupiedSeats:a?.usage.occupied_seats}),{query:m,setQuery:p,tmpQuery:g,setTmpQuery:v}=ns(),{results:y}=Aie({data:l,query:m});function C(z){v(z.target.value)}function b(){p(""),v("")}function w(z){z.preventDefault(),p(g)}const N=y.length,k=[];u&&k.push(Je.OverBillingLimit),k.push(Je.NeedsApproval),t.featureCanSendEmail&&k.push(Je.Invited),k.push(Je.Idle,Je.Suspended),r&&(s&&s.provisioningEnabled&&k.push(Je.ProvisionedOnly),k.push(Je.None));const E=Oie(l,k),T=Fie(l),_=r?[E,T]:[E],I=Bie(l,t.deviceAdminRole),F=Kv(y,Mie);return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:D(e.className,"flex justify-between gap-4"),children:[n.jsxs("div",{className:"items-center @md:flex mb-8 flex-grow",children:[n.jsx("form",{className:"flex-1 mb-2 @md:mb-0 @md:mr-4",onSubmit:w,children:n.jsx(Nu,{type:"text",name:"query",placeholder:"Search users...",onChange:C,onClearClick:b,value:g})}),n.jsxs("div",{className:"flex justify-end",children:[n.jsx(C8,{title:"Status",items:_,query:m,filterPrefix:"status",updateQuery:p}),n.jsx("div",{className:"ml-2",children:n.jsx(C8,{title:"Role",items:I,query:m,filterPrefix:"role",updateQuery:p})})]})]}),n.jsx(lA,{all:l,filtered:y,typeName:"user",headers:$ie})]}),n.jsxs(We,{variant:"status",className:"mb-4",children:[N," ",yt("user",N)]}),n.jsx(Uie,{users:F.pageData,currentUser:e.currentUser,canRestoreSuspendedUsers:d,isPosting:e.isPosting,mutate:e.mutate,setUserRole:e.setUserRole,handleAction:e.handleAction,emptyMessage:n.jsx(fn,{className:"py-6",description:m?`No users found matching “${m}”`:"No users found",action:m&&n.jsx("button",{className:"link",onClick:b,children:"Clear filters"})})}),F.pageCount>1&&n.jsx("div",{className:"flex justify-between mt-4",children:n.jsx(VA,{...F})})]})}function Rie(e){const{shouldUseHybridEligibleUI:t,readableProductID:r,occupiedSeats:s}=e,i=fl(r??"personal");if(!t||!i||s===void 0)return!0;const l=Xf("personal");return(s??Pu)r.status||"none",vP,t)}function Fie(e){return gy(e,t=>t.occupyingSeat?"occupyingseat":"notoccupyingseat",vP,["occupyingseat","notoccupyingseat"])}function Bie(e,t){const r=["owner","admin","network-admin","it-admin","auditor","billing-admin"];return t&&r.push("device-admin"),r.push("member"),[gy(e,s=>s.role,xP,r)]}function gy(e,t,r,s){return f.useMemo(()=>{const i=new Map;return e.forEach(l=>{const u=t(l);u!==void 0&&i.set(u,(i.get(u)??0)+1)}),s.map(l=>({value:l,display:r(l),count:i.get(l)??0}))},[e,s,t,r])}function Uie(e){const{users:t,canRestoreSuspendedUsers:r,isPosting:s,currentUser:a,mutate:i,handleAction:l,setUserRole:u,emptyMessage:d}=e;return n.jsx(n.Fragment,{children:n.jsxs("table",{className:"tb",children:[n.jsx("thead",{children:n.jsxs("tr",{children:[n.jsx("th",{className:mP,children:"User"}),n.jsx("th",{className:fP,children:"Role"}),n.jsx("th",{className:hP,children:"Joined"}),n.jsx("th",{className:pP,children:"Last seen"}),n.jsx("th",{className:gP,children:n.jsx("span",{className:"sr-only",children:"Users action menu"})})]})}),n.jsx("tbody",{children:t.length>0?t.map(m=>n.jsx(Vie,{user:m,allUsers:t,canRestoreSuspendedUser:r,isPosting:s,currentUser:a,handleAction:l,setUserRole:u,mutate:i},m.id||m.loginName||m.inviteId)):n.jsx("tr",{children:n.jsx("td",{className:"flex-auto",children:d})})})]})})}const Vie=ce.memo(e=>{const t=Yn(),{user:r,currentUser:s,allUsers:a,canRestoreSuspendedUser:i,isPosting:l,handleAction:u,setUserRole:d,mutate:m}=e,{currentTailnetID:p}=ot(),g=xP(r.role),[v,y]=f.useState("none"),{access:C}=qt(de.Users),{access:b}=qt(de.ExternalUsers),{access:w}=qt(de.UserRoles),{access:N}=qt(de.ACLs),{data:k}=Wi(),{data:E}=vt(),T=k&&k.provisioningEnabled&&!r.noLongerProvisioned,_=Sn(C)&&!T,I=Sn(b),F=Sn(w),z=r.id===s.id,H=r.orgTailnetId!==p,J=r.status===Je.Invited,Y=!J&&!z&&(_||I&&H),B=!J&&(Y||z&&!H&&_),W=z&&H,U=_&&r.status===Je.NeedsApproval,Z=!(_||I)&&!F,re=et(),me=Te=>Ue=>y(Ue?Te:"none"),[L,V]=f.useState(!1),[P,q]=f.useState(!1),{data:Q}=Rt(),ae=!!Q?.aclsExternallyManagedOn,X=f.useMemo(()=>r.inviterId?a.find(Te=>Te.id===r.inviterId):void 0,[a,r.inviterId]),fe=(L||P)&&U,{resendUserInvite:he,deleteUserInvite:se}=Ah(),le=r.inviteLastEmailSentAt?new Date(r.inviteLastEmailSentAt)>=Pw(t,{minutes:-1}):!1,Ae=f.useMemo(()=>[{type:"link",hidden:X===void 0,href:X===void 0?"":`/admin/users?q=${encodeURIComponent(X.loginName)}`,children:X&&n.jsxs("div",{className:"flex flex-col gap-1 max-w-xs",children:[n.jsx("div",{className:"text-gray-500 text-sm font-medium uppercase tracking-wider",children:"Invited by"}),n.jsxs("div",{className:"flex gap-2",children:[n.jsx(Lr,{sizeClassName:"w-5 h-5 text-sm",user:X}),n.jsx("span",{className:"truncate",children:X.displayName})]})]},r.inviteId)},{type:"separator",hidden:r.status!==Je.Invited||X===void 0},{type:"item",label:"Approve",hidden:!U,disabled:l,onSelect:()=>u(r,"approve")},{type:"link",label:"View devices",hidden:!r.loginName||r.status===Je.Invited,href:`/admin/machines?q=managedby:${encodeURIComponent(r.loginName)}`},{type:"link",label:"View recent activity",hidden:!E.auditLogs||r.status===Je.Invited,href:`/admin/logs?actors=["${encodeURIComponent(r.stableId)}"]`},{type:"link",label:"View access control rules",hidden:!r.loginName,href:`/admin/acls/preview?q=${encodeURIComponent(r.loginName)}`},{type:"separator",hidden:r.status!==void 0||Z},{type:"item",label:"Edit role…",hidden:!F||r.status===Je.Invited,disabled:l||r.isOwner||z||r.status===Je.Invited,onSelect:()=>y("edit-role")},{type:"item",label:"Edit group membership…",hidden:r.status===Je.Invited||!E.featureUserGroupDialog||!Sn(N)||ae,disabled:l,onSelect:()=>y("edit-acl-groups")},{type:"separator",hidden:!F||!Y||r.status===Je.Invited},{type:"item",label:"Restore user…",hidden:!Y||r.status!==Je.Suspended,disabled:l||z,onSelect:()=>y(i?"restore-user":"cannot-restore-user")},{type:"item",label:"Suspend user…",hidden:!Y||r.status===Je.Suspended||r.status===Je.OverBillingLimit||r.status===Je.NeedsApproval||r.status===Je.Invited,intent:"danger",disabled:l||r.isOwner||z,onSelect:()=>y("suspend-user")},{type:"item",label:"Delete user…",hidden:!B,intent:"danger",disabled:l||r.isOwner||z,onSelect:()=>y("delete-user")},{type:"link",label:"Leave tailnet…",intent:"danger",hidden:!W,href:vr("/leave-tailnet",{returnTo:"/admin"})},{type:"item",label:"Resend invite",hidden:r.status!==Je.Invited||!r.inviteId||!r.inviteEmail,disabled:le,icon:le?lw:void 0,onSelect:()=>he(r.inviteId).then(m)},{type:"item",label:"Copy invite link",hidden:r.status!==Je.Invited||!!r.loginName||!r.inviteUrl,onSelect:()=>Rr(r.inviteUrl).then(()=>{re.show({message:"Invite link copied to clipboard"})}).catch(()=>{re.show({message:"Failed to copy invite link to clipboard",variant:"danger"})})},{type:"item",label:"Delete invite",intent:"danger",hidden:r.status!==Je.Invited||!r.inviteId,onSelect:()=>se(r.inviteId).then(m)}],[U,l,r,E.auditLogs,E.featureUserGroupDialog,Z,F,z,N,ae,Y,B,W,i,le,u,he,re,X,se,m]);return n.jsxs("tr",{className:"px-0.5 hover:bg-gray-0 dark:hover:bg-gray-800 group",onMouseEnter:()=>q(!0),onMouseLeave:()=>q(!1),children:[n.jsxs("td",{className:D(mP,"relative w-0"),children:[n.jsx(Lr,{className:D((r.status===Je.Suspended||r.status===Je.Idle||r.status===Je.OverBillingLimit||r.status===Je.NeedsApproval||r.status===Je.Invited||r.status===Je.SuspendedGlobal)&&"grayscale opacity-50","mr-3"),sizeClassName:"w-8 h-8 @md:w-12 @md:h-12 @md:text-xl",user:r}),n.jsxs("div",{className:"min-w-0",children:[r.status===void 0?n.jsx("div",{className:"truncate",children:n.jsx(ze,{href:`/admin/machines?q=${r.loginName}`,className:"font-semibold stretched-link hover:text-text-primary",children:r.displayName})}):n.jsxs("div",{className:"flex",children:[n.jsx("div",{className:"mr-2 truncate",children:r.status===Je.Invited?r.inviteEmail||n.jsxs("code",{children:[r.invitePathPrefix,"…"]}):r.displayName||r.loginName}),n.jsxs("div",{className:"space-x-1",children:[r.status===Je.Idle&&n.jsx(oae,{}),r.status===Je.Suspended&&n.jsx(y8,{}),r.status===Je.SuspendedGlobal&&n.jsx(y8,{global:!0}),r.status===Je.NeedsApproval&&n.jsx(qae,{}),r.status===Je.OverBillingLimit&&n.jsx(Zae,{}),r.status===Je.Invited&&n.jsx(Gae,{user:r}),r.status===Je.ProvisionedOnly&&n.jsx(Yae,{})]})]}),n.jsxs("div",{className:"truncate",children:[r.loginName,n.jsxs("span",{className:"@sm:hidden",children:[" · ",g]})]})]})]}),n.jsx("td",{className:fP,children:g}),n.jsx("td",{className:hP,children:r.created&&r.status!==Je.Invited?n.jsx(Fs,{time:new Date(r.created),format:"date"}):n.jsx(Ut.NullValue,{})}),n.jsx("td",{className:pP,children:n.jsx(kh,{date:r.lastSeen,connected:r.currentlyConnected})}),n.jsxs("td",{className:gP,children:[n.jsx("div",{className:D({"absolute flex items-stretch border border-border-interactive bg-bg-base shadow-md cursor-pointer divide-x rounded-md active:shadow focus:outline-none focus:ring":L||fe}),children:fe?n.jsxs(n.Fragment,{children:[n.jsx("button",{disabled:l,onClick:()=>{u(r,"approve")},className:"px-2 hover:bg-gray-0 dark:hover:bg-gray-800 first:rounded-l-md focus:outline-none focus:ring","aria-label":`Approve ${r.displayName||r.loginName}`,children:"Approve"}),n.jsx(el,{ariaLabel:`Actions for ${r.displayName||r.loginName}`,buttonClassName:D("!border-y-0 rounded-l-none group-hover:!shadow-none"),items:Ae,side:"bottom",onOpenChange:V})]}):n.jsx(el,{ariaLabel:`Actions for ${r.displayName||r.loginName}`,items:Ae,side:"bottom",buttonClassName:D({"!border-0":L}),onOpenChange:V})}),n.jsx(Ug,{open:v==="suspend-user",onOpenChange:me("suspend-user"),onSubmit:()=>{u(r,"suspend"),y("none")},user:r,disabled:l,action:"suspend_user"}),n.jsx(Ug,{open:v==="restore-user",onOpenChange:me("restore-user"),onSubmit:()=>{u(r,"restore"),y("none")},user:r,disabled:l,action:"restore_user"}),n.jsx(iae,{open:v==="cannot-restore-user",onOpenChange:me("cannot-restore-user")}),n.jsx(Ug,{open:v==="delete-user",onOpenChange:me("delete-user"),onSubmit:()=>{u(r,"delete")},user:r,disabled:l,action:"delete_user"}),n.jsx(hie,{open:v==="edit-role",onOpenChange:me("edit-role"),user:r,currentUser:s,isPosting:l,setUserRole:Te=>d(r,Te)}),E.featureUserGroupDialog&&n.jsx(lie,{open:v==="edit-acl-groups",onOpenChange:me("edit-acl-groups"),user:r})]})]})});function xP(e){switch(e){case"owner":return"Owner";case"admin":return"Admin";case"network-admin":return"Network admin";case"it-admin":return"IT admin";case"auditor":return"Auditor";case"billing-admin":return"Billing admin";case"device-admin":return"Device admin";case"member":return"Member";case"none":return"None"}}function vP(e){switch(e){case Je.None:return"No status";case Je.Idle:return"Idle";case Je.Suspended:return"Suspended";case Je.NeedsApproval:return"Needs Approval";case Je.OverBillingLimit:return"Unpaid";case Je.Invited:return"Invited";case Je.SuspendedGlobal:return"Suspended";case Je.ProvisionedOnly:return"Provisioned-only";case"occupyingseat":return"Occupying a seat";case"notoccupyingseat":return"Not occupying a seat";default:return e}}const $ie=[{name:"displayName",label:"Name"},{name:"loginName",label:"Username"},{name:"domainName",label:"Domain name"},{name:"sharedDomain",label:"Shared from domain"},{name:"created",label:"Joined"},{name:"role",label:"User role"},{name:"isAdmin",label:"Admin"},{name:"isOwner",label:"Owner"},{name:"lastSeen",label:"Last seen"}];function Hie(){f.useEffect(()=>{const e=document.querySelector("link.js-favicon");if(!e||!globalThis.matchMedia)return;const t=()=>{const s=r.matches?e.href.replace("favicon.ico","favicon-dark.ico"):e.href.replace("favicon-dark.ico","favicon.ico");e.setAttribute("href",s)},r=globalThis.matchMedia("(prefers-color-scheme: dark)");return r.addEventListener("change",t),t(),()=>r.removeEventListener("change",t)},[])}const Vg={source:"utm_source",medium:"utm_medium",name:"utm_campaign",content:"utm_content",term:"utm_term"};function zie(e){const t=Object.keys(Vg);t.some(s=>!!e[s])&&(t.forEach(s=>j8(Vg[s],"",-1)),t.forEach(s=>{const a=e[s];a&&j8(Vg[s],a,30)}))}const Wie={name:null,source:null,medium:null,term:null,content:null};let w8=!1;function Kie(e,t){if(!t||!globalThis)return;const r=Object.values(e).some(d=>!!d);r&&w8?e=Wie:r&&(w8=!0);const s=globalThis.document,a=globalThis.navigator,i=_0(),l=Nm(i),u={props:{path:t.pathname,url:t.href,search:t.search,referrer:s.referrer,title:s.title,requestedTheme:i,resolvedTheme:l},context:{userAgent:a.userAgent,locale:g2(),campaign:e}};Ie.post("/public/events/pageview",u).catch(()=>{})}function Gie(){const[t,r]=f.useState(null),s=I6(Kie,1e3),a=I6(zie,1e3),i=f.useCallback(()=>{const l=globalThis.location,u=l.pathname;if(u===t)return;r(u);const d=new URLSearchParams(l.search),m=qie(d);s(m,l),a(m)},[s,a,t]);f.useEffect(()=>(i(),globalThis.addEventListener("popstate",i),globalThis.addEventListener("pushState",i),globalThis.addEventListener("replaceState",i),()=>{globalThis.removeEventListener("popstate",i),globalThis.removeEventListener("pushState",i),globalThis.removeEventListener("replaceState",i)}),[i])}function qie(e){return{name:e.get("utm_campaign"),source:e.get("utm_source"),medium:e.get("utm_medium"),term:e.get("utm_term"),content:e.get("utm_content")}}function j8(e,t,r,s){const a={expires:r||void 0,sameSite:"Strict",path:"/"};a.domain="tailscale.com",D8.set(e,t,a)}function Du(e){return yP.push(e),ce.lazy(e)}const yP=[];function S8(){for(const e of yP)e()}globalThis.requestIdleCallback?globalThis.requestIdleCallback(S8):window.addEventListener("load",()=>{setTimeout(S8,3e3)});function Yie(){const[e]=ft();f.useEffect(()=>{const t=globalThis.location.hash;if(t){const r=t.replace("#",""),s=document.querySelector(`#${CSS.escape(r)}`);s&&s.scrollIntoView()}},[e])}const Zie=1e3*5;function Qie({children:e}){const[t,r]=f.useState(Date.now());return f.useEffect(()=>{const s=()=>{const a=Date.now();(!t||a-t>=Zie)&&(r(a),Ie.post("self/activity"))};return globalThis.addEventListener("click",s),globalThis.addEventListener("keydown",s),()=>{globalThis.removeEventListener("click",s),globalThis.removeEventListener("keydown",s)}},[t]),n.jsx(n.Fragment,{children:e})}const Jie="/admin/assets/aperture-ui-screenshot-light-JmXR9ENg.png",Xie="/admin/assets/aperture-ui-screenshot-dark-LQBwyzX1.png",k8={eventProperties:{productArea:K.Billing,productSubArea:oe.ApertureAwarenessBanner}};function N8(e){const{dismissNotice:t}=mu();return n.jsx(at,{empty:!0,noPadding:!0,className:`container relative mx-auto mt-6 mb-8 overflow-hidden sidenav:w-full sidenav:max-w-none sidenav:mx-0 /* Light Mode */ bg-[linear-gradient(0deg,rgba(63,93,179,0.72)-15.24%,rgba(133,170,245,0.54)7.65%,rgba(173,199,252,0.24)33.05%,rgba(63,93,179,0)50%,transparent_50%)] @md:bg-[linear-gradient(90deg,transparent_50%,rgba(63,93,179,0)50%,rgba(173,199,252,0.24)66.95%,rgba(133,170,245,0.54)92.35%,rgba(63,93,179,0.72)115.24%)] /* Dark Mode */ dark:bg-[linear-gradient(0deg,rgba(90,130,222,0.75)-9.96%,rgba(75,112,204,0.5)9.83%,rgba(63,93,179,0.25)29.62%,rgba(50,73,148,0)50%,transparent_50%)] dark:@md:bg-[linear-gradient(90deg,transparent_50%,rgba(50,73,148,0)50%,rgba(63,93,179,0.25)70.38%,rgba(75,112,204,0.5)90.17%,rgba(90,130,222,0.75)109.96%)]`,...e,children:n.jsxs("div",{className:"flex flex-col @md:gap-3 items-start @md:justify-between @md:flex-row @md:items-center ",children:[n.jsxs("div",{className:"flex flex-col gap-3 p-6 @md:flex-grow",children:[n.jsx("h3",{className:"text-xl @md:text-lg font-medium",children:e.title}),n.jsx("p",{className:"text-lg @md:text-base",children:e.body}),n.jsxs("div",{className:"flex flex-row gap-3 items-center",children:[n.jsx(Vt,{intent:"primary",to:"https://aperture.tailscale.com/signup?ref=discover-aperture-banner",onClick:()=>{O(R.ApertureBannerSignupClicked,k8)},children:"Sign up"}),n.jsx(ue,{intent:"base",variant:"minimal",onClick:()=>{t("ApertureAwarenessBanner"),O(R.ApertureAwarenessBannerDismissed,k8)},children:"Dismiss"})]})]}),n.jsxs("div",{className:"max-w-96 @md:max-w-none flex-shrink-0 self-center @md:self-auto px-6 pb-4 @md:py-4 @md:flex-grow-0",children:[n.jsx("img",{src:Jie,alt:"A screenshot from the Aperture dashboard displaying information about token usage and total spend.",className:"dark:hidden @md:h-32 w-full"}),n.jsx("img",{src:Xie,alt:"A screenshot from the Aperture dashboard displaying information about token usage and total spend.",className:"hidden dark:block @md:h-32 w-full"})]})]})})}const eoe=Coe({id:"aperture",defaultPriority:30,experimentKey:"help-ai-use-case-tailnets-discover-aperture",segment:{useCase:"AI Infrastructure Access",pathPrefix:"/admin/machines",dismissNoticeKey:"ApertureAwarenessBanner"},variants:{control:null,variant1:n.jsx(N8,{title:"Simplify secure connectivity for AI agents with Aperture ",body:"Protect your API keys, audit LLM sessions, and control tool calls from a single interface."}),variant2:n.jsx(N8,{title:"Take control of your AI costs with Aperture",body:"Get full visibility into token spend and set per-user quotas so AI usage never turns into a surprise bill."})}});function toe(){return n.jsxs(n.Fragment,{children:[n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 254 138",className:"hidden @md:block absolute inset-y-0 right-0 h-full pointer-events-none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("rect",{y:"87",width:"112",height:"112",rx:"56",fill:"#EEEBEA",className:"dark:fill-gray-700"}),n.jsx("rect",{x:"225",y:"-25",width:"112",height:"112",rx:"56",fill:"#DAD6D5",className:"dark:fill-gray-600"}),n.jsx("rect",{x:"339",y:"87",width:"112",height:"227",rx:"56",transform:"rotate(90 339 87)",fill:"#DAD6D5",className:"dark:fill-gray-600"}),n.jsx("rect",{x:"112",y:"-25",width:"112",height:"112",fill:"#EEEBEA",className:"dark:fill-gray-700"})]}),n.jsxs("svg",{"aria-hidden":!0,viewBox:"0 0 275 245",className:"@md:hidden absolute inset-y-0 right-0 h-full pointer-events-none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("rect",{y:"224",width:"112",height:"112",rx:"56",fill:"#EEEBEA",className:"dark:fill-gray-700"}),n.jsx("rect",{x:"225",y:"112",width:"112",height:"112",rx:"56",fill:"#DAD6D5",className:"dark:fill-gray-600"}),n.jsx("rect",{x:"448",width:"112",height:"225",rx:"56",transform:"rotate(90 448 0)",fill:"#EEEBEA",className:"dark:fill-gray-700"}),n.jsx("rect",{x:"339",y:"224",width:"112",height:"227",rx:"56",transform:"rotate(90 339 224)",fill:"#DAD6D5",className:"dark:fill-gray-600"}),n.jsx("rect",{x:"112",y:"112",width:"112",height:"112",fill:"#EEEBEA",className:"dark:fill-gray-700"})]})]})}const noe=e=>f.createElement("svg",{width:40,height:40,viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("path",{d:"M20 0C31.0476 0 40 8.95238 40 20C40 31.0476 31.0317 40 20 40C8.96825 40 0 31.0476 0 20C1.3847e-06 8.95238 8.95238 1.38461e-06 20 0ZM4.51758 12.8242C3.7404 12.4612 2.83745 12.9848 2.67871 13.6982C2.48838 14.3803 2.96361 15.2199 3.80371 15.332L3.80273 15.3379L2.67578 17.623L4.19922 15.4961C4.19922 15.5119 4.10545 18.5289 4.10449 18.5596L4.5332 16.2578C5.67606 18.4324 8.19958 21.7824 11.7393 24.2744C12.0091 24.4649 12.3586 24.7978 12.4697 24.9248C12.4998 24.9399 15.8736 26.6214 21.0566 22.6709C21.1043 22.6392 21.1682 22.6069 21.2158 22.5752L21.2949 22.623L22.4375 23.3848C22.0459 23.2751 21.2992 23.089 21.2793 23.084C18.7714 25.9728 14.6914 26.4486 12.501 24.9883C12.4052 24.9252 11.8667 25.1476 11.7715 25.4648C11.7081 25.6394 11.7712 25.8298 11.8506 25.9727C12.295 26.7978 12.9609 26.7185 12.6436 27.6865C12.4214 28.2103 12.1041 28.7182 11.7549 29.1943C11.0249 30.1782 9.88285 31.0513 9.99316 31.5752C15.1678 37.9561 26.8349 37.0676 31.2793 31.3691C31.2156 30.5439 29.9135 30.1466 29.0088 28.1309C29.2628 28.2102 29.6436 28.3215 29.6436 28.3057C29.6345 28.2753 28.564 26.543 28.5166 26.3691L29.2158 26.417C29.2158 26.417 28.2944 25.2742 28.2627 25.1631L29.1992 25.0361C29.1872 25.0223 28.0246 23.6857 28.0088 23.5752L29.1992 23.7666L27.8984 22.1943H28.5166L27.7871 21.1309L21.8662 18.7979C19.5964 17.3852 17.5804 15.6546 16.0566 14.3213L12.9932 12.8301C10.0567 12.6079 7.31046 12.6872 5.62793 13.0205L6.70801 11.1787L5.13574 13.0518C5.04058 13.0201 4.92969 12.9883 4.92969 12.9883L5.04102 10.6074L4.51758 12.8242ZM30.582 10.5439C29.2645 7.11551 24.1375 4.62381 20.6455 6.02051C20.0107 6.27445 19.4393 6.6396 18.9473 7.08398C18.7886 7.02052 18.6296 6.98831 18.4551 6.98828C17.5979 6.98828 16.693 7.71921 16.2168 8.81445C15.8836 9.60789 15.8197 10.4489 16.0576 11.0996C14.8194 11.3693 12.0421 11.0366 11.3438 11.0049C11.3914 11.0366 11.4551 11.0679 11.5186 11.0996L16.5977 13.5127L16.6455 13.5605C18.1534 14.878 20.1537 16.5916 22.3916 17.9883C23.8202 18.7502 28.7883 20.4336 29.0264 20.4971C28.4233 19.021 30.0417 17.0526 30.4863 15.6875C31.026 14.0208 31.217 12.2106 30.582 10.5439Z",fill:"currentColor"}),f.createElement("path",{d:"M16.5264 8.93018C17.082 7.67653 18.2087 6.96261 19.0498 7.32764C19.891 7.70866 20.1454 9.01026 19.5898 10.2642C19.0343 11.5181 17.9067 12.2318 17.0654 11.8667C16.2244 11.4856 15.9709 10.184 16.5264 8.93018ZM18.9121 7.61572C18.2615 7.33119 17.3469 7.98629 16.8691 9.07861C16.3914 10.1709 16.5311 11.2872 17.1816 11.5718C17.8322 11.8562 18.7469 11.2011 19.2246 10.1089C19.7023 9.01673 19.5624 7.90047 18.9121 7.61572Z",fill:"currentColor"})),$g={eventProperties:{productArea:K.Billing,productSubArea:oe.MullvadAwarenessBanner}};function roe(e){const{dismissNotice:t}=mu();return n.jsxs(at,{empty:!0,className:"container relative mx-auto mt-6 mb-8 overflow-hidden sidenav:w-full sidenav:max-w-none sidenav:mx-0",...e,children:[n.jsx(toe,{}),n.jsx(ue,{intent:"base",variant:"minimal",className:"absolute bottom-3 right-3 z-10",onClick:()=>{t(i2.MullvadAwarenessBanner),O(R.MullvadAwarenessBannerDismissClicked,$g)},children:"Dismiss"}),n.jsxs("div",{className:"flex gap-3 items-start",children:[n.jsx(noe,{className:"w-10 h-10 flex-shrink-0"}),n.jsxs("div",{className:"relative flex flex-col gap-3",children:[n.jsxs("h3",{className:"text-lg font-medium",children:["Did you know you can browse privately with Mullvad VPN?",n.jsx(Qo,{className:"ml-2 sm:ml-3 -inset-[0.125rem]"})]}),n.jsx("p",{children:"For $5 per month for every 5 devices, get instant access to hundreds of servers in 40+ countries around the world."}),n.jsxs("div",{className:"flex flex-col gap-3 items-start md:flex-row md:items-center",children:[n.jsx(Vt,{intent:"primary",to:"/admin/settings/billing/add/mullvad",onClick:()=>{O(R.MullvadAwarenessBannerPurchaseClicked,$g)},children:"Purchase add-on"}),n.jsx(Ge,{url:"https://tailscale.com/docs/features/exit-nodes/mullvad-exit-nodes",label:"Learn about Mullvad exit nodes",kbTopic:"Mullvad exit nodes",onClick:()=>{O(R.MullvadAwarenessBannerLearnMoreClicked,$g)}})]})]})]})]})}const soe=20,aoe=3,ioe={id:"mullvad",useCandidate(){const{inSegment:e}=Xs({isSharedDomain:!0,isBusiness:!1,hasMullvadAddOn:!1,minDeviceCount:aoe,pathPrefix:"/admin/machines",dismissNoticeKey:"MullvadAwarenessBanner"});return e?{id:"mullvad",priority:soe,node:n.jsx(Se,{permission:de.Billing,readWrite:t=>n.jsx(f.Suspense,{fallback:null,children:n.jsx(roe,{...t})})})}:null}};function ooe({className:e}){return n.jsx("div",{className:D("absolute inset-0 size-full overflow-hidden rounded-md","border border-border-base","bg-gradient-to-bl from-[#FAF9F8] to-[#F9F7F6]","dark:from-[#1F1E1E] dark:to-[#2E2D2D]",e),children:n.jsx(loe,{className:"absolute -bottom-32 -right-1 max-w-none"})})}function loe({className:e}){return n.jsxs("svg",{width:"459",height:"344",viewBox:"666 16 458.4 343.801",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,children:[n.jsx("rect",{x:"1009.8",y:"245.201",width:"114.6",height:"114.6",rx:"57.3",fill:"currentColor",className:"text-gray-200 dark:text-gray-900"}),n.jsx("rect",{x:"895.203",y:"245.201",width:"114.6",height:"114.6",rx:"57.3",fill:"currentColor",className:"text-gray-100 dark:text-gray-800"}),n.jsx("rect",{x:"780.602",y:"245.201",width:"114.6",height:"114.6",rx:"57.3",fill:"currentColor",className:"text-gray-200 dark:text-gray-900"}),n.jsx("rect",{x:"666",y:"245.201",width:"114.6",height:"114.6",rx:"57.3",fill:"currentColor",className:"text-gray-100 dark:text-gray-800"}),n.jsx("rect",{x:"1009.8",y:"16",width:"114.6",height:"114.6",rx:"57.3",fill:"currentColor",className:"text-gray-200 dark:text-gray-900"}),n.jsx("rect",{x:"895.203",y:"16",width:"114.6",height:"114.6",rx:"57.3",fill:"currentColor",className:"text-gray-100 dark:text-gray-800"}),n.jsx("rect",{x:"1009.8",y:"130.602",width:"114.6",height:"114.6",rx:"57.3",fill:"currentColor",className:"text-gray-100 dark:text-gray-800"}),n.jsx("rect",{x:"895.203",y:"130.602",width:"114.6",height:"114.6",rx:"57.3",fill:"currentColor",className:"text-gray-200 dark:text-gray-900"}),n.jsx("rect",{x:"780.602",y:"130.602",width:"114.6",height:"114.6",rx:"57.3",fill:"currentColor",className:"text-gray-100 dark:text-gray-800"})]})}const pm=Eh.map(e=>({type:"string-constant",label:e.label,value:e.value,description:e.description}));function coe(e){const{className:t}=e,{data:r,isLoading:s}=Rt(),{dismissNotice:a}=mu(),[,i]=rl(),l=f.useMemo(()=>{const v=r?.personalization?.useCase,y=pm.find(b=>b.value===v);if(y)return y;if(!r||s)return null;const C=Bi(r)?"VPN Replacement":"Personal or At-Home Use";return pm.find(b=>b.value===C)??pm[0]},[r,s]),[u,d]=f.useState(),m=u??l,p=m?Eh.find(v=>v.value===m.value)?.subtitleQualifier??"":"",g=f.useMemo(()=>m?YA.filter(v=>v.useCases.includes(m.value)):[],[m]);return m?n.jsxs(at,{className:D("relative overflow-hidden bg-gray-0 dark:bg-gray-800 border-0",t),children:[n.jsx(ooe,{}),n.jsxs("div",{className:"relative z-20 flex flex-col gap-3",children:[n.jsxs("div",{className:"flex flex-col gap-3 @md:flex-row @md:items-center @md:justify-between @md:gap-6",children:[n.jsx("h3",{className:"font-medium text-lg",children:"Welcome! See what’s possible"}),n.jsxs("div",{className:"flex flex-col gap-1 @md:flex-row @md:items-center @md:gap-3 @md:flex-shrink-0",children:[n.jsx("label",{children:"What do you want to do?"}),n.jsx(br,{buttonClassName:"min-w-[220px] !bg-bg-base",values:pm,selected:m,onUpdateSelected:v=>{const y=v;y.value!==m.value&&O(R.SolutionGuidesUseCaseChanged,{solutionGuidesProperties:{useCase:y.value,previousUseCase:m.value}}),d(y)}})]})]}),n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsxs("p",{children:["Try these solution guides for popular ",p," use cases:"]}),n.jsx("div",{className:"grid grid-cols-1 gap-3 @md:grid-cols-3",children:g.map((v,y)=>n.jsx(uoe,{guide:v,useCase:m.value},y))})]}),n.jsxs("div",{className:"flex flex-col gap-2 @md:flex-row @md:items-center @md:justify-between @md:gap-6",children:[n.jsxs("p",{className:"text-text-muted @md:min-w-0",children:["Not seeing what you want? Get started with this"," ",n.jsx("a",{href:"https://www.youtube.com/watch?v=sPdvyR7bLqI",target:"_blank",rel:"noopener noreferrer",onClick:()=>{O(R.SolutionGuidesVideoLinkClicked,{solutionGuidesProperties:{useCase:m.value}})},className:"link-underline",children:"10-minute video"})]}),n.jsx(ue,{variant:"minimal",sizeVariant:"small",onClick:()=>{O(R.SolutionGuidesDismissed,{solutionGuidesProperties:{useCase:m.value}}),a(i2.SolutionGuides),i(v=>{const y=new URLSearchParams(v);return y.set(R0,"true"),y})},className:"self-end @md:self-auto @md:flex-shrink-0",children:"Dismiss"})]})]})]}):null}function uoe({guide:e,useCase:t}){return n.jsxs("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",onClick:()=>{O(R.SolutionGuidesTileClicked,{solutionGuidesProperties:{useCase:t,guideTitle:e.title,guideUrl:e.url}})},className:"flex items-center gap-3 px-3 py-3 rounded-md bg-bg-base border hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",children:[n.jsx("span",{className:"flex-shrink-0 w-9 h-9 self-start flex items-center justify-center text-text-muted",children:e.icon}),n.jsx("span",{className:"flex-1 text-text-base",children:e.title}),n.jsx(js,{size:18,className:"flex-shrink-0 text-text-muted","aria-hidden":!0})]})}const doe=11,moe={id:"solution-guides",useCandidate(){const{inSegment:e}=Xs({isSharedDomain:!0,minDeviceCount:2,pathPrefix:"/admin/machines",dismissNoticeKey:"SolutionGuides"});return e?{id:"solution-guides",priority:doe,node:n.jsx(coe,{className:"container mx-auto mt-6 mb-8 sidenav:w-full sidenav:max-w-none sidenav:mx-0"})}:null}},foe=e=>f.createElement("svg",{width:90,height:121,viewBox:"0 0 90 121",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("g",{filter:"url(#filter0_d_758_3051)"},f.createElement("g",{clipPath:"url(#clip0_758_3051)"},f.createElement("rect",{x:4,y:2,width:82,height:112.549,rx:6.43137,fill:"#DAD6D5"}),f.createElement("rect",{x:-10,y:2,width:104,height:58,fill:"url(#paint0_linear_758_3051)"}),f.createElement("rect",{width:107.725,height:54.6667,transform:"matrix(1 0 0 -1 -4.03922 114.549)",fill:"url(#paint1_linear_758_3051)"}),f.createElement("path",{d:"M44.5349 96.7086C38.8938 96.7086 34.052 95.2812 30.0095 92.4264C25.9899 89.5487 22.8953 85.4035 20.7256 79.9907C18.5788 74.5551 17.5054 68.0118 17.5054 60.3609C17.5282 52.7099 18.613 46.2009 20.7599 40.8338C22.9295 35.4439 26.0242 31.3329 30.0438 28.5009C34.0862 25.6689 38.9166 24.2529 44.5349 24.2529C50.1532 24.2529 54.9836 25.6689 59.0261 28.5009C63.0685 31.3329 66.1632 35.4439 68.31 40.8338C70.4797 46.2237 71.5645 52.7327 71.5645 60.3609C71.5645 68.0347 70.4797 74.5894 68.31 80.025C66.1632 85.4377 63.0685 89.5715 59.0261 92.4264C55.0065 95.2812 50.1761 96.7086 44.5349 96.7086ZM44.5349 85.9859C48.92 85.9859 52.38 83.8276 54.9151 79.5111C57.473 75.1717 58.752 68.7883 58.752 60.3609C58.752 54.7882 58.1696 50.1063 57.0049 46.3151C55.8401 42.5238 54.1957 39.669 52.0717 37.7506C49.9477 35.8093 47.4354 34.8386 44.5349 34.8386C40.1727 34.8386 36.7241 37.0083 34.189 41.3477C31.6539 45.6642 30.375 52.0019 30.3521 60.3609C30.3293 65.9563 30.8888 70.6611 32.0308 74.4752C33.1955 78.2892 34.8399 81.1669 36.9639 83.1082C39.0879 85.0266 41.6116 85.9859 44.5349 85.9859Z",fill:"white"}),f.createElement("rect",{x:-24.9412,y:59.8823,width:118.98,height:1.60784,fill:"#DAD6D5"}),f.createElement("rect",{x:82.7843,y:55.0588,width:3.21569,height:11.2549,fill:"#DAD6D5"}),f.createElement("rect",{x:4,y:55.0588,width:3.21569,height:11.2549,fill:"#DAD6D5"}))),f.createElement("defs",null,f.createElement("filter",{id:"filter0_d_758_3051",x:0,y:0,width:90,height:120.549,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},f.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),f.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),f.createElement("feOffset",{dy:2}),f.createElement("feGaussianBlur",{stdDeviation:2}),f.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0"}),f.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_758_3051"}),f.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_758_3051",result:"shape"})),f.createElement("linearGradient",{id:"paint0_linear_758_3051",x1:42,y1:2,x2:42,y2:60,gradientUnits:"userSpaceOnUse"},f.createElement("stop",null),f.createElement("stop",{offset:1,stopColor:"#1F1E1E"})),f.createElement("linearGradient",{id:"paint1_linear_758_3051",x1:53.8627,y1:0,x2:53.8627,y2:54.6667,gradientUnits:"userSpaceOnUse"},f.createElement("stop",null),f.createElement("stop",{offset:1,stopColor:"#1F1E1E"})),f.createElement("clipPath",{id:"clip0_758_3051"},f.createElement("rect",{x:4,y:2,width:82,height:112.549,rx:6.43137,fill:"white"})))),hoe=e=>f.createElement("svg",{width:90,height:121,viewBox:"0 0 90 121",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},f.createElement("g",{filter:"url(#filter0_d_758_2842)"},f.createElement("g",{clipPath:"url(#clip0_758_2842)"},f.createElement("rect",{x:4,y:2,width:82,height:112.549,rx:6.43137,fill:"#DAD6D5"}),f.createElement("rect",{x:-10,y:2,width:104,height:58,fill:"url(#paint0_linear_758_2842)"}),f.createElement("rect",{width:107.725,height:54.6667,transform:"matrix(1 0 0 -1 -4.03922 114.549)",fill:"url(#paint1_linear_758_2842)"}),f.createElement("path",{d:"M44.5349 96.7086C38.8938 96.7086 34.052 95.2812 30.0095 92.4264C25.9899 89.5487 22.8953 85.4035 20.7256 79.9907C18.5788 74.5551 17.5054 68.0118 17.5054 60.3609C17.5282 52.7099 18.613 46.2009 20.7599 40.8338C22.9295 35.4439 26.0242 31.3329 30.0438 28.5009C34.0862 25.6689 38.9166 24.2529 44.5349 24.2529C50.1532 24.2529 54.9836 25.6689 59.0261 28.5009C63.0685 31.3329 66.1632 35.4439 68.31 40.8338C70.4797 46.2237 71.5645 52.7327 71.5645 60.3609C71.5645 68.0347 70.4797 74.5894 68.31 80.025C66.1632 85.4377 63.0685 89.5715 59.0261 92.4264C55.0065 95.2812 50.1761 96.7086 44.5349 96.7086ZM44.5349 85.9859C48.92 85.9859 52.38 83.8276 54.9151 79.5111C57.473 75.1717 58.752 68.7883 58.752 60.3609C58.752 54.7882 58.1696 50.1063 57.0049 46.3151C55.8401 42.5238 54.1957 39.669 52.0717 37.7506C49.9477 35.8093 47.4354 34.8386 44.5349 34.8386C40.1727 34.8386 36.7241 37.0083 34.189 41.3477C31.6539 45.6642 30.375 52.0019 30.3521 60.3609C30.3293 65.9563 30.8888 70.6611 32.0308 74.4752C33.1955 78.2892 34.8399 81.1669 36.9639 83.1082C39.0879 85.0266 41.6116 85.9859 44.5349 85.9859Z",fill:"#232222"}),f.createElement("rect",{x:-24.9412,y:59.8823,width:118.98,height:1.60784,fill:"#1F1E1E"}),f.createElement("rect",{x:82.7843,y:55.0588,width:3.21569,height:11.2549,fill:"#1F1E1E"}),f.createElement("rect",{x:4,y:55.0588,width:3.21569,height:11.2549,fill:"#1F1E1E"}))),f.createElement("defs",null,f.createElement("filter",{id:"filter0_d_758_2842",x:0,y:0,width:90,height:120.549,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},f.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),f.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),f.createElement("feOffset",{dy:2}),f.createElement("feGaussianBlur",{stdDeviation:2}),f.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.05 0"}),f.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_758_2842"}),f.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_758_2842",result:"shape"})),f.createElement("linearGradient",{id:"paint0_linear_758_2842",x1:42,y1:2,x2:42,y2:60,gradientUnits:"userSpaceOnUse"},f.createElement("stop",{stopColor:"#EEEBEA"}),f.createElement("stop",{offset:1,stopColor:"#F9F7F6"})),f.createElement("linearGradient",{id:"paint1_linear_758_2842",x1:53.8627,y1:0,x2:53.8627,y2:54.6667,gradientUnits:"userSpaceOnUse"},f.createElement("stop",{stopColor:"#EEEBEA"}),f.createElement("stop",{offset:1,stopColor:"#F9F7F6"})),f.createElement("clipPath",{id:"clip0_758_2842"},f.createElement("rect",{x:4,y:2,width:82,height:112.549,rx:6.43137,fill:"white"})))),fx=f.memo(function({id:t,name:r,description:s,price:a,onClick:i,to:l,elevated:u,className:d,badge:m,badgeColor:p,ctaText:g}){const v=n.jsxs(at,{elevated:u,className:D("grid grid-rows-subgrid row-span-4 gap-2 rounded-xl p-[20px]","w-full @md:w-[250px]",m&&"relative z-10 bg-bg-base",d),children:[n.jsxs("div",{className:"flex items-center justify-between",children:[n.jsx("div",{className:"text-3xl font-medium",children:r}),n.jsx(Vv,{className:"self-end",product:t,height:32})]}),n.jsxs("div",{className:"flex items-end gap-2 mt-2",children:[n.jsx("p",{className:"text-3xl font-medium leading-none",children:a}),n.jsx("p",{className:"leading-none",children:pH(t).toLowerCase()})]}),n.jsx("div",{children:s&&n.jsx("p",{className:"text-sm leading-relaxed",children:s})}),n.jsx("div",{className:"self-end mt-2",children:l&&n.jsx(Vt,{intent:"primary",sizeVariant:"small",className:"w-full font-medium",to:l,onClick:i,children:g??"Select"})})]});return m?n.jsxs("div",{className:"relative grid grid-rows-subgrid row-span-4",children:[n.jsx("div",{className:D("absolute -top-6 left-0 right-0 z-0","pt-1 px-4 pb-10 rounded-tl-xl rounded-tr-xl","text-center text-sm font-semibold uppercase tracking-wide","border border-gray-200 dark:border-gray-700",p==="blue"?"bg-blue-50 dark:bg-blue-800 text-blue-600 dark:text-blue-50":"bg-gray-0 dark:bg-gray-800 text-text-muted"),children:m}),v]}):v});fx.displayName="MiniPlanCard";const Hg="EXTENDTRIAL26";function xy(){const{data:e}=Nt(),{inSegment:t}=Xs({isBusiness:!0,inEnterpriseTrial:!0,permissions:[{permission:de.Billing,access:"write"}],flags:{trialNoBanner:!1},excludePathPrefix:["/admin/settings","/admin/resource-hub"]});return!t||!e?.trialEnd?!1:j7(new Date(e.trialEnd))===0}const bP=f.memo(function(){const t=xy();return f.useEffect(()=>{t&&O(R.TrialExpiredBannerViewed,{eventProperties:{productArea:K.Billing,productSubArea:oe.TrialExpiredBanner}})},[t]),t?n.jsx(pl,{experimentKey:"trial-expired-banner-optimization-v2",enabled:t,variants:{control:n.jsx(E8,{}),variant1:n.jsx(E8,{showPromoCode:!0})}}):null});bP.displayName="TrialExpiredBanner";const E8=f.memo(function({showPromoCode:t}){return n.jsx("div",{className:"-mt-6 mb-6 border-b sidenav:border sidenav:rounded-lg sidenav:mt-6 sidenav:mb-8 overflow-hidden relative bg-gradient-to-b from-white dark:from-gray-1000 to-gray-200/20 dark:to-gray-900/20",children:n.jsxs("div",{className:"py-6 px-9 @md:container mx-auto relative",children:[n.jsxs("div",{className:"flex flex-col @md:flex-row gap-6 items-center",children:[n.jsx("div",{className:"relative z-20 flex flex-col gap-5 @md:flex-1",children:n.jsxs("div",{className:"flex items-center gap-5",children:[n.jsxs("div",{role:"img","aria-label":"0 days left",className:"flex flex-col items-center shrink-0",children:[n.jsx(hoe,{"aria-hidden":"true",className:"h-[120px] w-auto block dark:hidden"}),n.jsx(foe,{"aria-hidden":"true",className:"h-[120px] w-auto hidden dark:block"}),n.jsx("span",{className:"mt-2 text-xs uppercase tracking-wide text-text-muted",children:"Days left"})]}),n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsx("h2",{className:Et.pageTitle,children:"Your free trial has ended"}),n.jsx("p",{className:"max-w-[400px] text-lg",children:"Don’t worry, keep everything you’ve set up by choosing a plan."}),n.jsx("div",{children:n.jsx(Vt,{className:"mt-2",sizeVariant:"small",to:"/admin/settings/billing/plans",onClick:()=>O(R.ComparePlansClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.TrialExpiredBanner}}),children:"Compare all plans"})})]})]})}),n.jsxs("div",{className:"flex flex-col gap-2",children:[n.jsxs("div",{className:"relative z-20 grid grid-cols-1 grid-rows-[repeat(4,auto)] gap-x-4 gap-y-4 pt-8 @md:grid-cols-2 @md:justify-end",children:[n.jsx(fx,{id:"hybrid_standard",name:"Standard",description:"For teams looking for a secure network access solution that’s easy to use and deploy.",price:"$8",elevated:!0,badge:"Most popular",badgeColor:"blue",ctaText:"Choose Standard",to:"/admin/settings/billing/checkout/hybrid_standard",onClick:()=>O(R.SelectHybridStandardPlanButtonClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.TrialExpiredBanner}})}),n.jsx(fx,{id:"hybrid_premium",name:"Premium",description:"For organizations with strong compliance needs, operational visibility, and priority support.",price:"$18",elevated:!0,ctaText:"Choose Premium",to:"/admin/settings/billing/checkout/hybrid_premium",onClick:()=>O(R.SelectHybridPremiumPlanButtonClicked,{eventProperties:{productArea:K.Billing,productSubArea:oe.TrialExpiredBanner}})})]}),t&&n.jsx(poe,{})]})]}),n.jsx(GE,{topSVGClassName:"-top-[200px] -right-[180px]",bottomSVGClassName:"-bottom-[280px] -left-[360px]"})]})})}),poe=f.memo(function(){const t=et(),r=()=>{Rr(Hg),t.show({message:"Copied promo code to the clipboard"}),O(R.TrialExpiredBannerPromoCodeCopied,{eventProperties:{productArea:K.Billing,productSubArea:oe.TrialExpiredBanner}})};return n.jsxs("p",{className:"text-center @md:text-left text-sm text-text-muted",children:["Need more time? Use promo code"," ",n.jsxs("button",{type:"button",onClick:r,"aria-label":`Copy promo code ${Hg}`,className:"font-semibold text-text-base cursor-pointer hover:text-blue-500 dark:hover:text-blue-400",children:[Hg," ",n.jsx(Lc,{size:12,className:"inline-block"})]})," ","to get your first month on a new plan free."]})}),goe=Object.freeze(Object.defineProperty({__proto__:null,default:bP,useTrialExpiredBannerVisible:xy},Symbol.toStringTag,{value:"Module"})),xoe=ce.lazy(()=>$e(()=>Promise.resolve().then(()=>goe),void 0)),voe=10,yoe={id:"trial-expired",useCandidate(){return xy()?{id:"trial-expired",priority:voe,node:n.jsx(f.Suspense,{fallback:null,children:n.jsx(xoe,{})})}:null}};function boe(e,t){const r=e?.mainPageBanner;if(!r||typeof r!="object")return t;const s=r.priority;return typeof s=="number"&&Number.isFinite(s)?s:t}function Coe(e){return{id:e.id,useCandidate(){const{inSegment:t}=Xs(e.segment),{variant:r,payload:s}=Fr(e.experimentKey,t),a=e.variants[r];return a==null?null:{id:e.id,priority:boe(s,e.defaultPriority),node:a}}}}const woe=[yoe,moe,eoe,ioe];function joe(){const e=[];for(const r of woe){const s=r.useCandidate();s&&e.push(s)}const t=Soe(e);return t.length===0?null:n.jsx("div",{className:"@container sidenav:max-w-content-wide sidenav:mx-auto sidenav:px-6 lg:sidenav:px-10",children:t.map(r=>n.jsx(ce.Fragment,{children:r.node},r.id))})}function Soe(e){if(e.length===0)return[];const t=Math.min(...e.map(r=>r.priority));return e.filter(r=>r.priority===t)}const koe=Du(()=>$e(()=>import("./acl-view-HhlDyj24.js").then(e=>e.b),__vite__mapDeps([33,34,35,27,12,36,37,38,39]))),Noe=Du(()=>$e(()=>import("./dns-view-DF64kAou.js"),__vite__mapDeps([40,41,42]))),Eoe=ce.lazy(()=>$e(()=>import("./services-view-BeCeVvyc.js"),__vite__mapDeps([43,41,44,45,38]))),Aoe=ce.lazy(()=>$e(()=>Promise.resolve().then(()=>$te),void 0)),Poe=ce.lazy(()=>$e(()=>Promise.resolve().then(()=>IQ),void 0)),Toe=ce.lazy(()=>$e(()=>Promise.resolve().then(()=>Ute),void 0)),Ioe=ce.lazy(()=>$e(()=>import("./seat-calculator-view-DtgsH-WR.js"),__vite__mapDeps([46,47,36]))),zg=Du(()=>$e(()=>import("./logs-view-DAEUGWrb.js"),__vite__mapDeps([48,49]))),A8=Du(()=>$e(()=>import("./log-streaming-setup-page-BZ7sChxv.js"),__vite__mapDeps([50,51,49,11,12]))),Doe=Du(()=>$e(()=>import("./pam-session-details-view-DQh1Aj8a.js"),__vite__mapDeps([52,53,34,35,54]))),gm=ce.lazy(()=>$e(()=>Promise.resolve().then(()=>one),void 0)),_oe=ce.lazy(()=>$e(()=>import("./onboarding-all-set-dialog-DIFz1JGN.js"),[])),Moe=ce.lazy(()=>$e(()=>import("./design-view-QEyiaBjC.js"),__vite__mapDeps([55,56,36]))),Loe=ce.lazy(()=>$e(()=>import("./acl-gui-view-CDiGVdri.js"),__vite__mapDeps([57,58,59,37,24,60,61,62,63,64,33,34,35,27,12,36,38,39]))),P8=ce.lazy(()=>$e(()=>import("./acl-gui-add-edit-view-CTpQtVIC.js"),__vite__mapDeps([65,59,37,60,45,66,63,64,42,62]))),Roe=ce.lazy(()=>$e(()=>import("./acl-gui-user-defined-group-view-CKHkrXCD.js"),__vite__mapDeps([67,64,59,37]))),Ooe=ce.lazy(()=>$e(()=>import("./acl-gui-user-defined-groups-view-BXFb4wiz.js"),__vite__mapDeps([68,64,59,37]))),Foe=ce.lazy(()=>$e(()=>import("./acl-gui-synced-group-view-UKkv7_y6.js"),__vite__mapDeps([69,64,59,37]))),Boe=ce.lazy(()=>$e(()=>import("./acl-gui-synced-groups-view-CvhgUjzF.js"),__vite__mapDeps([70,64,59,37]))),Uoe=ce.lazy(()=>$e(()=>import("./acl-gui-autogroup-view-BRLXFB6f.js"),__vite__mapDeps([71,64,59,37]))),Voe=ce.lazy(()=>$e(()=>import("./acl-gui-autogroups-view-BcpMdELo.js"),__vite__mapDeps([72,64,59,37]))),$oe=ce.lazy(()=>$e(()=>import("./acl-gui-auto-approver-routes-view-CRfl1V2S.js"),__vite__mapDeps([73,58,59,37,24,60]))),Hoe=ce.lazy(()=>$e(()=>import("./acl-gui-auto-approver-services-view-DRpYcaHl.js"),__vite__mapDeps([74,58,59,37,24,60]))),zoe=ce.lazy(()=>$e(()=>import("./acl-gui-auto-approver-exit-nodes-view-D1Zq4Ijj.js"),__vite__mapDeps([75,58,59,37,24,60]))),Woe=ce.lazy(()=>$e(()=>import("./acl-gui-tests-view-Dciadftq.js"),__vite__mapDeps([76,59,37,61,24,62]))),Koe=ce.lazy(()=>$e(()=>import("./acl-gui-tests-ssh-view-ZLDBEmff.js"),__vite__mapDeps([77,59,37,61,24,62]))),Goe=ce.lazy(()=>$e(()=>import("./acl-redirect-view-AJKaIvGS.js"),__vite__mapDeps([78,37]))),qoe=ce.lazy(()=>$e(()=>import("./new-service-view-DQ_tSinT.js"),__vite__mapDeps([79,41,45]))),Yoe=ce.lazy(()=>$e(()=>import("./new-pam-service-view-CBQu9MhM.js"),__vite__mapDeps([80,81,66,45,11,12]))),Zoe=ce.lazy(()=>$e(()=>import("./service-details-view-miGDmu1B.js"),__vite__mapDeps([82,41,44,45]))),Qoe=ce.lazy(()=>$e(()=>import("./edit-service-view-BWTDnOOD.js"),__vite__mapDeps([83,81,66,41,45]))),Wg=ce.lazy(()=>$e(()=>import("./trust-credentials-wizard-9Z4pzUQb.js"),__vite__mapDeps([84,25])));function Joe(){if(document.cookie.includes("rl_anonymous_id"))return;const e=V2(),t=globalThis.location.hostname.split(".").slice(-2).join("."),r=`C-${e}`;D8.set("rl_anonymous_id",r,{expires:365,domain:`.${t}`,path:"/",sameSite:"Lax"})}function Xoe(){return Gie(),nB(),Hie(),Yie(),f.useEffect(()=>Joe,[]),n.jsx(n.Fragment,{children:n.jsx(jz,{children:n.jsx(yae,{children:n.jsx(Qie,{children:n.jsx(kz,{children:n.jsx(Ee.Provider,{children:n.jsx(ZF,{children:n.jsxs(r0,{children:[n.jsx(be,{path:"/admin/deleted",component:eG}),n.jsx(be,{path:"/admin/machines/ssh-reauth-complete",component:kG}),n.jsx(be,{children:n.jsx(QK,{children:n.jsx(ele,{})})})]})})})})})})})})}function ele(){const{data:e}=vt(),[t,r]=f.useState(!1);return t?n.jsx("div",{className:"min-h-screen flex items-center",children:n.jsx(De,{})}):n.jsxs(n.Fragment,{children:[n.jsx(nle,{}),n.jsx(f.Suspense,{fallback:null,children:n.jsx(_oe,{})}),n.jsxs(r0,{children:[n.jsx(be,{path:"/admin/invite/:id",component:vJ}),n.jsx(be,{path:"/admin/design/*?",children:n.jsx(f.Suspense,{fallback:n.jsx("div",{className:"flex items-center justify-center min-h-screen",children:n.jsx(De,{loadingMessage:"Loading..."})}),children:n.jsx(Moe,{})})}),n.jsx(be,{path:"/admin/welcome/checkout/:id",children:({id:s})=>n.jsx("div",{className:"h-full w-full pt-4",children:n.jsxs("div",{className:"container h-full mx-auto",children:[n.jsx(vc,{setSwitchingTailnets:r}),n.jsx(f.Suspense,{fallback:n.jsx("div",{className:"mt-20 rounded-2xl border bg-bg-base shadow-soft max-w-2xl mx-auto w-full md:p-10",children:n.jsx(De,{loadingMessage:"Loading..."})}),children:n.jsx(gm,{checkoutPlanId:s})})]})})}),n.jsx(be,{path:"/admin/welcome/finish-setup",children:n.jsx("div",{className:"h-full w-full pt-4",children:n.jsxs("div",{className:"container h-full mx-auto",children:[n.jsx(vc,{setSwitchingTailnets:r}),n.jsx(f.Suspense,{fallback:n.jsx("div",{className:"mt-20 rounded-2xl border bg-bg-base shadow-soft max-w-2xl mx-auto w-full md:p-10",children:n.jsx(De,{loadingMessage:"Loading..."})}),children:n.jsx(gm,{finishSetup:!0})})]})})}),n.jsx(be,{path:"/admin/welcome/plans",children:n.jsx("div",{className:"h-full w-full pt-4",children:n.jsxs("div",{className:"container h-full mx-auto",children:[n.jsx(vc,{setSwitchingTailnets:r}),n.jsx(f.Suspense,{fallback:n.jsx("div",{className:"mt-20 rounded-2xl border bg-bg-base shadow-soft max-w-2xl mx-auto w-full md:p-10",children:n.jsx(De,{loadingMessage:"Loading..."})}),children:n.jsx(gm,{showPlans:!0})})]})})}),n.jsx(be,{path:"/admin/welcome",children:n.jsx("div",{className:"h-full w-full pt-4",children:n.jsxs("div",{className:"container h-full mx-auto",children:[n.jsx(vc,{setSwitchingTailnets:r}),n.jsx(f.Suspense,{fallback:n.jsx("div",{className:"mt-20 rounded-2xl border bg-bg-base shadow-soft max-w-2xl mx-auto w-full md:p-10",children:n.jsx(De,{loadingMessage:"Loading..."})}),children:n.jsx(gm,{})})]})})}),n.jsx(be,{path:"/*",children:n.jsxs(qK,{setSwitchingTailnets:r,topNav:n.jsx(sle,{setSwitchingTailnets:r}),children:[n.jsx(joe,{}),n.jsx("main",{className:"container mx-auto pb-20 md:pb-24 sidenav:w-full sidenav:max-w-content-wide sidenav:mx-auto sidenav:pt-5 lg:sidenav:pt-8 sidenav:px-6 lg:sidenav:px-10",children:n.jsxs("div",{className:"@container",children:[e.trialBanner&&n.jsx(rle,{}),n.jsx(f.Suspense,{fallback:n.jsx(De,{loadingMessage:"Loading..."}),children:n.jsxs(r0,{children:[n.jsx(be,{path:"/admin/users",children:n.jsx(Se,{permission:de.Users,noAccess:Ne,readWrite:_ie})}),n.jsx(be,{path:"/admin/machines",children:n.jsx(Se,{permission:de.Devices,noAccess:Ne,readWrite:Nre})}),n.jsx(be,{path:"/admin/machines/new-linux",children:n.jsx(Se,{permission:de.Devices,noAccess:Ne,readWrite:qre})}),n.jsx(be,{path:"/admin/machines/new-aws",children:n.jsx(Se,{permission:de.Devices,noAccess:Ne,readWrite:Fre})}),n.jsx(be,{path:"/admin/machines/ssh-setup",children:n.jsx(Se,{permission:de.Devices,noAccess:Ne,readWrite:v6})}),n.jsx(be,{path:"/admin/machines/:id/ssh-setup",children:s=>n.jsx(Se,{permission:de.Devices,noAccess:Ne,readWrite:a=>n.jsx(v6,{id:s.id,...a})})}),n.jsx(be,{path:"/admin/machines/exit-node-setup",children:n.jsx(Se,{permission:de.Devices,noAccess:Ne,readWrite:g6})}),n.jsx(be,{path:"/admin/machines/:id/exit-node-setup",children:s=>n.jsx(Se,{permission:de.Devices,noAccess:Ne,readWrite:a=>n.jsx(g6,{id:s.id,...a})})}),n.jsx(be,{path:"/admin/machines/subnet-router-setup",children:n.jsx(Se,{permission:de.Devices,noAccess:Ne,readWrite:y6})}),n.jsx(be,{path:"/admin/machines/:id/subnet-router-setup",children:s=>n.jsx(Se,{permission:de.Devices,noAccess:Ne,readWrite:a=>n.jsx(y6,{id:s.id,...a})})}),n.jsx(be,{path:"/admin/machines/:id",children:s=>n.jsx(Se,{permission:de.Devices,noAccess:Ne,readWrite:a=>n.jsx(_ee,{id:s.id,...a})})}),e.featureBorder0IntegrationOK&&e.featureBorder0MilestoneThree&&n.jsxs(n.Fragment,{children:[n.jsx(be,{path:"/admin/pam_connectors",children:n.jsx(Se,{permission:de.Devices,noAccess:Ne,readWrite:qQ})}),n.jsx(be,{path:"/admin/pam_connectors/new",children:n.jsx(Se,{permission:de.Devices,noAccess:Ne,readWrite:$re})}),n.jsx(be,{path:"/admin/pam_connectors/:id/tokens",children:s=>n.jsx(Se,{permission:de.Devices,noAccess:Ne,readWrite:a=>n.jsx(cJ,{id:s.id,...a})})}),n.jsx(be,{path:"/admin/pam_connectors/:id",children:s=>n.jsx(Se,{permission:de.Devices,noAccess:Ne,readWrite:a=>n.jsx(eJ,{id:s.id,...a})})})]}),n.jsxs(n.Fragment,{children:[n.jsx(be,{path:"/admin/apps",children:n.jsx(Se,{permission:de.Devices,noAccess:Ne,readWrite:Zq})}),n.jsx(be,{path:"/admin/apps/:id",children:s=>n.jsx(Se,{permission:de.Devices,noAccess:Ne,readWrite:a=>n.jsx(nY,{id:s.id,...a})})})]}),n.jsx(be,{path:"/admin/services",children:n.jsx(Se,{permission:de.Devices,noAccess:Ne,readWrite:Eoe})}),n.jsx(be,{path:"/admin/services/new",children:n.jsx(Se,{permission:de.VIPServices,noAccess:Ne,readWrite:qoe})}),n.jsx(be,{path:"/admin/services/new-pam",children:n.jsx(Se,{permission:de.VIPServices,noAccess:Ne,readWrite:Yoe})}),n.jsx(be,{path:"/admin/services/:service",children:s=>n.jsx(Se,{permission:de.VIPServices,noAccess:Ne,readWrite:a=>n.jsx(Zoe,{service:s.service,...a})})}),n.jsx(be,{path:"/admin/services/:service/edit",children:s=>n.jsx(Se,{permission:de.VIPServices,noAccess:Ne,readWrite:a=>n.jsx(Qoe,{service:s.service,...a})})}),n.jsxs(n.Fragment,{children:[n.jsx(be,{path:"/admin/acls/visual/:tab",children:s=>n.jsx(Se,{permission:de.ACLs,noAccess:Ne,readWrite:a=>n.jsx(Loe,{tab:s.tab,...a})})}),n.jsx(be,{path:"/admin/acls/visual/:tab/add",children:s=>n.jsx(Se,{permission:de.ACLs,noAccess:Ne,readWrite:a=>n.jsx(P8,{tab:s.tab,action:"add",...a})})}),n.jsx(be,{path:"/admin/acls/visual/:tab/:id/edit",children:s=>n.jsx(Se,{permission:de.ACLs,noAccess:Ne,readWrite:a=>n.jsx(P8,{tab:s.tab,action:"edit",id:s.id,...a})})}),n.jsx(be,{path:"/admin/acls/visual/groups/userdefined/:name",children:s=>n.jsx(Se,{permission:de.ACLs,noAccess:Ne,readWrite:a=>n.jsx(Roe,{name:decodeURIComponent(s.name),...a})})}),n.jsx(be,{path:"/admin/acls/visual/groups/userdefined",children:()=>n.jsx(Se,{permission:de.ACLs,noAccess:Ne,readWrite:s=>n.jsx(Ooe,{...s})})}),n.jsx(be,{path:"/admin/acls/visual/groups/synced/:name",children:s=>n.jsx(Se,{permission:de.ACLs,noAccess:Ne,readWrite:a=>n.jsx(Foe,{name:decodeURIComponent(s.name),...a})})}),n.jsx(be,{path:"/admin/acls/visual/groups/synced",children:()=>n.jsx(Se,{permission:de.ACLs,noAccess:Ne,readWrite:()=>n.jsx(Boe,{})})}),n.jsx(be,{path:"/admin/acls/visual/groups/autogroups/:name",children:s=>n.jsx(Se,{permission:de.ACLs,noAccess:Ne,readWrite:a=>n.jsx(Uoe,{name:decodeURIComponent(s.name),...a})})}),n.jsx(be,{path:"/admin/acls/visual/groups/autogroups",children:()=>n.jsx(Se,{permission:de.ACLs,noAccess:Ne,readWrite:()=>n.jsx(Voe,{})})}),n.jsx(be,{path:"/admin/acls/visual/auto-approvers/routes",children:()=>n.jsx(Se,{permission:de.ACLs,noAccess:Ne,readWrite:s=>n.jsx($oe,{...s})})}),n.jsx(be,{path:"/admin/acls/visual/auto-approvers/services",children:()=>n.jsx(Se,{permission:de.ACLs,noAccess:Ne,readWrite:s=>n.jsx(Hoe,{...s})})}),n.jsx(be,{path:"/admin/acls/visual/auto-approvers/exit-nodes",children:()=>n.jsx(Se,{permission:de.ACLs,noAccess:Ne,readWrite:s=>n.jsx(zoe,{...s})})}),n.jsx(be,{path:"/admin/acls/visual/tests/general",children:()=>n.jsx(Se,{permission:de.ACLs,noAccess:Ne,readWrite:s=>n.jsx(Woe,{...s})})}),n.jsx(be,{path:"/admin/acls/visual/tests/ssh",children:()=>n.jsx(Se,{permission:de.ACLs,noAccess:Ne,readWrite:s=>n.jsx(Koe,{...s})})})]}),n.jsx(be,{path:"/admin/acls/:tab",children:s=>n.jsx(Se,{permission:de.ACLs,noAccess:Ne,readWrite:a=>n.jsx(koe,{tab:s.tab,...a})})}),n.jsx(be,{path:"/admin/acls",children:()=>n.jsx(Se,{permission:de.ACLs,noAccess:Ne,readWrite:()=>n.jsx(Goe,{})})}),e.auditLogs&&n.jsx(be,{path:"/admin/logs",children:n.jsx(Se,{permission:de.AuditLogs,noAccess:Ne,readWrite:()=>n.jsx(zg,{page:"config"})})}),n.jsx(be,{path:"/admin/logs/configuration/setup",children:n.jsx(Se,{permission:de.LogStreaming,noAccess:Ne,readWrite:()=>n.jsx(A8,{streamType:"configuration"})})}),n.jsx(be,{path:"/admin/logs/network",children:n.jsx(Se,{permission:de.NetworkLogs,noAccess:Ne,readWrite:()=>n.jsx(zg,{page:"network"})})}),n.jsx(be,{path:"/admin/logs/network/setup",children:n.jsx(Se,{permission:de.LogStreaming,noAccess:Ne,readWrite:()=>n.jsx(A8,{streamType:"network"})})}),e.featureBorder0IntegrationOK&&e.featureBorder0MilestoneThree&&n.jsx(be,{path:"/admin/logs/pam_session",children:n.jsx(Se,{permission:de.AuditLogs,noAccess:Ne,readWrite:()=>n.jsx(zg,{page:"pam_session"})})}),e.featureBorder0IntegrationOK&&e.featureBorder0MilestoneThree&&n.jsx(be,{path:"/admin/logs/pam_session/:socketId/:sessionId",children:s=>n.jsx(Se,{permission:de.AuditLogs,noAccess:Ne,readWrite:()=>n.jsx(Doe,{socketId:s.socketId,sessionId:s.sessionId})})}),n.jsx(be,{path:"/admin/dns",children:n.jsx(Se,{permission:de.DNS,noAccess:Ne,readWrite:Noe})}),n.jsx(be,{path:"/admin/settings/billing/confirmation/:rest",children:s=>n.jsx(Se,{permission:de.Billing,noAccess:Ne,readWrite:a=>n.jsx(eE,{id:s.rest,...a})})}),n.jsx(be,{path:"/admin/settings/billing/add/:rest?",children:({rest:s})=>n.jsx(Se,{permission:de.Billing,noAccess:Ne,readWrite:()=>n.jsx(Poe,{addon:s})})}),n.jsx(be,{path:"/admin/settings/billing/checkout/:id",children:({id:s})=>n.jsx(Se,{permission:de.Billing,noAccess:Ne,readWrite:()=>n.jsx(f.Suspense,{fallback:n.jsx(De,{loadingMessage:"Loading checkout..."}),children:n.jsx(Toe,{id:s})})})}),n.jsx(be,{path:"/admin/settings/billing/plans/:rest?",children:s=>n.jsx(Se,{permission:de.Billing,noAccess:Ne,readWrite:()=>n.jsx(f.Suspense,{fallback:n.jsx(De,{loadingMessage:"Loading plans..."}),children:n.jsx(Aoe,{plan:s.rest})})})}),n.jsx(be,{path:"/admin/settings/billing/billing-card-update-success/:sessionId",children:s=>n.jsx(DQ,{sessionId:s.sessionId})}),n.jsx(be,{path:"/admin/settings/billing/seat-calculator",children:n.jsx(Se,{permission:de.Billing,noAccess:Ne,readWrite:()=>n.jsx(Ioe,{})})}),n.jsx(be,{path:"/admin/settings/billing/:tab?",children:({tab:s})=>n.jsx(Gt,{page:Ke.Billing,tab:s})}),n.jsx(be,{path:`/admin/settings/${Ke.General}`,children:n.jsx(Gt,{page:Ke.General})}),n.jsx(be,{path:`/admin/settings/${Ke.UserManagement}`,children:n.jsx(Gt,{page:Ke.UserManagement})}),n.jsx(be,{path:`/admin/settings/${Ke.PolicyFileManagement}`,children:n.jsx(Gt,{page:Ke.PolicyFileManagement})}),e.featureDomainClaim&&n.jsx(be,{path:`/admin/settings/${Ke.Domains}`,children:n.jsx(Gt,{page:Ke.Domains})}),n.jsx(be,{path:`/admin/settings/${Ke.DeviceManagement}`,children:n.jsx(Gt,{page:Ke.DeviceManagement})}),n.jsx(be,{path:`/admin/settings/${Ke.DeviceManagement}/posture`,children:n.jsx(Gt,{page:Ke.DevicePosture})}),e.devicePosture&&n.jsxs(n.Fragment,{children:[n.jsx(be,{path:`/admin/settings/${Ke.DeviceManagement}/posture/crowdstrike-falcon`,children:n.jsx(Gt,{page:Ke.DevicePostureSetupCrowdStrike})}),n.jsx(be,{path:`/admin/settings/${Ke.DeviceManagement}/posture/fleet`,children:n.jsx(Gt,{page:Ke.DevicePostureSetupFleet})}),n.jsx(be,{path:`/admin/settings/${Ke.DeviceManagement}/posture/huntress`,children:n.jsx(Gt,{page:Ke.DevicePostureSetupHuntress})}),n.jsx(be,{path:`/admin/settings/${Ke.DeviceManagement}/posture/jamf-pro`,children:n.jsx(Gt,{page:Ke.DevicePostureSetupJamfPro})}),n.jsx(be,{path:`/admin/settings/${Ke.DeviceManagement}/posture/kandji`,children:n.jsx(Gt,{page:Ke.DevicePostureSetupKandji})}),n.jsx(be,{path:`/admin/settings/${Ke.DeviceManagement}/posture/microsoft-intune`,children:n.jsx(Gt,{page:Ke.DevicePostureSetupIntune})}),n.jsx(be,{path:`/admin/settings/${Ke.DeviceManagement}/posture/kolide`,children:n.jsx(Gt,{page:Ke.DevicePostureSetupKolide})}),n.jsx(be,{path:`/admin/settings/${Ke.DeviceManagement}/posture/sentinelone`,children:n.jsx(Gt,{page:Ke.DevicePostureSetupSentinelOne})})]}),n.jsx(be,{path:`/admin/settings/${Ke.DeviceManagement}/enable-tailnet-lock`,children:n.jsx(Gt,{page:Ke.EnableTailnetLock})}),n.jsx(be,{path:`/admin/settings/${Ke.General}/mullvad`,children:n.jsx(Gt,{page:Ke.ConfigureMullvad})}),n.jsx(be,{path:`/admin/settings/${Ke.Keys}`,children:n.jsx(Gt,{page:Ke.Keys})}),e.webhooks&&n.jsx(be,{path:`/admin/settings/${Ke.Webhooks}`,children:n.jsx(Gt,{page:Ke.Webhooks})}),n.jsx(be,{path:`/admin/settings/${Ke.TrustCredentials}`,children:n.jsx(Gt,{page:Ke.TrustCredentials})}),n.jsx(be,{path:`/admin/settings/${Ke.TrustCredentials}/add`,children:()=>n.jsx(Se,{permission:de.ACLs,noAccess:Ne,readWrite:s=>n.jsx(Wg,{...s})})}),n.jsx(be,{path:`/admin/settings/${Ke.TrustCredentials}/edit/:id`,children:s=>n.jsx(Se,{permission:de.ACLs,noAccess:Ne,readWrite:a=>n.jsx(Wg,{...a,keyId:decodeURIComponent(s.id)})})}),n.jsx(be,{path:`/admin/settings/${Ke.TrustCredentials}/view/:id`,children:s=>n.jsx(Se,{permission:de.ACLs,noAccess:Ne,readWrite:a=>n.jsx(Wg,{...a,keyId:decodeURIComponent(s.id)})})}),e.emailPreferences&&n.jsx(be,{path:`/admin/settings/${Ke.ContactPreferences}`,children:n.jsx(Gt,{page:Ke.ContactPreferences})}),e.featureSelfServeIdP&&n.jsx(be,{path:`/admin/settings/${Ke.UserManagement}/switch-idp`,children:n.jsx(Gt,{page:Ke.SwitchIDP})}),e.featureSelfServeIdP&&n.jsx(be,{path:`/admin/settings/${Ke.EditIDP}`,children:n.jsx(Gt,{page:Ke.EditIDP})}),n.jsx(be,{path:"/admin/new/*",children:s=>n.jsx(_i,{to:`/admin/${s["*"]||""}`,replace:!0})}),n.jsx(be,{path:"/admin/resource-hub",children:n.jsx(Se,{permission:de.Devices,noAccess:Ne,readWrite:bse})}),n.jsx(be,{component:tN})]})})]})})]})})]})]})}const tle={"/admin":"/admin/machines","/admin/new":"/admin/machines","/admin/settings":`/admin/settings/${Ke.General}`,"/admin/settings/authentication":`/admin/settings/${Ke.General}`,"/admin/settings/authkeys":`/admin/settings/${Ke.Keys}`,"/admin/authkeys":`/admin/settings/${Ke.Keys}`,"/admin/machines/external":"/admin/machines?q=is%3Aexternal","/admin/settings/features":"/admin/settings/general","/admin/acls/visual":"/admin/acls/visual/general-access-rules","/admin/settings/oauth":`/admin/settings/${Ke.TrustCredentials}`};function nle(){return n.jsx(n.Fragment,{children:Object.entries(tle).map(([e,t])=>n.jsx(be,{path:e,children:n.jsx(_i,{to:t,replace:!0})},e))})}function rle(){return n.jsx("div",{className:"relative overflow-hidden",children:n.jsx(ze,{href:"/admin/settings/billing",children:n.jsxs(rt,{intent:"error",className:"mb-5",children:[n.jsx("span",{className:"font-semibold",title:"You are likely to be eaten by a grue",children:"You are in a trial"}),". During the trial, you can add as many users and devices as youʼd like, and use all features. Get back to us before the end of your trial to continue using Tailscale with the features you need."]})})})}function sle({setSwitchingTailnets:e}){return n.jsxs("div",{className:"bg-bg-app border-b pt-4 mb-6",children:[n.jsx("div",{className:"container mx-auto mb-2 md:mb-4",children:n.jsx(vc,{setSwitchingTailnets:e})}),n.jsx(ale,{}),n.jsx(pl,{experimentKey:"a-a-baseline-experiment",enabled:!0,variants:{control:null,variant1:null}})]})}function ale(){const{data:e}=vt();return n.jsx("div",{className:"relative overflow-auto top-px [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:n.jsxs("nav",{id:"nav",className:"navigation flex items-center relative md:container md:mx-auto md:px-0",children:[n.jsx(Gr,{href:"/admin/machines",permission:de.Devices,icon:ol,className:"ml-1 md:-ml-3",children:"Machines"}),e.featureBorder0IntegrationOK&&e.featureBorder0MilestoneThree&&n.jsx(Gr,{href:"/admin/pam_connectors",permission:de.Devices,icon:nw,children:"Connectors"}),n.jsx(Gr,{href:"/admin/apps",permission:de.Devices,icon:e2,children:"Apps"}),n.jsx(Gr,{href:"/admin/services",permission:de.Devices,icon:xw,children:"Services"}),n.jsx(Gr,{href:"/admin/users",permission:de.Users,icon:wi,children:"Users"}),n.jsx(S2,{children:n.jsx(Gr,{href:"/admin/acls",permission:de.ACLs,icon:mw,children:"Access controls"})}),e.auditLogs&&n.jsx(Gr,{href:"/admin/logs",permission:de.AuditLogs,icon:$f,children:"Logs"}),n.jsx(Gr,{href:"/admin/dns",permission:de.DNS,icon:Hf,children:"DNS"}),n.jsx(Gr,{href:"/admin/settings",icon:Xx,children:"Settings"}),n.jsx("span",{className:"flex-1"}),n.jsxs("div",{className:"relative inline-flex",children:[n.jsx(Gr,{href:"/admin/resource-hub",className:"-mr-2.5",icon:tw,children:"Resource hub"}),n.jsx(BS,{})]})]})})}function Gr({permission:e,...t}){return e===void 0?n.jsx(T8,{...t}):n.jsx(Se,{permission:e,noAccess:()=>n.jsx(ile,{...t}),readWrite:()=>n.jsx(T8,{...t})})}function T8({children:e,icon:t,iconClass:r,href:s,className:a,...i}){const[l]=ft(),u=l.startsWith(s);return n.jsx(ze,{href:s,asChild:!0,children:n.jsx("a",{className:CP(a),...i,children:n.jsxs("div",{className:D("px-2.5 py-1.5 flex items-center rounded-md group-hover:bg-gray-200 dark:group-hover:bg-gray-800 after:absolute after:bottom-0 after:right-2.5 after:left-2.5 after:h-0.5 after:bg-text-primary group-focus-visible:visible-focus",{"text-text-primary after:visible":u,"text-gray-600 dark:text-gray-300 group-hover:text-gray-800 dark:group-hover:text-gray-100 after:invisible":!u}),children:[t&&n.jsx(t,{className:D("mr-2 hidden sm:inline-block",r),size:"1.125em",strokeWidth:u?"2.5":"2"}),n.jsx("div",{"data-content":e,className:D("navigation-link",{"navigation-linkActive":u}),children:e})]})})})}function ile({children:e,icon:t,className:r}){return n.jsx(Ee,{content:Sw,children:n.jsx("div",{className:CP(r),children:n.jsxs("div",{className:"cursor-not-allowed flex items-center border-b-2 text-text-disabled",children:[t&&n.jsx(t,{className:"mr-2 hidden sm:inline-block",size:"1.125em"}),n.jsx("div",{"data-content":e,className:"navigation-link",children:e})]})})})}const CP=e=>D("whitespace-nowrap py-2 group relative group !outline-none",e);Gr.defaultProps={icon:File};globalThis.addEventListener("error",e=>{al(wC(e.error??e.message))});globalThis.addEventListener("unhandledrejection",e=>{al(wC(e.reason))});const _h=document.createElement("div");_h.id="app-root";_h.classList.add("relative","z-0");document.body.append(_h);const ole=kI.createRoot(_h);ole.render(n.jsx(ce.StrictMode,{children:n.jsx(Xoe,{})}));export{i2 as $,V0 as A,We as B,Ko as C,js as D,Oa as E,Wx as F,iw as G,BR as H,VR as I,ow as J,lw as K,eA as L,Ate as M,U0 as N,u0 as O,Zn as P,Ete as Q,FY as R,Lc as S,cw as T,k$ as U,Pu as V,vce as W,Ea as X,DN as Y,Re as Z,Ile as _,Iv as a,gs as a$,Ge as a0,eZ as a1,rO as a2,_le as a3,Pe as a4,aO as a5,fn as a6,lA as a7,uw as a8,uO as a9,xq as aA,Ece as aB,vi as aC,tN as aD,rt as aE,bh as aF,yce as aG,VA as aH,Dce as aI,de as aJ,f8 as aK,Vv as aL,Qx as aM,Ni as aN,E7 as aO,He as aP,Wce as aQ,hy as aR,VZ as aS,dre as aT,gre as aU,el as aV,Rn as aW,ce as aX,hx as aY,HL as aZ,_i as a_,C8 as aa,Br as ab,mO as ac,zY as ad,Hf as ae,yO as af,jF as ag,bs as ah,ln as ai,_$ as aj,UY as ak,ze as al,Vt as am,CX as an,De as ao,$x as ap,tX as aq,mw as ar,EO as as,OE as at,Dle as au,FZ as av,iQ as aw,Yx as ax,Zx as ay,sP as az,Ne as b,xw as b$,ly as b0,Nce as b1,kte as b2,LY as b3,bX as b4,be as b5,nZ as b6,Jx as b7,Ace as b8,Nu as b9,eQ as bA,nQ as bB,rQ as bC,ite as bD,Zo as bE,sQ as bF,ote as bG,r0 as bH,Lv as bI,Tu as bJ,iF as bK,Lk as bL,Fs as bM,dn as bN,Ee as bO,Da as bP,Nte as bQ,RY as bR,wX as bS,pF as bT,Je as bU,wi as bV,xce as bW,pce as bX,Z9 as bY,mn as bZ,BY as b_,ol as ba,dee as bb,zt as bc,Ke as bd,Po as be,Hce as bf,$ce as bg,br as bh,pte as bi,xn as bj,ts as bk,Fn as bl,bQ as bm,WY as bn,y8 as bo,ete as bp,QZ as bq,i6 as br,JZ as bs,eie as bt,tte as bu,nte as bv,rte as bw,tie as bx,noe as by,nie as bz,is as c,Wle as c$,Or as c0,$e as c1,bt as c2,Aw as c3,qo as c4,Js as c5,nH as c6,Lle as c7,Mle as c8,ice as c9,D as cA,j7 as cB,$m as cC,qle as cD,Wc as cE,w0 as cF,Gm as cG,Fc as cH,Nb as cI,Eb as cJ,Q9 as cK,Fq as cL,Vi as cM,dce as cN,fne as cO,mne as cP,Mw as cQ,SB as cR,Bce as cS,ji as cT,kU as cU,Sce as cV,Ks as cW,zle as cX,Kle as cY,jce as cZ,S7 as c_,rn as ca,ace as cb,F$ as cc,Es as cd,GY as ce,Tle as cf,Ho as cg,A7 as ch,B$ as ci,Sn as cj,ml as ck,nce as cl,uce as cm,cce as cn,Ie as co,Oce as cp,Kf as cq,Cce as cr,gM as cs,_r as ct,vr as cu,Rr as cv,Rle as cw,zf as cx,we as cy,Yle as cz,une as d,UZ as d$,ws as d0,Qc as d1,ll as d2,AU as d3,wce as d4,lU as d5,Gk as d6,Mv as d7,tce as d8,Wm as d9,Pce as dA,WZ as dB,Ice as dC,Tce as dD,Fle as dE,n as dF,$le as dG,Uce as dH,rce as dI,Ple as dJ,mU as dK,pB as dL,Ew as dM,Ule as dN,yi as dO,lce as dP,hce as dQ,Gle as dR,Vle as dS,Xf as dT,Qs as dU,yt as dV,ece as dW,sce as dX,O$ as dY,N7 as dZ,ef as d_,V2 as da,uU as db,Lw as dc,bce as dd,Mce as de,fce as df,Ole as dg,Vm as dh,Fce as di,Ro as dj,_7 as dk,fl as dl,TN as dm,ZY as dn,YY as dp,M$ as dq,R$ as dr,vu as ds,mH as dt,gU as du,xU as dv,v2 as dw,gu as dx,Zs as dy,Zle as dz,k2 as e,rl as e$,gce as e0,Mi as e1,f as e2,cm as e3,Di as e4,Yn as e5,Hle as e6,Go as e7,Hc as e8,_ce as e9,jh as eA,mu as eB,lY as eC,rZ as eD,Fr as eE,cA as eF,vt as eG,Yt as eH,bl as eI,qA as eJ,Kv as eK,ft as eL,Wk as eM,sn as eN,mi as eO,Cse as eP,kce as eQ,xu as eR,Wi as eS,lle as eT,dt as eU,Xc as eV,PN as eW,Qle as eX,Qf as eY,CA as eZ,Z8 as e_,qZ as ea,Km as eb,zm as ec,Oc as ed,_a as ee,Ble as ef,Ut as eg,Lce as eh,pr as ei,Qt as ej,Rce as ek,O as el,Ise as em,zce as en,Et as eo,mce as ep,lee as eq,$i as er,Eu as es,qt as et,sH as eu,ss as ev,J8 as ew,Ln as ex,ot as ey,DJ as ez,R as f,tq as f0,Dee as f1,ph as f2,U2 as f3,Jle as f4,Xle as f5,Nt as f6,Vce as f7,Rt as f8,Ai as f9,et as fa,ns as fb,SQ as fc,Ss as fd,vU as fe,K as g,oe as h,qd as i,zx as j,Lr as k,fle as l,Qo as m,fte as n,hte as o,Hv as p,AN as q,ue as r,vw as s,CR as t,yR as u,at as v,nn as w,yr as x,Nn as y,Li as z};