@deslop/deploy 0.1.1359 → 0.1.1365

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{a as t,o as n,r}from"./react-DLGSahv8.js";import{u as i}from"./index-qjacScV-.js";import{_ as a,ct as o,d as s,n as c,r as l,rt as u,t as d}from"./fleet-C6v5oKqs.js";import{$ as f,At as p,Ha as m,Li as ee,Mr as h,N as g,Ta as _,Wa as v,_a as y,bi as b,ca as x,et as S,fa as C,ga as w,la as te,pt as T,wa as E,xr as ne,za as D}from"./effect-2Kl3lmQH.js";import{$t as O,A as k,C as A,D as j,E as M,F as N,H as P,Kt as re,M as F,O as I,Rt as ie,S as ae,V as oe,Y as L,_ as R,_t as z,a as se,b as B,c as ce,en as le,h as V,i as ue,j as H,k as U,ln as W,m as G,mn as de,n as fe,o as pe,ot as me,p as he,r as ge,rt as _e,s as ve,t as ye,ut as be,v as xe,w as Se,x as Ce,y as we,z as Te,zt as Ee}from"./result-error-Y-B0irzX.js";import{R as De,_ as Oe,a as ke,g as Ae,h as K,l as je,o as q,p as Me,r as J,t as Y}from"./dist-BdaiJgHG.js";var X=e(n(),1),Ne=new Map([[`bold`,X.createElement(X.Fragment,null,X.createElement(`path`,{d:`M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z`}))],[`duotone`,X.createElement(X.Fragment,null,X.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),X.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`fill`,X.createElement(X.Fragment,null,X.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`light`,X.createElement(X.Fragment,null,X.createElement(`path`,{d:`M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z`}))],[`regular`,X.createElement(X.Fragment,null,X.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`thin`,X.createElement(X.Fragment,null,X.createElement(`path`,{d:`M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z`}))]]),Pe=X.forwardRef((e,t)=>X.createElement(De,{ref:t,...e,weights:Ne}));Pe.displayName=`XIcon`;var Fe=X.createContext(void 0);function Z(e){let t=X.useContext(Fe);if(!e&&t===void 0)throw Error(Me(27));return t}var Ie=X.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=Z(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`),d={open:c,transitionStatus:s.useState(`transitionStatus`)};return J(`div`,e,{state:d,ref:[s.context.backdropRef,t],stateAttributesMapping:Ee,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),Le=X.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=Z(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=je({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,z(_e,e.nativeEvent))}return J(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),Re=X.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Z(),c=we(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),J(`p`,e,{ref:t,props:[{id:c},o]})}),ze=X.createContext(void 0);function Be(){let e=X.useContext(ze);if(e===void 0)throw Error(Me(26));return e}var Ve=`--nested-dialogs`,He=`data-nested-dialog-open`,Ue={...ie,...re,nestedDialogOpen(e){return e?{[He]:``}:null}},Q=r(),We=X.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=Z(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),ee=c.useState(`nested`),h=c.useState(`nestedOpenDialogCount`),g=c.useState(`open`),_=c.useState(`openMethod`),v=c.useState(`titleElementId`),y=c.useState(`transitionStatus`),b=c.useState(`role`),x=d.useState(`floatingId`);Be(),N({open:g,ref:c.context.popupRef,onComplete(){g&&c.context.onOpenChangeComplete?.(!0)}});let S=o===void 0?M(c.context.popupRef):o,C=h>0,w=c.useStateSetter(`popupElement`),te=J(`div`,e,{state:{open:g,nested:ee,transitionStatus:y,nestedDialogOpen:C},props:[f,{id:x,"aria-labelledby":v,"aria-describedby":l,role:b,...A,hidden:!m,onKeyDown(e){he.has(e.key)&&e.stopPropagation()},style:{[Ve]:h}},s],ref:[t,c.context.popupRef,w],stateAttributesMapping:Ue});return(0,Q.jsx)(P,{context:d,openInteractionType:_,disabled:!m,closeOnFocusOut:!u,initialFocus:S,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:te})}),Ge=X.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=Z(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,Q.jsx)(ze.Provider,{value:n,children:(0,Q.jsxs)(L,{ref:t,...r,children:[a&&o===!0&&(0,Q.jsx)(V,{ref:i.context.internalBackdropRef,inert:R(!s)}),e.children]})}):null});function Ke({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),i=e.useState(`mounted`),a=e.useState(`disablePointerDismissal`),o=e.useState(`modal`),s=e.useState(`popupElement`),c=e.useState(`floatingRootContext`),[l,u]=X.useState(0),[d,f]=X.useState(0),p=l===0,m=oe(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=le(t);if(p&&!a){if(o){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||O(n,s)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:p});return G(r&&o===!0,s),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(u(t),f(n))}),K(()=>{!r&&!i&&(u(0),f(0))},[r,i]),K(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(l+1,d+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,l,d,t]),k(e,{activeTriggerProps:m.reference,inactiveTriggerProps:m.trigger,popupProps:m.floating,nestedOpenDialogCount:l,nestedOpenDrawerCount:d}),null}var qe={...Ce,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},Je=class extends Te{constructor(e,t,n){let r=new ae,i=Ye(e,r,t,n);super(i,Xe(r),qe)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled||(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(j(this.state,e,t.trigger)))}};function Ye(e,t,n,r=!1){return{...B(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function Xe(e){return{popupRef:X.createRef(),backdropRef:X.createRef(),internalBackdropRef:X.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function Ze(e,t){let{children:n,open:r,defaultOpen:i=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:s=!1,modal:c=!0,actionsRef:l,handle:u,triggerId:d,defaultTriggerId:f=null}=t,p=e===`drawer`,m=e===`alert-dialog`,ee=m?!0:c,h=m||s,g=m?`alertdialog`:`dialog`,_=Z(!0),v={modal:ee,disablePointerDismissal:h,nested:_!=null,role:g},y=H((e,t)=>new Je({open:i,openProp:r,activeTriggerId:f,triggerIdProp:d,...v},e,t),!0);y.useControlledProp(`openProp`,r),y.useControlledProp(`triggerIdProp`,d),y.useSyncedValues(v),y.useContextCallback(`onOpenChange`,a),y.useContextCallback(`onOpenChangeComplete`,o);let b=y.useState(`open`),x=y.useState(`mounted`),S=y.useState(`payload`);F(y,b),I(y);let{forceUnmount:C}=U(b,y);X.useImperativeHandle(l,()=>({unmount:C,close:()=>y.setOpen(!1,z(me))}),[C,y]);let w=b||x||u!=null;return(0,Q.jsxs)(Fe.Provider,{value:y,children:[u&&(0,Q.jsx)(Se,{handle:u,store:y}),w&&(0,Q.jsx)(Ke,{store:y,parentContext:_?.context,isDrawer:p}),typeof n==`function`?n({payload:S}):n]})}var Qe=de(function(e){return Ze(`dialog`,e)}),$e=X.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Z(),c=we(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),J(`h2`,e,{ref:t,props:[{id:c},o]})}),$=t();function et(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(Qe,{"data-slot":`dialog`,...n}),t[2]=n,t[3]=r),r}function tt(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(Ge,{"data-slot":`dialog-portal`,...n}),t[2]=n,t[3]=r),r}function nt(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Q.jsx)(Le,{"data-slot":`dialog-close`,...n}),t[2]=n,t[3]=r),r}function rt(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(Ie,{"data-slot":`dialog-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function it(e){let t=(0,$.c)(15),n,r,i,o;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4]):({className:r,children:n,showCloseButton:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o);let s=o===void 0||o,c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(rt,{}),t[5]=c):c=t[5];let l;t[6]===r?l=t[7]:(l=Y(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-none bg-popover p-4 text-xs/relaxed text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,r),t[6]=r,t[7]=l);let u;t[8]===s?u=t[9]:(u=s&&(0,Q.jsxs)(Le,{"data-slot":`dialog-close`,render:(0,Q.jsx)(a,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,Q.jsx)(Pe,{}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Close`})]}),t[8]=s,t[9]=u);let d;return t[10]!==n||t[11]!==i||t[12]!==l||t[13]!==u?(d=(0,Q.jsxs)(tt,{children:[c,(0,Q.jsxs)(We,{"data-slot":`dialog-content`,className:l,...i,children:[n,u]})]}),t[10]=n,t[11]=i,t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function at(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`flex flex-col gap-1 text-left`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(`div`,{"data-slot":`dialog-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ot(e){let t=(0,$.c)(14),n,r,i,o;t[0]===e?(n=t[1],r=t[2],i=t[3],o=t[4]):({className:r,showCloseButton:o,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o);let s=o!==void 0&&o,c;t[5]===r?c=t[6]:(c=Y(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,r),t[5]=r,t[6]=c);let l;t[7]===s?l=t[8]:(l=s&&(0,Q.jsx)(Le,{render:(0,Q.jsx)(a,{variant:`outline`}),children:`Close`}),t[7]=s,t[8]=l);let u;return t[9]!==n||t[10]!==i||t[11]!==c||t[12]!==l?(u=(0,Q.jsxs)(`div`,{"data-slot":`dialog-footer`,className:c,...i,children:[n,l]}),t[9]=n,t[10]=i,t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function st(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`font-heading text-sm font-medium`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)($e,{"data-slot":`dialog-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ct(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=Y(`text-xs/relaxed text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Q.jsx)(Re,{"data-slot":`dialog-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var lt=`data-valid`,ut=`data-invalid`,dt={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},ft={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},pt={valid(e){return e===null?null:e?{[lt]:``}:{[ut]:``}}},mt={invalid:void 0,name:void 0,validityData:{state:dt,errors:[],error:``,value:``,initialValue:null},setValidityData:q,disabled:void 0,setTouched:q,setDirty:q,setFilled:q,setFocused:q,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:ft,registerFieldControl:q,validation:{getValidationProps:(e,t=ke)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:q,getInputControl:()=>null,commit:async()=>{},change:q}},ht=X.createContext(mt);function gt(e=!0){let t=X.useContext(ht);if(t.setValidityData===q&&!e)throw Error(Me(28));return t}var _t=X.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:q,validationMode:`onSubmit`,submitCountRef:{current:0}});function vt(){return X.useContext(_t)}var yt=X.createContext({controlId:void 0,registerControlId:q,resetControlId:q,labelId:void 0,setLabelId:q,messageIds:[],setMessageIds:q,getDescriptionProps:e=>e});function bt(){return X.useContext(yt)}function xt(e,t,n){let{setFocused:r,focusOwnerRef:i}=gt(),a=Ae(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return K(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function St(e,t,n,r,i=!0,a){let{registerFieldControl:o}=gt(),s=Oe(()=>Symbol());K(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),K(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}function Ct(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=bt(),o=we(),s=Oe(()=>Symbol()),c=X.useRef(!1),l=X.useRef(!1),u=Ae(()=>{c.current&&i!==q&&(c.current=!1,i(s.current,void 0))});return K(()=>{if(!n||i===q){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),K(()=>u,[u]),(n?r:void 0)??t??o}var wt=X.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:ee,setTouched:h,setDirty:g,validityData:_,setFilled:v,validationMode:y,validation:b}=gt(),{clearErrors:x,elementRef:S,submitCountRef:C}=vt(),w=ee||s,te=m??a,T={...p,disabled:w},{labelId:E}=bt(),ne=Ct({id:i}),D=o!==void 0,O=o==null?void 0:String(o),k=Ae(()=>b.inputRef.current?.value);St(b.inputRef,ne,O,k,!w,a),K(()=>{let e=O??b.inputRef.current?.value;e!==void 0&&v(e!==``)},[O,l,b.inputRef,v]),xe(O,()=>{O!==void 0&&(x(te),g(O!==(_.initialValue??``)),b.change(O))});let A=X.useRef(null),j=xt(w,A),M=W();return J(`input`,e,{ref:[t,A],state:T,props:[{id:ne,disabled:w,name:te,ref:b.inputRef,"aria-labelledby":E,autoFocus:u,...D?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=z(be,e.nativeEvent);c?.(t,n),D||(g(t!==(_.initialValue??``)),v(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(x(te),b.change(t)))},onFocus(){j(!0)},onBlur(e){if(h(!0),j(!1),y===`onBlur`){let t=e.currentTarget.value;b.commit(t),D&&queueMicrotask(()=>{let e=b.inputRef.current?.value;e!==void 0&&e!==t&&e!==(_.initialValue??``)&&b.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){h(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===S.current&&!e.defaultPrevented){let t=e.currentTarget,n=C.current;M.start(0,()=>{C.current===n&&b.commit(t.value)})}else b.commit(t)}}},f,e=>b.getValidationProps(w,e)],stateAttributesMapping:pt})}),Tt=X.forwardRef(function(e,t){return(0,Q.jsx)(wt,{ref:t,...e})});function Et(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,type:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=Y(`h-8 w-full min-w-0 rounded-none border border-input bg-transparent px-2.5 py-1 text-xs transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-xs file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 md:text-xs dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a||t[8]!==i?(o=(0,Q.jsx)(Tt,{type:i,"data-slot":`input`,className:a,...r}),t[6]=r,t[7]=a,t[8]=i,t[9]=o):o=t[9],o}var Dt=T([`tailnet`,`public`]);function Ot(e){let t=(0,$.c)(70),[n,r]=u(d),[i,o]=(0,X.useState)(`tailnet`),[c,l]=(0,X.useState)(``),_;if(t[0]!==e.items||t[1]!==e.port.worker){let n;t[3]===e.port.worker?n=t[4]:(n=t=>te(t.self,!0)&&t.worker===e.port.worker,t[3]=e.port.worker,t[4]=n),_=w(v(e.items,b(n),C(kt)),m(``)),t[0]=e.items,t[1]=e.port.worker,t[2]=_}else _=t[2];let x=_,S;t[5]===n?S=t[6]:(S=f(n),t[5]=n,t[6]=S);let T=S,E;t[7]!==r||t[8]!==c||t[9]!==i||t[10]!==e.port.worker||t[11]!==e.portNumber||t[12]!==x?(E=t=>{t.preventDefault(),r({hostname:g(i===`public`,{onFalse:()=>x,onTrue:()=>c}),kind:i,name:s.make(g(i===`public`,{onFalse:()=>`tailnet:${e.portNumber}`,onTrue:()=>`public:${c}`})),port:e.portNumber,publicAccess:i===`public`,worker:e.port.worker})},t[7]=r,t[8]=c,t[9]=i,t[10]=e.port.worker,t[11]=e.portNumber,t[12]=x,t[13]=E):E=t[13];let D;if(t[14]!==e.port.name||t[15]!==e.port.process){let n;t[17]===e.port.name?n=t[18]:(n=()=>e.port.name,t[17]=e.port.name,t[18]=n),D=w(e.port.process,n),t[14]=e.port.name,t[15]=e.port.process,t[16]=D}else D=t[16];let O;t[19]===D?O=t[20]:(O=(0,Q.jsx)(st,{children:D}),t[19]=D,t[20]=O);let k;t[21]===e.port.port?k=t[22]:(k=y(e.port.port),t[21]=e.port.port,t[22]=k);let A;t[23]===k?A=t[24]:(A=(0,Q.jsxs)(ct,{children:[`Port `,k]}),t[23]=k,t[24]=A);let j;t[25]!==O||t[26]!==A?(j=(0,Q.jsxs)(at,{children:[O,A]}),t[25]=O,t[26]=A,t[27]=j):j=t[27];let M;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(M=e=>{p(Dt)(e)&&o(e)},t[28]=M):M=t[28];let N;t[29]===T?N=t[30]:(N=ee(Dt.literals,e=>(0,Q.jsx)(ce,{value:e,disabled:T,children:ne(e)},e)),t[29]=T,t[30]=N);let P;t[31]===N?P=t[32]:(P=(0,Q.jsx)(ve,{className:`w-full`,children:N}),t[31]=N,t[32]=P);let re;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Q.jsx)(ue,{htmlFor:`expose-tailnet`,children:`Address`}),t[33]=re):re=t[33];let F;t[34]!==e.port.port||t[35]!==x?(F=g(x===``,{onFalse:()=>`https://${x}:${y(e.port.port)}`,onTrue:m(``)}),t[34]=e.port.port,t[35]=x,t[36]=F):F=t[36];let I;t[37]===F?I=t[38]:(I=(0,Q.jsx)(pe,{value:`tailnet`,children:(0,Q.jsxs)(fe,{children:[re,(0,Q.jsx)(Et,{id:`expose-tailnet`,readOnly:!0,value:F})]})}),t[37]=F,t[38]=I);let ie;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Q.jsx)(ue,{htmlFor:`expose-public`,children:`Hostname`}),t[39]=ie):ie=t[39];let ae=i===`public`,oe;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(oe=e=>l(h(e.target.value)),t[40]=oe):oe=t[40];let L;t[41]!==c||t[42]!==T||t[43]!==ae?(L=(0,Q.jsx)(pe,{value:`public`,children:(0,Q.jsxs)(fe,{children:[ie,(0,Q.jsx)(Et,{id:`expose-public`,required:ae,placeholder:`app.example.com`,autoCapitalize:`none`,spellCheck:!1,value:c,disabled:T,onChange:oe})]})}),t[41]=c,t[42]=T,t[43]=ae,t[44]=L):L=t[44];let R;t[45]!==i||t[46]!==P||t[47]!==I||t[48]!==L?(R=(0,Q.jsxs)(se,{value:i,onValueChange:M,children:[P,I,L]}),t[45]=i,t[46]=P,t[47]=I,t[48]=L,t[49]=R):R=t[49];let z;t[50]===n?z=t[51]:(z=(0,Q.jsx)(ye,{result:n}),t[50]=n,t[51]=z);let B;t[52]===T?B=t[53]:(B=(0,Q.jsx)(nt,{render:(0,Q.jsx)(a,{variant:`outline`,type:`button`,disabled:T}),children:`Cancel`}),t[52]=T,t[53]=B);let le=T||i===`tailnet`&&x===``||i===`public`&&c===``,V;t[54]===T?V=t[55]:(V=g(T,{onFalse:m(`Expose`),onTrue:m(`Exposing…`)}),t[54]=T,t[55]=V);let H;t[56]!==le||t[57]!==V?(H=(0,Q.jsx)(a,{type:`submit`,disabled:le,children:V}),t[56]=le,t[57]=V,t[58]=H):H=t[58];let U;t[59]!==B||t[60]!==H?(U=(0,Q.jsxs)(ot,{children:[B,H]}),t[59]=B,t[60]=H,t[61]=U):U=t[61];let W;t[62]!==R||t[63]!==z||t[64]!==U||t[65]!==j?(W=(0,Q.jsxs)(ge,{children:[j,R,z,U]}),t[62]=R,t[63]=z,t[64]=U,t[65]=j,t[66]=W):W=t[66];let G;return t[67]!==E||t[68]!==W?(G=(0,Q.jsx)(`form`,{onSubmit:E,children:W}),t[67]=E,t[68]=W,t[69]=G):G=t[69],G}function kt(e){return e.hostname}function At(){let e=(0,$.c)(2),[t,n]=u(c),r;return e[0]===n?r=e[1]:(r=e=>(0,Q.jsx)(et,{open:!0,onOpenChange:e=>{e||n(_())},children:(0,Q.jsx)(it,{showCloseButton:!1,children:E(e.port.port,{onNone:D,onSome:t=>(0,Q.jsx)(Ot,{items:e.snapshot.items,port:e.port,portNumber:t},e.port.id)})})}),e[0]=n,e[1]=r),E(x({port:t,snapshot:S(o(l))}),{onNone:D,onSome:r})}function jt(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(At,{}),(0,Q.jsx)(i,{})]}),e[0]=t):t=e[0],t}export{jt as component};