diff --git a/chunk-6ETDIVCW.js b/chunk-JGT6E7XW.js similarity index 96% rename from chunk-6ETDIVCW.js rename to chunk-JGT6E7XW.js index d7d844d..1a651e2 100644 --- a/chunk-6ETDIVCW.js +++ b/chunk-JGT6E7XW.js @@ -1 +1 @@ -import{A as ae,B as g,C as ue,D as ce,E as T,F as j,G as V,H as de,I as le,K as z,L as he,M as fe,a as b,b as N,c as _,d as f,e as w,f as a,g as M,h as S,i as I,j as te,k as ne,l as y,m as P,n as ie,o as k,p as re,q as C,r as x,s as E,t as $,u as se,v as U,w as h,x as l,y as H,z as oe}from"./chunk-VDGI7CPG.js";var ge=null;function Y(){return ge}function pe(i){ge??=i}var R=class{};var p=new w("");function De(i,n){n=encodeURIComponent(n);for(let e of i.split(";")){let t=e.indexOf("="),[r,s]=t==-1?[e,""]:[e.slice(0,t),e.slice(t+1)];if(r.trim()===n)return decodeURIComponent(s)}return null}var me=(()=>{class i{transform(e){return JSON.stringify(e,null,2)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275pipe=te({name:"json",type:i,pure:!1,standalone:!0})}}return i})();var ye="browser",xe="server";function Z(i){return i===xe}var O=class{};var X=class extends R{constructor(){super(...arguments),this.supportsDOMEvents=!0}},q=class i extends X{static makeCurrent(){pe(new i)}onAndCancel(n,e,t){return n.addEventListener(e,t),()=>{n.removeEventListener(e,t)}}dispatchEvent(n,e){n.dispatchEvent(e)}remove(n){n.remove()}createElement(n,e){return e=e||this.getDefaultDocument(),e.createElement(n)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(n){return n.nodeType===Node.ELEMENT_NODE}isShadowRoot(n){return n instanceof DocumentFragment}getGlobalEventTarget(n,e){return e==="window"?window:e==="document"?n:e==="body"?n.body:null}getBaseHref(n){let e=Ue();return e==null?null:He(e)}resetBaseElement(){F=null}getUserAgent(){return window.navigator.userAgent}getCookie(n){return De(document.cookie,n)}},F=null;function Ue(){return F=F||document.querySelector("base"),F?F.getAttribute("href"):null}function He(i){return new URL(i,document.baseURI).pathname}var je=(()=>{class i{build(){return new XMLHttpRequest}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=f({token:i,factory:i.\u0275fac})}}return i})(),J=new w(""),Se=(()=>{class i{constructor(e,t){this._zone=t,this._eventNameToPlugin=new Map,e.forEach(r=>{r.manager=this}),this._plugins=e.slice().reverse()}addEventListener(e,t,r){return this._findPluginFor(t).addEventListener(e,t,r)}getZone(){return this._zone}_findPluginFor(e){let t=this._eventNameToPlugin.get(e);if(t)return t;if(t=this._plugins.find(s=>s.supports(e)),!t)throw new _(5101,!1);return this._eventNameToPlugin.set(e,t),t}static{this.\u0275fac=function(t){return new(t||i)(a(J),a(y))}}static{this.\u0275prov=f({token:i,factory:i.\u0275fac})}}return i})(),L=class{constructor(n){this._doc=n}},W="ng-app-id",Fe=(()=>{class i{constructor(e,t,r,s={}){this.doc=e,this.appId=t,this.nonce=r,this.platformId=s,this.styleRef=new Map,this.hostNodes=new Set,this.styleNodesInDOM=this.collectServerRenderedStyles(),this.platformIsServer=Z(s),this.resetHostNodes()}addStyles(e){for(let t of e)this.changeUsageCount(t,1)===1&&this.onStyleAdded(t)}removeStyles(e){for(let t of e)this.changeUsageCount(t,-1)<=0&&this.onStyleRemoved(t)}ngOnDestroy(){let e=this.styleNodesInDOM;e&&(e.forEach(t=>t.remove()),e.clear());for(let t of this.getAllStyles())this.onStyleRemoved(t);this.resetHostNodes()}addHost(e){this.hostNodes.add(e);for(let t of this.getAllStyles())this.addStyleToHost(e,t)}removeHost(e){this.hostNodes.delete(e)}getAllStyles(){return this.styleRef.keys()}onStyleAdded(e){for(let t of this.hostNodes)this.addStyleToHost(t,e)}onStyleRemoved(e){let t=this.styleRef;t.get(e)?.elements?.forEach(r=>r.remove()),t.delete(e)}collectServerRenderedStyles(){let e=this.doc.head?.querySelectorAll(`style[${W}="${this.appId}"]`);if(e?.length){let t=new Map;return e.forEach(r=>{r.textContent!=null&&t.set(r.textContent,r)}),t}return null}changeUsageCount(e,t){let r=this.styleRef;if(r.has(e)){let s=r.get(e);return s.usage+=t,s.usage}return r.set(e,{usage:t,elements:[]}),t}getStyleElement(e,t){let r=this.styleNodesInDOM,s=r?.get(t);if(s?.parentNode===e)return r.delete(t),s.removeAttribute(W),s;{let o=this.doc.createElement("style");return this.nonce&&o.setAttribute("nonce",this.nonce),o.textContent=t,this.platformIsServer&&o.setAttribute(W,this.appId),e.appendChild(o),o}}addStyleToHost(e,t){let r=this.getStyleElement(e,t),s=this.styleRef,o=s.get(t)?.elements;o?o.push(r):s.set(t,{elements:[r],usage:1})}resetHostNodes(){let e=this.hostNodes;e.clear(),e.add(this.doc.head)}static{this.\u0275fac=function(t){return new(t||i)(a(p),a(k),a(x,8),a(C))}}static{this.\u0275prov=f({token:i,factory:i.\u0275fac})}}return i})(),K={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/Math/MathML"},ee=/%COMP%/g,ve="%COMP%",Ve=`_nghost-${ve}`,ze=`_ngcontent-${ve}`,Ge=!0,Ye=new w("",{providedIn:"root",factory:()=>Ge});function Ze(i){return ze.replace(ee,i)}function We(i){return Ve.replace(ee,i)}function Ae(i,n){return n.map(e=>e.replace(ee,i))}var Ce=(()=>{class i{constructor(e,t,r,s,o,u,c,d=null){this.eventManager=e,this.sharedStylesHost=t,this.appId=r,this.removeStylesOnCompDestroy=s,this.doc=o,this.platformId=u,this.ngZone=c,this.nonce=d,this.rendererByCompId=new Map,this.platformIsServer=Z(u),this.defaultRenderer=new v(e,o,c,this.platformIsServer)}createRenderer(e,t){if(!e||!t)return this.defaultRenderer;this.platformIsServer&&t.encapsulation===S.ShadowDom&&(t=N(b({},t),{encapsulation:S.Emulated}));let r=this.getOrCreateRenderer(e,t);return r instanceof B?r.applyToHost(e):r instanceof A&&r.applyStyles(),r}getOrCreateRenderer(e,t){let r=this.rendererByCompId,s=r.get(t.id);if(!s){let o=this.doc,u=this.ngZone,c=this.eventManager,d=this.sharedStylesHost,D=this.removeStylesOnCompDestroy,m=this.platformIsServer;switch(t.encapsulation){case S.Emulated:s=new B(c,d,t,this.appId,D,o,u,m);break;case S.ShadowDom:return new Q(c,d,e,t,o,u,this.nonce,m);default:s=new A(c,d,t,D,o,u,m);break}r.set(t.id,s)}return s}ngOnDestroy(){this.rendererByCompId.clear()}static{this.\u0275fac=function(t){return new(t||i)(a(Se),a(Fe),a(k),a(Ye),a(p),a(C),a(y),a(x))}}static{this.\u0275prov=f({token:i,factory:i.\u0275fac})}}return i})(),v=class{constructor(n,e,t,r){this.eventManager=n,this.doc=e,this.ngZone=t,this.platformIsServer=r,this.data=Object.create(null),this.throwOnSyntheticProps=!0,this.destroyNode=null}destroy(){}createElement(n,e){return e?this.doc.createElementNS(K[e]||e,n):this.doc.createElement(n)}createComment(n){return this.doc.createComment(n)}createText(n){return this.doc.createTextNode(n)}appendChild(n,e){(Ee(n)?n.content:n).appendChild(e)}insertBefore(n,e,t){n&&(Ee(n)?n.content:n).insertBefore(e,t)}removeChild(n,e){e.remove()}selectRootElement(n,e){let t=typeof n=="string"?this.doc.querySelector(n):n;if(!t)throw new _(-5104,!1);return e||(t.textContent=""),t}parentNode(n){return n.parentNode}nextSibling(n){return n.nextSibling}setAttribute(n,e,t,r){if(r){e=r+":"+e;let s=K[r];s?n.setAttributeNS(s,e,t):n.setAttribute(e,t)}else n.setAttribute(e,t)}removeAttribute(n,e,t){if(t){let r=K[t];r?n.removeAttributeNS(r,e):n.removeAttribute(`${t}:${e}`)}else n.removeAttribute(e)}addClass(n,e){n.classList.add(e)}removeClass(n,e){n.classList.remove(e)}setStyle(n,e,t,r){r&(E.DashCase|E.Important)?n.style.setProperty(e,t,r&E.Important?"important":""):n.style[e]=t}removeStyle(n,e,t){t&E.DashCase?n.style.removeProperty(e):n.style[e]=""}setProperty(n,e,t){n!=null&&(n[e]=t)}setValue(n,e){n.nodeValue=e}listen(n,e,t){if(typeof n=="string"&&(n=Y().getGlobalEventTarget(this.doc,n),!n))throw new Error(`Unsupported event target ${n} for event ${e}`);return this.eventManager.addEventListener(n,e,this.decoratePreventDefault(t))}decoratePreventDefault(n){return e=>{if(e==="__ngUnwrap__")return n;(this.platformIsServer?this.ngZone.runGuarded(()=>n(e)):n(e))===!1&&e.preventDefault()}}};function Ee(i){return i.tagName==="TEMPLATE"&&i.content!==void 0}var Q=class extends v{constructor(n,e,t,r,s,o,u,c){super(n,s,o,c),this.sharedStylesHost=e,this.hostEl=t,this.shadowRoot=t.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);let d=Ae(r.id,r.styles);for(let D of d){let m=document.createElement("style");u&&m.setAttribute("nonce",u),m.textContent=D,this.shadowRoot.appendChild(m)}}nodeOrShadowRoot(n){return n===this.hostEl?this.shadowRoot:n}appendChild(n,e){return super.appendChild(this.nodeOrShadowRoot(n),e)}insertBefore(n,e,t){return super.insertBefore(this.nodeOrShadowRoot(n),e,t)}removeChild(n,e){return super.removeChild(null,e)}parentNode(n){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(n)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}},A=class extends v{constructor(n,e,t,r,s,o,u,c){super(n,s,o,u),this.sharedStylesHost=e,this.removeStylesOnCompDestroy=r,this.styles=c?Ae(c,t.styles):t.styles}applyStyles(){this.sharedStylesHost.addStyles(this.styles)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles)}},B=class extends A{constructor(n,e,t,r,s,o,u,c){let d=r+"-"+t.id;super(n,e,t,s,o,u,c,d),this.contentAttr=Ze(d),this.hostAttr=We(d)}applyToHost(n){this.applyStyles(),this.setAttribute(n,this.hostAttr,"")}createElement(n,e){let t=super.createElement(n,e);return super.setAttribute(t,this.contentAttr,""),t}},Ke=(()=>{class i extends L{constructor(e){super(e)}supports(e){return!0}addEventListener(e,t,r){return e.addEventListener(t,r,!1),()=>this.removeEventListener(e,t,r)}removeEventListener(e,t,r){return e.removeEventListener(t,r)}static{this.\u0275fac=function(t){return new(t||i)(a(p))}}static{this.\u0275prov=f({token:i,factory:i.\u0275fac})}}return i})(),we=["alt","control","meta","shift"],Xe={"\b":"Backspace"," ":"Tab","\x7F":"Delete","\x1B":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},qe={alt:i=>i.altKey,control:i=>i.ctrlKey,meta:i=>i.metaKey,shift:i=>i.shiftKey},Je=(()=>{class i extends L{constructor(e){super(e)}supports(e){return i.parseEventName(e)!=null}addEventListener(e,t,r){let s=i.parseEventName(t),o=i.eventCallback(s.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Y().onAndCancel(e,s.domEventName,o))}static parseEventName(e){let t=e.toLowerCase().split("."),r=t.shift();if(t.length===0||!(r==="keydown"||r==="keyup"))return null;let s=i._normalizeKey(t.pop()),o="",u=t.indexOf("code");if(u>-1&&(t.splice(u,1),o="code."),we.forEach(d=>{let D=t.indexOf(d);D>-1&&(t.splice(D,1),o+=d+".")}),o+=s,t.length!=0||s.length===0)return null;let c={};return c.domEventName=r,c.fullKey=o,c}static matchEventFullKeyCode(e,t){let r=Xe[e.key]||e.key,s="";return t.indexOf("code.")>-1&&(r=e.code,s="code."),r==null||!r?!1:(r=r.toLowerCase(),r===" "?r="space":r==="."&&(r="dot"),we.forEach(o=>{if(o!==r){let u=qe[o];u(e)&&(s+=o+".")}}),s+=r,s===t)}static eventCallback(e,t,r){return s=>{i.matchEventFullKeyCode(s,e)&&r.runGuarded(()=>t(s))}}static _normalizeKey(e){return e==="esc"?"escape":e}static{this.\u0275fac=function(t){return new(t||i)(a(p))}}static{this.\u0275prov=f({token:i,factory:i.\u0275fac})}}return i})();function be(i,n){return le(b({rootComponent:i},Qe(n)))}function Qe(i){return{appProviders:[...rt,...i?.providers??[]],platformProviders:it}}function et(){q.makeCurrent()}function tt(){return new P}function nt(){return ie(document),document}var it=[{provide:C,useValue:ye},{provide:re,useValue:et,multi:!0},{provide:p,useFactory:nt,deps:[]}];var rt=[{provide:ne,useValue:"root"},{provide:P,useFactory:tt,deps:[]},{provide:J,useClass:Ke,multi:!0,deps:[p,y,C]},{provide:J,useClass:Je,multi:!0,deps:[p]},Ce,Fe,Se,{provide:se,useExisting:Ce},{provide:O,useClass:je,deps:[]},[]];console.debug("Default Config: ",z());console.debug("Feature Flags: ",z());var _e={providers:[de({eventCoalescing:!0}),fe()]};var st=["*"],Me=(()=>{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=I({type:i,selectors:[["app-editor"]],standalone:!0,features:[T],ngContentSelectors:st,decls:12,vars:0,consts:[[1,"flex-grow","flex","flex-col","dark:bg-gray-900","bg-white","rounded-md"],[1,"dark:bg-blue-600","bg-blue-500","flex","items-center","justify-between","p-2","dark:text-white","text-white","rounded-md"],[1,"flex","space-x-2"],[1,"w-3","h-3","bg-red-500","rounded-full"],[1,"w-3","h-3","bg-yellow-400","rounded-full"],[1,"w-3","h-3","bg-green-500","rounded-full"],[1,"text-lg"],[1,"w-6","h-6"],[1,"p-4","overflow-auto"],[1,"text-sm","leading-relaxed"]],template:function(t,r){t&1&&(oe(),h(0,"div",0)(1,"div",1)(2,"div",2),H(3,"div",3)(4,"div",4)(5,"div",5),l(),h(6,"div",6),g(7,"JSON Viewer"),l(),H(8,"div",7),l(),h(9,"div",8)(10,"pre",9),ae(11),l()()())}})}}return i})();var Ie=(()=>{class i{constructor(){this.configService=M(he),this.defaultConfig=U(this.configService.getConfig()),this.featureFlags=U(this.configService.getConfig("features"))}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=I({type:i,selectors:[["app-root"]],standalone:!0,features:[T],decls:18,vars:6,consts:[[1,"flex","flex-col","items-center","bg-slate-200","dark:bg-slate-700","h-svh","gap-5","dark:text-white","font-sans"],[1,"flex","flex-row","items-center","justify-center","bg-blue-500","dark:bg-blue-700","w-full","p-3","rounded-sm","shadow-md","text-white"],[1,"text-3xl","font-bold"],[1,"flex","flex-col","items-center","gap-2"],[1,"text-xl","font-semibold"],[1,""]],template:function(t,r){t&1&&(h(0,"div",0)(1,"div",1)(2,"h1",2),g(3,"NG-Remote-Config Example"),l()(),h(4,"div",3)(5,"h2",4),g(6,"Config"),l(),h(7,"div")(8,"app-editor"),g(9),j(10,"json"),l()()(),h(11,"div",3)(12,"h2",4),g(13,"Feature Flags"),l(),h(14,"div",5)(15,"app-editor",5),g(16),j(17,"json"),l()()()()),t&2&&($(9),ue(V(10,2,r.defaultConfig())),$(7),ce(" ",V(17,4,r.featureFlags())," "))},dependencies:[me,Me]})}}return i})();be(Ie,_e); +import{A as ae,B as g,C as ue,D as ce,E as T,F as j,G as V,H as de,I as le,K as z,L as he,M as fe,a as b,b as N,c as _,d as f,e as w,f as a,g as M,h as S,i as I,j as te,k as ne,l as y,m as P,n as ie,o as k,p as re,q as C,r as x,s as E,t as $,u as se,v as U,w as h,x as l,y as H,z as oe}from"./chunk-VDGI7CPG.js";var ge=null;function Y(){return ge}function pe(i){ge??=i}var R=class{};var p=new w("");function De(i,n){n=encodeURIComponent(n);for(let e of i.split(";")){let t=e.indexOf("="),[r,s]=t==-1?[e,""]:[e.slice(0,t),e.slice(t+1)];if(r.trim()===n)return decodeURIComponent(s)}return null}var me=(()=>{class i{transform(e){return JSON.stringify(e,null,2)}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275pipe=te({name:"json",type:i,pure:!1,standalone:!0})}}return i})();var ye="browser",xe="server";function Z(i){return i===xe}var O=class{};var X=class extends R{constructor(){super(...arguments),this.supportsDOMEvents=!0}},q=class i extends X{static makeCurrent(){pe(new i)}onAndCancel(n,e,t){return n.addEventListener(e,t),()=>{n.removeEventListener(e,t)}}dispatchEvent(n,e){n.dispatchEvent(e)}remove(n){n.remove()}createElement(n,e){return e=e||this.getDefaultDocument(),e.createElement(n)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(n){return n.nodeType===Node.ELEMENT_NODE}isShadowRoot(n){return n instanceof DocumentFragment}getGlobalEventTarget(n,e){return e==="window"?window:e==="document"?n:e==="body"?n.body:null}getBaseHref(n){let e=Ue();return e==null?null:He(e)}resetBaseElement(){F=null}getUserAgent(){return window.navigator.userAgent}getCookie(n){return De(document.cookie,n)}},F=null;function Ue(){return F=F||document.querySelector("base"),F?F.getAttribute("href"):null}function He(i){return new URL(i,document.baseURI).pathname}var je=(()=>{class i{build(){return new XMLHttpRequest}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275prov=f({token:i,factory:i.\u0275fac})}}return i})(),J=new w(""),Se=(()=>{class i{constructor(e,t){this._zone=t,this._eventNameToPlugin=new Map,e.forEach(r=>{r.manager=this}),this._plugins=e.slice().reverse()}addEventListener(e,t,r){return this._findPluginFor(t).addEventListener(e,t,r)}getZone(){return this._zone}_findPluginFor(e){let t=this._eventNameToPlugin.get(e);if(t)return t;if(t=this._plugins.find(s=>s.supports(e)),!t)throw new _(5101,!1);return this._eventNameToPlugin.set(e,t),t}static{this.\u0275fac=function(t){return new(t||i)(a(J),a(y))}}static{this.\u0275prov=f({token:i,factory:i.\u0275fac})}}return i})(),L=class{constructor(n){this._doc=n}},W="ng-app-id",Fe=(()=>{class i{constructor(e,t,r,s={}){this.doc=e,this.appId=t,this.nonce=r,this.platformId=s,this.styleRef=new Map,this.hostNodes=new Set,this.styleNodesInDOM=this.collectServerRenderedStyles(),this.platformIsServer=Z(s),this.resetHostNodes()}addStyles(e){for(let t of e)this.changeUsageCount(t,1)===1&&this.onStyleAdded(t)}removeStyles(e){for(let t of e)this.changeUsageCount(t,-1)<=0&&this.onStyleRemoved(t)}ngOnDestroy(){let e=this.styleNodesInDOM;e&&(e.forEach(t=>t.remove()),e.clear());for(let t of this.getAllStyles())this.onStyleRemoved(t);this.resetHostNodes()}addHost(e){this.hostNodes.add(e);for(let t of this.getAllStyles())this.addStyleToHost(e,t)}removeHost(e){this.hostNodes.delete(e)}getAllStyles(){return this.styleRef.keys()}onStyleAdded(e){for(let t of this.hostNodes)this.addStyleToHost(t,e)}onStyleRemoved(e){let t=this.styleRef;t.get(e)?.elements?.forEach(r=>r.remove()),t.delete(e)}collectServerRenderedStyles(){let e=this.doc.head?.querySelectorAll(`style[${W}="${this.appId}"]`);if(e?.length){let t=new Map;return e.forEach(r=>{r.textContent!=null&&t.set(r.textContent,r)}),t}return null}changeUsageCount(e,t){let r=this.styleRef;if(r.has(e)){let s=r.get(e);return s.usage+=t,s.usage}return r.set(e,{usage:t,elements:[]}),t}getStyleElement(e,t){let r=this.styleNodesInDOM,s=r?.get(t);if(s?.parentNode===e)return r.delete(t),s.removeAttribute(W),s;{let o=this.doc.createElement("style");return this.nonce&&o.setAttribute("nonce",this.nonce),o.textContent=t,this.platformIsServer&&o.setAttribute(W,this.appId),e.appendChild(o),o}}addStyleToHost(e,t){let r=this.getStyleElement(e,t),s=this.styleRef,o=s.get(t)?.elements;o?o.push(r):s.set(t,{elements:[r],usage:1})}resetHostNodes(){let e=this.hostNodes;e.clear(),e.add(this.doc.head)}static{this.\u0275fac=function(t){return new(t||i)(a(p),a(k),a(x,8),a(C))}}static{this.\u0275prov=f({token:i,factory:i.\u0275fac})}}return i})(),K={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/Math/MathML"},ee=/%COMP%/g,ve="%COMP%",Ve=`_nghost-${ve}`,ze=`_ngcontent-${ve}`,Ge=!0,Ye=new w("",{providedIn:"root",factory:()=>Ge});function Ze(i){return ze.replace(ee,i)}function We(i){return Ve.replace(ee,i)}function Ae(i,n){return n.map(e=>e.replace(ee,i))}var Ce=(()=>{class i{constructor(e,t,r,s,o,u,c,d=null){this.eventManager=e,this.sharedStylesHost=t,this.appId=r,this.removeStylesOnCompDestroy=s,this.doc=o,this.platformId=u,this.ngZone=c,this.nonce=d,this.rendererByCompId=new Map,this.platformIsServer=Z(u),this.defaultRenderer=new v(e,o,c,this.platformIsServer)}createRenderer(e,t){if(!e||!t)return this.defaultRenderer;this.platformIsServer&&t.encapsulation===S.ShadowDom&&(t=N(b({},t),{encapsulation:S.Emulated}));let r=this.getOrCreateRenderer(e,t);return r instanceof B?r.applyToHost(e):r instanceof A&&r.applyStyles(),r}getOrCreateRenderer(e,t){let r=this.rendererByCompId,s=r.get(t.id);if(!s){let o=this.doc,u=this.ngZone,c=this.eventManager,d=this.sharedStylesHost,D=this.removeStylesOnCompDestroy,m=this.platformIsServer;switch(t.encapsulation){case S.Emulated:s=new B(c,d,t,this.appId,D,o,u,m);break;case S.ShadowDom:return new Q(c,d,e,t,o,u,this.nonce,m);default:s=new A(c,d,t,D,o,u,m);break}r.set(t.id,s)}return s}ngOnDestroy(){this.rendererByCompId.clear()}static{this.\u0275fac=function(t){return new(t||i)(a(Se),a(Fe),a(k),a(Ye),a(p),a(C),a(y),a(x))}}static{this.\u0275prov=f({token:i,factory:i.\u0275fac})}}return i})(),v=class{constructor(n,e,t,r){this.eventManager=n,this.doc=e,this.ngZone=t,this.platformIsServer=r,this.data=Object.create(null),this.throwOnSyntheticProps=!0,this.destroyNode=null}destroy(){}createElement(n,e){return e?this.doc.createElementNS(K[e]||e,n):this.doc.createElement(n)}createComment(n){return this.doc.createComment(n)}createText(n){return this.doc.createTextNode(n)}appendChild(n,e){(Ee(n)?n.content:n).appendChild(e)}insertBefore(n,e,t){n&&(Ee(n)?n.content:n).insertBefore(e,t)}removeChild(n,e){e.remove()}selectRootElement(n,e){let t=typeof n=="string"?this.doc.querySelector(n):n;if(!t)throw new _(-5104,!1);return e||(t.textContent=""),t}parentNode(n){return n.parentNode}nextSibling(n){return n.nextSibling}setAttribute(n,e,t,r){if(r){e=r+":"+e;let s=K[r];s?n.setAttributeNS(s,e,t):n.setAttribute(e,t)}else n.setAttribute(e,t)}removeAttribute(n,e,t){if(t){let r=K[t];r?n.removeAttributeNS(r,e):n.removeAttribute(`${t}:${e}`)}else n.removeAttribute(e)}addClass(n,e){n.classList.add(e)}removeClass(n,e){n.classList.remove(e)}setStyle(n,e,t,r){r&(E.DashCase|E.Important)?n.style.setProperty(e,t,r&E.Important?"important":""):n.style[e]=t}removeStyle(n,e,t){t&E.DashCase?n.style.removeProperty(e):n.style[e]=""}setProperty(n,e,t){n!=null&&(n[e]=t)}setValue(n,e){n.nodeValue=e}listen(n,e,t){if(typeof n=="string"&&(n=Y().getGlobalEventTarget(this.doc,n),!n))throw new Error(`Unsupported event target ${n} for event ${e}`);return this.eventManager.addEventListener(n,e,this.decoratePreventDefault(t))}decoratePreventDefault(n){return e=>{if(e==="__ngUnwrap__")return n;(this.platformIsServer?this.ngZone.runGuarded(()=>n(e)):n(e))===!1&&e.preventDefault()}}};function Ee(i){return i.tagName==="TEMPLATE"&&i.content!==void 0}var Q=class extends v{constructor(n,e,t,r,s,o,u,c){super(n,s,o,c),this.sharedStylesHost=e,this.hostEl=t,this.shadowRoot=t.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);let d=Ae(r.id,r.styles);for(let D of d){let m=document.createElement("style");u&&m.setAttribute("nonce",u),m.textContent=D,this.shadowRoot.appendChild(m)}}nodeOrShadowRoot(n){return n===this.hostEl?this.shadowRoot:n}appendChild(n,e){return super.appendChild(this.nodeOrShadowRoot(n),e)}insertBefore(n,e,t){return super.insertBefore(this.nodeOrShadowRoot(n),e,t)}removeChild(n,e){return super.removeChild(null,e)}parentNode(n){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(n)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}},A=class extends v{constructor(n,e,t,r,s,o,u,c){super(n,s,o,u),this.sharedStylesHost=e,this.removeStylesOnCompDestroy=r,this.styles=c?Ae(c,t.styles):t.styles}applyStyles(){this.sharedStylesHost.addStyles(this.styles)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles)}},B=class extends A{constructor(n,e,t,r,s,o,u,c){let d=r+"-"+t.id;super(n,e,t,s,o,u,c,d),this.contentAttr=Ze(d),this.hostAttr=We(d)}applyToHost(n){this.applyStyles(),this.setAttribute(n,this.hostAttr,"")}createElement(n,e){let t=super.createElement(n,e);return super.setAttribute(t,this.contentAttr,""),t}},Ke=(()=>{class i extends L{constructor(e){super(e)}supports(e){return!0}addEventListener(e,t,r){return e.addEventListener(t,r,!1),()=>this.removeEventListener(e,t,r)}removeEventListener(e,t,r){return e.removeEventListener(t,r)}static{this.\u0275fac=function(t){return new(t||i)(a(p))}}static{this.\u0275prov=f({token:i,factory:i.\u0275fac})}}return i})(),we=["alt","control","meta","shift"],Xe={"\b":"Backspace"," ":"Tab","\x7F":"Delete","\x1B":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},qe={alt:i=>i.altKey,control:i=>i.ctrlKey,meta:i=>i.metaKey,shift:i=>i.shiftKey},Je=(()=>{class i extends L{constructor(e){super(e)}supports(e){return i.parseEventName(e)!=null}addEventListener(e,t,r){let s=i.parseEventName(t),o=i.eventCallback(s.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>Y().onAndCancel(e,s.domEventName,o))}static parseEventName(e){let t=e.toLowerCase().split("."),r=t.shift();if(t.length===0||!(r==="keydown"||r==="keyup"))return null;let s=i._normalizeKey(t.pop()),o="",u=t.indexOf("code");if(u>-1&&(t.splice(u,1),o="code."),we.forEach(d=>{let D=t.indexOf(d);D>-1&&(t.splice(D,1),o+=d+".")}),o+=s,t.length!=0||s.length===0)return null;let c={};return c.domEventName=r,c.fullKey=o,c}static matchEventFullKeyCode(e,t){let r=Xe[e.key]||e.key,s="";return t.indexOf("code.")>-1&&(r=e.code,s="code."),r==null||!r?!1:(r=r.toLowerCase(),r===" "?r="space":r==="."&&(r="dot"),we.forEach(o=>{if(o!==r){let u=qe[o];u(e)&&(s+=o+".")}}),s+=r,s===t)}static eventCallback(e,t,r){return s=>{i.matchEventFullKeyCode(s,e)&&r.runGuarded(()=>t(s))}}static _normalizeKey(e){return e==="esc"?"escape":e}static{this.\u0275fac=function(t){return new(t||i)(a(p))}}static{this.\u0275prov=f({token:i,factory:i.\u0275fac})}}return i})();function be(i,n){return le(b({rootComponent:i},Qe(n)))}function Qe(i){return{appProviders:[...rt,...i?.providers??[]],platformProviders:it}}function et(){q.makeCurrent()}function tt(){return new P}function nt(){return ie(document),document}var it=[{provide:C,useValue:ye},{provide:re,useValue:et,multi:!0},{provide:p,useFactory:nt,deps:[]}];var rt=[{provide:ne,useValue:"root"},{provide:P,useFactory:tt,deps:[]},{provide:J,useClass:Ke,multi:!0,deps:[p,y,C]},{provide:J,useClass:Je,multi:!0,deps:[p]},Ce,Fe,Se,{provide:se,useExisting:Ce},{provide:O,useClass:je,deps:[]},[]];console.debug("Default Config: ",z());console.debug("Feature Flags: ",z());var _e={providers:[de({eventCoalescing:!0}),fe()]};var st=["*"],Me=(()=>{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=I({type:i,selectors:[["app-editor"]],standalone:!0,features:[T],ngContentSelectors:st,decls:12,vars:0,consts:[[1,"flex-grow","flex","flex-col","dark:bg-gray-900","bg-white","rounded-md"],[1,"dark:bg-blue-600","bg-blue-500","flex","items-center","justify-between","p-2","dark:text-white","text-white","rounded-md"],[1,"flex","space-x-2"],[1,"w-3","h-3","bg-red-500","rounded-full"],[1,"w-3","h-3","bg-yellow-400","rounded-full"],[1,"w-3","h-3","bg-green-500","rounded-full"],[1,"text-lg"],[1,"w-6","h-6"],[1,"p-4","overflow-auto"],[1,"text-sm","leading-relaxed"]],template:function(t,r){t&1&&(oe(),h(0,"div",0)(1,"div",1)(2,"div",2),H(3,"div",3)(4,"div",4)(5,"div",5),l(),h(6,"div",6),g(7,"JSON Viewer"),l(),H(8,"div",7),l(),h(9,"div",8)(10,"pre",9),ae(11),l()()())}})}}return i})();var Ie=(()=>{class i{constructor(){this.configService=M(he),this.defaultConfig=U(this.configService.getConfig()),this.featureFlags=U(this.configService.getConfig("features"))}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=I({type:i,selectors:[["app-root"]],standalone:!0,features:[T],decls:18,vars:6,consts:[[1,"flex","flex-col","items-center","bg-slate-200","dark:bg-slate-700","h-svh","gap-5","dark:text-white","font-sans"],[1,"flex","flex-row","items-center","justify-center","bg-blue-500","dark:bg-blue-700","w-full","p-3","rounded-sm","shadow-md","text-white"],[1,"text-3xl","font-bold"],[1,"flex","flex-col","items-center","gap-2"],[1,"text-xl","font-semibold"]],template:function(t,r){t&1&&(h(0,"div",0)(1,"div",1)(2,"h1",2),g(3,"NG-Remote-Config Example"),l()(),h(4,"div",3)(5,"h2",4),g(6,"Config"),l(),h(7,"div")(8,"app-editor"),g(9),j(10,"json"),l()()(),h(11,"div",3)(12,"h2",4),g(13,"Feature Flags"),l(),h(14,"div")(15,"app-editor"),g(16),j(17,"json"),l()()()()),t&2&&($(9),ue(V(10,2,r.defaultConfig())),$(7),ce(" ",V(17,4,r.featureFlags())," "))},dependencies:[me,Me]})}}return i})();be(Ie,_e); diff --git a/index.html b/index.html index 9b53218..ce521e2 100644 --- a/index.html +++ b/index.html @@ -2,12 +2,12 @@
-