@pacem/pacem-core 1.0.5-bartels → 1.0.5-doppler

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
1
  /*!
2
- * @pacem/pacem-core v1.0.5-bartels (https://js.pacem.it)
2
+ * @pacem/pacem-core v1.0.5-doppler (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
6
- var ti=Object.defineProperty;var lt=(i,e)=>{for(var t in e)ti(i,t,{get:e[t],enumerable:!0})};var ct=class i{constructor(){}static clone(e){return new i()._clone(e)}_clone(e){let t=new WeakMap;function r(n){if(typeof n=="object"&&n!==null&&!(n instanceof Element)&&!(n instanceof FileSystemHandle)&&!(n instanceof File)){if(Array.isArray(n))return n.map(r);if(n instanceof Date)return new Date(n.valueOf());if(n instanceof RegExp)return new RegExp(n);if(t.has(n))return t.get(n);{let s=Object.assign({},n);return t.set(n,s),Object.keys(s).forEach(o=>{s[o]=r(n[o])}),s}}return n}return r(e)}};import{Keys as ri}from"@pacem/pacem-foundation";var He="$refId",cr;(function(i){i[i.Ignore=0]="Ignore",i.Reference="reference",i.Plain="plain"})(cr||(cr={}));var pr=class{static{this._jsonFnWeakMap=new WeakMap}static{this._jsonFnMap=new Map}static store(e){let t=this._jsonFnWeakMap;if(!t.has(e)){let r=ri.uniqueCode();t.set(e,r),this._jsonFnMap.set(r,e)}return t.get(e)}static retrieve(e){return this._jsonFnMap.get(e)}static remove(e){let t=this.retrieve(e);this._jsonFnMap.delete(e),this._jsonFnWeakMap.delete(t)}},Ct=class _Json{constructor(i){this._options=i}static serialize(i,e){return new _Json(e)._serialize(i)}static deserialize(i){return new _Json()._deserialize(i)}_serialize(i){let e=ct.clone(i),t=[He],r=this._flatten(e,0,null,t);return JSON.stringify(r,t.sort())}_deserialize(json){let hasRefs=!1,obj=JSON.parse(json,(key,value)=>{let elPattern=/^\$<#(.+)>$/,fnPattern=/^\$<fn:([^\x05]+)>$/,regexPattern=/^\$<regex:(.+)>$/,fnRefPattern=/^\$<fn#(.+)>$/,arr;if(key===He)hasRefs=!0;else if(typeof value=="string")if((arr=regexPattern.exec(value))&&arr.length>1){let i=arr[1],e=i.lastIndexOf("|");return new RegExp(i.substr(0,e),i.substr(e+1))}else{if((arr=elPattern.exec(value))&&arr.length>1)return document.getElementById(arr[1]);if((arr=fnPattern.exec(value))&&arr.length>1)return eval(arr[1]);if((arr=fnRefPattern.exec(value))&&arr.length>1)return pr.retrieve(arr[1])}return value});return hasRefs?this._revive(obj):obj}_flatten(i,e=0,t,r){if(t=t||new WeakSet,r=r||[],i instanceof Element)return i.id?`$<#${i.id}>`:void 0;if(i instanceof RegExp)return`$<regex:${i.source}|${i.flags}>`;if(typeof i=="object"&&i!=null&&!(i instanceof Date))return Array.isArray(i)?i.map(n=>this._flatten(n,e,t,r)):t.has(i)?i[He]=i[He]||"$#ref_"+e++:(t.add(i),Object.keys(i).forEach(n=>{r.indexOf(n)===-1&&r.push(n),i[n]=this._flatten(i[n],e,t,r)}),i);if(typeof i=="function")switch(this._options?.functions){case cr.Reference:return"$<fn#"+pr.store(i)+">";case cr.Plain:return"$<fn:"+i+">";default:return}return i}_revive(i){let e={},t=/^\$#ref_(.+)$/;function r(n){if(typeof n=="object"&&n!==null){if(Array.isArray(n))return n.map(r);He in n&&(e[n[He]]=n,delete n[He]),Object.keys(n).forEach(s=>{n[s]=r(n[s])})}else if(typeof n=="string"&&t.test(n)){let s=t.exec(n);return e[s[0]]}return n}return r(i)}};import{Keys as Jr,Dates as Ce,Colors as Wn,Strings as pt,Blobs as dr,Imaging as zn,NullChecker as Gn,detect as ni}from"@pacem/pacem-foundation";var K=class i{constructor(){this.deferred=null;var e=this;e.promise=new Promise(function(t,r){e.deferred={resolve:t,reject:r,promise:e}})}then(e,t){return this.promise.then(e,t)}finally(e){return this.promise.then(e,e),this}success(e){return this.promise.then(e,null),this}error(e){return this.promise.then(null,e),this}static defer(){var e=new i;return e.deferred}};var si="pacem",Kn="download",Eo=i=>{i.stopPropagation()},wo=i=>{i.preventDefault()},ce=i=>{i.preventDefault(),i.stopPropagation()},qn=/^\/[^\/]+/,ii=/\/\{([a-z\$_][\w]*)\??\}/,l=class i{static get core(){let e=window.Pacem;var t=e&&e.Configuration&&e.Configuration.core||si;return window[t]=window[t]||{}}static get customElements(){return window.customElements}static uniqueId(){return Jr.uniqueId()}static uniqueCode(){return Jr.uniqueCode()}static randomString(e){return Jr.randomString(e)}static parseDate(e){return Ce.parse(e)}static copyToClipboard(e){return navigator.clipboard?navigator.clipboard.writeText(e):new Promise((t,r)=>{let n=document.createElement("textarea");n.value=e,n.style.opacity="0",document.body.appendChild(n);try{n.select(),document.execCommand("copy"),n.remove(),t()}catch(s){r(s)}})}static{this.Json={stringify:Ct.serialize,parse:Ct.deserialize}}static{this.Dates={now:()=>i.parseDate(Date.now()),parse:i.parseDate,isLeapYear:Ce.isLeapYear,daysInMonth:Ce.daysInMonth,isDate:Ce.isDate,dateOnly:Ce.dateOnly,addMonths:Ce.addMonths,addDays:Ce.addDays,daysBetween:Ce.daysBetween}}static colorize(e,t){let r={h:38,s:.245,l:.6};var n,s,o,a;e instanceof HTMLElement?n=t:n=e,typeof n=="string"?s=Wn.parse(n):s={r:n[0],g:n[1],b:n[2]};let c=Wn.hsl(s);if(o=`brightness(50%) sepia(1) hue-rotate(${c.h-r.h}deg) saturate(${1+(c.s-r.s)}) brightness(${1+(c.l-r.l)})`,n===t)a.style.filter=o;else return o}static cssEscape(e){return escape(e).replace("%","\\")}static{this.Css={colorize:i.colorize,escape:i.cssEscape,getVariableValue(e){return getComputedStyle(document.documentElement).getPropertyValue(e)},setVariable(e,t){getComputedStyle(document.documentElement).setProperty(e,t)},isClassDefined(e){let t=new RegExp("."+e+"($|[s.,])");for(let r=0;r<document.styleSheets.length;r++){let n=document.styleSheets.item(r);try{let s=n.cssRules;for(let o=0;o<s.length;o++){let a=n.cssRules.item(o);if(t.test(a.selectorText))return!0}}catch(s){s instanceof DOMException&&console.warn(`Couldn't access cssRules of stylesheet "`+n.href+'".')}}return!1},deserializeTransform(e){let t=e instanceof Element?getComputedStyle(e):e,r=1,n=0,s=0,o=1,a=0,c=0,p=/^matrix\((.*)\)$/.exec(t.transform),f;return p&&p.length>1&&(f=p[1].split(",")).length==6&&(r=parseFloat(f[0]),n=parseFloat(f[1]),s=parseFloat(f[2]),o=parseFloat(f[3]),a+=parseFloat(f[4]),c+=parseFloat(f[5])),{a:r,b:n,c:s,d:o,e:a,f:c}}}}static{this.leftPad=pt.leftPad}static{this.formatString=pt.format}static{this.diff=pt.diff}static{this.Strings={leftPad:pt.leftPad,format:pt.format,diff:pt.diff,stripHTML:e=>new DOMParser().parseFromString(e,"text/html").body.textContent||""}}static{this.Blobs={toDataURL:dr.blobToDataURL,fromDataURL:dr.dataURLToBlob,toText:dr.blobToText,fromText:dr.textToBlob}}static{this.Images={load:zn.loadImage,resize:zn.resizeImage}}static loadImage(e){return new Promise((t,r)=>{let n=new Image;n.src=e,n.complete?t(n):(n.onload=s=>{t(n)},n.onerror=s=>{r()})})}static blobToDataURL(e){return i.Blobs.toDataURL(e)}static dataURLToBlob(e){return i.Blobs.fromDataURL(e)}static blobToText(e,t){return i.Blobs.toText(e,t)}static textToBlob(e,t="text/plain"){return i.Blobs.fromText(e,t)}static resizeImage(e,t,r,n){var s=K.defer();return i.blobToDataURL(e).then(i.loadImage).then(o=>{let a=o.width,c=o.height,p=document.createElement("canvas");p.width=a,p.height=c;let f=p.getContext("2d");if(a>t||c>r){let m=a/c,h=t/r,v,b;h<m?(b=t,v=t/m):(v=r,b=r*m),p.width=b,p.height=v;let x=n>0&&n<=1;x&&(f.fillStyle="#000",f.fillRect(0,0,p.width,p.height)),i.cropImageOntoCanvas(o,f);let g;x?g=f.canvas.toDataURL("image/jpeg",n):g=f.canvas.toDataURL(),s.resolve(i.dataURLToBlob(g))}else s.resolve(e)},o=>{}),s.promise}static cropImage(e,t,r,n){var s=K.defer();let o=new Image;return o.crossOrigin="anonymous",o.onload=function(a){let c=document.createElement("canvas"),p=c.getContext("2d");t&&(c.width=t),r&&(c.height=r);let f=n>0&&n<=1;f&&(p.fillStyle="#000",p.fillRect(0,0,c.width,c.height)),i.cropImageOntoCanvas(o,p),s.resolve(f?c.toDataURL("image/jpeg",n):c.toDataURL())},o.src=e,s.promise}static getUserMediaFunctions(){var e=[];let r=[navigator.getUserMedia,navigator.webkitGetUserMedia,navigator.msGetUserMedia,navigator.mozGetUserMedia].filter(function(n,s){return typeof n=="function"});return r.length&&(e=r),e}static cropImageOntoCanvas(e,t,r,n){t.imageSmoothingEnabled=t.mozImageSmoothingEnabled=t.oImageSmoothingEnabled=t.webkitImageSmoothingEnabled=!0;let s=t.canvas.width,o=t.canvas.height,a=s,c=o,p=r||1*e.width,f=n||1*e.height;var m=p/f,h=s/o;if(h>m){var v=s/p;o=v*f,t.drawImage(e,0,.5*(-o+c),a,o)}else{var v=o/f;s=v*p,t.drawImage(e,-Math.abs(.5*(-s+a)),0,s,c)}}static get _domURL(){return window.URL||window.webkitURL||window}static snapshotElement(e,t,r="image/png",n){function s(o){return new Promise((a,c)=>{let p=document.createElement("canvas"),f=o.width,m=o.height;if(!(f>0))c("Image has width zero.");else if(!(m>0))c("Image has height zero.");else{p.width=f,p.height=m;let h=p.getContext("2d");i.isNullOrEmpty(t)||(h.fillStyle=t,h.fillRect(0,0,f,m)),h.drawImage(o,0,0),p.toBlob(v=>{a(v)},r,n)}})}return e instanceof HTMLCanvasElement?s(e):new Promise((o,a)=>{let c=[];function p(g){let y=new Promise((C,P)=>{let N=()=>g instanceof HTMLImageElement?g.src:g.href.baseVal,D=O=>{g instanceof HTMLImageElement?g.src=O:g.setAttribute("href",O)};fetch(N()).then(O=>O.blob()).then(O=>i.blobToDataURL(O)).then(O=>{D(O),C()})});c.push(y)}function f(g,y){let C=new Promise((P,N)=>{let D=new Image;D.crossOrigin="anonymous",D.width=y.width,D.height=y.height,D.style.cssText=g.style.cssText,D.onload=()=>{g.replaceWith(D),P()},D.src=y.toDataURL()});c.push(C)}function m(g,y){let C=getComputedStyle(y);for(let P=0;P<C.length;P++){let N=C.item(P);g.style[N]=C[N]}}function h(g,y){m(g,y),g instanceof HTMLImageElement||g instanceof SVGImageElement?p(g):g instanceof HTMLCanvasElement&&f(g,y);let C=g.children.length;for(let P=0;P<C;P++){let N=g.children.item(P),D=y.children.item(P);N.tagName===D.tagName&&h(N,D)}}if(e instanceof SVGElement){let g=e.cloneNode(!0);h(g,e),Promise.all(c).then(y=>{e=g,x()})}else{var b=document.implementation.createHTMLDocument("");b.write(e.outerHTML),b.documentElement.setAttribute("xmlns",b.documentElement.namespaceURI);let y=document.evaluate(".//"+e.localName,b.body,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;y.setAttribute("xmlns",b.documentElement.namespaceURI),h(y,e),Promise.all(c).then(C=>{let P=document.createElementNS("http://www.w3.org/2000/svg","svg"),N=i.offset(e);P.setAttribute("viewBox",`0 0 ${N.width} ${N.height}`),P.setAttribute("width",N.width.toString()),P.setAttribute("height",N.height.toString()),P.innerHTML=`<foreignObject width="${N.width}" height="${N.height}">${y.outerHTML}</foreignObject>`,e=P,x()})}function x(){let g=new XMLSerializer().serializeToString(e),y=new Image;y.crossOrigin="anonymous";let C="data:image/svg+xml;charset=utf8,"+encodeURIComponent(g);y.onload=()=>{s(y).then(o)},y.src=C}})}static async download(e,t,r="application/download"){if(typeof e=="string"){let a=e,c={},p;i.isNullOrEmpty(t)||(typeof t=="object"?(c={credentials:t.credentials,headers:t.headers},p=t.filename||p,r=t.mime||r):p=t);var n=await fetch(a,c);if(n.ok){if(i.isNullOrEmpty(p)){let m="Content-Disposition";if(n.headers.has(m)){let h=n.headers.get(m),v=/^attachment; filename=\"?([^;\"]+)\"?(;|$)/.exec(h);v.length>1&&(p=v[1])}else p=Kn}var s=await n.blob();let f=p.split(/[\\\/]/g).join("_");return i.download(s,f)}{let f=await n.text();throw new Error(f)}}else{let a=e,c=typeof t=="string"&&t||Kn,p=document.createElement("a");if(p.setAttribute("href",i._domURL.createObjectURL(a)),p.setAttribute("download",c),document.createEvent){var o=document.createEvent("MouseEvents");o.initEvent("click",!0,!0),p.dispatchEvent(o)}else p.click()}}static isDOMReady(){return document.readyState==="complete"}static onDOMReady(e){window.addEventListener("load",e,!1)}static moveChildren(e,t){return i.moveItems(e.childNodes,t)}static moveItems(e,t){let r=[],n;for(let s=e.length-1;s>=0;s--){let o=e instanceof NodeList?e.item(s):e[s];t.insertBefore(o,n),r.unshift(o),n=o}return r}static is(e,t){return(e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector).call(e,t)}static lang(e){return e.lang||document.documentElement.lang||navigator.language}static jsonSortStringify(e){return i.isNull(e)?e:i.Json.stringify(e)}static{this.Browsers={detect:ni}}static cookies(e){let t=(e??document.cookie).split(";"),r={};for(var n of t){let s=n.split("=");if(s.length<2)continue;let o=(s[0]||"").trim(),a=(s[1]||"").trim();Object.defineProperty(r,o,{configurable:!1,enumerable:!0,writable:!1,value:decodeURIComponent(a.split("+").join(" "))})}return r}static{this.Cookies={getAll:async e=>{let t="cookieStore"in window?window.cookieStore:null,r=[];if(i.isNull(t)){let n=i.cookies();for(let s in n)!i.isNullOrEmpty(e)&&e!==s||r.push({name:s,value:n[s]});return r}else return await t.getAll(e)},stringify:e=>{let t=`${e.name}=${encodeURIComponent(e.value??"")}`;return i.isNullOrEmpty(e.domain)||(t+=`; domain=${encodeURIComponent(e.domain)}`),i.isNullOrEmpty(e.path)||(t+=`; path=${encodeURIComponent(e.path)}`),e.maxAge>0&&(t+=`; max-age=${e.maxAge.toFixed(0)}`),i.isNullOrEmpty(e.expires)||(t+=`; expires=${e.expires}`),e.partitioned&&(t+="; Partitioned"),i.isNullOrEmpty(e.sameSite)||(t+=`; SameSite=${encodeURIComponent(e.sameSite)}`),e.secure&&(t+="; Secure"),t}}}static isVisible(e){return"checkVisibility"in e?e.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):getComputedStyle(e).visibility!=="hidden"&&(e.clientWidth>0||e.clientHeight>0)}static hasClass(e,t){return e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className)}static addClass(e,t){let r=t.trim();e.classList?DOMTokenList.prototype.add.apply(e.classList,r.split(" ")):e.setAttribute("class",e.className+" "+r)}static removeClass(e,t){let r=t.trim();e.classList?DOMTokenList.prototype.remove.apply(e.classList,r.split(" ")):e.setAttribute("class",e.className.replace(new RegExp("(^|\\b)"+r.split(" ").join("|")+"(\\b|$)","gi")," "))}static toggleClass(e,t,r){r?i.addClass(e,t):i.removeClass(e,t)}static hasPart(e,t){return e.part.contains(t)}static addPart(e,t){DOMTokenList.prototype.add.apply(e.part,t.trim().split(" "))}static removePart(e,t){DOMTokenList.prototype.remove.apply(e.part,t.trim().split(" "))}static togglePart(e,t,r){r?i.addPart(e,t):i.removePart(e,t)}static offset(e){var t=e.getBoundingClientRect();return{top:Math.round(t.top)+i.scrollTop,left:Math.round(t.left)+i.scrollLeft,width:Math.round(t.width),height:Math.round(t.height)}}static offsetRect(e){var t=this.offset(e);return{y:t.top,x:t.left,width:t.width,height:t.height}}static naturalOffsetTop(e){return(e?.offsetTop??0)+(e?.offsetParent&&e.offsetParent instanceof HTMLElement?this.naturalOffsetTop(e.offsetParent):0)}static naturalOffsetLeft(e){return(e?.offsetTop??0)+(e?.offsetParent&&e.offsetParent instanceof HTMLElement?this.naturalOffsetLeft(e.offsetParent):0)}static naturalOffset(e){return{left:this.naturalOffsetLeft(e),top:this.naturalOffsetTop(e),width:e?.offsetWidth??0,height:e?.offsetHeight??0}}static naturalOffsetRect(e){var t=this.naturalOffset(e);return{y:t.top,x:t.left,width:t.width,height:t.height}}static deserializeTransform(e){return i.Css.deserializeTransform(e)}static set scrollTop(e){window.scrollTo(i.scrollLeft,e)}static set scrollLeft(e){window.scrollTo(e,i.scrollTop)}static scrollTo(e,t=!0,r=!0){let n=i.isNull(t)||typeof t=="boolean",s=n?i.scrollLeft:e,o=n?e:t,a=(n?t:r)?"smooth":"instant";window.scrollTo({behavior:a,left:s,top:o})}static get scrollTop(){return window.scrollY||document.documentElement.scrollTop||document.body.scrollTop||0}static get scrollLeft(){return window.scrollX||document.documentElement.scrollLeft||document.body.scrollLeft||0}static get windowSize(){let e=window;return{width:e.innerWidth||e.document.documentElement.clientWidth||e.document.body.clientWidth||0,height:e.innerHeight||e.document.documentElement.clientHeight||e.document.body.clientHeight||0}}static addAnimationEndCallback(e,t,r=500){let n=o=>{(!o||o.target==e)&&(clearTimeout(s),e.removeEventListener("animationend",n,!1),e.removeEventListener("transitionend",n,!1),t.apply(this,[e]))};e.addEventListener("animationend",n,!1),e.addEventListener("transitionend",n,!1);let s=setTimeout(n,r)}static waitForAnimationEnd(e,t=500){return new Promise((r,n)=>{i.addAnimationEndCallback(e,()=>{r()},t)})}static idle(e){return new Promise((t,r)=>{setTimeout(()=>t(),e)})}static accelerateCallback(e,t=500,r=5,n=20){let s={cancel:!1},o=t,a=r+n,c=()=>{e(s),s.cancel||(setTimeout(c,o),o<a?o=n:o-=r)};c()}static isEmpty(e){return Gn.isEmpty(e)&&!(e instanceof Node)}static isNull(e){return Gn.isNull(e)}static isArray(e){return Array.isArray(e)}static isNullOrEmpty(e){return i.isNull(e)||i.isEmpty(e)}static areSemanticallyEqual(e,t){e??=null,t??=null;let r=e&&e.valueOf&&e.valueOf(),n=t&&t.valueOf&&t.valueOf();return r===n}static{this.extend=Object.assign}static clone(e){if(e!==void 0)return ct.clone(e)}static fromResult(e){return Promise.resolve(e)}static fromResultAsync(e){return new Promise(t=>requestAnimationFrame(()=>t(e())))}static readonlyCopy(e){if(i.isNull(e))return null;if(i.isArray(e)){let t=e.slice(0);return Object.freeze(t),t}else{let t={};for(let r in e)t[r]=e[r];return Object.freeze(t),t}}static{this.URIs={format:function(e,t,r){for(let o in t||{}){let c=new RegExp("(^|\\/)\\{"+o+"\\??\\}(\\/|$)").exec(e);if(c&&c.length){let p=new RegExp("\\{"+o+"\\??\\}"),f=c.index;e=e.substring(0,f)+e.substring(f).replace(p,encodeURIComponent(t[o])),r&&delete t[o]}}let n=/(^|\/)\{[\w]+\?\}(\/|$)/;for(var s;(s=n.exec(e))&&s.length>0;){let o=s[0];e=e.replace(o,o.endsWith("/")?"/":"")}return e},appendQuery:function(e,t,r=!1,n=!1){let s=n?"#":"?",a=((n?/#/:/\?/).test(e)?"&":s)+Object.keys(t).filter(c=>!i.isNull(t[c])||!r).map(c=>encodeURIComponent(c)+"="+encodeURIComponent(t[c]??"")).join("&");return e+(a.length>1?a:"")},parseQuery:(e=window.location)=>{typeof e!="string"&&(e=e.search);let t={};return new URLSearchParams(e).forEach((r,n)=>{Object.defineProperty(t,n,{enumerable:!0,value:r})}),t},hasMandatoryTemplateSegments:function(e){return/(^|\/)\{\.*\}(\/|$)/.test(e)},parseRoute:function(e){let t=e,r=[];if(!i.isNullOrEmpty(t)){let n,s=0;for(;(n=qn.exec(t))!=null;){let o=n[0],a=ii.exec(o);if(!i.isNullOrEmpty(a)){let c=a[1];r.push({name:c,optional:o.charAt(o.length-2)==="?",index:s})}t=t.substring(n.index+o.length),s++}}return r},split:function(e){let r=/^((https?:)?\/\/[^\/]+)?([^\?#]+)(\?[^#]*)?(#[^#]*)?$/.exec(e);return r?{domain:r[2]??"",protocol:r[1]??"",path:r[3]??"",query:r[4]??"",hash:r[5]??""}:null},parseState:function(e,t,r,n,s){let o=t;if(i.isNullOrEmpty(r)){let h=i.URIs.split(t);r=h.path,i.isNullOrEmpty(n)&&(n=h.query??""),i.isNullOrEmpty(s)&&(s=h.hash??""),o=r+n+s}let a=h=>{let v=h.indexOf("#");return v!==0?null:h.substring(v+1)},c=h=>{let v=h.indexOf("?");return v===0?i.URIs.parseQuery(h.substring(v+1)):{}},p={$path:o,$pathname:r,$querystring:n.length>0?n.substring(1):n,$query:c(n),$hash:a(s)},f=0,m=e.slice();if(!i.isNullOrEmpty(m)){let h;for(;(h=qn.exec(r))!=null;){let v=h[0],b=m.findIndex(x=>x.index===f);if(b>=0){let x=m[b],{name:g}=x;Object.defineProperty(p,g,{enumerable:!0,value:v.substring(1)}),m.splice(b,1)}f++,r=r.substring(h.index+v.length)}}for(let h=0;h<m.length;h++)if(!m[h].optional)throw`Must provide "${m[h].name}" route value.`;return p}}}static getApiResult(e){if(typeof e=="object"&&!i.isNull(e)&&e.hasOwnProperty("success"))switch(e.success){case!0:if(e.hasOwnProperty("result"))return e.result;break;case!1:if(e.hasOwnProperty("error"))return null;break}return e}};var Co=Function,hr="pacem:properties",dt="pacem:custom-element:bindings",Pe="pacem:custom-element:host",Pt="pacem:custom-element:scope";var Xn,E=(Xn=window.Pacem)?.Configuration?.prefix??"pacem",R=Xn?.Configuration?.css??E;var ve="__context_pacem",oi=/'(\\'|[^'])*[^\\]?'|"(\\"|[^"])*[^\\]?"/g,ai=/[^\w]new\s|[^\w]window\s*[\.\[]|[^\w]document\s*\.|[^\w]eval\s*\(/,Jn=/(^|[\s\(\[\+\-\*\/!])(:host\.|\^+item[\s\.,;\)\]]|\^+item$|\^+index[^\w\.]|\^+index$|\$?this[\.\s$]?|#[a-zA-Z_][\w]*|::[a-zA-Z_][\w]*)/g,Ne=class i{constructor(){this._pending=!1,this._independent=!1}get dependencies(){return this._dependencies}get functionBody(){return this._fnBody}get voidBody(){return this._voidBody}get pending(){return this._pending}get independent(){return this._independent}evaluate(){return this._fn||(this._fn=new Function("$pacem",ve,this._fnBody)),this._fn.apply(null,[l.core,this._args])}evaluateAsync(){let e=K.defer();return this._fn||(this._fn=new Function("$pacem",ve,this._fnBody)),e.resolve(this._fn.apply(null,[l.core,this._args])),e.promise}evaluatePlus(e={}){if(!this._fn){let n=[ve];for(var t in e)n.push(t);n.push("$pacem"),this._fn=new Function(n.join(", "),this._voidBody)}let r=[].concat(this._args);for(var t in e)r.push(e[t]);return r.push(l.core),this._fn.apply(null,r)}static{this._pendingExpression=null}static _getPendingExpressionSingleton(){if(i._pendingExpression==null){let e=new i;e._pending=!0,e._dependencies=[],i._pendingExpression=e}return i._pendingExpression}static parse(e,t){for(var r=_.findScopeContext(t),n={$this:t},s=[],o="",a=!0,c=[],p,f=0,m=[];(p=oi.exec(e))!=null;){m.push(e.substr(f,p.index-f));let g=p[0].length;c.push({start:p.index,length:g}),f=p.index+g}f<e.length&&m.push(e.substr(f,e.length-f));for(var h=0;h<m.length;h++){let g=m[h];if(ai.test(g))throw`Unsafe expression detected: "${g}".`;if(r==null){if(new RegExp(Jn).test(g)===!0){a=!1;break}}else{let y=g.replace(Jn,(C,P,N,D,O)=>{a=!1;let k="__host_pacem",L=ve+".$this"+(N.endsWith(".")?".":""),S=t,H=O.indexOf(".",D),Z=H>D?O.substr(H+1).trim():"",xe=/^[\w\.\$]+/.exec(Z),G=xe&&xe.length>0&&xe[0],re,J=G&&(re=G.split(".")).length>0&&re[0];if(N===":host.")S=n[k]=n[k]||_.findHostContext(t),L=`${ve}.${k}.`;else if(N.endsWith("^item")||N.substr(0,N.length-1).endsWith("^item")){let M=N.endsWith("^item")?"":N.substr(N.length-1,1),ae=N.length-(M.length>0?6:5),le=`__item_${ae}_up_pacem`,me=Ae.findItemContext(t,ae);S=n[le]=n[le]||me&&me.placeholder,G="item"+(G?"."+G:""),J="item",L=`${ve}.${le}.item${M}`}else if(N.endsWith("^index")||N.substr(0,N.length-1).endsWith("^index")){let M=N.endsWith("^index")?"":N.substr(N.length-1,1),ae=N.length-(M.length>0?7:6),le=`__item_${ae}_up_pacem`,me=Ae.findItemContext(t,ae);S=n[le]=n[le]||me&&me.placeholder,G="index",J="index",L=`${ve}.${le}.index${M}`}else if(N.startsWith("::")){let M=N.substr(2,N.length-2),ae=n[k]=n[k]||_.findHostContext(t);l.isNull(ae)?S=null:S=ae[M],L=`${ve}.${k}.${M}`}else if(N.startsWith("#")){let M=N.substr(1,N.length-1);S=n[M]=n[M]||r.querySelector("#"+M),L=`${ve}.${M}`}return J&&S&&J in S&&typeof S[J]!="function"&&s.find(M=>M.element===S&&M.property==J)==null&&s.push({element:S,property:J,path:G,twowayAllowed:!1}),P+L});if(o+=y,h<c.length){let C=c[h];o+=e.substr(C.start,C.length)}}}if(a){var v=new i;return v._independent=!0,v._fnBody=`return ${e};`,v._voidBody=e,v._dependencies=[],v}if(r==null)return this._getPendingExpressionSingleton();for(var b in n)if(n[b]==null)return i._getPendingExpressionSingleton();s.length==1&&/[^\w\.\$]+/.test(o.trim())!==!0&&(s[0].twowayAllowed=!0);var x=new i;return x._args=n,x._fnBody=`try{ var ___$$$r = ${o}; return ___$$$r; }catch(e){ }`,x._voidBody=`try{ ${o} }catch(e){ }`,x._dependencies=s,x}};var ht=class extends HTMLElement{};var ur="__pacem__",li=/^\{\{(.|\n)+\}\}$/,_=class i{static get polyfilling(){return customElements instanceof window.CustomElementRegistry}static camelToKebab(e){return e&&e.replace(/([A-Z])/g,"-$1").toLowerCase()}static kebabToCamel(e){return e&&e.replace(/(-[a-z])/g,t=>t[1].toUpperCase())}static waitForReady(e){return new Promise((t,r)=>{l.isNull(e)&&r("Not found."),e.isReady&&t();let n=()=>{e.removeEventListener("load",n),t()};e.addEventListener("load",n)})}static whenReady(e,t){i.waitForReady(e).then(t)}static getWatchedProperties(e,t=!0){var r=[],n=e instanceof HTMLElement?e.constructor:e;do{let o=(this.getAttachedPropertyValue(n,hr)||[]).filter(a=>!a.name.startsWith("_"));Array.prototype.splice.apply(r,[0,0].concat(o))}while(t&&(n=Object.getPrototypeOf(n)));return r}static getWatchedProperty(e,t){return this.getWatchedProperties(e,!0).find(r=>r.name===t)}static importjs(e,t=null,r=!1){var n={type:"text/javascript",src:e};return l.isNullOrEmpty(t)||l.extend(n,{integrity:t}),r&&l.extend(n,{crossorigin:""}),i.import(e,"script",n,document.head||document.getElementsByTagName("head")[0])}static importcss(e,t=null,r=!1){var n={rel:"stylesheet",href:e};return l.isNullOrEmpty(t)||l.extend(n,{integrity:t}),r&&l.extend(n,{crossorigin:"anonymous"}),i.import(e,"link",n,document.head||document.getElementsByTagName("head")[0])}static import(e,t,r,n=document.body){let s=l.core;var o=s.imports=s.imports||{};return o[e]=o[e]||new Promise((a,c)=>{var p=t;for(let h in r||{})p+=`[${h}="${r[h]}"]`;var f=document.querySelector(p);if(!l.isNull(f))a(f);else{f=document.createElement(t),f.onerror=h=>{c(h)},f.onload=()=>{a(f)};for(var m in r||{})f.setAttribute(m,r[m]);n.appendChild(f)}})}static{this.Theme={importWebFonts(){function e(s){return/^('|").*\1$/.test(s)?s.substring(1,s.length-1):s}function t(s){return l.isNullOrEmpty(s)?Promise.resolve():document.fonts.load("1rem "+s)}let r=["icons","std","main","tech","btn"].map(s=>{let o=l.Css.getVariableValue(`--${R}-font-${s}`).split(",")[0],a=e(l.Css.getVariableValue(`--${R}-font-${s}-api-url`));return l.isNullOrEmpty(a)?t(o):i.importcss(a).then(c=>t(o))}),n=new Promise(s=>{function o(a=0){a>4||!("size"in document.fonts)||typeof document.fonts.size=="number"&&document.fonts.size>0?document.fonts.ready.then(s):setTimeout(o,250,a++)}o()});return r.push(n),Promise.all(r)}}}static setAttachedPropertyValue(e,t,r){if(l.isNull(e))return;let n=Object.getOwnPropertyDescriptor(e,ur),s=n&&n.value||Object.defineProperty(e,ur,{value:{},enumerable:!1,writable:!1,configurable:!1})[ur];l.isNull(r)?delete s[t]:s[t]=r}static deleteAttachedPropertyValue(e,t){i.setAttachedPropertyValue(e,t,void 0)}static getAttachedPropertyValue(e,t,r){let n=Object.getOwnPropertyDescriptor(e,ur),s=n&&n.value;return l.isNull(s&&s[t])&&!l.isNull(r)?(i.setAttachedPropertyValue(e,t,r),r):s&&s[t]}static resolvePath(e,t){if(!e||!t)return;if(/[\(\)\{\}]/.test(e))throw`Security alert: not allowed to process paths like ${e}.`;let r=e.split(".");var n=t,s=n,o,a=r[0];r.forEach((f,m)=>{var h=f.split("[");h.forEach((v,b)=>{o=s,/\]$/.test(v)&&(v=v.substring(0,v.length-1),/^('|").+[^\\]\1$/.test(v)&&(v=v.substr(1,v.length-2))),s=s[v]})});var c,p;return/\]$/.test(e)?(p=e.lastIndexOf("["),c=e.substring(p+1),c=c.substring(0,c.length-1)):(p=e.lastIndexOf("."),c=e.substring(p+1)),{target:{value:s,name:c},parent:{value:o||t,path:e.substring(0,p)},root:{value:n,property:a}}}static set(e,t,r){var n=i.resolvePath(t,e),s=n.target.value;if(s!==r)if(n.parent.value!=n.root.value&&!(n.parent.value instanceof HTMLElement)){n.parent.value[n.target.name]=r;let o=l.clone(n.root.value[n.root.property]);n.parent.value[n.target.name]=s;let a;n.root.property==="item"&&!l.isNull(a=ge.getRepeaterItem(n.root.value))?a.repeater&&a.repeater.datasource&&a.repeater.datasource.splice(a.index,1,a.item=o):n.root.value[n.root.property]=o}else n.parent.value[n.target.name]=r}static get(e,t){var r=i.resolvePath(t,e);return r&&r.target&&r.target.value}static _findScopeContextLegacy(e){let t=e,r;do t=t.parentNode;while(t!=null&&(t!=(r=e.ownerDocument)||t instanceof HTMLElement&&(r=t.shadowRoot)!=null));return r}static findScopeContext(e){return(e.isConnected?e.getRootNode():i.getAttachedPropertyValue(e,Pt))??i._findScopeContextLegacy(e)}static findAncestor(e,t){let r=e,n;for(;r&&(r=r.parentNode||r.getRootNode()?.host)!=null;)if(r.host instanceof HTMLElement&&(r=r.host),t.apply(r,[r])){n=r;break}return n}static findAncestorShell(e){return i.findAncestor(e,t=>l.is(t,`.${R}-body`)||t===document.body)}static findAncestorOfType(e,t){return i.findAncestor(e,r=>r instanceof t)}static findDescendants(e,t,r=!1){let n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(var s=[];n.nextNode();){let o=n.currentNode;if(t(o)===!0&&(s.push(o),r))return s}return s}static findFirstDescendant(e,t){let r=i.findDescendants(e,t,!0);return l.isNullOrEmpty(r)?void 0:r[0]}static findAll(e="[pacem]",t=r=>!0){let r=[];return document.querySelectorAll(e).forEach((n,s,o)=>{t(n)===!0&&r.push(n)}),r}static findPreviousSiblingOrAncestorOfType(e,t,r=0){let n=e,s=null,o=0;do if(n=n.previousSibling||n.parentNode,n instanceof t){if(o>=r){s=n;break}else n=n.parentNode;o++}while(n!=null);return s}static findPreviousSiblingOrAncestor(e,t,r=0){let n=e,s=null,o=0;do if(n=n.previousSibling||n.parentNode,n&&t.apply(n,[n])){if(o>=r){s=n;break}else n=n.parentNode;o++}while(n!=null);return s}static assignHostContext(e,t){let r=document.createTreeWalker(t.content,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_DOCUMENT_FRAGMENT);for(;r.nextNode();){var n=r.currentNode;l.isNull(i.getAttachedPropertyValue(n,Pe))&&i.setAttachedPropertyValue(n,Pe,e)}}static findHostContext(e){let t=e,r;if(!t.isConnected)return r;for(;t!=null&&(r=i.getAttachedPropertyValue(t,Pe),!(r instanceof HTMLElement));)t=t.parentElement;let n;return r==null&&console&&(n=console.warn)&&n(`Element "${e.constructor.name}" isn't a descendant of a templated component.`),r}static isBindingAttribute(e){return li.test(e)}static extractBindingAttributeExpression(e){if(i.isBindingAttribute(e))return e.substr(2,e.length-4);throw"Invalid attribute: incorrect binding syntax."}static parseBindingAttribute(e,t){let r=i.extractBindingAttributeExpression(e),n=/,\s*(twoway|once)\s*$/.exec(r),s=n&&n.length>1&&n[1];l.isNullOrEmpty(s)||(r=r.substr(0,r.lastIndexOf(",")));var o=Ne.parse(r,t);return(o&&o.dependencies).forEach(a=>{switch(s){case"twoway":a.mode=a.twowayAllowed&&o.dependencies.length==1?"twoway":void 0;break;case"once":a.mode=s;break}}),o}static ensureMember(e,t,r){let n=Object.getOwnPropertyDescriptor(e,t);return n??(Object.defineProperty(e,t,r),Object.getOwnPropertyDescriptor(e,t))}static stripObservedAttributes(e){Yn(e,!1)}static freezeObservedAttributes(e){Yn(e)}};function Yn(i,e=!0){let t=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT);do{var r=t.currentNode;if(r instanceof HTMLElement){let s=r.constructor.observedAttributes;if(!l.isNull(s)){_.deleteAttachedPropertyValue(r,dt);let o=function(a){return l.isArray(a)?"["+a.map(o).join(",")+"]":a instanceof Element?`#${a.id=a.id||"_"+l.uniqueCode()}`:`${l.Json.stringify(a)}`};for(var n of s)if(n in r.attributes){let a,c;if(e&&!l.isNull(c=r[a=_.kebabToCamel(n)])){let p=o(c);r.setAttribute(n,`{{ ${p} }}`)}else r.removeAttribute(n)}}}}while(t.nextNode())}var Qn=_.getAttachedPropertyValue,ci=_.setAttachedPropertyValue,Yr="pacem:repeater-item",Ae=class{static findItemContext(e,t=0,r=console.warn){let n=ge.findUpwards(e,t,r);return n==null&&r&&e instanceof HTMLElement&&e.isConnected&&r(`Couldn't find a ${ge.name} up ${t} level${t===1?"":"s"} from element "${e.constructor.name}".`),n}},ge=class i{static findUpwards(e,t=0,r=console.warn){if(l.isNull(e)||e.localName==="template"||e instanceof ht)return null;let n=null,s=a=>!l.isNull(n=i.getRepeaterItem(a));return _.findPreviousSiblingOrAncestor(e,s,t)==null&&r&&e instanceof HTMLElement&&e.isConnected&&r(`Couldn't find a ${i.name} up ${t} level${t===1?"":"s"} from element "${e.constructor.name}".`),n}static isRepeaterItem(e){return!l.isNull(Qn(e,Yr))}static getRepeaterItem(e){return Qn(e,Yr)}constructor(e){this._placeholder=e,ci(e,Yr,this)}get placeholder(){return this._placeholder}};var Zn;(function(i){i.AltKey="Alt",i.CtrlKey="Ctrl",i.ShiftKey="Shift",i.MetaKey="Cmd"})(Zn||(Zn={}));var j=class{static isInstanceOf(e,t){return e instanceof t}static getEventCoordinates(e){var t;return"touches"in e?l.isNullOrEmpty(e.touches)?l.isNullOrEmpty(e.changedTouches)||(t=e.changedTouches[0]):t=e.touches[0]:t=e,{page:{x:t.pageX,y:t.pageY},screen:{x:t.screenX,y:t.screenY},client:{x:t.clientX,y:t.clientY}}}static getEventKeyModifiers(e){var t=e.which;return e instanceof MouseEvent&&(t=e.button),{which:t,shiftKey:e.shiftKey,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey}}static matchModifiers(e,...t){let r=!l.isNull(t)&&(t.length===1&&l.isArray(t[0])?t[0]:Array.from(t).filter(p=>!l.isNullOrEmpty(p))),n=(r||[]).map(p=>p.toLowerCase()),s=n.indexOf("alt")>=0||n.indexOf("option")>=0,o=n.indexOf("shift")>=0,a=n.indexOf("ctrl")>=0,c=n.indexOf("win")>=0||n.indexOf("cmd")>=0;return!(s!==e.altKey||o!==e.shiftKey||c!==e.metaKey||a!==e.ctrlKey)}static fixEdgeCustomEventSubClassInstance(e,t){e instanceof t||Object.setPrototypeOf(e,t)}};var $=class extends CustomEvent{constructor(e,t,r){super(e,l.extend({detail:t},r||{})),j.fixEdgeCustomEventSubClassInstance(this,this.constructor)}};function pi(i){if("detail"in i){for(let e in i)if(e!=="bubbles"&&e!=="cancelable"&&e!=="composed"&&e!=="detail")return!1;return!0}return!1}var Oe=class extends CustomEvent{constructor(e,t,r,n){super(e,l.extend(pi(t||{})?t:{detail:t},!(r instanceof Event)&&r||{}));let s=n||r;s instanceof Event&&(this.#e=s,this.#t=j.getEventKeyModifiers(s),(s instanceof MouseEvent||s instanceof TouchEvent)&&(this.#r=j.getEventCoordinates(s))),j.fixEdgeCustomEventSubClassInstance(this,this.constructor)}#e;#t;#r;get originalEvent(){return this.#e}get which(){return this.#t?.which}get altKey(){return this.#t?.altKey}get shiftKey(){return this.#t?.shiftKey}get ctrlKey(){return this.#t?.ctrlKey}get metaKey(){return this.#t?.metaKey}get pageX(){return this.#r?.page.x}get pageY(){return this.#r?.page.y}get clientX(){return this.#r?.client.x}get clientY(){return this.#r?.client.y}get screenX(){return this.#r?.screen.x}get screenY(){return this.#r?.screen.y}},di="attributechange",fr=class extends ${constructor(e){super(di,e)}},Ie="propertychange",ne=class extends ${constructor(e){super(Ie,e)}},hi="navigating",ui="navigate",mr=class extends ${constructor(e){super(ui,typeof e=="string"?{path:e}:e,{cancelable:!1,bubbles:!1})}},vr=class extends ${constructor(e){super(hi,e,{cancelable:!0,bubbles:!1})}};var gr=class extends ${constructor(e){super("currentindexchange",e)}};var Nt="command",es=class extends ${constructor(e){super(Nt,e,{bubbles:!0,cancelable:!0})}};var yr=(i,e)=>l.areSemanticallyEqual(i,e);import{Point as fi,Size as mi,Rect as vi}from"@pacem/pacem-foundation";var gi={convert:i=>{}},yi={convert:i=>i,convertBack:i=>i},bi={convert:i=>i&&i.trim().split(/[ ,]+/),convertBack:i=>l.isArray(i)&&i.join(" ")||""},_i={convert:i=>parseFloat(i),convertBack:i=>i.toString()},Ei={convert:i=>!l.isNullOrEmpty(i)&&i!=="0"&&i!=="false",convertBack:i=>(!!i).toString()},wi={convert:i=>i==="true"||i==="1",convertBack:i=>(!!i).toString()},ts={convert:i=>l.parseDate(i),convertBack:i=>l.parseDate(i).toISOString()},xi=ts,Ci={convert:i=>l.Json.parse(i),convertBack:i=>l.Json.stringify(i)},Pi={convert:i=>Function(`return ${i};`).apply(null),convertBack:i=>{}},Ni={convert:i=>document.querySelector(i),convertBack:i=>i instanceof Element&&i.id?"#"+i.id:void 0,retryConversionWhenReady:!0},Ai={convert:i=>fi.parse(i),convertBack:i=>`${i.x||0} ${i.y||0}`},Oi={convert:i=>mi.parse(i),convertBack:i=>`${i.width||0} ${i.height||0}`},Ri={convert:i=>vi.parse(i),convertBack:i=>`${i.x||0} ${i.y||0} ${i.width||0} ${i.height||0}`},u={None:gi,String:yi,StringArray:bi,Number:_i,Boolean:Ei,BooleanStrict:wi,Date:xi,Datetime:ts,Json:Ci,Eval:Pi,Element:Ni,Point:Ai,Rect:Ri,Size:Oi};var X;(function(i){i.Get="GET",i.Post="POST",i.Put="PUT",i.Delete="DELETE",i.Options="OPTIONS",i.Head="HEAD",i.Patch="PATCH",i.Connect="CONNECT",i.Trace="TRACE"})(X||(X={}));var Qr="fetchresult",Zr="error",en="success",At=class{static isEmpty(e){return e.status===204||e.headers.get("Content-Length")==="0"}};var Ti=()=>{},Ot=class extends Error{constructor(e,t){super(t),this.statusCode=e}get status(){return this.statusCode}},br=class{constructor(e,t){e&&(this._status=e.status,this._body=e.response,this._text=e.responseText,this._type=e.responseType,this._allHeadersRaw=e.getAllResponseHeaders(),this._processTime=t)}get processTime(){return this._processTime}get headers(){return this._headers===void 0&&this._allHeadersRaw&&this._parseHeaders(),this._headers}get size(){return+this.headers["Content-Length"]}get mime(){return this.headers["Content-Type"]}get date(){return new Date(Date.parse(this.headers.Date))}_parseHeaders(){let e={};this._allHeadersRaw.split(`\r
6
+ var ti=Object.defineProperty;var lt=(i,e)=>{for(var t in e)ti(i,t,{get:e[t],enumerable:!0})};var ct=class i{constructor(){}static clone(e){return new i()._clone(e)}_clone(e){let t=new WeakMap;function r(n){if(typeof n=="object"&&n!==null&&!(n instanceof Element)&&!(n instanceof FileSystemHandle)&&!(n instanceof File)){if(Array.isArray(n))return n.map(r);if(n instanceof Date)return new Date(n.valueOf());if(n instanceof RegExp)return new RegExp(n);if(t.has(n))return t.get(n);{let s=Object.assign({},n);return t.set(n,s),Object.keys(s).forEach(o=>{s[o]=r(n[o])}),s}}return n}return r(e)}};import{Keys as ri}from"@pacem/pacem-foundation";var He="$refId",cr;(function(i){i[i.Ignore=0]="Ignore",i.Reference="reference",i.Plain="plain"})(cr||(cr={}));var pr=class{static{this._jsonFnWeakMap=new WeakMap}static{this._jsonFnMap=new Map}static store(e){let t=this._jsonFnWeakMap;if(!t.has(e)){let r=ri.uniqueCode();t.set(e,r),this._jsonFnMap.set(r,e)}return t.get(e)}static retrieve(e){return this._jsonFnMap.get(e)}static remove(e){let t=this.retrieve(e);this._jsonFnMap.delete(e),this._jsonFnWeakMap.delete(t)}},Ct=class _Json{constructor(i){this._options=i}static serialize(i,e){return new _Json(e)._serialize(i)}static deserialize(i){return new _Json()._deserialize(i)}_serialize(i){let e=ct.clone(i),t=[He],r=this._flatten(e,0,null,t);return JSON.stringify(r,t.sort())}_deserialize(json){let hasRefs=!1,obj=JSON.parse(json,(key,value)=>{let elPattern=/^\$<#(.+)>$/,fnPattern=/^\$<fn:([^\x05]+)>$/,regexPattern=/^\$<regex:(.+)>$/,fnRefPattern=/^\$<fn#(.+)>$/,arr;if(key===He)hasRefs=!0;else if(typeof value=="string")if((arr=regexPattern.exec(value))&&arr.length>1){let i=arr[1],e=i.lastIndexOf("|");return new RegExp(i.substr(0,e),i.substr(e+1))}else{if((arr=elPattern.exec(value))&&arr.length>1)return document.getElementById(arr[1]);if((arr=fnPattern.exec(value))&&arr.length>1)return eval(arr[1]);if((arr=fnRefPattern.exec(value))&&arr.length>1)return pr.retrieve(arr[1])}return value});return hasRefs?this._revive(obj):obj}_flatten(i,e=0,t,r){if(t=t||new WeakSet,r=r||[],i instanceof Element)return i.id?`$<#${i.id}>`:void 0;if(i instanceof RegExp)return`$<regex:${i.source}|${i.flags}>`;if(typeof i=="object"&&i!=null&&!(i instanceof Date))return Array.isArray(i)?i.map(n=>this._flatten(n,e,t,r)):t.has(i)?i[He]=i[He]||"$#ref_"+e++:(t.add(i),Object.keys(i).forEach(n=>{r.indexOf(n)===-1&&r.push(n),i[n]=this._flatten(i[n],e,t,r)}),i);if(typeof i=="function")switch(this._options?.functions){case cr.Reference:return"$<fn#"+pr.store(i)+">";case cr.Plain:return"$<fn:"+i+">";default:return}return i}_revive(i){let e={},t=/^\$#ref_(.+)$/;function r(n){if(typeof n=="object"&&n!==null){if(Array.isArray(n))return n.map(r);He in n&&(e[n[He]]=n,delete n[He]),Object.keys(n).forEach(s=>{n[s]=r(n[s])})}else if(typeof n=="string"&&t.test(n)){let s=t.exec(n);return e[s[0]]}return n}return r(i)}};import{Keys as Jr,Dates as Ce,Colors as Wn,Strings as pt,Blobs as dr,Imaging as zn,NullChecker as Gn,detect as ni}from"@pacem/pacem-foundation";var K=class i{constructor(){this.deferred=null;var e=this;e.promise=new Promise(function(t,r){e.deferred={resolve:t,reject:r,promise:e}})}then(e,t){return this.promise.then(e,t)}finally(e){return this.promise.then(e,e),this}success(e){return this.promise.then(e,null),this}error(e){return this.promise.then(null,e),this}static defer(){var e=new i;return e.deferred}};var si="pacem",Kn="download",Eo=i=>{i.stopPropagation()},wo=i=>{i.preventDefault()},ce=i=>{i.preventDefault(),i.stopPropagation()},qn=/^\/[^\/]+/,ii=/\/\{([a-z\$_][\w]*)\??\}/,l=class i{static get core(){let e=window.Pacem;var t=e&&e.Configuration&&e.Configuration.core||si;return window[t]=window[t]||{}}static get customElements(){return window.customElements}static uniqueId(){return Jr.uniqueId()}static uniqueCode(){return Jr.uniqueCode()}static randomString(e){return Jr.randomString(e)}static parseDate(e){return Ce.parse(e)}static copyToClipboard(e){return navigator.clipboard?navigator.clipboard.writeText(e):new Promise((t,r)=>{let n=document.createElement("textarea");n.value=e,n.style.opacity="0",document.body.appendChild(n);try{n.select(),document.execCommand("copy"),n.remove(),t()}catch(s){r(s)}})}static{this.Json={stringify:Ct.serialize,parse:Ct.deserialize}}static{this.Dates={now:()=>i.parseDate(Date.now()),parse:i.parseDate,isLeapYear:Ce.isLeapYear,daysInMonth:Ce.daysInMonth,isDate:Ce.isDate,dateOnly:Ce.dateOnly,addMonths:Ce.addMonths,addDays:Ce.addDays,daysBetween:Ce.daysBetween}}static colorize(e,t){let r={h:38,s:.245,l:.6};var n,s,o,a;e instanceof HTMLElement?n=t:n=e,typeof n=="string"?s=Wn.parse(n):s={r:n[0],g:n[1],b:n[2]};let c=Wn.hsl(s);if(o=`brightness(50%) sepia(1) hue-rotate(${c.h-r.h}deg) saturate(${1+(c.s-r.s)}) brightness(${1+(c.l-r.l)})`,n===t)a.style.filter=o;else return o}static cssEscape(e){return escape(e).replace("%","\\")}static{this.Css={colorize:i.colorize,escape:i.cssEscape,getVariableValue(e){return getComputedStyle(document.documentElement).getPropertyValue(e)},setVariable(e,t){getComputedStyle(document.documentElement).setProperty(e,t)},isClassDefined(e){let t=new RegExp("."+e+"($|[s.,])");for(let r=0;r<document.styleSheets.length;r++){let n=document.styleSheets.item(r);try{let s=n.cssRules;for(let o=0;o<s.length;o++){let a=n.cssRules.item(o);if(t.test(a.selectorText))return!0}}catch(s){s instanceof DOMException&&console.warn(`Couldn't access cssRules of stylesheet "`+n.href+'".')}}return!1},deserializeTransform(e){let t=e instanceof Element?getComputedStyle(e):e,r=1,n=0,s=0,o=1,a=0,c=0,p=/^matrix\((.*)\)$/.exec(t.transform),f;return p&&p.length>1&&(f=p[1].split(",")).length==6&&(r=parseFloat(f[0]),n=parseFloat(f[1]),s=parseFloat(f[2]),o=parseFloat(f[3]),a+=parseFloat(f[4]),c+=parseFloat(f[5])),{a:r,b:n,c:s,d:o,e:a,f:c}}}}static{this.leftPad=pt.leftPad}static{this.formatString=pt.format}static{this.diff=pt.diff}static{this.Strings={leftPad:pt.leftPad,format:pt.format,diff:pt.diff,stripHTML:e=>new DOMParser().parseFromString(e,"text/html").body.textContent||""}}static{this.Blobs={toDataURL:dr.blobToDataURL,fromDataURL:dr.dataURLToBlob,toText:dr.blobToText,fromText:dr.textToBlob}}static{this.Images={load:zn.loadImage,resize:zn.resizeImage}}static loadImage(e){return new Promise((t,r)=>{let n=new Image;n.src=e,n.complete?t(n):(n.onload=s=>{t(n)},n.onerror=s=>{r()})})}static blobToDataURL(e){return i.Blobs.toDataURL(e)}static dataURLToBlob(e){return i.Blobs.fromDataURL(e)}static blobToText(e,t){return i.Blobs.toText(e,t)}static textToBlob(e,t="text/plain"){return i.Blobs.fromText(e,t)}static resizeImage(e,t,r,n){var s=K.defer();return i.blobToDataURL(e).then(i.loadImage).then(o=>{let a=o.width,c=o.height,p=document.createElement("canvas");p.width=a,p.height=c;let f=p.getContext("2d");if(a>t||c>r){let m=a/c,h=t/r,v,b;h<m?(b=t,v=t/m):(v=r,b=r*m),p.width=b,p.height=v;let x=n>0&&n<=1;x&&(f.fillStyle="#000",f.fillRect(0,0,p.width,p.height)),i.cropImageOntoCanvas(o,f);let g;x?g=f.canvas.toDataURL("image/jpeg",n):g=f.canvas.toDataURL(),s.resolve(i.dataURLToBlob(g))}else s.resolve(e)},o=>{}),s.promise}static cropImage(e,t,r,n){var s=K.defer();let o=new Image;return o.crossOrigin="anonymous",o.onload=function(a){let c=document.createElement("canvas"),p=c.getContext("2d");t&&(c.width=t),r&&(c.height=r);let f=n>0&&n<=1;f&&(p.fillStyle="#000",p.fillRect(0,0,c.width,c.height)),i.cropImageOntoCanvas(o,p),s.resolve(f?c.toDataURL("image/jpeg",n):c.toDataURL())},o.src=e,s.promise}static getUserMediaFunctions(){var e=[];let r=[navigator.getUserMedia,navigator.webkitGetUserMedia,navigator.msGetUserMedia,navigator.mozGetUserMedia].filter(function(n,s){return typeof n=="function"});return r.length&&(e=r),e}static cropImageOntoCanvas(e,t,r,n){t.imageSmoothingEnabled=t.mozImageSmoothingEnabled=t.oImageSmoothingEnabled=t.webkitImageSmoothingEnabled=!0;let s=t.canvas.width,o=t.canvas.height,a=s,c=o,p=r||1*e.width,f=n||1*e.height;var m=p/f,h=s/o;if(h>m){var v=s/p;o=v*f,t.drawImage(e,0,.5*(-o+c),a,o)}else{var v=o/f;s=v*p,t.drawImage(e,-Math.abs(.5*(-s+a)),0,s,c)}}static get _domURL(){return window.URL||window.webkitURL||window}static snapshotElement(e,t,r="image/png",n){function s(o){return new Promise((a,c)=>{let p=document.createElement("canvas"),f=o.width,m=o.height;if(!(f>0))c("Image has width zero.");else if(!(m>0))c("Image has height zero.");else{p.width=f,p.height=m;let h=p.getContext("2d");i.isNullOrEmpty(t)||(h.fillStyle=t,h.fillRect(0,0,f,m)),h.drawImage(o,0,0),p.toBlob(v=>{a(v)},r,n)}})}return e instanceof HTMLCanvasElement?s(e):new Promise((o,a)=>{let c=[];function p(g){let y=new Promise((C,P)=>{let N=()=>g instanceof HTMLImageElement?g.src:g.href.baseVal,D=O=>{g instanceof HTMLImageElement?g.src=O:g.setAttribute("href",O)};fetch(N()).then(O=>O.blob()).then(O=>i.blobToDataURL(O)).then(O=>{D(O),C()})});c.push(y)}function f(g,y){let C=new Promise((P,N)=>{let D=new Image;D.crossOrigin="anonymous",D.width=y.width,D.height=y.height,D.style.cssText=g.style.cssText,D.onload=()=>{g.replaceWith(D),P()},D.src=y.toDataURL()});c.push(C)}function m(g,y){let C=getComputedStyle(y);for(let P=0;P<C.length;P++){let N=C.item(P);g.style[N]=C[N]}}function h(g,y){m(g,y),g instanceof HTMLImageElement||g instanceof SVGImageElement?p(g):g instanceof HTMLCanvasElement&&f(g,y);let C=g.children.length;for(let P=0;P<C;P++){let N=g.children.item(P),D=y.children.item(P);N.tagName===D.tagName&&h(N,D)}}if(e instanceof SVGElement){let g=e.cloneNode(!0);h(g,e),Promise.all(c).then(y=>{e=g,x()})}else{var b=document.implementation.createHTMLDocument("");b.write(e.outerHTML),b.documentElement.setAttribute("xmlns",b.documentElement.namespaceURI);let y=document.evaluate(".//"+e.localName,b.body,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;y.setAttribute("xmlns",b.documentElement.namespaceURI),h(y,e),Promise.all(c).then(C=>{let P=document.createElementNS("http://www.w3.org/2000/svg","svg"),N=i.offset(e);P.setAttribute("viewBox",`0 0 ${N.width} ${N.height}`),P.setAttribute("width",N.width.toString()),P.setAttribute("height",N.height.toString()),P.innerHTML=`<foreignObject width="${N.width}" height="${N.height}">${y.outerHTML}</foreignObject>`,e=P,x()})}function x(){let g=new XMLSerializer().serializeToString(e),y=new Image;y.crossOrigin="anonymous";let C="data:image/svg+xml;charset=utf8,"+encodeURIComponent(g);y.onload=()=>{s(y).then(o)},y.src=C}})}static async download(e,t,r="application/download"){if(typeof e=="string"){let a=e,c={},p;i.isNullOrEmpty(t)||(typeof t=="object"?(c={credentials:t.credentials,headers:t.headers},p=t.filename||p,r=t.mime||r):p=t);var n=await fetch(a,c);if(n.ok){if(i.isNullOrEmpty(p)){let m="Content-Disposition";if(n.headers.has(m)){let h=n.headers.get(m),v=/^attachment; filename=\"?([^;\"]+)\"?(;|$)/.exec(h);v.length>1&&(p=v[1])}else p=Kn}var s=await n.blob();let f=p.split(/[\\\/]/g).join("_");return i.download(s,f)}{let f=await n.text();throw new Error(f)}}else{let a=e,c=typeof t=="string"&&t||Kn,p=document.createElement("a");if(p.setAttribute("href",i._domURL.createObjectURL(a)),p.setAttribute("download",c),document.createEvent){var o=document.createEvent("MouseEvents");o.initEvent("click",!0,!0),p.dispatchEvent(o)}else p.click()}}static isDOMReady(){return document.readyState==="complete"}static onDOMReady(e){window.addEventListener("load",e,!1)}static moveChildren(e,t){return i.moveItems(e.childNodes,t)}static moveItems(e,t){let r=[],n;for(let s=e.length-1;s>=0;s--){let o=e instanceof NodeList?e.item(s):e[s];t.insertBefore(o,n),r.unshift(o),n=o}return r}static is(e,t){return(e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector).call(e,t)}static lang(e){return e.lang||document.documentElement.lang||navigator.language}static jsonSortStringify(e){return i.isNull(e)?e:i.Json.stringify(e)}static{this.Browsers={detect:ni}}static cookies(e){let t=(e??document.cookie).split(";"),r={};for(var n of t){let s=n.split("=");if(s.length<2)continue;let o=(s[0]||"").trim(),a=(s[1]||"").trim();Object.defineProperty(r,o,{configurable:!1,enumerable:!0,writable:!1,value:decodeURIComponent(a.split("+").join(" "))})}return r}static{this.Cookies={getAll:async e=>{let t="cookieStore"in window?window.cookieStore:null,r=[];if(i.isNull(t)){let n=i.cookies();for(let s in n)!i.isNullOrEmpty(e)&&e!==s||r.push({name:s,value:n[s]});return r}else return await t.getAll(e)},stringify:e=>{let t=`${e.name}=${encodeURIComponent(e.value??"")}`;return i.isNullOrEmpty(e.domain)||(t+=`; domain=${encodeURIComponent(e.domain)}`),i.isNullOrEmpty(e.path)||(t+=`; path=${encodeURIComponent(e.path)}`),e.maxAge>0&&(t+=`; max-age=${e.maxAge.toFixed(0)}`),i.isNullOrEmpty(e.expires)||(t+=`; expires=${e.expires}`),e.partitioned&&(t+="; Partitioned"),i.isNullOrEmpty(e.sameSite)||(t+=`; SameSite=${encodeURIComponent(e.sameSite)}`),e.secure&&(t+="; Secure"),t}}}static isVisible(e){return"checkVisibility"in e?e.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):getComputedStyle(e).visibility!=="hidden"&&(e.clientWidth>0||e.clientHeight>0)}static hasClass(e,t){return e.classList?e.classList.contains(t):new RegExp("(^| )"+t+"( |$)","gi").test(e.className)}static addClass(e,t){let r=t.trim();e.classList?DOMTokenList.prototype.add.apply(e.classList,r.split(" ")):e.setAttribute("class",e.className+" "+r)}static removeClass(e,t){let r=t.trim();e.classList?DOMTokenList.prototype.remove.apply(e.classList,r.split(" ")):e.setAttribute("class",e.className.replace(new RegExp("(^|\\b)"+r.split(" ").join("|")+"(\\b|$)","gi")," "))}static toggleClass(e,t,r){r?i.addClass(e,t):i.removeClass(e,t)}static hasPart(e,t){return e.part.contains(t)}static addPart(e,t){DOMTokenList.prototype.add.apply(e.part,t.trim().split(" "))}static removePart(e,t){DOMTokenList.prototype.remove.apply(e.part,t.trim().split(" "))}static togglePart(e,t,r){r?i.addPart(e,t):i.removePart(e,t)}static offset(e){var t=e.getBoundingClientRect();return{top:Math.round(t.top)+i.scrollTop,left:Math.round(t.left)+i.scrollLeft,width:Math.round(t.width),height:Math.round(t.height)}}static offsetRect(e){var t=this.offset(e);return{y:t.top,x:t.left,width:t.width,height:t.height}}static naturalOffsetTop(e){return(e?.offsetTop??0)+(e?.offsetParent&&e.offsetParent instanceof HTMLElement?this.naturalOffsetTop(e.offsetParent):0)}static naturalOffsetLeft(e){return(e?.offsetTop??0)+(e?.offsetParent&&e.offsetParent instanceof HTMLElement?this.naturalOffsetLeft(e.offsetParent):0)}static naturalOffset(e){return{left:this.naturalOffsetLeft(e),top:this.naturalOffsetTop(e),width:e?.offsetWidth??0,height:e?.offsetHeight??0}}static naturalOffsetRect(e){var t=this.naturalOffset(e);return{y:t.top,x:t.left,width:t.width,height:t.height}}static deserializeTransform(e){return i.Css.deserializeTransform(e)}static set scrollTop(e){window.scrollTo(i.scrollLeft,e)}static set scrollLeft(e){window.scrollTo(e,i.scrollTop)}static scrollTo(e,t=!0,r=!0){let n=i.isNull(t)||typeof t=="boolean",s=n?i.scrollLeft:e,o=n?e:t,a=(n?t:r)?"smooth":"instant";window.scrollTo({behavior:a,left:s,top:o})}static get scrollTop(){return window.scrollY||document.documentElement.scrollTop||document.body.scrollTop||0}static get scrollLeft(){return window.scrollX||document.documentElement.scrollLeft||document.body.scrollLeft||0}static get windowSize(){let e=window;return{width:e.innerWidth||e.document.documentElement.clientWidth||e.document.body.clientWidth||0,height:e.innerHeight||e.document.documentElement.clientHeight||e.document.body.clientHeight||0}}static addAnimationEndCallback(e,t,r=500){let n=o=>{(!o||o.target==e)&&(clearTimeout(s),e.removeEventListener("animationend",n,!1),e.removeEventListener("transitionend",n,!1),t.apply(this,[e]))};e.addEventListener("animationend",n,!1),e.addEventListener("transitionend",n,!1);let s=setTimeout(n,r)}static waitForAnimationEnd(e,t=500){return new Promise((r,n)=>{i.addAnimationEndCallback(e,()=>{r()},t)})}static idle(e){return new Promise((t,r)=>{setTimeout(()=>t(),e)})}static accelerateCallback(e,t=500,r=5,n=20){let s={cancel:!1},o=t,a=r+n,c=()=>{e(s),s.cancel||(setTimeout(c,o),o<a?o=n:o-=r)};c()}static isEmpty(e){return Gn.isEmpty(e)&&!(e instanceof Node)}static isNull(e){return Gn.isNull(e)}static isArray(e){return Array.isArray(e)}static isNullOrEmpty(e){return i.isNull(e)||i.isEmpty(e)}static areSemanticallyEqual(e,t){e??=null,t??=null;let r=e&&e.valueOf&&e.valueOf(),n=t&&t.valueOf&&t.valueOf();return r===n}static{this.extend=Object.assign}static clone(e){if(e!==void 0)return ct.clone(e)}static fromResult(e){return Promise.resolve(e)}static fromResultAsync(e){return new Promise(t=>requestAnimationFrame(()=>t(e())))}static readonlyCopy(e){if(i.isNull(e))return null;if(i.isArray(e)){let t=e.slice(0);return Object.freeze(t),t}else{let t={};for(let r in e)t[r]=e[r];return Object.freeze(t),t}}static{this.URIs={format:function(e,t,r){for(let o in t||{}){let c=new RegExp("(^|\\/)\\{"+o+"\\??\\}(\\/|$)").exec(e);if(c&&c.length){let p=new RegExp("\\{"+o+"\\??\\}"),f=c.index;e=e.substring(0,f)+e.substring(f).replace(p,encodeURIComponent(t[o])),r&&delete t[o]}}let n=/(^|\/)\{[\w]+\?\}(\/|$)/;for(var s;(s=n.exec(e))&&s.length>0;){let o=s[0];e=e.replace(o,o.endsWith("/")?"/":"")}return e},appendQuery:function(e,t,r=!1,n=!1){let s=n?"#":"?",a=((n?/#/:/\?/).test(e)?"&":s)+Object.keys(t).filter(c=>!i.isNull(t[c])||!r).map(c=>encodeURIComponent(c)+"="+encodeURIComponent(t[c]??"")).join("&");return e+(a.length>1?a:"")},parseQuery:(e=window.location)=>{typeof e!="string"&&(e=e.search);let t={};return new URLSearchParams(e).forEach((r,n)=>{Object.defineProperty(t,n,{enumerable:!0,value:r})}),t},hasMandatoryTemplateSegments:function(e){return/(^|\/)\{\.*\}(\/|$)/.test(e)},parseRoute:function(e){let t=e,r=[];if(!i.isNullOrEmpty(t)){let n,s=0;for(;(n=qn.exec(t))!=null;){let o=n[0],a=ii.exec(o);if(!i.isNullOrEmpty(a)){let c=a[1];r.push({name:c,optional:o.charAt(o.length-2)==="?",index:s})}t=t.substring(n.index+o.length),s++}}return r},split:function(e){let r=/^((https?:)?\/\/[^\/]+)?([^\?#]+)(\?[^#]*)?(#[^#]*)?$/.exec(e);return r?{domain:r[2]??"",protocol:r[1]??"",path:r[3]??"",query:r[4]??"",hash:r[5]??""}:null},parseState:function(e,t,r,n,s){let o=t;if(i.isNullOrEmpty(r)){let h=i.URIs.split(t);r=h.path,i.isNullOrEmpty(n)&&(n=h.query??""),i.isNullOrEmpty(s)&&(s=h.hash??""),o=r+n+s}let a=h=>{let v=h.indexOf("#");return v!==0?null:h.substring(v+1)},c=h=>{let v=h.indexOf("?");return v===0?i.URIs.parseQuery(h.substring(v+1)):{}},p={$path:o,$pathname:r,$querystring:n.length>0?n.substring(1):n,$query:c(n),$hash:a(s)},f=0,m=e.slice();if(!i.isNullOrEmpty(m)){let h;for(;(h=qn.exec(r))!=null;){let v=h[0],b=m.findIndex(x=>x.index===f);if(b>=0){let x=m[b],{name:g}=x;Object.defineProperty(p,g,{enumerable:!0,value:v.substring(1)}),m.splice(b,1)}f++,r=r.substring(h.index+v.length)}}for(let h=0;h<m.length;h++)if(!m[h].optional)throw`Must provide "${m[h].name}" route value.`;return p}}}static getApiResult(e){if(typeof e=="object"&&!i.isNull(e)&&e.hasOwnProperty("success"))switch(e.success){case!0:if(e.hasOwnProperty("result"))return e.result;break;case!1:if(e.hasOwnProperty("error"))return null;break}return e}};var Co=Function,hr="pacem:properties",dt="pacem:custom-element:bindings",Pe="pacem:custom-element:host",Pt="pacem:custom-element:scope";var Xn,E=(Xn=window.Pacem)?.Configuration?.prefix??"pacem",R=Xn?.Configuration?.css??E;var ve="__context_pacem",oi=/'(\\'|[^'])*[^\\]?'|"(\\"|[^"])*[^\\]?"/g,ai=/[^\w]new\s|[^\w]window\s*[\.\[]|[^\w]document\s*\.|[^\w]eval\s*\(/,Jn=/(^|[\s\(\[\+\-\*\/!])(:host\.|\^+item[\s\.,;\)\]]|\^+item$|\^+index[^\w\.]|\^+index$|\$?this[\.\s$]?|#[a-zA-Z_][\w]*|::[a-zA-Z_][\w]*)/g,Ne=class i{constructor(){this._pending=!1,this._independent=!1}get dependencies(){return this._dependencies}get functionBody(){return this._fnBody}get voidBody(){return this._voidBody}get pending(){return this._pending}get independent(){return this._independent}evaluate(){return this._fn||(this._fn=new Function("$pacem",ve,this._fnBody)),this._fn.apply(null,[l.core,this._args])}evaluateAsync(){let e=K.defer();return this._fn||(this._fn=new Function("$pacem",ve,this._fnBody)),e.resolve(this._fn.apply(null,[l.core,this._args])),e.promise}evaluatePlus(e={}){if(!this._fn){let n=[ve];for(var t in e)n.push(t);n.push("$pacem"),this._fn=new Function(n.join(", "),this._voidBody)}let r=[].concat(this._args);for(var t in e)r.push(e[t]);return r.push(l.core),this._fn.apply(null,r)}static{this._pendingExpression=null}static _getPendingExpressionSingleton(){if(i._pendingExpression==null){let e=new i;e._pending=!0,e._dependencies=[],i._pendingExpression=e}return i._pendingExpression}static parse(e,t){for(var r=_.findScopeContext(t),n={$this:t},s=[],o="",a=!0,c=[],p,f=0,m=[];(p=oi.exec(e))!=null;){m.push(e.substr(f,p.index-f));let g=p[0].length;c.push({start:p.index,length:g}),f=p.index+g}f<e.length&&m.push(e.substr(f,e.length-f));for(var h=0;h<m.length;h++){let g=m[h];if(ai.test(g))throw`Unsafe expression detected: "${g}".`;if(r==null){if(new RegExp(Jn).test(g)===!0){a=!1;break}}else{let y=g.replace(Jn,(C,P,N,D,O)=>{a=!1;let k="__host_pacem",L=ve+".$this"+(N.endsWith(".")?".":""),S=t,H=O.indexOf(".",D),Z=H>D?O.substr(H+1).trim():"",xe=/^[\w\.\$]+/.exec(Z),G=xe&&xe.length>0&&xe[0],re,J=G&&(re=G.split(".")).length>0&&re[0];if(N===":host.")S=n[k]=n[k]||_.findHostContext(t),L=`${ve}.${k}.`;else if(N.endsWith("^item")||N.substr(0,N.length-1).endsWith("^item")){let M=N.endsWith("^item")?"":N.substr(N.length-1,1),ae=N.length-(M.length>0?6:5),le=`__item_${ae}_up_pacem`,me=Ae.findItemContext(t,ae);S=n[le]=n[le]||me&&me.placeholder,G="item"+(G?"."+G:""),J="item",L=`${ve}.${le}.item${M}`}else if(N.endsWith("^index")||N.substr(0,N.length-1).endsWith("^index")){let M=N.endsWith("^index")?"":N.substr(N.length-1,1),ae=N.length-(M.length>0?7:6),le=`__item_${ae}_up_pacem`,me=Ae.findItemContext(t,ae);S=n[le]=n[le]||me&&me.placeholder,G="index",J="index",L=`${ve}.${le}.index${M}`}else if(N.startsWith("::")){let M=N.substr(2,N.length-2),ae=n[k]=n[k]||_.findHostContext(t);l.isNull(ae)?S=null:S=ae[M],L=`${ve}.${k}.${M}`}else if(N.startsWith("#")){let M=N.substr(1,N.length-1);S=n[M]=n[M]||r.querySelector("#"+M),L=`${ve}.${M}`}return J&&S&&J in S&&typeof S[J]!="function"&&s.find(M=>M.element===S&&M.property==J)==null&&s.push({element:S,property:J,path:G,twowayAllowed:!1}),P+L});if(o+=y,h<c.length){let C=c[h];o+=e.substr(C.start,C.length)}}}if(a){var v=new i;return v._independent=!0,v._fnBody=`return ${e};`,v._voidBody=e,v._dependencies=[],v}if(r==null)return this._getPendingExpressionSingleton();for(var b in n)if(n[b]==null)return i._getPendingExpressionSingleton();s.length==1&&/[^\w\.\$]+/.test(o.trim())!==!0&&(s[0].twowayAllowed=!0);var x=new i;return x._args=n,x._fnBody=`try{ var ___$$$r = ${o}; return ___$$$r; }catch(e){ }`,x._voidBody=`try{ ${o} }catch(e){ }`,x._dependencies=s,x}};var ht=class extends HTMLElement{};var ur="__pacem__",li=/^\{\{(.|\n)+\}\}$/,_=class i{static get polyfilling(){return customElements instanceof window.CustomElementRegistry}static camelToKebab(e){return e&&e.replace(/([A-Z])/g,"-$1").toLowerCase()}static kebabToCamel(e){return e&&e.replace(/(-[a-z])/g,t=>t[1].toUpperCase())}static waitForReady(e){return new Promise((t,r)=>{l.isNull(e)&&r("Not found."),e.isReady&&t();let n=()=>{e.removeEventListener("load",n),t()};e.addEventListener("load",n)})}static whenReady(e,t){i.waitForReady(e).then(t)}static getWatchedProperties(e,t=!0){var r=[],n=e instanceof HTMLElement?e.constructor:e;do{let o=(this.getAttachedPropertyValue(n,hr)||[]).filter(a=>!a.name.startsWith("_"));Array.prototype.splice.apply(r,[0,0].concat(o))}while(t&&(n=Object.getPrototypeOf(n)));return r}static getWatchedProperty(e,t){return this.getWatchedProperties(e,!0).find(r=>r.name===t)}static importjs(e,t=null,r=!1){var n={type:"text/javascript",src:e};return l.isNullOrEmpty(t)||l.extend(n,{integrity:t}),r&&l.extend(n,{crossorigin:""}),i.import(e,"script",n,document.head||document.getElementsByTagName("head")[0])}static importcss(e,t=null,r=!1){var n={rel:"stylesheet",href:e};return l.isNullOrEmpty(t)||l.extend(n,{integrity:t}),r&&l.extend(n,{crossorigin:"anonymous"}),i.import(e,"link",n,document.head||document.getElementsByTagName("head")[0])}static import(e,t,r,n=document.body){let s=l.core;var o=s.imports=s.imports||{};return o[e]=o[e]||new Promise((a,c)=>{var p=t;for(let h in r||{})p+=`[${h}="${r[h]}"]`;var f=document.querySelector(p);if(!l.isNull(f))a(f);else{f=document.createElement(t),f.onerror=h=>{c(h)},f.onload=()=>{a(f)};for(var m in r||{})f.setAttribute(m,r[m]);n.appendChild(f)}})}static{this.Theme={importWebFonts(){function e(s){return/^('|").*\1$/.test(s)?s.substring(1,s.length-1):s}function t(s){return l.isNullOrEmpty(s)?Promise.resolve():document.fonts.load("1rem "+s)}let r=["icons","std","main","tech","btn"].map(s=>{let o=l.Css.getVariableValue(`--${R}-font-${s}`).split(",")[0],a=e(l.Css.getVariableValue(`--${R}-font-${s}-api-url`));return l.isNullOrEmpty(a)?t(o):i.importcss(a).then(c=>t(o))}),n=new Promise(s=>{function o(a=0){a>4||!("size"in document.fonts)||typeof document.fonts.size=="number"&&document.fonts.size>0?document.fonts.ready.then(s):setTimeout(o,250,a++)}o()});return r.push(n),Promise.all(r)}}}static setAttachedPropertyValue(e,t,r){if(l.isNull(e))return;let n=Object.getOwnPropertyDescriptor(e,ur),s=n&&n.value||Object.defineProperty(e,ur,{value:{},enumerable:!1,writable:!1,configurable:!1})[ur];l.isNull(r)?delete s[t]:s[t]=r}static deleteAttachedPropertyValue(e,t){i.setAttachedPropertyValue(e,t,void 0)}static getAttachedPropertyValue(e,t,r){let n=Object.getOwnPropertyDescriptor(e,ur),s=n&&n.value;return l.isNull(s&&s[t])&&!l.isNull(r)?(i.setAttachedPropertyValue(e,t,r),r):s&&s[t]}static resolvePath(e,t){if(!e||!t)return;if(/[\(\)\{\}]/.test(e))throw`Security alert: not allowed to process paths like ${e}.`;let r=e.split(".");var n=t,s=n,o,a=r[0];r.forEach((f,m)=>{var h=f.split("[");h.forEach((v,b)=>{o=s,/\]$/.test(v)&&(v=v.substring(0,v.length-1),/^('|").+[^\\]\1$/.test(v)&&(v=v.substr(1,v.length-2))),s=l.isNull(s)?null:s[v]})});var c,p;return/\]$/.test(e)?(p=e.lastIndexOf("["),c=e.substring(p+1),c=c.substring(0,c.length-1)):(p=e.lastIndexOf("."),c=e.substring(p+1)),{target:{value:s,name:c},parent:{value:o||t,path:e.substring(0,p)},root:{value:n,property:a}}}static set(e,t,r){var n=i.resolvePath(t,e),s=n.target.value;if(s!==r)if(n.parent.value!=n.root.value&&!(n.parent.value instanceof HTMLElement)){n.parent.value[n.target.name]=r;let o=l.clone(n.root.value[n.root.property]);n.parent.value[n.target.name]=s;let a;n.root.property==="item"&&!l.isNull(a=ge.getRepeaterItem(n.root.value))?a.repeater&&a.repeater.datasource&&a.repeater.datasource.splice(a.index,1,a.item=o):n.root.value[n.root.property]=o}else n.parent.value[n.target.name]=r}static get(e,t){var r=i.resolvePath(t,e);return r&&r.target&&r.target.value}static _findScopeContextLegacy(e){let t=e,r;do t=t.parentNode;while(t!=null&&(t!=(r=e.ownerDocument)||t instanceof HTMLElement&&(r=t.shadowRoot)!=null));return r}static findScopeContext(e){return(e.isConnected?e.getRootNode():i.getAttachedPropertyValue(e,Pt))??i._findScopeContextLegacy(e)}static findAncestor(e,t){let r=e,n;for(;r&&(r=r.parentNode||r.getRootNode()?.host)!=null;)if(r.host instanceof HTMLElement&&(r=r.host),t.apply(r,[r])){n=r;break}return n}static findAncestorShell(e){return i.findAncestor(e,t=>l.is(t,`.${R}-body`)||t===document.body)}static findAncestorOfType(e,t){return i.findAncestor(e,r=>r instanceof t)}static findDescendants(e,t,r=!1){let n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(var s=[];n.nextNode();){let o=n.currentNode;if(t(o)===!0&&(s.push(o),r))return s}return s}static findFirstDescendant(e,t){let r=i.findDescendants(e,t,!0);return l.isNullOrEmpty(r)?void 0:r[0]}static findAll(e="[pacem]",t=r=>!0){let r=[];return document.querySelectorAll(e).forEach((n,s,o)=>{t(n)===!0&&r.push(n)}),r}static findPreviousSiblingOrAncestorOfType(e,t,r=0){let n=e,s=null,o=0;do if(n=n.previousSibling||n.parentNode,n instanceof t){if(o>=r){s=n;break}else n=n.parentNode;o++}while(n!=null);return s}static findPreviousSiblingOrAncestor(e,t,r=0){let n=e,s=null,o=0;do if(n=n.previousSibling||n.parentNode,n&&t.apply(n,[n])){if(o>=r){s=n;break}else n=n.parentNode;o++}while(n!=null);return s}static assignHostContext(e,t){let r=document.createTreeWalker(t.content,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_DOCUMENT_FRAGMENT);for(;r.nextNode();){var n=r.currentNode;l.isNull(i.getAttachedPropertyValue(n,Pe))&&i.setAttachedPropertyValue(n,Pe,e)}}static findHostContext(e){let t=e,r;if(!t.isConnected)return r;for(;t!=null&&(r=i.getAttachedPropertyValue(t,Pe),!(r instanceof HTMLElement));)t=t.parentElement;let n;return r==null&&console&&(n=console.warn)&&n(`Element "${e.constructor.name}" isn't a descendant of a templated component.`),r}static isBindingAttribute(e){return li.test(e)}static extractBindingAttributeExpression(e){if(i.isBindingAttribute(e))return e.substr(2,e.length-4);throw"Invalid attribute: incorrect binding syntax."}static parseBindingAttribute(e,t){let r=i.extractBindingAttributeExpression(e),n=/,\s*(twoway|once)\s*$/.exec(r),s=n&&n.length>1&&n[1];l.isNullOrEmpty(s)||(r=r.substr(0,r.lastIndexOf(",")));var o=Ne.parse(r,t);return(o&&o.dependencies).forEach(a=>{switch(s){case"twoway":a.mode=a.twowayAllowed&&o.dependencies.length==1?"twoway":void 0;break;case"once":a.mode=s;break}}),o}static ensureMember(e,t,r){let n=Object.getOwnPropertyDescriptor(e,t);return n??(Object.defineProperty(e,t,r),Object.getOwnPropertyDescriptor(e,t))}static stripObservedAttributes(e){Yn(e,!1)}static freezeObservedAttributes(e){Yn(e)}};function Yn(i,e=!0){let t=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT);do{var r=t.currentNode;if(r instanceof HTMLElement){let s=r.constructor.observedAttributes;if(!l.isNull(s)){_.deleteAttachedPropertyValue(r,dt);let o=function(a){return l.isArray(a)?"["+a.map(o).join(",")+"]":a instanceof Element?`#${a.id=a.id||"_"+l.uniqueCode()}`:`${l.Json.stringify(a)}`};for(var n of s)if(n in r.attributes){let a,c;if(e&&!l.isNull(c=r[a=_.kebabToCamel(n)])){let p=o(c);r.setAttribute(n,`{{ ${p} }}`)}else r.removeAttribute(n)}}}}while(t.nextNode())}var Qn=_.getAttachedPropertyValue,ci=_.setAttachedPropertyValue,Yr="pacem:repeater-item",Ae=class{static findItemContext(e,t=0,r=console.warn){let n=ge.findUpwards(e,t,r);return n==null&&r&&e instanceof HTMLElement&&e.isConnected&&r(`Couldn't find a ${ge.name} up ${t} level${t===1?"":"s"} from element "${e.constructor.name}".`),n}},ge=class i{static findUpwards(e,t=0,r=console.warn){if(l.isNull(e)||e.localName==="template"||e instanceof ht)return null;let n=null,s=a=>!l.isNull(n=i.getRepeaterItem(a));return _.findPreviousSiblingOrAncestor(e,s,t)==null&&r&&e instanceof HTMLElement&&e.isConnected&&r(`Couldn't find a ${i.name} up ${t} level${t===1?"":"s"} from element "${e.constructor.name}".`),n}static isRepeaterItem(e){return!l.isNull(Qn(e,Yr))}static getRepeaterItem(e){return Qn(e,Yr)}constructor(e){this._placeholder=e,ci(e,Yr,this)}get placeholder(){return this._placeholder}};var Zn;(function(i){i.AltKey="Alt",i.CtrlKey="Ctrl",i.ShiftKey="Shift",i.MetaKey="Cmd"})(Zn||(Zn={}));var j=class{static isInstanceOf(e,t){return e instanceof t}static getEventCoordinates(e){var t;return"touches"in e?l.isNullOrEmpty(e.touches)?l.isNullOrEmpty(e.changedTouches)||(t=e.changedTouches[0]):t=e.touches[0]:t=e,{page:{x:t.pageX,y:t.pageY},screen:{x:t.screenX,y:t.screenY},client:{x:t.clientX,y:t.clientY}}}static getEventKeyModifiers(e){var t=e.which;return e instanceof MouseEvent&&(t=e.button),{which:t,shiftKey:e.shiftKey,altKey:e.altKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey}}static matchModifiers(e,...t){let r=!l.isNull(t)&&(t.length===1&&l.isArray(t[0])?t[0]:Array.from(t).filter(p=>!l.isNullOrEmpty(p))),n=(r||[]).map(p=>p.toLowerCase()),s=n.indexOf("alt")>=0||n.indexOf("option")>=0,o=n.indexOf("shift")>=0,a=n.indexOf("ctrl")>=0,c=n.indexOf("win")>=0||n.indexOf("cmd")>=0;return!(s!==e.altKey||o!==e.shiftKey||c!==e.metaKey||a!==e.ctrlKey)}static fixEdgeCustomEventSubClassInstance(e,t){e instanceof t||Object.setPrototypeOf(e,t)}};var $=class extends CustomEvent{constructor(e,t,r){super(e,l.extend({detail:t},r||{})),j.fixEdgeCustomEventSubClassInstance(this,this.constructor)}};function pi(i){if("detail"in i){for(let e in i)if(e!=="bubbles"&&e!=="cancelable"&&e!=="composed"&&e!=="detail")return!1;return!0}return!1}var Oe=class extends CustomEvent{constructor(e,t,r,n){super(e,l.extend(pi(t||{})?t:{detail:t},!(r instanceof Event)&&r||{}));let s=n||r;s instanceof Event&&(this.#e=s,this.#t=j.getEventKeyModifiers(s),(s instanceof MouseEvent||s instanceof TouchEvent)&&(this.#r=j.getEventCoordinates(s))),j.fixEdgeCustomEventSubClassInstance(this,this.constructor)}#e;#t;#r;get originalEvent(){return this.#e}get which(){return this.#t?.which}get altKey(){return this.#t?.altKey}get shiftKey(){return this.#t?.shiftKey}get ctrlKey(){return this.#t?.ctrlKey}get metaKey(){return this.#t?.metaKey}get pageX(){return this.#r?.page.x}get pageY(){return this.#r?.page.y}get clientX(){return this.#r?.client.x}get clientY(){return this.#r?.client.y}get screenX(){return this.#r?.screen.x}get screenY(){return this.#r?.screen.y}},di="attributechange",fr=class extends ${constructor(e){super(di,e)}},Ie="propertychange",ne=class extends ${constructor(e){super(Ie,e)}},hi="navigating",ui="navigate",mr=class extends ${constructor(e){super(ui,typeof e=="string"?{path:e}:e,{cancelable:!1,bubbles:!1})}},vr=class extends ${constructor(e){super(hi,e,{cancelable:!0,bubbles:!1})}};var gr=class extends ${constructor(e){super("currentindexchange",e)}};var Nt="command",es=class extends ${constructor(e){super(Nt,e,{bubbles:!0,cancelable:!0})}};var yr=(i,e)=>l.areSemanticallyEqual(i,e);import{Point as fi,Size as mi,Rect as vi}from"@pacem/pacem-foundation";var gi={convert:i=>{}},yi={convert:i=>i,convertBack:i=>i},bi={convert:i=>i&&i.trim().split(/[ ,]+/),convertBack:i=>l.isArray(i)&&i.join(" ")||""},_i={convert:i=>parseFloat(i),convertBack:i=>i.toString()},Ei={convert:i=>!l.isNullOrEmpty(i)&&i!=="0"&&i!=="false",convertBack:i=>(!!i).toString()},wi={convert:i=>i==="true"||i==="1",convertBack:i=>(!!i).toString()},ts={convert:i=>l.parseDate(i),convertBack:i=>l.parseDate(i).toISOString()},xi=ts,Ci={convert:i=>l.Json.parse(i),convertBack:i=>l.Json.stringify(i)},Pi={convert:i=>Function(`return ${i};`).apply(null),convertBack:i=>{}},Ni={convert:i=>document.querySelector(i),convertBack:i=>i instanceof Element&&i.id?"#"+i.id:void 0,retryConversionWhenReady:!0},Ai={convert:i=>fi.parse(i),convertBack:i=>`${i.x||0} ${i.y||0}`},Oi={convert:i=>mi.parse(i),convertBack:i=>`${i.width||0} ${i.height||0}`},Ri={convert:i=>vi.parse(i),convertBack:i=>`${i.x||0} ${i.y||0} ${i.width||0} ${i.height||0}`},u={None:gi,String:yi,StringArray:bi,Number:_i,Boolean:Ei,BooleanStrict:wi,Date:xi,Datetime:ts,Json:Ci,Eval:Pi,Element:Ni,Point:Ai,Rect:Ri,Size:Oi};var X;(function(i){i.Get="GET",i.Post="POST",i.Put="PUT",i.Delete="DELETE",i.Options="OPTIONS",i.Head="HEAD",i.Patch="PATCH",i.Connect="CONNECT",i.Trace="TRACE"})(X||(X={}));var Qr="fetchresult",Zr="error",en="success",At=class{static isEmpty(e){return e.status===204||e.headers.get("Content-Length")==="0"}};var Ti=()=>{},Ot=class extends Error{constructor(e,t){super(t),this.statusCode=e}get status(){return this.statusCode}},br=class{constructor(e,t){e&&(this._status=e.status,this._body=e.response,this._text=e.responseText,this._type=e.responseType,this._allHeadersRaw=e.getAllResponseHeaders(),this._processTime=t)}get processTime(){return this._processTime}get headers(){return this._headers===void 0&&this._allHeadersRaw&&this._parseHeaders(),this._headers}get size(){return+this.headers["Content-Length"]}get mime(){return this.headers["Content-Type"]}get date(){return new Date(Date.parse(this.headers.Date))}_parseHeaders(){let e={};this._allHeadersRaw.split(`\r
7
7
  `).forEach(r=>{if(r&&r.length){let n=r.indexOf(":"),s=r.substr(0,n).trim(),o=r.substr(n+1).trim();e[s]=o}}),this._headers=e}get status(){return this._status}get text(){return this._text}get content(){return this._body}get type(){return this._type}get json(){if(this._type==="json")return this._body;try{return JSON.parse(this._text)}catch{return}}},Rt=class{constructor(){}request(e,t){var r=this;let n=K.defer();t=t||{method:X.Get};var s=t.method||X.Get,o=t.data||{},a=t.progress||Ti,c=t.headers||{};r.accessToken&&(c.Authorization="Bearer "+r.accessToken);var p=new XMLHttpRequest;p.withCredentials=!1,p.addEventListener("progress",v=>{if(v.lengthComputable){var b=v.loaded/v.total;typeof a=="function"&&a.apply(r,[b])}},!1),p.addEventListener("error",v=>{n.reject(new Ot(500,v.message||"Unknown error"))},!1);var f;p.addEventListener("load",()=>{if(p.status>=200&&p.status<300){var v=new br(p,Date.now()-f);n.resolve(v)}else n.reject(new Ot(p.status,p.statusText))},!1);var m;switch(s.toUpperCase()){case X.Get:e+=(/\?/.test(e)?"&":"?")+(typeof o=="string"?o:Object.keys(o).map(function(v){return encodeURIComponent(v)+"="+encodeURIComponent(o[v])}).join("&"));break;case X.Post:m=JSON.stringify(o)}switch(p.open(s,e,!0),s.toUpperCase()){case X.Get:p.setRequestHeader("X-Requested-With","XMLHttpRequest");break;case X.Post:p.setRequestHeader("X-Requested-With","XMLHttpRequest"),p.setRequestHeader("Content-Type","application/json");break}for(var h in c)p.setRequestHeader(h,c[h]);return f=Date.now(),p.send(m),n.promise}get(e,t,r){return this.request(e,{method:X.Get,data:t,headers:r||{}})}post(e,t,r){return this.request(e,{method:X.Post,data:t,headers:r||{}})}};var I=_.getAttachedPropertyValue,q=_.setAttachedPropertyValue,St=_.deleteAttachedPropertyValue,Si="pacem:property:",rs="pacem:version",Tt="pacem:binding:",is="pacem:view-children",tn="pacem:has-binding:",os="pacem:custom-element:has-template",ns="pacem:custom-element:has-templated",as="pacem:custom-element:promise",ft="pacem:custom-element:ready",ss="pacem:custom-element:startup";function ut(i,e,t){var r=i;let n=e,s=t;var o=I(r,Tt+n);if(o&&o.forEach(a=>{a.dep.element.removeEventListener(Ie,a.callback,!1)}),l.isNull(s)||I(i,ft)!==!0)St(r,Tt+n),St(r,tn+n);else if(s.pending)q(r,Tt+n,[]);else{let a="oneway";switch(s.dependencies&&s.dependencies.length&&s.dependencies[0].mode){case"twoway":s.dependencies.length==1&&(a="twoway");break;case"once":a="once"}q(r,tn+n,a);let c=s.dependencies.map(p=>{var f={dep:p,callback:function(m){m.detail.propertyName===p.property&&(r[n]=s.evaluate())}};return p.element.addEventListener(Ie,f.callback,!1),f});q(r,Tt+n,c),r[n]=s.evaluate()}}function Li(i){var e=K.defer();let t=r=>{l.isDOMReady()?e.resolve(r):l.onDOMReady(n=>{e.resolve(r)})};return i.template?t(i.template):i.templateUrl?new Rt().get(i.templateUrl).success(n=>{let s=i.template=n.text;return t(s),n}).error(n=>{console.error(n.message),t(null)}):t(null),e.promise}function ki(i,e){let t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(var r=[];t.nextNode();){var n=t.currentNode;if(I(n.constructor,os)===!0){var s=I(n,as,K.defer());r.push(s.promise)}}return r}var w=i=>e=>{if(l.customElements.get(i.tagName)){console.warn(`${i.tagName} registration skipped, since already defined.`);return}var t=_.getWatchedProperties(e,!0);if(q(e,os,!(l.isNullOrEmpty(i.template)&&l.isNullOrEmpty(i.templateUrl))),t&&t.length>0){let s="observedAttributes";var r=[];e.hasOwnProperty(s)&&(r=e[s].slice(),delete e[s]);let o=r;for(var n of t){let a=_.camelToKebab(n.name);o.unshift(a)}Object.defineProperty(e,s,{get:function(){return o},enumerable:!0,configurable:!1})}{let s=e.prototype,o=Object.getOwnPropertyDescriptor(s,"connectedCallback")||s.connectedCallback,a=Object.getOwnPropertyDescriptor(s,"viewActivatedCallback")||s.viewActivatedCallback;Object.defineProperty(s,"connectedCallback",{value:function(){let h=this;h.setAttribute("pacem",""),h.setAttribute("cloak",""),St(h,is),o&&o.value?o.value.apply(h,[]):typeof o=="function"&&o.apply(h),Li(i).then(v=>{if(!h.isConnected)return;var b=[];if(I(h,ft)!==!0&&!l.isNullOrEmpty(v)&&I(h,ns)!=!0){q(h,ns,!0);let O=h,k=i.shadow,L=document.createElement("template").content,S=document.createElement("template");if(!k)for(var x=O.childNodes.length-1;x>=0;x--)L.insertBefore(O.childNodes.item(x),L.firstChild);S.innerHTML=v;let H=S.content.querySelectorAll(E+"-content");if(_.assignHostContext(h,S),H.length==1){let Z=H.item(0);var g=Z.nextSibling;let xe=Z.parentElement||S.content,G=L.childNodes;for(xe.removeChild(Z);G.length>0;)try{let re=G.item(0);xe.insertBefore(re,g)}catch(re){console.error(re.toString())}}else if(H.length>1)throw"There can only be at most 1 content placeholder inside a template.";var y;if(i.shadow)y=O.attachShadow({mode:"open"}),y.appendChild(S.content);else{y=O;for(var C=S.content.children;C.length>0;)y.append(C.item(0))}b=ki(h,y)}q(h,ft,!0);for(let O of t){let k=O.name,L=O.config;if(!L.converter.retryConversionWhenReady||!l.isNull(h[k]))continue;let S=_.camelToKebab(k),H=h.getAttribute(S);!l.isNullOrEmpty(H)&&!_.isBindingAttribute(H)&&(h[k]=L.converter.convert(H,h))}(I(h,ss)||[]).forEach(O=>{O.apply(h)}),(O=>{var k=I(h,dt)||[];k.forEach(L=>{let S=L;if(!(S in h.attributes))throw`Howcome? ${S} not in ${h.constructor.name} attributes!?...`;let H=h.attributes[S].value;if(_.isBindingAttribute(H)){var Z=_.parseBindingAttribute(H,h);ut(h,_.kebabToCamel(L),Z)}})})();let D=O=>{a&&a.value?a.value.apply(h,[]):typeof a=="function"&&a.apply(h);var k=I(h,as);l.isNull(k)||k.resolve()};h.removeAttribute("cloak"),Promise.all(b).then(O=>D())})},configurable:!0,enumerable:!0});let c=Object.getOwnPropertyDescriptor(s,"disconnectedCallback")||s.disconnectedCallback;Object.defineProperty(s,"disconnectedCallback",{value:function(){let h=this;c&&c.value?c.value.apply(h,[]):typeof c=="function"&&c.apply(h,[]),q(h,ft,!1),(I(h,dt)||[]).forEach(b=>{ut(h,_.kebabToCamel(b))})},configurable:!0,enumerable:!0});let p=Object.getOwnPropertyDescriptor(s,"attributeChangedCallback")||s.attributeChangedCallback;Object.defineProperty(s,"attributeChangedCallback",{value:function(h,v,b){let x=this,g=I(x,ft)===!0;p&&p.value?p.value.apply(x,[h,v,b]):typeof p=="function"&&p.apply(x,[h,v,b]);let y=new fr({attributeName:h,oldValue:v,currentValue:b,firstChange:!g});x.dispatchEvent(y);let C=_.isBindingAttribute(b),P=h,N=_.kebabToCamel(P),D=!1;if(C){let k=_.parseBindingAttribute(b,x);if(k instanceof Ne){let L=()=>{x[N]=k.evaluate(),ut(x,N)},S=()=>{var H=I(x,dt,[]);H.push(P),k.pending||ut(x,N,k)};if(k.independent&&!D)try{L()}catch(H){console.warn(`Error occurred in early binding evaluation:
8
8
  ${b}
9
9
  ${H.message??H}`),S()}else S()}else throw`Howcome? ${b} misinterpreted as ${P} binding...`}else{var O=t.find(k=>k.name===N);l.isNull(O)||(ut(x,N),x[N]=O.config.converter.convert(b,x))}},configurable:!0,enumerable:!0});let f=Object.getOwnPropertyDescriptor(s,"propertyChangedCallback")||s.propertyChangedCallback;Object.defineProperty(s,"propertyChangedCallback",{value:function(h,v,b,x,g){let y=this,C=I(y,ft)===!0,P=()=>{let D=I(y,tn+h);if(f&&f.value?f.value.apply(y,[h,v,b,!C]):typeof f=="function"&&f.apply(y,[h,v,b,!C]),!g||g.emit!==!1){let H=new ne({propertyName:h,oldValue:v,currentValue:b,firstChange:!C});y.dispatchEvent(H)}if(l.isNullOrEmpty(D)){var O=t.find(H=>H.name===h);if(g&&g.reflectBack===!0&&!_.polyfilling){var k=_.camelToKebab(h),L=y.attributes.getNamedItem(k);if(C||l.isNullOrEmpty(L)){var S;if(b==null)y.removeAttribute(k);else if(O&&(S=O.config)&&typeof S.converter.convertBack=="function"){let H=S.converter.convertBack(b,y);(L==null||H!==L.value)&&y.setAttribute(k,H)}}}}else if(D==="twoway"){let H=I(y,Tt+h)[0].dep;_.set(H.element,H.path,b)}else D==="once"&&ut(y,h)};if(C)P.apply(y);else{var N=I(y,ss,[]);N.push(P)}},configurable:!0,enumerable:!0})}l.customElements.define(i.tagName,e,i.options),l.customElements.whenDefined(i.tagName).then(()=>{})},Di=u.None;function d(i){return(e,t,r)=>{var n=I(e.constructor,hr,[]);n.push({name:t,config:l.extend({emit:!0,converter:Di},i)});let s=yr,o=r&&r.set,a=Si+t,c=rs,p=rs+":"+t;function f(){return I(this,a)}function m(b,x,g){let y=this,C=i&&i.debounce,P;if(typeof(P=y.propertyChangedCallback)=="function"){let N=()=>P.apply(y,[b,x,I(y,a),!1,i]);typeof C=="number"&&C>0?(clearTimeout(this["_handle_"+t]),this["_handle_"+t]=setTimeout(N,C)):C===!0?(cancelAnimationFrame(this["_handle_"+t]),this["_handle_"+t]=requestAnimationFrame(N)):N()}}function h(b){let x=this;if(b=b||x[t],I(b,"pacem:array:decorated")===!0)return;q(b,"pacem:array:decorated",!0);let g=Array.prototype,y={splice:g.splice,pop:g.pop,copyWithin:g.copyWithin,push:g.push,shift:g.shift,unshift:g.unshift};for(let C in y){let P=C;b[P]=function(...N){let D=y[P].apply(this,N);return q(this,c,Date.now()),m.call(x,t,this,this),D}}}function v(b,x){let g=this,y=l.isArray(x);(!s(b,x)||y&&I(x,c)!==I(g,p))&&(q(g,a,x),y&&(q(g,p,I(x,c)),h.call(g,x)),m.call(g,t,b,x))}if(o)r.set=function(b){let x=this,g=x[t];o.call(x,b);let y=x[t];v.call(x,g,y)};else{try{e.ownerDocument&&(e[a]=e[t])}catch{}delete e[t]&&Object.defineProperty(e,t,{get:function(){return f.call(this)},set:function(b){let x=this,g=I(x,a);v.call(x,g,b)},enumerable:!0,configurable:!0})}}}function ls(i){return(e,t,r)=>{let n=`${t}_${l.uniqueCode()}`;function s(){let a=this,c=(a.shadowRoot||a).querySelectorAll(i);for(let p=0;p<c.length;p++){let f=c.item(p);if(I(f,Pe)===a)return f}return null}function o(){let a=this,c=I(a,is,{});return c[n]=c[n]||s.call(a)}delete e[t]&&Object.defineProperty(e,t,{get:function(){return o.call(this)},enumerable:!0,configurable:!0})}}function ha(){function i(e){return e&&typeof e.then=="function"}return function(e,t,r){let n=r.value,s=`pacem:concurrent-buffer:${t}`,o=`pacem:concurrent-running:${t}`;r.value=function(...a){var c=this,p=_.getAttachedPropertyValue(c,s,[]),f=_.getAttachedPropertyValue(c,o,!1);if(f){let h=K.defer();return a.push(h),p.push(a),h.promise}var m=n.apply(c,a);if(i(m)){let h=a&&a.length>0&&a[a.length-1];return h&&h.promise instanceof K?a.pop():h=K.defer(),_.setAttachedPropertyValue(c,o,!0),m.then(v=>{h.resolve(v),_.setAttachedPropertyValue(c,o,!1),p.length>0&&n.apply(c,p.shift())},v=>{_.setAttachedPropertyValue(c,o,!1),h.reject(v)}),h.promise}else return m}}}function _r(i=50,e=(t,...r)=>`pacem:debouncer:${t}`){return function(t,r,n){let s=n.value;i===!0?n.value=function(...o){let a=e(r,...o);var c=this;cancelAnimationFrame(I(c,a)),q(c,a,requestAnimationFrame(()=>{s.apply(c,o)}))}:i>0&&(n.value=function(...o){let a=e(r,...o);var c=this;clearTimeout(I(c,a,0)),q(c,a,setTimeout(()=>{s.apply(c,o)},i))})}}function ua(i=50,e=(t,...r)=>`pacem:throttler:${t}`){return function(t,r,n){let s=n.value;n.value=function(...o){let a=e(r,...o),c=`${a}:args`,p=this,f=()=>{St(p,a);let m=I(p,c);St(p,c),m&&s.apply(p,o)};if(!l.isNull(I(p,a))){q(p,c,o??["pacem"]);return}q(p,a,1),s.apply(p,o),i===!0?requestAnimationFrame(f):i>0&&setTimeout(f,i)}}}var rn=class{static register(e,t){let r=l.core,n=(e||t.name).split(".");for(let o of n.slice(0,-1))r=r[o]||(r[o]={});let s=n[n.length-1]||t.name;l.isNull(r[s])?r[s]=t:console.warn(`A transform named ${s} already exists in this set.`)}};function U(i){return function(e,t,r){let n=r.value;rn.register(i,n)}}var ma={USE_SHADOW_ROOT:!1};var T;(function(i){i.Trace="trace",i.Debug="debug",i.Warn="warn",i.Error="error",i.Info="info",i.Log="log"})(T||(T={}));var cs=function(i,e,t,r){var n=arguments.length,s=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},A=class extends HTMLElement{constructor(){super(),this._isReady=!1,this.emitHandler=e=>{this.disabled||this.emit(e)}}emit(e){e.defaultPrevented||this._emitCore(e)}_emitCore(e){var t=`on-${e.type.toLowerCase()}`;if(t in this.attributes){this.log(T.Debug,`Calling ${t} handler for event ${e.type}`);var r=this.attributes[t].value,n=Ne.parse(r,this);!l.isNull(n)&&n.pending!==!0&&n.evaluatePlus({$event:e})}}handle(e,t){typeof e=="string"&&(e=l.isNull(t)?new Event(e,{cancelable:!1}):new CustomEvent(e,{cancelable:!1,detail:t})),this.emit(e)}get isReady(){return this._isReady}connectedCallback(){_.setAttachedPropertyValue(this,Pt,_.findScopeContext(this)),this.log(T.Debug,"Connected.")}disconnectedCallback(){this._isReady=!1,this.dispatchEvent(new Event("unload")),_.deleteAttachedPropertyValue(this,Pt),this.log(T.Debug,"Disconnected.")}viewActivatedCallback(){this._isReady=!0,this.log(T.Debug,"Loaded (view activated)."),this.dispatchEvent(new Event("load"))}propertyChangedCallback(e,t,r,n){n?this.log(T.Log,`Property "${e}" changed at start-up`):this.log(T.Log,`Property "${e}" changed from ${t} to ${r}`)}dispatchEvent(e){if(this.disabled)return!1;this.log(T.Log,`Dispatching event "${e.type}"`);let t=super.dispatchEvent(e);return this.emit(e),t}log(e,t,r=this.localName+(this.id?"#"+this.id:"")){this.logger&&typeof this.logger.log=="function"&&this.logger.log(e,t,r)}refreshBindings(){for(let e=0;e<this.attributes.length;e++){let t=this.attributes.item(e);if(!_.isBindingAttribute(t.value))continue;let n=_.kebabToCamel(t.name),s=_.parseBindingAttribute(t.value,this);this[n]=s.evaluate()}}};cs([d({reflectBack:!0,converter:u.Boolean})],A.prototype,"disabled",void 0);cs([d({emit:!1,converter:u.Element})],A.prototype,"logger",void 0);var Na=/a^/,ps=class{static split(e,t){for(var r,n=0,s=[];(r=t.exec(e))!=null;){s.push({value:e.substr(n,r.index-n),match:!1,index:n});let o=r[0].length;s.push({value:e.substr(r.index,o),match:!0,index:r.index}),n=r.index+o}return n<e.length&&s.push({value:e.substr(n,e.length-n),match:!1,index:n}),s}};var nn="_exp",Er=class{_getStorage(e){return e?window.localStorage:window.sessionStorage}_parseValue(e,t){let r=e.getItem(t);if(l.isNullOrEmpty(r))return null;let n=l.Json.parse(r);return Object.hasOwnProperty(nn)?n[nn]<Date.now()?(e.removeItem(t),null):n.value:n}setPropertyValue(e,t,r){var n=this._getStorage(r===!0||typeof r=="number"&&r>0),s=t;if(typeof r=="number"&&r>0){let o=Date.now()+1e3*r;s={value:t},s[nn]=o}n.setItem(e,l.Json.stringify(s)),n=this._getStorage(!r),n.removeItem(e)}getPropertyValue(e){return this._parseValue(this._getStorage(!1),e)||this._parseValue(this._getStorage(!0),e)}clear(){var e=this._getStorage(!0);e.clear(),e=this._getStorage(!1),e.clear()}removeProperty(e){var t=this._getStorage(!0);t.removeItem(e),t=this._getStorage(!1),t.removeItem(e)}};var F=function(i,e,t,r){var n=arguments.length,s=n<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(i,e,t,r);else for(var a=i.length-1;a>=0;a--)(o=i[a])&&(s=(n<3?o(s):n>3?o(e,t,s):o(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s};function Hi(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ii(i,e,t,r){let n="char",s="full",o,a;return["line","word","char"].includes(i)?(n=i,s=e,o=t,a=r):(s=i,o=e,a=t),{mode:n,output:s,cssAdd:o??"fill-green-container",cssRemove:a??"fill-red-container"}}var B=class{static highlight(e,t,r=R+"-highlight"){if(!t||!e)return e;let n=e.substring(0),s=t.substring(0).split(" ");for(var o=0;o<s.length;o++){let a=Hi(s[o]),c=new RegExp("(?![^<>]*>)"+a,"gi");n=n.replace(c,function(p,f,m){var h,v;return(h=m.indexOf("<",f))!=(v=m.indexOf("</",f))||h==-1?'<span class="'+r+'">'+p+"</span>":p})}return n}static diff(e,t,r="full",n,s,o){let{mode:a,output:c,cssAdd:p,cssRemove:f}=Ii(r,n,s,o);return l.diff(e,t,a).reduce((h,v)=>{let b=v.type;if(b==="=")h+=v.value;else if(b==="+"&&c!=="left"||b==="-"&&c!=="right"){let x=v.value.split(/\r?\n/),g=x.length-1;for(let y=0;y<=g;y++){let C=x[y];(!l.isNullOrEmpty(C)||y<g)&&(h+=`<span class="${R}-token ${b==="-"?f:p} text-prewrap">${C||" "}</span>`),y<g&&(h+=`
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @pacem/pacem-core v1.0.5-bartels (https://js.pacem.it)
2
+ * @pacem/pacem-core v1.0.5-doppler (https://js.pacem.it)
3
3
  * Pacem (https://pacem.it)
4
4
  * Licensed under Apache-2.0
5
5
  */
@@ -1768,7 +1768,7 @@ var CustomElementUtils = class _CustomElementUtils {
1768
1768
  t2 = t2.substr(1, t2.length - 2);
1769
1769
  }
1770
1770
  }
1771
- ref = ref[t2];
1771
+ ref = Utils.isNull(ref) ? null : ref[t2];
1772
1772
  });
1773
1773
  });
1774
1774
  var name, ndx;