@social-mail/social-mail-client 1.2.539 → 1.2.541

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.
Files changed (49) hide show
  1. package/dist/admin/AdminAppIndex.pack.js +33 -29
  2. package/dist/admin/AdminAppIndex.pack.js.map +1 -1
  3. package/dist/admin/AdminAppIndex.pack.min.js +2 -2
  4. package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
  5. package/dist/public/channel/ChannelView.pack.js +19 -19
  6. package/dist/public/channel/ChannelView.pack.js.map +1 -1
  7. package/dist/public/channel/ChannelView.pack.min.js +1 -1
  8. package/dist/public/channel/ChannelView.pack.min.js.map +1 -1
  9. package/dist/public/contact-us/ContactUsApp.pack.js +19 -19
  10. package/dist/public/contact-us/ContactUsApp.pack.js.map +1 -1
  11. package/dist/public/contact-us/ContactUsApp.pack.min.js +1 -1
  12. package/dist/public/contact-us/ContactUsApp.pack.min.js.map +1 -1
  13. package/dist/public/preview/pdf/PreviewPDF.pack.js +19 -19
  14. package/dist/public/preview/pdf/PreviewPDF.pack.js.map +1 -1
  15. package/dist/public/preview/pdf/PreviewPDF.pack.min.js +1 -1
  16. package/dist/public/preview/pdf/PreviewPDF.pack.min.js.map +1 -1
  17. package/dist/public/store/Store.pack.js +19 -19
  18. package/dist/public/store/Store.pack.js.map +1 -1
  19. package/dist/public/store/Store.pack.min.js +1 -1
  20. package/dist/public/store/Store.pack.min.js.map +1 -1
  21. package/dist/public/store/StoreApp.pack.js +19 -19
  22. package/dist/public/store/StoreApp.pack.js.map +1 -1
  23. package/dist/public/store/StoreApp.pack.min.js +1 -1
  24. package/dist/public/store/StoreApp.pack.min.js.map +1 -1
  25. package/dist/public/store/cart/ShoppingCart.pack.js +19 -19
  26. package/dist/public/store/cart/ShoppingCart.pack.js.map +1 -1
  27. package/dist/public/store/cart/ShoppingCart.pack.min.js +1 -1
  28. package/dist/public/store/cart/ShoppingCart.pack.min.js.map +1 -1
  29. package/dist/site-editor/SiteEditorApp.pack.js +19 -19
  30. package/dist/site-editor/SiteEditorApp.pack.js.map +1 -1
  31. package/dist/site-editor/SiteEditorApp.pack.min.js +1 -1
  32. package/dist/site-editor/SiteEditorApp.pack.min.js.map +1 -1
  33. package/dist/tsconfig.tsbuildinfo +1 -1
  34. package/dist/web/AppIndex.pack.js +33 -29
  35. package/dist/web/AppIndex.pack.js.map +1 -1
  36. package/dist/web/AppIndex.pack.min.js +2 -2
  37. package/dist/web/AppIndex.pack.min.js.map +1 -1
  38. package/dist/web/page/channels/services/ChannelService.d.ts +4 -1
  39. package/dist/web/page/channels/services/ChannelService.d.ts.map +1 -1
  40. package/dist/web/page/channels/services/ChannelService.js +14 -10
  41. package/dist/web/page/channels/services/ChannelService.js.map +1 -1
  42. package/node_modules/@web-atoms/core/dist/style/styled.d.ts.map +1 -1
  43. package/node_modules/@web-atoms/core/dist/style/styled.js +19 -19
  44. package/node_modules/@web-atoms/core/dist/style/styled.js.map +1 -1
  45. package/node_modules/@web-atoms/core/dist/tsconfig.tsbuildinfo +1 -1
  46. package/node_modules/@web-atoms/core/package.json +1 -1
  47. package/node_modules/@web-atoms/core/src/style/styled.ts +19 -21
  48. package/package.json +2 -2
  49. package/src/web/page/channels/services/ChannelService.ts +11 -10
@@ -12,7 +12,7 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
12
12
 
13
13
  See the Apache Version 2.0 License for specific language governing permissions
14
14
  and limitations under the License.
