UNPKG

apprun

Version:

JavaScript library that has Elm inspired architecture, event pub-sub and components

2 lines 60.1 kB
/*! For license information please see apprun-html.js.LICENSE.txt */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.apprun=e():t.apprun=e()}(this,(()=>(()=>{"use strict";var t={320:(t,e,n)=>{n.d(e,{Fragment:()=>o.FK,createElement:()=>o.n,render:()=>o.cJ,safeHTML:()=>o.t_});var o=n(593)},593:(t,e,n)=>{n.d(e,{FK:()=>F,n:()=>J,t_:()=>Q,cJ:()=>Y});var o={};n.r(o),n.d(o,{boolean:()=>s,booleanish:()=>a,commaOrSpaceSeparated:()=>p,commaSeparated:()=>d,number:()=>c,overloadedBoolean:()=>u,spaceSeparated:()=>h});var r=n(741);class l{constructor(t,e){this.attribute=e,this.property=t}}l.prototype.attribute="",l.prototype.booleanish=!1,l.prototype.boolean=!1,l.prototype.commaOrSpaceSeparated=!1,l.prototype.commaSeparated=!1,l.prototype.defined=!1,l.prototype.mustUseProperty=!1,l.prototype.number=!1,l.prototype.overloadedBoolean=!1,l.prototype.property="",l.prototype.spaceSeparated=!1,l.prototype.space=void 0;let i=0;const s=f(),a=f(),u=f(),c=f(),h=f(),d=f(),p=f();function f(){return 2**++i}const g=Object.keys(o);class m extends l{constructor(t,e,n,r){let l=-1;if(super(t,e),y(this,"space",r),"number"==typeof n)for(;++l<g.length;){const t=g[l];y(this,g[l],(n&o[t])===o[t])}}}function y(t,e,n){n&&(t[e]=n)}function v(t){return t.toLowerCase()}m.prototype.defined=!0;const _=/[A-Z]/g,b=/-[a-z]/g,A=/^data[-\w.:]+$/i;function $(t){return"-"+t.toLowerCase()}function E(t){return t.charAt(1).toUpperCase()}class S{constructor(t,e,n){this.normal=e,this.property=t,n&&(this.space=n)}}function w(t,e){const n={},o={};for(const e of t)Object.assign(n,e.property),Object.assign(o,e.normal);return new S(n,o,e)}function C(t){const e={},n={};for(const[o,r]of Object.entries(t.properties)){const l=new m(o,t.transform(t.attributes||{},o),r,t.space);t.mustUseProperty&&t.mustUseProperty.includes(o)&&(l.mustUseProperty=!0),e[o]=l,n[v(o)]=o,n[v(l.attribute)]=o}return new S(e,n,t.space)}S.prototype.normal={},S.prototype.property={},S.prototype.space=void 0;const k=C({properties:{ariaActiveDescendant:null,ariaAtomic:a,ariaAutoComplete:null,ariaBusy:a,ariaChecked:a,ariaColCount:c,ariaColIndex:c,ariaColSpan:c,ariaControls:h,ariaCurrent:null,ariaDescribedBy:h,ariaDetails:null,ariaDisabled:a,ariaDropEffect:h,ariaErrorMessage:null,ariaExpanded:a,ariaFlowTo:h,ariaGrabbed:a,ariaHasPopup:null,ariaHidden:a,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:h,ariaLevel:c,ariaLive:null,ariaModal:a,ariaMultiLine:a,ariaMultiSelectable:a,ariaOrientation:null,ariaOwns:h,ariaPlaceholder:null,ariaPosInSet:c,ariaPressed:a,ariaReadOnly:a,ariaRelevant:null,ariaRequired:a,ariaRoleDescription:h,ariaRowCount:c,ariaRowIndex:c,ariaRowSpan:c,ariaSelected:a,ariaSetSize:c,ariaSort:null,ariaValueMax:c,ariaValueMin:c,ariaValueNow:c,ariaValueText:null,role:null},transform:(t,e)=>"role"===e?e:"aria-"+e.slice(4).toLowerCase()});function P(t,e){return e in t?t[e]:e}function x(t,e){return P(t,e.toLowerCase())}const O=C({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:d,acceptCharset:h,accessKey:h,action:null,allow:null,allowFullScreen:s,allowPaymentRequest:s,allowUserMedia:s,alt:null,as:null,async:s,autoCapitalize:null,autoComplete:h,autoFocus:s,autoPlay:s,blocking:h,capture:null,charSet:null,checked:s,cite:null,className:h,cols:c,colSpan:null,content:null,contentEditable:a,controls:s,controlsList:h,coords:c|d,crossOrigin:null,data:null,dateTime:null,decoding:null,default:s,defer:s,dir:null,dirName:null,disabled:s,download:u,draggable:a,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:s,formTarget:null,headers:h,height:c,hidden:u,high:c,href:null,hrefLang:null,htmlFor:h,httpEquiv:h,id:null,imageSizes:null,imageSrcSet:null,inert:s,inputMode:null,integrity:null,is:null,isMap:s,itemId:null,itemProp:h,itemRef:h,itemScope:s,itemType:h,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:s,low:c,manifest:null,max:null,maxLength:c,media:null,method:null,min:null,minLength:c,multiple:s,muted:s,name:null,nonce:null,noModule:s,noValidate:s,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:s,optimum:c,pattern:null,ping:h,placeholder:null,playsInline:s,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:s,referrerPolicy:null,rel:h,required:s,reversed:s,rows:c,rowSpan:c,sandbox:h,scope:null,scoped:s,seamless:s,selected:s,shadowRootClonable:s,shadowRootDelegatesFocus:s,shadowRootMode:null,shape:null,size:c,sizes:null,slot:null,span:c,spellCheck:a,src:null,srcDoc:null,srcLang:null,srcSet:null,start:c,step:null,style:null,tabIndex:c,target:null,title:null,translate:null,type:null,typeMustMatch:s,useMap:null,value:a,width:c,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:h,axis:null,background:null,bgColor:null,border:c,borderColor:null,bottomMargin:c,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:s,declare:s,event:null,face:null,frame:null,frameBorder:null,hSpace:c,leftMargin:c,link:null,longDesc:null,lowSrc:null,marginHeight:c,marginWidth:c,noResize:s,noHref:s,noShade:s,noWrap:s,object:null,profile:null,prompt:null,rev:null,rightMargin:c,rules:null,scheme:null,scrolling:a,standby:null,summary:null,text:null,topMargin:c,valueType:null,version:null,vAlign:null,vLink:null,vSpace:c,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:s,disableRemotePlayback:s,prefix:null,property:null,results:c,security:null,unselectable:null},space:"html",transform:x}),T=C({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:p,accentHeight:c,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:c,amplitude:c,arabicForm:null,ascent:c,attributeName:null,attributeType:null,azimuth:c,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:c,by:null,calcMode:null,capHeight:c,className:h,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:c,diffuseConstant:c,direction:null,display:null,dur:null,divisor:c,dominantBaseline:null,download:s,dx:null,dy:null,edgeMode:null,editable:null,elevation:c,enableBackground:null,end:null,event:null,exponent:c,externalResourcesRequired:null,fill:null,fillOpacity:c,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:d,g2:d,glyphName:d,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:c,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:c,horizOriginX:c,horizOriginY:c,id:null,ideographic:c,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:c,k:c,k1:c,k2:c,k3:c,k4:c,kernelMatrix:p,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:c,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:c,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:c,overlineThickness:c,paintOrder:null,panose1:null,path:null,pathLength:c,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:h,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:c,pointsAtY:c,pointsAtZ:c,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:p,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:p,rev:p,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:p,requiredFeatures:p,requiredFonts:p,requiredFormats:p,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:c,specularExponent:c,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:c,strikethroughThickness:c,string:null,stroke:null,strokeDashArray:p,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:c,strokeOpacity:c,strokeWidth:null,style:null,surfaceScale:c,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:p,tabIndex:c,tableValues:null,target:null,targetX:c,targetY:c,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:p,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:c,underlineThickness:c,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:c,values:null,vAlphabetic:c,vMathematical:c,vectorEffect:null,vHanging:c,vIdeographic:c,version:null,vertAdvY:c,vertOriginX:c,vertOriginY:c,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:c,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:P}),M=C({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(t,e)=>"xlink:"+e.slice(5).toLowerCase()}),R=C({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:x}),L=C({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(t,e)=>"xml:"+e.slice(3).toLowerCase()}),U=w([k,O,M,R,L],"html"),D=w([k,T,M,R,L],"svg"),N="_props",H=new Map;function j(t,e,n){!function(t){return null!=t&&!1!==t&&""!==t&&(!0===t||("string"==typeof t?"false"!==t.toLowerCase()&&"0"!==t:Boolean(t)))}(n)?t.removeAttribute(e):t.setAttribute(e,e)}function B(t,e,n){try{t[e]=n}catch(o){I(t,e,n,!1)}}function I(t,e,n,o){if(null==n)return void t.removeAttribute(e);const r=String(n);if(o&&e.includes(":")){const[n]=e.split(":");"xlink"===n?t.setAttributeNS("http://www.w3.org/1999/xlink",e,r):t.setAttribute(e,r)}else t.setAttribute(e,r)}function W(t,e,n,o){if(r=t,i=e,document.activeElement===r?["selectionStart","selectionEnd","selectionDirection"].includes(i):"scrollTop"===i||"scrollLeft"===i||r instanceof HTMLMediaElement&&["currentTime","paused","playbackRate","volume"].includes(i))return;var r,i;if("style"===e){if(t.style.cssText&&(t.style.cssText=""),"string"==typeof n)t.style.cssText=n;else if(n&&"object"==typeof n)for(const e in n)t.style[e]!==n[e]&&(t.style[e]=n[e]);return}if("key"===e)return void(null!=n&&(t.key=n));if(e.startsWith("data-"))return void function(t,e,n){const o=(r=e.slice(5)).length<=1?r.toLowerCase():r.split("-").map(((t,e)=>0===e?t.toLowerCase():t.charAt(0).toUpperCase()+t.slice(1).toLowerCase())).join("");var r;null==n?delete t.dataset[o]:t.dataset[o]=String(n)}(t,e,n);if(e.startsWith("on"))return void function(t,e,n){e.startsWith("on")&&(n&&"function"!=typeof n?"string"==typeof n&&(n?t.setAttribute(e,n):t.removeAttribute(e)):t[e]=n)}(t,e,n);if(!("INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&"SELECT"!==t.tagName||"value"!==e&&"selected"!==e&&"selectedIndex"!==e))return void B(t,e,n);if("INPUT"===t.tagName&&"checked"===e)return B(t,e,n),void j(t,e,n);const s=function(t,e){const n=`${t}:${e}`;let o=H.get(n);return void 0===o&&(o=function(t,e){const n=v(e);let o=e,r=l;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&"data"===n.slice(0,4)&&A.test(e)){if("-"===e.charAt(4)){const t=e.slice(5).replace(b,E);o="data"+t.charAt(0).toUpperCase()+t.slice(1)}else{const t=e.slice(4);if(!b.test(t)){let n=t.replace(_,$);"-"!==n.charAt(0)&&(n="-"+n),e="data"+n}}r=m}return new r(o,e)}(e?D:U,t)||null,H.set(n,o)),o}(e,o);s?s.boolean||s.overloadedBoolean?j(t,s.attribute,n):s.mustUseProperty&&!o?B(t,s.property,n):I(t,s.attribute,n,o):e.startsWith("aria-")||"role"===e?I(t,e,n,o):e in t||void 0!==t[e]?B(t,e,n):I(t,e,n,o)}function z(t){return/^[a-zA-Z_:][\w\-:.]*$/.test(t)&&!t.includes("<")&&!t.includes(">")&&!t.includes('"')&&!t.includes("'")}function V(t,e,n){const o=function(t,e){if(e&&(e.class=e.class||e.className,delete e.className),!t||0===Object.keys(t).length)return e||{};if(!e||0===Object.keys(e).length){const e={};return Object.keys(t).forEach((t=>e[t]=null)),e}const n={};return Object.keys(t).forEach((t=>{t in e||(n[t]=null)})),Object.keys(e).forEach((t=>n[t]=e[t])),n}(t[N]||{},e);t[N]=e||{},function(t,e,n,o){for(const n in e)z(n)&&W(t,n,e[n],o);e&&"function"==typeof e.ref&&window.requestAnimationFrame((()=>e.ref(t)))}(t,o,0,n)}function F(t,...e){return q(e)}function q(t){const e=[],n=t=>{null!=t&&""!==t&&!1!==t&&e.push("function"==typeof t||"object"==typeof t?t:`${t}`)};return t&&t.forEach((t=>{Array.isArray(t)?t.forEach((t=>n(t))):n(t)})),e}const K={};let X=0;function J(t,e,...n){const o=q(n);if("string"==typeof t)return{tag:t,props:e,children:o};if(Array.isArray(t))return t;if(void 0===t&&n)return o;if(Object.getPrototypeOf(t).__isAppRunComponent)return{tag:t,props:e,children:o};if("function"==typeof t)return t(e,o);throw new Error(`Unknown tag in vdom ${t}`)}const Y=(t,e,n={})=>{null!=e&&!1!==e&&function(t,e,n={}){if(null==e||!1===e)return;if(e=nt(e,n),!t)return;const o="SVG"===t.nodeName;Array.isArray(e)?G(t,e,o):G(t,[e],o)}("string"==typeof t&&t?document.getElementById(t)||document.querySelector(t):t,e=(0,r.A)(e,n),n)};function Z(t,e,n){n=n||"svg"===e.tag,function(t,e){const n=t.nodeName,o=`${e.tag||""}`;return n.toUpperCase()===o.toUpperCase()}(t,e)?(G(t,e.children,n),V(t,e.props,n)):t.parentNode.replaceChild(et(e,n),t)}function G(t,e,n){const o=t.childNodes?.length||0,r=e?.length||0,l=Math.min(o,r);for(let o=0;o<l;o++){const r=e[o],l=t.childNodes[o];if("string"==typeof r)l.textContent!==r&&(3===l.nodeType?l.nodeValue=r:t.replaceChild(tt(r),l));else if(r instanceof HTMLElement||r instanceof SVGElement)t.insertBefore(r,l);else{const e=r.props&&r.props.key;if(e)if(l.key===e)Z(t.childNodes[o],r,n);else{const i=K[e];i?(t.insertBefore(i,l),Z(t.childNodes[o],r,n)):t.replaceChild(et(r,n),l)}else Z(t.childNodes[o],r,n)}}let i=t.childNodes?.length||0;for(;i>l;)t.removeChild(t.lastChild),i--;if(r>l){const o=document.createDocumentFragment();for(let t=l;t<e.length;t++)o.appendChild(et(e[t],n));t.appendChild(o)}}const Q=t=>{const e=document.createElement("section");return e.insertAdjacentHTML("afterbegin",t),Array.from(e.children)};function tt(t){if(0===t?.indexOf("_html:")){const e=document.createElement("div");return e.insertAdjacentHTML("afterbegin",t.substring(6)),e}return document.createTextNode(t??"")}function et(t,e){if(t instanceof HTMLElement||t instanceof SVGElement)return t;if("string"==typeof t)return tt(t);if(!t.tag||"function"==typeof t.tag)return tt(JSON.stringify(t));const n=(e=e||"svg"===t.tag)?document.createElementNS("http://www.w3.org/2000/svg",t.tag):document.createElement(t.tag);return V(n,t.props,e),t.children&&t.children.forEach((t=>n.appendChild(et(t,e)))),t.props&&void 0!==t.props.key&&(n.key=t.props.key,K[t.props.key]=n,++X>=500&&(function(){if(!(Object.keys(K).length<=1e3))for(const[t,e]of Object.entries(K))e.isConnected||delete K[t]}(),X=0)),n}function nt(t,e,n=0){if("string"==typeof t)return t;if(Array.isArray(t))return t.map((t=>nt(t,e,n++)));let o=t;if(t&&"function"==typeof t.tag&&Object.getPrototypeOf(t.tag).__isAppRunComponent&&(o=function(t,e,n){const{tag:o,props:r,children:l}=t;let i=`_${n}`,s=r&&r.id;s?i=s:s=`_${n}${Date.now()}`;let a="section";r&&r.as&&(a=r.as,delete r.as),e.__componentCache||(e.__componentCache={});let u=e.__componentCache[i];if(u&&u instanceof o&&u.element)u.renderState(u.state);else{const t=document.createElement(a);u=e.__componentCache[i]=new o({...r,children:l}).mount(t,{render:!0})}if(u.mounted){const t=u.mounted(r,l,u.state);void 0!==t&&u.setState(t)}return V(u.element,r,!1),u.element}(t,e,n)),o&&Array.isArray(o.children)){const t=o.props?._component;if(t){let e=0;o.children=o.children.map((n=>nt(n,t,e++)))}else o.children=o.children.map((t=>nt(t,e,n++)))}return o}},634:(t,e,n)=>{function o(t){return t?.target instanceof HTMLElement?t.target:null}function r(t,e){"object"==typeof t&&null!==t&&Object.keys(e).forEach((n=>{t[n]=e[n]}))}function l(t,e=document){try{return e.querySelector(t)}catch(e){return console.warn(`Invalid selector: ${t}`,e),null}}function i(t){try{return document.getElementById(t)}catch(e){return console.warn(`Error getting element by id: ${t}`,e),null}}n.d(e,{PB:()=>o,Q0:()=>r,bV:()=>l,oP:()=>i})},672:(t,e,n)=>{n.d(e,{C:()=>r,a:()=>o});const o="3.38.0",r=`AppRun-${o}`},741:(t,e,n)=>{n.d(e,{A:()=>u});var o=n(859),r=n(634);const l=t=>{if(!t)return[];const e=[];let n="",o=!1,r="";for(let l=0;l<t.length;l++){const i=t[l];"["!==i||o?"]"===i&&o?(r?n=n.slice(1,-1):/^\d+$/.test(n)&&(n=parseInt(n,10)),e.push(n),n="",o=!1,r=""):'"'!==i&&"'"!==i||!o?"."!==i||o?n+=i:n&&(e.push(n),n=""):(r?i===r&&(r=""):r=i,n+=i):(n&&(e.push(n),n=""),o=!0)}return n&&e.push(n),e},i=(t,e)=>{if(!e)return t.state||"";const n=l(e),o=((t,e)=>{let n=t;for(const t of e){if(null==n)return;n=n[t]}return n})(t.state,n);return void 0!==o?o:""},s=(t,e,n)=>{if(!e)return void t.setState(n);const o=l(e),r=((t,e,n)=>{if(0===e.length)return n;const o={...t};let r=o;for(let t=0;t<e.length-1;t++){const n=e[t],o=e[t+1];null==r[n]?r[n]="number"==typeof o?[]:{}:Array.isArray(r[n])?r[n]=[...r[n]]:"object"==typeof r[n]&&(r[n]={...r[n]}),r=r[n]}return r[e[e.length-1]]=n,o})(t.state||{},o,n);t.setState(r)},a=(t,e)=>{if(Array.isArray(t))return t.map((t=>a(t,e)));{let{type:n,tag:l,props:u,children:c}=t;return l=l||n,c=c||u?.children,u&&Object.keys(u).forEach((t=>{t.startsWith("$")&&(((t,e,n,l)=>{if(t.startsWith("$on")){const n=e[t];if(t=t.substring(1),"boolean"==typeof n)e[t]=e=>l.run?l.run(t,e):o.A.run(t,e);else if("string"==typeof n)e[t]=t=>l.run?l.run(n,t):o.A.run(n,t);else if("function"==typeof n)e[t]=t=>l.setState(n(l.state,t));else if(Array.isArray(n)){const[r,...i]=n;"string"==typeof r?e[t]=t=>l.run?l.run(r,...i,t):o.A.run(r,...i,t):"function"==typeof r&&(e[t]=t=>l.setState(r(l.state,...i,t)))}}else if("$bind"===t){const o=e.type||"text",a="string"==typeof e[t]?e[t]:e.name;if("input"===n)switch(o){case"checkbox":e.checked=i(l,a),e.onclick=t=>{const e=(0,r.PB)(t);e&&s(l,a||e.name,e.checked)};break;case"radio":e.checked=i(l,a)===e.value,e.onclick=t=>{const e=(0,r.PB)(t);e&&s(l,a||e.name,e.value)};break;case"number":case"range":e.value=i(l,a),e.oninput=t=>{const e=(0,r.PB)(t);e&&s(l,a||e.name,Number(e.value))};break;default:e.value=i(l,a),e.oninput=t=>{const e=(0,r.PB)(t);e&&s(l,a||e.name,e.value)}}else"select"===n?(e.value=i(l,a),e.onchange=t=>{const e=(0,r.PB)(t);e&&!e.multiple&&s(l,a||e.name,e.value)}):"option"===n?(e.selected=i(l,a),e.onclick=t=>{const e=(0,r.PB)(t);e&&s(l,a||e.name,e.selected)}):"textarea"===n&&(e.innerHTML=i(l,a),e.oninput=t=>{const e=(0,r.PB)(t);e&&s(l,a||e.name,e.value)})}else o.A.run("$",{key:t,tag:n,props:e,component:l})})(t,u,l,e),delete u[t])})),c&&a(c,e),t}},u=a},752:(t,e,n)=>{n.d(e,{JW:()=>S,XX:()=>I,c0:()=>w,qy:()=>E,s6:()=>C});const o=globalThis,r=o.trustedTypes,l=r?r.createPolicy("lit-html",{createHTML:t=>t}):void 0,i="$lit$",s=`lit$${Math.random().toFixed(9).slice(2)}$`,a="?"+s,u=`<${a}>`,c=document,h=()=>c.createComment(""),d=t=>null===t||"object"!=typeof t&&"function"!=typeof t,p=Array.isArray,f="[ \t\n\f\r]",g=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,m=/-->/g,y=/>/g,v=RegExp(`>|${f}(?:([^\\s"'>=/]+)(${f}*=${f}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),_=/'/g,b=/"/g,A=/^(?:script|style|textarea|title)$/i,$=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),E=$(1),S=$(2),w=($(3),Symbol.for("lit-noChange")),C=Symbol.for("lit-nothing"),k=new WeakMap,P=c.createTreeWalker(c,129);function x(t,e){if(!p(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==l?l.createHTML(e):e}const O=(t,e)=>{const n=t.length-1,o=[];let r,l=2===e?"<svg>":3===e?"<math>":"",a=g;for(let e=0;e<n;e++){const n=t[e];let c,h,d=-1,p=0;for(;p<n.length&&(a.lastIndex=p,h=a.exec(n),null!==h);)p=a.lastIndex,a===g?"!--"===h[1]?a=m:void 0!==h[1]?a=y:void 0!==h[2]?(A.test(h[2])&&(r=RegExp("</"+h[2],"g")),a=v):void 0!==h[3]&&(a=v):a===v?">"===h[0]?(a=r??g,d=-1):void 0===h[1]?d=-2:(d=a.lastIndex-h[2].length,c=h[1],a=void 0===h[3]?v:'"'===h[3]?b:_):a===b||a===_?a=v:a===m||a===y?a=g:(a=v,r=void 0);const f=a===v&&t[e+1].startsWith("/>")?" ":"";l+=a===g?n+u:d>=0?(o.push(c),n.slice(0,d)+i+n.slice(d)+s+f):n+s+(-2===d?e:f)}return[x(t,l+(t[n]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),o]};class T{constructor({strings:t,_$litType$:e},n){let o;this.parts=[];let l=0,u=0;const c=t.length-1,d=this.parts,[p,f]=O(t,e);if(this.el=T.createElement(p,n),P.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(o=P.nextNode())&&d.length<c;){if(1===o.nodeType){if(o.hasAttributes())for(const t of o.getAttributeNames())if(t.endsWith(i)){const e=f[u++],n=o.getAttribute(t).split(s),r=/([.?@])?(.*)/.exec(e);d.push({type:1,index:l,name:r[2],strings:n,ctor:"."===r[1]?D:"?"===r[1]?N:"@"===r[1]?H:U}),o.removeAttribute(t)}else t.startsWith(s)&&(d.push({type:6,index:l}),o.removeAttribute(t));if(A.test(o.tagName)){const t=o.textContent.split(s),e=t.length-1;if(e>0){o.textContent=r?r.emptyScript:"";for(let n=0;n<e;n++)o.append(t[n],h()),P.nextNode(),d.push({type:2,index:++l});o.append(t[e],h())}}}else if(8===o.nodeType)if(o.data===a)d.push({type:2,index:l});else{let t=-1;for(;-1!==(t=o.data.indexOf(s,t+1));)d.push({type:7,index:l}),t+=s.length-1}l++}}static createElement(t,e){const n=c.createElement("template");return n.innerHTML=t,n}}function M(t,e,n=t,o){if(e===w)return e;let r=void 0!==o?n._$Co?.[o]:n._$Cl;const l=d(e)?void 0:e._$litDirective$;return r?.constructor!==l&&(r?._$AO?.(!1),void 0===l?r=void 0:(r=new l(t),r._$AT(t,n,o)),void 0!==o?(n._$Co??=[])[o]=r:n._$Cl=r),void 0!==r&&(e=M(t,r._$AS(t,e.values),r,o)),e}class R{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:n}=this._$AD,o=(t?.creationScope??c).importNode(e,!0);P.currentNode=o;let r=P.nextNode(),l=0,i=0,s=n[0];for(;void 0!==s;){if(l===s.index){let e;2===s.type?e=new L(r,r.nextSibling,this,t):1===s.type?e=new s.ctor(r,s.name,s.strings,this,t):6===s.type&&(e=new j(r,this,t)),this._$AV.push(e),s=n[++i]}l!==s?.index&&(r=P.nextNode(),l++)}return P.currentNode=c,o}p(t){let e=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}}class L{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,n,o){this.type=2,this._$AH=C,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=M(this,t,e),d(t)?t===C||null==t||""===t?(this._$AH!==C&&this._$AR(),this._$AH=C):t!==this._$AH&&t!==w&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>p(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==C&&d(this._$AH)?this._$AA.nextSibling.data=t:this.T(c.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:n}=t,o="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=T.createElement(x(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===o)this._$AH.p(e);else{const t=new R(o,this),n=t.u(this.options);t.p(e),this.T(n),this._$AH=t}}_$AC(t){let e=k.get(t.strings);return void 0===e&&k.set(t.strings,e=new T(t)),e}k(t){p(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let n,o=0;for(const r of t)o===e.length?e.push(n=new L(this.O(h()),this.O(h()),this,this.options)):n=e[o],n._$AI(r),o++;o<e.length&&(this._$AR(n&&n._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class U{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,n,o,r){this.type=1,this._$AH=C,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=r,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=C}_$AI(t,e=this,n,o){const r=this.strings;let l=!1;if(void 0===r)t=M(this,t,e,0),l=!d(t)||t!==this._$AH&&t!==w,l&&(this._$AH=t);else{const o=t;let i,s;for(t=r[0],i=0;i<r.length-1;i++)s=M(this,o[n+i],e,i),s===w&&(s=this._$AH[i]),l||=!d(s)||s!==this._$AH[i],s===C?t=C:t!==C&&(t+=(s??"")+r[i+1]),this._$AH[i]=s}l&&!o&&this.j(t)}j(t){t===C?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class D extends U{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===C?void 0:t}}class N extends U{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==C)}}class H extends U{constructor(t,e,n,o,r){super(t,e,n,o,r),this.type=5}_$AI(t,e=this){if((t=M(this,t,e,0)??C)===w)return;const n=this._$AH,o=t===C&&n!==C||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,r=t!==C&&(n===C||o);o&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class j{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){M(this,t)}}const B=o.litHtmlPolyfillSupport;B?.(T,L),(o.litHtmlVersions??=[]).push("3.3.0");const I=(t,e,n)=>{const o=n?.renderBefore??e;let r=o._$litPart$;if(void 0===r){const t=n?.renderBefore??null;o._$litPart$=r=new L(e.insertBefore(h(),t),t,void 0,n??{})}return r._$AI(t),r}},804:(t,e,n)=>{n.d(e,{OA:()=>o,WL:()=>l,u$:()=>r});const o={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},r=t=>(...e)=>({_$litDirective$:t,values:e});class l{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,n){this._$Ct=t,this._$AM=e,this._$Ci=n}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}},859:(t,e,n)=>{n.d(e,{A:()=>a,q:()=>r});var o=n(672);class r{constructor(){this._events={}}on(t,e,n={}){this._events[t]=this._events[t]||[],this._events[t].push({fn:e,options:n})}off(t,e){const n=this._events[t]||[];this._events[t]=n.filter((t=>t.fn!==e))}find(t){return this._events[t]}run(t,...e){const n=this.getSubscribers(t,this._events);return console.assert(n&&n.length>0,"No subscriber for event: "+t),n.forEach((n=>{const{fn:o,options:r}=n;if(!o||"function"!=typeof o)return console.error(`AppRun event handler for '${t}' is not a function:`,o),!1;if(r.delay)this.delay(t,o,e,r);else try{Object.keys(r).length>0?o.apply(this,[...e,r]):o.apply(this,e)}catch(e){console.error(`Error in event handler for '${t}':`,e)}return!n.options.once})),n.length}once(t,e,n={}){this.on(t,e,{...n,once:!0})}delay(t,e,n,o){o._t&&clearTimeout(o._t),o._t=setTimeout((()=>{clearTimeout(o._t);try{Object.keys(o).length>0?e.apply(this,[...n,o]):e.apply(this,n)}catch(e){console.error(`Error in delayed event handler for '${t}':`,e)}}),o.delay)}runAsync(t,...e){const n=this.getSubscribers(t,this._events);console.assert(n&&n.length>0,"No subscriber for event: "+t);const o=n.map((n=>{const{fn:o,options:r}=n;if(!o||"function"!=typeof o)return console.error(`AppRun async event handler for '${t}' is not a function:`,o),Promise.resolve(null);try{return Object.keys(r).length>0?o.apply(this,[...e,r]):o.apply(this,e)}catch(e){return console.error(`Error in async event handler for '${t}':`,e),Promise.reject(e)}}));return Promise.all(o)}query(t,...e){return console.warn("app.query() is deprecated. Use app.runAsync() instead."),this.runAsync(t,...e)}getSubscribers(t,e){const n=e[t]||[];return e[t]=n.filter((t=>!t.options.once)),Object.keys(e).filter((e=>e.endsWith("*")&&t.startsWith(e.replace("*","")))).sort(((t,e)=>e.length-t.length)).forEach((o=>n.push(...e[o].map((e=>({...e,options:{...e.options,event:t}})))))),n}}const l=o.C;let i;const s="undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{};s.app&&s._AppRunVersions?i=s.app:(i=new r,s.app=i,s._AppRunVersions=l);const a=i},971:(t,e,n)=>{n.d(e,{Component:()=>g,ROUTER_404_EVENT:()=>_,ROUTER_EVENT:()=>v,app:()=>k,customElement:()=>c,default:()=>P,event:()=>a,on:()=>u,safeHTML:()=>r.safeHTML,update:()=>a});var o=n(859),r=n(320);const l=(t,e={})=>class extends HTMLElement{constructor(){super()}get component(){return this._component}get state(){return this._component.state}static get observedAttributes(){return(e.observedAttributes||[]).map((t=>t.toLowerCase()))}connectedCallback(){if(this.isConnected&&!this._component){const n=e||{};this._shadowRoot=n.shadow?this.attachShadow({mode:"open"}):this;const o=n.observedAttributes||[],r=o.reduce(((t,e)=>{const n=e.toLowerCase();return n!==e&&(t[n]=e),t}),{});this._attrMap=t=>r[t]||t;const l={};Array.from(this.attributes).forEach((t=>l[this._attrMap(t.name)]=t.value)),o.forEach((t=>{void 0!==this[t]&&(l[t]=this[t]),Object.defineProperty(this,t,{get:()=>l[t],set(e){this.attributeChangedCallback(t,l[t],e)},configurable:!0,enumerable:!0})})),requestAnimationFrame((()=>{const e=this.children?Array.from(this.children):[];if(this._component=new t({...l,children:e}).mount(this._shadowRoot,n),this._component._props=l,this._component.dispatchEvent=this.dispatchEvent.bind(this),this._component.mounted){const t=this._component.mounted(l,e,this._component.state);void 0!==t&&(this._component.state=t)}this.on=this._component.on.bind(this._component),this.run=this._component.run.bind(this._component),!1!==n.render&&this._component.run(".")}))}}disconnectedCallback(){this._component?.unload?.(),this._component?.unmount?.(),this._component=null}attributeChangedCallback(t,n,o){if(this._component){const r=this._attrMap(t);this._component._props[r]=o,this._component.run("attributeChanged",r,n,o),o!==n&&!1!==e.render&&window.requestAnimationFrame((()=>{this._component.run(".")}))}}},i=(t,e,n)=>{"undefined"!=typeof customElements&&customElements.define(t,l(e,n))},s={meta:new WeakMap,defineMetadata(t,e,n){this.meta.has(n)||this.meta.set(n,{}),this.meta.get(n)[t]=e},getMetadataKeys(t){return t=Object.getPrototypeOf(t),this.meta.get(t)?Object.keys(this.meta.get(t)):[]},getMetadata(t,e){return e=Object.getPrototypeOf(e),this.meta.get(e)?this.meta.get(e)[t]:null}};function a(t,e={}){return(n,o,r)=>{const l=t?t.toString():o;return s.defineMetadata(`apprun-update:${l}`,{name:l,key:o,options:e},n),r}}function u(t,e={}){return function(n,o){const r=t?t.toString():o;s.defineMetadata(`apprun-update:${r}`,{name:r,key:o,options:e},n)}}function c(t,e){return function(n){return i(t,n,e),n}}var h=n(741),d=n(634);const p=t=>t,f=o.A;class g{renderState(t,e=null){if(!this.view)return;let n=e||this.view(t);if(f.debug&&f.run("debug",{component:this,_:n?".":"-",state:t,vdom:n,el:this.element}),"object"!=typeof document)return;const o="string"==typeof this.element&&this.element?(0,d.oP)(this.element)||(0,d.bV)(this.element):this.element;if(!o)return void console.warn(`Component element not found: ${this.element}`);const r="_c";this.unload?o._component===this&&o.getAttribute(r)===this.tracking_id||(this.tracking_id=(new Date).valueOf().toString(),o.setAttribute(r,this.tracking_id),"undefined"!=typeof MutationObserver&&(this.observer||(this.observer=new MutationObserver((t=>{t[0].oldValue!==this.tracking_id&&document.body.contains(o)||(this.unload(this.state),this.observer.disconnect(),this.observer=null)}))),this.observer.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0,attributeFilter:[r]}))):o.removeAttribute&&o.removeAttribute(r),o._component=this,!e&&n&&(n=(0,h.A)(n,this),this.options.transition&&document&&document.startViewTransition?document.startViewTransition((()=>f.render(o,n,this))):f.render(o,n,this)),this.rendered&&this.rendered(this.state)}setState(t,e={render:!0,history:!1}){const n=t;if(n?.[Symbol.asyncIterator])this.setState((async t=>{try{for(;;){const{value:n,done:o}=await t.next();if(o)break;this.setState(n,e)}}catch(t){console.error("Error in async iterator:",t)}})(n[Symbol.asyncIterator]()),e);else if(n?.[Symbol.iterator]&&"function"==typeof n.next)for(const t of n)this.setState(t,e);else if(t&&t instanceof Promise)Promise.resolve(t).then((n=>{this.setState(n,e),this._state=t}));else{if(this._state=t,null==t)return;this.state=t,!1!==e.render&&(e.transition&&document&&document.startViewTransition?document.startViewTransition((()=>this.renderState(t))):this.renderState(t)),!1!==e.history&&this.enable_history&&(this._history=[...this._history,t],this._history_idx=this._history.length-1),"function"==typeof e.callback&&e.callback(this.state)}}constructor(t,e,n,r){this.state=t,this.view=e,this.update=n,this.options=r,this._app=new o.q,this._actions=[],this._global_events=[],this._history=[],this._history_idx=-1,this._history_prev=()=>{this._history_idx--,this._history_idx>=0?this.setState(this._history[this._history_idx],{render:!0,history:!1}):this._history_idx=0},this._history_next=()=>{this._history_idx++,this._history_idx<this._history.length?this.setState(this._history[this._history_idx],{render:!0,history:!1}):this._history_idx=this._history.length-1},this.start=(t=null,e)=>{if(this.mount(t,{render:!0,...e}),this.mounted&&"function"==typeof this.mounted){const t=this.mounted({},[],this.state);void 0!==t&&this.setState(t)}return this}}mount(t=null,e){return console.assert(!this.element,"Component already mounted."),this.options=e={...this.options,...e},this.element=t,this.global_event=e.global_event,this.enable_history=!!e.history,this.enable_history&&(this.on(e.history.prev||"history-prev",this._history_prev),this.on(e.history.next||"history-next",this._history_next)),e.route&&(this.update=this.update||{},this.update[e.route]||(this.update[e.route]=p)),this.add_actions(),this.state=this.state??this.model??{},"function"==typeof this.state&&(this.state=this.state()),this.setState(this.state,{render:!!e.render,history:!0}),f.debug&&f.find("debug-create-component")?.length&&f.run("debug-create-component",this),this}is_global_event(t){return t&&(this.global_event||this._global_events.indexOf(t)>=0||t.startsWith("#")||t.startsWith("/")||t.startsWith("@"))}add_action(t,e,n={}){e&&"function"==typeof e?(n.global&&this._global_events.push(t),this.on(t,((...o)=>{f.debug&&f.run("debug",{component:this,_:">",event:t,p:o,current_state:this.state,options:n});try{const r=e(this.state,...o);f.debug&&f.run("debug",{component:this,_:"<",event:t,p:o,newState:r,state:this.state,options:n}),this.setState(r,n)}catch(e){console.error(`Error in component action '${t}':`,e),f.debug&&f.run("debug",{component:this,_:"!",event:t,p:o,error:e,state:this.state,options:n})}}),n)):console.warn(`Component action for '${t}' is not a valid function:`,e)}add_actions(){const t=this.update||{};s.getMetadataKeys(this).forEach((e=>{if(e.startsWith("apprun-update:")){const n=s.getMetadata(e,this);t[n.name]=[this[n.key].bind(this),n.options]}}));const e={};Array.isArray(t)?t.forEach((t=>{const[n,o,r]=t;n.toString().split(",").forEach((t=>e[t.trim()]=[o,r]))})):Object.keys(t).forEach((n=>{const o=t[n];("function"==typeof o||Array.isArray(o))&&n.split(",").forEach((t=>e[t.trim()]=o))})),e["."]||(e["."]=p),Object.keys(e).forEach((t=>{const n=e[t];"function"==typeof n?this.add_action(t,n):Array.isArray(n)&&this.add_action(t,n[0],n[1])}))}run(t,...e){if(this.state instanceof Promise)return Promise.resolve(this.state).then((n=>{this.state=n,this.run(t,...e)}));{const n=t.toString();return this.is_global_event(n)?f.run(n,...e):this._app.run(n,...e)}}on(t,e,n){const o=t.toString();return this._actions.push({name:o,fn:e}),this.is_global_event(o)?f.on(o,e,n):this._app.on(o,e,n)}runAsync(t,...e){const n=t.toString();return this.is_global_event(n)?f.runAsync(n,...e):this._app.runAsync(n,...e)}query(t,...e){return console.warn("component.query() is deprecated. Use component.runAsync() instead."),this.runAsync(t,...e)}unmount(){this.observer?.disconnect(),this._actions.forEach((t=>{const{name:e,fn:n}=t;this.is_global_event(e)?f.off(e,n):this._app.off(e,n)}))}}function m(){const t=o.A.find("#");if(t&&t.length>0)return o.A.run("#"),void o.A.run(v,"#");const e=o.A.find("/");if(e&&e.length>0)return o.A.run("/"),void o.A.run(v,"/");const n=o.A.find("#/");if(n&&n.length>0)return o.A.run("#/"),void o.A.run(v,"#/");console.warn("No subscribers for event: "),o.A.run(_,""),o.A.run(v,"")}g.__isAppRunComponent=!0;const y=(t,...e)=>{if(!t||t===v||t===_)return;const n=o.A.find(t);n&&0!==n.length?o.A.run(t,...e):(console.warn(`No subscribers for event: ${t}`),o.A.run(_,t,...e)),o.A.run(v,t,...e)},v="//",_="///",b=t=>{o.A.lastUrl!==t&&(o.A.lastUrl=t,function(t){if(!t)return void m();t=function(t){return t&&"/"!==t&&"#"!==t&&"#/"!==t&&t.endsWith("/")?t.slice(0,-1):t}(t);const e=o.A.basePath;e&&(t=function(t,e){if(!e||"/"===e||""===e)return t;const n=e.startsWith("/")?e:"/"+e;if(t.startsWith(n)){const e=t.substring(n.length);return e.startsWith("/")?e:"/"+e}return t}(t,e));const n=function(t){return t?t.startsWith("#/")?t.substring(2).split("/"):t.startsWith("#")||t.startsWith("/")?t.substring(1).split("/"):t.split("/"):[]}(t);let r;!function(t){const e=t.filter(Boolean);e.length>11&&console.warn(`Deep route hierarchy detected: ${e.join("/")} (${e.length} levels)`)}(n),r=t.startsWith("#/")?"hash-slash":t.startsWith("#")?"hash":t.startsWith("/")?"path":"non-prefixed";const l=function(t,e){const n=[];for(let o=t.length;o>0;o--){const r=t.slice(0,o);let l="";switch(e){case"path":l="/"+r.join("/");break;case"hash":l="#"+r.join("/");break;case"hash-slash":l="#/"+r.join("/");break;case"non-prefixed":l=r.join("/")}n.push(l)}return n}(n,r),i=function(t,e){for(let n=0;n<t.length;n++){const r=t[n],l=o.A.find(r);if(l&&l.length>0){const o=t.length-n;return{eventName:r,parameters:e.slice(o)}}}return null}(l,n);if(i)y(i.eventName,...i.parameters);else if(l.length>0){const e=l[l.length-1];console.warn(`No subscribers for event: ${e}`),o.A.run(_,t),o.A.run(v,t)}else m()}(t))};function A(t){return t&&"object"==typeof t&&"function"==typeof t.mount}function $(t){return"function"==typeof t&&t.prototype&&t.prototype.constructor===t&&(void 0!==t.prototype.mount||void 0!==t.prototype.state||void 0!==t.prototype.view)}function E(t){return"function"==typeof t&&!$(t)}async function S(t,e=3){let n=t,o=0;for(;E(n)&&o<e;)try{const t=await n();if(t===n)break;n=t,o++}catch(t){console.error(`Error executing component function: ${t}`);break}return n}const w=async(t,e)=>{for(const[n,r]of Object.entries(e))if(r&&n)if(A(r)){const e={route:n};r.mount(t,e)}else if($(r)){const e={route:n};(new r).mount(t,e)}else if(E(r)){let e=await S(r);if(A(e)){const o={route:n};e.mount(t,o);continue}if($(e)){const o={route:n};(new e).mount(t,o);continue}o.A.on(n,((...e)=>{const n=r(...e);if("string"!=typeof t||(t=document.querySelector(t)))return o.A.render(t,n);console.error(`Element not found: ${t}`)}))}else console.error("Invalid component: component must be a class, instance, or function that returns a class/instance");else console.error(`Invalid component configuration: component=${r}, route=${n}`)};var C=n(672);const k=o.A,P=k;if(!k.start){k.version=C.a,k.h=k.createElement=r.createElement,k.render=r.render,k.Fragment=r.Fragment,k.webComponent=i,k.safeHTML=r.safeHTML,k.start=(t,e,n,o,r)=>{const l={render:!0,global_event:!0,...r},i=new g(e,n,o);return r&&r.rendered&&(i.rendered=r.rendered),r&&r.mounted&&(i.mounted=r.mounted),i.start(t,l),i},k.query=k.query||k.runAsync;const t=t=>{};if(k.on("/",t),k.on("debug",(e=>t)),k.on(v,t),k.on(_,t),k.route=b,k.on("route",(t=>k.route&&k.route(t))),"object"==typeof document&&document.addEventListener("DOMContentLoaded",(()=>{const t=document.body.hasAttribute("apprun-no-init")||k["no-init-route"]||!1,e=k.find("#")||k.find("#/")||!1;window.addEventListener("hashchange",(()=>b(location.hash))),window.addEventListener("popstate",(()=>b(location.pathname))),e?!t&&b(location.hash):(!t&&(()=>{const t=k.basePath||"";let e=location.pathname;t&&e.startsWith(t)&&(e=e.substring(t.length),e.startsWith("/")||(e="/"+e)),b(e)})(),document.body.addEventListener("click",(t=>{const e=t.target;if(!e)return;const n="A"===e.tagName?e:e.closest("a");if(n&&n.origin===location.origin&&n.pathname){t.preventDefault();const e=(k.basePath||"")+n.pathname;history.pushState(null,"",e),b(n.pathname)}})))})),"object"==typeof window){const t=window;t.Component=g,t._React=t.React,t.React=k,t.on=u,t.customElement=c,t.safeHTML=r.safeHTML}k.use_render=(t,e=0)=>{k.render=0===e?(e,n)=>t(n,e):(e,n)=>t(e,n)},k.use_react=(t,e)=>{if(t&&e)if("function"==typeof t.createElement)if(t.Fragment)if(k.h=k.createElement=t.createElement,k.Fragment=t.Fragment,t.version&&t.version.startsWith("18")){if(!e.createRoot||"function"!=typeof e.createRoot)return void console.error("AppRun use_react: ReactDOM.createRoot not found in React 18+");k.render=(t,n)=>{t&&void 0!==n&&(t._root||(t._root=e.createRoot(t)),t._root.render(n))}}else{if(!e.render||"function"!=typeof e.render)return void console.error("AppRun use_react: ReactDOM.render not found in legacy React");k.render=(t,n)=>e.render(n,t)}else console.error("AppRun use_react: Invalid React object - Fragment not found");else console.error("AppRun use_react: Invalid React object - createElement method not found");else console.error("AppRun use_react: React and ReactDOM parameters are required")},k.addComponents=w}}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var l=e[o]={