UNPKG

@fntio/infra-client

Version:

Self-hosted AWS access portal: credential vending, target-account trust, and grant-driven private networking as CDK stacks and constructs.

2 lines (1 loc) • 7.53 kB
import{b as V}from"./chunk-MID2IYAR.js";import{a as B}from"./chunk-7A4HO4AV.js";import{Aa as a,Ba as d,Ca as T,F as v,I as l,Ja as _,K as m,L as h,La as c,Na as I,Oa as L,Pa as y,Q as P,R as r,Ra as N,Sa as A,Ua as j,Va as K,Xa as b,Y as S,Ya as M,Z as z,_ as u,ga as E,pb as C,qb as W,rb as p,sa as O,sb as x,ta as k,tb as g,ua as D,ub as H,za as R}from"./chunk-FYA6QUPZ.js";var f=class n{tpl=r(null);content=this.tpl.asReadonly();widthSig=r(0);width=this.widthSig.asReadonly();open(e){this.tpl.set(e)}close(e){this.tpl()===e&&this.tpl.set(null)}setWidth(e){this.widthSig.set(e)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=v({token:n,factory:n.\u0275fac,providedIn:"root"})};function ee(n,e,t){let i=l(f);p(()=>{let o=e();o&&(n()?i.open(o):i.close(o))}),p(()=>{let o=i.content(),s=C(e);s&&o!==null&&o!==s&&C(n)&&t()}),l(P).onDestroy(()=>{let o=e();o&&i.close(o)})}var w=class n{static DEFAULT=560;minWidthSig=r(n.DEFAULT);minWidth=this.minWidthSig.asReadonly();report(e){this.minWidthSig.set(Math.max(e,n.DEFAULT))}reset(){this.minWidthSig.set(n.DEFAULT)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=v({token:n,factory:n.\u0275fac,providedIn:"root"})};var Y=["bodyEl"],q=[[["","panel-header-actions",""]],"*",[["","panel-footer",""]]],G=["[panel-header-actions]","*","[panel-footer]"];function Q(n,e){if(n&1){let t=_();a(0,"button",8),c("click",function(){m(t);let o=I();return h(o.back.emit())}),b(1),d(),T(2,"app-icon",9)}n&2&&(u(),M(e),u(),R("strokeWidth",2))}var X=class n{title=g.required();size=g("md");contentKey=g(null);parentLabel=g(null);closed=x();back=x();bodyEl=H("bodyEl");lastKey=null;panelService=l(f);contentWidth=l(w);static MAX_WIDTH=1100;static BESIDE_RAIL=104;static STORAGE_KEY="ui.panelWidth";customWidth=r(n.readStoredWidth());resizing=r(!1);opened=r(!1);static readStoredWidth(){try{let e=Number(localStorage.getItem(n.STORAGE_KEY));return e>0?e:null}catch{return null}}baseWidth=W(()=>this.size()==="lg"?480:400);windowWidth=r(window.innerWidth);effectiveWidth=W(()=>{let e=this.customWidth()??this.baseWidth(),t=this.windowWidth()-n.BESIDE_RAIL-this.contentWidth.minWidth();return Math.max(this.baseWidth(),Math.min(e,t))});dragStartX=0;dragStartWidth=0;constructor(){p(()=>{let e=this.contentKey(),t=this.bodyEl()?.nativeElement;if(!t||e===this.lastKey)return;let i=this.lastKey===null;this.lastKey=e,!i&&(t.style.animation="none",t.offsetHeight,t.style.animation="")}),p(()=>{this.resizing()||this.panelService.setWidth(this.effectiveWidth())})}onWindowResize(){this.windowWidth.set(window.innerWidth)}ngOnDestroy(){this.panelService.setWidth(0),this.stopResizing()}onResizeStart(e){e.preventDefault(),this.opened.set(!0),this.resizing.set(!0),this.dragStartX=e.clientX,this.dragStartWidth=this.effectiveWidth(),document.body.style.userSelect="none",document.body.style.cursor="col-resize",window.addEventListener("mousemove",this.onResizeMove),window.addEventListener("mouseup",this.onResizeEnd)}onResizeMove=e=>{let t=this.size()==="lg"?480:400,i=this.dragStartX-e.clientX,o=Math.min(n.MAX_WIDTH,window.innerWidth-n.BESIDE_RAIL-this.contentWidth.minWidth()),s=Math.min(o,Math.max(t,this.dragStartWidth+i));this.customWidth.set(s)};onResizeEnd=()=>{this.stopResizing()};stopResizing(){if(this.resizing()&&this.customWidth()!==null)try{localStorage.setItem(n.STORAGE_KEY,String(this.customWidth()))}catch{}this.resizing.set(!1),document.body.style.userSelect="",document.body.style.cursor="",window.removeEventListener("mousemove",this.onResizeMove),window.removeEventListener("mouseup",this.onResizeEnd)}onEscape(){document.querySelector('[role="dialog"][aria-modal="true"]')||this.closed.emit()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=E({type:n,selectors:[["app-panel"]],viewQuery:function(t,i){t&1&&N(i.bodyEl,Y,5),t&2&&A()},hostBindings:function(t,i){t&1&&c("resize",function(){return i.onWindowResize()},S)("keydown.escape",function(){return i.onEscape()},z)},inputs:{title:[1,"title"],size:[1,"size"],contentKey:[1,"contentKey"],parentLabel:[1,"parentLabel"]},outputs:{closed:"closed",back:"back"},ngContentSelectors:G,decls:15,vars:11,consts:[["bodyEl",""],["role","complementary",3,"animationend"],[1,"resize-handle",3,"mousedown"],[1,"header-left"],[1,"ui-subtitle"],["variant","ghost","size","icon","ariaLabel","Close panel",3,"click"],[1,"body"],[1,"footer"],["type","button",1,"crumb-parent",3,"click"],["name","chevron-right",1,"h-3.5","w-3.5","shrink-0",2,"color","var(--placeholder)",3,"strokeWidth"]],template:function(t,i){if(t&1){let o=_();L(q),a(0,"aside",1),c("animationend",function(){return m(o),h(i.opened.set(!0))}),a(1,"div",2),c("mousedown",function(U){return m(o),h(i.onResizeStart(U))}),d(),a(2,"header")(3,"div",3),k(4,Q,3,2),a(5,"h2",4),b(6),d()(),y(7),a(8,"app-button",5),c("click",function(){return m(o),h(i.closed.emit())}),b(9," \u2715 "),d()(),a(10,"div",6,0),y(12,1),d(),a(13,"div",7),y(14,2),d()()}if(t&2){let o;j("width",i.effectiveWidth(),"px"),K("lg",i.size()==="lg")("resizing",i.resizing())("opened",i.opened()),O("aria-label",i.title()),u(4),D((o=i.parentLabel())?4:-1,o),u(2),M(i.title())}},dependencies:[B,V],styles:["[_nghost-%COMP%]{display:contents}aside[_ngcontent-%COMP%]{width:400px;height:calc(100vh - 24px);flex-shrink:0;display:flex;flex-direction:column;border-radius:calc(var(--radius) * 2);overflow:hidden;-webkit-backdrop-filter:blur(42px) saturate(1.5);backdrop-filter:blur(42px) saturate(1.5);background:var(--glass-panel-bg);box-shadow:var(--shadow-card);position:relative;z-index:1}aside[_ngcontent-%COMP%]:not(.opened){animation:_ngcontent-%COMP%_panel-in .24s var(--ease-emphasized)}aside.resizing[_ngcontent-%COMP%]{animation:none}.resize-handle[_ngcontent-%COMP%]{position:absolute;left:0;top:0;bottom:0;width:6px;cursor:col-resize;z-index:2;touch-action:none}.resize-handle[_ngcontent-%COMP%]:hover, aside.resizing[_ngcontent-%COMP%] .resize-handle[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--foreground) 12%,transparent)}@keyframes _ngcontent-%COMP%_panel-in{0%{width:0;opacity:0}}header[_ngcontent-%COMP%], .body[_ngcontent-%COMP%]{min-width:400px}aside.lg[_ngcontent-%COMP%] header[_ngcontent-%COMP%], aside.lg[_ngcontent-%COMP%] .body[_ngcontent-%COMP%]{min-width:480px}@media(prefers-reduced-motion:reduce){aside[_ngcontent-%COMP%], .body[_ngcontent-%COMP%]{animation:none}}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:16px 24px;border-bottom:1px solid var(--border);flex-shrink:0}.header-left[_ngcontent-%COMP%]{display:flex;align-items:center;gap:6px;min-width:0;flex:1}.header-left[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crumb-parent[_ngcontent-%COMP%]{flex:0 2 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.9375rem;font-weight:500;color:var(--placeholder);transition:color .15s}.crumb-parent[_ngcontent-%COMP%]:hover{color:var(--surface-foreground)}.body[_ngcontent-%COMP%]{flex:1;min-height:0;overflow-y:auto;scrollbar-gutter:stable;padding:20px 14px 20px 24px;animation:_ngcontent-%COMP%_body-in .18s var(--ease-emphasized)}@keyframes _ngcontent-%COMP%_body-in{0%{opacity:0;transform:translateY(8px)}}.footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:12px 24px;border-top:1px solid var(--border);flex-shrink:0}.footer[_ngcontent-%COMP%]:empty{display:none}"]})};export{f as a,ee as b,w as c,X as d};