15
- ***************************************************************************** */var Reflect;(function(Reflect){(function(factory){var root=typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:Function("return this;")();var exporter=makeExporter(Reflect);if(typeof root.Reflect==="undefined"){root.Reflect=Reflect}else{exporter=makeExporter(root.Reflect,exporter)}factory(exporter);function makeExporter(target,previous){return function(key,value){if(typeof target[key]!=="function"){Object.defineProperty(target,key,{configurable:true,writable:true,value})}if(previous)previous(key,value)}}})((function(exporter){var hasOwn=Object.prototype.hasOwnProperty;var supportsSymbol=typeof Symbol==="function";var toPrimitiveSymbol=supportsSymbol&&typeof Symbol.toPrimitive!=="undefined"?Symbol.toPrimitive:"@@toPrimitive";var iteratorSymbol=supportsSymbol&&typeof Symbol.iterator!=="undefined"?Symbol.iterator:"@@iterator";var supportsCreate=typeof Object.create==="function";var supportsProto={__proto__:[]}instanceof Array;var downLevel=!supportsCreate&&!supportsProto;var HashMap={create:supportsCreate?function(){return MakeDictionary(Object.create(null))}:supportsProto?function(){return MakeDictionary({__proto__:null})}:function(){return MakeDictionary({})},has:downLevel?function(map,key){return hasOwn.call(map,key)}:function(map,key){return key in map},get:downLevel?function(map,key){return hasOwn.call(map,key)?map[key]:undefined}:function(map,key){return map[key]}};var functionPrototype=Object.getPrototypeOf(Function);var usePolyfill=typeof process==="object"&&process["env"+""]&&process["env"+""]["REFLECT_METADATA_USE_MAP_POLYFILL"]==="true";var _Map=!usePolyfill&&typeof Map==="function"&&typeof Map.prototype.entries==="function"?Map:CreateMapPolyfill();var _Set=!usePolyfill&&typeof Set==="function"&&typeof Set.prototype.entries==="function"?Set:CreateSetPolyfill();var _WeakMap=!usePolyfill&&typeof WeakMap==="function"?WeakMap:CreateWeakMapPolyfill();var Metadata=new _WeakMap;function decorate(decorators,target,propertyKey,attributes){if(!IsUndefined(propertyKey)){if(!IsArray(decorators))throw new TypeError;if(!IsObject(target))throw new TypeError;if(!IsObject(attributes)&&!IsUndefined(attributes)&&!IsNull(attributes))throw new TypeError;if(IsNull(attributes))attributes=undefined;propertyKey=ToPropertyKey(propertyKey);return DecorateProperty(decorators,target,propertyKey,attributes)}else{if(!IsArray(decorators))throw new TypeError;if(!IsConstructor(target))throw new TypeError;return DecorateConstructor(decorators,target)}}exporter("decorate",decorate);function metadata(metadataKey,metadataValue){function decorator(target,propertyKey){if(!IsObject(target))throw new TypeError;if(!IsUndefined(propertyKey)&&!IsPropertyKey(propertyKey))throw new TypeError;OrdinaryDefineOwnMetadata(metadataKey,metadataValue,target,propertyKey)}return decorator}exporter("metadata",metadata);function defineMetadata(metadataKey,metadataValue,target,propertyKey){if(!IsObject(target))throw new TypeError;if(!IsUndefined(propertyKey))propertyKey=ToPropertyKey(propertyKey);return OrdinaryDefineOwnMetadata(metadataKey,metadataValue,target,propertyKey)}exporter("defineMetadata",defineMetadata);function hasMetadata(metadataKey,target,propertyKey){if(!IsObject(target))throw new TypeError;if(!IsUndefined(propertyKey))propertyKey=ToPropertyKey(propertyKey);return OrdinaryHasMetadata(metadataKey,target,propertyKey)}exporter("hasMetadata",hasMetadata);function hasOwnMetadata(metadataKey,target,propertyKey){if(!IsObject(target))throw new TypeError;if(!IsUndefined(propertyKey))propertyKey=ToPropertyKey(propertyKey);return OrdinaryHasOwnMetadata(metadataKey,target,propertyKey)}exporter("hasOwnMetadata",hasOwnMetadata);function getMetadata(metadataKey,target,propertyKey){if(!IsObject(target))throw new TypeError;if(!IsUndefined(propertyKey))propertyKey=ToPropertyKey(propertyKey);return OrdinaryGetMetadata(metadataKey,target,propertyKey)}exporter("getMetadata",getMetadata);function getOwnMetadata(metadataKey,target,propertyKey){if(!IsObject(target))throw new TypeError;if(!IsUndefined(propertyKey))propertyKey=ToPropertyKey(propertyKey);return OrdinaryGetOwnMetadata(metadataKey,target,propertyKey)}exporter("getOwnMetadata",getOwnMetadata);function getMetadataKeys(target,propertyKey){if(!IsObject(target))throw new TypeError;if(!IsUndefined(propertyKey))propertyKey=ToPropertyKey(propertyKey);return OrdinaryMetadataKeys(target,propertyKey)}exporter("getMetadataKeys",getMetadataKeys);function getOwnMetadataKeys(target,propertyKey){if(!IsObject(target))throw new TypeError;if(!IsUndefined(propertyKey))propertyKey=ToPropertyKey(propertyKey);return OrdinaryOwnMetadataKeys(target,propertyKey)}exporter("getOwnMetadataKeys",getOwnMetadataKeys);function deleteMetadata(metadataKey,target,propertyKey){if(!IsObject(target))throw new TypeError;if(!IsUndefined(propertyKey))propertyKey=ToPropertyKey(propertyKey);var metadataMap=GetOrCreateMetadataMap(target,propertyKey,false);if(IsUndefined(metadataMap))return false;if(!metadataMap.delete(metadataKey))return false;if(metadataMap.size>0)return true;var targetMetadata=Metadata.get(target);targetMetadata.delete(propertyKey);if(targetMetadata.size>0)return true;Metadata.delete(target);return true}exporter("deleteMetadata",deleteMetadata);function DecorateConstructor(decorators,target){for(var i=decorators.length-1;i>=0;--i){var decorator=decorators[i];var decorated=decorator(target);if(!IsUndefined(decorated)&&!IsNull(decorated)){if(!IsConstructor(decorated))throw new TypeError;target=decorated}}return target}function DecorateProperty(decorators,target,propertyKey,descriptor){for(var i=decorators.length-1;i>=0;--i){var decorator=decorators[i];var decorated=decorator(target,propertyKey,descriptor);if(!IsUndefined(decorated)&&!IsNull(decorated)){if(!IsObject(decorated))throw new TypeError;descriptor=decorated}}return descriptor}function GetOrCreateMetadataMap(O,P,Create){var targetMetadata=Metadata.get(O);if(IsUndefined(targetMetadata)){if(!Create)return undefined;targetMetadata=new _Map;Metadata.set(O,targetMetadata)}var metadataMap=targetMetadata.get(P);if(IsUndefined(metadataMap)){if(!Create)return undefined;metadataMap=new _Map;targetMetadata.set(P,metadataMap)}return metadataMap}function OrdinaryHasMetadata(MetadataKey,O,P){var hasOwn=OrdinaryHasOwnMetadata(MetadataKey,O,P);if(hasOwn)return true;var parent=OrdinaryGetPrototypeOf(O);if(!IsNull(parent))return OrdinaryHasMetadata(MetadataKey,parent,P);return false}function OrdinaryHasOwnMetadata(MetadataKey,O,P){var metadataMap=GetOrCreateMetadataMap(O,P,false);if(IsUndefined(metadataMap))return false;return ToBoolean(metadataMap.has(MetadataKey))}function OrdinaryGetMetadata(MetadataKey,O,P){var hasOwn=OrdinaryHasOwnMetadata(MetadataKey,O,P);if(hasOwn)return OrdinaryGetOwnMetadata(MetadataKey,O,P);var parent=OrdinaryGetPrototypeOf(O);if(!IsNull(parent))return OrdinaryGetMetadata(MetadataKey,parent,P);return undefined}function OrdinaryGetOwnMetadata(MetadataKey,O,P){var metadataMap=GetOrCreateMetadataMap(O,P,false);if(IsUndefined(metadataMap))return undefined;return metadataMap.get(MetadataKey)}function OrdinaryDefineOwnMetadata(MetadataKey,MetadataValue,O,P){var metadataMap=GetOrCreateMetadataMap(O,P,true);metadataMap.set(MetadataKey,MetadataValue)}function OrdinaryMetadataKeys(O,P){var ownKeys=OrdinaryOwnMetadataKeys(O,P);var parent=OrdinaryGetPrototypeOf(O);if(parent===null)return ownKeys;var parentKeys=OrdinaryMetadataKeys(parent,P);if(parentKeys.length<=0)return ownKeys;if(ownKeys.length<=0)return parentKeys;var set=new _Set;var keys=[];for(var _i=0,ownKeys_1=ownKeys;_i<ownKeys_1.length;_i++){var key=ownKeys_1[_i];var hasKey=set.has(key);if(!hasKey){set.add(key);keys.push(key)}}for(var _a=0,parentKeys_1=parentKeys;_a<parentKeys_1.length;_a++){var key=parentKeys_1[_a];var hasKey=set.has(key);if(!hasKey){set.add(key);keys.push(key)}}return keys}function OrdinaryOwnMetadataKeys(O,P){var keys=[];var metadataMap=GetOrCreateMetadataMap(O,P,false);if(IsUndefined(metadataMap))return keys;var keysObj=metadataMap.keys();var iterator=GetIterator(keysObj);var k=0;while(true){var next=IteratorStep(iterator);if(!next){keys.length=k;return keys}var nextValue=IteratorValue(next);try{keys[k]=nextValue}catch(e){try{IteratorClose(iterator)}finally{throw e}}k++}}function Type(x){if(x===null)return 1;switch(typeof x){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return x===null?1:6;default:return 6}}function IsUndefined(x){return x===undefined}function IsNull(x){return x===null}function IsSymbol(x){return typeof x==="symbol"}function IsObject(x){return typeof x==="object"?x!==null:typeof x==="function"}function ToPrimitive(input,PreferredType){switch(Type(input)){case 0:return input;case 1:return input;case 2:return input;case 3:return input;case 4:return input;case 5:return input}var hint=PreferredType===3?"string":PreferredType===5?"number":"default";var exoticToPrim=GetMethod(input,toPrimitiveSymbol);if(exoticToPrim!==undefined){var result=exoticToPrim.call(input,hint);if(IsObject(result))throw new TypeError;return result}return OrdinaryToPrimitive(input,hint==="default"?"number":hint)}function OrdinaryToPrimitive(O,hint){if(hint==="string"){var toString_1=O.toString;if(IsCallable(toString_1)){var result=toString_1.call(O);if(!IsObject(result))return result}var valueOf=O.valueOf;if(IsCallable(valueOf)){var result=valueOf.call(O);if(!IsObject(result))return result}}else{var valueOf=O.valueOf;if(IsCallable(valueOf)){var result=valueOf.call(O);if(!IsObject(result))return result}var toString_2=O.toString;if(IsCallable(toString_2)){var result=toString_2.call(O);if(!IsObject(result))return result}}throw new TypeError}function ToBoolean(argument){return!!argument}function ToString(argument){return""+argument}function ToPropertyKey(argument){var key=ToPrimitive(argument,3);if(IsSymbol(key))return key;return ToString(key)}function IsArray(argument){return Array.isArray?Array.isArray(argument):argument instanceof Object?argument instanceof Array:Object.prototype.toString.call(argument)==="[object Array]"}function IsCallable(argument){return typeof argument==="function"}function IsConstructor(argument){return typeof argument==="function"}function IsPropertyKey(argument){switch(Type(argument)){case 3:return true;case 4:return true;default:return false}}function GetMethod(V,P){var func=V[P];if(func===undefined||func===null)return undefined;if(!IsCallable(func))throw new TypeError;return func}function GetIterator(obj){var method=GetMethod(obj,iteratorSymbol);if(!IsCallable(method))throw new TypeError;var iterator=method.call(obj);if(!IsObject(iterator))throw new TypeError;return iterator}function IteratorValue(iterResult){return iterResult.value}function IteratorStep(iterator){var result=iterator.next();return result.done?false:result}function IteratorClose(iterator){var f=iterator["return"];if(f)f.call(iterator)}function OrdinaryGetPrototypeOf(O){var proto=Object.getPrototypeOf(O);if(typeof O!=="function"||O===functionPrototype)return proto;if(proto!==functionPrototype)return proto;var prototype=O.prototype;var prototypeProto=prototype&&Object.getPrototypeOf(prototype);if(prototypeProto==null||prototypeProto===Object.prototype)return proto;var constructor=prototypeProto.constructor;if(typeof constructor!=="function")return proto;if(constructor===O)return proto;return constructor}function CreateMapPolyfill(){var cacheSentinel={};var arraySentinel=[];var MapIterator=function(){function MapIterator(keys,values,selector){this._index=0;this._keys=keys;this._values=values;this._selector=selector}MapIterator.prototype["@@iterator"]=function(){return this};MapIterator.prototype[iteratorSymbol]=function(){return this};MapIterator.prototype.next=function(){var index=this._index;if(index>=0&&index<this._keys.length){var result=this._selector(this._keys[index],this._values[index]);if(index+1>=this._keys.length){this._index=-1;this._keys=arraySentinel;this._values=arraySentinel}else{this._index++}return{value:result,done:false}}return{value:undefined,done:true}};MapIterator.prototype.throw=function(error){if(this._index>=0){this._index=-1;this._keys=arraySentinel;this._values=arraySentinel}throw error};MapIterator.prototype.return=function(value){if(this._index>=0){this._index=-1;this._keys=arraySentinel;this._values=arraySentinel}return{value,done:true}};return MapIterator}();return function(){function Map(){this._keys=[];this._values=[];this._cacheKey=cacheSentinel;this._cacheIndex=-2}Object.defineProperty(Map.prototype,"size",{get:function(){return this._keys.length},enumerable:true,configurable:true});Map.prototype.has=function(key){return this._find(key,false)>=0};Map.prototype.get=function(key){var index=this._find(key,false);return index>=0?this._values[index]:undefined};Map.prototype.set=function(key,value){var index=this._find(key,true);this._values[index]=value;return this};Map.prototype.delete=function(key){var index=this._find(key,false);if(index>=0){var size=this._keys.length;for(var i=index+1;i<size;i++){this._keys[i-1]=this._keys[i];this._values[i-1]=this._values[i]}this._keys.length--;this._values.length--;if(key===this._cacheKey){this._cacheKey=cacheSentinel;this._cacheIndex=-2}return true}return false};Map.prototype.clear=function(){this._keys.length=0;this._values.length=0;this._cacheKey=cacheSentinel;this._cacheIndex=-2};Map.prototype.keys=function(){return new MapIterator(this._keys,this._values,getKey)};Map.prototype.values=function(){return new MapIterator(this._keys,this._values,getValue)};Map.prototype.entries=function(){return new MapIterator(this._keys,this._values,getEntry)};Map.prototype["@@iterator"]=function(){return this.entries()};Map.prototype[iteratorSymbol]=function(){return this.entries()};Map.prototype._find=function(key,insert){if(this._cacheKey!==key){this._cacheIndex=this._keys.indexOf(this._cacheKey=key)}if(this._cacheIndex<0&&insert){this._cacheIndex=this._keys.length;this._keys.push(key);this._values.push(undefined)}return this._cacheIndex};return Map}();function getKey(key,_){return key}function getValue(_,value){return value}function getEntry(key,value){return[key,value]}}function CreateSetPolyfill(){return function(){function Set(){this._map=new _Map}Object.defineProperty(Set.prototype,"size",{get:function(){return this._map.size},enumerable:true,configurable:true});Set.prototype.has=function(value){return this._map.has(value)};Set.prototype.add=function(value){return this._map.set(value,value),this};Set.prototype.delete=function(value){return this._map.delete(value)};Set.prototype.clear=function(){this._map.clear()};Set.prototype.keys=function(){return this._map.keys()};Set.prototype.values=function(){return this._map.values()};Set.prototype.entries=function(){return this._map.entries()};Set.prototype["@@iterator"]=function(){return this.keys()};Set.prototype[iteratorSymbol]=function(){return this.keys()};return Set}()}function CreateWeakMapPolyfill(){var UUID_SIZE=16;var keys=HashMap.create();var rootKey=CreateUniqueKey();return function(){function WeakMap(){this._key=CreateUniqueKey()}WeakMap.prototype.has=function(target){var table=GetOrCreateWeakMapTable(target,false);return table!==undefined?HashMap.has(table,this._key):false};WeakMap.prototype.get=function(target){var table=GetOrCreateWeakMapTable(target,false);return table!==undefined?HashMap.get(table,this._key):undefined};WeakMap.prototype.set=function(target,value){var table=GetOrCreateWeakMapTable(target,true);table[this._key]=value;return this};WeakMap.prototype.delete=function(target){var table=GetOrCreateWeakMapTable(target,false);return table!==undefined?delete table[this._key]:false};WeakMap.prototype.clear=function(){this._key=CreateUniqueKey()};return WeakMap}();function CreateUniqueKey(){var key;do{key="@@WeakMap@@"+CreateUUID()}while(HashMap.has(keys,key));keys[key]=true;return key}function GetOrCreateWeakMapTable(target,create){if(!hasOwn.call(target,rootKey)){if(!create)return undefined;Object.defineProperty(target,rootKey,{value:HashMap.create()})}return target[rootKey]}function FillRandomBytes(buffer,size){for(var i=0;i<size;++i)buffer[i]=Math.random()*255|0;return buffer}function GenRandomBytes(size){if(typeof Uint8Array==="function"){if(typeof crypto!=="undefined")return crypto.getRandomValues(new Uint8Array(size));if(typeof msCrypto!=="undefined")return msCrypto.getRandomValues(new Uint8Array(size));return FillRandomBytes(new Uint8Array(size),size)}return FillRandomBytes(new Array(size),size)}function CreateUUID(){var data=GenRandomBytes(UUID_SIZE);data[6]=data[6]&79|64;data[8]=data[8]&191|128;var result="";for(var offset=0;offset<UUID_SIZE;++offset){var byte=data[offset];if(offset===4||offset===6||offset===8)result+="-";if(byte<16)result+="0";result+=byte.toString(16).toLowerCase()}return result}}function MakeDictionary(obj){obj.__=undefined;delete obj.__;return obj}}))})(Reflect||(Reflect={}));AmdLoader.instance.setup("reflect-metadata");System.register([],(function(_export,_context){"use strict";return{setters:[],execute:function(){Map.prototype.getOrCreate=function(key,factory){let item=this.get(key);if(item===undefined){item=factory(key);this.set(key,item)}return item};_export("default",Map)}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/AtomMap");System.register(["reflect-metadata","./AtomMap"],(function(_export,_context){"use strict";var Map,CancelToken,ArrayHelper,_a,_b,_c,ignoreValue,globalNS,DI,UMD;_export({CancelToken:void 0,ArrayHelper:void 0});return{setters:[function(_reflectMetadata){},function(_AtomMap){Map=_AtomMap.default}],execute:function(){_export("ignoreValue",ignoreValue=Symbol("ignore"));_export("CancelToken",CancelToken=class CancelToken{static isCancelled(e){var _a;if(/^(cancelled$|canceled$|aborterror\:)/i.test((_a=e.message)!==null&&_a!==void 0?_a:e.toString().trim())){return true}if(e.name==="AbortError"){return true}}get cancelled(){return this.mCancelled}constructor(timeout=-1){this.listeners=[];this.mCancelled=null;this.cancelTimeout=null;if(timeout>0){this.cancelTimeout=setTimeout((()=>{this.cancelTimeout=null;this.cancel("timeout")}),timeout)}}cancel(r="cancelled"){this.mCancelled=r;const existing=this.listeners.slice(0);this.listeners.length=0;for(const fx of existing){fx(r)}this.dispose()}reset(){this.mCancelled=null;this.dispose()}dispose(){this.listeners.length=0;if(this.cancelTimeout){clearTimeout(this.cancelTimeout)}}registerForCancel(f){if(this.mCancelled){f(this.mCancelled);this.cancel();return}this.listeners.push(f)}});_export("ArrayHelper",ArrayHelper=class ArrayHelper{static remove(a,filter){for(let i=0;i<a.length;i++){const item=a[i];if(filter(item)){a.splice(i,1);return true}}return false}});(_a=Object.values)!==null&&_a!==void 0?_a:Object.values=function(t){const r=[];for(const key in t){if(Object.prototype.hasOwnProperty.call(t,key)){const element=t[key];r.push(element)}}return r};(_b=(_c=Array.prototype).flat)!==null&&_b!==void 0?_b:_c.flat=function(depth=1){const r=[];const flat=depth>0;const nestDepth=depth-1;const nestFlat=nestDepth>0;for(const iterator of this){if(flat&&Array.isArray(iterator)){if(nestFlat){r.push(...iterator.flat(nestDepth));continue}r.push(...iterator);continue}r.push(iterator)}return r};Array.prototype["groupBy"]=function(keySelector){const map=new Map;const groups=[];for(const iterator of this){const key=keySelector(iterator);let g=map.get(key);if(!g){g=[];g.key=key;groups.push(g);map.set(key,g)}g.push(iterator)}map.clear();return groups};globalNS=typeof window!=="undefined"?window:global;_export("DI",DI=globalNS.UMD);_export("UMD",UMD=globalNS.UMD)}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/types");System.register(["./types"],(function(_export,_context){"use strict";var ArrayHelper,AtomBinder,symbolHandlers,symbolBindable;_export("AtomBinder",void 0);return{setters:[function(_types){ArrayHelper=_types.ArrayHelper}],execute:function(){_export("symbolHandlers",symbolHandlers=Symbol.for("handlers"));_export("symbolBindable",symbolBindable=Symbol.for("bindable"));_export("AtomBinder",AtomBinder=class AtomBinder{static refreshValue(target,key){const handlers=AtomBinder.get_WatchHandler(target,key);if(handlers===undefined||handlers==null){return}for(const item of handlers){item(target,key)}if(target.onPropertyChanged){target.onPropertyChanged(key)}}static add_WatchHandler(target,key,handler){if(target==null){return}const handlers=AtomBinder.get_WatchHandler(target,key);handlers.push(handler);if(Array.isArray(target)){return}const pv=AtomBinder.getPropertyDescriptor(target,key);if(pv&&pv.get){return}const tw=target;let bindables=tw[symbolBindable];if(bindables===undefined){bindables={};Object.defineProperty(tw,symbolBindable,{value:bindables,enumerable:false,writable:true,configurable:true})}if(!bindables[key]){bindables[key]=1;const o=target[key];const nk=Symbol.for(key);target[nk]=o;const set=function(v){const ov=this[nk];if(ov===undefined?ov===v:ov==v){return}this[nk]=v;AtomBinder.refreshValue(this,key)};const get=function(){return this[nk]};if(pv){delete target[key];Object.defineProperty(target,key,{get,set,configurable:true,enumerable:true})}else{Object.defineProperty(target,key,{get,set,enumerable:true,configurable:true})}}}static getPropertyDescriptor(target,key){const pv=Object.getOwnPropertyDescriptor(target,key);if(!pv){const pt=Object.getPrototypeOf(target);if(pt){return AtomBinder.getPropertyDescriptor(pt,key)}}return pv}static get_WatchHandler(target,key){if(target==null){return null}let handlers=target[symbolHandlers];if(handlers===undefined){handlers={};Object.defineProperty(target,symbolHandlers,{value:handlers,enumerable:false,writable:true,configurable:true})}let handlersForKey=handlers[key];if(handlersForKey===undefined||handlersForKey==null){handlersForKey=[];handlers[key]=handlersForKey}return handlersForKey}static remove_WatchHandler(target,key,handler){if(target==null){return}const handlers=target[symbolHandlers];if(typeof handlers==="undefined"){return}const handlersForKey=target[symbolHandlers][key];if(handlersForKey===undefined||handlersForKey==null){return}ArrayHelper.remove(handlersForKey,(f=>f===handler));if(!handlersForKey.length){handlers[key]=null;delete handlers[key]}}static invokeItemsEvent(target,mode,index,item,oldItem){const key="_items";const handlers=AtomBinder.get_WatchHandler(target,key);if(!handlers){return}for(const obj of handlers){obj(target,mode,index,item,oldItem)}AtomBinder.refreshValue(target,"length")}static refreshItems(ary){AtomBinder.invokeItemsEvent(ary,"refresh",-1,null)}static add_CollectionChanged(target,handler){if(target==null){throw new Error("Target Array to watch cannot be null")}if(handler==null){throw new Error("Target handle to watch an Array cannot be null")}const handlers=AtomBinder.get_WatchHandler(target,"_items");handlers.push(handler);return{dispose:()=>{AtomBinder.remove_CollectionChanged(target,handler)}}}static remove_CollectionChanged(t,handler){if(t==null){return}const target=t;const handlers=target[symbolHandlers];if(typeof handlers==="undefined"){return}const key="_items";const handlersForKey=handlers[key];if(handlersForKey===undefined||handlersForKey==null){return}ArrayHelper.remove(handlersForKey,(f=>f===handler));if(!handlersForKey.length){handlers[key]=null;delete handlers[key]}}static watch(item,property,f){AtomBinder.add_WatchHandler(item,property,f);return{dispose:()=>{AtomBinder.remove_WatchHandler(item,property,f)}}}static clear(a){a.length=0;this.invokeItemsEvent(a,"refresh",-1,null);AtomBinder.refreshValue(a,"length")}static addItem(a,item){const index=a.length;a.push(item);this.invokeItemsEvent(a,"add",index,item);AtomBinder.refreshValue(a,"length")}static removeItem(a,item){const i=a.findIndex((x=>x===item));if(i===-1){return false}a.splice(i,1);AtomBinder.invokeItemsEvent(a,"remove",i,item);AtomBinder.refreshValue(a,"length");return true}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/AtomBinder");System.register([],(function(_export,_context){"use strict";var AtomDispatcher;_export("AtomDispatcher",void 0);return{setters:[],execute:function(){_export("AtomDispatcher",AtomDispatcher=class AtomDispatcher{constructor(){this.head=null;this.tail=null}onTimeout(){if(this.paused){return}if(!this.head){return}const item=this.head;this.head=item.next;item.next=null;if(!this.head){this.tail=null}item();setTimeout((()=>{this.onTimeout()}),1)}pause(){this.paused=true}start(){this.paused=false;setTimeout((()=>{this.onTimeout()}),1)}callLater(f){if(this.tail){this.tail.next=f;this.tail=f}else{this.head=f;this.tail=f}if(!this.paused){this.start()}}waitForAll(){return new Promise(((resolve,reject)=>{this.callLater((()=>{resolve()}))}))}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/AtomDispatcher");System.register(["../core/AtomMap"],(function(_export,_context){"use strict";var AtomMap,TypeKey;_export("TypeKey",void 0);return{setters:[function(_coreAtomMap){AtomMap=_coreAtomMap.default}],execute:function(){_export("TypeKey",TypeKey=class TypeKey{static get(c){return c}static getName(c){return TypeKey.keys.getOrCreate(c,(c1=>{const key=`${c1.name||"key"}${TypeKey.keys.size}`;return key}))}});TypeKey.keys=new AtomMap}}}));AmdLoader.instance.setup("@web-atoms/core/dist/di/TypeKey");System.register(["../core/types","./TypeKey"],(function(_export,_context){"use strict";var ArrayHelper,TypeKey,ServiceDescription,ServiceCollection,Scope;_export({ServiceDescription:void 0,ServiceCollection:void 0,Scope:void 0});return{setters:[function(_coreTypes){ArrayHelper=_coreTypes.ArrayHelper},function(_TypeKey){TypeKey=_TypeKey.TypeKey}],execute:function(){(function(Scope){Scope[Scope["Global"]=1]="Global";Scope[Scope["Scoped"]=2]="Scoped";Scope[Scope["Transient"]=3]="Transient"})(Scope||_export("Scope",Scope={}));_export("ServiceDescription",ServiceDescription=class ServiceDescription{constructor(id,scope,type,factory){this.id=id;this.scope=scope;this.type=type;this.factory=factory;this.factory=this.factory||(sp=>sp.create(type))}});_export("ServiceCollection",ServiceCollection=class ServiceCollection{constructor(){this.registrations=[];this.ids=1}register(type,factory,scope=Scope.Transient,id){ArrayHelper.remove(this.registrations,(r=>id?r.id===id:r.type===type));if(!id){id=TypeKey.get(type);this.ids++}const sd=new ServiceDescription(id,scope,type,factory);this.registrations.push(sd);return sd}registerScoped(type,factory,id){return this.register(type,factory,Scope.Scoped,id)}registerSingleton(type,factory,id){return this.register(type,factory,Scope.Global,id)}get(type){return this.registrations.find((s=>s.id===type||s.type===type))}});ServiceCollection.instance=new ServiceCollection}}}));AmdLoader.instance.setup("@web-atoms/core/dist/di/ServiceCollection");System.register(["../core/types","./ServiceCollection"],(function(_export,_context){"use strict";var DI,Scope,ServiceCollection,globalNS;function evalGlobal(path){if(typeof path==="string"){let r=globalNS;for(const iterator of path.split(".")){r=r[iterator];if(r===undefined||r===null){return r}}return r}return path}function Register(id,scope){return target=>{if(typeof id==="object"){if(scope){id.scope=scope}ServiceCollection.instance.register(id.for||target,id.for?sp=>sp.create(target):null,id.scope||Scope.Transient,id.id);if(id.mockOrInject){if(id.mockOrInject.inject){DI.inject(target,id.mockOrInject.inject)}else if(id.mockOrInject.mock){DI.mockType(target,id.mockOrInject.mock)}else if(id.mockOrInject.globalVar){ServiceCollection.instance.register(id.for||target,(sp=>evalGlobal(id.mockOrInject.globalVar)),id.scope||Scope.Global,id.id)}}return}ServiceCollection.instance.register(target,null,scope,id)}}_export("Register",Register);return{setters:[function(_coreTypes){DI=_coreTypes.DI},function(_ServiceCollection){Scope=_ServiceCollection.Scope;ServiceCollection=_ServiceCollection.ServiceCollection}],execute:function(){globalNS=typeof global==="undefined"?window:global}}}));AmdLoader.instance.setup("@web-atoms/core/dist/di/Register");System.register(["./Register","./ServiceCollection"],(function(_export,_context){"use strict";var Register,Scope;function RegisterSingleton(target){Register({scope:Scope.Global})(target)}_export("RegisterSingleton",RegisterSingleton);return{setters:[function(_Register){Register=_Register.Register},function(_ServiceCollection){Scope=_ServiceCollection.Scope}],execute:function(){}}}));AmdLoader.instance.setup("@web-atoms/core/dist/di/RegisterSingleton");System.register([],(function(_export,_context){"use strict";var TransientDisposable;_export("default",void 0);return{setters:[],execute:function(){_export("default",TransientDisposable=class TransientDisposable{constructor(owner){if(owner){this.registerIn(owner)}}registerIn(value){const v=value.disposables;if(v){v.push(this)}else{if(value.registerDisposable){value.registerDisposable(this)}}}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/TransientDisposable");System.register(["./TypeKey"],(function(_export,_context){"use strict";var TypeKey,InjectedTypes;function Inject(target,name,index){if(index!==undefined){const key=TypeKey.get(target);const plist=Reflect.getMetadata("design:paramtypes",target,name);if(typeof index==="number"){const pSavedList=InjectedTypes.paramList[key]||(InjectedTypes.paramList[key]=[]);pSavedList[index]=plist[index]}else{throw new Error("Inject can only be applied on constructor"+"parameter or a property without get/set methods")}}else{const key=TypeKey.get(target.constructor);const plist=Reflect.getMetadata("design:type",target,name);const p=InjectedTypes.propertyList[key]||(InjectedTypes.propertyList[key]={});p[name]=plist;let base=target.constructor;while(true){base=Object.getPrototypeOf(base);if(!base){break}const baseKey=TypeKey.get(base);const bp=InjectedTypes.propertyList[baseKey];if(bp){for(const pKey in bp){if(bp.hasOwnProperty(pKey)){const element=bp[pKey];if(!p[pKey]){p[pKey]=element}}}}}}}_export({InjectedTypes:void 0,Inject});return{setters:[function(_TypeKey){TypeKey=_TypeKey.TypeKey}],execute:function(){_export("InjectedTypes",InjectedTypes=class InjectedTypes{static getParamList(key,typeKey1){let plist=InjectedTypes.paramList[typeKey1];let type=key;while(plist===undefined){type=Object.getPrototypeOf(type);if(!type){break}const typeKey=TypeKey.get(type);plist=InjectedTypes.paramList[typeKey];if(!plist){InjectedTypes.paramList[typeKey]=plist}}return plist}static getPropertyList(key,typeKey1){let plist=InjectedTypes.propertyList[typeKey1];let type=key;while(plist===undefined){type=Object.getPrototypeOf(type);if(!type){break}const typeKey=TypeKey.get(type);plist=InjectedTypes.propertyList[typeKey];if(!plist){InjectedTypes.propertyList[typeKey]=plist}}return plist}});InjectedTypes.paramList={};InjectedTypes.propertyList={}}}}));AmdLoader.instance.setup("@web-atoms/core/dist/di/Inject");System.register(["../core/TransientDisposable","../core/types","./Inject","./ServiceCollection","./TypeKey"],(function(_export,_context){"use strict";var TransientDisposable,DI,InjectedTypes,Scope,ServiceCollection,TypeKey,ServiceProvider;_export("ServiceProvider",void 0);return{setters:[function(_coreTransientDisposable){TransientDisposable=_coreTransientDisposable.default},function(_coreTypes){DI=_coreTypes.DI},function(_Inject){InjectedTypes=_Inject.InjectedTypes},function(_ServiceCollection){Scope=_ServiceCollection.Scope;ServiceCollection=_ServiceCollection.ServiceCollection},function(_TypeKey){TypeKey=_TypeKey.TypeKey}],execute:function(){_export("ServiceProvider",ServiceProvider=class ServiceProvider{get global(){return this.parent===null?this:this.parent.global}constructor(parent){this.parent=parent;this.instances=new Map;if(parent===null){ServiceCollection.instance.registerScoped(ServiceProvider)}const sd=ServiceCollection.instance.get(ServiceProvider);this.instances.set(sd.id,this)}get(key){return this.resolve(key,true)}put(key,value){let sd=ServiceCollection.instance.get(key);if(!sd){sd=ServiceCollection.instance.register(key,(()=>value),Scope.Global)}this.instances.set(sd.id,value)}resolve(key,create=false,defValue){const sd=ServiceCollection.instance.get(key);if(!sd){if(!create){if(defValue!==undefined){return defValue}throw new Error(`No service registered for type ${key}`)}return this.create(key)}if(sd.type===ServiceProvider){return this}if(sd.scope===Scope.Global){return this.global.getValue(sd)}if(sd.scope===Scope.Scoped){if(this.parent===null){throw new Error("Scoped dependency cannot be created on global")}}return this.getValue(sd)}getValue(sd){if(sd.scope===Scope.Transient){return sd.factory(this)}let v=this.instances.get(sd.id);if(v===void 0){v=sd.factory(this);this.instances.set(sd.id,v)}return v}newScope(){return new ServiceProvider(this)}dispose(){var _a;for(const element of this.instances.values()){if(element===this){continue}(_a=element.dispose)===null||_a===void 0?void 0:_a.call(element)}this.instances.clear()}create(key){const originalKey=key;const originalTypeKey=TypeKey.get(originalKey);if(DI.resolveType){let mappedType=ServiceProvider.mappedTypes.get(originalTypeKey);if(mappedType===void 0){mappedType=DI.resolveType(originalKey);ServiceProvider.mappedTypes.set(originalKey,mappedType)}key=mappedType}const typeKey1=TypeKey.get(key);const plist=InjectedTypes.getParamList(key,typeKey1);let value=null;if(plist){const pv=plist.map((x=>x?this.resolve(x):void 0));pv.unshift(null);value=new(key.bind.apply(key,pv));for(const iterator of pv){if(iterator&&iterator instanceof TransientDisposable){iterator.registerIn(value)}}}else{value=new key}const propList=InjectedTypes.getPropertyList(key,typeKey1);if(propList){for(const key1 in propList){if(propList.hasOwnProperty(key1)){const element=propList[key1];const d=this.resolve(element);value[key1]=d;if(d&&d instanceof TransientDisposable){d.registerIn(value)}}}}return value}});ServiceProvider.mappedTypes=new Map}}}));AmdLoader.instance.setup("@web-atoms/core/dist/di/ServiceProvider");System.register(["tslib","../di/RegisterSingleton"],(function(_export,_context){"use strict";var __decorate,RegisterSingleton,BusyIndicatorService;return{setters:[function(_tslib){__decorate=_tslib.__decorate},function(_diRegisterSingleton){RegisterSingleton=_diRegisterSingleton.RegisterSingleton}],execute:function(){_export("BusyIndicatorService",BusyIndicatorService=class BusyIndicatorService{createIndicator(info){return{dispose(){}}}});_export("BusyIndicatorService",BusyIndicatorService=__decorate([RegisterSingleton],BusyIndicatorService))}}}));AmdLoader.instance.setup("@web-atoms/core/dist/services/BusyIndicatorService");System.register(["tslib","./core/AtomBinder","./core/AtomDispatcher","./core/types","./di/RegisterSingleton","./di/ServiceProvider","./services/BusyIndicatorService"],(function(_export,_context){"use strict";var __decorate,__metadata,AtomBinder,AtomDispatcher,CancelToken,RegisterSingleton,ServiceProvider,BusyIndicatorService,AtomHandler,AtomMessageAction,App_1,App;_export("AtomMessageAction",void 0);return{setters:[function(_tslib){__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_coreAtomBinder){AtomBinder=_coreAtomBinder.AtomBinder},function(_coreAtomDispatcher){AtomDispatcher=_coreAtomDispatcher.AtomDispatcher},function(_coreTypes){CancelToken=_coreTypes.CancelToken},function(_diRegisterSingleton){RegisterSingleton=_diRegisterSingleton.RegisterSingleton},function(_diServiceProvider){ServiceProvider=_diServiceProvider.ServiceProvider},function(_servicesBusyIndicatorService){BusyIndicatorService=_servicesBusyIndicatorService.BusyIndicatorService}],execute:function(){AtomHandler=class AtomHandler{constructor(message){this.message=message;this.list=new Array}};_export("AtomMessageAction",AtomMessageAction=class AtomMessageAction{constructor(msg,a){this.message=msg;this.action=a}});_export("App",App=App_1=class App extends ServiceProvider{static installStyleSheet(ssConfig){if(typeof ssConfig!=="object"){ssConfig={href:ssConfig}}ssConfig.href=UMD.resolvePath(ssConfig.href);const links=document.getElementsByTagName("link");for(let index=0;index<links.length;index++){const element=links[index];const href=element.getAttribute("href");if(href===ssConfig.href){return}}const ss=document.createElement("link");ss.rel="stylesheet";ss.href=ssConfig.href;if(ssConfig.crossOrigin){ss.crossOrigin=ssConfig.crossOrigin}if(ssConfig.integrity){ss.integrity=ssConfig.integrity}document.head.appendChild(ss)}static installScript(location){location=UMD.resolvePath(location);const links=document.getElementsByTagName("script");for(let index=0;index<links.length;index++){const element=links[index];const href=element.getAttribute("src");if(href===location){return element.loaderPromise}}const script=document.createElement("script");const p=new Promise(((resolve,reject)=>{script.type="text/javascript";script.src=location;const s=script;script.onload=s.onreadystatechange=()=>{if(s.readyState&&s.readyState!=="complete"&&s.readyState!=="loaded"){return}script.onload=s.onreadystatechange=null;resolve()};document.body.appendChild(script)}));script.loaderPromise=p;return p}static authorize(authorize=true){const detail={authorize,authorized:true};const ce=new CustomEvent("authorize",{bubbles:true,detail});document.body.dispatchEvent(ce);if(!ce.detail.authorized){return false}return true}get url(){return this.mUrl}set url(v){this.mUrl=v;AtomBinder.refreshValue(this,"url")}get contextId(){return"none"}constructor(){super(null);this.appReady=false;this.busyIndicators=[];this.readyHandlers=[];this.onError=error=>{console.log(error)};this.screen={};this.bag={};this.put(App_1,this);this.dispatcher=new AtomDispatcher;this.dispatcher.start();this.put(AtomDispatcher,this.dispatcher);setTimeout((()=>{this.invokeReady()}),5)}createBusyIndicator(taskInfo){this.busyIndicatorService=this.busyIndicatorService||this.resolve(BusyIndicatorService);return this.busyIndicatorService.createIndicator(taskInfo)}syncUrl(){}callLater(f){this.dispatcher.callLater(f)}installStyleSheet(ssConfig){App_1.installStyleSheet(ssConfig)}installScript(location){return App_1.installScript(location)}updateDefaultStyle(content){throw new Error("Platform does not support StyleSheets")}waitForPendingCalls(){return this.dispatcher.waitForAll()}setTimeoutAsync(task,timeInMS=1,previousToken){if(previousToken!==void 0){clearTimeout(previousToken)}return setTimeout((()=>{try{const p=task();if(p===null||p===void 0?void 0:p.then){p.catch((error=>{if(CancelToken.isCancelled(error)){return}console.error(error)}))}}catch(e){if(CancelToken.isCancelled(e)){return}console.error(e)}}),timeInMS)}runAsync(tf){try{const p=tf();if(p&&p.then&&p.catch){p.catch((error=>{this.onError("runAsync");this.onError(error)}))}}catch(e){this.onError("runAsync");this.onError(e)}}broadcast(channel,data){const ary=this.bag[channel];if(!ary){return}for(const entry of ary.list){entry.call(this,channel,data)}}subscribe(channel,action){let ary=this.bag[channel];if(!ary){ary=new AtomHandler(channel);this.bag[channel]=ary}ary.list.push(action);return{dispose:()=>{ary.list=ary.list.filter((a=>a!==action));if(!ary.list.length){this.bag[channel]=null}}}}main(){}onReady(f){if(this.readyHandlers){this.readyHandlers.push(f)}else{this.invokeReadyHandler(f)}}invokeReady(){if(this.invokeReadyHandler){for(const iterator of this.readyHandlers){this.invokeReadyHandler(iterator)}}this.readyHandlers=null}invokeReadyHandler(f){const indicator=this.createBusyIndicator();const a=f();if(a&&a.then&&a.catch){a.then((r=>{indicator.dispose()}));a.catch((e=>{indicator.dispose();console.error(typeof e==="string"?e:JSON.stringify(e))}));return}indicator.dispose()}});_export("App",App=App_1=__decorate([RegisterSingleton,__metadata("design:paramtypes",[])],App))}}}));AmdLoader.instance.setup("@web-atoms/core/dist/App");System.register([],(function(_export,_context){"use strict";var AtomDisposableList;_export("AtomDisposableList",void 0);return{setters:[],execute:function(){_export("AtomDisposableList",AtomDisposableList=class AtomDisposableList{constructor(){this.disposables=[]}add(d){if(typeof d==="function"){const fx=d;d={dispose:fx}}this.disposables.push(d);const dx=d;return{dispose:()=>{this.disposables=this.disposables.filter((x=>x!==dx));dx.dispose()}}}dispose(){for(const iterator of this.disposables){iterator.dispose()}this.disposables.length=0}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/AtomDisposableList");System.register([],(function(_export,_context){"use strict";var viewModelParseWatchCache,viewModelParseWatchCache2;function trimRegEx(t,r){const m=r.exec(t);if(m&&m.length){return[true,t.substring(m[0].length).trim(),m[0]]}return[false,t,""]}function extractTill(text,search,returnOriginal=false){const index=text.indexOf(search);if(index<=0){return returnOriginal?text:""}return text.substring(0,index)}function parsePath(f,parseThis){let str=f.toString().trim();str=str.split("\n").filter((s=>!/^\/\//.test(s.trim()))).join("\n");const key=(parseThis===undefined?"un:":parseThis?"_this:":"_noThis:")+str;const px1=viewModelParseWatchCache[key];if(px1){return px1}if(str.endsWith("}")){str=str.substr(0,str.length-1)}const functionRegEx=/^\w+\s*\(/;const lambdaRegEx=/^\(?(\w+)?(\s?\,\s?\w+)*\)?\s?\=\>/;let arg="";const original=str;let[success,remaining]=trimRegEx(str,functionRegEx);if(success){str=remaining;remaining=extractTill(remaining,")");str=str.substring(remaining.length);arg=extractTill(remaining,",",true)}else{[success,str,remaining]=trimRegEx(str,lambdaRegEx);if(success){remaining=remaining.trim();remaining=remaining.substring(0,remaining.length-2);remaining=extractTill(remaining,")",true);arg=extractTill(remaining,",",true);if(arg.startsWith("(")){arg=arg.substring(1)}}else{if(parseThis!==undefined&&parseThis===false){return[]}else{parseThis=true}}}str=str.trim();const isThis=parseThis===undefined?(arg?false:true)||parseThis:parseThis;const p=(isThis?"(\\_this|this)":arg||"").trim();if(p.length===0){const empty=[];viewModelParseWatchCache[key]=empty;return empty}const regExp=`(?:(\\b${p})(?:(\\.[a-zA-Z_][a-zA-Z_0-9]*)+)\\s?(?:(\\(|\\=\\=\\=|\\=\\=|\\=)?))`;const re=new RegExp(regExp,"gi");let path=[];const ms=str.replace(re,(m=>{let px=m;if(px.startsWith("this.")){if(parseThis!==true){px=px.substr(5)}}else if(px.startsWith("_this.")){if(parseThis!==true){px=px.substr(6)}else{px=px.substr(1)}}else{px=px.substr(p.length+1)}px=px.split(".").filter((s=>!s.endsWith("("))).join(".");if(!path.find((y=>y===px))){path.push(px)}const filtered=[];for(const iterator of path){if(iterator.endsWith("==")||!(iterator.endsWith("(")||iterator.endsWith("="))){filtered.push((iterator.endsWith("===")?iterator.substr(0,iterator.length-3):iterator.endsWith("==")?iterator.substr(0,iterator.length-2):iterator).trim())}}path=filtered.filter((px11=>{const search=px11+".";for(const iterator of filtered){if(px11!==iterator&&iterator.indexOf(search)!==-1){return false}}return true}));return m}));path=path.sort(((a,b)=>b.localeCompare(a)));const duplicates=path;path=[];for(const iterator of duplicates){if(path.find((px2=>px2===iterator))){continue}path.push(iterator)}const rp=[];for(const rpItem of path){if(rp.find((x=>x.startsWith(rpItem)))){continue}rp.push(rpItem)}const pl=path.filter((p1=>p1)).map((p1=>p1.split(".")));viewModelParseWatchCache[key]=pl;return pl}function parsePathLists(f){const str=f.toString().trim();const key=str;const px1=viewModelParseWatchCache2[key];if(px1){return px1}const pl={pathList:parsePath(str,false),thisPath:parsePath(str,true),combined:[]};if(pl.thisPath.length&&pl.pathList.length){pl.combined=pl.thisPath.map((x=>{x[0]="t";x.splice(0,0,"this");return x})).concat(pl.pathList.map((x=>{x.splice(0,0,"this","x");return x})));pl.thisPath=[];pl.pathList=[]}viewModelParseWatchCache2[key]=pl;return pl}_export({parsePath,parsePathLists});return{setters:[],execute:function(){viewModelParseWatchCache={};viewModelParseWatchCache2={}}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/ExpressionParser");System.register(["./AtomBinder","./ExpressionParser"],(function(_export,_context){"use strict";var AtomBinder,parsePath,ObjectProperty,AtomWatcher;_export({ObjectProperty:void 0,AtomWatcher:void 0});return{setters:[function(_AtomBinder){AtomBinder=_AtomBinder.AtomBinder},function(_ExpressionParser){parsePath=_ExpressionParser.parsePath}],execute:function(){_export("ObjectProperty",ObjectProperty=class ObjectProperty{constructor(name){this.name=name}toString(){return this.name}});_export("AtomWatcher",AtomWatcher=class AtomWatcher{constructor(target,path,onChanged,source){this.source=source;this.isExecuting=false;this.target=target;this.forValidation=true;if(path instanceof Function){const f=path;path=parsePath(path);this.func=onChanged||f;this.funcText=f.toString()}else{this.func=onChanged}this.runEvaluate=()=>{this.evaluate()};this.runEvaluate.watcher=this;this.path=path.map((x=>x.map((y=>new ObjectProperty(y)))));if(!this.path.length){debugger;console.warn("There is nothing to watch, do not use one way binding without any binding expression")}}toString(){return this.func.toString()}dispose(){if(!this.path){return}for(const p of this.path){for(const op of p){if(op.watcher){op.watcher.dispose();op.watcher=null;op.target=null}}}this.func=null;this.path=null;this.source=null}init(evaluate){if(evaluate){this.evaluate(true)}else{for(const iterator of this.path){this.evaluatePath(this.target,iterator)}}}evaluatePath(target,path){let newTarget=null;for(const p of path){if(this.source&&p.name==="this"){target=this.source;continue}newTarget=target[p.name];if(!p.target){if(p.watcher){p.watcher.dispose()}p.watcher=AtomBinder.watch(target,p.name,this.runEvaluate)}else if(p.target!==target){if(p.watcher){p.watcher.dispose()}p.watcher=AtomBinder.watch(target,p.name,this.runEvaluate)}p.target=target;target=newTarget;if(newTarget===undefined||newTarget===null){break}}return newTarget}evaluate(force){if(!this.path){console.warn(`Watcher is not disposed properly, please watch for any memory leak`);return}if(this.isExecuting){return}const disposeWatchers=[];this.isExecuting=true;try{const values=[];const logs=[];for(const p of this.path){values.push(this.evaluatePath(this.target,p))}try{this.func.apply(this.target,values)}catch(e){console.warn(e)}}finally{this.isExecuting=false;for(const d of disposeWatchers){d.dispose()}}}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/AtomWatcher");System.register(["tslib","./ExpressionParser","./types"],(function(_export,_context){"use strict";var __awaiter,parsePath,parsePathLists,CancelToken,ignoreValue,Bind,isEvent,bindSymbol;function twoWaysConvert(name,b,control,e,creator){control.bind(e,name,b.thisPathList||b.pathList,b.eventList||true,null,b.thisPathList?creator:undefined)}_export("default",void 0);return{setters:[function(_tslib){__awaiter=_tslib.__awaiter},function(_ExpressionParser){parsePath=_ExpressionParser.parsePath;parsePathLists=_ExpressionParser.parsePathLists},function(_types){CancelToken=_types.CancelToken;ignoreValue=_types.ignoreValue}],execute:function(){isEvent=/^event/i;_export("bindSymbol",bindSymbol=Symbol("Bind"));_export("default",Bind=class Bind{static forControl(){return Bind}static forData(){return Bind}static forViewModel(){return Bind}static forLocalViewModel(){return Bind}static presenter(name){return{[bindSymbol](cn,control,e,creator){if(typeof name==="function"){name(control);return}const n=name||cn;let c=control.element;while(c){if(c.atomControl&&c.atomControl[n]!==undefined){break}c=c._logicalParent||c.parentElement}(c&&c.atomControl||control)[n]=e}}}static event(sourcePath){return{[bindSymbol](name,control,e){control.runAfterInit((()=>{if(isEvent.test(name)){name=name.substring(5);if(name.startsWith("-")){name=name.substring(1).replace(/-([a-z])/g,(g=>g[1].toUpperCase()))}else{name=name[0].toLowerCase()+name.substring(1)}}control.bindEvent(e,name,(e1=>sourcePath(control,e1)))}))}}}static oneTime(sourcePath,now){return{[bindSymbol](name,control,e){control.runAfterInit((()=>{control.setLocalValue(e,name,sourcePath(control,e))}));if(typeof now!=="undefined"){control.setLocalValue(e,name,now)}}}}static oneTimeAsync(sourcePath,now){return{[bindSymbol](name,control,e){control.runAfterInit((()=>{control.app.runAsync((()=>__awaiter(this,void 0,void 0,(function*(){const value=yield sourcePath(control,e,new CancelToken);control.setLocalValue(e,name,value)}))))}));if(typeof now!=="undefined"){control.setLocalValue(e,name,now)}}}}static source(source,path,now){const lists=parsePath(path,false).map((x=>["this",...x]));return{[bindSymbol](name,control,e,creator){const self={control,source};control.bind(e,name,lists,false,(()=>path.call(self,self)),self);if(typeof now!=="undefined"){control.setLocalValue(e,name,now)}}}}static oneWayAsync(sourcePath,{watchDelayInMS=250,default:defaultValue}={}){let pathList;let combined;let thisPathList;if(Array.isArray(sourcePath)){pathList=sourcePath}else{const lists=parsePathLists(sourcePath);if(lists.combined.length){combined=lists.combined}if(lists.pathList.length){pathList=lists.pathList}if(lists.thisPath.length){thisPathList=lists.thisPath}}if(!(combined||pathList||thisPathList)){throw new Error(`Failed to setup binding for ${sourcePath}, parsing failed`)}return{[bindSymbol](name,control,e,creator){let bindingSource;let finalPathList=pathList;if(combined){bindingSource={t:creator,x:control};finalPathList=combined}else if(thisPathList){finalPathList=thisPathList;bindingSource=creator}const asyncState={token:0,cancelToken:undefined};control.bind(e,name,finalPathList,false,(()=>{var _a;const app=control.app;(_a=asyncState.cancelToken)===null||_a===void 0?void 0:_a.cancel();asyncState.cancelToken=undefined;asyncState.token=app.setTimeoutAsync((()=>__awaiter(this,void 0,void 0,(function*(){var _b,_c;if((_b=asyncState.cancelToken)===null||_b===void 0?void 0:_b.cancelled){return}asyncState.token=undefined;(_c=asyncState.cancelToken)===null||_c===void 0?void 0:_c.cancel();const ct=asyncState.cancelToken=new CancelToken;const value=yield sourcePath.call(creator,control,e,ct);if(!ct.cancelled){control.setLocalValue(e,name,value)}}))),watchDelayInMS,asyncState.token);return ignoreValue}),bindingSource);if(typeof defaultValue!=="undefined"){control.setLocalValue(e,name,defaultValue)}}}}static oneWay(sourcePath,now){let pathList;let combined;let thisPathList;if(Array.isArray(sourcePath)){pathList=sourcePath}else{const lists=parsePathLists(sourcePath);if(lists.combined.length){combined=lists.combined}if(lists.pathList.length){pathList=lists.pathList}if(lists.thisPath.length){thisPathList=lists.thisPath}}if(!(combined||pathList||thisPathList)){throw new Error(`Failed to setup binding for ${sourcePath}, parsing failed`)}return{[bindSymbol](name,control,e,creator){if(pathList){control.bind(e,name,pathList,false,(()=>sourcePath.call(creator,control,e)));if(typeof now!=="undefined"){control.setLocalValue(e,name,now)}return}if(combined){const a={t:creator,x:control};control.bind(e,name,combined,false,(()=>sourcePath.call(creator,control,e)),a);if(typeof now!=="undefined"){control.setLocalValue(e,name,now)}return}control.bind(e,name,thisPathList,false,(()=>sourcePath.call(creator,control,e)),creator);if(typeof now!=="undefined"){control.setLocalValue(e,name,now)}}}}static twoWays(sourcePath,events,converter){let pathList;let thisPathList;if(Array.isArray(sourcePath)){pathList=sourcePath}else{const lists=parsePathLists(sourcePath);if(lists.combined.length){throw new Error("Cannot have combined binding for two ways")}if(lists.pathList.length){pathList=lists.pathList}if(lists.thisPath.length){thisPathList=lists.thisPath}}if(!(thisPathList||pathList)){throw new Error(`Failed to setup twoWay binding on ${sourcePath}`)}return{[bindSymbol](name,control,e,creator){control.bind(e,name,thisPathList||pathList,events||true,converter,thisPathList?creator:undefined)}}}static sourceTwoWays(source,path,events=["input","cut","paste","change"]){const lists=parsePath(path,false).map((x=>["this",...x]));return{[bindSymbol](name,control,e,creator){const self={control,source};control.bind(e,name,lists,events,lists,self)}}}static twoWaysImmediate(sourcePath,converter){return this.twoWays(sourcePath,["change","input","paste","cut"],converter)}constructor(setupFunction,sourcePath,name,eventList){this.setupFunction=setupFunction;this.name=name;this.eventList=eventList;this.sourcePath=sourcePath;this[bindSymbol]=true;if(!this.sourcePath){return}if(Array.isArray(this.sourcePath)){this.pathList=this.sourcePath}else{const lists=parsePathLists(this.sourcePath);if(lists.combined.length){this.combined=lists.combined}if(lists.pathList.length){this.pathList=lists.pathList}if(lists.thisPath.length){this.thisPathList=lists.thisPath}}}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/Bind");System.register([],(function(_export,_context){"use strict";var AncestorEnumerator,ChildEnumerator,AtomUI;function*descendentElementIterator(e){const stack=[];const start=e;if(start){stack.push(start)}while(stack.length){const pop=stack.pop();const next=pop.nextElementSibling;yield pop;if(next){stack.push(next)}const child=pop.firstElementChild;if(child){stack.push(child)}}}function*descendentIterator(e){const stack=[];const start=e;if(start){stack.push(start)}while(stack.length){const pop=stack.pop();const next=pop.nextSibling;yield pop;if(next){stack.push(next)}const child=pop.firstChild;if(child){stack.push(child)}}}_export({AncestorEnumerator:void 0,ChildEnumerator:void 0,descendentElementIterator,descendentIterator,AtomUI:void 0});return{setters:[],execute:function(){_export("AncestorEnumerator",AncestorEnumerator=class AncestorEnumerator{static find(e,filter){let start=e===null||e===void 0?void 0:e.parentElement;while(start){if(filter(start)){return start}start=start.parentElement}}static findSelector(e,selector){let start=e===null||e===void 0?void 0:e.parentElement;while(start){const found=start.matches(selector);if(found){return start}start=start.parentElement}}});_export("ChildEnumerator",ChildEnumerator=class ChildEnumerator{static find(e,filter){let item=e===null||e===void 0?void 0:e.firstElementChild;while(item){const next=item.nextElementSibling;if(filter(item)){return item}item=next}}static*where(e,filter){let item=e===null||e===void 0?void 0:e.firstElementChild;while(item){const next=item.nextElementSibling;if(filter(item)){yield item}item=next}}static*enumerate(e){let item=e===null||e===void 0?void 0:e.firstElementChild;while(item){const next=item.nextElementSibling;yield item;item=next}}get current(){return this.item}constructor(e){this.e=e}next(){var _a;if(!this.item){this.item=(_a=this.e)===null||_a===void 0?void 0:_a.firstElementChild}else{this.item=this.item.nextElementSibling}return this.item?true:false}});_export("AtomUI",AtomUI=class AtomUI{static outerHeight(el,margin=false){let height=el.offsetHeight;if(!margin){return height}const style=getComputedStyle(el);height+=parseInt(style.marginTop,10)+parseInt(style.marginBottom,10);return height}static outerWidth(el,margin=false){let width=el.offsetWidth;if(!margin){return width}const style=getComputedStyle(el);width+=parseInt(style.marginLeft,10)+parseInt(style.marginRight,10);return width}static innerWidth(el){return el.clientWidth}static innerHeight(el){return el.clientHeight}static scrollTop(el,y){el.scrollTo(0,y)}static screenOffset(e){const r={x:e.offsetLeft,y:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight};if(e.offsetParent){const p=this.screenOffset(e.offsetParent);r.x+=p.x;r.y+=p.y}return r}static parseUrl(url){const r={};const plist=url.split("&");for(const item of plist){const p=item.split("=");const key=decodeURIComponent(p[0]);if(!key){continue}let val=p[1];if(val){val=decodeURIComponent(val)}r[key]=this.parseValue(val)}return r}static parseValue(val){let n;if(/^[0-9]+$/.test(val)){n=parseInt(val,10);if(!isNaN(n)){return n}return val}if(/^[0-9]+\.[0-9]+/gi.test(val)){n=parseFloat(val);if(!isNaN(n)){return n}return val}if(val==="true"){return true}if(val==="false"){return false}return val}static assignID(element){if(!element.id){element.id="__waID"+AtomUI.getNewIndex()}return element.id}static toNumber(text){if(!text){return 0}if(text.constructor===String){return parseFloat(text)}return 0}static getNewIndex(){AtomUI.index=AtomUI.index+1;return AtomUI.index}});AtomUI.index=1001}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/core/AtomUI");System.register(["../web/core/AtomUI","./AtomBinder"],(function(_export,_context){"use strict";var ChildEnumerator,AtomBinder,visitDescendents,refreshInherited,watchProperty,setValue;return{setters:[function(_webCoreAtomUI){ChildEnumerator=_webCoreAtomUI.ChildEnumerator},function(_AtomBinder){AtomBinder=_AtomBinder.AtomBinder}],execute:function(){_export("visitDescendents",visitDescendents=(element,action)=>{for(const iterator of ChildEnumerator.enumerate(element)){const eAny=iterator;const ac=eAny?eAny.atomControl:undefined;if(!action(iterator,ac)){continue}visitDescendents(iterator,action)}});_export("refreshInherited",refreshInherited=(target,name,fieldName)=>{AtomBinder.refreshValue(target,name);if(!fieldName){fieldName="m"+name[0].toUpperCase()+name.substr(1)}if(!target.element){return}visitDescendents(target.element,((e,ac)=>{if(ac){if(ac[fieldName]===undefined){refreshInherited(ac,name,fieldName)}return false}return true}))});_export("watchProperty",watchProperty=(element,name,events,f)=>{if(events.indexOf("change")===-1){events.push("change")}const l=e=>{const e1=element;const v=e1.type==="checkbox"?e1.checked:e1.value;f(v)};for(const iterator of events){element.addEventListener(iterator,l,false)}return{dispose:()=>{for(const iterator of events){element.removeEventListener(iterator,l,false)}}}});_export("setValue",setValue=(element,name,value)=>{element[name]=value})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/Hacks");System.register(["./AtomBinder"],(function(_export,_context){"use strict";var AtomBinder,cache;function getSymbolKey(name){var _a;return(_a=cache[name])!==null&&_a!==void 0?_a:cache[name]=Symbol(name)}function refreshInherited(ac,key,storageKey){const e=ac.element;if(!e){return}AtomBinder.refreshValue(ac,key);let start=e.firstElementChild;if(!start){return}const stack=[start];while(stack.length){start=stack.pop();while(start){let firstChild=start.firstElementChild;const childControl=start.atomControl;if(childControl){if(childControl[storageKey]===undefined){AtomBinder.refreshValue(childControl,key)}else{firstChild=void 0}}if(firstChild){stack.push(firstChild)}start=start.nextElementSibling}}}function getOwnInheritedProperty(target,key){return target[getSymbolKey(key)]}function InheritedProperty(target,key){const iVal=target[key];const keyName=getSymbolKey(key);target[keyName]=iVal;const getter=function(){let start=this;do{const p=start[keyName];if(typeof p!=="undefined"){return p}if(!start.element){break}start=start.parent}while(start);return undefined};const setter=function(newVal){const oldValue=this[keyName];if(oldValue&&oldValue.dispose){oldValue.dispose()}this[keyName]=newVal;refreshInherited(this,key,keyName)};if(delete target[key]){Object.defineProperty(target,key,{get:getter,set:setter,enumerable:true,configurable:true})}}_export({getOwnInheritedProperty,InheritedProperty});return{setters:[function(_AtomBinder){AtomBinder=_AtomBinder.AtomBinder}],execute:function(){cache={}}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/InheritedProperty");System.register(["../di/TypeKey"],(function(_export,_context){"use strict";var TypeKey,PropertyMap;_export("PropertyMap",void 0);return{setters:[function(_diTypeKey){TypeKey=_diTypeKey.TypeKey}],execute:function(){_export("PropertyMap",PropertyMap=class PropertyMap{static from(o){const c=Object.getPrototypeOf(o);const key=TypeKey.get(c);const map=PropertyMap.map;const m=map[key]||(map[key]=PropertyMap.createMap(o));return m}static createMap(c){const map={};const nameList=[];while(c){const names=Object.getOwnPropertyNames(c);for(const name of names){if(/hasOwnProperty|constructor|toString|isValid|errors/i.test(name)){continue}map[name]=true;nameList.push(name)}c=Object.getPrototypeOf(c)}const m=new PropertyMap;m.map=map;m.names=nameList;return m}});PropertyMap.map={}}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/PropertyMap");System.register(["./Bind"],(function(_export,_context){"use strict";var bindSymbol,RootObject,XNode,xnodeSymbol,isControl,elementFactorySymbol,isFactorySymbol,attachedSymbol,isTemplateSymbol,constructorNeedsArgumentsSymbol,attachedProperties,attachedId,attach;_export({RootObject:void 0,default:void 0});return{setters:[function(_Bind){bindSymbol=_Bind.bindSymbol}],execute:function(){_export("RootObject",RootObject=class RootObject{get vsProps(){return undefined}addEventListener(name,handler){return bridge.addEventHandler(this,name,handler)}appendChild(e){bridge.appendChild(this,e)}dispatchEvent(evt){bridge.dispatchEvent(evt)}});_export("xnodeSymbol",xnodeSymbol=Symbol("XNode"));_export("isControl",isControl=Symbol("isControl"));_export("elementFactorySymbol",elementFactorySymbol=Symbol("elementFactory"));_export("isFactorySymbol",isFactorySymbol=Symbol("isFactory"));_export("attachedSymbol",attachedSymbol=Symbol("attached"));_export("isTemplateSymbol",isTemplateSymbol=Symbol("isTemplate"));_export("constructorNeedsArgumentsSymbol",constructorNeedsArgumentsSymbol=Symbol("constructorNeedsArguments"));_export("attachedProperties",attachedProperties={});attachedId=1;attach=(name,attacher)=>{const key=`:${attachedId++}`;const fx=v=>({[key]:v});attachedProperties[key]=attacher;fx[attachedSymbol]=attacher;fx[isFactorySymbol]=key;return fx};_export("default",XNode=class XNode{static attach(n,tag){return{factory:(attributes,...nodes)=>new XNode(n,attributes?Object.assign(Object.assign({},attributes),{for:tag}):{for:tag},nodes)}}static prepare(n,isProperty,isTemplate){function px(v){return{[n]:v}}px.factory=(a,...nodes)=>new XNode(n,a,nodes,isProperty,isTemplate);px.toString=()=>n;return px}static getClass(fullTypeName,assemblyName){const n=fullTypeName+";"+assemblyName;const cx=XNode.classes[n]||(XNode.classes[n]=bridge.getClass(fullTypeName,assemblyName,RootObject,((name,isProperty,isTemplate)=>(a,...nodes)=>new XNode(name,a,nodes,isProperty,isTemplate))));return cx}static namespace(ns,assemblyName){return(type,isTemplate)=>c=>{for(const key in c){if(c.hasOwnProperty(key)){const element=c[key];if(element){const n=ns+"."+type+":"+key+";"+assemblyName;const af=a=>{const r={[n]:a};Object.defineProperty(r,"toString",{value:()=>n,enumerable:false,configurable:false});return r};af.factory=(a,...nodes)=>new XNode(n,a,nodes,true,element.isTemplate);af.toString=()=>n;c[key]=af}}}const tn=ns+"."+type+";"+assemblyName;c.factory=(a,...nodes)=>new XNode(tn,a,nodes,false,isTemplate);c.toString=()=>tn}}static create(name,attributes,...children){if(typeof name==="string"){return new XNode(name,attributes,children)}if(name[isFactorySymbol]){return new XNode(name,attributes,children)}if(name.factory){return name.factory(attributes,...children)}switch(typeof name){case"object":name=name.toString();break;case"function":return name(attributes||{},...children)}return new XNode(name,attributes,children)}constructor(name,attributes,children,isProperty,isTemplate){this.name=name;this.attributes=attributes;this.children=children;this.isProperty=isProperty;this.isTemplate=isTemplate;this[xnodeSymbol]=true}toString(){if(typeof this.name==="string"){return`name is of type string and value is ${this.name}`}return`name is of type ${typeof this.name}`}});XNode.isFactory=isFactorySymbol;XNode.elementFactory=elementFactorySymbol;XNode.bindSymbol=bindSymbol;XNode.isTemplate=isTemplateSymbol;XNode.prepareAttached=attach;XNode.constructorNeedsArguments=constructorNeedsArgumentsSymbol;XNode.classes={};XNode.factory=(name,isProperty,isTemplate)=>(a,...nodes)=>new XNode(name,a,nodes,isProperty,isTemplate);if(typeof bridge!=="undefined"){bridge.XNode=XNode}}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/XNode");System.register(["tslib","../App","../core/types","../di/Inject","./AtomDisposableList","./AtomWatcher","./Bind","./Hacks","./InheritedProperty","./PropertyMap","./XNode"],(function(_export,_context){"use strict";var __decorate,__metadata,__param,App,ArrayHelper,CancelToken,ignoreValue,Inject,AtomDisposableList,AtomWatcher,bindSymbol,visitDescendents,watchProperty,InheritedProperty,PropertyMap,isControl,isFactorySymbol,xnodeSymbol,PropertyBinding,_a,_b,localBindSymbol,localXNodeSymbol,AtomComponent;_export("PropertyBinding",void 0);return{setters:[function(_tslib){__decorate=_tslib.__decorate;__metadata=_tslib.__metadata;__param=_tslib.__param},function(_App){App=_App.App},function(_coreTypes){ArrayHelper=_coreTypes.ArrayHelper;CancelToken=_coreTypes.CancelToken;ignoreValue=_coreTypes.ignoreValue},function(_diInject){Inject=_diInject.Inject},function(_AtomDisposableList){AtomDisposableList=_AtomDisposableList.AtomDisposableList},function(_AtomWatcher){AtomWatcher=_AtomWatcher.AtomWatcher},function(_Bind){bindSymbol=_Bind.bindSymbol},function(_Hacks){visitDescendents=_Hacks.visitDescendents;watchProperty=_Hacks.watchProperty},function(_InheritedProperty){InheritedProperty=_InheritedProperty.InheritedProperty},function(_PropertyMap){PropertyMap=_PropertyMap.PropertyMap},function(_XNode){isControl=_XNode.isControl;isFactorySymbol=_XNode.isFactorySymbol;xnodeSymbol=_XNode.xnodeSymbol}],execute:function(){localBindSymbol=bindSymbol;localXNodeSymbol=xnodeSymbol;_export("AtomComponent",AtomComponent=class AtomComponent{get vsProps(){return undefined}constructor(app,element=null){this.app=app;this.mInvalidated=0;this.mPendingPromises={};this.disposables=new AtomDisposableList;this.bindings=[];this.eventHandlers=[];this.element=element;this.element.atomControl=this;const a=this.beginEdit();this.preCreate();this.create();app.callLater((()=>a.dispose()))}bind(element,name,path,twoWays,valueFunc,source){const binding=new PropertyBinding(this,element,name,path,twoWays,valueFunc,source);this.bindings.push(binding);return{dispose:()=>{binding.dispose();ArrayHelper.remove(this.bindings,(x=>x===binding))}}}unbind(element,name){const toDelete=this.bindings.filter((x=>x.element===element&&(!name||x.name===name)));for(const iterator of toDelete){iterator.dispose();ArrayHelper.remove(this.bindings,(x=>x===iterator))}}bindEvent(element,name,method,key,capture){if(!element){return}if(!method){return}const be={element,name,handler:method};if(key){be.key=key}const handler=e=>{var _c;try{let r=method(e);e.executed=true;if(r){const originalReturn=r;r=r.then?r:Promise.resolve(r);e.promise=e.promise?e.promise.then((()=>r)):r;if(originalReturn.catch){return originalReturn.catch((c=>{var _c;if(CancelToken.isCancelled(c!==null&&c!==void 0?c:"Unknown error")){return}alert((_c=c.stack)!==null&&_c!==void 0?_c:c)}))}return r}}catch(error){if(CancelToken.isCancelled(error)){return}alert((_c=error.stack)!==null&&_c!==void 0?_c:error)}};element.addEventListener(name,handler,capture);be.disposable={dispose:()=>{element.removeEventListener(name,handler,capture);be.disposable.dispose=()=>undefined}};this.eventHandlers.push(be);return{dispose:()=>{be.disposable.dispose();ArrayHelper.remove(this.eventHandlers,(e=>e.disposable===be.disposable))}}}unbindEvent(element,name,method,key){const deleted=[];for(const be of this.eventHandlers){if(element&&be.element!==element){return}if(key&&be.key!==key){return}if(name&&be.name!==name){return}if(method&&be.handler!==method){return}be.disposable.dispose();be.handler=null;be.element=null;be.name=null;be.key=null;deleted.push((()=>this.eventHandlers.remove(be)))}for(const iterator of deleted){iterator()}}hasProperty(name){if(/^(data|viewModel|localViewModel|element)$/.test(name)){return true}const map=PropertyMap.from(this);if(map.map[name]){return true}if(this[name]!==undefined){return true}return false}setPrimitiveValue(element,name,value){const p=value;if(p&&p.then&&p.catch){console.warn(`Do not bind promises, instead use Bind.oneWayAsync`);this.mPendingPromises[name]=p;p.then((r=>{if(this.mPendingPromises[name]!==p){return}this.mPendingPromises[name]=null;this.setPrimitiveValue(element,name,r)})).catch((e=>{if(this.mPendingPromises[name]!==p){return}this.mPendingPromises[name]=null;console.error(e)}));return}if(/^(viewModel|localViewModel)$/.test(name)){this[name]=value;return}if((!element||element===this.element)&&this.hasProperty(name)){this.runAfterInit((()=>{this[name]=value}))}else{this.setElementValue(element,name,value)}}setLocalValue(element,name,value){const p=value;if(p&&p.then&&p.catch){console.warn(`Do not bind promises, instead use Bind.oneWayAsync`);this.mPendingPromises[name]=p;p.then((r=>{if(this.mPendingPromises[name]!==p){return}this.mPendingPromises[name]=null;this.setLocalValue(element,name,r)})).catch((e=>{if(this.mPendingPromises[name]!==p){return}this.mPendingPromises[name]=null;console.error(e)}));return}if((!element||element===this.element)&&Reflect.has(this,name)){this[name]=value}else{this.setElementValue(element,name,value)}}dispose(e){if(this.mInvalidated){clearTimeout(this.mInvalidated);this.mInvalidated=0}visitDescendents(e||this.element,((ex,ac)=>{if(ac){ac.dispose();return false}return true}));if(!e){this.unbindEvent(null,null,null);for(const binding of this.bindings){binding.dispose()}this.bindings.length=0;this.bindings=null;const e1=this.element;if(typeof e1.dispose==="function"){e1.dispose()}this.element=null;const lvm=this.localViewModel;if(lvm&&lvm.dispose){lvm.dispose();this.localViewModel=null}const vm=this.viewModel;if(vm&&vm.dispose){vm.dispose();this.viewModel=null}this.disposables.dispose();this.pendingInits=null}}onPropertyChanged(name){}beginEdit(){this.pendingInits=[];const a=this.pendingInits;return{dispose:()=>{if(this.pendingInits==null){return}this.pendingInits=null;if(a){for(const iterator of a){iterator()}}this.invalidate()}}}invalidate(){if(this.mInvalidated){clearTimeout(this.mInvalidated)}this.mInvalidated=setTimeout((()=>{this.mInvalidated=0;this.app.callLater((()=>{this.onUpdateUI()}))}),5)}onUpdateUI(){}runAfterInit(f){if(this.pendingInits){this.pendingInits.push(f)}else{f()}}registerDisposable(d){return this.disposables.add(d)}render(node,e=this.element,creator=this.creator||this){const app=this.app;const attr=node.attributes;if(attr){for(const key in attr){if(attr.hasOwnProperty(key)){const item=attr[key];const isObject=typeof item==="object";if(isObject&&item!==null){const localSymbol=item[localBindSymbol];if(localSymbol){localSymbol(key,this,e,creator);continue}const localXNode=item[localXNodeSymbol];if(localXNode){if(item.isTemplate){this.setLocalValue(e,key,this.toTemplate(app,item,creator));continue}this.setLocalValue(e,key,this.createNode(app,null,item,creator));continue}}this.setLocalValue(e,key,item)}}}const children=node.children;if(children===void 0){return}for(const iterator of children){if(!iterator){continue}if(!iterator[localXNodeSymbol]){e.appendChild(document.createTextNode(iterator.toString()));continue}if(iterator.isProperty){if(iterator.isTemplate){this.setLocalValue(e,iterator.name,this.toTemplate(app,iterator.children[0],creator));continue}this.createNode(app,e,iterator,creator);continue}const t=iterator.attributes&&iterator.attributes.template;if(t){console.warn(`This path is deprecated, check who is calling it.`);this.setLocalValue(e,t,this.toTemplate(app,iterator,creator));continue}this.createNode(app,e,iterator,creator)}}extractControlProperties(x,name="div"){const a=x.attributes;const extracted={};if(typeof x.name==="function"&&this instanceof x.name){x.name=name}if(a){for(const key in a){if(Object.prototype.hasOwnProperty.call(a,key)){if(Reflect.has(this,key)){const element=a[key];extracted[key]=element;delete a[key]}}}}return extracted}create(){}preCreate(){}setElementValue(element,name,value){element[name]=value}resolve(c,selfName){const result=this.app.resolve(c,true);if(selfName){if(typeof selfName==="function"){this.runAfterInit((()=>{const v=selfName();if(v){for(const key in v){if(v.hasOwnProperty(key)){const element=v[key];result[key]=element}}}}))}else{result[selfName]=this}}return result}pushInit(){this.runAfterInit((()=>{var _c,_d,_e;(_e=(_d=(_c=this).init)===null||_d===void 0?void 0:_d.call(_c))===null||_e===void 0?void 0:_e.catch((error=>CancelToken.isCancelled(error)?void 0:console.error(error)))}))}});_a=isControl,_b=isFactorySymbol;AtomComponent[_a]=true;AtomComponent[_b]=true;__decorate([InheritedProperty,__metadata("design:type",Object)],AtomComponent.prototype,"data",void 0);__decorate([InheritedProperty,__metadata("design:type",Object)],AtomComponent.prototype,"viewModel",void 0);__decorate([InheritedProperty,__metadata("design:type",Object)],AtomComponent.prototype,"localViewModel",void 0);_export("AtomComponent",AtomComponent=__decorate([__param(0,Inject),__metadata("design:paramtypes",[App,Object])],AtomComponent));_export("PropertyBinding",PropertyBinding=class PropertyBinding{constructor(target,element,name,path,twoWays,valueFunc,source){this.target=target;this.element=element;this.name=name;this.twoWays=twoWays;this.source=source;this.isTwoWaySetup=false;this.name=name;this.twoWays=twoWays;this.target=target;this.element=element;this.isRunning=false;if(valueFunc){if(typeof valueFunc!=="function"){this.fromSourceToTarget=valueFunc.fromSource;this.fromTargetToSource=valueFunc.fromTarget}else{this.fromSourceToTarget=valueFunc}}this.watcher=new AtomWatcher(target,path,((...v)=>{if(this.isRunning){return}if(this.disposed){return}for(const iterator of v){if(iterator===undefined){return}}const cv=this.fromSourceToTarget?this.fromSourceToTarget.apply(this,v):v[0];if(cv===ignoreValue){return}this.isRunning=true;try{if(this.target instanceof AtomComponent){this.target.setLocalValue(this.element,this.name,cv)}else{this.target[name]=cv}}finally{this.isRunning=false}}),source);this.path=this.watcher.path;if(this.target instanceof AtomComponent){this.target.runAfterInit((()=>{if(!this.watcher){return}this.watcher.init(true);if(twoWays){this.setupTwoWayBinding()}}))}else{this.watcher.init(true);if(twoWays){this.setupTwoWayBinding()}}}setupTwoWayBinding(){if(this.target instanceof AtomComponent){if(this.element&&(this.element!==this.target.element||!this.target.hasProperty(this.name))){let events=[];if(typeof this.twoWays!=="boolean"){events=this.twoWays}this.twoWaysDisposable=watchProperty(this.element,this.name,events,(v=>{this.setInverseValue(v)}));return}}const watcher=new AtomWatcher(this.target,[[this.name]],((...values)=>{if(this.isTwoWaySetup){this.setInverseValue(values[0])}}));watcher.init(true);this.isTwoWaySetup=true;this.twoWaysDisposable=watcher}setInverseValue(value){if(!this.twoWays){throw new Error("This Binding is not two ways.")}if(this.disposed){return}if(this.isRunning){return}this.isRunning=true;try{const first=this.path[0];const length=first.length;let v=this.target;let i=0;let name;for(i=0;i<length-1;i++){name=first[i].name;if(name==="this"){v=this.source||this.target}else{v=v[name]}if(!v){return}}name=first[i].name;v[name]=this.fromTargetToSource?this.fromTargetToSource.call(this,value):value}finally{this.isRunning=false}}dispose(){var _c;(_c=this.twoWaysDisposable)===null||_c===void 0?void 0:_c.dispose();this.twoWaysDisposable=undefined;this.watcher.dispose();this.disposed=true;this.watcher=null}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/AtomComponent");System.register(["./AtomBinder"],(function(_export,_context){"use strict";var AtomBinder;function BindableProperty(target,key){const iVal=target[key];const keyName="_"+key;target[keyName]=iVal;const getter=function(){return this[keyName]};const setter=function(newVal){const oldValue=this[keyName];if(oldValue===undefined?oldValue===newVal:oldValue==newVal){return}const ce=this;if(ce.onPropertyChanging){ce.onPropertyChanging(key,oldValue,newVal)}this[keyName]=newVal;AtomBinder.refreshValue(this,key)};if(delete target[key]){Object.defineProperty(target,key,{get:getter,set:setter,enumerable:true,configurable:true})}}_export("BindableProperty",BindableProperty);return{setters:[function(_AtomBinder){AtomBinder=_AtomBinder.AtomBinder}],execute:function(){}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/BindableProperty");(function(factory){if(typeof module==="object"&&typeof module.exports==="object"){var v=factory(require,exports);if(v!==undefined)module.exports=v}else if(typeof define==="function"&&define.amd){define(["require","exports"],factory)}})((function(require,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.msDays=exports.msHours=exports.msSeconds=exports.msMinutes=void 0;function isEmpty(n){return n===undefined||n===null||n===0||isNaN(n)}exports.msMinutes=6e4;exports.msSeconds=1e3;exports.msHours=36e5;exports.msDays=24*exports.msHours;const daysPerMS=1/exports.msDays;const hoursPerMS=1/exports.msHours;const minutesPerMS=1/exports.msMinutes;const secondsPerMS=1/exports.msSeconds;function padLeft(n,c=2,t="0"){let s=n.toString();if(s.length<c){s=t+s}return s}class TimeSpan{static fromDays(n){return new TimeSpan(n*exports.msDays)}static fromHours(n){return new TimeSpan(n*exports.msHours)}static fromMinutes(n){return new TimeSpan(n*exports.msMinutes)}static fromSeconds(n){return new TimeSpan(n*exports.msSeconds)}static parse(text){if(!text){throw new Error("Invalid time format")}let isPM=false;let d,h,m,s,ms;const tokens=text.split(/:/);const last=tokens[tokens.length-1];const lastParts=last.split(" ");if(lastParts.length>1){if(/pm/i.test(lastParts[1])){isPM=true}tokens[tokens.length-1]=lastParts[0]}const firstOfLast=lastParts[0];if(firstOfLast.indexOf(".")!==-1){const secondParts=firstOfLast.split(".");if(secondParts.length>1){tokens[tokens.length-1]=secondParts[0];ms=parseInt(secondParts[1],10)}}if(tokens.length===2){d=0;h=parseInt(tokens[0],10);m=parseInt(tokens[1],10)}else if(tokens.length===3){d=0;h=parseInt(tokens[0],10);m=parseInt(tokens[1],10);s=parseInt(tokens[2],10)}else if(tokens.length===4){d=parseInt(tokens[0],10);h=parseInt(tokens[1],10);m=parseInt(tokens[2],10);s=parseInt(tokens[3],10)}return new TimeSpan(d,isPM?h+12:h,m,s,ms)}get totalSeconds(){return this.msSinceEpoch*secondsPerMS}get totalMinutes(){return this.msSinceEpoch*minutesPerMS}get totalHours(){return this.msSinceEpoch*hoursPerMS}get totalDays(){return this.msSinceEpoch*daysPerMS}get totalMilliseconds(){return this.msSinceEpoch}get days(){return Math.floor(this.msSinceEpoch/exports.msDays)}get hours(){return Math.floor(this.msSinceEpoch/exports.msHours%24)}get minutes(){return Math.floor(this.msSinceEpoch/exports.msMinutes%60)}get seconds(){return Math.floor(this.msSinceEpoch/exports.msSeconds%60)}get milliseconds(){return Math.floor(this.msSinceEpoch%1e3)}get duration(){const t=this.msSinceEpoch;return new TimeSpan(t>0?t:-t)}get trimmedTime(){return new TimeSpan(Math.ceil(this.msSinceEpoch%exports.msDays))}constructor(days,hours,minutes,seconds,milliseconds){if(arguments.length===1){this.msSinceEpoch=days}else{this.msSinceEpoch=(days||0)*exports.msDays+(hours||0)*exports.msHours+(minutes||0)*exports.msMinutes+(seconds||0)*exports.msSeconds+(milliseconds||0)}}toString(formatAs12=false){let ams=this.msSinceEpoch;const text=[];let postFix="";function format(max,f12=false){let txt=null;if(ams>max){const n=Math.floor(ams/max);ams=ams%max;if(f12){if(n>12){postFix=" PM";txt=padLeft(n-12)}else{postFix=" AM"}}if(!txt){txt=padLeft(n)}}if(txt){text.push(txt)}return txt}const d=format(exports.msDays);format(exports.msHours,formatAs12&&!d);format(exports.msMinutes);let s=format(exports.msSeconds);if(ams){s+="."+ams;text[text.length-1]=s}return`${text.join(":")}${postFix}`}add(ts){return new TimeSpan(this.msSinceEpoch+ts.msSinceEpoch)}equals(ts){return ts.msSinceEpoch===this.msSinceEpoch}}exports.default=TimeSpan;if(typeof window!=="undefined"){window.TimeSpan=TimeSpan}}));AmdLoader.instance.setup("@web-atoms/date-time/dist/TimeSpan");(function(factory){if(typeof module==="object"&&typeof module.exports==="object"){var v=factory(require,exports);if(v!==undefined)module.exports=v}else if(typeof define==="function"&&define.amd){define(["require","exports","./TimeSpan"],factory)}})((function(require,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});const TimeSpan_1=require("./TimeSpan");class DateTime{static from(d){if(!d){return null}if(!(d instanceof DateTime)){if(d instanceof Date){d=new DateTime(d.getTime())}return new DateTime(d)}return d}static get today(){const a=new DateTime;return a.date}static get utcNow(){const now=new Date;return new DateTime(now.getTime()+now.getTimezoneOffset())}static get now(){return new DateTime}static parse(s){return new DateTime(s)}get day(){return this.getDate()}get dayOfWeek(){return this.getDay()}get month(){return this.getMonth()}get year(){return this.getFullYear()}get hour(){return this.getHours()}get minute(){return this.getMinutes()}get second(){return this.getSeconds()}get milliSecond(){return this.getMilliseconds()}get timeZoneOffset(){return TimeSpan_1.default.fromMinutes(this.getTimezoneOffset())}get msSinceEpoch(){return this.getTime()}get date(){const d=new DateTime(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0,0);return d}get asJSDate(){return this}get time(){return new TimeSpan_1.default(0,this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds())}constructor(a,b,c,d,e,f,g){let rd;switch(arguments.length){case 0:rd=new Date;break;case 1:rd=new Date(a);break;case 2:rd=new Date(a,b);break;case 3:rd=new Date(a,b,c);break;case 4:rd=new Date(a,b,c,d);break;case 5:rd=new Date(a,b,c,d,e);break;case 6:rd=new Date(a,b,c,d,e,f);break;default:rd=new Date(a,b,c,d,e,f,g)}Object.setPrototypeOf(rd,DateTime.prototype);return rd}add(t,hours,minutes,seconds,milliseconds){if(t instanceof Date){return new DateTime(this.getTime()+t.getTime())}let days=0;if(t instanceof TimeSpan_1.default){days=t.days;hours=t.hours;minutes=t.minutes;seconds=t.seconds;milliseconds=t.milliseconds}else{days=t}function hasValue(n,name){if(n===undefined){return false}if(n===null){throw new Error(`${name} cannot be null`)}return n!==0}const d=new Date(this.getTime());if(hasValue(days,"days")){d.setDate(d.getDate()+days)}if(hasValue(hours,"hours")){d.setHours(d.getHours()+hours)}if(hasValue(minutes,"minutes")){d.setMinutes(d.getMinutes()+minutes)}if(hasValue(seconds,"seconds")){d.setSeconds(d.getSeconds()+seconds)}if(hasValue(milliseconds,"milliseconds")){d.setMilliseconds(d.getMilliseconds()+milliseconds)}Object.setPrototypeOf(d,DateTime.prototype);return d}addMonths(m){const d=new Date(this.msSinceEpoch);d.setMonth(d.getMonth()+m);Object.setPrototypeOf(d,DateTime.prototype);return d}addYears(y){const d=new Date(this.msSinceEpoch);d.setFullYear(d.getFullYear()+y);Object.setPrototypeOf(d,DateTime.prototype);return d}addDays(day){const d=new Date(this.msSinceEpoch);d.setDate(d.getDate()+day);Object.setPrototypeOf(d,DateTime.prototype);return d}addHours(h){const d=new Date(this.msSinceEpoch);d.setHours(d.getHours()+h);Object.setPrototypeOf(d,DateTime.prototype);return d}addMinutes(m){const d=new Date(this.msSinceEpoch);d.setMinutes(d.getMinutes()+m);Object.setPrototypeOf(d,DateTime.prototype);return d}diff(rhs){return new TimeSpan_1.default(this.getTime()-rhs.getTime())}equals(d){if(!d){return false}return this.getTime()===d.getTime()}dateEquals(d){if(!d){return false}return this.date.equals(DateTime.from(d).date)}compare(d){return this.getTime()-d.getTime()}toRelativeString(dt){if(!dt){dt=DateTime.now}else{if(dt instanceof Date&&!(dt instanceof DateTime)){dt.__proto__=DateTime.prototype;dt=dt}}const diff=this.diff(dt);if(dt.year!==this.year){return this.toLocaleDateString()}if(Math.abs(diff.totalDays)>6){return this.toLocaleDateString(undefined,{month:"short",day:"numeric"})}if(Math.abs(diff.totalHours)>23){return this.toLocaleDateString(undefined,{weekday:"short"})}if(Math.abs(diff.totalMinutes)>59){return`${Math.floor(diff.totalHours)} hours`}return`${Math.floor(diff.totalMinutes)} mins`}valueOf(){return this.getTime()}}exports.default=DateTime;DateTime.prototype.__proto__=Date.prototype;if(typeof window!=="undefined"){window.DateTime=DateTime}}));AmdLoader.instance.setup("@web-atoms/date-time/dist/DateTime");System.register(["@web-atoms/date-time/dist/DateTime","./types"],(function(_export,_context){"use strict";var DateTime,CancelToken,EventScope,key,id;_export("default",void 0);return{setters:[function(_webAtomsDateTimeDistDateTime){DateTime=_webAtomsDateTimeDistDateTime.default},function(_types){CancelToken=_types.CancelToken}],execute:function(){key=DateTime.now.msSinceEpoch;id=1;_export("default",EventScope=class EventScope{static create(){return new EventScope(`eventScopeE${key}${id++}`)}bindEvent(fx){return{[this.eventName]:fx}}constructor(eventType){this.eventType=eventType;this.eventName=`event-${this.eventType}`}subscribe(control,handler){return control.bindEvent(window,this.eventType,handler)}listen(fx){const asyncHandler=ce=>{if(ce.defaultPrevented){return}try{const p=fx(ce);if(p===null||p===void 0?void 0:p.catch){p.catch((r=>{if(CancelToken.isCancelled(r)){return}console.error(r)}))}}catch(e){if(CancelToken.isCancelled(e)){return}console.error(e)}};window.addEventListener(this.eventType,asyncHandler);return{dispose:()=>{window.removeEventListener(this.eventType,asyncHandler)}}}listenOn(target,fx){const asyncHandler=ce=>{if(ce.defaultPrevented){return}try{const p=fx(ce);if(p===null||p===void 0?void 0:p.catch){p.catch((r=>{if(CancelToken.isCancelled(r)){return}console.error(r)}))}}catch(e){if(CancelToken.isCancelled(e)){return}console.error(e)}};target.addEventListener(this.eventType,asyncHandler);return{dispose:()=>{target.removeEventListener(this.eventType,asyncHandler)}}}dispatch(target,detail,{cancelable=true,bubbles=true}={}){const ce=new CustomEvent(this.eventType,{detail,cancelable,bubbles});target.dispatchEvent(ce);return ce}dispatchEvent(detail,cancelable=true){const ce=new CustomEvent(this.eventType,{detail,cancelable,bubbles:false});window.dispatchEvent(ce);return ce}toString(){return this.eventType}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/EventScope");System.register([],(function(_export,_context){"use strict";var StringHelper;_export("StringHelper",void 0);return{setters:[],execute:function(){_export("StringHelper",StringHelper=class StringHelper{static escapeRegExp(text){return text.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}static createContainsRegExp(text){return new RegExp(this.escapeRegExp(text),"i")}static createContainsAnyWordRegExp(text){return new RegExp(text.split(/\s+/g).map((x=>`(${this.escapeRegExp(x)})`)).join("|"),"i")}static containsIgnoreCase(source,test){if(!source){return false}if(!test){return true}return this.createContainsRegExp(test).test(source)}static containsAnyWordIgnoreCase(source,test){if(!source){return false}if(!test){return true}return this.createContainsAnyWordRegExp(test).test(source)}static fromCamelToHyphen(input){return input.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}static fromCamelToUnderscore(input){return input.replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase()}static fromCamelToPascal(input){return input[0].toUpperCase()+input.substr(1)}static fromHyphenToCamel(input){return input.replace(/-([a-z])/g,(g=>g[1].toUpperCase()))}static fromUnderscoreToCamel(input){return input.replace(/\_([a-z])/g,(g=>g[1].toUpperCase()))}static fromPascalToCamel(input){return input[0].toLowerCase()+input.substr(1)}static fromPascalToTitleCase(s){return s.replace(/([A-Z])/gm,((x,g,i)=>i?" "+x:x))}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/StringHelper");System.register(["./StringHelper"],(function(_export,_context){"use strict";var StringHelper,Variable,Route;_export({Variable:void 0,default:void 0});return{setters:[function(_StringHelper){StringHelper=_StringHelper.StringHelper}],execute:function(){_export("Variable",Variable=class Variable{get regex(){if(this.catchAll){return`(/(?<${this.variable}>.+)?)?`}if(this.optional){return`(/?(?<${this.variable}>[^\\/]+))?`}return`/(?<${this.variable}>[^\\/]+)`}constructor(variable,name){var _a;this.variable=variable;this.name=name;this.convert=v=>v;if(variable.startsWith("*")){this.catchAll=true;variable=variable.substring(1)}if(variable.endsWith("?")){this.optional=true;variable=variable.substring(0,variable.length-1)}const index=variable.indexOf(":");if(index!==-1){const parseAs=variable.substring(index+1);variable=variable.substring(0,index);switch(parseAs){case"number":this.convert=v=>{const r=parseFloat(v);if(Number.isNaN(r)){return void 0}return r};break;case"boolean":this.convert=v=>{if(v==="true"){return true}if(v==="false"){return false}};break}}this.variable=variable;(_a=this.name)!==null&&_a!==void 0?_a:this.name=variable}});_export("default",Route=class Route{static encodeUrl(url){return url}static create(route,queries,order=0){if(!route.startsWith("/")){throw new Error("String Route must start with /")}return new Route(route,queries,order)}constructor(route,queries,order=0){this.route=route;this.order=order;this.queries=new Map;this.variables=[];this.substitutions=[];if(queries){for(const iterator of queries){let[name,variable=name]=iterator.split("=");if(variable.startsWith("{")){variable=variable.substring(1,variable.length-1)}this.queries.set(name,variable)}}const tokens=route.substring(1).split(/\//g);let regex="^";this.substitutions.push("/");let catchAll=false;for(const iterator of tokens){if(regex.length>2){this.substitutions.push("/")}if(!iterator.startsWith("{")){this.substitutions.push(iterator);regex+=StringHelper.escapeRegExp("/");regex+=StringHelper.escapeRegExp(iterator);continue}if(!iterator.endsWith("}")){throw new Error("invalid route, missing end curly brace")}const v=new Variable(iterator.substring(1,iterator.length-1));regex+=v.regex;this.variables.push(v);this.substitutions.push(v);catchAll||(catchAll=v.catchAll)}if(!catchAll){regex+="\\/?$"}this.regex=new RegExp(regex,"i")}matches(route,q){var _a;const matches=this.regex.exec(route);if((matches===null||matches===void 0?void 0:matches.length)>0){const result={};const{groups}=matches;for(const iterator of this.variables){const v=groups[iterator.variable];if(v!==void 0&&v!==null){const converted=iterator.convert(decodeURIComponent(v));if(converted===void 0){return null}result[iterator.variable]=converted}}if(q){for(let[key,value]of q.entries()){const variable=(_a=this.queries.get(key))!==null&&_a!==void 0?_a:key;result[variable]=value}}return result}return null}substitute(vars){var _a;let result="";for(const iterator of this.substitutions){if(typeof iterator==="string"){result+=iterator;continue}result+=(_a=vars[iterator.variable])!==null&&_a!==void 0?_a:""}if(this.queries.size>0){result+="?";for(const[key,variable]of this.queries.entries()){const value=vars[variable];if(value){result+=`${encodeURIComponent(key)}=${encodeURIComponent(value)}&`}}}return result}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/Route");System.register(["tslib","./EventScope","./Route","./types"],(function(_export,_context){"use strict";var __awaiter,EventScope,Route,CancelToken,PageCommands,Command,Commands,routeSymbol,displayRouteSymbol,id,defaultOrSelf;_export({PageCommands:void 0,default:void 0,Commands:void 0});return{setters:[function(_tslib){__awaiter=_tslib.__awaiter},function(_EventScope){EventScope=_EventScope.default},function(_Route){Route=_Route.default},function(_types){CancelToken=_types.CancelToken}],execute:function(){_export("routeSymbol",routeSymbol=Symbol("routeSymbol"));_export("displayRouteSymbol",displayRouteSymbol=Symbol("displayRouteSymbol"));document.body.addEventListener("click",(ce=>{let target=ce.target;let clickCommand;let commandParameter;while(target){clickCommand=target.getAttribute("data-click-command");const cp=target.commandParameter;if(cp){commandParameter=cp}if(clickCommand){break}target=target.parentElement}if(!clickCommand){return}const cmd=Command.registry.get(clickCommand);if(cmd){cmd.eventScope.dispatch(target,commandParameter)}}));id=1;_export("PageCommands",PageCommands=class PageCommands{});defaultOrSelf=x=>{var _a;return(_a=x===null||x===void 0?void 0:x.default)!==null&&_a!==void 0?_a:x};_export("default",Command=class Command{static invokeRoute(route=(location.hash.startsWith("#!")?location.hash.substring(2):location.href),forceDisplay=false){let sp;if(/^http(s)?\:\/\//i.test(route)){const url=new URL(route);sp=url.searchParams;route=url.hash.startsWith("#!")?url.hash.substring(2):url.pathname}else{if(route.startsWith("#!")){route=route.substring(2)}}const index=route.indexOf("?");if(index!==-1){sp=new URLSearchParams(route.substring(index+1));route=route.substring(0,index)}else{sp!==null&&sp!==void 0?sp:sp=new URLSearchParams("")}for(const iterator of this.routes){const params=iterator.route.matches(route,sp);if(params){params[routeSymbol]=route;params[displayRouteSymbol]=forceDisplay?sp.size>0?`${route}?${sp.toString()}`:route:"";iterator.dispatch(params,true);return iterator}}}static create({name=`command${id++}`,eventScope=EventScope.create(),route,routeQueries,routeOrder=0,routeDefaults,pageLoader,pageListener,openPage,pushPage,registerOnClick,pushPageForResult,pushPageForResultOrCancel,listener}){let cmd=new Command(name,eventScope,registerOnClick);if(route){if(this.routePrefix){if(!route.startsWith(this.routePrefix)){route=this.routePrefix+route}}cmd=cmd.withRoute(route,routeQueries,routeOrder,routeDefaults)}cmd.listener=listener;if(openPage){let pageType;cmd.listener=ce=>__awaiter(this,void 0,void 0,(function*(){var _a;const p=(_a=ce.detail)!==null&&_a!==void 0?_a:{};return p.returnResult?PageCommands.pushPageForResult(pageType!==null&&pageType!==void 0?pageType:pageType=defaultOrSelf(yield openPage()),p):PageCommands.openPage(pageType!==null&&pageType!==void 0?pageType:pageType=defaultOrSelf(yield openPage()),p)}))}if(pushPage){let pageType;cmd.listener=ce=>__awaiter(this,void 0,void 0,(function*(){var _b;const p=(_b=ce.detail)!==null&&_b!==void 0?_b:{};return p.returnResult?PageCommands.pushPageForResult(pageType!==null&&pageType!==void 0?pageType:pageType=defaultOrSelf(yield pushPage()),p):PageCommands.pushPage(pageType!==null&&pageType!==void 0?pageType:pageType=defaultOrSelf(yield pushPage()),p)}))}if(pushPageForResult){let pageType;cmd.listener=ce=>__awaiter(this,void 0,void 0,(function*(){var _c;return PageCommands.pushPageForResult(pageType!==null&&pageType!==void 0?pageType:pageType=defaultOrSelf(yield pushPageForResult()),(_c=ce.detail)!==null&&_c!==void 0?_c:{})}))}if(pushPageForResultOrCancel){let pageType;cmd.listener=ce=>__awaiter(this,void 0,void 0,(function*(){var _d;try{return yield PageCommands.pushPageForResult(pageType!==null&&pageType!==void 0?pageType:pageType=defaultOrSelf(yield pushPageForResultOrCancel()),(_d=ce.detail)!==null&&_d!==void 0?_d:{})}catch(e){if(CancelToken.isCancelled(e)){return}console.error(e)}}))}if(pageLoader){let pageType;cmd.listener=ce=>__awaiter(this,void 0,void 0,(function*(){try{pageType!==null&&pageType!==void 0?pageType:pageType=defaultOrSelf(yield pageLoader());return pageListener(pageType)(ce)}catch(e){if(CancelToken.isCancelled(e)){return}console.error(e)}}))}return cmd}get eventName(){return this.eventScope.eventType}get route(){return this.routeObj}constructor(name=`command${id++}`,eventScope=EventScope.create(),registerOnClick=(p=>({"data-click-command":this.name,commandParameter:p}))){this.name=name;this.eventScope=eventScope;this.registerOnClick=registerOnClick;Command.registry.set(this.name,this)}displayRoute(p,absoluteUrl=false){let route=Route.encodeUrl(this.routeObj.substitute(p));if(absoluteUrl){if(route.startsWith("#!")){route=location.href.split("#")[0]+route}else if(route.startsWith("/")){route=location.protocol+"//"+location.host+route}}return route}withRoute(route,queries,order=0,defaults){this.routeObj=Route.create(route,queries,order);Command.routes.push(this);Command.routes.sort(((a,b)=>a.route.order-b.route.order));this.defaults=defaults;return this}listen(r,handler=this.listener){if(!handler){throw new Error("Handler must be specified...")}const d=this.eventScope.listen((e=>{const ce=e;try{ce.executed=true;ce.promise=handler(e)}catch(error){ce.promise=Promise.reject(error)}r.app.runAsync((()=>ce.promise))}));return r.registerDisposable(d)}dispatch(detail,cancelable){if(this.route){detail=this.updateRoute(detail)}this.eventScope.dispatch(document.body,detail,{cancelable,bubbles:true})}updateRoute(detail){const d=detail!==null&&detail!==void 0?detail:detail={};let r=d[routeSymbol];if(r===null||r===void 0){r=this.route.substitute(d);d[routeSymbol]=r;d[displayRouteSymbol]=r}const{defaults}=this;if(defaults){for(const key in defaults){if(Object.prototype.hasOwnProperty.call(defaults,key)){const element=defaults[key];if(d[key]===void 0){d[key]=element}}}}return detail}dispatchAsync(detail,cancelable){return __awaiter(this,void 0,void 0,(function*(){if(this.route){detail=this.updateRoute(detail)}const ce=new CustomEvent(this.eventScope.eventType,{detail,cancelable});ce.returnResult=true;window.dispatchEvent(ce);if(ce.executed){const promise=ce.promise;if(promise){return yield promise}}}))}});Command.routePrefix="";Command.registry=new Map;Command.routes=[];_export("Commands",Commands=class Commands{static install(control){this.app=control.app;for(const key in this){const element=this[key];if(element instanceof Command){element.listen(control)}}}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/Command");System.register([],(function(_export,_context){"use strict";var FormattedString;_export("default",void 0);return{setters:[],execute:function(){_export("default",FormattedString=class FormattedString{constructor(text){this.text=text}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/FormattedString");System.register([],(function(_export,_context){"use strict";var WebImage;_export("default",void 0);return{setters:[],execute:function(){_export("default",WebImage=class WebImage{constructor(url){this.url=url}toString(){return this.url}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/WebImage");System.register(["../../core/StringHelper"],(function(_export,_context){"use strict";var StringHelper,AtomStyle,emptyPrototype;_export("AtomStyle",void 0);return{setters:[function(_coreStringHelper){StringHelper=_coreStringHelper.StringHelper}],execute:function(){emptyPrototype=Object.getPrototypeOf({});_export("AtomStyle",AtomStyle=class AtomStyle{constructor(styleSheet,name){this.styleSheet=styleSheet;this.name=name;this.styleText=null;this.name=this.name+"-root"}getBaseProperty(tc,name){let c=tc;do{c=Object.getPrototypeOf(c);if(!c){throw new Error("No property descriptor found for "+name)}const pd=Object.getOwnPropertyDescriptor(c.prototype,name);if(!pd){continue}return pd.get.apply(this)}while(true)}build(){if(this.styleText){return}this.styleText=this.createStyleText("",[],this.root).join("\n")}toString(){return this.styleText}createStyleText(name,pairs,styles){const styleList=[];for(const key in styles){if(styles.hasOwnProperty(key)){if(/^(\_\$\_|className$|toString$)/i.test(key)){continue}const element=styles[key];if(element===undefined||element===null){continue}const keyName=StringHelper.fromCamelToHyphen(key);if(key==="subclasses"){const n=name;for(const subclassKey in element){if(element.hasOwnProperty(subclassKey)){const ve=element[subclassKey];pairs=this.createStyleText(`${n}${subclassKey}`,pairs,ve)}}}else{if(element.url){styleList.push(`${keyName}: url(${element})`)}else{styleList.push(`${keyName}: ${element}`)}}}}const cname=StringHelper.fromCamelToHyphen(name);const styleClassName=`${this.name}${cname}`;if(styleList.length){pairs.push(`.${styleClassName} { ${styleList.join(";\r\n")}; }`)}return pairs}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/styles/AtomStyle");System.register(["../../di/TypeKey"],(function(_export,_context){"use strict";var TypeKey,AtomStyleSheet;_export("AtomStyleSheet",void 0);return{setters:[function(_diTypeKey){TypeKey=_diTypeKey.TypeKey}],execute:function(){_export("AtomStyleSheet",AtomStyleSheet=class AtomStyleSheet{constructor(app,name){this.app=app;this.name=name;this.styles={};this.lastUpdateId=0;this.isAttaching=false;this.pushUpdate(0)}getNamedStyle(c){const name=TypeKey.getName(c);return this.createNamedStyle(c,name)}createNamedStyle(c,name,updateTimeout){const style=this.styles[name]=new c(this,`${this.name}-${name}`);style.build();this.pushUpdate(updateTimeout);return style}onPropertyChanging(name,newValue,oldValue){this.pushUpdate()}pushUpdate(delay=1){if(this.isAttaching){return}if(delay===0){this.attach();return}if(this.lastUpdateId){clearTimeout(this.lastUpdateId)}this.lastUpdateId=setTimeout((()=>{this.attach()}),delay)}dispose(){if(this.styleElement){this.styleElement.remove()}}attach(){this.isAttaching=true;const text=[];for(const key in this.styles){if(this.styles.hasOwnProperty(key)){const element=this.styles[key];text.push(element.toString())}}const textContent=text.join("\n");this.app.updateDefaultStyle(textContent);this.isAttaching=false}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/styles/AtomStyleSheet");System.register(["tslib","../../core/AtomBinder","../../core/AtomComponent","../../core/BindableProperty","../../core/Command","../../core/FormattedString","../../core/Hacks","../../core/WebImage","../../core/XNode","../../di/TypeKey","../styles/AtomStyle","../styles/AtomStyleSheet"],(function(_export,_context){"use strict";var __decorate,__metadata,AtomBinder,AtomComponent,BindableProperty,Command,FormattedString,refreshInherited,visitDescendents,WebImage,XNode,isControl,TypeKey,AtomStyle,AtomStyleSheet,AtomControl,isAtomControl,fromHyphenToCamel,defaultStyleSheets,ElementValueSetters,propertyId,getSelection,body,html;function setAttribute(name){return(ctrl,e,value)=>{e.setAttribute(name,value)}}function setEvent(name){return(ctrl,e,value)=>{ctrl.bindEvent(e,name,value)}}function setStyle(name,applyUnit){if(applyUnit){return(ctrl,e,value)=>{if(typeof value==="number"){e.style[name]=value+applyUnit;return}e.style[name]=value}}return(ctrl,e,value)=>{e.style[name]=value}}function disposeChildren(owner,e){if(!e){return}let s=e.firstElementChild;while(s){const c=s;s=s.nextElementSibling;const ac=c.atomControl;if(ac){ac.dispose();c.remove();continue}disposeChildren(owner,c);owner.unbind(c);owner.unbindEvent(c);c.remove()}}_export("AtomControl",void 0);return{setters:[function(_tslib){__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_coreAtomBinder){AtomBinder=_coreAtomBinder.AtomBinder},function(_coreAtomComponent){AtomComponent=_coreAtomComponent.AtomComponent},function(_coreBindableProperty){BindableProperty=_coreBindableProperty.BindableProperty},function(_coreCommand){Command=_coreCommand.default},function(_coreFormattedString){FormattedString=_coreFormattedString.default},function(_coreHacks){refreshInherited=_coreHacks.refreshInherited;visitDescendents=_coreHacks.visitDescendents},function(_coreWebImage){WebImage=_coreWebImage.default},function(_coreXNode){XNode=_coreXNode.default;isControl=_coreXNode.isControl},function(_diTypeKey){TypeKey=_diTypeKey.TypeKey},function(_stylesAtomStyle){AtomStyle=_stylesAtomStyle.AtomStyle},function(_stylesAtomStyleSheet){AtomStyleSheet=_stylesAtomStyleSheet.AtomStyleSheet}],execute:function(){isAtomControl=isControl;fromHyphenToCamel=input=>input.replace(/-([a-z])/g,(g=>g[1].toUpperCase()));if(typeof bridge!=="undefined"&&bridge.platform){throw new Error("AtomControl of Web should not be used with Xamarin Forms")}defaultStyleSheets={};_export("ElementValueSetters",ElementValueSetters={text(ctrl,e,value){e.textContent=value},["class"](ctrl,e,value){if(typeof value==="string"){e.className=value;return}ctrl.setElementClass(e,value,true)},alt:setAttribute("alt"),title:setAttribute("title"),href:setAttribute("href"),target:setAttribute("target"),style:setAttribute("style"),styleLeft:setStyle("left","px"),styleTop:setStyle("top","px"),styleBottom:setStyle("bottom","px"),styleRight:setStyle("right","px"),styleWidth:setStyle("width","px"),styleHeight:setStyle("height","px"),stylePosition:setStyle("position"),styleFontSize:setStyle("fontSize","px"),styleFontFamily:setStyle("fontFamily"),styleFontWeight:setStyle("fontWeight"),styleBorder:setStyle("border"),styleBorderWidth:setStyle("borderWidth","px"),styleBorderColor:setStyle("borderColor"),styleColor:setStyle("color"),styleBackgroundColor:setStyle("backgroundColor"),dir:setAttribute("dir"),name:setAttribute("name"),tabIndex:setAttribute("tabIndex"),contentEditable:setAttribute("contentEditable"),eventClick:setEvent("click"),eventKeydown:setEvent("keydown"),eventKeyup:setEvent("keyup"),eventKeypress:setEvent("keypress"),eventMousedown:setEvent("mousedown"),eventMouseup:setEvent("mouseup"),eventMousemove:setEvent("mousemove"),src(ctrl,e,value){if(value&&/^http\:/i.test(value)){e.src=value.substring(5);return}e.src=value},styleClass(ctrl,e,value){ctrl.setElementClass(e,value)},styleDisplay(ctrl,e,value){if(typeof value==="boolean"){e.style.display=value?"":"none";return}e.style.display=value},formattedText(ctrl,e,value){if(value instanceof FormattedString){value.applyTo(ctrl.app,e)}else{e.textContent=(value||"").toString()}},disabled(ctrl,e,value){if(value){e.setAttribute("disabled","");return}e.removeAttribute("disabled")},autofocus(ctrl,element,value){ctrl.app.callLater((()=>{const ie=element;if(ie){setTimeout((()=>requestAnimationFrame((()=>ie.focus()))),100)}}))},autocomplete(ctrl,element,value){ctrl.app.callLater((()=>{element.autocomplete=value}))},onCreate(ctrl,element,value){value(ctrl,element)},watch(ctrl,element,value){setTimeout(((c1,e1,v1)=>{e1.dispatchEvent(new CustomEvent("watch",{bubbles:true,cancelable:true,detail:{control:c1,value:v1}}))}),1,ctrl,element,value)},ariaLabel(ctrl,e,value){if(value===null){e.removeAttribute("aria-label");return}if(typeof value==="object"){value=JSON.stringify(value)}if(typeof value!=="string"){value=value.toString()}e.setAttribute("aria-label",value)},ariaPlaceholder(ctrl,e,value){if(value===null){e.removeAttribute("aria-placeholder");return}if(typeof value==="object"){value=JSON.stringify(value)}if(typeof value!=="string"){value=value.toString()}e.setAttribute("aria-placeholder",value)}});ElementValueSetters["aria-label"]=ElementValueSetters.ariaLabel;ElementValueSetters["aria-placeholder"]=ElementValueSetters.ariaPlaceholder;ElementValueSetters["style-display"]=ElementValueSetters.styleDisplay;ElementValueSetters["style-left"]=ElementValueSetters.styleLeft;ElementValueSetters["style-top"]=ElementValueSetters.styleTop;ElementValueSetters["style-bottom"]=ElementValueSetters.styleBottom;ElementValueSetters["style-right"]=ElementValueSetters.styleRight;ElementValueSetters["style-width"]=ElementValueSetters.styleWidth;ElementValueSetters["style-height"]=ElementValueSetters.styleHeight;ElementValueSetters["style-position"]=ElementValueSetters.stylePosition;ElementValueSetters["style-font-size"]=ElementValueSetters.styleFontSize;ElementValueSetters["style-font-family"]=ElementValueSetters.styleFontFamily;ElementValueSetters["style-font-weight"]=ElementValueSetters.styleFontWeight;ElementValueSetters["style-border"]=ElementValueSetters.styleBorder;ElementValueSetters["style-border-width"]=ElementValueSetters.styleBorderWidth;ElementValueSetters["style-border-color"]=ElementValueSetters.styleBorderColor;ElementValueSetters["style-color"]=ElementValueSetters.styleColor;ElementValueSetters["style-background-color"]=ElementValueSetters.styleBackgroundColor;ElementValueSetters["on-create"]=ElementValueSetters.onCreate;propertyId=1;_export("AtomControl",AtomControl=class AtomControl extends AtomComponent{static from(e1){var _a;let e=e1;while(e){const{atomControl}=e;if(atomControl){return atomControl}e=(_a=e._logicalParent)!==null&&_a!==void 0?_a:e.parentElement}}static registerProperty(attributeName,attributeValue,setter){const setterSymbol=`${attributeName}_${attributeValue}_${propertyId++}`;ElementValueSetters[setterSymbol]=setter;function setterFx(v){return{[setterSymbol]:v}}setterFx.toString=()=>setterSymbol;setterFx.property=setterSymbol;return setterFx}get controlStyle(){if(this.mControlStyle===undefined){const key=TypeKey.getName(this.defaultControlStyle||this.constructor);this.mControlStyle=defaultStyleSheets[key];if(this.mControlStyle){return this.mControlStyle}if(this.defaultControlStyle){this.mControlStyle=defaultStyleSheets[key]||(defaultStyleSheets[key]=this.theme.createNamedStyle(this.defaultControlStyle,key))}this.mControlStyle=this.mControlStyle||null}return this.mControlStyle}set controlStyle(v){if(v instanceof AtomStyle){this.mControlStyle=v}else{const key=TypeKey.getName(v);this.mControlStyle=defaultStyleSheets[key]||(defaultStyleSheets[key]=this.theme.createNamedStyle(v,key))}AtomBinder.refreshValue(this,"controlStyle");this.invalidate()}get theme(){return this.mTheme||this.mCachedTheme||(this.mCachedTheme=this.parent?this.parent.theme:this.app.resolve(AtomStyleSheet,false,null))}set theme(v){this.mTheme=v;refreshInherited(this,"theme")}get parent(){let e=this.element._logicalParent||this.element.parentElement;if(!e){return null}while(e){const ac=e.atomControl;if(ac){return ac}e=e._logicalParent||e.parentElement}}get factory(){return AtomControl}constructor(app,e=document.createElement("div")){super(app,e)}onPropertyChanged(name){super.onPropertyChanged(name);switch(name){case"theme":this.mCachedTheme=null;AtomBinder.refreshValue(this,"style");break;case"renderer":this.rendererChanged();break}}atomParent(e){var _a;while(e){const ac=e.atomControl;if(ac){return ac}e=(_a=e._logicalParent)!==null&&_a!==void 0?_a:e.parentElement}}append(element){if(element instanceof AtomControl){this.element.appendChild(element.element)}else{this.element.appendChild(element)}return this}updateSize(){this.onUpdateSize();visitDescendents(this.element,((e,ac)=>{if(ac){ac.updateSize();return false}return true}))}rendererChanged(){disposeChildren(this,this.element);this.element.innerHTML="";const r=this.renderer;if(!r){return}delete this.render;this.render(r)}preCreate(){}setElementValue(element,name,value){if(value===undefined){return}const setter=ElementValueSetters[name];if(setter!==void 0){setter(this,element,value);return}if(/^(data|aria)\-/.test(name)){if(value===null){element.removeAttribute(name);return}if(typeof value==="object"){value=JSON.stringify(value)}if(typeof value!=="string"){value=value.toString()}element.setAttribute(name,value);return}if(/^style/.test(name)){name=name.substring(5);if(name.startsWith("-")){name=fromHyphenToCamel(name.substring(1))}else{name=name.charAt(0).toLowerCase()+name.substring(1)}if(value instanceof WebImage){value=`url(${value})`}element.style[name]=value;return}if(/^event/.test(name)){name=name.substring(5);if(name.startsWith("-")){name=fromHyphenToCamel(name.substring(1))}else{name=name.charAt(0).toLowerCase()+name.substring(1)}this.bindEvent(element,name,value);return}if(name.startsWith("aria-")){element.setAttribute(name,value)}else{element[name]=value}}setElementClass(element,value,clear){const s=value;if(s&&typeof s==="object"){if(!s.className){if(clear){let sr="";for(const key in s){if(s.hasOwnProperty(key)){const sv=s[key];if(sv){sr+=sr?" "+key:key}}}element.className=sr;return}for(const key in s){if(s.hasOwnProperty(key)){const sv=s[key];if(sv){if(!element.classList.contains(key)){element.classList.add(key)}}else{if(element.classList.contains(key)){element.classList.remove(key)}}}}return}}const sv1=s?s.className||s.toString():"";element.className=sv1}onUpdateSize(){}removeAllChildren(e){let child=e.firstElementChild;while(child){const c=child;child=child.nextElementSibling;const ac=c;if(ac&&ac.atomControl){ac.atomControl.dispose()}else{this.unbindEvent(child);this.unbind(child)}c.remove()}}createNode(app,e,iterator,creator){const name=iterator.name;const attributes=iterator.attributes;if(typeof name==="string"){const element=document.createElement(name);if(name==="input"){if(!attributes.autocomplete){this.app.callLater((()=>{element.autocomplete="google-stop"}))}}e===null||e===void 0?void 0:e.appendChild(element);this.render(iterator,element,creator);return element}if(name[isAtomControl]){const forName=attributes===null||attributes===void 0?void 0:attributes.for;const ctrl=new name(app,forName?document.createElement(forName):undefined);const element=ctrl.element;e===null||e===void 0?void 0:e.appendChild(element);ctrl.render(iterator,element,creator);return element}throw new Error(`not implemented create for ${iterator.name}`)}toTemplate(app,iterator,creator){var _a;if(iterator.isTemplate){return this.toTemplate(app,iterator.children[0],creator)}const name=iterator.name;if(typeof name==="string"){return class Template extends AtomControl{constructor(a=app,e=document.createElement(name)){super(a,e)}create(){super.create();this.render(iterator,undefined,creator)}}}if(name[isAtomControl]){const forName=(_a=name.attributes)===null||_a===void 0?void 0:_a.for;if(forName){return class Template extends name{constructor(a=app,e=document.createElement(forName)){super(a,e)}create(){super.create();this.render(iterator,undefined,creator)}}}return class Template extends name{constructor(a=app,e){super(a,e)}create(){super.create();this.render(iterator,undefined,creator)}}}throw new Error(`Creating template from ${name} not supported`)}dispatchClickEvent(e,data){let clickEvent=data.clickEvent;if(!clickEvent){return}clickEvent=clickEvent.replace(/-([a-z])/g,(g=>g[1].toUpperCase()));const ce=new CustomEvent(clickEvent,{detail:data,bubbles:true,cancelable:true});e.target.dispatchEvent(ce);if(ce.preventClickEvent){e.preventDefault()}}});__decorate([BindableProperty,__metadata("design:type",XNode)],AtomControl.prototype,"renderer",void 0);getSelection=()=>{const sel=window.getSelection();if(sel.rangeCount){var frag=sel.getRangeAt(0).cloneContents();var el=document.createElement("div");el.appendChild(frag);return el.innerHTML}return""};body=document.body;html=body.parentElement;window.addEventListener("click",(e=>{if(e.defaultPrevented){return}if(getSelection()){return}const originalTarget=e.target;let start=originalTarget;if(originalTarget===html){return}let clickEvent;while(start&&start!==body){clickEvent||(clickEvent=start.getAttribute("data-click-event"));if(start.tagName==="A"){if(!clickEvent){return}if(clickEvent==="route"){const{href}=start;if(href){if(Command.invokeRoute(href,true)){e.preventDefault();e.stopImmediatePropagation();e.stopPropagation()}}}e.preventDefault();e.stopImmediatePropagation();e.stopPropagation();break}start=start.parentNode}let control=AtomControl.from(originalTarget);if(control!==void 0){const data=new Proxy(originalTarget,{get(target,p){if(typeof p!=="string"){return}while(target){const value=target.dataset[p];if(value!==void 0){return value}target=target.parentElement}}});control.dispatchClickEvent(e,data)}}))}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/controls/AtomControl");System.register(["./Register","./ServiceCollection"],(function(_export,_context){"use strict";var Register,Scope;function DISingleton(mockOrInject){return target=>{Register({scope:Scope.Global,mockOrInject})(target)}}_export("default",DISingleton);return{setters:[function(_Register){Register=_Register.Register},function(_ServiceCollection){Scope=_ServiceCollection.Scope}],execute:function(){}}}));AmdLoader.instance.setup("@web-atoms/core/dist/di/DISingleton");System.register([],(function(_export,_context){"use strict";var cloneSource;return{setters:[],execute:function(){cloneSource=Symbol("cloneSource");_export("default",cloneSource)}}}));AmdLoader.instance.setup("@web-atoms/entity/dist/models/cloneSource");System.register(["./cloneSource"],(function(_export,_context){"use strict";var cloneSource,Cloner,PropertyCloner,getKey;_export({Cloner:void 0,PropertyCloner:void 0});return{setters:[function(_cloneSource){cloneSource=_cloneSource.default}],execute:function(){getKey=(target,value)=>{for(const key in target){if(Object.prototype.hasOwnProperty.call(target,key)){const element=target[key];if(element===value){return key}}}};_export("Cloner",Cloner=class Cloner{static copyProperties(src,dest={}){dest[cloneSource]=src;for(const key in src){if(Object.prototype.hasOwnProperty.call(src,key)){const element=src[key];switch(typeof element){case"bigint":case"boolean":case"number":case"string":dest[key]=element;break;case"object":if(element===null){dest[key]=null}if(element instanceof Date){dest[key]=element}break}}}return dest}get copy(){const copy=Cloner.copyProperties(this.item);if(this.path){for(const iterator of this.path){this.clone(this.item,copy,iterator)}}return copy}constructor(item,path){this.item=item;this.path=path;this.$type=item.$type}include(property){const last=[property];return new PropertyCloner(this.item,this.path?[...this.path,last]:[last],last)}clone(src,dest,paths){var _a,_b,_c;if(!paths.length){return dest}const[first,...others]=paths;let p=first(src);if(!p){return dest}const original=p;const name=getKey(src,p);if(Array.isArray(p)){const existing=(_a=dest[name])!==null&&_a!==void 0?_a:dest[name]=[];for(let index=0;index<p.length;index++){const element=p[index];const existingItem=(_b=existing[index])!==null&&_b!==void 0?_b:existing[index]={};Cloner.copyProperties(element,existingItem);this.clone(element,existingItem,others)}return existing}p=Cloner.copyProperties(p,(_c=dest[name])!==null&&_c!==void 0?_c:undefined);dest[name]=p;this.clone(original,p,others);return dest}});_export("PropertyCloner",PropertyCloner=class PropertyCloner extends Cloner{constructor(item,path,propertyPath){super(item,path);this.propertyPath=propertyPath}thenInclude(property){this.propertyPath.push(property);return new PropertyCloner(this.item,this.path,this.propertyPath)}})}}}));AmdLoader.instance.setup("@web-atoms/entity/dist/models/Cloner");System.register([],(function(_export,_context){"use strict";var EntityContext;_export("EntityContext",void 0);return{setters:[],execute:function(){_export("EntityContext",EntityContext=class EntityContext{constructor(models){this.models=models;this.cache=[];for(const iterator of models){this.cache[iterator.name]=iterator}}for(name){return this.cache[name]}})}}}));AmdLoader.instance.setup("@web-atoms/entity/dist/models/IEntityModel");System.register([],(function(_export,_context){"use strict";var JsonError;_export("default",void 0);return{setters:[],execute:function(){_export("default",JsonError=class JsonError extends Error{constructor(message,json){super(message);this.json=json}get errors(){var _a;return(_a=this.json.paramErrors)!==null&&_a!==void 0?_a:[]}get details(){var _a;const{errors}=this;if(errors.length){return errors.map((x=>`${x.name}: ${x.reason}`)).join("\n")}return(_a=this.json)===null||_a===void 0?void 0:_a.details}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/services/http/JsonError");System.register([],(function(_export,_context){"use strict";var Queue;_export("default",void 0);return{setters:[],execute:function(){_export("default",Queue=class Queue{constructor(){this.head=0;this.tail=0;this.store=new Map}peek(){return this.store.get(this.head)}enqueue(item){this.store.set(this.tail,item);this.tail++}dequeue(){const{head,tail}=this;const size=tail-head;if(size<=0){return void 0}const item=this.store.get(head);this.store.delete(head);this.head++;if(this.head===this.tail){this.head=0;this.tail=0}return item}})}}}));AmdLoader.instance.setup("@web-atoms/entity/dist/models/Queue");System.register(["./Queue"],(function(_export,_context){"use strict";var Queue,TaskManager;_export("default",void 0);return{setters:[function(_Queue){Queue=_Queue.default}],execute:function(){_export("default",TaskManager=class TaskManager{constructor(){this.rateLimit=10;this.running=new Set;this.waiting=new Queue}run(fx){const pr=new Promise(((resolve,reject)=>{this.waiting.enqueue({resolve,reject,fx})}));pr.catch((error=>console.error(error)));this.processQueue();return pr}processQueue(){for(;;){if(this.running.size>=this.rateLimit){return}const t=this.waiting.dequeue();if(!t){return}const{fx,resolve,reject}=t;this.running.add(fx);fx().then((r=>{this.running.delete(fx);setTimeout((()=>this.processQueue()),1);resolve(r)}),(e=>{this.running.delete(fx);setTimeout((()=>this.processQueue()),1);reject(e)}))}}})}}}));AmdLoader.instance.setup("@web-atoms/entity/dist/models/TaskManager");System.register(["tslib","@web-atoms/core/dist/services/http/JsonError","../models/TaskManager"],(function(_export,_context){"use strict";var __awaiter,JsonError,TaskManager,TextBody,HttpSession;function merge(url,extra){return url+(typeof extra==="string"?extra:combine(extra))}function combine([url,params]){let separator=url.indexOf("?")===-1?"?":"&";if(!url.endsWith("&")){url+=separator;separator=""}for(const key in params){if(params.hasOwnProperty(key)){const element=params[key];url+=separator;separator="&";url+=`${key}=${encodeURIComponent(element)}`}}return url}_export({merge,combine,TextBody:void 0,default:void 0});return{setters:[function(_tslib){__awaiter=_tslib.__awaiter},function(_webAtomsCoreDistServicesHttpJsonError){JsonError=_webAtomsCoreDistServicesHttpJsonError.default},function(_modelsTaskManager){TaskManager=_modelsTaskManager.default}],execute:function(){_export("TextBody",TextBody=class TextBody{constructor(text){this.text=text}toString(){return this.text}});_export("default",HttpSession=class HttpSession extends TaskManager{constructor(){super(...arguments);this.rateLimit=10;this.resultConverter=e=>e}fetchJson(options){return this.run((()=>this.uncheckedFetchJson(options)))}uncheckedFetchJson(options){var _a,_b,_c,_d,_e,_f;return __awaiter(this,void 0,void 0,(function*(){if(options.cancelToken){const ab=new AbortController;options.signal=ab.signal;options.cancelToken.registerForCancel((()=>{ab.abort()}))}let response;if(this.interceptFetch){response=yield this.interceptFetch(options.url,options)}else{response=yield fetch(options.url,options)}const contentType=(_a=response.headers.get("Content-Type"))===null||_a===void 0?void 0:_a.toString();if(response.status>=400){if(contentType===null||contentType===void 0?void 0:contentType.includes("/json")){const error=yield response.json();throw new JsonError(typeof response==="string"?response:(_f=(_e=(_d=(_c=(_b=error.title)!==null&&_b!==void 0?_b:error.detail)!==null&&_c!==void 0?_c:error.message)!==null&&_d!==void 0?_d:error.exceptionMessage)!==null&&_e!==void 0?_e:error)!==null&&_f!==void 0?_f:"Json Server Error",error)}throw new Error(yield response.text())}if(contentType&&!contentType.includes("/json")){throw new Error(`Unable to convert to json\r\n${contentType}}`)}return this.resultConverter(yield response.json())}))}interceptFetch(input,init){throw new Error("not supported")}getJson(options){options.method="GET";return this.fetchJson(options)}postFormModel(options){var _a;options.method="POST";if(options.body){options.body=new TextBody(`formModel=${encodeURIComponent(JSON.stringify(options.body))}`)}(_a=options.headers)!==null&&_a!==void 0?_a:options.headers={};options.headers["content-type"]="application/x-www-form-urlencoded";return this.fetchJson(options)}postJson(options){var _a;options.method="POST";if(options.body){options.body=JSON.stringify(options.body)}(_a=options.headers)!==null&&_a!==void 0?_a:options.headers={};options.headers["content-type"]="application/json";return this.fetchJson(options)}deleteJson(options){var _a;options.method="DELETE";if(options.body){options.body=JSON.stringify(options.body)}(_a=options.headers)!==null&&_a!==void 0?_a:options.headers={};options.headers["content-type"]="application/json";return this.fetchJson(options)}putJson(options){var _a;options.method="PUT";if(options.body){options.body=JSON.stringify(options.body)}(_a=options.headers)!==null&&_a!==void 0?_a:options.headers={};options.headers["content-type"]="application/json";return this.fetchJson(options)}});delete HttpSession.prototype.interceptFetch}}}));AmdLoader.instance.setup("@web-atoms/entity/dist/services/HttpSession");System.register(["../models/cloneSource"],(function(_export,_context){"use strict";var cloneSource,isObject;function mergeProperties(src,target,path="0",visited=new Map,merged=new Map){if(visited.has(path)){return}if(merged.has(target)){return}merged.set(target,true);visited.set(path,true);if(Array.isArray(src)){for(let index=0;index<src.length;index++){const srcElement=src[index];const targetElement=target[index];if(isObject(targetElement)){mergeProperties(srcElement,targetElement,`${path}.${index}`,visited,merged);continue}target[index]=targetElement}return}const cloneTarget=target[cloneSource];for(const key in src){if(Object.prototype.hasOwnProperty.call(src,key)){const srcElement=src[key];if(typeof srcElement!=="object"){if(srcElement!==void 0){target[key]=srcElement;if(cloneTarget){cloneTarget[key]=srcElement}}continue}if(srcElement instanceof Date){target[key]=srcElement;if(cloneTarget){cloneTarget[key]=srcElement}continue}const targetElement=target[key];if(isObject(targetElement)){if(cloneTarget){const cloneTargetElement=cloneTarget[key];if(cloneTargetElement){mergeProperties(srcElement,cloneTargetElement,path+".$"+key,visited,merged)}}mergeProperties(srcElement,targetElement,path+"."+key,visited,merged);continue}if(targetElement===void 0&&srcElement){target[key]=srcElement;continue}target[key]=targetElement;if(cloneTarget&&targetElement!==void 0){cloneTarget[key]=targetElement}}}}_export("default",mergeProperties);return{setters:[function(_modelsCloneSource){cloneSource=_modelsCloneSource.default}],execute:function(){isObject=o=>typeof o==="object"&&o!==null&&!(o instanceof Date)}}}));AmdLoader.instance.setup("@web-atoms/entity/dist/services/mergeProperties");System.register([],(function(_export,_context){"use strict";var StringHelper;_export("default",void 0);return{setters:[],execute:function(){_export("default",StringHelper=class StringHelper{static findParameter(f){let text=f.toString();let i=text.indexOf("=>");if(i!==-1){text=text.substring(0,i)}i=text.indexOf("(");if(i===-1){return text}text=text.substring(i+1);i=text.indexOf(")");return text.substring(0,i)}static contains(left,right){if(!left){return!right}return left.toLowerCase().includes(right.toLowerCase())}})}}}));AmdLoader.instance.setup("@web-atoms/entity/dist/services/StringHelper");System.register(["tslib","./StringHelper"],(function(_export,_context){"use strict";var __awaiter,StringHelper,QueryComposer,Query,replacer,convertToLinq;function append(original,...item){if(original){return[...original,...item]}return[...item]}_export({append,QueryComposer:void 0,default:void 0});return{setters:[function(_tslib){__awaiter=_tslib.__awaiter},function(_StringHelper){StringHelper=_StringHelper.default}],execute:function(){replacer=/(===)|(!==)|(\(\s*\{)|(\.[a-zA-Z0-9]+)|([a-zA-Z0-9]+\s*\:\s*\{?)/g;_export("convertToLinq",convertToLinq=x=>{x=x.replace(/(\s+)|((CastAs|EF)\_[0-9]\.default\.)/g,((s,first,second)=>{if(s===first){return" "}if(s.startsWith("EF")){return"EF."}if(s.startsWith("CastAs")){return"CastAs."}return s}));replacer.lastIndex=0;x=x.replace(replacer,(s=>{switch(s){case"===":return"==";case"!==":return"!=";case"({":return"( new {";case".some":return".Any";case".map":return".Select";case".filter":return".Where";case".find":return".FirstOrDefault";case".includes":return".Contains"}if(s.endsWith("{")){const index=s.indexOf(":");const v=s.substring(0,index)+" = new {";return v}const trimmed=s.trim();if(trimmed.endsWith(":")){return trimmed.substring(0,trimmed.length-1)+" = "}if(s.startsWith(".")&&s.length>2){return s[0]+s[1].toUpperCase()+s.substring(2)}return s}));return x});_export("QueryComposer",QueryComposer=class QueryComposer{constructor(separator=" || "){this.separator=separator;this.query="p => x => ";this.parameters={};this.index=0}add(p,q){if(this.index){this.query+=this.separator}const suffix=`_${this.index++}`;let text=q.toString();const pfn=StringHelper.findParameter(text).trim();text=text.substring(text.indexOf("=>")+2);const xfn=StringHelper.findParameter(text).trim();const target=this.parameters;for(const key in p){if(Object.prototype.hasOwnProperty.call(p,key)){const element=p[key];const name=`${key}${suffix}`;target[name]=element;text=text.split(`${pfn}.${key}`).join(`p.${name}`);text=text.split(`${xfn}.`).join(`x.`)}}text=text.substring(text.indexOf("=>")+2);this.query+=text}asQuery(){return[this.parameters,this.query]}});_export("default",Query=class Query{constructor(context,methods=[]){this.context=context;this.methods=methods;if(!methods){throw new Error("Methods cannot be empty")}}where(tOrP,q){return this.process("where",tOrP,q)}joinDateRange(start,end,step){return this.append(["joinDateRange","@0,@1,@2",start,end,step])}selectWith(model,tOrP,q){const nq=this.append(["selectWith",model.name]);return nq.process("select",tOrP,q)}select(tOrP,q){return this.process("select",tOrP,q)}whereLinq(query,...args){let filters="";const params=[];for(let index=0;index<args.length;index++){const element=args[index];const raw=query.raw[index];if(raw){filters+=raw}const pi=`@${index}`;filters+=pi;params.push(element)}const last=query.raw[args.length];if(last){filters+=last}return this.append(["where",filters,...params])}selectLinq(query,...args){let filters="";const params=[];for(let index=0;index<args.length;index++){const element=args[index];const raw=query.raw[index];if(raw){filters+=raw}const pi=`@${index}`;filters+=pi;params.push(element)}const last=query.raw[args.length];if(last){filters+=last}return this.append(["select",filters,...params])}join(model,left,right){return this.append(["join",model.name,this.convertToLinq(left.toString()),this.convertToLinq(right.toString())])}leftJoin(model,left,right){return this.append(["leftJoin",model.name,this.convertToLinq(left.toString()),this.convertToLinq(right.toString())])}include(tOrP,...q){if(typeof tOrP==="string"){return this.append(["include",tOrP],...q.map((s=>["include",s])))}const select=this.convertToLinq(tOrP.toString());return this.append(["include",select])}firstOrDefault(p={}){return __awaiter(this,void 0,void 0,(function*(){const lp=p;lp.size=1;lp.start=0;lp.count=false;const list=yield this.toPagedList(lp);return list.items[0]}))}orderBy(tOrP,q){return this.process("orderBy",tOrP,q)}orderByDescending(tOrP,q){return this.process("orderByDescending",tOrP,q)}thenBy(tOrP,q){return this.process("thenBy",tOrP,q)}thenByDescending(tOrP,q){return this.process("thenByDescending",tOrP,q)}trace(){this.context.traceQuery=true;return this}toArray({cancelToken,doNotResolve,hideActivityIndicator,cacheSeconds,cacheVersion}={}){return __awaiter(this,void 0,void 0,(function*(){const r=yield this.toPagedList({size:-1,count:false,cacheSeconds,cancelToken,doNotResolve,hideActivityIndicator,cacheVersion});return r.items}))}toPagedList({start=0,size=100,cancelToken,cacheVersion="1",hideActivityIndicator,splitInclude=false,cacheSeconds=0,cacheImmutable=cacheSeconds>0,count=true}={}){let url;const{traceQuery,name,service,queryFunction,args}=this.context;const trace=traceQuery;const methods=JSON.stringify(this.methods);const fm=new URLSearchParams;fm.append("methods",methods);if(start){fm.append("start",start.toString())}if(size){fm.append("size",size.toString())}fm.append("count",count.toString());if(trace){fm.append("trace",trace?"true":"false")}if(queryFunction){fm.append("function",queryFunction);fm.append("args",JSON.stringify(args!==null&&args!==void 0?args:"[]"))}const encodedMethods=fm.toString();if(encodedMethods.length>1824){if(cacheSeconds>0){throw new Error("Generated query too big for caching")}url=`${service.url}methods/${name}`;return service.postJson({url,cancelToken,body:{methods:this.methods,start,size,split:splitInclude,count,trace,function:queryFunction||void 0,args:queryFunction?args:void 0}})}if(cacheSeconds>0){fm.append("cache",cacheSeconds.toString());fm.append("cv",cacheVersion);if(!cacheImmutable){fm.append("cacheImmutable","false")}}else{}url=`${service.url}query/${name}?${fm.toString()}`;return service.getJson({url,cancelToken,hideActivityIndicator})}thenInclude(a){const select=this.convertToLinq(a.toString());return this.append(["thenInclude",select])}append(...methods){return new Query(this.context,[...this.methods,...methods])}process(name,tOrP,q){if(!q){const select=this.convertToLinq(tOrP.toString());return this.append([name,select])}const pl=[];let i=0;const p=tOrP;let text=q(p).toString();const pfn=StringHelper.findParameter(q.toString()).trim();for(const key in p){if(Object.prototype.hasOwnProperty.call(p,key)){const element=p[key];const pn=`@${i++}`;text=text.split(`${pfn}.${key}`).join(pn);pl.push(element)}}text=this.convertToLinq(text);return this.append([name,text,...pl])}convertToLinq(text){if(this.context.queryProcessor==="DotNet"){return convertToLinq(text)}return text.replace(/\s+/g," ")}})}}}));AmdLoader.instance.setup("@web-atoms/entity/dist/services/Query");System.register(["@web-atoms/date-time/dist/DateTime"],(function(_export,_context){"use strict";var DateTime,dateFormatISORegEx;function resolve(target){const cache=[];function map(t){if(typeof t!=="object"){return t}if(Array.isArray(t)){return t.map(map)}const{$id,$ref}=t;if($ref){t=cache[$ref];return t}if($id){t.$deleted=false;cache[$id]=t}for(const key in t){if(Object.prototype.hasOwnProperty.call(t,key)){let element=t[key];switch(typeof element){case"object":if(!element){continue}element=map(element);t[key]=element;continue;case"string":if(dateFormatISORegEx.test(element)){t[key]=new DateTime(element)}}}}return t}target=map(target);return target}_export("default",resolve);return{setters:[function(_webAtomsDateTimeDistDateTime){DateTime=_webAtomsDateTimeDistDateTime.default}],execute:function(){_export("dateFormatISORegEx",dateFormatISORegEx=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/)}}}));AmdLoader.instance.setup("@web-atoms/entity/dist/services/resolve");System.register(["tslib","../models/Cloner","../models/IEntityModel","./HttpSession","./mergeProperties","./Query","./resolve"],(function(_export,_context){"use strict";var __awaiter,Cloner,EntityContext,HttpSession,mergeProperties,Query,resolve,DefaultFactory,Model,BaseEntityService,ArrayPrototype;_export({DefaultFactory:void 0,Model:void 0,default:void 0});return{setters:[function(_tslib){__awaiter=_tslib.__awaiter},function(_modelsCloner){Cloner=_modelsCloner.Cloner},function(_modelsIEntityModel){EntityContext=_modelsIEntityModel.EntityContext},function(_HttpSession){HttpSession=_HttpSession.default},function(_mergeProperties){mergeProperties=_mergeProperties.default},function(_Query){Query=_Query.default},function(_resolve){resolve=_resolve.default}],execute:function(){ArrayPrototype=Array.prototype;ArrayPrototype.where=ArrayPrototype.filter;ArrayPrototype.any=ArrayPrototype.some;ArrayPrototype.select=ArrayPrototype.map;ArrayPrototype.selectMany=function(x){const r=[];for(const iterator of this){const items=x(iterator);if(Array.isArray(items)){r.push(...items)}}return r};ArrayPrototype.firstOrDefault=function(f){if(f){return ArrayPrototype.find.apply(this,arguments)}return this[0]};ArrayPrototype.sum=function(f){var _a;let n=0;for(const iterator of this){n+=(_a=f(iterator))!==null&&_a!==void 0?_a:0}return n};ArrayPrototype.average=function(f){var _a;if(this.length===0){return 0}let n=0;for(const iterator of this){n+=(_a=f(iterator))!==null&&_a!==void 0?_a:0}return n/this.length};ArrayPrototype.orderBy=function(f){return this.sort(((a,b)=>{const ak=f(a);const bk=f(b);if(typeof ak==="string"){return ak.toLowerCase().localeCompare(bk.toLowerCase())}return ak-bk}))};ArrayPrototype.thenBy=ArrayPrototype.orderBy;ArrayPrototype.orderByDescending=function(f){return this.sort(((a,b)=>{const ak=f(a);const bk=f(b);if(typeof ak==="string"){return bk.toLowerCase().localeCompare(ak.toLowerCase())}return bk-ak}))};ArrayPrototype.thenByDescending=ArrayPrototype.orderByDescending;ArrayPrototype.count=function(f){if(!f){return this.length}let length=0;for(const iterator of this){if(f(iterator)){length++}}return length};_export("DefaultFactory",DefaultFactory=class DefaultFactory{constructor(factory){this.factory=factory}});_export("Model",Model=class Model{constructor(name,keys=[],defaults=null,schema=null){this.name=name;this.keys=keys;this.schema=schema;if(defaults){this.defaults=[];for(const key in defaults){if(Object.prototype.hasOwnProperty.call(defaults,key)){const element=defaults[key];this.defaults.push([key,element])}}}}create(properties={}){properties.$type=this.name;if(this.defaults){for(const[key,value]of this.defaults){if(properties[key]===void 0){if(value instanceof DefaultFactory){properties[key]=value.factory()}else{properties[key]=value}}}}return properties}patch(original,updates){for(const iterator of this.keys){const originalKey=original[iterator];const updatedKey=updates[iterator];if(updatedKey&&updatedKey!==originalKey){throw new Error(`Cannot update ${iterator} as it is the primary key`)}updates[iterator]=originalKey}return Object.assign({$type:this.name},updates)}});_export("default",BaseEntityService=class BaseEntityService extends HttpSession{constructor(){super(...arguments);this.url="/api/entity/";this.resultConverter=resolve}cloner(item){return new Cloner(item)}model(){return __awaiter(this,void 0,void 0,(function*(){if(this.entityModel){return this.entityModel}const c=yield this.getJson({url:`${this.url}model`});this.entityModel=new EntityContext(c);return this.entityModel}))}dateRange(start,end,step){return new Query({service:this,name:"NeuroSpeech.EntityAccessControl.DateRange",traceQuery:false},[["dateRange","@0,@1,@2",start,end,step]])}query(m,queryFunction,...args){return new Query({service:this,name:m.name,queryProcessor:this.queryProcessor,queryFunction,args})}delete(body){const url=this.url;return this.deleteJson({url,body})}insert(body){const url=this.url;return this.putJson({url,body})}invoke(m,method,argEntity,...args){const entity={$type:m.name};for(const key of m.schema.keys){entity[key.name]=argEntity[key.name]}return this.postJson({url:`${this.url}invoke/${entity.$type}/${method}`,method:"POST",body:{entity,args}})}save(body,cloner,trace){return __awaiter(this,void 0,void 0,(function*(){if(Array.isArray(body)&&body.length===0){return body}let url=this.url;if(body instanceof Cloner){body=body.copy}if(trace){const hasQuery=url.includes("?");if(hasQuery){url=url+="&trace=true"}else{url=url+="?trace=true"}}if(cloner){if(Array.isArray(body)){body=body.map((x=>cloner(new Cloner(x)).copy))}else{const c=cloner(new Cloner(body));body=c.copy}}const result=yield this.postJson({url,body});mergeProperties(result,body);return body}))}update(e,update){return __awaiter(this,void 0,void 0,(function*(){yield this.bulkUpdate([e],update);for(const key in update){if(Object.prototype.hasOwnProperty.call(update,key)){const element=update[key];e[key]=element}}return e}))}bulkUpdate(entities,update,throwWhenNotFound=false){return __awaiter(this,void 0,void 0,(function*(){const model=yield this.model();const keys=[];for(const iterator of entities){const entityType=model.for(iterator.$type);const key={$type:iterator.$type};for(const{name}of entityType.keys){key[name]=iterator[name]}keys.push(key)}const body={keys,update,throwWhenNotFound};const url=`${this.url}bulk`;yield this.putJson({url,body})}))}bulkDelete(entities,throwWhenNotFound=false){return __awaiter(this,void 0,void 0,(function*(){const model=yield this.model();const keys=[];for(const iterator of entities){const entityType=model.for(iterator.$type);const key={$type:iterator.$type};for(const{name}of entityType.keys){key[name]=iterator[name]}keys.push(key)}const url=`${this.url}bulk`;const body={keys,throwWhenNotFound};yield this.deleteJson({url,body})}))}fetchJson(options){const _super=Object.create(null,{fetchJson:{get:()=>super.fetchJson}});return __awaiter(this,void 0,void 0,(function*(){if(!this.createBusyIndicator||(options===null||options===void 0?void 0:options.hideActivityIndicator)){return yield _super.fetchJson.call(this,options)}const disposable=this.createBusyIndicator(options);try{return yield _super.fetchJson.call(this,options)}finally{disposable===null||disposable===void 0?void 0:disposable.dispose()}}))}createBusyIndicator(options){return{dispose(){}}}});delete BaseEntityService.prototype.createBusyIndicator}}}));AmdLoader.instance.setup("@web-atoms/entity/dist/services/BaseEntityService");System.register([],(function(_export,_context){"use strict";var StyleFragment,id,nextId,globalLow,global,globalHigh,localLow,local,localHigh,styles,styled,svgAsCssDataUrl;function*divide(text){const regex=/^(([^\{\n]+\{[\t\x20]*)|([^\n\}]*\}[^\S\n\r]*))$/gm;let m;let sentOnce=false;let lastIndex=0;let lastMatch;while((m=regex.exec(text))!==null){if(m.index===regex.lastIndex){regex.lastIndex++}const match=m[0];if(!sentOnce){sentOnce=true;yield text.substring(lastIndex,m.index);lastIndex=m.index+match.length;lastMatch=match;continue}if(lastMatch.includes("}")){yield[lastMatch.trim()];lastIndex=m.index+match.length;lastMatch=match;continue}yield[lastMatch,text.substring(lastIndex,m.index),match];lastIndex=m.index+match.length;lastMatch=match}if(lastMatch===null||lastMatch===void 0?void 0:lastMatch.includes("}")){yield[lastMatch.trim()]}}return{setters:[],execute:function(){id=1;nextId=()=>`styled-r${id++}`;globalLow=document.createElement("meta");globalLow.name="global-low-style";document.head.appendChild(globalLow);global=document.createElement("meta");global.name="global-style";document.head.appendChild(global);globalHigh=document.createElement("meta");globalHigh.name="global-high-style";document.head.appendChild(globalHigh);localLow=document.createElement("meta");localLow.name="local-low-style";document.head.appendChild(localLow);local=document.createElement("meta");local.name="local-style";document.head.appendChild(local);localHigh=document.createElement("meta");localHigh.name="local-high-style";document.head.appendChild(localHigh);StyleFragment=class StyleFragment{static newStyle({selector="",content=""}){return new StyleFragment({selector,content})}constructor({selector,content}){this.order="low";this.selector=selector;this.content=content}expand(selector){selector!==null&&selector!==void 0?selector:selector=this.selector;let en=divide(this.content);let parts=en.next();if(parts.done){if(!this.content){return""}return`${selector} {\n${this.content}\n}`}const first=parts.value;let content=(first===null||first===void 0?void 0:first.trim())?`${selector} {\n${first}\n}\n`:"";let selectorStack=[];while(!(parts=en.next()).done){const[key,value]=parts.value;if(key.endsWith("}")){selector=selectorStack.pop();if(selector==="@"){content+="\n}\n";selector=selectorStack.pop()}continue}let keySelector=key.replace("{","");const isMedia=/\@/.test(keySelector);const replace=!isMedia;const replaced=replace?selector.split(",").map((x=>keySelector.replace(/\&/g,x).trim())).join(","):keySelector;selectorStack.push(selector);selector=replace?replaced:selector;if(isMedia){selectorStack.push("@")}if(value===null||value===void 0?void 0:value.trim()){content+=`${replaced} {\n${value}\n}\n`}else{if(isMedia){content+=`${replaced} {\n`}}}return content}toString(){return this.content.replace(/\\n/g,"")}installGlobal(selector="",id=this.id||selector,description){const style=document.createElement("style");style.textContent=this.expand(selector);if(description){style.setAttribute("data-desc",description)}switch(this.order){case"low":document.head.insertBefore(style,globalLow);break;case"default":case"medium":document.head.insertBefore(style,global);break;case"high":document.head.insertBefore(style,globalHigh);break}style.id=id}installLocal(prefix="",description=this.description){const selector=nextId();const style=document.createElement("style");const id=`${prefix}.${selector}`;style.id=id;style.textContent=this.expand(id);if(description){style.setAttribute("data-desc",description)}switch(this.order){case"low":document.head.insertBefore(style,localLow);break;case"default":case"medium":document.head.insertBefore(style,local);break;case"high":document.head.insertBefore(style,localHigh);break}return selector}withId(id){this.id=id;return this}withDescription(description){this.description=description;return this}withOrder(order){this.order=order;return this}};styles=[];styled={get styles(){return styles},css:(t,...a)=>{let r="";for(let index=0;index<t.length;index++){const element=t[index];r+=element;if(index<a.length){r+=a[index]}}return StyleFragment.newStyle({content:r})},add(x){styles.push(x)}};_export("default",styled);_export("svgAsCssDataUrl",svgAsCssDataUrl=text=>`url(${JSON.stringify(`data:image/svg+xml,${text}`)})`)}}}));AmdLoader.instance.setup("@web-atoms/core/dist/style/styled");System.register(["@web-atoms/core/dist/style/styled"],(function(_export,_context){"use strict";var styled,BusyProgress,css,container,stack;_export("default",void 0);return{setters:[function(_webAtomsCoreDistStyleStyled){styled=_webAtomsCoreDistStyleStyled.default}],execute:function(){css=styled.css`
15
+ ***************************************************************************** */var Reflect;(function(Reflect){(function(factory){var root=typeof global==="object"?global:typeof self==="object"?self:typeof this==="object"?this:Function("return this;")();var exporter=makeExporter(Reflect);if(typeof root.Reflect==="undefined"){root.Reflect=Reflect}else{exporter=makeExporter(root.Reflect,exporter)}factory(exporter);function makeExporter(target,previous){return function(key,value){if(typeof target[key]!=="function"){Object.defineProperty(target,key,{configurable:true,writable:true,value})}if(previous)previous(key,value)}}})((function(exporter){var hasOwn=Object.prototype.hasOwnProperty;var supportsSymbol=typeof Symbol==="function";var toPrimitiveSymbol=supportsSymbol&&typeof Symbol.toPrimitive!=="undefined"?Symbol.toPrimitive:"@@toPrimitive";var iteratorSymbol=supportsSymbol&&typeof Symbol.iterator!=="undefined"?Symbol.iterator:"@@iterator";var supportsCreate=typeof Object.create==="function";var supportsProto={__proto__:[]}instanceof Array;var downLevel=!supportsCreate&&!supportsProto;var HashMap={create:supportsCreate?function(){return MakeDictionary(Object.create(null))}:supportsProto?function(){return MakeDictionary({__proto__:null})}:function(){return MakeDictionary({})},has:downLevel?function(map,key){return hasOwn.call(map,key)}:function(map,key){return key in map},get:downLevel?function(map,key){return hasOwn.call(map,key)?map[key]:undefined}:function(map,key){return map[key]}};var functionPrototype=Object.getPrototypeOf(Function);var usePolyfill=typeof process==="object"&&process["env"+""]&&process["env"+""]["REFLECT_METADATA_USE_MAP_POLYFILL"]==="true";var _Map=!usePolyfill&&typeof Map==="function"&&typeof Map.prototype.entries==="function"?Map:CreateMapPolyfill();var _Set=!usePolyfill&&typeof Set==="function"&&typeof Set.prototype.entries==="function"?Set:CreateSetPolyfill();var _WeakMap=!usePolyfill&&typeof WeakMap==="function"?WeakMap:CreateWeakMapPolyfill();var Metadata=new _WeakMap;function decorate(decorators,target,propertyKey,attributes){if(!IsUndefined(propertyKey)){if(!IsArray(decorators))throw new TypeError;if(!IsObject(target))throw new TypeError;if(!IsObject(attributes)&&!IsUndefined(attributes)&&!IsNull(attributes))throw new TypeError;if(IsNull(attributes))attributes=undefined;propertyKey=ToPropertyKey(propertyKey);return DecorateProperty(decorators,target,propertyKey,attributes)}else{if(!IsArray(decorators))throw new TypeError;if(!IsConstructor(target))throw new TypeError;return DecorateConstructor(decorators,target)}}exporter("decorate",decorate);function metadata(metadataKey,metadataValue){function decorator(target,propertyKey){if(!IsObject(target))throw new TypeError;if(!IsUndefined(propertyKey)&&!IsPropertyKey(propertyKey))throw new TypeError;OrdinaryDefineOwnMetadata(metadataKey,metadataValue,target,propertyKey)}return decorator}exporter("metadata",metadata);function defineMetadata(metadataKey,metadataValue,target,propertyKey){if(!IsObject(target))throw new TypeError;if(!IsUndefined(propertyKey))propertyKey=ToPropertyKey(propertyKey);return OrdinaryDefineOwnMetadata(metadataKey,metadataValue,target,propertyKey)}exporter("defineMetadata",defineMetadata);function hasMetadata(metadataKey,target,propertyKey){if(!IsObject(target))throw new TypeError;if(!IsUndefined(propertyKey))propertyKey=ToPropertyKey(propertyKey);return OrdinaryHasMetadata(metadataKey,target,propertyKey)}exporter("hasMetadata",hasMetadata);function hasOwnMetadata(metadataKey,target,propertyKey){if(!IsObject(target))throw new TypeError;if(!IsUndefined(propertyKey))propertyKey=ToPropertyKey(propertyKey);return OrdinaryHasOwnMetadata(metadataKey,target,propertyKey)}exporter("hasOwnMetadata",hasOwnMetadata);function getMetadata(metadataKey,target,propertyKey){if(!IsObject(target))throw new TypeError;if(!IsUndefined(propertyKey))propertyKey=ToPropertyKey(propertyKey);return OrdinaryGetMetadata(metadataKey,target,propertyKey)}exporter("getMetadata",getMetadata);function getOwnMetadata(metadataKey,target,propertyKey){if(!IsObject(target))throw new TypeError;if(!IsUndefined(propertyKey))propertyKey=ToPropertyKey(propertyKey);return OrdinaryGetOwnMetadata(metadataKey,target,propertyKey)}exporter("getOwnMetadata",getOwnMetadata);function getMetadataKeys(target,propertyKey){if(!IsObject(target))throw new TypeError;if(!IsUndefined(propertyKey))propertyKey=ToPropertyKey(propertyKey);return OrdinaryMetadataKeys(target,propertyKey)}exporter("getMetadataKeys",getMetadataKeys);function getOwnMetadataKeys(target,propertyKey){if(!IsObject(target))throw new TypeError;if(!IsUndefined(propertyKey))propertyKey=ToPropertyKey(propertyKey);return OrdinaryOwnMetadataKeys(target,propertyKey)}exporter("getOwnMetadataKeys",getOwnMetadataKeys);function deleteMetadata(metadataKey,target,propertyKey){if(!IsObject(target))throw new TypeError;if(!IsUndefined(propertyKey))propertyKey=ToPropertyKey(propertyKey);var metadataMap=GetOrCreateMetadataMap(target,propertyKey,false);if(IsUndefined(metadataMap))return false;if(!metadataMap.delete(metadataKey))return false;if(metadataMap.size>0)return true;var targetMetadata=Metadata.get(target);targetMetadata.delete(propertyKey);if(targetMetadata.size>0)return true;Metadata.delete(target);return true}exporter("deleteMetadata",deleteMetadata);function DecorateConstructor(decorators,target){for(var i=decorators.length-1;i>=0;--i){var decorator=decorators[i];var decorated=decorator(target);if(!IsUndefined(decorated)&&!IsNull(decorated)){if(!IsConstructor(decorated))throw new TypeError;target=decorated}}return target}function DecorateProperty(decorators,target,propertyKey,descriptor){for(var i=decorators.length-1;i>=0;--i){var decorator=decorators[i];var decorated=decorator(target,propertyKey,descriptor);if(!IsUndefined(decorated)&&!IsNull(decorated)){if(!IsObject(decorated))throw new TypeError;descriptor=decorated}}return descriptor}function GetOrCreateMetadataMap(O,P,Create){var targetMetadata=Metadata.get(O);if(IsUndefined(targetMetadata)){if(!Create)return undefined;targetMetadata=new _Map;Metadata.set(O,targetMetadata)}var metadataMap=targetMetadata.get(P);if(IsUndefined(metadataMap)){if(!Create)return undefined;metadataMap=new _Map;targetMetadata.set(P,metadataMap)}return metadataMap}function OrdinaryHasMetadata(MetadataKey,O,P){var hasOwn=OrdinaryHasOwnMetadata(MetadataKey,O,P);if(hasOwn)return true;var parent=OrdinaryGetPrototypeOf(O);if(!IsNull(parent))return OrdinaryHasMetadata(MetadataKey,parent,P);return false}function OrdinaryHasOwnMetadata(MetadataKey,O,P){var metadataMap=GetOrCreateMetadataMap(O,P,false);if(IsUndefined(metadataMap))return false;return ToBoolean(metadataMap.has(MetadataKey))}function OrdinaryGetMetadata(MetadataKey,O,P){var hasOwn=OrdinaryHasOwnMetadata(MetadataKey,O,P);if(hasOwn)return OrdinaryGetOwnMetadata(MetadataKey,O,P);var parent=OrdinaryGetPrototypeOf(O);if(!IsNull(parent))return OrdinaryGetMetadata(MetadataKey,parent,P);return undefined}function OrdinaryGetOwnMetadata(MetadataKey,O,P){var metadataMap=GetOrCreateMetadataMap(O,P,false);if(IsUndefined(metadataMap))return undefined;return metadataMap.get(MetadataKey)}function OrdinaryDefineOwnMetadata(MetadataKey,MetadataValue,O,P){var metadataMap=GetOrCreateMetadataMap(O,P,true);metadataMap.set(MetadataKey,MetadataValue)}function OrdinaryMetadataKeys(O,P){var ownKeys=OrdinaryOwnMetadataKeys(O,P);var parent=OrdinaryGetPrototypeOf(O);if(parent===null)return ownKeys;var parentKeys=OrdinaryMetadataKeys(parent,P);if(parentKeys.length<=0)return ownKeys;if(ownKeys.length<=0)return parentKeys;var set=new _Set;var keys=[];for(var _i=0,ownKeys_1=ownKeys;_i<ownKeys_1.length;_i++){var key=ownKeys_1[_i];var hasKey=set.has(key);if(!hasKey){set.add(key);keys.push(key)}}for(var _a=0,parentKeys_1=parentKeys;_a<parentKeys_1.length;_a++){var key=parentKeys_1[_a];var hasKey=set.has(key);if(!hasKey){set.add(key);keys.push(key)}}return keys}function OrdinaryOwnMetadataKeys(O,P){var keys=[];var metadataMap=GetOrCreateMetadataMap(O,P,false);if(IsUndefined(metadataMap))return keys;var keysObj=metadataMap.keys();var iterator=GetIterator(keysObj);var k=0;while(true){var next=IteratorStep(iterator);if(!next){keys.length=k;return keys}var nextValue=IteratorValue(next);try{keys[k]=nextValue}catch(e){try{IteratorClose(iterator)}finally{throw e}}k++}}function Type(x){if(x===null)return 1;switch(typeof x){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return x===null?1:6;default:return 6}}function IsUndefined(x){return x===undefined}function IsNull(x){return x===null}function IsSymbol(x){return typeof x==="symbol"}function IsObject(x){return typeof x==="object"?x!==null:typeof x==="function"}function ToPrimitive(input,PreferredType){switch(Type(input)){case 0:return input;case 1:return input;case 2:return input;case 3:return input;case 4:return input;case 5:return input}var hint=PreferredType===3?"string":PreferredType===5?"number":"default";var exoticToPrim=GetMethod(input,toPrimitiveSymbol);if(exoticToPrim!==undefined){var result=exoticToPrim.call(input,hint);if(IsObject(result))throw new TypeError;return result}return OrdinaryToPrimitive(input,hint==="default"?"number":hint)}function OrdinaryToPrimitive(O,hint){if(hint==="string"){var toString_1=O.toString;if(IsCallable(toString_1)){var result=toString_1.call(O);if(!IsObject(result))return result}var valueOf=O.valueOf;if(IsCallable(valueOf)){var result=valueOf.call(O);if(!IsObject(result))return result}}else{var valueOf=O.valueOf;if(IsCallable(valueOf)){var result=valueOf.call(O);if(!IsObject(result))return result}var toString_2=O.toString;if(IsCallable(toString_2)){var result=toString_2.call(O);if(!IsObject(result))return result}}throw new TypeError}function ToBoolean(argument){return!!argument}function ToString(argument){return""+argument}function ToPropertyKey(argument){var key=ToPrimitive(argument,3);if(IsSymbol(key))return key;return ToString(key)}function IsArray(argument){return Array.isArray?Array.isArray(argument):argument instanceof Object?argument instanceof Array:Object.prototype.toString.call(argument)==="[object Array]"}function IsCallable(argument){return typeof argument==="function"}function IsConstructor(argument){return typeof argument==="function"}function IsPropertyKey(argument){switch(Type(argument)){case 3:return true;case 4:return true;default:return false}}function GetMethod(V,P){var func=V[P];if(func===undefined||func===null)return undefined;if(!IsCallable(func))throw new TypeError;return func}function GetIterator(obj){var method=GetMethod(obj,iteratorSymbol);if(!IsCallable(method))throw new TypeError;var iterator=method.call(obj);if(!IsObject(iterator))throw new TypeError;return iterator}function IteratorValue(iterResult){return iterResult.value}function IteratorStep(iterator){var result=iterator.next();return result.done?false:result}function IteratorClose(iterator){var f=iterator["return"];if(f)f.call(iterator)}function OrdinaryGetPrototypeOf(O){var proto=Object.getPrototypeOf(O);if(typeof O!=="function"||O===functionPrototype)return proto;if(proto!==functionPrototype)return proto;var prototype=O.prototype;var prototypeProto=prototype&&Object.getPrototypeOf(prototype);if(prototypeProto==null||prototypeProto===Object.prototype)return proto;var constructor=prototypeProto.constructor;if(typeof constructor!=="function")return proto;if(constructor===O)return proto;return constructor}function CreateMapPolyfill(){var cacheSentinel={};var arraySentinel=[];var MapIterator=function(){function MapIterator(keys,values,selector){this._index=0;this._keys=keys;this._values=values;this._selector=selector}MapIterator.prototype["@@iterator"]=function(){return this};MapIterator.prototype[iteratorSymbol]=function(){return this};MapIterator.prototype.next=function(){var index=this._index;if(index>=0&&index<this._keys.length){var result=this._selector(this._keys[index],this._values[index]);if(index+1>=this._keys.length){this._index=-1;this._keys=arraySentinel;this._values=arraySentinel}else{this._index++}return{value:result,done:false}}return{value:undefined,done:true}};MapIterator.prototype.throw=function(error){if(this._index>=0){this._index=-1;this._keys=arraySentinel;this._values=arraySentinel}throw error};MapIterator.prototype.return=function(value){if(this._index>=0){this._index=-1;this._keys=arraySentinel;this._values=arraySentinel}return{value,done:true}};return MapIterator}();return function(){function Map(){this._keys=[];this._values=[];this._cacheKey=cacheSentinel;this._cacheIndex=-2}Object.defineProperty(Map.prototype,"size",{get:function(){return this._keys.length},enumerable:true,configurable:true});Map.prototype.has=function(key){return this._find(key,false)>=0};Map.prototype.get=function(key){var index=this._find(key,false);return index>=0?this._values[index]:undefined};Map.prototype.set=function(key,value){var index=this._find(key,true);this._values[index]=value;return this};Map.prototype.delete=function(key){var index=this._find(key,false);if(index>=0){var size=this._keys.length;for(var i=index+1;i<size;i++){this._keys[i-1]=this._keys[i];this._values[i-1]=this._values[i]}this._keys.length--;this._values.length--;if(key===this._cacheKey){this._cacheKey=cacheSentinel;this._cacheIndex=-2}return true}return false};Map.prototype.clear=function(){this._keys.length=0;this._values.length=0;this._cacheKey=cacheSentinel;this._cacheIndex=-2};Map.prototype.keys=function(){return new MapIterator(this._keys,this._values,getKey)};Map.prototype.values=function(){return new MapIterator(this._keys,this._values,getValue)};Map.prototype.entries=function(){return new MapIterator(this._keys,this._values,getEntry)};Map.prototype["@@iterator"]=function(){return this.entries()};Map.prototype[iteratorSymbol]=function(){return this.entries()};Map.prototype._find=function(key,insert){if(this._cacheKey!==key){this._cacheIndex=this._keys.indexOf(this._cacheKey=key)}if(this._cacheIndex<0&&insert){this._cacheIndex=this._keys.length;this._keys.push(key);this._values.push(undefined)}return this._cacheIndex};return Map}();function getKey(key,_){return key}function getValue(_,value){return value}function getEntry(key,value){return[key,value]}}function CreateSetPolyfill(){return function(){function Set(){this._map=new _Map}Object.defineProperty(Set.prototype,"size",{get:function(){return this._map.size},enumerable:true,configurable:true});Set.prototype.has=function(value){return this._map.has(value)};Set.prototype.add=function(value){return this._map.set(value,value),this};Set.prototype.delete=function(value){return this._map.delete(value)};Set.prototype.clear=function(){this._map.clear()};Set.prototype.keys=function(){return this._map.keys()};Set.prototype.values=function(){return this._map.values()};Set.prototype.entries=function(){return this._map.entries()};Set.prototype["@@iterator"]=function(){return this.keys()};Set.prototype[iteratorSymbol]=function(){return this.keys()};return Set}()}function CreateWeakMapPolyfill(){var UUID_SIZE=16;var keys=HashMap.create();var rootKey=CreateUniqueKey();return function(){function WeakMap(){this._key=CreateUniqueKey()}WeakMap.prototype.has=function(target){var table=GetOrCreateWeakMapTable(target,false);return table!==undefined?HashMap.has(table,this._key):false};WeakMap.prototype.get=function(target){var table=GetOrCreateWeakMapTable(target,false);return table!==undefined?HashMap.get(table,this._key):undefined};WeakMap.prototype.set=function(target,value){var table=GetOrCreateWeakMapTable(target,true);table[this._key]=value;return this};WeakMap.prototype.delete=function(target){var table=GetOrCreateWeakMapTable(target,false);return table!==undefined?delete table[this._key]:false};WeakMap.prototype.clear=function(){this._key=CreateUniqueKey()};return WeakMap}();function CreateUniqueKey(){var key;do{key="@@WeakMap@@"+CreateUUID()}while(HashMap.has(keys,key));keys[key]=true;return key}function GetOrCreateWeakMapTable(target,create){if(!hasOwn.call(target,rootKey)){if(!create)return undefined;Object.defineProperty(target,rootKey,{value:HashMap.create()})}return target[rootKey]}function FillRandomBytes(buffer,size){for(var i=0;i<size;++i)buffer[i]=Math.random()*255|0;return buffer}function GenRandomBytes(size){if(typeof Uint8Array==="function"){if(typeof crypto!=="undefined")return crypto.getRandomValues(new Uint8Array(size));if(typeof msCrypto!=="undefined")return msCrypto.getRandomValues(new Uint8Array(size));return FillRandomBytes(new Uint8Array(size),size)}return FillRandomBytes(new Array(size),size)}function CreateUUID(){var data=GenRandomBytes(UUID_SIZE);data[6]=data[6]&79|64;data[8]=data[8]&191|128;var result="";for(var offset=0;offset<UUID_SIZE;++offset){var byte=data[offset];if(offset===4||offset===6||offset===8)result+="-";if(byte<16)result+="0";result+=byte.toString(16).toLowerCase()}return result}}function MakeDictionary(obj){obj.__=undefined;delete obj.__;return obj}}))})(Reflect||(Reflect={}));AmdLoader.instance.setup("reflect-metadata");System.register([],(function(_export,_context){"use strict";return{setters:[],execute:function(){Map.prototype.getOrCreate=function(key,factory){let item=this.get(key);if(item===undefined){item=factory(key);this.set(key,item)}return item};_export("default",Map)}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/AtomMap");System.register(["reflect-metadata","./AtomMap"],(function(_export,_context){"use strict";var Map,CancelToken,ArrayHelper,_a,_b,_c,ignoreValue,globalNS,DI,UMD;_export({CancelToken:void 0,ArrayHelper:void 0});return{setters:[function(_reflectMetadata){},function(_AtomMap){Map=_AtomMap.default}],execute:function(){_export("ignoreValue",ignoreValue=Symbol("ignore"));_export("CancelToken",CancelToken=class CancelToken{static isCancelled(e){var _a;if(/^(cancelled$|canceled$|aborterror\:)/i.test((_a=e.message)!==null&&_a!==void 0?_a:e.toString().trim())){return true}if(e.name==="AbortError"){return true}}get cancelled(){return this.mCancelled}constructor(timeout=-1){this.listeners=[];this.mCancelled=null;this.cancelTimeout=null;if(timeout>0){this.cancelTimeout=setTimeout((()=>{this.cancelTimeout=null;this.cancel("timeout")}),timeout)}}cancel(r="cancelled"){this.mCancelled=r;const existing=this.listeners.slice(0);this.listeners.length=0;for(const fx of existing){fx(r)}this.dispose()}reset(){this.mCancelled=null;this.dispose()}dispose(){this.listeners.length=0;if(this.cancelTimeout){clearTimeout(this.cancelTimeout)}}registerForCancel(f){if(this.mCancelled){f(this.mCancelled);this.cancel();return}this.listeners.push(f)}});_export("ArrayHelper",ArrayHelper=class ArrayHelper{static remove(a,filter){for(let i=0;i<a.length;i++){const item=a[i];if(filter(item)){a.splice(i,1);return true}}return false}});(_a=Object.values)!==null&&_a!==void 0?_a:Object.values=function(t){const r=[];for(const key in t){if(Object.prototype.hasOwnProperty.call(t,key)){const element=t[key];r.push(element)}}return r};(_b=(_c=Array.prototype).flat)!==null&&_b!==void 0?_b:_c.flat=function(depth=1){const r=[];const flat=depth>0;const nestDepth=depth-1;const nestFlat=nestDepth>0;for(const iterator of this){if(flat&&Array.isArray(iterator)){if(nestFlat){r.push(...iterator.flat(nestDepth));continue}r.push(...iterator);continue}r.push(iterator)}return r};Array.prototype["groupBy"]=function(keySelector){const map=new Map;const groups=[];for(const iterator of this){const key=keySelector(iterator);let g=map.get(key);if(!g){g=[];g.key=key;groups.push(g);map.set(key,g)}g.push(iterator)}map.clear();return groups};globalNS=typeof window!=="undefined"?window:global;_export("DI",DI=globalNS.UMD);_export("UMD",UMD=globalNS.UMD)}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/types");System.register(["./types"],(function(_export,_context){"use strict";var ArrayHelper,AtomBinder,symbolHandlers,symbolBindable;_export("AtomBinder",void 0);return{setters:[function(_types){ArrayHelper=_types.ArrayHelper}],execute:function(){_export("symbolHandlers",symbolHandlers=Symbol.for("handlers"));_export("symbolBindable",symbolBindable=Symbol.for("bindable"));_export("AtomBinder",AtomBinder=class AtomBinder{static refreshValue(target,key){const handlers=AtomBinder.get_WatchHandler(target,key);if(handlers===undefined||handlers==null){return}for(const item of handlers){item(target,key)}if(target.onPropertyChanged){target.onPropertyChanged(key)}}static add_WatchHandler(target,key,handler){if(target==null){return}const handlers=AtomBinder.get_WatchHandler(target,key);handlers.push(handler);if(Array.isArray(target)){return}const pv=AtomBinder.getPropertyDescriptor(target,key);if(pv&&pv.get){return}const tw=target;let bindables=tw[symbolBindable];if(bindables===undefined){bindables={};Object.defineProperty(tw,symbolBindable,{value:bindables,enumerable:false,writable:true,configurable:true})}if(!bindables[key]){bindables[key]=1;const o=target[key];const nk=Symbol.for(key);target[nk]=o;const set=function(v){const ov=this[nk];if(ov===undefined?ov===v:ov==v){return}this[nk]=v;AtomBinder.refreshValue(this,key)};const get=function(){return this[nk]};if(pv){delete target[key];Object.defineProperty(target,key,{get,set,configurable:true,enumerable:true})}else{Object.defineProperty(target,key,{get,set,enumerable:true,configurable:true})}}}static getPropertyDescriptor(target,key){const pv=Object.getOwnPropertyDescriptor(target,key);if(!pv){const pt=Object.getPrototypeOf(target);if(pt){return AtomBinder.getPropertyDescriptor(pt,key)}}return pv}static get_WatchHandler(target,key){if(target==null){return null}let handlers=target[symbolHandlers];if(handlers===undefined){handlers={};Object.defineProperty(target,symbolHandlers,{value:handlers,enumerable:false,writable:true,configurable:true})}let handlersForKey=handlers[key];if(handlersForKey===undefined||handlersForKey==null){handlersForKey=[];handlers[key]=handlersForKey}return handlersForKey}static remove_WatchHandler(target,key,handler){if(target==null){return}const handlers=target[symbolHandlers];if(typeof handlers==="undefined"){return}const handlersForKey=target[symbolHandlers][key];if(handlersForKey===undefined||handlersForKey==null){return}ArrayHelper.remove(handlersForKey,(f=>f===handler));if(!handlersForKey.length){handlers[key]=null;delete handlers[key]}}static invokeItemsEvent(target,mode,index,item,oldItem){const key="_items";const handlers=AtomBinder.get_WatchHandler(target,key);if(!handlers){return}for(const obj of handlers){obj(target,mode,index,item,oldItem)}AtomBinder.refreshValue(target,"length")}static refreshItems(ary){AtomBinder.invokeItemsEvent(ary,"refresh",-1,null)}static add_CollectionChanged(target,handler){if(target==null){throw new Error("Target Array to watch cannot be null")}if(handler==null){throw new Error("Target handle to watch an Array cannot be null")}const handlers=AtomBinder.get_WatchHandler(target,"_items");handlers.push(handler);return{dispose:()=>{AtomBinder.remove_CollectionChanged(target,handler)}}}static remove_CollectionChanged(t,handler){if(t==null){return}const target=t;const handlers=target[symbolHandlers];if(typeof handlers==="undefined"){return}const key="_items";const handlersForKey=handlers[key];if(handlersForKey===undefined||handlersForKey==null){return}ArrayHelper.remove(handlersForKey,(f=>f===handler));if(!handlersForKey.length){handlers[key]=null;delete handlers[key]}}static watch(item,property,f){AtomBinder.add_WatchHandler(item,property,f);return{dispose:()=>{AtomBinder.remove_WatchHandler(item,property,f)}}}static clear(a){a.length=0;this.invokeItemsEvent(a,"refresh",-1,null);AtomBinder.refreshValue(a,"length")}static addItem(a,item){const index=a.length;a.push(item);this.invokeItemsEvent(a,"add",index,item);AtomBinder.refreshValue(a,"length")}static removeItem(a,item){const i=a.findIndex((x=>x===item));if(i===-1){return false}a.splice(i,1);AtomBinder.invokeItemsEvent(a,"remove",i,item);AtomBinder.refreshValue(a,"length");return true}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/AtomBinder");System.register([],(function(_export,_context){"use strict";var AtomDispatcher;_export("AtomDispatcher",void 0);return{setters:[],execute:function(){_export("AtomDispatcher",AtomDispatcher=class AtomDispatcher{constructor(){this.head=null;this.tail=null}onTimeout(){if(this.paused){return}if(!this.head){return}const item=this.head;this.head=item.next;item.next=null;if(!this.head){this.tail=null}item();setTimeout((()=>{this.onTimeout()}),1)}pause(){this.paused=true}start(){this.paused=false;setTimeout((()=>{this.onTimeout()}),1)}callLater(f){if(this.tail){this.tail.next=f;this.tail=f}else{this.head=f;this.tail=f}if(!this.paused){this.start()}}waitForAll(){return new Promise(((resolve,reject)=>{this.callLater((()=>{resolve()}))}))}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/AtomDispatcher");System.register(["../core/AtomMap"],(function(_export,_context){"use strict";var AtomMap,TypeKey;_export("TypeKey",void 0);return{setters:[function(_coreAtomMap){AtomMap=_coreAtomMap.default}],execute:function(){_export("TypeKey",TypeKey=class TypeKey{static get(c){return c}static getName(c){return TypeKey.keys.getOrCreate(c,(c1=>{const key=`${c1.name||"key"}${TypeKey.keys.size}`;return key}))}});TypeKey.keys=new AtomMap}}}));AmdLoader.instance.setup("@web-atoms/core/dist/di/TypeKey");System.register(["../core/types","./TypeKey"],(function(_export,_context){"use strict";var ArrayHelper,TypeKey,ServiceDescription,ServiceCollection,Scope;_export({ServiceDescription:void 0,ServiceCollection:void 0,Scope:void 0});return{setters:[function(_coreTypes){ArrayHelper=_coreTypes.ArrayHelper},function(_TypeKey){TypeKey=_TypeKey.TypeKey}],execute:function(){(function(Scope){Scope[Scope["Global"]=1]="Global";Scope[Scope["Scoped"]=2]="Scoped";Scope[Scope["Transient"]=3]="Transient"})(Scope||_export("Scope",Scope={}));_export("ServiceDescription",ServiceDescription=class ServiceDescription{constructor(id,scope,type,factory){this.id=id;this.scope=scope;this.type=type;this.factory=factory;this.factory=this.factory||(sp=>sp.create(type))}});_export("ServiceCollection",ServiceCollection=class ServiceCollection{constructor(){this.registrations=[];this.ids=1}register(type,factory,scope=Scope.Transient,id){ArrayHelper.remove(this.registrations,(r=>id?r.id===id:r.type===type));if(!id){id=TypeKey.get(type);this.ids++}const sd=new ServiceDescription(id,scope,type,factory);this.registrations.push(sd);return sd}registerScoped(type,factory,id){return this.register(type,factory,Scope.Scoped,id)}registerSingleton(type,factory,id){return this.register(type,factory,Scope.Global,id)}get(type){return this.registrations.find((s=>s.id===type||s.type===type))}});ServiceCollection.instance=new ServiceCollection}}}));AmdLoader.instance.setup("@web-atoms/core/dist/di/ServiceCollection");System.register(["../core/types","./ServiceCollection"],(function(_export,_context){"use strict";var DI,Scope,ServiceCollection,globalNS;function evalGlobal(path){if(typeof path==="string"){let r=globalNS;for(const iterator of path.split(".")){r=r[iterator];if(r===undefined||r===null){return r}}return r}return path}function Register(id,scope){return target=>{if(typeof id==="object"){if(scope){id.scope=scope}ServiceCollection.instance.register(id.for||target,id.for?sp=>sp.create(target):null,id.scope||Scope.Transient,id.id);if(id.mockOrInject){if(id.mockOrInject.inject){DI.inject(target,id.mockOrInject.inject)}else if(id.mockOrInject.mock){DI.mockType(target,id.mockOrInject.mock)}else if(id.mockOrInject.globalVar){ServiceCollection.instance.register(id.for||target,(sp=>evalGlobal(id.mockOrInject.globalVar)),id.scope||Scope.Global,id.id)}}return}ServiceCollection.instance.register(target,null,scope,id)}}_export("Register",Register);return{setters:[function(_coreTypes){DI=_coreTypes.DI},function(_ServiceCollection){Scope=_ServiceCollection.Scope;ServiceCollection=_ServiceCollection.ServiceCollection}],execute:function(){globalNS=typeof global==="undefined"?window:global}}}));AmdLoader.instance.setup("@web-atoms/core/dist/di/Register");System.register(["./Register","./ServiceCollection"],(function(_export,_context){"use strict";var Register,Scope;function RegisterSingleton(target){Register({scope:Scope.Global})(target)}_export("RegisterSingleton",RegisterSingleton);return{setters:[function(_Register){Register=_Register.Register},function(_ServiceCollection){Scope=_ServiceCollection.Scope}],execute:function(){}}}));AmdLoader.instance.setup("@web-atoms/core/dist/di/RegisterSingleton");System.register([],(function(_export,_context){"use strict";var TransientDisposable;_export("default",void 0);return{setters:[],execute:function(){_export("default",TransientDisposable=class TransientDisposable{constructor(owner){if(owner){this.registerIn(owner)}}registerIn(value){const v=value.disposables;if(v){v.push(this)}else{if(value.registerDisposable){value.registerDisposable(this)}}}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/TransientDisposable");System.register(["./TypeKey"],(function(_export,_context){"use strict";var TypeKey,InjectedTypes;function Inject(target,name,index){if(index!==undefined){const key=TypeKey.get(target);const plist=Reflect.getMetadata("design:paramtypes",target,name);if(typeof index==="number"){const pSavedList=InjectedTypes.paramList[key]||(InjectedTypes.paramList[key]=[]);pSavedList[index]=plist[index]}else{throw new Error("Inject can only be applied on constructor"+"parameter or a property without get/set methods")}}else{const key=TypeKey.get(target.constructor);const plist=Reflect.getMetadata("design:type",target,name);const p=InjectedTypes.propertyList[key]||(InjectedTypes.propertyList[key]={});p[name]=plist;let base=target.constructor;while(true){base=Object.getPrototypeOf(base);if(!base){break}const baseKey=TypeKey.get(base);const bp=InjectedTypes.propertyList[baseKey];if(bp){for(const pKey in bp){if(bp.hasOwnProperty(pKey)){const element=bp[pKey];if(!p[pKey]){p[pKey]=element}}}}}}}_export({InjectedTypes:void 0,Inject});return{setters:[function(_TypeKey){TypeKey=_TypeKey.TypeKey}],execute:function(){_export("InjectedTypes",InjectedTypes=class InjectedTypes{static getParamList(key,typeKey1){let plist=InjectedTypes.paramList[typeKey1];let type=key;while(plist===undefined){type=Object.getPrototypeOf(type);if(!type){break}const typeKey=TypeKey.get(type);plist=InjectedTypes.paramList[typeKey];if(!plist){InjectedTypes.paramList[typeKey]=plist}}return plist}static getPropertyList(key,typeKey1){let plist=InjectedTypes.propertyList[typeKey1];let type=key;while(plist===undefined){type=Object.getPrototypeOf(type);if(!type){break}const typeKey=TypeKey.get(type);plist=InjectedTypes.propertyList[typeKey];if(!plist){InjectedTypes.propertyList[typeKey]=plist}}return plist}});InjectedTypes.paramList={};InjectedTypes.propertyList={}}}}));AmdLoader.instance.setup("@web-atoms/core/dist/di/Inject");System.register(["../core/TransientDisposable","../core/types","./Inject","./ServiceCollection","./TypeKey"],(function(_export,_context){"use strict";var TransientDisposable,DI,InjectedTypes,Scope,ServiceCollection,TypeKey,ServiceProvider;_export("ServiceProvider",void 0);return{setters:[function(_coreTransientDisposable){TransientDisposable=_coreTransientDisposable.default},function(_coreTypes){DI=_coreTypes.DI},function(_Inject){InjectedTypes=_Inject.InjectedTypes},function(_ServiceCollection){Scope=_ServiceCollection.Scope;ServiceCollection=_ServiceCollection.ServiceCollection},function(_TypeKey){TypeKey=_TypeKey.TypeKey}],execute:function(){_export("ServiceProvider",ServiceProvider=class ServiceProvider{get global(){return this.parent===null?this:this.parent.global}constructor(parent){this.parent=parent;this.instances=new Map;if(parent===null){ServiceCollection.instance.registerScoped(ServiceProvider)}const sd=ServiceCollection.instance.get(ServiceProvider);this.instances.set(sd.id,this)}get(key){return this.resolve(key,true)}put(key,value){let sd=ServiceCollection.instance.get(key);if(!sd){sd=ServiceCollection.instance.register(key,(()=>value),Scope.Global)}this.instances.set(sd.id,value)}resolve(key,create=false,defValue){const sd=ServiceCollection.instance.get(key);if(!sd){if(!create){if(defValue!==undefined){return defValue}throw new Error(`No service registered for type ${key}`)}return this.create(key)}if(sd.type===ServiceProvider){return this}if(sd.scope===Scope.Global){return this.global.getValue(sd)}if(sd.scope===Scope.Scoped){if(this.parent===null){throw new Error("Scoped dependency cannot be created on global")}}return this.getValue(sd)}getValue(sd){if(sd.scope===Scope.Transient){return sd.factory(this)}let v=this.instances.get(sd.id);if(v===void 0){v=sd.factory(this);this.instances.set(sd.id,v)}return v}newScope(){return new ServiceProvider(this)}dispose(){var _a;for(const element of this.instances.values()){if(element===this){continue}(_a=element.dispose)===null||_a===void 0?void 0:_a.call(element)}this.instances.clear()}create(key){const originalKey=key;const originalTypeKey=TypeKey.get(originalKey);if(DI.resolveType){let mappedType=ServiceProvider.mappedTypes.get(originalTypeKey);if(mappedType===void 0){mappedType=DI.resolveType(originalKey);ServiceProvider.mappedTypes.set(originalKey,mappedType)}key=mappedType}const typeKey1=TypeKey.get(key);const plist=InjectedTypes.getParamList(key,typeKey1);let value=null;if(plist){const pv=plist.map((x=>x?this.resolve(x):void 0));pv.unshift(null);value=new(key.bind.apply(key,pv));for(const iterator of pv){if(iterator&&iterator instanceof TransientDisposable){iterator.registerIn(value)}}}else{value=new key}const propList=InjectedTypes.getPropertyList(key,typeKey1);if(propList){for(const key1 in propList){if(propList.hasOwnProperty(key1)){const element=propList[key1];const d=this.resolve(element);value[key1]=d;if(d&&d instanceof TransientDisposable){d.registerIn(value)}}}}return value}});ServiceProvider.mappedTypes=new Map}}}));AmdLoader.instance.setup("@web-atoms/core/dist/di/ServiceProvider");System.register(["tslib","../di/RegisterSingleton"],(function(_export,_context){"use strict";var __decorate,RegisterSingleton,BusyIndicatorService;return{setters:[function(_tslib){__decorate=_tslib.__decorate},function(_diRegisterSingleton){RegisterSingleton=_diRegisterSingleton.RegisterSingleton}],execute:function(){_export("BusyIndicatorService",BusyIndicatorService=class BusyIndicatorService{createIndicator(info){return{dispose(){}}}});_export("BusyIndicatorService",BusyIndicatorService=__decorate([RegisterSingleton],BusyIndicatorService))}}}));AmdLoader.instance.setup("@web-atoms/core/dist/services/BusyIndicatorService");System.register(["tslib","./core/AtomBinder","./core/AtomDispatcher","./core/types","./di/RegisterSingleton","./di/ServiceProvider","./services/BusyIndicatorService"],(function(_export,_context){"use strict";var __decorate,__metadata,AtomBinder,AtomDispatcher,CancelToken,RegisterSingleton,ServiceProvider,BusyIndicatorService,AtomHandler,AtomMessageAction,App_1,App;_export("AtomMessageAction",void 0);return{setters:[function(_tslib){__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_coreAtomBinder){AtomBinder=_coreAtomBinder.AtomBinder},function(_coreAtomDispatcher){AtomDispatcher=_coreAtomDispatcher.AtomDispatcher},function(_coreTypes){CancelToken=_coreTypes.CancelToken},function(_diRegisterSingleton){RegisterSingleton=_diRegisterSingleton.RegisterSingleton},function(_diServiceProvider){ServiceProvider=_diServiceProvider.ServiceProvider},function(_servicesBusyIndicatorService){BusyIndicatorService=_servicesBusyIndicatorService.BusyIndicatorService}],execute:function(){AtomHandler=class AtomHandler{constructor(message){this.message=message;this.list=new Array}};_export("AtomMessageAction",AtomMessageAction=class AtomMessageAction{constructor(msg,a){this.message=msg;this.action=a}});_export("App",App=App_1=class App extends ServiceProvider{static installStyleSheet(ssConfig){if(typeof ssConfig!=="object"){ssConfig={href:ssConfig}}ssConfig.href=UMD.resolvePath(ssConfig.href);const links=document.getElementsByTagName("link");for(let index=0;index<links.length;index++){const element=links[index];const href=element.getAttribute("href");if(href===ssConfig.href){return}}const ss=document.createElement("link");ss.rel="stylesheet";ss.href=ssConfig.href;if(ssConfig.crossOrigin){ss.crossOrigin=ssConfig.crossOrigin}if(ssConfig.integrity){ss.integrity=ssConfig.integrity}document.head.appendChild(ss)}static installScript(location){location=UMD.resolvePath(location);const links=document.getElementsByTagName("script");for(let index=0;index<links.length;index++){const element=links[index];const href=element.getAttribute("src");if(href===location){return element.loaderPromise}}const script=document.createElement("script");const p=new Promise(((resolve,reject)=>{script.type="text/javascript";script.src=location;const s=script;script.onload=s.onreadystatechange=()=>{if(s.readyState&&s.readyState!=="complete"&&s.readyState!=="loaded"){return}script.onload=s.onreadystatechange=null;resolve()};document.body.appendChild(script)}));script.loaderPromise=p;return p}static authorize(authorize=true){const detail={authorize,authorized:true};const ce=new CustomEvent("authorize",{bubbles:true,detail});document.body.dispatchEvent(ce);if(!ce.detail.authorized){return false}return true}get url(){return this.mUrl}set url(v){this.mUrl=v;AtomBinder.refreshValue(this,"url")}get contextId(){return"none"}constructor(){super(null);this.appReady=false;this.busyIndicators=[];this.readyHandlers=[];this.onError=error=>{console.log(error)};this.screen={};this.bag={};this.put(App_1,this);this.dispatcher=new AtomDispatcher;this.dispatcher.start();this.put(AtomDispatcher,this.dispatcher);setTimeout((()=>{this.invokeReady()}),5)}createBusyIndicator(taskInfo){this.busyIndicatorService=this.busyIndicatorService||this.resolve(BusyIndicatorService);return this.busyIndicatorService.createIndicator(taskInfo)}syncUrl(){}callLater(f){this.dispatcher.callLater(f)}installStyleSheet(ssConfig){App_1.installStyleSheet(ssConfig)}installScript(location){return App_1.installScript(location)}updateDefaultStyle(content){throw new Error("Platform does not support StyleSheets")}waitForPendingCalls(){return this.dispatcher.waitForAll()}setTimeoutAsync(task,timeInMS=1,previousToken){if(previousToken!==void 0){clearTimeout(previousToken)}return setTimeout((()=>{try{const p=task();if(p===null||p===void 0?void 0:p.then){p.catch((error=>{if(CancelToken.isCancelled(error)){return}console.error(error)}))}}catch(e){if(CancelToken.isCancelled(e)){return}console.error(e)}}),timeInMS)}runAsync(tf){try{const p=tf();if(p&&p.then&&p.catch){p.catch((error=>{this.onError("runAsync");this.onError(error)}))}}catch(e){this.onError("runAsync");this.onError(e)}}broadcast(channel,data){const ary=this.bag[channel];if(!ary){return}for(const entry of ary.list){entry.call(this,channel,data)}}subscribe(channel,action){let ary=this.bag[channel];if(!ary){ary=new AtomHandler(channel);this.bag[channel]=ary}ary.list.push(action);return{dispose:()=>{ary.list=ary.list.filter((a=>a!==action));if(!ary.list.length){this.bag[channel]=null}}}}main(){}onReady(f){if(this.readyHandlers){this.readyHandlers.push(f)}else{this.invokeReadyHandler(f)}}invokeReady(){if(this.invokeReadyHandler){for(const iterator of this.readyHandlers){this.invokeReadyHandler(iterator)}}this.readyHandlers=null}invokeReadyHandler(f){const indicator=this.createBusyIndicator();const a=f();if(a&&a.then&&a.catch){a.then((r=>{indicator.dispose()}));a.catch((e=>{indicator.dispose();console.error(typeof e==="string"?e:JSON.stringify(e))}));return}indicator.dispose()}});_export("App",App=App_1=__decorate([RegisterSingleton,__metadata("design:paramtypes",[])],App))}}}));AmdLoader.instance.setup("@web-atoms/core/dist/App");System.register([],(function(_export,_context){"use strict";var AtomDisposableList;_export("AtomDisposableList",void 0);return{setters:[],execute:function(){_export("AtomDisposableList",AtomDisposableList=class AtomDisposableList{constructor(){this.disposables=[]}add(d){if(typeof d==="function"){const fx=d;d={dispose:fx}}this.disposables.push(d);const dx=d;return{dispose:()=>{this.disposables=this.disposables.filter((x=>x!==dx));dx.dispose()}}}dispose(){for(const iterator of this.disposables){iterator.dispose()}this.disposables.length=0}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/AtomDisposableList");System.register([],(function(_export,_context){"use strict";var viewModelParseWatchCache,viewModelParseWatchCache2;function trimRegEx(t,r){const m=r.exec(t);if(m&&m.length){return[true,t.substring(m[0].length).trim(),m[0]]}return[false,t,""]}function extractTill(text,search,returnOriginal=false){const index=text.indexOf(search);if(index<=0){return returnOriginal?text:""}return text.substring(0,index)}function parsePath(f,parseThis){let str=f.toString().trim();str=str.split("\n").filter((s=>!/^\/\//.test(s.trim()))).join("\n");const key=(parseThis===undefined?"un:":parseThis?"_this:":"_noThis:")+str;const px1=viewModelParseWatchCache[key];if(px1){return px1}if(str.endsWith("}")){str=str.substr(0,str.length-1)}const functionRegEx=/^\w+\s*\(/;const lambdaRegEx=/^\(?(\w+)?(\s?\,\s?\w+)*\)?\s?\=\>/;let arg="";const original=str;let[success,remaining]=trimRegEx(str,functionRegEx);if(success){str=remaining;remaining=extractTill(remaining,")");str=str.substring(remaining.length);arg=extractTill(remaining,",",true)}else{[success,str,remaining]=trimRegEx(str,lambdaRegEx);if(success){remaining=remaining.trim();remaining=remaining.substring(0,remaining.length-2);remaining=extractTill(remaining,")",true);arg=extractTill(remaining,",",true);if(arg.startsWith("(")){arg=arg.substring(1)}}else{if(parseThis!==undefined&&parseThis===false){return[]}else{parseThis=true}}}str=str.trim();const isThis=parseThis===undefined?(arg?false:true)||parseThis:parseThis;const p=(isThis?"(\\_this|this)":arg||"").trim();if(p.length===0){const empty=[];viewModelParseWatchCache[key]=empty;return empty}const regExp=`(?:(\\b${p})(?:(\\.[a-zA-Z_][a-zA-Z_0-9]*)+)\\s?(?:(\\(|\\=\\=\\=|\\=\\=|\\=)?))`;const re=new RegExp(regExp,"gi");let path=[];const ms=str.replace(re,(m=>{let px=m;if(px.startsWith("this.")){if(parseThis!==true){px=px.substr(5)}}else if(px.startsWith("_this.")){if(parseThis!==true){px=px.substr(6)}else{px=px.substr(1)}}else{px=px.substr(p.length+1)}px=px.split(".").filter((s=>!s.endsWith("("))).join(".");if(!path.find((y=>y===px))){path.push(px)}const filtered=[];for(const iterator of path){if(iterator.endsWith("==")||!(iterator.endsWith("(")||iterator.endsWith("="))){filtered.push((iterator.endsWith("===")?iterator.substr(0,iterator.length-3):iterator.endsWith("==")?iterator.substr(0,iterator.length-2):iterator).trim())}}path=filtered.filter((px11=>{const search=px11+".";for(const iterator of filtered){if(px11!==iterator&&iterator.indexOf(search)!==-1){return false}}return true}));return m}));path=path.sort(((a,b)=>b.localeCompare(a)));const duplicates=path;path=[];for(const iterator of duplicates){if(path.find((px2=>px2===iterator))){continue}path.push(iterator)}const rp=[];for(const rpItem of path){if(rp.find((x=>x.startsWith(rpItem)))){continue}rp.push(rpItem)}const pl=path.filter((p1=>p1)).map((p1=>p1.split(".")));viewModelParseWatchCache[key]=pl;return pl}function parsePathLists(f){const str=f.toString().trim();const key=str;const px1=viewModelParseWatchCache2[key];if(px1){return px1}const pl={pathList:parsePath(str,false),thisPath:parsePath(str,true),combined:[]};if(pl.thisPath.length&&pl.pathList.length){pl.combined=pl.thisPath.map((x=>{x[0]="t";x.splice(0,0,"this");return x})).concat(pl.pathList.map((x=>{x.splice(0,0,"this","x");return x})));pl.thisPath=[];pl.pathList=[]}viewModelParseWatchCache2[key]=pl;return pl}_export({parsePath,parsePathLists});return{setters:[],execute:function(){viewModelParseWatchCache={};viewModelParseWatchCache2={}}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/ExpressionParser");System.register(["./AtomBinder","./ExpressionParser"],(function(_export,_context){"use strict";var AtomBinder,parsePath,ObjectProperty,AtomWatcher;_export({ObjectProperty:void 0,AtomWatcher:void 0});return{setters:[function(_AtomBinder){AtomBinder=_AtomBinder.AtomBinder},function(_ExpressionParser){parsePath=_ExpressionParser.parsePath}],execute:function(){_export("ObjectProperty",ObjectProperty=class ObjectProperty{constructor(name){this.name=name}toString(){return this.name}});_export("AtomWatcher",AtomWatcher=class AtomWatcher{constructor(target,path,onChanged,source){this.source=source;this.isExecuting=false;this.target=target;this.forValidation=true;if(path instanceof Function){const f=path;path=parsePath(path);this.func=onChanged||f;this.funcText=f.toString()}else{this.func=onChanged}this.runEvaluate=()=>{this.evaluate()};this.runEvaluate.watcher=this;this.path=path.map((x=>x.map((y=>new ObjectProperty(y)))));if(!this.path.length){debugger;console.warn("There is nothing to watch, do not use one way binding without any binding expression")}}toString(){return this.func.toString()}dispose(){if(!this.path){return}for(const p of this.path){for(const op of p){if(op.watcher){op.watcher.dispose();op.watcher=null;op.target=null}}}this.func=null;this.path=null;this.source=null}init(evaluate){if(evaluate){this.evaluate(true)}else{for(const iterator of this.path){this.evaluatePath(this.target,iterator)}}}evaluatePath(target,path){let newTarget=null;for(const p of path){if(this.source&&p.name==="this"){target=this.source;continue}newTarget=target[p.name];if(!p.target){if(p.watcher){p.watcher.dispose()}p.watcher=AtomBinder.watch(target,p.name,this.runEvaluate)}else if(p.target!==target){if(p.watcher){p.watcher.dispose()}p.watcher=AtomBinder.watch(target,p.name,this.runEvaluate)}p.target=target;target=newTarget;if(newTarget===undefined||newTarget===null){break}}return newTarget}evaluate(force){if(!this.path){console.warn(`Watcher is not disposed properly, please watch for any memory leak`);return}if(this.isExecuting){return}const disposeWatchers=[];this.isExecuting=true;try{const values=[];const logs=[];for(const p of this.path){values.push(this.evaluatePath(this.target,p))}try{this.func.apply(this.target,values)}catch(e){console.warn(e)}}finally{this.isExecuting=false;for(const d of disposeWatchers){d.dispose()}}}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/AtomWatcher");System.register(["tslib","./ExpressionParser","./types"],(function(_export,_context){"use strict";var __awaiter,parsePath,parsePathLists,CancelToken,ignoreValue,Bind,isEvent,bindSymbol;function twoWaysConvert(name,b,control,e,creator){control.bind(e,name,b.thisPathList||b.pathList,b.eventList||true,null,b.thisPathList?creator:undefined)}_export("default",void 0);return{setters:[function(_tslib){__awaiter=_tslib.__awaiter},function(_ExpressionParser){parsePath=_ExpressionParser.parsePath;parsePathLists=_ExpressionParser.parsePathLists},function(_types){CancelToken=_types.CancelToken;ignoreValue=_types.ignoreValue}],execute:function(){isEvent=/^event/i;_export("bindSymbol",bindSymbol=Symbol("Bind"));_export("default",Bind=class Bind{static forControl(){return Bind}static forData(){return Bind}static forViewModel(){return Bind}static forLocalViewModel(){return Bind}static presenter(name){return{[bindSymbol](cn,control,e,creator){if(typeof name==="function"){name(control);return}const n=name||cn;let c=control.element;while(c){if(c.atomControl&&c.atomControl[n]!==undefined){break}c=c._logicalParent||c.parentElement}(c&&c.atomControl||control)[n]=e}}}static event(sourcePath){return{[bindSymbol](name,control,e){control.runAfterInit((()=>{if(isEvent.test(name)){name=name.substring(5);if(name.startsWith("-")){name=name.substring(1).replace(/-([a-z])/g,(g=>g[1].toUpperCase()))}else{name=name[0].toLowerCase()+name.substring(1)}}control.bindEvent(e,name,(e1=>sourcePath(control,e1)))}))}}}static oneTime(sourcePath,now){return{[bindSymbol](name,control,e){control.runAfterInit((()=>{control.setLocalValue(e,name,sourcePath(control,e))}));if(typeof now!=="undefined"){control.setLocalValue(e,name,now)}}}}static oneTimeAsync(sourcePath,now){return{[bindSymbol](name,control,e){control.runAfterInit((()=>{control.app.runAsync((()=>__awaiter(this,void 0,void 0,(function*(){const value=yield sourcePath(control,e,new CancelToken);control.setLocalValue(e,name,value)}))))}));if(typeof now!=="undefined"){control.setLocalValue(e,name,now)}}}}static source(source,path,now){const lists=parsePath(path,false).map((x=>["this",...x]));return{[bindSymbol](name,control,e,creator){const self={control,source};control.bind(e,name,lists,false,(()=>path.call(self,self)),self);if(typeof now!=="undefined"){control.setLocalValue(e,name,now)}}}}static oneWayAsync(sourcePath,{watchDelayInMS=250,default:defaultValue}={}){let pathList;let combined;let thisPathList;if(Array.isArray(sourcePath)){pathList=sourcePath}else{const lists=parsePathLists(sourcePath);if(lists.combined.length){combined=lists.combined}if(lists.pathList.length){pathList=lists.pathList}if(lists.thisPath.length){thisPathList=lists.thisPath}}if(!(combined||pathList||thisPathList)){throw new Error(`Failed to setup binding for ${sourcePath}, parsing failed`)}return{[bindSymbol](name,control,e,creator){let bindingSource;let finalPathList=pathList;if(combined){bindingSource={t:creator,x:control};finalPathList=combined}else if(thisPathList){finalPathList=thisPathList;bindingSource=creator}const asyncState={token:0,cancelToken:undefined};control.bind(e,name,finalPathList,false,(()=>{var _a;const app=control.app;(_a=asyncState.cancelToken)===null||_a===void 0?void 0:_a.cancel();asyncState.cancelToken=undefined;asyncState.token=app.setTimeoutAsync((()=>__awaiter(this,void 0,void 0,(function*(){var _b,_c;if((_b=asyncState.cancelToken)===null||_b===void 0?void 0:_b.cancelled){return}asyncState.token=undefined;(_c=asyncState.cancelToken)===null||_c===void 0?void 0:_c.cancel();const ct=asyncState.cancelToken=new CancelToken;const value=yield sourcePath.call(creator,control,e,ct);if(!ct.cancelled){control.setLocalValue(e,name,value)}}))),watchDelayInMS,asyncState.token);return ignoreValue}),bindingSource);if(typeof defaultValue!=="undefined"){control.setLocalValue(e,name,defaultValue)}}}}static oneWay(sourcePath,now){let pathList;let combined;let thisPathList;if(Array.isArray(sourcePath)){pathList=sourcePath}else{const lists=parsePathLists(sourcePath);if(lists.combined.length){combined=lists.combined}if(lists.pathList.length){pathList=lists.pathList}if(lists.thisPath.length){thisPathList=lists.thisPath}}if(!(combined||pathList||thisPathList)){throw new Error(`Failed to setup binding for ${sourcePath}, parsing failed`)}return{[bindSymbol](name,control,e,creator){if(pathList){control.bind(e,name,pathList,false,(()=>sourcePath.call(creator,control,e)));if(typeof now!=="undefined"){control.setLocalValue(e,name,now)}return}if(combined){const a={t:creator,x:control};control.bind(e,name,combined,false,(()=>sourcePath.call(creator,control,e)),a);if(typeof now!=="undefined"){control.setLocalValue(e,name,now)}return}control.bind(e,name,thisPathList,false,(()=>sourcePath.call(creator,control,e)),creator);if(typeof now!=="undefined"){control.setLocalValue(e,name,now)}}}}static twoWays(sourcePath,events,converter){let pathList;let thisPathList;if(Array.isArray(sourcePath)){pathList=sourcePath}else{const lists=parsePathLists(sourcePath);if(lists.combined.length){throw new Error("Cannot have combined binding for two ways")}if(lists.pathList.length){pathList=lists.pathList}if(lists.thisPath.length){thisPathList=lists.thisPath}}if(!(thisPathList||pathList)){throw new Error(`Failed to setup twoWay binding on ${sourcePath}`)}return{[bindSymbol](name,control,e,creator){control.bind(e,name,thisPathList||pathList,events||true,converter,thisPathList?creator:undefined)}}}static sourceTwoWays(source,path,events=["input","cut","paste","change"]){const lists=parsePath(path,false).map((x=>["this",...x]));return{[bindSymbol](name,control,e,creator){const self={control,source};control.bind(e,name,lists,events,lists,self)}}}static twoWaysImmediate(sourcePath,converter){return this.twoWays(sourcePath,["change","input","paste","cut"],converter)}constructor(setupFunction,sourcePath,name,eventList){this.setupFunction=setupFunction;this.name=name;this.eventList=eventList;this.sourcePath=sourcePath;this[bindSymbol]=true;if(!this.sourcePath){return}if(Array.isArray(this.sourcePath)){this.pathList=this.sourcePath}else{const lists=parsePathLists(this.sourcePath);if(lists.combined.length){this.combined=lists.combined}if(lists.pathList.length){this.pathList=lists.pathList}if(lists.thisPath.length){this.thisPathList=lists.thisPath}}}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/Bind");System.register([],(function(_export,_context){"use strict";var AncestorEnumerator,ChildEnumerator,AtomUI;function*descendentElementIterator(e){const stack=[];const start=e;if(start){stack.push(start)}while(stack.length){const pop=stack.pop();const next=pop.nextElementSibling;yield pop;if(next){stack.push(next)}const child=pop.firstElementChild;if(child){stack.push(child)}}}function*descendentIterator(e){const stack=[];const start=e;if(start){stack.push(start)}while(stack.length){const pop=stack.pop();const next=pop.nextSibling;yield pop;if(next){stack.push(next)}const child=pop.firstChild;if(child){stack.push(child)}}}_export({AncestorEnumerator:void 0,ChildEnumerator:void 0,descendentElementIterator,descendentIterator,AtomUI:void 0});return{setters:[],execute:function(){_export("AncestorEnumerator",AncestorEnumerator=class AncestorEnumerator{static find(e,filter){let start=e===null||e===void 0?void 0:e.parentElement;while(start){if(filter(start)){return start}start=start.parentElement}}static findSelector(e,selector){let start=e===null||e===void 0?void 0:e.parentElement;while(start){const found=start.matches(selector);if(found){return start}start=start.parentElement}}});_export("ChildEnumerator",ChildEnumerator=class ChildEnumerator{static find(e,filter){let item=e===null||e===void 0?void 0:e.firstElementChild;while(item){const next=item.nextElementSibling;if(filter(item)){return item}item=next}}static*where(e,filter){let item=e===null||e===void 0?void 0:e.firstElementChild;while(item){const next=item.nextElementSibling;if(filter(item)){yield item}item=next}}static*enumerate(e){let item=e===null||e===void 0?void 0:e.firstElementChild;while(item){const next=item.nextElementSibling;yield item;item=next}}get current(){return this.item}constructor(e){this.e=e}next(){var _a;if(!this.item){this.item=(_a=this.e)===null||_a===void 0?void 0:_a.firstElementChild}else{this.item=this.item.nextElementSibling}return this.item?true:false}});_export("AtomUI",AtomUI=class AtomUI{static outerHeight(el,margin=false){let height=el.offsetHeight;if(!margin){return height}const style=getComputedStyle(el);height+=parseInt(style.marginTop,10)+parseInt(style.marginBottom,10);return height}static outerWidth(el,margin=false){let width=el.offsetWidth;if(!margin){return width}const style=getComputedStyle(el);width+=parseInt(style.marginLeft,10)+parseInt(style.marginRight,10);return width}static innerWidth(el){return el.clientWidth}static innerHeight(el){return el.clientHeight}static scrollTop(el,y){el.scrollTo(0,y)}static screenOffset(e){const r={x:e.offsetLeft,y:e.offsetTop,width:e.offsetWidth,height:e.offsetHeight};if(e.offsetParent){const p=this.screenOffset(e.offsetParent);r.x+=p.x;r.y+=p.y}return r}static parseUrl(url){const r={};const plist=url.split("&");for(const item of plist){const p=item.split("=");const key=decodeURIComponent(p[0]);if(!key){continue}let val=p[1];if(val){val=decodeURIComponent(val)}r[key]=this.parseValue(val)}return r}static parseValue(val){let n;if(/^[0-9]+$/.test(val)){n=parseInt(val,10);if(!isNaN(n)){return n}return val}if(/^[0-9]+\.[0-9]+/gi.test(val)){n=parseFloat(val);if(!isNaN(n)){return n}return val}if(val==="true"){return true}if(val==="false"){return false}return val}static assignID(element){if(!element.id){element.id="__waID"+AtomUI.getNewIndex()}return element.id}static toNumber(text){if(!text){return 0}if(text.constructor===String){return parseFloat(text)}return 0}static getNewIndex(){AtomUI.index=AtomUI.index+1;return AtomUI.index}});AtomUI.index=1001}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/core/AtomUI");System.register(["../web/core/AtomUI","./AtomBinder"],(function(_export,_context){"use strict";var ChildEnumerator,AtomBinder,visitDescendents,refreshInherited,watchProperty,setValue;return{setters:[function(_webCoreAtomUI){ChildEnumerator=_webCoreAtomUI.ChildEnumerator},function(_AtomBinder){AtomBinder=_AtomBinder.AtomBinder}],execute:function(){_export("visitDescendents",visitDescendents=(element,action)=>{for(const iterator of ChildEnumerator.enumerate(element)){const eAny=iterator;const ac=eAny?eAny.atomControl:undefined;if(!action(iterator,ac)){continue}visitDescendents(iterator,action)}});_export("refreshInherited",refreshInherited=(target,name,fieldName)=>{AtomBinder.refreshValue(target,name);if(!fieldName){fieldName="m"+name[0].toUpperCase()+name.substr(1)}if(!target.element){return}visitDescendents(target.element,((e,ac)=>{if(ac){if(ac[fieldName]===undefined){refreshInherited(ac,name,fieldName)}return false}return true}))});_export("watchProperty",watchProperty=(element,name,events,f)=>{if(events.indexOf("change")===-1){events.push("change")}const l=e=>{const e1=element;const v=e1.type==="checkbox"?e1.checked:e1.value;f(v)};for(const iterator of events){element.addEventListener(iterator,l,false)}return{dispose:()=>{for(const iterator of events){element.removeEventListener(iterator,l,false)}}}});_export("setValue",setValue=(element,name,value)=>{element[name]=value})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/Hacks");System.register(["./AtomBinder"],(function(_export,_context){"use strict";var AtomBinder,cache;function getSymbolKey(name){var _a;return(_a=cache[name])!==null&&_a!==void 0?_a:cache[name]=Symbol(name)}function refreshInherited(ac,key,storageKey){const e=ac.element;if(!e){return}AtomBinder.refreshValue(ac,key);let start=e.firstElementChild;if(!start){return}const stack=[start];while(stack.length){start=stack.pop();while(start){let firstChild=start.firstElementChild;const childControl=start.atomControl;if(childControl){if(childControl[storageKey]===undefined){AtomBinder.refreshValue(childControl,key)}else{firstChild=void 0}}if(firstChild){stack.push(firstChild)}start=start.nextElementSibling}}}function getOwnInheritedProperty(target,key){return target[getSymbolKey(key)]}function InheritedProperty(target,key){const iVal=target[key];const keyName=getSymbolKey(key);target[keyName]=iVal;const getter=function(){let start=this;do{const p=start[keyName];if(typeof p!=="undefined"){return p}if(!start.element){break}start=start.parent}while(start);return undefined};const setter=function(newVal){const oldValue=this[keyName];if(oldValue&&oldValue.dispose){oldValue.dispose()}this[keyName]=newVal;refreshInherited(this,key,keyName)};if(delete target[key]){Object.defineProperty(target,key,{get:getter,set:setter,enumerable:true,configurable:true})}}_export({getOwnInheritedProperty,InheritedProperty});return{setters:[function(_AtomBinder){AtomBinder=_AtomBinder.AtomBinder}],execute:function(){cache={}}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/InheritedProperty");System.register(["../di/TypeKey"],(function(_export,_context){"use strict";var TypeKey,PropertyMap;_export("PropertyMap",void 0);return{setters:[function(_diTypeKey){TypeKey=_diTypeKey.TypeKey}],execute:function(){_export("PropertyMap",PropertyMap=class PropertyMap{static from(o){const c=Object.getPrototypeOf(o);const key=TypeKey.get(c);const map=PropertyMap.map;const m=map[key]||(map[key]=PropertyMap.createMap(o));return m}static createMap(c){const map={};const nameList=[];while(c){const names=Object.getOwnPropertyNames(c);for(const name of names){if(/hasOwnProperty|constructor|toString|isValid|errors/i.test(name)){continue}map[name]=true;nameList.push(name)}c=Object.getPrototypeOf(c)}const m=new PropertyMap;m.map=map;m.names=nameList;return m}});PropertyMap.map={}}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/PropertyMap");System.register(["./Bind"],(function(_export,_context){"use strict";var bindSymbol,RootObject,XNode,xnodeSymbol,isControl,elementFactorySymbol,isFactorySymbol,attachedSymbol,isTemplateSymbol,constructorNeedsArgumentsSymbol,attachedProperties,attachedId,attach;_export({RootObject:void 0,default:void 0});return{setters:[function(_Bind){bindSymbol=_Bind.bindSymbol}],execute:function(){_export("RootObject",RootObject=class RootObject{get vsProps(){return undefined}addEventListener(name,handler){return bridge.addEventHandler(this,name,handler)}appendChild(e){bridge.appendChild(this,e)}dispatchEvent(evt){bridge.dispatchEvent(evt)}});_export("xnodeSymbol",xnodeSymbol=Symbol("XNode"));_export("isControl",isControl=Symbol("isControl"));_export("elementFactorySymbol",elementFactorySymbol=Symbol("elementFactory"));_export("isFactorySymbol",isFactorySymbol=Symbol("isFactory"));_export("attachedSymbol",attachedSymbol=Symbol("attached"));_export("isTemplateSymbol",isTemplateSymbol=Symbol("isTemplate"));_export("constructorNeedsArgumentsSymbol",constructorNeedsArgumentsSymbol=Symbol("constructorNeedsArguments"));_export("attachedProperties",attachedProperties={});attachedId=1;attach=(name,attacher)=>{const key=`:${attachedId++}`;const fx=v=>({[key]:v});attachedProperties[key]=attacher;fx[attachedSymbol]=attacher;fx[isFactorySymbol]=key;return fx};_export("default",XNode=class XNode{static attach(n,tag){return{factory:(attributes,...nodes)=>new XNode(n,attributes?Object.assign(Object.assign({},attributes),{for:tag}):{for:tag},nodes)}}static prepare(n,isProperty,isTemplate){function px(v){return{[n]:v}}px.factory=(a,...nodes)=>new XNode(n,a,nodes,isProperty,isTemplate);px.toString=()=>n;return px}static getClass(fullTypeName,assemblyName){const n=fullTypeName+";"+assemblyName;const cx=XNode.classes[n]||(XNode.classes[n]=bridge.getClass(fullTypeName,assemblyName,RootObject,((name,isProperty,isTemplate)=>(a,...nodes)=>new XNode(name,a,nodes,isProperty,isTemplate))));return cx}static namespace(ns,assemblyName){return(type,isTemplate)=>c=>{for(const key in c){if(c.hasOwnProperty(key)){const element=c[key];if(element){const n=ns+"."+type+":"+key+";"+assemblyName;const af=a=>{const r={[n]:a};Object.defineProperty(r,"toString",{value:()=>n,enumerable:false,configurable:false});return r};af.factory=(a,...nodes)=>new XNode(n,a,nodes,true,element.isTemplate);af.toString=()=>n;c[key]=af}}}const tn=ns+"."+type+";"+assemblyName;c.factory=(a,...nodes)=>new XNode(tn,a,nodes,false,isTemplate);c.toString=()=>tn}}static create(name,attributes,...children){if(typeof name==="string"){return new XNode(name,attributes,children)}if(name[isFactorySymbol]){return new XNode(name,attributes,children)}if(name.factory){return name.factory(attributes,...children)}switch(typeof name){case"object":name=name.toString();break;case"function":return name(attributes||{},...children)}return new XNode(name,attributes,children)}constructor(name,attributes,children,isProperty,isTemplate){this.name=name;this.attributes=attributes;this.children=children;this.isProperty=isProperty;this.isTemplate=isTemplate;this[xnodeSymbol]=true}toString(){if(typeof this.name==="string"){return`name is of type string and value is ${this.name}`}return`name is of type ${typeof this.name}`}});XNode.isFactory=isFactorySymbol;XNode.elementFactory=elementFactorySymbol;XNode.bindSymbol=bindSymbol;XNode.isTemplate=isTemplateSymbol;XNode.prepareAttached=attach;XNode.constructorNeedsArguments=constructorNeedsArgumentsSymbol;XNode.classes={};XNode.factory=(name,isProperty,isTemplate)=>(a,...nodes)=>new XNode(name,a,nodes,isProperty,isTemplate);if(typeof bridge!=="undefined"){bridge.XNode=XNode}}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/XNode");System.register(["tslib","../App","../core/types","../di/Inject","./AtomDisposableList","./AtomWatcher","./Bind","./Hacks","./InheritedProperty","./PropertyMap","./XNode"],(function(_export,_context){"use strict";var __decorate,__metadata,__param,App,ArrayHelper,CancelToken,ignoreValue,Inject,AtomDisposableList,AtomWatcher,bindSymbol,visitDescendents,watchProperty,InheritedProperty,PropertyMap,isControl,isFactorySymbol,xnodeSymbol,PropertyBinding,_a,_b,localBindSymbol,localXNodeSymbol,AtomComponent;_export("PropertyBinding",void 0);return{setters:[function(_tslib){__decorate=_tslib.__decorate;__metadata=_tslib.__metadata;__param=_tslib.__param},function(_App){App=_App.App},function(_coreTypes){ArrayHelper=_coreTypes.ArrayHelper;CancelToken=_coreTypes.CancelToken;ignoreValue=_coreTypes.ignoreValue},function(_diInject){Inject=_diInject.Inject},function(_AtomDisposableList){AtomDisposableList=_AtomDisposableList.AtomDisposableList},function(_AtomWatcher){AtomWatcher=_AtomWatcher.AtomWatcher},function(_Bind){bindSymbol=_Bind.bindSymbol},function(_Hacks){visitDescendents=_Hacks.visitDescendents;watchProperty=_Hacks.watchProperty},function(_InheritedProperty){InheritedProperty=_InheritedProperty.InheritedProperty},function(_PropertyMap){PropertyMap=_PropertyMap.PropertyMap},function(_XNode){isControl=_XNode.isControl;isFactorySymbol=_XNode.isFactorySymbol;xnodeSymbol=_XNode.xnodeSymbol}],execute:function(){localBindSymbol=bindSymbol;localXNodeSymbol=xnodeSymbol;_export("AtomComponent",AtomComponent=class AtomComponent{get vsProps(){return undefined}constructor(app,element=null){this.app=app;this.mInvalidated=0;this.mPendingPromises={};this.disposables=new AtomDisposableList;this.bindings=[];this.eventHandlers=[];this.element=element;this.element.atomControl=this;const a=this.beginEdit();this.preCreate();this.create();app.callLater((()=>a.dispose()))}bind(element,name,path,twoWays,valueFunc,source){const binding=new PropertyBinding(this,element,name,path,twoWays,valueFunc,source);this.bindings.push(binding);return{dispose:()=>{binding.dispose();ArrayHelper.remove(this.bindings,(x=>x===binding))}}}unbind(element,name){const toDelete=this.bindings.filter((x=>x.element===element&&(!name||x.name===name)));for(const iterator of toDelete){iterator.dispose();ArrayHelper.remove(this.bindings,(x=>x===iterator))}}bindEvent(element,name,method,key,capture){if(!element){return}if(!method){return}const be={element,name,handler:method};if(key){be.key=key}const handler=e=>{var _c;try{let r=method(e);e.executed=true;if(r){const originalReturn=r;r=r.then?r:Promise.resolve(r);e.promise=e.promise?e.promise.then((()=>r)):r;if(originalReturn.catch){return originalReturn.catch((c=>{var _c;if(CancelToken.isCancelled(c!==null&&c!==void 0?c:"Unknown error")){return}alert((_c=c.stack)!==null&&_c!==void 0?_c:c)}))}return r}}catch(error){if(CancelToken.isCancelled(error)){return}alert((_c=error.stack)!==null&&_c!==void 0?_c:error)}};element.addEventListener(name,handler,capture);be.disposable={dispose:()=>{element.removeEventListener(name,handler,capture);be.disposable.dispose=()=>undefined}};this.eventHandlers.push(be);return{dispose:()=>{be.disposable.dispose();ArrayHelper.remove(this.eventHandlers,(e=>e.disposable===be.disposable))}}}unbindEvent(element,name,method,key){const deleted=[];for(const be of this.eventHandlers){if(element&&be.element!==element){return}if(key&&be.key!==key){return}if(name&&be.name!==name){return}if(method&&be.handler!==method){return}be.disposable.dispose();be.handler=null;be.element=null;be.name=null;be.key=null;deleted.push((()=>this.eventHandlers.remove(be)))}for(const iterator of deleted){iterator()}}hasProperty(name){if(/^(data|viewModel|localViewModel|element)$/.test(name)){return true}const map=PropertyMap.from(this);if(map.map[name]){return true}if(this[name]!==undefined){return true}return false}setPrimitiveValue(element,name,value){const p=value;if(p&&p.then&&p.catch){console.warn(`Do not bind promises, instead use Bind.oneWayAsync`);this.mPendingPromises[name]=p;p.then((r=>{if(this.mPendingPromises[name]!==p){return}this.mPendingPromises[name]=null;this.setPrimitiveValue(element,name,r)})).catch((e=>{if(this.mPendingPromises[name]!==p){return}this.mPendingPromises[name]=null;console.error(e)}));return}if(/^(viewModel|localViewModel)$/.test(name)){this[name]=value;return}if((!element||element===this.element)&&this.hasProperty(name)){this.runAfterInit((()=>{this[name]=value}))}else{this.setElementValue(element,name,value)}}setLocalValue(element,name,value){const p=value;if(p&&p.then&&p.catch){console.warn(`Do not bind promises, instead use Bind.oneWayAsync`);this.mPendingPromises[name]=p;p.then((r=>{if(this.mPendingPromises[name]!==p){return}this.mPendingPromises[name]=null;this.setLocalValue(element,name,r)})).catch((e=>{if(this.mPendingPromises[name]!==p){return}this.mPendingPromises[name]=null;console.error(e)}));return}if((!element||element===this.element)&&Reflect.has(this,name)){this[name]=value}else{this.setElementValue(element,name,value)}}dispose(e){if(this.mInvalidated){clearTimeout(this.mInvalidated);this.mInvalidated=0}visitDescendents(e||this.element,((ex,ac)=>{if(ac){ac.dispose();return false}return true}));if(!e){this.unbindEvent(null,null,null);for(const binding of this.bindings){binding.dispose()}this.bindings.length=0;this.bindings=null;const e1=this.element;if(typeof e1.dispose==="function"){e1.dispose()}this.element=null;const lvm=this.localViewModel;if(lvm&&lvm.dispose){lvm.dispose();this.localViewModel=null}const vm=this.viewModel;if(vm&&vm.dispose){vm.dispose();this.viewModel=null}this.disposables.dispose();this.pendingInits=null}}onPropertyChanged(name){}beginEdit(){this.pendingInits=[];const a=this.pendingInits;return{dispose:()=>{if(this.pendingInits==null){return}this.pendingInits=null;if(a){for(const iterator of a){iterator()}}this.invalidate()}}}invalidate(){if(this.mInvalidated){clearTimeout(this.mInvalidated)}this.mInvalidated=setTimeout((()=>{this.mInvalidated=0;this.app.callLater((()=>{this.onUpdateUI()}))}),5)}onUpdateUI(){}runAfterInit(f){if(this.pendingInits){this.pendingInits.push(f)}else{f()}}registerDisposable(d){return this.disposables.add(d)}render(node,e=this.element,creator=this.creator||this){const app=this.app;const attr=node.attributes;if(attr){for(const key in attr){if(attr.hasOwnProperty(key)){const item=attr[key];const isObject=typeof item==="object";if(isObject&&item!==null){const localSymbol=item[localBindSymbol];if(localSymbol){localSymbol(key,this,e,creator);continue}const localXNode=item[localXNodeSymbol];if(localXNode){if(item.isTemplate){this.setLocalValue(e,key,this.toTemplate(app,item,creator));continue}this.setLocalValue(e,key,this.createNode(app,null,item,creator));continue}}this.setLocalValue(e,key,item)}}}const children=node.children;if(children===void 0){return}for(const iterator of children){if(!iterator){continue}if(!iterator[localXNodeSymbol]){e.appendChild(document.createTextNode(iterator.toString()));continue}if(iterator.isProperty){if(iterator.isTemplate){this.setLocalValue(e,iterator.name,this.toTemplate(app,iterator.children[0],creator));continue}this.createNode(app,e,iterator,creator);continue}const t=iterator.attributes&&iterator.attributes.template;if(t){console.warn(`This path is deprecated, check who is calling it.`);this.setLocalValue(e,t,this.toTemplate(app,iterator,creator));continue}this.createNode(app,e,iterator,creator)}}extractControlProperties(x,name="div"){const a=x.attributes;const extracted={};if(typeof x.name==="function"&&this instanceof x.name){x.name=name}if(a){for(const key in a){if(Object.prototype.hasOwnProperty.call(a,key)){if(Reflect.has(this,key)){const element=a[key];extracted[key]=element;delete a[key]}}}}return extracted}create(){}preCreate(){}setElementValue(element,name,value){element[name]=value}resolve(c,selfName){const result=this.app.resolve(c,true);if(selfName){if(typeof selfName==="function"){this.runAfterInit((()=>{const v=selfName();if(v){for(const key in v){if(v.hasOwnProperty(key)){const element=v[key];result[key]=element}}}}))}else{result[selfName]=this}}return result}pushInit(){this.runAfterInit((()=>{var _c,_d,_e;(_e=(_d=(_c=this).init)===null||_d===void 0?void 0:_d.call(_c))===null||_e===void 0?void 0:_e.catch((error=>CancelToken.isCancelled(error)?void 0:console.error(error)))}))}});_a=isControl,_b=isFactorySymbol;AtomComponent[_a]=true;AtomComponent[_b]=true;__decorate([InheritedProperty,__metadata("design:type",Object)],AtomComponent.prototype,"data",void 0);__decorate([InheritedProperty,__metadata("design:type",Object)],AtomComponent.prototype,"viewModel",void 0);__decorate([InheritedProperty,__metadata("design:type",Object)],AtomComponent.prototype,"localViewModel",void 0);_export("AtomComponent",AtomComponent=__decorate([__param(0,Inject),__metadata("design:paramtypes",[App,Object])],AtomComponent));_export("PropertyBinding",PropertyBinding=class PropertyBinding{constructor(target,element,name,path,twoWays,valueFunc,source){this.target=target;this.element=element;this.name=name;this.twoWays=twoWays;this.source=source;this.isTwoWaySetup=false;this.name=name;this.twoWays=twoWays;this.target=target;this.element=element;this.isRunning=false;if(valueFunc){if(typeof valueFunc!=="function"){this.fromSourceToTarget=valueFunc.fromSource;this.fromTargetToSource=valueFunc.fromTarget}else{this.fromSourceToTarget=valueFunc}}this.watcher=new AtomWatcher(target,path,((...v)=>{if(this.isRunning){return}if(this.disposed){return}for(const iterator of v){if(iterator===undefined){return}}const cv=this.fromSourceToTarget?this.fromSourceToTarget.apply(this,v):v[0];if(cv===ignoreValue){return}this.isRunning=true;try{if(this.target instanceof AtomComponent){this.target.setLocalValue(this.element,this.name,cv)}else{this.target[name]=cv}}finally{this.isRunning=false}}),source);this.path=this.watcher.path;if(this.target instanceof AtomComponent){this.target.runAfterInit((()=>{if(!this.watcher){return}this.watcher.init(true);if(twoWays){this.setupTwoWayBinding()}}))}else{this.watcher.init(true);if(twoWays){this.setupTwoWayBinding()}}}setupTwoWayBinding(){if(this.target instanceof AtomComponent){if(this.element&&(this.element!==this.target.element||!this.target.hasProperty(this.name))){let events=[];if(typeof this.twoWays!=="boolean"){events=this.twoWays}this.twoWaysDisposable=watchProperty(this.element,this.name,events,(v=>{this.setInverseValue(v)}));return}}const watcher=new AtomWatcher(this.target,[[this.name]],((...values)=>{if(this.isTwoWaySetup){this.setInverseValue(values[0])}}));watcher.init(true);this.isTwoWaySetup=true;this.twoWaysDisposable=watcher}setInverseValue(value){if(!this.twoWays){throw new Error("This Binding is not two ways.")}if(this.disposed){return}if(this.isRunning){return}this.isRunning=true;try{const first=this.path[0];const length=first.length;let v=this.target;let i=0;let name;for(i=0;i<length-1;i++){name=first[i].name;if(name==="this"){v=this.source||this.target}else{v=v[name]}if(!v){return}}name=first[i].name;v[name]=this.fromTargetToSource?this.fromTargetToSource.call(this,value):value}finally{this.isRunning=false}}dispose(){var _c;(_c=this.twoWaysDisposable)===null||_c===void 0?void 0:_c.dispose();this.twoWaysDisposable=undefined;this.watcher.dispose();this.disposed=true;this.watcher=null}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/AtomComponent");System.register(["./AtomBinder"],(function(_export,_context){"use strict";var AtomBinder;function BindableProperty(target,key){const iVal=target[key];const keyName="_"+key;target[keyName]=iVal;const getter=function(){return this[keyName]};const setter=function(newVal){const oldValue=this[keyName];if(oldValue===undefined?oldValue===newVal:oldValue==newVal){return}const ce=this;if(ce.onPropertyChanging){ce.onPropertyChanging(key,oldValue,newVal)}this[keyName]=newVal;AtomBinder.refreshValue(this,key)};if(delete target[key]){Object.defineProperty(target,key,{get:getter,set:setter,enumerable:true,configurable:true})}}_export("BindableProperty",BindableProperty);return{setters:[function(_AtomBinder){AtomBinder=_AtomBinder.AtomBinder}],execute:function(){}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/BindableProperty");(function(factory){if(typeof module==="object"&&typeof module.exports==="object"){var v=factory(require,exports);if(v!==undefined)module.exports=v}else if(typeof define==="function"&&define.amd){define(["require","exports"],factory)}})((function(require,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.msDays=exports.msHours=exports.msSeconds=exports.msMinutes=void 0;function isEmpty(n){return n===undefined||n===null||n===0||isNaN(n)}exports.msMinutes=6e4;exports.msSeconds=1e3;exports.msHours=36e5;exports.msDays=24*exports.msHours;const daysPerMS=1/exports.msDays;const hoursPerMS=1/exports.msHours;const minutesPerMS=1/exports.msMinutes;const secondsPerMS=1/exports.msSeconds;function padLeft(n,c=2,t="0"){let s=n.toString();if(s.length<c){s=t+s}return s}class TimeSpan{static fromDays(n){return new TimeSpan(n*exports.msDays)}static fromHours(n){return new TimeSpan(n*exports.msHours)}static fromMinutes(n){return new TimeSpan(n*exports.msMinutes)}static fromSeconds(n){return new TimeSpan(n*exports.msSeconds)}static parse(text){if(!text){throw new Error("Invalid time format")}let isPM=false;let d,h,m,s,ms;const tokens=text.split(/:/);const last=tokens[tokens.length-1];const lastParts=last.split(" ");if(lastParts.length>1){if(/pm/i.test(lastParts[1])){isPM=true}tokens[tokens.length-1]=lastParts[0]}const firstOfLast=lastParts[0];if(firstOfLast.indexOf(".")!==-1){const secondParts=firstOfLast.split(".");if(secondParts.length>1){tokens[tokens.length-1]=secondParts[0];ms=parseInt(secondParts[1],10)}}if(tokens.length===2){d=0;h=parseInt(tokens[0],10);m=parseInt(tokens[1],10)}else if(tokens.length===3){d=0;h=parseInt(tokens[0],10);m=parseInt(tokens[1],10);s=parseInt(tokens[2],10)}else if(tokens.length===4){d=parseInt(tokens[0],10);h=parseInt(tokens[1],10);m=parseInt(tokens[2],10);s=parseInt(tokens[3],10)}return new TimeSpan(d,isPM?h+12:h,m,s,ms)}get totalSeconds(){return this.msSinceEpoch*secondsPerMS}get totalMinutes(){return this.msSinceEpoch*minutesPerMS}get totalHours(){return this.msSinceEpoch*hoursPerMS}get totalDays(){return this.msSinceEpoch*daysPerMS}get totalMilliseconds(){return this.msSinceEpoch}get days(){return Math.floor(this.msSinceEpoch/exports.msDays)}get hours(){return Math.floor(this.msSinceEpoch/exports.msHours%24)}get minutes(){return Math.floor(this.msSinceEpoch/exports.msMinutes%60)}get seconds(){return Math.floor(this.msSinceEpoch/exports.msSeconds%60)}get milliseconds(){return Math.floor(this.msSinceEpoch%1e3)}get duration(){const t=this.msSinceEpoch;return new TimeSpan(t>0?t:-t)}get trimmedTime(){return new TimeSpan(Math.ceil(this.msSinceEpoch%exports.msDays))}constructor(days,hours,minutes,seconds,milliseconds){if(arguments.length===1){this.msSinceEpoch=days}else{this.msSinceEpoch=(days||0)*exports.msDays+(hours||0)*exports.msHours+(minutes||0)*exports.msMinutes+(seconds||0)*exports.msSeconds+(milliseconds||0)}}toString(formatAs12=false){let ams=this.msSinceEpoch;const text=[];let postFix="";function format(max,f12=false){let txt=null;if(ams>max){const n=Math.floor(ams/max);ams=ams%max;if(f12){if(n>12){postFix=" PM";txt=padLeft(n-12)}else{postFix=" AM"}}if(!txt){txt=padLeft(n)}}if(txt){text.push(txt)}return txt}const d=format(exports.msDays);format(exports.msHours,formatAs12&&!d);format(exports.msMinutes);let s=format(exports.msSeconds);if(ams){s+="."+ams;text[text.length-1]=s}return`${text.join(":")}${postFix}`}add(ts){return new TimeSpan(this.msSinceEpoch+ts.msSinceEpoch)}equals(ts){return ts.msSinceEpoch===this.msSinceEpoch}}exports.default=TimeSpan;if(typeof window!=="undefined"){window.TimeSpan=TimeSpan}}));AmdLoader.instance.setup("@web-atoms/date-time/dist/TimeSpan");(function(factory){if(typeof module==="object"&&typeof module.exports==="object"){var v=factory(require,exports);if(v!==undefined)module.exports=v}else if(typeof define==="function"&&define.amd){define(["require","exports","./TimeSpan"],factory)}})((function(require,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});const TimeSpan_1=require("./TimeSpan");class DateTime{static from(d){if(!d){return null}if(!(d instanceof DateTime)){if(d instanceof Date){d=new DateTime(d.getTime())}return new DateTime(d)}return d}static get today(){const a=new DateTime;return a.date}static get utcNow(){const now=new Date;return new DateTime(now.getTime()+now.getTimezoneOffset())}static get now(){return new DateTime}static parse(s){return new DateTime(s)}get day(){return this.getDate()}get dayOfWeek(){return this.getDay()}get month(){return this.getMonth()}get year(){return this.getFullYear()}get hour(){return this.getHours()}get minute(){return this.getMinutes()}get second(){return this.getSeconds()}get milliSecond(){return this.getMilliseconds()}get timeZoneOffset(){return TimeSpan_1.default.fromMinutes(this.getTimezoneOffset())}get msSinceEpoch(){return this.getTime()}get date(){const d=new DateTime(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0,0);return d}get asJSDate(){return this}get time(){return new TimeSpan_1.default(0,this.getHours(),this.getMinutes(),this.getSeconds(),this.getMilliseconds())}constructor(a,b,c,d,e,f,g){let rd;switch(arguments.length){case 0:rd=new Date;break;case 1:rd=new Date(a);break;case 2:rd=new Date(a,b);break;case 3:rd=new Date(a,b,c);break;case 4:rd=new Date(a,b,c,d);break;case 5:rd=new Date(a,b,c,d,e);break;case 6:rd=new Date(a,b,c,d,e,f);break;default:rd=new Date(a,b,c,d,e,f,g)}Object.setPrototypeOf(rd,DateTime.prototype);return rd}add(t,hours,minutes,seconds,milliseconds){if(t instanceof Date){return new DateTime(this.getTime()+t.getTime())}let days=0;if(t instanceof TimeSpan_1.default){days=t.days;hours=t.hours;minutes=t.minutes;seconds=t.seconds;milliseconds=t.milliseconds}else{days=t}function hasValue(n,name){if(n===undefined){return false}if(n===null){throw new Error(`${name} cannot be null`)}return n!==0}const d=new Date(this.getTime());if(hasValue(days,"days")){d.setDate(d.getDate()+days)}if(hasValue(hours,"hours")){d.setHours(d.getHours()+hours)}if(hasValue(minutes,"minutes")){d.setMinutes(d.getMinutes()+minutes)}if(hasValue(seconds,"seconds")){d.setSeconds(d.getSeconds()+seconds)}if(hasValue(milliseconds,"milliseconds")){d.setMilliseconds(d.getMilliseconds()+milliseconds)}Object.setPrototypeOf(d,DateTime.prototype);return d}addMonths(m){const d=new Date(this.msSinceEpoch);d.setMonth(d.getMonth()+m);Object.setPrototypeOf(d,DateTime.prototype);return d}addYears(y){const d=new Date(this.msSinceEpoch);d.setFullYear(d.getFullYear()+y);Object.setPrototypeOf(d,DateTime.prototype);return d}addDays(day){const d=new Date(this.msSinceEpoch);d.setDate(d.getDate()+day);Object.setPrototypeOf(d,DateTime.prototype);return d}addHours(h){const d=new Date(this.msSinceEpoch);d.setHours(d.getHours()+h);Object.setPrototypeOf(d,DateTime.prototype);return d}addMinutes(m){const d=new Date(this.msSinceEpoch);d.setMinutes(d.getMinutes()+m);Object.setPrototypeOf(d,DateTime.prototype);return d}diff(rhs){return new TimeSpan_1.default(this.getTime()-rhs.getTime())}equals(d){if(!d){return false}return this.getTime()===d.getTime()}dateEquals(d){if(!d){return false}return this.date.equals(DateTime.from(d).date)}compare(d){return this.getTime()-d.getTime()}toRelativeString(dt){if(!dt){dt=DateTime.now}else{if(dt instanceof Date&&!(dt instanceof DateTime)){dt.__proto__=DateTime.prototype;dt=dt}}const diff=this.diff(dt);if(dt.year!==this.year){return this.toLocaleDateString()}if(Math.abs(diff.totalDays)>6){return this.toLocaleDateString(undefined,{month:"short",day:"numeric"})}if(Math.abs(diff.totalHours)>23){return this.toLocaleDateString(undefined,{weekday:"short"})}if(Math.abs(diff.totalMinutes)>59){return`${Math.floor(diff.totalHours)} hours`}return`${Math.floor(diff.totalMinutes)} mins`}valueOf(){return this.getTime()}}exports.default=DateTime;DateTime.prototype.__proto__=Date.prototype;if(typeof window!=="undefined"){window.DateTime=DateTime}}));AmdLoader.instance.setup("@web-atoms/date-time/dist/DateTime");System.register(["@web-atoms/date-time/dist/DateTime","./types"],(function(_export,_context){"use strict";var DateTime,CancelToken,EventScope,key,id;_export("default",void 0);return{setters:[function(_webAtomsDateTimeDistDateTime){DateTime=_webAtomsDateTimeDistDateTime.default},function(_types){CancelToken=_types.CancelToken}],execute:function(){key=DateTime.now.msSinceEpoch;id=1;_export("default",EventScope=class EventScope{static create(){return new EventScope(`eventScopeE${key}${id++}`)}bindEvent(fx){return{[this.eventName]:fx}}constructor(eventType){this.eventType=eventType;this.eventName=`event-${this.eventType}`}subscribe(control,handler){return control.bindEvent(window,this.eventType,handler)}listen(fx){const asyncHandler=ce=>{if(ce.defaultPrevented){return}try{const p=fx(ce);if(p===null||p===void 0?void 0:p.catch){p.catch((r=>{if(CancelToken.isCancelled(r)){return}console.error(r)}))}}catch(e){if(CancelToken.isCancelled(e)){return}console.error(e)}};window.addEventListener(this.eventType,asyncHandler);return{dispose:()=>{window.removeEventListener(this.eventType,asyncHandler)}}}listenOn(target,fx){const asyncHandler=ce=>{if(ce.defaultPrevented){return}try{const p=fx(ce);if(p===null||p===void 0?void 0:p.catch){p.catch((r=>{if(CancelToken.isCancelled(r)){return}console.error(r)}))}}catch(e){if(CancelToken.isCancelled(e)){return}console.error(e)}};target.addEventListener(this.eventType,asyncHandler);return{dispose:()=>{target.removeEventListener(this.eventType,asyncHandler)}}}dispatch(target,detail,{cancelable=true,bubbles=true}={}){const ce=new CustomEvent(this.eventType,{detail,cancelable,bubbles});target.dispatchEvent(ce);return ce}dispatchEvent(detail,cancelable=true){const ce=new CustomEvent(this.eventType,{detail,cancelable,bubbles:false});window.dispatchEvent(ce);return ce}toString(){return this.eventType}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/EventScope");System.register([],(function(_export,_context){"use strict";var StringHelper;_export("StringHelper",void 0);return{setters:[],execute:function(){_export("StringHelper",StringHelper=class StringHelper{static escapeRegExp(text){return text.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}static createContainsRegExp(text){return new RegExp(this.escapeRegExp(text),"i")}static createContainsAnyWordRegExp(text){return new RegExp(text.split(/\s+/g).map((x=>`(${this.escapeRegExp(x)})`)).join("|"),"i")}static containsIgnoreCase(source,test){if(!source){return false}if(!test){return true}return this.createContainsRegExp(test).test(source)}static containsAnyWordIgnoreCase(source,test){if(!source){return false}if(!test){return true}return this.createContainsAnyWordRegExp(test).test(source)}static fromCamelToHyphen(input){return input.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}static fromCamelToUnderscore(input){return input.replace(/([a-z])([A-Z])/g,"$1_$2").toLowerCase()}static fromCamelToPascal(input){return input[0].toUpperCase()+input.substr(1)}static fromHyphenToCamel(input){return input.replace(/-([a-z])/g,(g=>g[1].toUpperCase()))}static fromUnderscoreToCamel(input){return input.replace(/\_([a-z])/g,(g=>g[1].toUpperCase()))}static fromPascalToCamel(input){return input[0].toLowerCase()+input.substr(1)}static fromPascalToTitleCase(s){return s.replace(/([A-Z])/gm,((x,g,i)=>i?" "+x:x))}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/StringHelper");System.register(["./StringHelper"],(function(_export,_context){"use strict";var StringHelper,Variable,Route;_export({Variable:void 0,default:void 0});return{setters:[function(_StringHelper){StringHelper=_StringHelper.StringHelper}],execute:function(){_export("Variable",Variable=class Variable{get regex(){if(this.catchAll){return`(/(?<${this.variable}>.+)?)?`}if(this.optional){return`(/?(?<${this.variable}>[^\\/]+))?`}return`/(?<${this.variable}>[^\\/]+)`}constructor(variable,name){var _a;this.variable=variable;this.name=name;this.convert=v=>v;if(variable.startsWith("*")){this.catchAll=true;variable=variable.substring(1)}if(variable.endsWith("?")){this.optional=true;variable=variable.substring(0,variable.length-1)}const index=variable.indexOf(":");if(index!==-1){const parseAs=variable.substring(index+1);variable=variable.substring(0,index);switch(parseAs){case"number":this.convert=v=>{const r=parseFloat(v);if(Number.isNaN(r)){return void 0}return r};break;case"boolean":this.convert=v=>{if(v==="true"){return true}if(v==="false"){return false}};break}}this.variable=variable;(_a=this.name)!==null&&_a!==void 0?_a:this.name=variable}});_export("default",Route=class Route{static encodeUrl(url){return url}static create(route,queries,order=0){if(!route.startsWith("/")){throw new Error("String Route must start with /")}return new Route(route,queries,order)}constructor(route,queries,order=0){this.route=route;this.order=order;this.queries=new Map;this.variables=[];this.substitutions=[];if(queries){for(const iterator of queries){let[name,variable=name]=iterator.split("=");if(variable.startsWith("{")){variable=variable.substring(1,variable.length-1)}this.queries.set(name,variable)}}const tokens=route.substring(1).split(/\//g);let regex="^";this.substitutions.push("/");let catchAll=false;for(const iterator of tokens){if(regex.length>2){this.substitutions.push("/")}if(!iterator.startsWith("{")){this.substitutions.push(iterator);regex+=StringHelper.escapeRegExp("/");regex+=StringHelper.escapeRegExp(iterator);continue}if(!iterator.endsWith("}")){throw new Error("invalid route, missing end curly brace")}const v=new Variable(iterator.substring(1,iterator.length-1));regex+=v.regex;this.variables.push(v);this.substitutions.push(v);catchAll||(catchAll=v.catchAll)}if(!catchAll){regex+="\\/?$"}this.regex=new RegExp(regex,"i")}matches(route,q){var _a;const matches=this.regex.exec(route);if((matches===null||matches===void 0?void 0:matches.length)>0){const result={};const{groups}=matches;for(const iterator of this.variables){const v=groups[iterator.variable];if(v!==void 0&&v!==null){const converted=iterator.convert(decodeURIComponent(v));if(converted===void 0){return null}result[iterator.variable]=converted}}if(q){for(let[key,value]of q.entries()){const variable=(_a=this.queries.get(key))!==null&&_a!==void 0?_a:key;result[variable]=value}}return result}return null}substitute(vars){var _a;let result="";for(const iterator of this.substitutions){if(typeof iterator==="string"){result+=iterator;continue}result+=(_a=vars[iterator.variable])!==null&&_a!==void 0?_a:""}if(this.queries.size>0){result+="?";for(const[key,variable]of this.queries.entries()){const value=vars[variable];if(value){result+=`${encodeURIComponent(key)}=${encodeURIComponent(value)}&`}}}return result}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/Route");System.register(["tslib","./EventScope","./Route","./types"],(function(_export,_context){"use strict";var __awaiter,EventScope,Route,CancelToken,PageCommands,Command,Commands,routeSymbol,displayRouteSymbol,id,defaultOrSelf;_export({PageCommands:void 0,default:void 0,Commands:void 0});return{setters:[function(_tslib){__awaiter=_tslib.__awaiter},function(_EventScope){EventScope=_EventScope.default},function(_Route){Route=_Route.default},function(_types){CancelToken=_types.CancelToken}],execute:function(){_export("routeSymbol",routeSymbol=Symbol("routeSymbol"));_export("displayRouteSymbol",displayRouteSymbol=Symbol("displayRouteSymbol"));document.body.addEventListener("click",(ce=>{let target=ce.target;let clickCommand;let commandParameter;while(target){clickCommand=target.getAttribute("data-click-command");const cp=target.commandParameter;if(cp){commandParameter=cp}if(clickCommand){break}target=target.parentElement}if(!clickCommand){return}const cmd=Command.registry.get(clickCommand);if(cmd){cmd.eventScope.dispatch(target,commandParameter)}}));id=1;_export("PageCommands",PageCommands=class PageCommands{});defaultOrSelf=x=>{var _a;return(_a=x===null||x===void 0?void 0:x.default)!==null&&_a!==void 0?_a:x};_export("default",Command=class Command{static invokeRoute(route=(location.hash.startsWith("#!")?location.hash.substring(2):location.href),forceDisplay=false){let sp;if(/^http(s)?\:\/\//i.test(route)){const url=new URL(route);sp=url.searchParams;route=url.hash.startsWith("#!")?url.hash.substring(2):url.pathname}else{if(route.startsWith("#!")){route=route.substring(2)}}const index=route.indexOf("?");if(index!==-1){sp=new URLSearchParams(route.substring(index+1));route=route.substring(0,index)}else{sp!==null&&sp!==void 0?sp:sp=new URLSearchParams("")}for(const iterator of this.routes){const params=iterator.route.matches(route,sp);if(params){params[routeSymbol]=route;params[displayRouteSymbol]=forceDisplay?sp.size>0?`${route}?${sp.toString()}`:route:"";iterator.dispatch(params,true);return iterator}}}static create({name=`command${id++}`,eventScope=EventScope.create(),route,routeQueries,routeOrder=0,routeDefaults,pageLoader,pageListener,openPage,pushPage,registerOnClick,pushPageForResult,pushPageForResultOrCancel,listener}){let cmd=new Command(name,eventScope,registerOnClick);if(route){if(this.routePrefix){if(!route.startsWith(this.routePrefix)){route=this.routePrefix+route}}cmd=cmd.withRoute(route,routeQueries,routeOrder,routeDefaults)}cmd.listener=listener;if(openPage){let pageType;cmd.listener=ce=>__awaiter(this,void 0,void 0,(function*(){var _a;const p=(_a=ce.detail)!==null&&_a!==void 0?_a:{};return p.returnResult?PageCommands.pushPageForResult(pageType!==null&&pageType!==void 0?pageType:pageType=defaultOrSelf(yield openPage()),p):PageCommands.openPage(pageType!==null&&pageType!==void 0?pageType:pageType=defaultOrSelf(yield openPage()),p)}))}if(pushPage){let pageType;cmd.listener=ce=>__awaiter(this,void 0,void 0,(function*(){var _b;const p=(_b=ce.detail)!==null&&_b!==void 0?_b:{};return p.returnResult?PageCommands.pushPageForResult(pageType!==null&&pageType!==void 0?pageType:pageType=defaultOrSelf(yield pushPage()),p):PageCommands.pushPage(pageType!==null&&pageType!==void 0?pageType:pageType=defaultOrSelf(yield pushPage()),p)}))}if(pushPageForResult){let pageType;cmd.listener=ce=>__awaiter(this,void 0,void 0,(function*(){var _c;return PageCommands.pushPageForResult(pageType!==null&&pageType!==void 0?pageType:pageType=defaultOrSelf(yield pushPageForResult()),(_c=ce.detail)!==null&&_c!==void 0?_c:{})}))}if(pushPageForResultOrCancel){let pageType;cmd.listener=ce=>__awaiter(this,void 0,void 0,(function*(){var _d;try{return yield PageCommands.pushPageForResult(pageType!==null&&pageType!==void 0?pageType:pageType=defaultOrSelf(yield pushPageForResultOrCancel()),(_d=ce.detail)!==null&&_d!==void 0?_d:{})}catch(e){if(CancelToken.isCancelled(e)){return}console.error(e)}}))}if(pageLoader){let pageType;cmd.listener=ce=>__awaiter(this,void 0,void 0,(function*(){try{pageType!==null&&pageType!==void 0?pageType:pageType=defaultOrSelf(yield pageLoader());return pageListener(pageType)(ce)}catch(e){if(CancelToken.isCancelled(e)){return}console.error(e)}}))}return cmd}get eventName(){return this.eventScope.eventType}get route(){return this.routeObj}constructor(name=`command${id++}`,eventScope=EventScope.create(),registerOnClick=(p=>({"data-click-command":this.name,commandParameter:p}))){this.name=name;this.eventScope=eventScope;this.registerOnClick=registerOnClick;Command.registry.set(this.name,this)}displayRoute(p,absoluteUrl=false){let route=Route.encodeUrl(this.routeObj.substitute(p));if(absoluteUrl){if(route.startsWith("#!")){route=location.href.split("#")[0]+route}else if(route.startsWith("/")){route=location.protocol+"//"+location.host+route}}return route}withRoute(route,queries,order=0,defaults){this.routeObj=Route.create(route,queries,order);Command.routes.push(this);Command.routes.sort(((a,b)=>a.route.order-b.route.order));this.defaults=defaults;return this}listen(r,handler=this.listener){if(!handler){throw new Error("Handler must be specified...")}const d=this.eventScope.listen((e=>{const ce=e;try{ce.executed=true;ce.promise=handler(e)}catch(error){ce.promise=Promise.reject(error)}r.app.runAsync((()=>ce.promise))}));return r.registerDisposable(d)}dispatch(detail,cancelable){if(this.route){detail=this.updateRoute(detail)}this.eventScope.dispatch(document.body,detail,{cancelable,bubbles:true})}updateRoute(detail){const d=detail!==null&&detail!==void 0?detail:detail={};let r=d[routeSymbol];if(r===null||r===void 0){r=this.route.substitute(d);d[routeSymbol]=r;d[displayRouteSymbol]=r}const{defaults}=this;if(defaults){for(const key in defaults){if(Object.prototype.hasOwnProperty.call(defaults,key)){const element=defaults[key];if(d[key]===void 0){d[key]=element}}}}return detail}dispatchAsync(detail,cancelable){return __awaiter(this,void 0,void 0,(function*(){if(this.route){detail=this.updateRoute(detail)}const ce=new CustomEvent(this.eventScope.eventType,{detail,cancelable});ce.returnResult=true;window.dispatchEvent(ce);if(ce.executed){const promise=ce.promise;if(promise){return yield promise}}}))}});Command.routePrefix="";Command.registry=new Map;Command.routes=[];_export("Commands",Commands=class Commands{static install(control){this.app=control.app;for(const key in this){const element=this[key];if(element instanceof Command){element.listen(control)}}}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/Command");System.register([],(function(_export,_context){"use strict";var FormattedString;_export("default",void 0);return{setters:[],execute:function(){_export("default",FormattedString=class FormattedString{constructor(text){this.text=text}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/FormattedString");System.register([],(function(_export,_context){"use strict";var WebImage;_export("default",void 0);return{setters:[],execute:function(){_export("default",WebImage=class WebImage{constructor(url){this.url=url}toString(){return this.url}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/core/WebImage");System.register(["../../core/StringHelper"],(function(_export,_context){"use strict";var StringHelper,AtomStyle,emptyPrototype;_export("AtomStyle",void 0);return{setters:[function(_coreStringHelper){StringHelper=_coreStringHelper.StringHelper}],execute:function(){emptyPrototype=Object.getPrototypeOf({});_export("AtomStyle",AtomStyle=class AtomStyle{constructor(styleSheet,name){this.styleSheet=styleSheet;this.name=name;this.styleText=null;this.name=this.name+"-root"}getBaseProperty(tc,name){let c=tc;do{c=Object.getPrototypeOf(c);if(!c){throw new Error("No property descriptor found for "+name)}const pd=Object.getOwnPropertyDescriptor(c.prototype,name);if(!pd){continue}return pd.get.apply(this)}while(true)}build(){if(this.styleText){return}this.styleText=this.createStyleText("",[],this.root).join("\n")}toString(){return this.styleText}createStyleText(name,pairs,styles){const styleList=[];for(const key in styles){if(styles.hasOwnProperty(key)){if(/^(\_\$\_|className$|toString$)/i.test(key)){continue}const element=styles[key];if(element===undefined||element===null){continue}const keyName=StringHelper.fromCamelToHyphen(key);if(key==="subclasses"){const n=name;for(const subclassKey in element){if(element.hasOwnProperty(subclassKey)){const ve=element[subclassKey];pairs=this.createStyleText(`${n}${subclassKey}`,pairs,ve)}}}else{if(element.url){styleList.push(`${keyName}: url(${element})`)}else{styleList.push(`${keyName}: ${element}`)}}}}const cname=StringHelper.fromCamelToHyphen(name);const styleClassName=`${this.name}${cname}`;if(styleList.length){pairs.push(`.${styleClassName} { ${styleList.join(";\r\n")}; }`)}return pairs}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/styles/AtomStyle");System.register(["../../di/TypeKey"],(function(_export,_context){"use strict";var TypeKey,AtomStyleSheet;_export("AtomStyleSheet",void 0);return{setters:[function(_diTypeKey){TypeKey=_diTypeKey.TypeKey}],execute:function(){_export("AtomStyleSheet",AtomStyleSheet=class AtomStyleSheet{constructor(app,name){this.app=app;this.name=name;this.styles={};this.lastUpdateId=0;this.isAttaching=false;this.pushUpdate(0)}getNamedStyle(c){const name=TypeKey.getName(c);return this.createNamedStyle(c,name)}createNamedStyle(c,name,updateTimeout){const style=this.styles[name]=new c(this,`${this.name}-${name}`);style.build();this.pushUpdate(updateTimeout);return style}onPropertyChanging(name,newValue,oldValue){this.pushUpdate()}pushUpdate(delay=1){if(this.isAttaching){return}if(delay===0){this.attach();return}if(this.lastUpdateId){clearTimeout(this.lastUpdateId)}this.lastUpdateId=setTimeout((()=>{this.attach()}),delay)}dispose(){if(this.styleElement){this.styleElement.remove()}}attach(){this.isAttaching=true;const text=[];for(const key in this.styles){if(this.styles.hasOwnProperty(key)){const element=this.styles[key];text.push(element.toString())}}const textContent=text.join("\n");this.app.updateDefaultStyle(textContent);this.isAttaching=false}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/styles/AtomStyleSheet");System.register(["tslib","../../core/AtomBinder","../../core/AtomComponent","../../core/BindableProperty","../../core/Command","../../core/FormattedString","../../core/Hacks","../../core/WebImage","../../core/XNode","../../di/TypeKey","../styles/AtomStyle","../styles/AtomStyleSheet"],(function(_export,_context){"use strict";var __decorate,__metadata,AtomBinder,AtomComponent,BindableProperty,Command,FormattedString,refreshInherited,visitDescendents,WebImage,XNode,isControl,TypeKey,AtomStyle,AtomStyleSheet,AtomControl,isAtomControl,fromHyphenToCamel,defaultStyleSheets,ElementValueSetters,propertyId,getSelection,body,html;function setAttribute(name){return(ctrl,e,value)=>{e.setAttribute(name,value)}}function setEvent(name){return(ctrl,e,value)=>{ctrl.bindEvent(e,name,value)}}function setStyle(name,applyUnit){if(applyUnit){return(ctrl,e,value)=>{if(typeof value==="number"){e.style[name]=value+applyUnit;return}e.style[name]=value}}return(ctrl,e,value)=>{e.style[name]=value}}function disposeChildren(owner,e){if(!e){return}let s=e.firstElementChild;while(s){const c=s;s=s.nextElementSibling;const ac=c.atomControl;if(ac){ac.dispose();c.remove();continue}disposeChildren(owner,c);owner.unbind(c);owner.unbindEvent(c);c.remove()}}_export("AtomControl",void 0);return{setters:[function(_tslib){__decorate=_tslib.__decorate;__metadata=_tslib.__metadata},function(_coreAtomBinder){AtomBinder=_coreAtomBinder.AtomBinder},function(_coreAtomComponent){AtomComponent=_coreAtomComponent.AtomComponent},function(_coreBindableProperty){BindableProperty=_coreBindableProperty.BindableProperty},function(_coreCommand){Command=_coreCommand.default},function(_coreFormattedString){FormattedString=_coreFormattedString.default},function(_coreHacks){refreshInherited=_coreHacks.refreshInherited;visitDescendents=_coreHacks.visitDescendents},function(_coreWebImage){WebImage=_coreWebImage.default},function(_coreXNode){XNode=_coreXNode.default;isControl=_coreXNode.isControl},function(_diTypeKey){TypeKey=_diTypeKey.TypeKey},function(_stylesAtomStyle){AtomStyle=_stylesAtomStyle.AtomStyle},function(_stylesAtomStyleSheet){AtomStyleSheet=_stylesAtomStyleSheet.AtomStyleSheet}],execute:function(){isAtomControl=isControl;fromHyphenToCamel=input=>input.replace(/-([a-z])/g,(g=>g[1].toUpperCase()));if(typeof bridge!=="undefined"&&bridge.platform){throw new Error("AtomControl of Web should not be used with Xamarin Forms")}defaultStyleSheets={};_export("ElementValueSetters",ElementValueSetters={text(ctrl,e,value){e.textContent=value},["class"](ctrl,e,value){if(typeof value==="string"){e.className=value;return}ctrl.setElementClass(e,value,true)},alt:setAttribute("alt"),title:setAttribute("title"),href:setAttribute("href"),target:setAttribute("target"),style:setAttribute("style"),styleLeft:setStyle("left","px"),styleTop:setStyle("top","px"),styleBottom:setStyle("bottom","px"),styleRight:setStyle("right","px"),styleWidth:setStyle("width","px"),styleHeight:setStyle("height","px"),stylePosition:setStyle("position"),styleFontSize:setStyle("fontSize","px"),styleFontFamily:setStyle("fontFamily"),styleFontWeight:setStyle("fontWeight"),styleBorder:setStyle("border"),styleBorderWidth:setStyle("borderWidth","px"),styleBorderColor:setStyle("borderColor"),styleColor:setStyle("color"),styleBackgroundColor:setStyle("backgroundColor"),dir:setAttribute("dir"),name:setAttribute("name"),tabIndex:setAttribute("tabIndex"),contentEditable:setAttribute("contentEditable"),eventClick:setEvent("click"),eventKeydown:setEvent("keydown"),eventKeyup:setEvent("keyup"),eventKeypress:setEvent("keypress"),eventMousedown:setEvent("mousedown"),eventMouseup:setEvent("mouseup"),eventMousemove:setEvent("mousemove"),src(ctrl,e,value){if(value&&/^http\:/i.test(value)){e.src=value.substring(5);return}e.src=value},styleClass(ctrl,e,value){ctrl.setElementClass(e,value)},styleDisplay(ctrl,e,value){if(typeof value==="boolean"){e.style.display=value?"":"none";return}e.style.display=value},formattedText(ctrl,e,value){if(value instanceof FormattedString){value.applyTo(ctrl.app,e)}else{e.textContent=(value||"").toString()}},disabled(ctrl,e,value){if(value){e.setAttribute("disabled","");return}e.removeAttribute("disabled")},autofocus(ctrl,element,value){ctrl.app.callLater((()=>{const ie=element;if(ie){setTimeout((()=>requestAnimationFrame((()=>ie.focus()))),100)}}))},autocomplete(ctrl,element,value){ctrl.app.callLater((()=>{element.autocomplete=value}))},onCreate(ctrl,element,value){value(ctrl,element)},watch(ctrl,element,value){setTimeout(((c1,e1,v1)=>{e1.dispatchEvent(new CustomEvent("watch",{bubbles:true,cancelable:true,detail:{control:c1,value:v1}}))}),1,ctrl,element,value)},ariaLabel(ctrl,e,value){if(value===null){e.removeAttribute("aria-label");return}if(typeof value==="object"){value=JSON.stringify(value)}if(typeof value!=="string"){value=value.toString()}e.setAttribute("aria-label",value)},ariaPlaceholder(ctrl,e,value){if(value===null){e.removeAttribute("aria-placeholder");return}if(typeof value==="object"){value=JSON.stringify(value)}if(typeof value!=="string"){value=value.toString()}e.setAttribute("aria-placeholder",value)}});ElementValueSetters["aria-label"]=ElementValueSetters.ariaLabel;ElementValueSetters["aria-placeholder"]=ElementValueSetters.ariaPlaceholder;ElementValueSetters["style-display"]=ElementValueSetters.styleDisplay;ElementValueSetters["style-left"]=ElementValueSetters.styleLeft;ElementValueSetters["style-top"]=ElementValueSetters.styleTop;ElementValueSetters["style-bottom"]=ElementValueSetters.styleBottom;ElementValueSetters["style-right"]=ElementValueSetters.styleRight;ElementValueSetters["style-width"]=ElementValueSetters.styleWidth;ElementValueSetters["style-height"]=ElementValueSetters.styleHeight;ElementValueSetters["style-position"]=ElementValueSetters.stylePosition;ElementValueSetters["style-font-size"]=ElementValueSetters.styleFontSize;ElementValueSetters["style-font-family"]=ElementValueSetters.styleFontFamily;ElementValueSetters["style-font-weight"]=ElementValueSetters.styleFontWeight;ElementValueSetters["style-border"]=ElementValueSetters.styleBorder;ElementValueSetters["style-border-width"]=ElementValueSetters.styleBorderWidth;ElementValueSetters["style-border-color"]=ElementValueSetters.styleBorderColor;ElementValueSetters["style-color"]=ElementValueSetters.styleColor;ElementValueSetters["style-background-color"]=ElementValueSetters.styleBackgroundColor;ElementValueSetters["on-create"]=ElementValueSetters.onCreate;propertyId=1;_export("AtomControl",AtomControl=class AtomControl extends AtomComponent{static from(e1){var _a;let e=e1;while(e){const{atomControl}=e;if(atomControl){return atomControl}e=(_a=e._logicalParent)!==null&&_a!==void 0?_a:e.parentElement}}static registerProperty(attributeName,attributeValue,setter){const setterSymbol=`${attributeName}_${attributeValue}_${propertyId++}`;ElementValueSetters[setterSymbol]=setter;function setterFx(v){return{[setterSymbol]:v}}setterFx.toString=()=>setterSymbol;setterFx.property=setterSymbol;return setterFx}get controlStyle(){if(this.mControlStyle===undefined){const key=TypeKey.getName(this.defaultControlStyle||this.constructor);this.mControlStyle=defaultStyleSheets[key];if(this.mControlStyle){return this.mControlStyle}if(this.defaultControlStyle){this.mControlStyle=defaultStyleSheets[key]||(defaultStyleSheets[key]=this.theme.createNamedStyle(this.defaultControlStyle,key))}this.mControlStyle=this.mControlStyle||null}return this.mControlStyle}set controlStyle(v){if(v instanceof AtomStyle){this.mControlStyle=v}else{const key=TypeKey.getName(v);this.mControlStyle=defaultStyleSheets[key]||(defaultStyleSheets[key]=this.theme.createNamedStyle(v,key))}AtomBinder.refreshValue(this,"controlStyle");this.invalidate()}get theme(){return this.mTheme||this.mCachedTheme||(this.mCachedTheme=this.parent?this.parent.theme:this.app.resolve(AtomStyleSheet,false,null))}set theme(v){this.mTheme=v;refreshInherited(this,"theme")}get parent(){let e=this.element._logicalParent||this.element.parentElement;if(!e){return null}while(e){const ac=e.atomControl;if(ac){return ac}e=e._logicalParent||e.parentElement}}get factory(){return AtomControl}constructor(app,e=document.createElement("div")){super(app,e)}onPropertyChanged(name){super.onPropertyChanged(name);switch(name){case"theme":this.mCachedTheme=null;AtomBinder.refreshValue(this,"style");break;case"renderer":this.rendererChanged();break}}atomParent(e){var _a;while(e){const ac=e.atomControl;if(ac){return ac}e=(_a=e._logicalParent)!==null&&_a!==void 0?_a:e.parentElement}}append(element){if(element instanceof AtomControl){this.element.appendChild(element.element)}else{this.element.appendChild(element)}return this}updateSize(){this.onUpdateSize();visitDescendents(this.element,((e,ac)=>{if(ac){ac.updateSize();return false}return true}))}rendererChanged(){disposeChildren(this,this.element);this.element.innerHTML="";const r=this.renderer;if(!r){return}delete this.render;this.render(r)}preCreate(){}setElementValue(element,name,value){if(value===undefined){return}const setter=ElementValueSetters[name];if(setter!==void 0){setter(this,element,value);return}if(/^(data|aria)\-/.test(name)){if(value===null){element.removeAttribute(name);return}if(typeof value==="object"){value=JSON.stringify(value)}if(typeof value!=="string"){value=value.toString()}element.setAttribute(name,value);return}if(/^style/.test(name)){name=name.substring(5);if(name.startsWith("-")){name=fromHyphenToCamel(name.substring(1))}else{name=name.charAt(0).toLowerCase()+name.substring(1)}if(value instanceof WebImage){value=`url(${value})`}element.style[name]=value;return}if(/^event/.test(name)){name=name.substring(5);if(name.startsWith("-")){name=fromHyphenToCamel(name.substring(1))}else{name=name.charAt(0).toLowerCase()+name.substring(1)}this.bindEvent(element,name,value);return}if(name.startsWith("aria-")){element.setAttribute(name,value)}else{element[name]=value}}setElementClass(element,value,clear){const s=value;if(s&&typeof s==="object"){if(!s.className){if(clear){let sr="";for(const key in s){if(s.hasOwnProperty(key)){const sv=s[key];if(sv){sr+=sr?" "+key:key}}}element.className=sr;return}for(const key in s){if(s.hasOwnProperty(key)){const sv=s[key];if(sv){if(!element.classList.contains(key)){element.classList.add(key)}}else{if(element.classList.contains(key)){element.classList.remove(key)}}}}return}}const sv1=s?s.className||s.toString():"";element.className=sv1}onUpdateSize(){}removeAllChildren(e){let child=e.firstElementChild;while(child){const c=child;child=child.nextElementSibling;const ac=c;if(ac&&ac.atomControl){ac.atomControl.dispose()}else{this.unbindEvent(child);this.unbind(child)}c.remove()}}createNode(app,e,iterator,creator){const name=iterator.name;const attributes=iterator.attributes;if(typeof name==="string"){const element=document.createElement(name);if(name==="input"){if(!attributes.autocomplete){this.app.callLater((()=>{element.autocomplete="google-stop"}))}}e===null||e===void 0?void 0:e.appendChild(element);this.render(iterator,element,creator);return element}if(name[isAtomControl]){const forName=attributes===null||attributes===void 0?void 0:attributes.for;const ctrl=new name(app,forName?document.createElement(forName):undefined);const element=ctrl.element;e===null||e===void 0?void 0:e.appendChild(element);ctrl.render(iterator,element,creator);return element}throw new Error(`not implemented create for ${iterator.name}`)}toTemplate(app,iterator,creator){var _a;if(iterator.isTemplate){return this.toTemplate(app,iterator.children[0],creator)}const name=iterator.name;if(typeof name==="string"){return class Template extends AtomControl{constructor(a=app,e=document.createElement(name)){super(a,e)}create(){super.create();this.render(iterator,undefined,creator)}}}if(name[isAtomControl]){const forName=(_a=name.attributes)===null||_a===void 0?void 0:_a.for;if(forName){return class Template extends name{constructor(a=app,e=document.createElement(forName)){super(a,e)}create(){super.create();this.render(iterator,undefined,creator)}}}return class Template extends name{constructor(a=app,e){super(a,e)}create(){super.create();this.render(iterator,undefined,creator)}}}throw new Error(`Creating template from ${name} not supported`)}dispatchClickEvent(e,data){let clickEvent=data.clickEvent;if(!clickEvent){return}clickEvent=clickEvent.replace(/-([a-z])/g,(g=>g[1].toUpperCase()));const ce=new CustomEvent(clickEvent,{detail:data,bubbles:true,cancelable:true});e.target.dispatchEvent(ce);if(ce.preventClickEvent){e.preventDefault()}}});__decorate([BindableProperty,__metadata("design:type",XNode)],AtomControl.prototype,"renderer",void 0);getSelection=()=>{const sel=window.getSelection();if(sel.rangeCount){var frag=sel.getRangeAt(0).cloneContents();var el=document.createElement("div");el.appendChild(frag);return el.innerHTML}return""};body=document.body;html=body.parentElement;window.addEventListener("click",(e=>{if(e.defaultPrevented){return}if(getSelection()){return}const originalTarget=e.target;let start=originalTarget;if(originalTarget===html){return}let clickEvent;while(start&&start!==body){clickEvent||(clickEvent=start.getAttribute("data-click-event"));if(start.tagName==="A"){if(!clickEvent){return}if(clickEvent==="route"){const{href}=start;if(href){if(Command.invokeRoute(href,true)){e.preventDefault();e.stopImmediatePropagation();e.stopPropagation()}}}e.preventDefault();e.stopImmediatePropagation();e.stopPropagation();break}start=start.parentNode}let control=AtomControl.from(originalTarget);if(control!==void 0){const data=new Proxy(originalTarget,{get(target,p){if(typeof p!=="string"){return}while(target){const value=target.dataset[p];if(value!==void 0){return value}target=target.parentElement}}});control.dispatchClickEvent(e,data)}}))}}}));AmdLoader.instance.setup("@web-atoms/core/dist/web/controls/AtomControl");System.register(["./Register","./ServiceCollection"],(function(_export,_context){"use strict";var Register,Scope;function DISingleton(mockOrInject){return target=>{Register({scope:Scope.Global,mockOrInject})(target)}}_export("default",DISingleton);return{setters:[function(_Register){Register=_Register.Register},function(_ServiceCollection){Scope=_ServiceCollection.Scope}],execute:function(){}}}));AmdLoader.instance.setup("@web-atoms/core/dist/di/DISingleton");System.register([],(function(_export,_context){"use strict";var cloneSource;return{setters:[],execute:function(){cloneSource=Symbol("cloneSource");_export("default",cloneSource)}}}));AmdLoader.instance.setup("@web-atoms/entity/dist/models/cloneSource");System.register(["./cloneSource"],(function(_export,_context){"use strict";var cloneSource,Cloner,PropertyCloner,getKey;_export({Cloner:void 0,PropertyCloner:void 0});return{setters:[function(_cloneSource){cloneSource=_cloneSource.default}],execute:function(){getKey=(target,value)=>{for(const key in target){if(Object.prototype.hasOwnProperty.call(target,key)){const element=target[key];if(element===value){return key}}}};_export("Cloner",Cloner=class Cloner{static copyProperties(src,dest={}){dest[cloneSource]=src;for(const key in src){if(Object.prototype.hasOwnProperty.call(src,key)){const element=src[key];switch(typeof element){case"bigint":case"boolean":case"number":case"string":dest[key]=element;break;case"object":if(element===null){dest[key]=null}if(element instanceof Date){dest[key]=element}break}}}return dest}get copy(){const copy=Cloner.copyProperties(this.item);if(this.path){for(const iterator of this.path){this.clone(this.item,copy,iterator)}}return copy}constructor(item,path){this.item=item;this.path=path;this.$type=item.$type}include(property){const last=[property];return new PropertyCloner(this.item,this.path?[...this.path,last]:[last],last)}clone(src,dest,paths){var _a,_b,_c;if(!paths.length){return dest}const[first,...others]=paths;let p=first(src);if(!p){return dest}const original=p;const name=getKey(src,p);if(Array.isArray(p)){const existing=(_a=dest[name])!==null&&_a!==void 0?_a:dest[name]=[];for(let index=0;index<p.length;index++){const element=p[index];const existingItem=(_b=existing[index])!==null&&_b!==void 0?_b:existing[index]={};Cloner.copyProperties(element,existingItem);this.clone(element,existingItem,others)}return existing}p=Cloner.copyProperties(p,(_c=dest[name])!==null&&_c!==void 0?_c:undefined);dest[name]=p;this.clone(original,p,others);return dest}});_export("PropertyCloner",PropertyCloner=class PropertyCloner extends Cloner{constructor(item,path,propertyPath){super(item,path);this.propertyPath=propertyPath}thenInclude(property){this.propertyPath.push(property);return new PropertyCloner(this.item,this.path,this.propertyPath)}})}}}));AmdLoader.instance.setup("@web-atoms/entity/dist/models/Cloner");System.register([],(function(_export,_context){"use strict";var EntityContext;_export("EntityContext",void 0);return{setters:[],execute:function(){_export("EntityContext",EntityContext=class EntityContext{constructor(models){this.models=models;this.cache=[];for(const iterator of models){this.cache[iterator.name]=iterator}}for(name){return this.cache[name]}})}}}));AmdLoader.instance.setup("@web-atoms/entity/dist/models/IEntityModel");System.register([],(function(_export,_context){"use strict";var JsonError;_export("default",void 0);return{setters:[],execute:function(){_export("default",JsonError=class JsonError extends Error{constructor(message,json){super(message);this.json=json}get errors(){var _a;return(_a=this.json.paramErrors)!==null&&_a!==void 0?_a:[]}get details(){var _a;const{errors}=this;if(errors.length){return errors.map((x=>`${x.name}: ${x.reason}`)).join("\n")}return(_a=this.json)===null||_a===void 0?void 0:_a.details}})}}}));AmdLoader.instance.setup("@web-atoms/core/dist/services/http/JsonError");System.register([],(function(_export,_context){"use strict";var Queue;_export("default",void 0);return{setters:[],execute:function(){_export("default",Queue=class Queue{constructor(){this.head=0;this.tail=0;this.store=new Map}peek(){return this.store.get(this.head)}enqueue(item){this.store.set(this.tail,item);this.tail++}dequeue(){const{head,tail}=this;const size=tail-head;if(size<=0){return void 0}const item=this.store.get(head);this.store.delete(head);this.head++;if(this.head===this.tail){this.head=0;this.tail=0}return item}})}}}));AmdLoader.instance.setup("@web-atoms/entity/dist/models/Queue");System.register(["./Queue"],(function(_export,_context){"use strict";var Queue,TaskManager;_export("default",void 0);return{setters:[function(_Queue){Queue=_Queue.default}],execute:function(){_export("default",TaskManager=class TaskManager{constructor(){this.rateLimit=10;this.running=new Set;this.waiting=new Queue}run(fx){const pr=new Promise(((resolve,reject)=>{this.waiting.enqueue({resolve,reject,fx})}));pr.catch((error=>console.error(error)));this.processQueue();return pr}processQueue(){for(;;){if(this.running.size>=this.rateLimit){return}const t=this.waiting.dequeue();if(!t){return}const{fx,resolve,reject}=t;this.running.add(fx);fx().then((r=>{this.running.delete(fx);setTimeout((()=>this.processQueue()),1);resolve(r)}),(e=>{this.running.delete(fx);setTimeout((()=>this.processQueue()),1);reject(e)}))}}})}}}));AmdLoader.instance.setup("@web-atoms/entity/dist/models/TaskManager");System.register(["tslib","@web-atoms/core/dist/services/http/JsonError","../models/TaskManager"],(function(_export,_context){"use strict";var __awaiter,JsonError,TaskManager,TextBody,HttpSession;function merge(url,extra){return url+(typeof extra==="string"?extra:combine(extra))}function combine([url,params]){let separator=url.indexOf("?")===-1?"?":"&";if(!url.endsWith("&")){url+=separator;separator=""}for(const key in params){if(params.hasOwnProperty(key)){const element=params[key];url+=separator;separator="&";url+=`${key}=${encodeURIComponent(element)}`}}return url}_export({merge,combine,TextBody:void 0,default:void 0});return{setters:[function(_tslib){__awaiter=_tslib.__awaiter},function(_webAtomsCoreDistServicesHttpJsonError){JsonError=_webAtomsCoreDistServicesHttpJsonError.default},function(_modelsTaskManager){TaskManager=_modelsTaskManager.default}],execute:function(){_export("TextBody",TextBody=class TextBody{constructor(text){this.text=text}toString(){return this.text}});_export("default",HttpSession=class HttpSession extends TaskManager{constructor(){super(...arguments);this.rateLimit=10;this.resultConverter=e=>e}fetchJson(options){return this.run((()=>this.uncheckedFetchJson(options)))}uncheckedFetchJson(options){var _a,_b,_c,_d,_e,_f;return __awaiter(this,void 0,void 0,(function*(){if(options.cancelToken){const ab=new AbortController;options.signal=ab.signal;options.cancelToken.registerForCancel((()=>{ab.abort()}))}let response;if(this.interceptFetch){response=yield this.interceptFetch(options.url,options)}else{response=yield fetch(options.url,options)}const contentType=(_a=response.headers.get("Content-Type"))===null||_a===void 0?void 0:_a.toString();if(response.status>=400){if(contentType===null||contentType===void 0?void 0:contentType.includes("/json")){const error=yield response.json();throw new JsonError(typeof response==="string"?response:(_f=(_e=(_d=(_c=(_b=error.title)!==null&&_b!==void 0?_b:error.detail)!==null&&_c!==void 0?_c:error.message)!==null&&_d!==void 0?_d:error.exceptionMessage)!==null&&_e!==void 0?_e:error)!==null&&_f!==void 0?_f:"Json Server Error",error)}throw new Error(yield response.text())}if(contentType&&!contentType.includes("/json")){throw new Error(`Unable to convert to json\r\n${contentType}}`)}return this.resultConverter(yield response.json())}))}interceptFetch(input,init){throw new Error("not supported")}getJson(options){options.method="GET";return this.fetchJson(options)}postFormModel(options){var _a;options.method="POST";if(options.body){options.body=new TextBody(`formModel=${encodeURIComponent(JSON.stringify(options.body))}`)}(_a=options.headers)!==null&&_a!==void 0?_a:options.headers={};options.headers["content-type"]="application/x-www-form-urlencoded";return this.fetchJson(options)}postJson(options){var _a;options.method="POST";if(options.body){options.body=JSON.stringify(options.body)}(_a=options.headers)!==null&&_a!==void 0?_a:options.headers={};options.headers["content-type"]="application/json";return this.fetchJson(options)}deleteJson(options){var _a;options.method="DELETE";if(options.body){options.body=JSON.stringify(options.body)}(_a=options.headers)!==null&&_a!==void 0?_a:options.headers={};options.headers["content-type"]="application/json";return this.fetchJson(options)}putJson(options){var _a;options.method="PUT";if(options.body){options.body=JSON.stringify(options.body)}(_a=options.headers)!==null&&_a!==void 0?_a:options.headers={};options.headers["content-type"]="application/json";return this.fetchJson(options)}});delete HttpSession.prototype.interceptFetch}}}));AmdLoader.instance.setup("@web-atoms/entity/dist/services/HttpSession");System.register(["../models/cloneSource"],(function(_export,_context){"use strict";var cloneSource,isObject;function mergeProperties(src,target,path="0",visited=new Map,merged=new Map){if(visited.has(path)){return}if(merged.has(target)){return}merged.set(target,true);visited.set(path,true);if(Array.isArray(src)){for(let index=0;index<src.length;index++){const srcElement=src[index];const targetElement=target[index];if(isObject(targetElement)){mergeProperties(srcElement,targetElement,`${path}.${index}`,visited,merged);continue}target[index]=targetElement}return}const cloneTarget=target[cloneSource];for(const key in src){if(Object.prototype.hasOwnProperty.call(src,key)){const srcElement=src[key];if(typeof srcElement!=="object"){if(srcElement!==void 0){target[key]=srcElement;if(cloneTarget){cloneTarget[key]=srcElement}}continue}if(srcElement instanceof Date){target[key]=srcElement;if(cloneTarget){cloneTarget[key]=srcElement}continue}const targetElement=target[key];if(isObject(targetElement)){if(cloneTarget){const cloneTargetElement=cloneTarget[key];if(cloneTargetElement){mergeProperties(srcElement,cloneTargetElement,path+".$"+key,visited,merged)}}mergeProperties(srcElement,targetElement,path+"."+key,visited,merged);continue}if(targetElement===void 0&&srcElement){target[key]=srcElement;continue}target[key]=targetElement;if(cloneTarget&&targetElement!==void 0){cloneTarget[key]=targetElement}}}}_export("default",mergeProperties);return{setters:[function(_modelsCloneSource){cloneSource=_modelsCloneSource.default}],execute:function(){isObject=o=>typeof o==="object"&&o!==null&&!(o instanceof Date)}}}));AmdLoader.instance.setup("@web-atoms/entity/dist/services/mergeProperties");System.register([],(function(_export,_context){"use strict";var StringHelper;_export("default",void 0);return{setters:[],execute:function(){_export("default",StringHelper=class StringHelper{static findParameter(f){let text=f.toString();let i=text.indexOf("=>");if(i!==-1){text=text.substring(0,i)}i=text.indexOf("(");if(i===-1){return text}text=text.substring(i+1);i=text.indexOf(")");return text.substring(0,i)}static contains(left,right){if(!left){return!right}return left.toLowerCase().includes(right.toLowerCase())}})}}}));AmdLoader.instance.setup("@web-atoms/entity/dist/services/StringHelper");System.register(["tslib","./StringHelper"],(function(_export,_context){"use strict";var __awaiter,StringHelper,QueryComposer,Query,replacer,convertToLinq;function append(original,...item){if(original){return[...original,...item]}return[...item]}_export({append,QueryComposer:void 0,default:void 0});return{setters:[function(_tslib){__awaiter=_tslib.__awaiter},function(_StringHelper){StringHelper=_StringHelper.default}],execute:function(){replacer=/(===)|(!==)|(\(\s*\{)|(\.[a-zA-Z0-9]+)|([a-zA-Z0-9]+\s*\:\s*\{?)/g;_export("convertToLinq",convertToLinq=x=>{x=x.replace(/(\s+)|((CastAs|EF)\_[0-9]\.default\.)/g,((s,first,second)=>{if(s===first){return" "}if(s.startsWith("EF")){return"EF."}if(s.startsWith("CastAs")){return"CastAs."}return s}));replacer.lastIndex=0;x=x.replace(replacer,(s=>{switch(s){case"===":return"==";case"!==":return"!=";case"({":return"( new {";case".some":return".Any";case".map":return".Select";case".filter":return".Where";case".find":return".FirstOrDefault";case".includes":return".Contains"}if(s.endsWith("{")){const index=s.indexOf(":");const v=s.substring(0,index)+" = new {";return v}const trimmed=s.trim();if(trimmed.endsWith(":")){return trimmed.substring(0,trimmed.length-1)+" = "}if(s.startsWith(".")&&s.length>2){return s[0]+s[1].toUpperCase()+s.substring(2)}return s}));return x});_export("QueryComposer",QueryComposer=class QueryComposer{constructor(separator=" || "){this.separator=separator;this.query="p => x => ";this.parameters={};this.index=0}add(p,q){if(this.index){this.query+=this.separator}const suffix=`_${this.index++}`;let text=q.toString();const pfn=StringHelper.findParameter(text).trim();text=text.substring(text.indexOf("=>")+2);const xfn=StringHelper.findParameter(text).trim();const target=this.parameters;for(const key in p){if(Object.prototype.hasOwnProperty.call(p,key)){const element=p[key];const name=`${key}${suffix}`;target[name]=element;text=text.split(`${pfn}.${key}`).join(`p.${name}`);text=text.split(`${xfn}.`).join(`x.`)}}text=text.substring(text.indexOf("=>")+2);this.query+=text}asQuery(){return[this.parameters,this.query]}});_export("default",Query=class Query{constructor(context,methods=[]){this.context=context;this.methods=methods;if(!methods){throw new Error("Methods cannot be empty")}}where(tOrP,q){return this.process("where",tOrP,q)}joinDateRange(start,end,step){return this.append(["joinDateRange","@0,@1,@2",start,end,step])}selectWith(model,tOrP,q){const nq=this.append(["selectWith",model.name]);return nq.process("select",tOrP,q)}select(tOrP,q){return this.process("select",tOrP,q)}whereLinq(query,...args){let filters="";const params=[];for(let index=0;index<args.length;index++){const element=args[index];const raw=query.raw[index];if(raw){filters+=raw}const pi=`@${index}`;filters+=pi;params.push(element)}const last=query.raw[args.length];if(last){filters+=last}return this.append(["where",filters,...params])}selectLinq(query,...args){let filters="";const params=[];for(let index=0;index<args.length;index++){const element=args[index];const raw=query.raw[index];if(raw){filters+=raw}const pi=`@${index}`;filters+=pi;params.push(element)}const last=query.raw[args.length];if(last){filters+=last}return this.append(["select",filters,...params])}join(model,left,right){return this.append(["join",model.name,this.convertToLinq(left.toString()),this.convertToLinq(right.toString())])}leftJoin(model,left,right){return this.append(["leftJoin",model.name,this.convertToLinq(left.toString()),this.convertToLinq(right.toString())])}include(tOrP,...q){if(typeof tOrP==="string"){return this.append(["include",tOrP],...q.map((s=>["include",s])))}const select=this.convertToLinq(tOrP.toString());return this.append(["include",select])}firstOrDefault(p={}){return __awaiter(this,void 0,void 0,(function*(){const lp=p;lp.size=1;lp.start=0;lp.count=false;const list=yield this.toPagedList(lp);return list.items[0]}))}orderBy(tOrP,q){return this.process("orderBy",tOrP,q)}orderByDescending(tOrP,q){return this.process("orderByDescending",tOrP,q)}thenBy(tOrP,q){return this.process("thenBy",tOrP,q)}thenByDescending(tOrP,q){return this.process("thenByDescending",tOrP,q)}trace(){this.context.traceQuery=true;return this}toArray({cancelToken,doNotResolve,hideActivityIndicator,cacheSeconds,cacheVersion}={}){return __awaiter(this,void 0,void 0,(function*(){const r=yield this.toPagedList({size:-1,count:false,cacheSeconds,cancelToken,doNotResolve,hideActivityIndicator,cacheVersion});return r.items}))}toPagedList({start=0,size=100,cancelToken,cacheVersion="1",hideActivityIndicator,splitInclude=false,cacheSeconds=0,cacheImmutable=cacheSeconds>0,count=true}={}){let url;const{traceQuery,name,service,queryFunction,args}=this.context;const trace=traceQuery;const methods=JSON.stringify(this.methods);const fm=new URLSearchParams;fm.append("methods",methods);if(start){fm.append("start",start.toString())}if(size){fm.append("size",size.toString())}fm.append("count",count.toString());if(trace){fm.append("trace",trace?"true":"false")}if(queryFunction){fm.append("function",queryFunction);fm.append("args",JSON.stringify(args!==null&&args!==void 0?args:"[]"))}const encodedMethods=fm.toString();if(encodedMethods.length>1824){if(cacheSeconds>0){throw new Error("Generated query too big for caching")}url=`${service.url}methods/${name}`;return service.postJson({url,cancelToken,body:{methods:this.methods,start,size,split:splitInclude,count,trace,function:queryFunction||void 0,args:queryFunction?args:void 0}})}if(cacheSeconds>0){fm.append("cache",cacheSeconds.toString());fm.append("cv",cacheVersion);if(!cacheImmutable){fm.append("cacheImmutable","false")}}else{}url=`${service.url}query/${name}?${fm.toString()}`;return service.getJson({url,cancelToken,hideActivityIndicator})}thenInclude(a){const select=this.convertToLinq(a.toString());return this.append(["thenInclude",select])}append(...methods){return new Query(this.context,[...this.methods,...methods])}process(name,tOrP,q){if(!q){const select=this.convertToLinq(tOrP.toString());return this.append([name,select])}const pl=[];let i=0;const p=tOrP;let text=q(p).toString();const pfn=StringHelper.findParameter(q.toString()).trim();for(const key in p){if(Object.prototype.hasOwnProperty.call(p,key)){const element=p[key];const pn=`@${i++}`;text=text.split(`${pfn}.${key}`).join(pn);pl.push(element)}}text=this.convertToLinq(text);return this.append([name,text,...pl])}convertToLinq(text){if(this.context.queryProcessor==="DotNet"){return convertToLinq(text)}return text.replace(/\s+/g," ")}})}}}));AmdLoader.instance.setup("@web-atoms/entity/dist/services/Query");System.register(["@web-atoms/date-time/dist/DateTime"],(function(_export,_context){"use strict";var DateTime,dateFormatISORegEx;function resolve(target){const cache=[];function map(t){if(typeof t!=="object"){return t}if(Array.isArray(t)){return t.map(map)}const{$id,$ref}=t;if($ref){t=cache[$ref];return t}if($id){t.$deleted=false;cache[$id]=t}for(const key in t){if(Object.prototype.hasOwnProperty.call(t,key)){let element=t[key];switch(typeof element){case"object":if(!element){continue}element=map(element);t[key]=element;continue;case"string":if(dateFormatISORegEx.test(element)){t[key]=new DateTime(element)}}}}return t}target=map(target);return target}_export("default",resolve);return{setters:[function(_webAtomsDateTimeDistDateTime){DateTime=_webAtomsDateTimeDistDateTime.default}],execute:function(){_export("dateFormatISORegEx",dateFormatISORegEx=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/)}}}));AmdLoader.instance.setup("@web-atoms/entity/dist/services/resolve");System.register(["tslib","../models/Cloner","../models/IEntityModel","./HttpSession","./mergeProperties","./Query","./resolve"],(function(_export,_context){"use strict";var __awaiter,Cloner,EntityContext,HttpSession,mergeProperties,Query,resolve,DefaultFactory,Model,BaseEntityService,ArrayPrototype;_export({DefaultFactory:void 0,Model:void 0,default:void 0});return{setters:[function(_tslib){__awaiter=_tslib.__awaiter},function(_modelsCloner){Cloner=_modelsCloner.Cloner},function(_modelsIEntityModel){EntityContext=_modelsIEntityModel.EntityContext},function(_HttpSession){HttpSession=_HttpSession.default},function(_mergeProperties){mergeProperties=_mergeProperties.default},function(_Query){Query=_Query.default},function(_resolve){resolve=_resolve.default}],execute:function(){ArrayPrototype=Array.prototype;ArrayPrototype.where=ArrayPrototype.filter;ArrayPrototype.any=ArrayPrototype.some;ArrayPrototype.select=ArrayPrototype.map;ArrayPrototype.selectMany=function(x){const r=[];for(const iterator of this){const items=x(iterator);if(Array.isArray(items)){r.push(...items)}}return r};ArrayPrototype.firstOrDefault=function(f){if(f){return ArrayPrototype.find.apply(this,arguments)}return this[0]};ArrayPrototype.sum=function(f){var _a;let n=0;for(const iterator of this){n+=(_a=f(iterator))!==null&&_a!==void 0?_a:0}return n};ArrayPrototype.average=function(f){var _a;if(this.length===0){return 0}let n=0;for(const iterator of this){n+=(_a=f(iterator))!==null&&_a!==void 0?_a:0}return n/this.length};ArrayPrototype.orderBy=function(f){return this.sort(((a,b)=>{const ak=f(a);const bk=f(b);if(typeof ak==="string"){return ak.toLowerCase().localeCompare(bk.toLowerCase())}return ak-bk}))};ArrayPrototype.thenBy=ArrayPrototype.orderBy;ArrayPrototype.orderByDescending=function(f){return this.sort(((a,b)=>{const ak=f(a);const bk=f(b);if(typeof ak==="string"){return bk.toLowerCase().localeCompare(ak.toLowerCase())}return bk-ak}))};ArrayPrototype.thenByDescending=ArrayPrototype.orderByDescending;ArrayPrototype.count=function(f){if(!f){return this.length}let length=0;for(const iterator of this){if(f(iterator)){length++}}return length};_export("DefaultFactory",DefaultFactory=class DefaultFactory{constructor(factory){this.factory=factory}});_export("Model",Model=class Model{constructor(name,keys=[],defaults=null,schema=null){this.name=name;this.keys=keys;this.schema=schema;if(defaults){this.defaults=[];for(const key in defaults){if(Object.prototype.hasOwnProperty.call(defaults,key)){const element=defaults[key];this.defaults.push([key,element])}}}}create(properties={}){properties.$type=this.name;if(this.defaults){for(const[key,value]of this.defaults){if(properties[key]===void 0){if(value instanceof DefaultFactory){properties[key]=value.factory()}else{properties[key]=value}}}}return properties}patch(original,updates){for(const iterator of this.keys){const originalKey=original[iterator];const updatedKey=updates[iterator];if(updatedKey&&updatedKey!==originalKey){throw new Error(`Cannot update ${iterator} as it is the primary key`)}updates[iterator]=originalKey}return Object.assign({$type:this.name},updates)}});_export("default",BaseEntityService=class BaseEntityService extends HttpSession{constructor(){super(...arguments);this.url="/api/entity/";this.resultConverter=resolve}cloner(item){return new Cloner(item)}model(){return __awaiter(this,void 0,void 0,(function*(){if(this.entityModel){return this.entityModel}const c=yield this.getJson({url:`${this.url}model`});this.entityModel=new EntityContext(c);return this.entityModel}))}dateRange(start,end,step){return new Query({service:this,name:"NeuroSpeech.EntityAccessControl.DateRange",traceQuery:false},[["dateRange","@0,@1,@2",start,end,step]])}query(m,queryFunction,...args){return new Query({service:this,name:m.name,queryProcessor:this.queryProcessor,queryFunction,args})}delete(body){const url=this.url;return this.deleteJson({url,body})}insert(body){const url=this.url;return this.putJson({url,body})}invoke(m,method,argEntity,...args){const entity={$type:m.name};for(const key of m.schema.keys){entity[key.name]=argEntity[key.name]}return this.postJson({url:`${this.url}invoke/${entity.$type}/${method}`,method:"POST",body:{entity,args}})}save(body,cloner,trace){return __awaiter(this,void 0,void 0,(function*(){if(Array.isArray(body)&&body.length===0){return body}let url=this.url;if(body instanceof Cloner){body=body.copy}if(trace){const hasQuery=url.includes("?");if(hasQuery){url=url+="&trace=true"}else{url=url+="?trace=true"}}if(cloner){if(Array.isArray(body)){body=body.map((x=>cloner(new Cloner(x)).copy))}else{const c=cloner(new Cloner(body));body=c.copy}}const result=yield this.postJson({url,body});mergeProperties(result,body);return body}))}update(e,update){return __awaiter(this,void 0,void 0,(function*(){yield this.bulkUpdate([e],update);for(const key in update){if(Object.prototype.hasOwnProperty.call(update,key)){const element=update[key];e[key]=element}}return e}))}bulkUpdate(entities,update,throwWhenNotFound=false){return __awaiter(this,void 0,void 0,(function*(){const model=yield this.model();const keys=[];for(const iterator of entities){const entityType=model.for(iterator.$type);const key={$type:iterator.$type};for(const{name}of entityType.keys){key[name]=iterator[name]}keys.push(key)}const body={keys,update,throwWhenNotFound};const url=`${this.url}bulk`;yield this.putJson({url,body})}))}bulkDelete(entities,throwWhenNotFound=false){return __awaiter(this,void 0,void 0,(function*(){const model=yield this.model();const keys=[];for(const iterator of entities){const entityType=model.for(iterator.$type);const key={$type:iterator.$type};for(const{name}of entityType.keys){key[name]=iterator[name]}keys.push(key)}const url=`${this.url}bulk`;const body={keys,throwWhenNotFound};yield this.deleteJson({url,body})}))}fetchJson(options){const _super=Object.create(null,{fetchJson:{get:()=>super.fetchJson}});return __awaiter(this,void 0,void 0,(function*(){if(!this.createBusyIndicator||(options===null||options===void 0?void 0:options.hideActivityIndicator)){return yield _super.fetchJson.call(this,options)}const disposable=this.createBusyIndicator(options);try{return yield _super.fetchJson.call(this,options)}finally{disposable===null||disposable===void 0?void 0:disposable.dispose()}}))}createBusyIndicator(options){return{dispose(){}}}});delete BaseEntityService.prototype.createBusyIndicator}}}));AmdLoader.instance.setup("@web-atoms/entity/dist/services/BaseEntityService");System.register([],(function(_export,_context){"use strict";var StyleFragment,id,nextId,first,addMarker,globalLow,global,globalHigh,localLow,local,localHigh,styles,styled,svgAsCssDataUrl;function*divide(text){const regex=/^(([^\{\n]+\{[\t\x20]*)|([^\n\}]*\}[^\S\n\r]*))$/gm;let m;let sentOnce=false;let lastIndex=0;let lastMatch;while((m=regex.exec(text))!==null){if(m.index===regex.lastIndex){regex.lastIndex++}const match=m[0];if(!sentOnce){sentOnce=true;yield text.substring(lastIndex,m.index);lastIndex=m.index+match.length;lastMatch=match;continue}if(lastMatch.includes("}")){yield[lastMatch.trim()];lastIndex=m.index+match.length;lastMatch=match;continue}yield[lastMatch,text.substring(lastIndex,m.index),match];lastIndex=m.index+match.length;lastMatch=match}if(lastMatch===null||lastMatch===void 0?void 0:lastMatch.includes("}")){yield[lastMatch.trim()]}}return{setters:[],execute:function(){id=1;nextId=()=>`styled-r${id++}`;first=document.head.firstElementChild;addMarker=name=>{const m=document.createElement("meta");m.name=name;if(first){first.insertAdjacentElement("afterend",m)}else{document.head.insertAdjacentElement("afterbegin",m)}first=m;return m};globalLow=addMarker("global-low-style");global=addMarker("global-style");globalHigh=addMarker("global-high-style");localLow=addMarker("local-low-style");local=addMarker("local-style");localHigh=addMarker("local-high-style");StyleFragment=class StyleFragment{static newStyle({selector="",content=""}){return new StyleFragment({selector,content})}constructor({selector,content}){this.order="low";this.selector=selector;this.content=content}expand(selector){selector!==null&&selector!==void 0?selector:selector=this.selector;let en=divide(this.content);let parts=en.next();if(parts.done){if(!this.content){return""}return`${selector} {\n${this.content}\n}`}const first=parts.value;let content=(first===null||first===void 0?void 0:first.trim())?`${selector} {\n${first}\n}\n`:"";let selectorStack=[];while(!(parts=en.next()).done){const[key,value]=parts.value;if(key.endsWith("}")){selector=selectorStack.pop();if(selector==="@"){content+="\n}\n";selector=selectorStack.pop()}continue}let keySelector=key.replace("{","");const isMedia=/\@/.test(keySelector);const replace=!isMedia;const replaced=replace?selector.split(",").map((x=>keySelector.replace(/\&/g,x).trim())).join(","):keySelector;selectorStack.push(selector);selector=replace?replaced:selector;if(isMedia){selectorStack.push("@")}if(value===null||value===void 0?void 0:value.trim()){content+=`${replaced} {\n${value}\n}\n`}else{if(isMedia){content+=`${replaced} {\n`}}}return content}toString(){return this.content.replace(/\\n/g,"")}installGlobal(selector="",id=this.id||selector,description){const style=document.createElement("style");style.textContent=this.expand(selector);if(description){style.setAttribute("data-desc",description)}switch(this.order){case"low":document.head.insertBefore(style,globalLow);break;case"default":case"medium":document.head.insertBefore(style,global);break;case"high":document.head.insertBefore(style,globalHigh);break}style.id=id}installLocal(prefix="",description=this.description){const selector=nextId();const style=document.createElement("style");const id=`${prefix}.${selector}`;style.id=id;style.textContent=this.expand(id);if(description){style.setAttribute("data-desc",description)}switch(this.order){case"low":document.head.insertBefore(style,localLow);break;case"default":case"medium":document.head.insertBefore(style,local);break;case"high":document.head.insertBefore(style,localHigh);break}return selector}withId(id){this.id=id;return this}withDescription(description){this.description=description;return this}withOrder(order){this.order=order;return this}};styles=[];styled={get styles(){return styles},css:(t,...a)=>{let r="";for(let index=0;index<t.length;index++){const element=t[index];r+=element;if(index<a.length){r+=a[index]}}return StyleFragment.newStyle({content:r})},add(x){styles.push(x)}};_export("default",styled);_export("svgAsCssDataUrl",svgAsCssDataUrl=text=>`url(${JSON.stringify(`data:image/svg+xml,${text}`)})`)}}}));AmdLoader.instance.setup("@web-atoms/core/dist/style/styled");System.register(["@web-atoms/core/dist/style/styled"],(function(_export,_context){"use strict";var styled,BusyProgress,css,container,stack;_export("default",void 0);return{setters:[function(_webAtomsCoreDistStyleStyled){styled=_webAtomsCoreDistStyleStyled.default}],execute:function(){css=styled.css`
16
16
 
17
17
  position: absolute;
18
18
  left: 0;