spyne 0.20.0 → 0.20.2
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.
- package/.eslintignore +2 -0
- package/.husky/pre-commit +1 -0
- package/.travis.yml +6 -6
- package/README.md +3 -1
- package/karma.conf.js +3 -6
- package/lib/spyne.esm.js +4 -4
- package/lib/spyne.esm.js.map +1 -1
- package/lib/spyne.js +248 -248
- package/lib/spyne.umd.js +3 -9565
- package/lib/spyne.umd.js.LICENSE.txt +16 -0
- package/package.json +8 -5
- package/src/spyne/spyne-app.js +3 -2
- package/src/spyne/spyne-plugins.js +45 -6
- package/src/spyne/utils/spyne-app-properties.js +11 -0
- package/src/tests/package-json.spec.test.js +3 -0
package/lib/spyne.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{compose as e,not as t,is as n,allPass as r,keys as o,prop as i,path as s,fromPairs as a,toPairs as c,clone as l,mergeAll as
|
|
1
|
+
import{compose as e,not as t,is as n,allPass as r,keys as o,prop as i,path as s,fromPairs as a,toPairs as c,clone as l,mergeAll as u,includes as d,pickAll as h,lte as E,defaultTo as p,match as N,head as _,filter as m,test as f,__ as T,concat as A,without as C,uniq as g,complement as y,isEmpty as b,values as S,isNil as v,ifElse as I,reject as L,mapObjIndexed as O,pipe as D,pick as R,forEachObjIndexed as H,flip as w,mergeRight as V,propSatisfies as P,forEach as U,props as M,omit as W,find as x,always as F,flatten as $,map as k,any as G,equals as j,curry as z,where as Y,split as B,all as K,slice as q,toLower as X,either as Q,findIndex as J,apply as Z,propEq as ee,identity as te,chain as ne,objOf as re,view as oe,lensIndex as ie,assoc as se,when as ae,join as ce,replace as le,findLastIndex as ue,last as de,invert as he,reduce as Ee,zipObj as pe,has as Ne,mergeDeepRight as _e,lensProp as me,over as fe,reverse as Te,curryN as Ae,toUpper as Ce,partialRight as ge,pluck as ye,pathEq as be,propIs as Se,pathSatisfies as ve}from"ramda";import{Observable as Ie,Subject as Le,bindCallback as Oe,fromEvent as De,of as Re,ReplaySubject as He,fromEventPattern as we,merge as Ve,from as Pe}from"rxjs";const Ue=Object.create({}),Me=e(t,n(Array)),We=e(r([Me,n(Object)]));function xe(e){return e&&"object"==typeof e&&"[object RegExp]"!==Object.prototype.toString.call(e)&&"[object Date]"!==Object.prototype.toString.call(e)}function Fe(e,t){return t&&!0===t.clone&&xe(e)?ke((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function $e(e,t,n){const r=e.slice();return t.forEach((function(t,o){void 0===r[o]?r[o]=Fe(t,n):xe(t)?r[o]=ke(e[o],t,n):-1===e.indexOf(t)&&r.push(Fe(t,n))})),r}function ke(e,t,n){const r=Array.isArray(t),o=(n||{arrayMerge:$e}).arrayMerge||$e;return r?Array.isArray(e)?o(e,t,n):Fe(t,n):function(e,t,n){const r={};return xe(e)&&Object.keys(e).forEach((function(t){r[t]=Fe(e[t],n)})),Object.keys(t).forEach((function(o){xe(t[o])&&e[o]?r[o]=ke(e[o],t[o],n):r[o]=Fe(t[o],n)})),r}(e,t,n)}let Ge,je,ze,Ye;ke.all=function(e,t){if(!Array.isArray(e)||e.length<2)throw new Error("first argument should be an array with at least two elements");return e.reduce((function(e,n){return ke(e,n,t)}))};let Be,Ke=!0;const qe=[],Xe=new Map,Qe=new class{constructor(){Ue.foo=()=>console.log("used for testing purposes.")}addMethod(e,t,n=!1){if(!0===Object.prototype.hasOwnProperty.call(Ue,e)){const t=`Spyne Warning: the method name, ${e}, already exists.`;if(n)return t;console.warn(t)}else Ue[e]=t}addMethods(e={},t=!1){let n;if(!1===We(e))return n=`Spyne Warning: the pluginMethods property, ${JSON.stringify(e)} needs to be an object.`,t?n:void console.warn(n);return o(e).map((r=>{const o=i(r,e);if("function"==typeof o)this.addMethod(r,o,t);else{if(n=`the value for ${r} is not a valid function.`,t)return n;console.warn(n)}})).join(",")}checkIfMethodExists(e){}get pluginMethodsObj(){return Ue}};const Je=new class{constructor(){Ye=!1}get channelsMap(){return ze}get initialized(){return Ye}get config(){return Ge}get debug(){return Ke}static listChannels(){return Array.from(je.map.keys())}initialize(e={},t={},n,r){return je=n,Ge=ke(e,t),Ge.channels&&Ge.channels.ROUTE&&(Ge=r.conformRouteObject(Ge)),Be=Ge?.IMG_PATH,Ke=void 0!==Ge.debug?Ge.debug:Ke,this.getChannelActions=je.getChannelActions.bind(je),this.listRegisteredChannels=je.listRegisteredChannels.bind(je),Ye=!0,this.setChannelsMap(),t?.baseHref&&this.setHeadBaseHref(t.baseHref),Ge}setHeadBaseHref(e){const t=document.createElement("base");t.href=e,document.head.appendChild(t)}conformRouteConfig(e=!1){Ge=SpyneUtilsChannelRoute.conformRouteObject(Ge,e)}setChannelsMap(){const e=je.getStream.bind(je),t=je.testStream.bind(je),n=je.getProxySubject.bind(je);ze={getStream:e,testStream:t,getProxySubject:n}}setProp(e,t){Ge.tmp[e]=t}getProp(e){return s(["tmp",e],Ge)}setChannelConfig(e,t){return Ge.channels[e]=t,Ge.channels[e]}getChannelConfig(e,t=Ge){if("CHANNEL_ROUTE"===e?e="ROUTE":"CHANNEL_WINDOW"===e&&(e="WINDOW"),void 0===t||void 0===Ge.channels)return void console.warn("Spyne warning: Spyne config object is empty!");const n=Ge.channels[e];if(void 0!==n)return n;console.warn(`Spyne warning: Spyne configuration for channel, ${e} is empty!`)}registerChannel(){}addPluginConfig(e,t={}){void 0===Ge.plugins&&(Ge.plugins={}),this.addPluginMethods(t.pluginMethods),Ge.plugins[e]=t}getPluginsMethodObj(e){return e&&this.addPluginMethods(e),Qe.pluginMethodsObj}addPluginMethods(e){e&&Qe.addMethods(e)}doNotTrackChannel(e){qe.push(e)}getUntrackedChannelsList(){return qe}registerProxyReviver(e,t){Xe.set(e,t)}getProxyReviver(e){return Xe.get(e)}getPluginConfigByPluginName(e){return Ge.plugins[e]}get IMG_PATH(){return Be}tempGetChannelsInstance(){}tempGetConfig(){}},Ze=()=>({includes:()=>!0===Je.initialized?Je.listRegisteredChannels():["CHANNEL_ROUTE","CHANNEL_UI","CHANNEL_WINDOW","DISPATCHER"]});void 0!==e&&void 0!==Ie&&(e(n(String),s(["data","srcElement","vsid"])),e(n(String),s(["data","srcElement","id"])));const et=(e,t)=>{const{__proxy__proxyName:n}=e;void 0===n&&console.error("object is not proxy object ",e);const r=(n,r)=>{const o=s(r,e),{__proxy__isProxy:i,__proxy__props:a}=o;return i?t(n,a):n},o=r(l(e),[]),i=(e,t)=>{const n=t||[];Object.entries(e).forEach((([t,o])=>{const s=(e=>{let t=typeof e;return["number","boolean","string"].includes(t)?t="primitive":"object"===t&&(Array.isArray(e)?t="array":null===e&&(t="undefined")),t})(o),a=[...n];a.push(t),"object"!==s&&"array"!==s||(e[t]=r(o,a),i(o,a))}))};return i(o),o},tt=function(t){const{__proxy__proxyName:r}=t;if(void 0!==r){const e=Je.getProxyReviver(r);if("function"==typeof e)return et(t,e)}const o=n(Array),i=n(Object);var s;return!1===o(s=t)&&!0===i(s)?e(a,c,l)(t):l(t)};class nt{constructor(e,t,n,r,o,i){const s=e;i&&console.time(i);const a={channelName:e,action:t,srcElement:r,event:o},c=nt.deepFreeze(n);if(a.payload=c,!0===Je.debug){if(Object.prototype.hasOwnProperty.call(n,"payload")){const e=JSON.stringify(n);console.warn(`Spyne Warning: the following payload contains a nested payload property which may create conflicts: Action: ${t}, ${e}`)}const e=Je.getChannelActions(s);nt.validateAction(t,s,e)}a.clone=()=>u([{payload:tt(a.payload)},a.payload,{channel:l(s)},{event:l(o)},{srcElement:r},l(a.srcElement),{action:l(a.action)}]);const d={$dir:{get:()=>a._dir,set:e=>(a._dir=e,e)}};return"CHANNEL_ROUTE"===s&&(d.location={get:()=>nt.getLocationData()}),a._dir=void 0,Object.defineProperties(a,d),i&&console.timeEnd(i),a}static validateAction(e,t,n){const r=d(e,n);return!1===r&&!0===Je.initialized&&console.warn(`warning: Action: '${e}' is not registered within the ${t} channel!`),r}static getLocationData(){return h(["href","origin","protocol","host","hostname","port","pathname","search","hash"],window.location)}static getStreamItem(){}static deepClone(t){const r=n(Array),o=n(Object);var i;return!1===r(i=t)&&!0===o(i)?e(a,c,l)(t):l(t)}static deepFreeze(t){const n=e(E(0),p(-1),i("nodeType"));try{Object.freeze(t),Object.getOwnPropertyNames(t).forEach((function(e){!Object.prototype.hasOwnProperty.call(t,e)||!1!==n(t[e])||null===t[e]||"object"!=typeof t[e]&&"function"!=typeof t[e]||Object.isFrozen(t[e])||nt.deepFreeze(t[e])}))}catch(e){return t}return t}static getMouseEventKeys(){return["altKey","bubbles","cancelBubble","cancelable","clientX","clientY","composed","ctrlKey","currentTarget","defaultPrevented","detail","eventPhase","fromElement","isTrusted","layerX","layerY","metaKey","movementX","movementY","offsetX","offsetY","pageX","pageY","path","relatedTarget","returnValue","screenX","screenY","shiftKey","sourceCapabilities","srcElement","target","timeStamp","toElement","type","view","which","x","y"]}}function rt(){return{createpropsMap:function(){const e=new WeakMap,t={vsid:this.props.vsid};return e.set(t,this.props),{key:t,weakMap:e}},gc:function(){for(const e in this)delete this[e]},createId:function(){return Math.random().toString(36).replace(/\d/gm,"").substring(1,8)},setTraceFunc:function(e){return!0===e?console.log:()=>{}}}}const ot=async(e,t)=>{window.setTimeout((async()=>{var t;await(t=1,new Promise((e=>setTimeout(e,t)))),window.requestAnimationFrame(e)}),t)},it=e=>{if(void 0!==e.constructor.name)return e.constructor.name;const t=e.toString();return p(String(t).substr(0,12),N(/^(function\s)(\w+)(\(.*)$/,t)[2])},st=t=>{const n=e(y(b),_,S),o=e(y(v),_,S);return r([n,o])(t)};
|
|
2
2
|
/*! @license DOMPurify 3.2.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.3/LICENSE */
|
|
3
|
-
const{entries:at,setPrototypeOf:ct,isFrozen:lt,getPrototypeOf:dt,getOwnPropertyDescriptor:ut}=Object;let{freeze:ht,seal:Et,create:pt}=Object,{apply:Nt,construct:mt}="undefined"!=typeof Reflect&&Reflect;ht||(ht=function(e){return e}),Et||(Et=function(e){return e}),Nt||(Nt=function(e,t,n){return e.apply(t,n)}),mt||(mt=function(e,t){return new e(...t)});const _t=Dt(Array.prototype.forEach),ft=Dt(Array.prototype.pop),Tt=Dt(Array.prototype.push),At=Dt(String.prototype.toLowerCase),Ct=Dt(String.prototype.toString),gt=Dt(String.prototype.match),yt=Dt(String.prototype.replace),bt=Dt(String.prototype.indexOf),St=Dt(String.prototype.trim),vt=Dt(Object.prototype.hasOwnProperty),It=Dt(RegExp.prototype.test),Lt=(Ot=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return mt(Ot,t)});var Ot;function Dt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Nt(e,t,r)}}function Rt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:At;ct&&ct(e,null);let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){const e=n(o);e!==o&&(lt(t)||(t[r]=e),o=e)}e[o]=!0}return e}function Ht(e){for(let t=0;t<e.length;t++){vt(e,t)||(e[t]=null)}return e}function wt(e){const t=pt(null);for(const[n,r]of at(e)){vt(e,n)&&(Array.isArray(r)?t[n]=Ht(r):r&&"object"==typeof r&&r.constructor===Object?t[n]=wt(r):t[n]=r)}return t}function Vt(e,t){for(;null!==e;){const n=ut(e,t);if(n){if(n.get)return Dt(n.get);if("function"==typeof n.value)return Dt(n.value)}e=dt(e)}return function(){return null}}const Pt=ht(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ut=ht(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Mt=ht(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),xt=ht(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Wt=ht(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ft=ht(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),$t=ht(["#text"]),kt=ht(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Gt=ht(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),jt=ht(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),zt=ht(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Yt=Et(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Bt=Et(/<%[\w\W]*|[\w\W]*%>/gm),Kt=Et(/\$\{[\w\W]*}/gm),qt=Et(/^data-[\-\w.\u00B7-\uFFFF]+$/),Xt=Et(/^aria-[\-\w]+$/),Qt=Et(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Jt=Et(/^(?:\w+script|data):/i),Zt=Et(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),en=Et(/^html$/i),tn=Et(/^[a-z][.\w]*(-[.\w]+)+$/i);var nn=Object.freeze({__proto__:null,ARIA_ATTR:Xt,ATTR_WHITESPACE:Zt,CUSTOM_ELEMENT:tn,DATA_ATTR:qt,DOCTYPE_NAME:en,ERB_EXPR:Bt,IS_ALLOWED_URI:Qt,IS_SCRIPT_OR_DATA:Jt,MUSTACHE_EXPR:Yt,TMPLIT_EXPR:Kt});const rn=1,on=3,sn=7,an=8,cn=9,ln=function(){return"undefined"==typeof window?null:window};var dn=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ln();const n=t=>e(t);if(n.version="3.2.3",n.removed=[],!t||!t.document||t.document.nodeType!==cn)return n.isSupported=!1,n;let{document:r}=t;const o=r,i=o.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:c,Element:l,NodeFilter:d,NamedNodeMap:u=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:E,trustedTypes:p}=t,N=l.prototype,m=Vt(N,"cloneNode"),_=Vt(N,"remove"),f=Vt(N,"nextSibling"),T=Vt(N,"childNodes"),A=Vt(N,"parentNode");if("function"==typeof a){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let C,g="";const{implementation:y,createNodeIterator:b,createDocumentFragment:S,getElementsByTagName:v}=r,{importNode:I}=o;let L={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof at&&"function"==typeof A&&y&&void 0!==y.createHTMLDocument;const{MUSTACHE_EXPR:O,ERB_EXPR:D,TMPLIT_EXPR:R,DATA_ATTR:H,ARIA_ATTR:w,IS_SCRIPT_OR_DATA:V,ATTR_WHITESPACE:P,CUSTOM_ELEMENT:U}=nn;let{IS_ALLOWED_URI:M}=nn,x=null;const W=Rt({},[...Pt,...Ut,...Mt,...Wt,...$t]);let F=null;const $=Rt({},[...kt,...Gt,...jt,...zt]);let k=Object.seal(pt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),G=null,j=null,z=!0,Y=!0,B=!1,K=!0,q=!1,X=!0,Q=!1,J=!1,Z=!1,ee=!1,te=!1,ne=!1,re=!0,oe=!1,ie=!0,se=!1,ae={},ce=null;const le=Rt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let de=null;const ue=Rt({},["audio","video","img","source","image","track"]);let he=null;const Ee=Rt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pe="http://www.w3.org/1998/Math/MathML",Ne="http://www.w3.org/2000/svg",me="http://www.w3.org/1999/xhtml";let _e=me,fe=!1,Te=null;const Ae=Rt({},[pe,Ne,me],Ct);let Ce=Rt({},["mi","mo","mn","ms","mtext"]),ge=Rt({},["annotation-xml"]);const ye=Rt({},["title","style","font","a","script"]);let be=null;const Se=["application/xhtml+xml","text/html"];let ve=null,Ie=null;const Le=r.createElement("form"),Oe=function(e){return e instanceof RegExp||e instanceof Function},De=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Ie||Ie!==e){if(e&&"object"==typeof e||(e={}),e=wt(e),be=-1===Se.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,ve="application/xhtml+xml"===be?Ct:At,x=vt(e,"ALLOWED_TAGS")?Rt({},e.ALLOWED_TAGS,ve):W,F=vt(e,"ALLOWED_ATTR")?Rt({},e.ALLOWED_ATTR,ve):$,Te=vt(e,"ALLOWED_NAMESPACES")?Rt({},e.ALLOWED_NAMESPACES,Ct):Ae,he=vt(e,"ADD_URI_SAFE_ATTR")?Rt(wt(Ee),e.ADD_URI_SAFE_ATTR,ve):Ee,de=vt(e,"ADD_DATA_URI_TAGS")?Rt(wt(ue),e.ADD_DATA_URI_TAGS,ve):ue,ce=vt(e,"FORBID_CONTENTS")?Rt({},e.FORBID_CONTENTS,ve):le,G=vt(e,"FORBID_TAGS")?Rt({},e.FORBID_TAGS,ve):{},j=vt(e,"FORBID_ATTR")?Rt({},e.FORBID_ATTR,ve):{},ae=!!vt(e,"USE_PROFILES")&&e.USE_PROFILES,z=!1!==e.ALLOW_ARIA_ATTR,Y=!1!==e.ALLOW_DATA_ATTR,B=e.ALLOW_UNKNOWN_PROTOCOLS||!1,K=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,q=e.SAFE_FOR_TEMPLATES||!1,X=!1!==e.SAFE_FOR_XML,Q=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,ne=e.RETURN_TRUSTED_TYPE||!1,Z=e.FORCE_BODY||!1,re=!1!==e.SANITIZE_DOM,oe=e.SANITIZE_NAMED_PROPS||!1,ie=!1!==e.KEEP_CONTENT,se=e.IN_PLACE||!1,M=e.ALLOWED_URI_REGEXP||Qt,_e=e.NAMESPACE||me,Ce=e.MATHML_TEXT_INTEGRATION_POINTS||Ce,ge=e.HTML_INTEGRATION_POINTS||ge,k=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Oe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(k.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Oe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(k.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(k.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),q&&(Y=!1),te&&(ee=!0),ae&&(x=Rt({},$t),F=[],!0===ae.html&&(Rt(x,Pt),Rt(F,kt)),!0===ae.svg&&(Rt(x,Ut),Rt(F,Gt),Rt(F,zt)),!0===ae.svgFilters&&(Rt(x,Mt),Rt(F,Gt),Rt(F,zt)),!0===ae.mathMl&&(Rt(x,Wt),Rt(F,jt),Rt(F,zt))),e.ADD_TAGS&&(x===W&&(x=wt(x)),Rt(x,e.ADD_TAGS,ve)),e.ADD_ATTR&&(F===$&&(F=wt(F)),Rt(F,e.ADD_ATTR,ve)),e.ADD_URI_SAFE_ATTR&&Rt(he,e.ADD_URI_SAFE_ATTR,ve),e.FORBID_CONTENTS&&(ce===le&&(ce=wt(ce)),Rt(ce,e.FORBID_CONTENTS,ve)),ie&&(x["#text"]=!0),Q&&Rt(x,["html","head","body"]),x.table&&(Rt(x,["tbody"]),delete G.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Lt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Lt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=e.TRUSTED_TYPES_POLICY,g=C.createHTML("")}else void 0===C&&(C=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(p,i)),null!==C&&"string"==typeof g&&(g=C.createHTML(""));ht&&ht(e),Ie=e}},Re=Rt({},[...Ut,...Mt,...xt]),He=Rt({},[...Wt,...Ft]),we=function(e){Tt(n.removed,{element:e});try{A(e).removeChild(e)}catch(t){_(e)}},Ve=function(e,t){try{Tt(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Tt(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ee||te)try{we(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Pe=function(e){let t=null,n=null;if(Z)e="<remove></remove>"+e;else{const t=gt(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===be&&_e===me&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=C?C.createHTML(e):e;if(_e===me)try{t=(new E).parseFromString(o,be)}catch(e){}if(!t||!t.documentElement){t=y.createDocument(_e,"template",null);try{t.documentElement.innerHTML=fe?g:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),_e===me?v.call(t,Q?"html":"body")[0]:Q?t.documentElement:i},Ue=function(e){return b.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Me=function(e){return e instanceof h&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof u)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},xe=function(e){return"function"==typeof c&&e instanceof c};function We(e,t,r){_t(e,(e=>{e.call(n,t,r,Ie)}))}const Fe=function(e){let t=null;if(We(L.beforeSanitizeElements,e,null),Me(e))return we(e),!0;const r=ve(e.nodeName);if(We(L.uponSanitizeElement,e,{tagName:r,allowedTags:x}),e.hasChildNodes()&&!xe(e.firstElementChild)&&It(/<[/\w]/g,e.innerHTML)&&It(/<[/\w]/g,e.textContent))return we(e),!0;if(e.nodeType===sn)return we(e),!0;if(X&&e.nodeType===an&&It(/<[/\w]/g,e.data))return we(e),!0;if(!x[r]||G[r]){if(!G[r]&&ke(r)){if(k.tagNameCheck instanceof RegExp&&It(k.tagNameCheck,r))return!1;if(k.tagNameCheck instanceof Function&&k.tagNameCheck(r))return!1}if(ie&&!ce[r]){const t=A(e)||e.parentNode,n=T(e)||e.childNodes;if(n&&t){for(let r=n.length-1;r>=0;--r){const o=m(n[r],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,f(e))}}}return we(e),!0}return e instanceof l&&!function(e){let t=A(e);t&&t.tagName||(t={namespaceURI:_e,tagName:"template"});const n=At(e.tagName),r=At(t.tagName);return!!Te[e.namespaceURI]&&(e.namespaceURI===Ne?t.namespaceURI===me?"svg"===n:t.namespaceURI===pe?"svg"===n&&("annotation-xml"===r||Ce[r]):Boolean(Re[n]):e.namespaceURI===pe?t.namespaceURI===me?"math"===n:t.namespaceURI===Ne?"math"===n&&ge[r]:Boolean(He[n]):e.namespaceURI===me?!(t.namespaceURI===Ne&&!ge[r])&&!(t.namespaceURI===pe&&!Ce[r])&&!He[n]&&(ye[n]||!Re[n]):!("application/xhtml+xml"!==be||!Te[e.namespaceURI]))}(e)?(we(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!It(/<\/no(script|embed|frames)/i,e.innerHTML)?(q&&e.nodeType===on&&(t=e.textContent,_t([O,D,R],(e=>{t=yt(t,e," ")})),e.textContent!==t&&(Tt(n.removed,{element:e.cloneNode()}),e.textContent=t)),We(L.afterSanitizeElements,e,null),!1):(we(e),!0)},$e=function(e,t,n){if(re&&("id"===t||"name"===t)&&(n in r||n in Le))return!1;if(Y&&!j[t]&&It(H,t));else if(z&&It(w,t));else if(!F[t]||j[t]){if(!(ke(e)&&(k.tagNameCheck instanceof RegExp&&It(k.tagNameCheck,e)||k.tagNameCheck instanceof Function&&k.tagNameCheck(e))&&(k.attributeNameCheck instanceof RegExp&&It(k.attributeNameCheck,t)||k.attributeNameCheck instanceof Function&&k.attributeNameCheck(t))||"is"===t&&k.allowCustomizedBuiltInElements&&(k.tagNameCheck instanceof RegExp&&It(k.tagNameCheck,n)||k.tagNameCheck instanceof Function&&k.tagNameCheck(n))))return!1}else if(he[t]);else if(It(M,yt(n,P,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==bt(n,"data:")||!de[e]){if(B&&!It(V,yt(n,P,"")));else if(n)return!1}else;return!0},ke=function(e){return"annotation-xml"!==e&>(e,U)},Ge=function(e){We(L.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Me(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:F,forceKeepAttr:void 0};let o=t.length;for(;o--;){const i=t[o],{name:s,namespaceURI:a,value:c}=i,l=ve(s);let d="value"===s?c:St(c);if(r.attrName=l,r.attrValue=d,r.keepAttr=!0,r.forceKeepAttr=void 0,We(L.uponSanitizeAttribute,e,r),d=r.attrValue,!oe||"id"!==l&&"name"!==l||(Ve(s,e),d="user-content-"+d),X&&It(/((--!?|])>)|<\/(style|title)/i,d)){Ve(s,e);continue}if(r.forceKeepAttr)continue;if(Ve(s,e),!r.keepAttr)continue;if(!K&&It(/\/>/i,d)){Ve(s,e);continue}q&&_t([O,D,R],(e=>{d=yt(d,e," ")}));const u=ve(e.nodeName);if($e(u,l,d)){if(C&&"object"==typeof p&&"function"==typeof p.getAttributeType)if(a);else switch(p.getAttributeType(u,l)){case"TrustedHTML":d=C.createHTML(d);break;case"TrustedScriptURL":d=C.createScriptURL(d)}try{a?e.setAttributeNS(a,s,d):e.setAttribute(s,d),Me(e)?we(e):ft(n.removed)}catch(e){}}}We(L.afterSanitizeAttributes,e,null)},je=function e(t){let n=null;const r=Ue(t);for(We(L.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)We(L.uponSanitizeShadowNode,n,null),Fe(n),Ge(n),n.content instanceof s&&e(n.content);We(L.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,a=null,l=null;if(fe=!e,fe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!xe(e)){if("function"!=typeof e.toString)throw Lt("toString is not a function");if("string"!=typeof(e=e.toString()))throw Lt("dirty is not a string, aborting")}if(!n.isSupported)return e;if(J||De(t),n.removed=[],"string"==typeof e&&(se=!1),se){if(e.nodeName){const t=ve(e.nodeName);if(!x[t]||G[t])throw Lt("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof c)r=Pe("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),i.nodeType===rn&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!ee&&!q&&!Q&&-1===e.indexOf("<"))return C&&ne?C.createHTML(e):e;if(r=Pe(e),!r)return ee?null:ne?g:""}r&&Z&&we(r.firstChild);const d=Ue(se?e:r);for(;a=d.nextNode();)Fe(a),Ge(a),a.content instanceof s&&je(a.content);if(se)return e;if(ee){if(te)for(l=S.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(F.shadowroot||F.shadowrootmode)&&(l=I.call(o,l,!0)),l}let u=Q?r.outerHTML:r.innerHTML;return Q&&x["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&It(en,r.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+u),q&&_t([O,D,R],(e=>{u=yt(u,e," ")})),C&&ne?C.createHTML(u):u},n.setConfig=function(){De(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),J=!0},n.clearConfig=function(){Ie=null,J=!1},n.isValidAttribute=function(e,t,n){Ie||De({});const r=ve(e),o=ve(t);return $e(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&Tt(L[e],t)},n.removeHook=function(e){return ft(L[e])},n.removeHooks=function(e){L[e]=[]},n.removeAllHooks=function(){L={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();let un,hn=!1;class En{constructor(e,t={}){this.template=this.formatTemplate(e),this.isProxyData=!0===t.__cms__isProxy,!0===this.isProxyData&&(this.template=En.formatTemplateForProxyData(this.template));(()=>{!0===n(Array,t)&&(t={spyneData:t},this.template=this.template.replace("{{/}}","{{/spyneData}}"),this.template=this.template.replace("{{#}}","{{#spyneData}}"))})(),this.templateData=t;const r=En.getStringArray(this.template);let o=this.template.match(En.findTmplLoopsRE());o=null===o?[]:o;const i=En.parseTmplLoopsRE(),s=this.parseTheTmplLoop.bind(this),a=u(T,o),c=I(a,((e,t)=>e.replace(i,s)),this.addParams.bind(this));this.finalArr=r.map(c)}static isPrimitiveTag(e){return/({{\.\*?}})/.test(e)}static formatTemplateForProxyData(e){const t=/(({{(?!loopNum|loopIndex))(.*?)(}}))/gm,n=new RegExp("(?<=>)(.*?)(({{)(.*)(}}))","gm"),r=(e,t,n,r)=>(e=>{const t=En.isPrimitiveTag(e),{key:n,dataId:r}=(e=>{const n=/({{)([\w_]+(\.))*?(\w+)(}})/gm;let r="__cms__dataId";const o=t?"{{loopIndex}}":String(e).replace(n,"$4");return/(\w\.)/.test(e)&&(r=String(e).replace(n,"$2")+r),{key:o,dataId:r}})(e);let o=`<spyne-cms-item data-cms-id="{{${r}}}" data-cms-key="${n}"`;return t&&(o+=' data-cms-orig-key="{{origKey}}"'),`${o}><spyne-cms-item-hitbox></spyne-cms-item-hitbox><spyne-cms-item-text>${t?"{{spyneLoopKey}}":e}</spyne-cms-item-text></spyne-cms-item>`})(e);return String(e).replace(n,((e,n,o,i,s)=>`${n}${String(o).replace(t,r)}`))}static getNestedDataReducer(e={},t=""){return/(\.)/gm.test(String(t))?String(t).split(".").reduce(((e,t)=>e[t]?e[t]:"string"==typeof e?e:""),e):e[t]??""}static getStringArray(e){const t=e.split(En.findTmplLoopsRE()),n=/^([\\n\s\W]+)$/;return L((e=>e.match(n)),t)}static findTmplLoopsRE(){return/({{#[\w.]+}}[\w\n\s\W]+?{{\/[\w.]+}})/gm}static parseTmplLoopsRE(){return/({{#([\w.]+)}})([\w\n\s\W]+?)({{\/\2}})/gm}static swapParamsForTagsRE(){return/({{)(.*?)(}})/gm}removeThis(){void 0!==this&&(this.finalArr=void 0,this.templateData=void 0,this.template=void 0)}renderDocFrag(){let e=En.replaceImgPath(this.finalArr.join(""));e=(e=>{if(!hn)throw new Error("sanitizeHTML is not configured. Call sanitizeHTMLConfigure() with appropriate config.");return un(e)})(e);const t=/^([^>]*?)(<){1}(\b)(thead|col|colgroup|tbody|td|tfoot|tr|th)(\b)([^\0]*)$/.test(e)?e:document.createRange().createContextualFragment(e);return window.setTimeout(this.removeThis,2),t}renderToString(){let e=this.finalArr.join("");return e=En.replaceImgPath(e),window.setTimeout(this.removeThis,2),e}getTemplateString(){return this.finalArr.join("")}formatTemplate(e){return!0===["SCRIPT","TEMPLATE"].includes(i("nodeName",e))?e.innerHTML:e}getDataValFromPathStr(e,t){const n=String(e).split(".");return s(n,t)||""}addParams(e){return e.replace(En.swapParamsForTagsRE(),((e,t,n,r)=>En.getNestedDataReducer(this.templateData,n)))}static replaceImgPath(e){const{IMG_PATH:t}=Je;return void 0!==t?(e=e.replaceAll(/src\s*=\s*(['"])imgs\//g,`src=$1${t}`)).replaceAll(/url\(\s*(['"]?)imgs\//g,`url($1${t}`):e}parseTheTmplLoop(e,t,n,r){const o=/(\.)/gm,i=r;let s=En.getNestedDataReducer(this.templateData,n);const a=(e,t,n)=>{if(En.isPrimitiveTag(t))return c(e,t);return l((()=>{const t=e,r=n,o=n+1;if(this.isProxyData){return{spyneLoopKey:t,__cms__dataId:s.__cms__dataId,origKey:s[`__cms__keyFor_${e}`],loopIndex:r,loopNum:o,d:e}}return{spyneLoopKey:t,loopIndex:r,loopNum:o}})(),t,n)},c=(e,t,n,r)=>t.replace(En.swapParamsForTagsRE(),e),l=(e,t,n)=>t.replace(En.swapParamsForTagsRE(),((t,r,i)=>{const s={loopIndex:n,loopNum:n+1};if(!1===o.test(i)&&void 0!==e[i])return void 0!==s[i]?s[i]:e[i];const a=this.getDataValFromPathStr(i,e);return void 0!==s[i]?s[i]:a}));return!0===v(s)||b(s)?"":(void 0===s.length&&(s=[s]),s.map(((e,t)=>"string"==typeof e?a(e,i,t):l(e,i,t))).join(""))}}class pn{constructor(e={}){var t,n;e.tagName=(t="div",n=e.tagName,p(t)(n)),e.attributes=void 0!==e.attributes?e.attributes:this.getDomAttributes(e),e.attrs=this.updateAttrs(e.attributes),e.fragment=document.createDocumentFragment(),this.props=e,this.addMixins()}setProp(e,t){this.props[e]=t}getProp(e){return this.props[e]}get el(){return this.props.el}setElAttrs(e,t){return this.getProp("attrs").forEach(((t,n)=>{const r=(t,n)=>{e.dataset[n]=t};"dataset"===n?H(r,t):e.setAttribute(n,t)})),e}updateAttrs(e,t){const n=void 0!==t?t:new Map;return O(((e,t)=>n.set(t,e)),e),n}addTemplate(e){const t=this.getProp("template");return void 0!==t?(t=>{let r=this.getProp("data");r=n(Object,r)?r:{};const o=new En(t,r).renderDocFrag();return n(String,o)?e.innerHTML=o:e.appendChild(o),e})(t):e}createElement(e="div"){return document.createElement(e)}addContent(e){const t=this.getProp("data");if(!0===n(String,t)){const n=document.createTextNode(t);e.appendChild(n)}return e}execute(){const e=D(this.createElement.bind(this),this.setElAttrs.bind(this),this.addTemplate.bind(this),this.addContent.bind(this))(this.getProp("tagName"));this.props.el=e}render(){return this.execute(),this.props.template=void 0,this.props.data=void 0,this.props.attributes=void 0,this.getProp("el")}renderToHTMLString(){return this.execute(),this.props.template=void 0,this.props.data=void 0,this.props.attributes=void 0,this.getProp("el").outerHTML}returnIfDefined(e,t){if(void 0!==t){const n=void 0===t;e[t]=!1===n?t:ke(e[t],t)}}updateprops(e){return this.returnIfDefined(this.props,e),this}updatepropsAndRun(e){return this.updateprops(e),this.execute(),this.getProp("fragment")}unmount(){void 0!==this.props&&(this.getProp("el").remove(),this.props=void 0,this.gc())}updateTag(e="div"){this.updateprops(e)}updateAttributes(e={}){this.updateprops(e)}updateTemplate(e){this.updateprops(e)}updateData(e={}){this.updateprops(e)}addTagAndRender(e="div"){this.updatepropsAndRun(e)}addAttrsibutesAndRender(e={}){this.updatepropsAndRun(e)}addTemplateAndRender(e){this.updatepropsAndRun(e)}addDataAndRender(e={}){this.updatepropsAndRun(e)}addMixins(){const e=rt();this.gc=e.gc.bind(this)}getDomAttributes(e){return R(this.attributesArray,e)}get attributesArray(){return["accept","accept-charset","accesskey","action","align","allow","alt","async","autocapitalize","autocomplete","autofocus","autoplay","bgcolor","border","buffered","challenge","charset","checked","cite","class","code","codebase","color","cols","colspan","content","contenteditable","contextmenu","controls","coords","crossorigin","csp","dataset","datetime","decoding","default","defer","dir","dirname","disabled","download","draggable","dropzone","enctype","for","form","formaction","headers","height","hidden","high","href","hreflang","http-equiv","icon","id","importance","integrity","ismap","itemprop","keytype","kind","label","lang","language","lazyload","list","loop","low","manifest","max","maxlength","minlength","media","method","min","multiple","muted","name","novalidate","open","optimum","pattern","ping","placeholder","poster","preload","radiogroup","readonly","referrerpolicy","rel","required","reversed","rows","rowspan","sandbox","scope","scoped","selected","shape","size","sizes","slot","span","spellcheck","src","srcdoc","srclang","srcset","start","step","style","summary","tabindex","target","title","translate","type","usemap","value","width","wrap"]}}const Nn=(e=!1,t=1,n="ease",r=!1)=>`${!0===r?"opacity:0;":""}transition: opacity ${t}s ${n}; opacity: ${!0===e?1:0};`;function mn(e){return"function"==typeof e}function _n(e){return mn(null==e?void 0:e.lift)}function fn(e){return function(t){if(_n(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}var Tn=function(e,t){return Tn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Tn(e,t)};function An(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Tn(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Cn(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}function gn(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function yn(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function bn(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function Sn(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function vn(e){return this instanceof vn?(this.v=e,this):new vn(e)}function In(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||a(e,t)}))})}function a(e,t){try{(n=o[e](t)).value instanceof vn?Promise.resolve(n.value.v).then(c,l):d(i[0][2],n)}catch(e){d(i[0][3],e)}var n}function c(e){a("next",e)}function l(e){a("throw",e)}function d(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}}function Ln(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=yn(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}"function"==typeof SuppressedError&&SuppressedError;function On(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Dn=On((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function Rn(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Hn=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,r,o;if(!this.closed){this.closed=!0;var i=this._parentage;if(i)if(this._parentage=null,Array.isArray(i))try{for(var s=yn(i),a=s.next();!a.done;a=s.next()){a.value.remove(this)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else i.remove(this);var c=this.initialTeardown;if(mn(c))try{c()}catch(e){o=e instanceof Dn?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var d=yn(l),u=d.next();!u.done;u=d.next()){var h=u.value;try{Pn(h)}catch(e){o=null!=o?o:[],e instanceof Dn?o=Sn(Sn([],bn(o)),bn(e.errors)):o.push(e)}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}}if(o)throw new Dn(o)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Pn(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Rn(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&Rn(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),wn=Hn.EMPTY;function Vn(e){return e instanceof Hn||e&&"closed"in e&&mn(e.remove)&&mn(e.add)&&mn(e.unsubscribe)}function Pn(e){mn(e)?e():e.unsubscribe()}var Un={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Mn={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=Mn.delegate;return(null==o?void 0:o.setTimeout)?o.setTimeout.apply(o,Sn([e,t],bn(n))):setTimeout.apply(void 0,Sn([e,t],bn(n)))},clearTimeout:function(e){var t=Mn.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function xn(e){Mn.setTimeout((function(){throw e}))}function Wn(){}var Fn=null;function $n(e){if(Un.useDeprecatedSynchronousErrorHandling){var t=!Fn;if(t&&(Fn={errorThrown:!1,error:null}),e(),t){var n=Fn,r=n.errorThrown,o=n.error;if(Fn=null,r)throw o}}else e()}var kn=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Vn(t)&&t.add(n)):n.destination=Kn,n}return An(t,e),t.create=function(e,t,n){return new Yn(e,t,n)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Hn),Gn=Function.prototype.bind;function jn(e,t){return Gn.call(e,t)}var zn=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){Bn(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Bn(e)}else Bn(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Bn(e)}},e}(),Yn=function(e){function t(t,n,r){var o,i,s=e.call(this)||this;mn(t)||!t?o={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:s&&Un.useDeprecatedNextContext?((i=Object.create(t)).unsubscribe=function(){return s.unsubscribe()},o={next:t.next&&jn(t.next,i),error:t.error&&jn(t.error,i),complete:t.complete&&jn(t.complete,i)}):o=t;return s.destination=new zn(o),s}return An(t,e),t}(kn);function Bn(e){xn(e)}var Kn={closed:!0,next:Wn,error:function(e){throw e},complete:Wn},qn="function"==typeof Symbol&&Symbol.observable||"@@observable";function Xn(e){return e}var Qn=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r,o=this,i=(r=e)&&r instanceof kn||function(e){return e&&mn(e.next)&&mn(e.error)&&mn(e.complete)}(r)&&Vn(r)?e:new Yn(e,t,n);return $n((function(){var e=o,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?o._subscribe(i):o._trySubscribe(i))})),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=Jn(t))((function(t,r){var o=new Yn({next:function(t){try{e(t)}catch(e){r(e),o.unsubscribe()}},error:r,complete:t});n.subscribe(o)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[qn]=function(){return this},e.prototype.pipe=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return(0===(e=t).length?Xn:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)})(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Jn(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function Jn(e){var t;return null!==(t=null!=e?e:Un.Promise)&&void 0!==t?t:Promise}var Zn="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function er(e){if(e instanceof Qn)return e;if(null!=e){if(function(e){return mn(e[qn])}(e))return s=e,new Qn((function(e){var t=s[qn]();if(mn(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if((i=e)&&"number"==typeof i.length&&"function"!=typeof i)return o=e,new Qn((function(e){for(var t=0;t<o.length&&!e.closed;t++)e.next(o[t]);e.complete()}));if(mn(null==(r=e)?void 0:r.then))return n=e,new Qn((function(e){n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,xn)}));if(function(e){return Symbol.asyncIterator&&mn(null==e?void 0:e[Symbol.asyncIterator])}(e))return tr(e);if(function(e){return mn(null==e?void 0:e[Zn])}(e))return t=e,new Qn((function(e){var n,r;try{for(var o=yn(t),i=o.next();!i.done;i=o.next()){var s=i.value;if(e.next(s),e.closed)return}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}e.complete()}));if(function(e){return mn(null==e?void 0:e.getReader)}(e))return tr(function(e){return In(this,arguments,(function(){var t,n,r;return gn(this,(function(o){switch(o.label){case 0:t=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,vn(t.read())];case 3:return n=o.sent(),r=n.value,n.done?[4,vn(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,vn(r)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}(e))}var t,n,r,o,i,s;throw function(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}(e)}function tr(e){return new Qn((function(t){(function(e,t){var n,r,o,i;return Cn(this,void 0,void 0,(function(){var s,a;return gn(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=Ln(e),c.label=1;case 1:return[4,n.next()];case 2:if((r=c.sent()).done)return[3,4];if(s=r.value,t.next(s),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),o={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(i=n.return)?[4,i.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function nr(e,t,n,r,o){return new rr(e,t,n,r,o)}var rr=function(e){function t(t,n,r,o,i,s){var a=e.call(this,t)||this;return a.onFinalize=i,a.shouldUnsubscribe=s,a._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=o?function(e){try{o(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return An(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(kn),or=function(e){function t(t,n){return e.call(this)||this}return An(t,e),t.prototype.schedule=function(e,t){return this},t}(Hn),ir={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=ir.delegate;return(null==o?void 0:o.setInterval)?o.setInterval.apply(o,Sn([e,t],bn(n))):setInterval.apply(void 0,Sn([e,t],bn(n)))},clearInterval:function(e){var t=ir.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},sr=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return An(t,e),t.prototype.schedule=function(e,t){var n;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,o=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(o,r,t)),this.pending=!0,this.delay=t,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(o,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),ir.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;null!=t&&ir.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=e||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Rn(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(or),ar={now:function(){return(ar.delegate||Date).now()},delegate:void 0},cr=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=ar.now,e}(),lr=new(function(e){function t(t,n){void 0===n&&(n=cr.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return An(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(cr))(sr);function dr(e,t){return fn((function(n,r){var o=0;n.subscribe(nr(r,(function(n){r.next(e.call(t,n,o++))})))}))}function ur(e,t,n){return void 0===n&&(n=1/0),mn(t)?ur((function(n,r){return dr((function(e,o){return t(n,e,r,o)}))(er(e(n,r)))}),n):("number"==typeof t&&(n=t),fn((function(t,r){return function(e,t,n,r,o,i,s,a){var c=[],l=0,d=0,u=!1,h=function(){!u||c.length||l||t.complete()},E=function(e){return l<r?p(e):c.push(e)},p=function(e){i&&t.next(e),l++;var a=!1;er(n(e,d++)).subscribe(nr(t,(function(e){null==o||o(e),i?E(e):t.next(e)}),(function(){a=!0}),void 0,(function(){if(a)try{l--;for(var e=function(){var e=c.shift();s?function(e,t,n,r,o){void 0===r&&(r=0),void 0===o&&(o=!1);var i=t.schedule((function(){n(),o?e.add(this.schedule(null,r)):this.unsubscribe()}),r);e.add(i)}(t,s,(function(){return p(e)})):p(e)};c.length&&l<r;)e();h()}catch(e){t.error(e)}})))};return e.subscribe(nr(t,E,(function(){u=!0,h()}))),function(){null==a||a()}}(t,r,e,n)})))}var hr=On((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Er=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return An(t,e),t.prototype.lift=function(e){var t=new pr(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new hr},t.prototype.next=function(e){var t=this;$n((function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var o=yn(t.currentObservers),i=o.next();!i.done;i=o.next()){i.value.next(e)}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;$n((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}}))},t.prototype.complete=function(){var e=this;$n((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,o=n.isStopped,i=n.observers;return r||o?wn:(this.currentObservers=null,i.push(e),new Hn((function(){t.currentObservers=null,Rn(i,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,o=t.isStopped;n?e.error(r):o&&e.complete()},t.prototype.asObservable=function(){var e=new Qn;return e.source=this,e},t.create=function(e,t){return new pr(e,t)},t}(Qn),pr=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return An(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:wn},t}(Er);var Nr={connector:function(){return new Er}};function mr(e,t){void 0===t&&(t=Nr);var n=t.connector;return fn((function(t,r){var o,i=n();er(e((o=i,new Qn((function(e){return o.subscribe(e)}))))).subscribe(r),r.add(t.subscribe(i))}))}function _r(e,t){return void 0===t&&(t=lr),fn((function(n,r){var o=null,i=null,s=null,a=function(){if(o){o.unsubscribe(),o=null;var e=i;i=null,r.next(e)}};function c(){var n=s+e,i=t.now();if(i<n)return o=this.schedule(void 0,n-i),void r.add(o);a()}n.subscribe(nr(r,(function(n){i=n,s=t.now(),o||(o=t.schedule(c,e),r.add(o))}),(function(){a(),r.complete()}),void 0,(function(){i=o=null})))}))}function fr(e,t){return fn((function(n,r){var o=0;n.subscribe(nr(r,(function(n){return e.call(t,n,o++)&&r.next(n)})))}))}function Tr(e){return fn((function(t,n){try{t.subscribe(n)}finally{n.add(e)}}))}var Ar=ur;var Cr=function(e){function t(t,n){var r=e.call(this)||this;return r.source=t,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,_n(t)&&(r.lift=t.lift),r}return An(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,null==e||e.unsubscribe()},t.prototype.connect=function(){var e=this,t=this._connection;if(!t){t=this._connection=new Hn;var n=this.getSubject();t.add(this.source.subscribe(nr(n,void 0,(function(){e._teardown(),n.complete()}),(function(t){e._teardown(),n.error(t)}),(function(){return e._teardown()})))),t.closed&&(this._connection=null,t=Hn.EMPTY)}return t},t.prototype.refCount=function(){return fn((function(e,t){var n=null;e._refCount++;var r=nr(t,void 0,void 0,void 0,(function(){if(!e||e._refCount<=0||0<--e._refCount)n=null;else{var r=e._connection,o=n;n=null,!r||o&&r!==o||r.unsubscribe(),t.unsubscribe()}}));e.subscribe(r),r.closed||(n=e.connect())}))(this)},t}(Qn);function gr(e){return e?function(t){return mr(e)(t)}:function(e){return function(e,t){var n=mn(e)?e:function(){return e};return mn(t)?mr(t,{connector:n}):function(e){return new Cr(e,n)}}(new Er)(e)}}function yr(e,t){return void 0===t&&(t=!1),fn((function(n,r){var o=0;n.subscribe(nr(r,(function(n){var i=e(n,o++);(i||t)&&r.next(n),!i&&r.complete()})))}))}function br(e,t,n){var r=mn(e)||t||n?{next:e,error:t,complete:n}:e;return r?fn((function(e,t){var n;null===(n=r.subscribe)||void 0===n||n.call(r);var o=!0;e.subscribe(nr(t,(function(e){var n;null===(n=r.next)||void 0===n||n.call(r,e),t.next(e)}),(function(){var e;o=!1,null===(e=r.complete)||void 0===e||e.call(r),t.complete()}),(function(e){var n;o=!1,null===(n=r.error)||void 0===n||n.call(r,e),t.error(e)}),(function(){var e,t;o&&(null===(e=r.unsubscribe)||void 0===e||e.call(r)),null===(t=r.finalize)||void 0===t||t.call(r)})))})):Xn}class Sr{constructor(e){this.props.observableStreams=Sr.createDirectionalObservables()}static createDirectionalFiltersObject(){const e="internal",t="parent",n="child";return{P:[t],C:[n],PCI:[t,e,n],CI:[n,e],PI:[t,e],PC:[t,n]}}static addDefaultDir(e){return w(V)({$dir:["internal"]},l(e))}static addDownInternalDir(e,t=["internal","down"]){return w(V)(l(e),{$dir:t})}static addChildAndInternalDir(e,t=["child","down"]){return w(V)(l(e),{$dir:t})}static mapToDefaultDir(e){return this.addDefaultDir(e)}static createDirectionalObservables(e=new Le,t,n){void 0!==t&&void 0!==n&&(e.viewName=t,e.vsid=n);const r=e=>P((t=>t.includes(e)),"$dir"),o=r("parent"),i=r("child"),s=r("internal"),a=e=>V({from$:e}),c=a("child"),l=a("internal"),d=a("parent"),u=e.pipe(fr((e=>void 0!==e&&void 0!==e.action))),h=e.pipe(fr(s),dr(l)),E=e.pipe(fr(o),dr(c)),p=e.pipe(fr(i),dr(d)),N={parent:E,internal:h,child:p};return{raw$:u,toInternal$:h,toParent$:E,toChild$:p,completeAll:()=>{U((e=>{e.complete(),e.isStopped=!0}),[u,h,E,p])},completeStream:(e=[])=>{const t=e=>{if(void 0!==N[e]){(t=N[e]).complete(),t.isStopped=!0}var t};void 0!==e&&e.length>=1&&e.forEach(t)}}}}class vr{constructor(e,t={},n="",r="theName"){this.addMixins(),this._state="INIT",this.vsid=n,this.vsName=r,this.defaults={debug:!1,extendedHashMethods:{}},this.options=ke(this.defaults,t);this.addActionListeners().forEach((e=>{const[t,n]=e;this.options.extendedHashMethods[t]=e=>this[n](e)})),this.options.hashMethods=this.setHashMethods(this.options.extendedHashMethods),this.sink$=e,this.sink$.subscribe(this.onObsSinkSubscribe.bind(this)),this.$dirs=Sr.createDirectionalFiltersObject(),this.addDefaultDir=Sr.addDefaultDir,this.sourceStreams=Sr.createDirectionalObservables(new Le,this.vsName,this.vsid),this._source$=this.sourceStreams.toInternal$}addActionListeners(){return[]}setHashMethods(e={}){return ke({VS_DETRITUS_COLLECT:e=>this.onGarbageCollect(e),READY_FOR_VS_DETRITUS_COLLECT:e=>this.onReadyForGC(e),EXTIRPATE:e=>this.onDispose(e),VS_SPAWN:e=>this.onRender(e),VS_SPAWN_AND_ATTACH_TO_PARENT:e=>this.onRenderAndAttachToParent(e),VS_SPAWN_AND_ATTACH_TO_DOM:e=>this.onRenderAndAttachToDom(e),ATTACH_CHILD_TO_SELF:e=>this.onAttachChildToSelf(e)},e)}createDomItem(){this.props=void 0!==this.props?this.props:{};const e=_((e=>void 0!==e),R(["id","className"],this.props)),{tagName:t,data:n,template:r}=this.props;return new pn(t,e,n,r)}onDisposeCompleted(e){}animateInTween(e,t){!function(e,t){const n=1*window.getComputedStyle(e).opacity,r=Nn(!0,t,"ease",1===n);e.style.cssText+=r}(e,t)}animateOutTween(e,t,n){!function(e,t,n){const r=Nn(!1,t,"ease");e.style.cssText+=r,e.addEventListener("transitionend",n,!1)}(e,t,n)}setAnimateIn(e){if(!0===e.animateIn){const t=void 0!==e.el?e.el:this.domItem.el;this.animateInTween(t,e.animateInTime)}}disposeMethod(e){const t=void 0!==e.el.el?e.el.el:e.el,n={action:"READY_FOR_VS_DETRITUS_COLLECT",$dir:this.$dirs.PI,el:t},r=Oe(((e,n)=>{this.animateOutTween(t,e.animateOutTime,n)})),o=e=>{this._source$.next(n)},i=!0===e.animateOut?e=>(r(e).subscribe(o),{action:"EXTIRPATING",$dir:this.$dirs.CI}):()=>({action:"EXTIRPATE_AND_READY_FOR_VS_DETRITUS_COLLECT",$dir:this.$dirs.CI});return i(e)}onDispose(e){return this.disposeMethod(e)}removeStream(){void 0!==this.sourceStreams&&this.sourceStreams.completeStream(["internal","child"])}onReadyForGC(e){this.removeStream()}onGarbageCollect(e){void 0!==this.domItem&&this.domItem.unmount(),void 0!==this.sourceStreams&&this.sourceStreams.completeStream(["parent"])}getSourceStream(){return this._source$}combineDomItems(e){const t=v(e.query)?e.node:e.query,n=(e,t)=>e.insertBefore(t,e.firstChild);({appendChild:(e,t)=>e.appendChild(t),after:(e,t)=>e.after(t)}[e.attachType]||n)(t,this.domItem.render()),this.setAnimateIn(e)}onAttachChildToSelf(e){const t=e.childRenderData;return this.combineDomItems(t),{action:"CHILD_ATTACHED",$dir:this.$dirs.PI}}onRenderAndAttachToParent(e){return this.onRender(e),this.combineDomItems(e),{action:"VS_SPAWNED_AND_ATTACHED_TO_PARENT",el:this.domItem.el,$dir:this.$dirs.PI}}renderDomItem(e){const[t,n,r,o]=e;return this.domItem=new pn({tagName:t,attributes:n,data:r,template:o}),this.domItem}onRender(e){return{action:"VS_SPAWNED",el:(e=>this.renderDomItem(e))(M(["tagName","domAttributes","data","template"],e)),$dir:this.$dirs.I}}extendedMethods(e){}onRenderAndAttachToDom(e){return e.attachData.el=(e=>this.renderDomItem(e))(M(["tagName","domAttributes","data","template"],e)),this.combineDomItems(e.attachData),{action:"VS_SPAWNED_AND_ATTACHED_TO_DOM",el:e.attachData.el.el,$dir:this.$dirs.CI}}onObsSinkSubscribe(e){const t=e.action,n=p((e=>this.extendedMethods(e))),r=n(this.options.hashMethods[t])(e);void 0!==r&&(e=>{this._source$.next(e)})(Object.freeze(r))}addMixins(){}}function Ir(){setTimeout((()=>{U((e=>{}),this)}),1)}class Lr{constructor(e,t,n,r="subscribe",o=!1){const i={name:e,observable:t,data:n,action:r};this.sendToDirectorStream(i)}sendToDirectorStream(e){const t=Je.channelsMap.getStream("DISPATCHER"),n=tt(e);t.next(n),e=void 0}static deepClone(t){const r=n(Array),o=n(Object);var i;return!1===r(i=t)&&!0===o(i)?e(a,c,l)(t):l(t)}static getMouseEventKeys(){return["altKey","bubbles","cancelBubble","cancelable","clientX","clientY","composed","ctrlKey","currentTarget","defaultPrevented","detail","eventPhase","fromElement","isTrusted","layerX","layerY","metaKey","movementX","movementY","offsetX","offsetY","pageX","pageY","path","relatedTarget","returnValue","screenX","screenY","shiftKey","sourceCapabilities","srcElement","target","timeStamp","toElement","type","view","which","x","y"]}addMixins(){this.gc=Ir}}const Or=!0===Je.debug;class Dr{constructor(e,t){this.addMixins(),this.props=e,this.broadcastFn=t,this.broadcaster(this.broadcastFn)}addDblClickEvt(e){return De(e,"dblclick").pipe(dr((e=>{const t=l(e);return t.typeOverRide="dblclick",t})))}broadcast(e){if(e.length<=0&&!0===Or)return void console.warn(`Spyne Warning: The nested array in ${this.props.name}.broadcastEvents appears to be empty --\x3e vsid:${this.props.vsid}!`);const t={UI:this.sendUIPayload,ROUTE:this.sendRoutePayload},[n,r,o]=e;let i,s=this.props.el.querySelectorAll(n);if(s.length<=0){const e=this.props.el,t=t=>{t===e&&(s=[t])};(()=>{const r=(null!==e.parentElement?e.parentElement:document).querySelectorAll(n);r.forEach=Array.prototype.forEach,r.forEach(t)})()}const a=void 0!==o,c=e=>{const n="dblClick"!==r?De(e,r,{preventDefault:()=>!0}):this.addDblClickEvt(e);i=e.dataset.channel;const o={};o.payload=(e=>{const t={};for(const n in e)t[n]=e[n];return t})(e.dataset),o.payload=x(["channel"],o.payload),o.channel=i,o.srcElement={},o.srcElement.id=this.props.id,o.srcElement.vsid=this.props.vsid,o.srcElement.isLocalEvent=a,o.srcElement.srcEvent=r,o.srcElement.el=e;(void 0!==i?t[i]:t.UI)(n,o)};!0===(void 0===s||s.length<=0)&&!0===Or?console.warn(`Spyne Warning: The item ${n}, does not appear to exist in ${this.props.name} --\x3e vsid:${this.props.vsid}!`):(s.forEach=Array.prototype.forEach,s.forEach(c))}broadcaster(e){e().forEach((e=>this.broadcast(e)))}addMixins(){const e={testFunc:function(e){console.log("stream mixin is ",e)},sendRoutePayload:function(e,t){return new Lr("CHANNEL_ROUTE",e,t,"subscribe")},sendUIPayload:function(e,t){return new Lr("CHANNEL_UI",e,t,"subscribe")}};this.sendUIPayload=e.sendUIPayload,this.sendRoutePayload=e.sendRoutePayload}}const Rr=e(t,n(Array)),Hr=e(t,b),wr=r([n(String),Hr]),Vr=r([n(Array),Hr]),Pr=e(r([Rr,n(Object)])),Ur=e(r([Hr,Rr,n(Object)]));class Mr{constructor(t,o={},s,a){Pr(t)&&(t=i("selector",o=t),a=a||i("testMode",o));const c=[s,i("debugLabel",o)];s=e(W(n(String)))(c);let l=x(["debugLabel","label","selector","props","testMode","propFilters"],o);void 0!==o.props?l=d([o.props,l]):void 0!==o.propFilters&&(l=d([o.propFilters,l])),o.propFilters=l;const{propFilters:u}=o,h=wr(t)?Mr.filterSelector([t],s):void 0,E=Vr(t)?Mr.filterSelector(t,s):void 0,p=Ur(u)?Mr.filterData(u,s):void 0;let N=L(v,[h,E,p]);const m=b(N);return m&&(N=[F(!1)],!0===Je.debug&&!0!==a&&console.warn(`Spyne Warning: The Channel Filter, with selector: ${t}, and propFilters:${u} appears to be empty!`)),!0===a?{selector:t,propFilters:u,debugLabel:s,filters:o,testMode:a,filtersAreEmpty:m}:r(N)}static filterData(t,r){const o=r;return(()=>{if(b(t))return F(!1);t=k(((e,t,r)=>{var o;return!0===n(String,e)?(o=e,e=>e===o):e}),t);const r=Y(t);return e(r,(e=>{if(void 0===o)return e;const n={};return H(((t,r)=>{n[r]=t(i(r,e))}),t),console.log(`%c CHANNEL PAYLOAD FILTER DEBUGGER ["${o}"] - values: `,"color:orange;",{propsBooleans:n,comparedObj:e}),e}),p({}),(e=>{const{payload:t,srcElement:n,event:r}=e||{};return Object.assign({},e,n,r,t)}))})()}static checkPayloadSelector(t,n,r){const{payload:o,srcElement:s,event:a}=r||{},c=[s,o,i("srcElement",a),r].reduce(((e,t)=>{const n=i("el",t);return Mr.elIsDomElement(n)&&void 0===e&&(e=n),e}),void 0),l=e=>e.isEqualNode(c),d=e=>{const t=$(document.querySelectorAll(e));return k(l,t)};if(void 0!==n){const r=e($,k(d))(t),o=t;console.log(`%c CHANNEL PAYLOAD FILTER DEBUGGER ["${n}"] - selectors: `,"color:orange;",{el:c,selectorsArr:o,nodeArrResultsDebugger:r})}if("object"!=typeof c)return!1;const u=e($,k(d))(t);return!0!==b(u)&&G(j(!0),u)}static elIsDomElement(t){return n(String,t)&&(t=document.querySelector(t)),e(E(0),p(-1),i("nodeType"))(t)}static filterSelector(e,t){const n=L(b,e);return z(Mr.checkPayloadSelector)(n,t)}}function xr(){return!0===Je.debug}function Wr(e,t,n=!1){const r=$r(e,t,n);return 1===r.length?m(r):r}function Fr(t,n,r){const o=document.querySelector(t),s=e(E(0),p(-1),i("nodeType"));if(null===o||!1!==s(o)){if(void 0!==n&&String(n).trim().length>0){function a(e){try{return document.querySelectorAll(e).length>0}catch(e){return!1}}const c=a(n);!0===r&&!0===xr()&&!1===c&&console.warn(`Spyne Warning: the selector, ${n} does not exist in this el, ${t}`)}}else console.warn(`Spyne Warning: the el object is not a valid single element, ${o}`)}function $r(e,t,n=!1){let r=!1;const o=(n=>{let o=[];try{o=document.querySelectorAll(n)}catch(e){o=[]}try{r=document.querySelector(t)===document.querySelector(e),!0===r&&(o=[document.querySelector(t)])}catch(e){}return o})(void 0!==t?`${e} ${t}`:e);if(!0===n){Fr(!0===r?"body":e,t,n)}return o}function kr(e,t,n){return $r(t,n).forEach((t=>{t.style.cssText=e})),this}function Gr(t,n){function r(e){return Gr(t,e)}return Fr(t="string"==typeof t?t:function(e){let t=`${Math.random().toString(36).replace(/\d/gm,"").substring(1,8)}`;return void 0===e.dataset.vsid?e.dataset.vsid=t:t=e.dataset.vsid,`[data-vsid='${t}']`}(t),n,!1),r.map=e=>Array.from($r(t,n)).map(e),r.forEach=e=>Array.from($r(t,n)).map(e),r.getNodeListArray=()=>$r(t,n),r.addClass=e=>($r(t,n).forEach((t=>t.classList.add(e))),this),r.removeClass=e=>($r(t,n).forEach((t=>{t.classList.remove(e)})),this),r.setClass=r=>($r(t,n).forEach((t=>{const n=e(L(b),B(" "))(t.className),o=r.split(" ");n.forEach((e=>t.classList.remove(e))),o.forEach((e=>t.classList.add(e)))})),this),r.unmount=()=>{},r.toggleClass=(e,r)=>($r(t,n).forEach((t=>{(r=void 0!==r?r:!t.classList.contains(e))?t.classList.add(e):t.classList.remove(e)})),this),r.toggle=(e,t)=>(r.toggleClass(e,t),this),r.appendChild=e=>(0!==r.el.length?r.el.appendChild(e):console.warn(`Spyne Warning: The selector, ${n} does not appear to be valid!`),r.el),r.addAnimClass=e=>{requestAnimationFrame((()=>{$r(t,n).forEach((t=>{try{t.classList.add(e)}catch(e){}}))}))},r.setActiveItem=(r,o)=>{const s=$r(t,n),a="string"==typeof o?Wr(t,o):o,c=e=>e.isEqualNode(a)?e.classList.add(r):e.classList.remove(r);var l;return!0===(l=a,e(E(0),p(-1),i("nodeType"))(l))?s.forEach(c):!0===xr()&&console.warn(`Spyne Warning: The selector, ${o}, does not appear to be a valid item in setActiveItem: ${r}`),this},Object.defineProperty(r,"el",{get:()=>Wr(t,n,!0)}),Object.defineProperty(r,"els",{get:()=>$r(t,n)}),Object.defineProperty(r,"len",{get:()=>$r(t,n,!1).length}),Object.defineProperty(r,"exists",{get:()=>$r(t,n,!1).length>=1}),Object.defineProperty(r,"exist",{get:()=>$r(t,n,!1).length>=1}),Object.defineProperty(r,"nodeList",{get:()=>$r(t,n)}),Object.defineProperty(r,"arr",{get:()=>{const e=Wr(t,n,!0);return void 0===e?[]:void 0===e.length?[e]:Array.from(e)}}),Object.defineProperty(r,"inline",{set:e=>kr(e,t,n),get:()=>r}),Object.defineProperty(r,"inlineCss",{set:e=>kr(e,t,n),get:()=>r}),r}class jr{constructor(e={}){this.vsnum=Math.random(),this.addMixins(),this._postRenderCalled=!1,this.defaults=()=>{const t=this.createId(),n=e.id?e.id:t;return{vsid:t,id:n,tagName:"div",el:void 0,data:void 0,animateIn:!1,animateInTime:.5,animateOut:!1,animateOutTime:.5,sendLifecyleEvents:!1,hashId:`#${n}`,id$:`#${n}`,viewClass:vr,extendedSourcesHashMethods:{},debug:!1,template:void 0,node:document.createDocumentFragment(),name:it(this)}},this._state={},this.$dirs=Sr.createDirectionalFiltersObject(),this.addDefaultDirection=Sr.addDefaultDir,this.addDownInternalDir=Sr.addDownInternalDir,this.props=ke(this.defaults(),e),this.sendLifecycleMethod=!0===this.props.sendLifecyleEvents?this.sendLifecycleMethodActive.bind(this):this.sendLifecycleMethodInactive.bind(this);const t=this.attributesArray;this.props.domAttributes=R(t,this.props),void 0!==this.props.traits&&this.addTraits(this.props.traits),this.loadAllMethods(),this.props.action="LOADED",this.sink$=new Le;const n=this.props.viewClass;this.view=new n(this.sink$,{},this.props.vsid,this.props.id),this.sourceStreams=this.view.sourceStreams,this._rawSource$=this.view.getSourceStream(),this._rawSource$.viewName=this.props.name,this.sendEventsDownStream=this.sendEventsDownStreamFn,this.initViewStream(),this.isDevMode=jr.isDevMode(),this.props.addedChannels=[],this.checkIfElementAlreadyExists()}get source$(){return this._source$}get attributesArray(){return["accesskey","class","contenteditable","dir","draggable","hidden","id","lang","spellcheck","style","tabindex","title","translate","aria-autocomplete","aria-checked","aria-disabled","aria-expanded","aria-haspopup","aria-hidden","aria-invalid","aria-label","aria-level","aria-multiline","aria-multiselectable","aria-orientation","aria-pressed","aria-readonly","aria-required","aria-selected","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","aria-atomic","aria-busy","aria-live","aria-relevant","aria-dropeffect","aria-grabbed","aria-activedescendant","aria-controls","aria-describedby","aria-flowto","aria-labelledby","aria-owns","aria-posinset","aria-setsize","accept","autocomplete","autofocus","checked","dirname","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","list","max","maxlength","min","minlength","multiple","name","pattern","placeholder","readonly","required","size","step","value","alt","srcset","sizes","usemap","ismap","href","target","download","ping","rel","hreflang","as","media","accept-charset","action","enctype","novalidate","content","charset","http-equiv","async","defer","integrity","nomodule","nonce","referrerpolicy","autocapitalize","autoplay","buffered","challenge","cite","code","codebase","color","cols","colspan","contextmenu","controls","coords","crossorigin","csp","dataset","datetime","decoding","default","for","headers","high","icon","importance","itemprop","keytype","kind","label","language","lazyload","loop","low","manifest","method","muted","open","optimum","poster","preload","radiogroup","reversed","role","rows","rowspan","sandbox","scope","scoped","selected","shape","slot","span","srcdoc","src","type","srclang","start","summary","wrap","width","height"]}static isDevMode(){return Je.debug}static checkIfActionsAreRegistered(e=[],t){if(t.length>0){const n=t=>{const n=new RegExp(t);if(J(f(n),r)<0){const n=1===e.length?"from added channel":"from added channels";console.warn(`Spyne Warning: The action, ${t}, in ${this.props.name}, does not match any of the registered actions ${n}, ${e.join(", ")}`)}},r=(e=>{const t=e.map((e=>Je.getChannelActions(e)));return $(t)})(e);t.forEach(n)}}static isValidNestedArr(t){const r=j(!0),o=K(r),i=n(String),s=e(o,k(i),q(0,2),p([]));return e(o,k(s),p([]))(t)}static elIsDomElement(t){return n(String,t)&&(t=document.querySelector(t)),e(E(0),p(-1),i("nodeType"))(t)}updatePropsToMatchEl(){const t=e(X,Q(i("tagName"),F("")));this.props.tagName=t(this.props.el)}checkIfElementAlreadyExists(){const t=e(E(0),p(-1),i("nodeType"));P(r([e=>document.body.contains(e),t]),"el")(this.props)?(this.updatePropsToMatchEl(),this.postRender()):null===this.props.el&&console.error(`Spyne Error: The defined element for this ViewStream instance, ${this.constructor.name}, appears to not exist.`)}loadAllMethods(){const e=z(this.onChannelMethodCall.bind(this));this.addActionListeners().forEach((t=>{let[r,o,i]=t;n(String,i)&&(i=new Mr({selector:i})),this.props.extendedSourcesHashMethods[r]=e(o,i)})),this.props.hashSourceMethods=this.setSourceHashMethods(this.props.extendedSourcesHashMethods)}addActionListeners(){return[]}onChannelMethodCall(e,t,n){const r=t=>{void 0===this[e]?console.warn(`Spyne Warning: The method, ${e} does not appear to exist in ${this.constructor.name}!`):this[e](t)};if(void 0!==n.$dir&&n.$dir.includes("child")&&!0!==this.deleted){const e=ke({},n);e.$dir=this.$dirs.C,this.sourceStreams.raw$.next(e)}!0===p(F(!0),t)(n)&&r(n=x(["$dir"],n))}setSourceHashMethods(e={}){const t={EXTIRPATING:e=>this.checkParentDispose(e),EXTIRPATE:e=>this.disposeViewStream(e),VS_SPAWNED:e=>this.onVSRendered(e),VS_SPAWNED_AND_ATTACHED_TO_DOM:e=>this.onVSRendered(e),VS_SPAWNED_AND_ATTACHED_TO_PARENT:e=>this.onVSRendered(e),READY_FOR_VS_DETRITUS_COLLECT:e=>this.onReadyToGC(e),VS_NULLITY:()=>({})};return ke.all([{},t,e])}initViewStream(){this._source$=this._rawSource$.pipe(dr((e=>this.onMapViewSource(e))),yr(this.notGCSTATE)),this.initAutoMergeSourceStreams(),this.updateSourceSubscription(this._source$,!0)}notGCSTATE(e){return!e.action.includes("READY_FOR_VS_DETRITUS_COLLECT")}eqGCSTATE(e){return!e.action.includes("READY_FOR_VS_DETRITUS_COLLECT")}notCOMPLETED(e){return!e.action.includes("COMPLETED")}notGCCOMPLETE(e){return!e.action.includes("GC_COMPLETE")}testVal(e){console.log("TESTING VALL IS ",e)}addParentStream(e,t){this.parent$=e.pipe(fr((e=>void 0!==e&&void 0!==e.action)),dr((e=>{const t=ke({},e);return"EXTIRPATE_AND_READY_FOR_VS_DETRITUS_COLLECT"===t.action&&(this.disposeViewStream(t),t.action="READY_FOR_VS_DETRITUS_COLLECT"),t}))),this.updateSourceSubscription(this.parent$,!1,"PARENT"),this.renderAndAttachToParent(t)}addChildStream(e){const t=e.pipe(fr((e=>void 0!==e&&void 0!==e.action)),br((e=>this.tracer("addChildStraem do ",e))),dr((e=>e)),Tr((e=>this.onChildCompleted(t.source))));this.updateSourceSubscription(t,!0,"CHILD")}onChildDisposed(e){}onChildCompleted(e){const t=(e=>{const t=e=>{for(;void 0!==e.destination;)e=t(e.destination);return e};return R(["id","vsid"],t(e))})(e);return this.tracer("onChildCompleted ",this.vsnum,e),this.onChildDisposed(t,e),t}initAutoMergeSourceStreams(){const e={next:this.onSubscribeToSourcesNext.bind(this),error:this.onSubscribeToSourcesError.bind(this),complete:this.onSubscribeToSourcesComplete.bind(this)},t=()=>{this.props.el$=void 0,this.uberSource$.complete(),this.autoSubscriber$.complete(),this.sink$.complete(),this.props=void 0,this.deleted=!0,this.tracer("completeAll",this.deleted,this.props)},n=()=>{r-=1,0===r&&t()};let r=0;this.uberSource$=new Le;this.autoMergeSubject$=this.uberSource$.pipe(ur((e=>{const t=e.observable.pipe(fr((e=>void 0!==e&&void 0!==e.action)),dr((e=>{const t=ke({},e);return t.action=e.action,this.tracer("autoMergeSubject$",t),t})));return!1===e.autoClosesBool?t:(r+=1,t.pipe(Tr(n)))}))),this.autoSubscriber$=this.autoMergeSubject$.pipe(fr((e=>void 0!==e&&void 0!==e.action))).subscribe(e)}updateSourceSubscription(e,t=!1,n){const r={observable:e,autoClosesBool:t,rel:n};this.tracer("updateSourceSubscription ",this.vsnum,r),this.uberSource$.next(r)}onSubscribeToSourcesNext(t={}){const n=p((e=>this.sendExtendedStreams(e))),r=(i=this.props.hashSourceMethods,s=t.action,void 0!==i[s]?s:e(m,_(e(f(T,s),(e=>new RegExp(e)))))(o(i)));var i,s;n(this.props.hashSourceMethods[r])(t),this.tracer("onSubscribeToSourcesNext",{payload:t})}onSubscribeToSourcesError(e=""){console.log("ALL ERROR ",this.constructor.name,e)}onSubscribeToSourcesComplete(){this.tracer("onSubscribeToSourcesComplete","VS_DETRITUS_COLLECT"),this.openSpigot("VS_DETRITUS_COLLECT")}sendExtendedStreams(e){this.tracer("sendExtendedStreams",e),this.openSpigot(e.action,e)}renderAndAttachToParent(e){this.openSpigot("VS_SPAWN_AND_ATTACH_TO_PARENT",e)}renderView(){this.openSpigot("VS_SPAWN")}renderViewAndAttachToDom(e,t,n){const r={node:e,type:t,attachType:n};this.openSpigot("VS_SPAWN_AND_ATTACH_TO_DOM",{attachData:r})}checkParentDispose(e){"parent"===e.from$&&this.disposeViewStream(e)}onBeforeDispose(){}setTimeout(e,t=0,n=!1){window.setTimeout(((...t)=>{if(void 0!==this&&void 0!==this.props){const r=!0===n?e.bind(this):e;Z(r,t)}}),t)}disposeViewStream(e){this.onBeforeDispose(),this.openSpigot("EXTIRPATE")}onChildDispose(e){}onParentDisposing(e){this.openSpigot("EXTIRPATE")}onReadyToGC(e){const t=void 0!==e.from$&&"internal"===e.from$;this.tracer("onReadyToGC",t,e)}openSpigot(e,t={}){if(void 0!==this.props){this.props.action=e;const n=V(this.props,t);this.sink$.next(Object.freeze(n))}}setAttachData(e,t){return{node:this.props.el,type:"ViewStreamObservable",attachType:e,query:(()=>{const e=this.props.el.querySelector(t);return!0===jr.isDevMode()&&n(String,t)&&v(e)&&console.warn(`Spyne Warning: The appendView query in ${this.props.name}, '${t}', appears to not exist!`),e})()}}getParentEls(e,t){const n=e=>e.parentElement;let r=0,o=e;for(;r<t;)o=n(o),r++;return o}setAttachParentData(e,t,n){t=""!==t?t:void 0;const r=this.getParentEls(this.props.el,n);return{node:r,type:"ViewStreamObservable",attachType:e,query:r.querySelector(t)}}onMapViewSource(e={}){return this.props=V(this.props,e),e}exchangeViewsWithChild(e,t){this.addChildStream(e.sourceStreams.toParent$),e.addParentStream(this.sourceStreams.toChild$,t)}appendToDom(e){void 0!==this.props.el&&console.warn(`Spyne Warning: The ViewStream, ${this.props.name}, has an element, ${this.props.el}, that is already rendered and does not need to be appendedToDom. This may create unsusual side effects!`),this.renderViewAndAttachToDom(e,"dom","appendChild")}appendToDomAfter(e){void 0!==this.props.el&&console.warn(`Spyne Warning: The ViewStream, ${this.props.name}, has an element, ${this.props.el}, that is already rendered and does not need to be appendedToDomAfter. This may create unsusual side effects!`),this.renderViewAndAttachToDom(e,"dom","after")}prependToDom(e){void 0!==this.props.el&&console.warn(`Spyne Warning: The ViewStream, ${this.props.name}, has an element, ${this.props.el}, that is already rendered and does not need to be prependedToDom. This may create unsusual side effects!`),this.renderViewAndAttachToDom(e,"dom","prependChild")}appendView(e,t){this.exchangeViewsWithChild(e,this.setAttachData("appendChild",t))}appendViewAfter(e,t){this.exchangeViewsWithChild(e,this.setAttachData("after",t))}appendViewToParentEl(e,t,n=1){this.exchangeViewsWithChild(e,this.setAttachParentData("appendChild",t,n))}prependViewToParentEl(e,t,n=1){this.exchangeViewsWithChild(e,this.setAttachParentData("prependChild",t,n))}prependView(e,t){this.exchangeViewsWithChild(e,this.setAttachData("prependChild",t))}appendToNull(){const e=document.getElementById("spyne-null-views");this.renderViewAndAttachToDom(e,"dom","appendChild")}onVSRendered(e){"internal"===e.from$&&this.postRender()}postRender(){if(!0===this._postRenderedCalled)return;this.beforeAfterRender(),this.afterRender(),this.onRendered();if(requestAnimationFrame((()=>this.onAnimFrameAfterRendered())),!0===this.isDevMode){const e=this.broadcastEvents();!1===jr.isValidNestedArr(e)&&console.warn(`Spyne Warning: The array returned from broadcastEvents in ${this.props.name}, '${JSON.stringify(e)}', does not appear to be properly formatted!`)}this.initializeChannels(),this.viewsStreamBroadcaster=new Dr(this.props,this.broadcastEvents.bind(this)),this.afterBroadcastEvents(),this._postRenderedCalled=!0}addTraits(e){"Array"!==e.constructor.name&&(e=[e]);e.forEach((e=>{new e(this)}))}afterBroadcastEvents(){if(!0===this.isDevMode){const t=e=>e[0],r=this.addActionListeners(),o=r.map(t);if(!1===jr.isValidNestedArr(r))console.warn(`Spyne Warning: The array returned from addActionsListeners in ${this.props.name}, '${JSON.stringify(r)}', does not appear to be properly formatted!`);else{e(U((e=>{const t=p("",e[1]);!1===n(Function,this[t])&&console.warn(`Spyne Warning: The method in addActionListeners nested Array, '${JSON.stringify(e)}', in ${this.props.name}, does not appear to exist!`)})),p([]))(r)}const i=()=>{void 0!==s(["props","addedChannels"],this)&&jr.checkIfActionsAreRegistered.bind(this)(this.props.addedChannels,o)};this.setTimeout(i,500)}}setDataVSID(){this.props.el.dataset.vsid=this.props.vsid}beforeAfterRender(){this.setDataVSID(),this.props.el$=Gr(this.props.el)}downStream(){}onRendered(){}onAnimFrameAfterRendered(){}afterRender(){}broadcastEvents(){return[]}getChannel(e){return I((e=>Ze().includes(e)),(e=>Je.channelsMap.getStream(e).observer.pipe(yr((e=>!0!==this.deleted)))),(e=>console.warn(`channel name ${e} is not within ${Ze}`)))(e)}initializeChannels(){const e=e=>{const[t,n=!1]=Array.isArray(e)?e:[e];this?.addChannel(t,n)};Array.isArray(this?.props?.channels)&&this?.props?.channels?.forEach(e)}addChannel(e,t=!1,n=!1,r=!1){const o=!0===n?this.$dirs.CI:this.$dirs.I;if(!0===this?.props?.addedChannels?.includes(e))return;const i=s(["srcElement","isLocalEvent"]),a=s(["srcElement","vsid"]),c=[dr((e=>{const t=e;return t.$dir=o,t})),fr((e=>{const t=a(e);return!0!==i(e)||t===this.props.vsid}))];var l;!0===t&&c.unshift((l=1,fr((function(e,t){return l<=t}))));const d=this.getChannel(e).pipe(...c);this.updateSourceSubscription(d,!1),this.props.addedChannels.push(e)}checkIfChannelExists(e){const t=Je.channelsMap.testStream(e);return!0!==t&&console.warn(`SPYNE WARNING: The ChannelPayload from ${this.props.name}, has been sent to a channel, ${e}, that has not been registered!`),t}sendInfoToChannel(t,n={},r){const o=n,s=p("VIEWSTREAM_EVENT"),a=e(s,i(t)),c={payload:o,action:r=r||a({CHANNEL_ROUTE:"CHANNEL_ROUTE_CHANGE_EVENT"})};try{if(c.srcElement=e(R(["id","vsid","class","tagName"]),i("props"))(this),!0===this.checkIfChannelExists(t)){!1===/CHANNEL_LIFECYCLE/.test(r)&&Object.defineProperties(c,{payload:{get:()=>tt(n)}});const e=Re(c);return new Lr(t,e,c)}}catch(e){console.warn("SPYNE WARNING ",e)}}tracer(...e){this.sendLifecycleMethod(...e)}sendLifecycleMethodInactive(){}sendLifecycleMethodActive(e,t){const n="VS_DETRITUS_COLLECT"===t;!0===Y({from$:j("internal"),action:j("VS_SPAWNED_AND_ATTACHED_TO_PARENT")},t)?this.sendInfoToChannel("CHANNEL_LIFECYCLE",{action:"CHANNEL_LIFECYCLE_RENDERED_EVENT"},"CHANNEL_LIFECYCLE_RENDERED_EVENT"):!0===n&&this.sendInfoToChannel("CHANNEL_LIFECYCLE",{action:"CHANNEL_LIFECYCLE_DISPOSED_EVENT"},"CHANNEL_LIFECYCLE_DISPOSED_EVENT")}createActionFilter(e,t){return new Mr(e,t)}isLocalEvent(e){const t=s(["srcElement","el"],e),n=s(["props","el"],this);return jr.elIsDomElement(n)&&jr.elIsDomElement(t)&&n.contains(t)}addMixins(){const e=rt();this.createId=e.createId}}class zr{constructor(e){const t=String(e.props.name),n=`${t}_ROUTE_UPDATER`;return z(zr.createTemporaryViewStreamObj)({id:n,name:t})}static createTemporaryViewStreamObj(e,t){const{name:n,id:r}=e,o=t,i=new jr({id:r,name:n,data:t});i.onRendered=()=>{i.sendInfoToChannel("CHANNEL_ROUTE",o)},i.afterBroadcastEvents=()=>{i.disposeViewStream()},i.appendToNull()}}class Yr{constructor(e,t={}){this.addRegisteredActions.bind(this),this.createChannelActionsObj(e,t.extendedActionsArr),t.name=e,t.defaultActions=void 0!==t.data?[`${t.name}_EVENT`]:[],this.props=t,this.props.isRegistered=!1,this.props.isProxy=void 0!==this.props.isProxy&&this.props.isProxy;const n=void 0!==this.props.data;this.props.sendCachedPayload=void 0===this.props.sendCachedPayload?n:this.props.sendCachedPayload,this.sendPayloadToRouteChannel=new zr(this),this.createChannelActionMethods(),this.streamsController=Je.channelsMap;const r=this.getMainObserver();this.checkForPersistentDataMode=Yr.checkForPersistentDataMode.bind(this),this.observer$=this.props.observer=r;const o=this.streamsController.getStream("DISPATCHER"),i=ee(t.name,"name");o.pipe(fr(i)).subscribe((e=>this.onReceivedObservable(e)))}getMainObserver(){void 0===this.streamsController&&console.warn(`Spyne Warning: The following channel, ${this.props.name}, appears to be registered before Spyne has been initialized.`);return!0===this.streamsController.testStream(this.props.name)?this.streamsController.getProxySubject(this.props.name,this.props.sendCachedPayload):!0===this.props.sendCachedPayload?new He(1):new Le}onChannelInitialized(){}onRegistered(e=this.props){if(void 0!==e.data){const t=Object.keys(this.channelActions)[0];this.sendChannelPayload(t,e.data)}}get isProxy(){return this.props.isProxy}get channelName(){return this.props.name}get observer(){return this.observer$}checkForTraits(){const e=e=>{"Array"!==e.constructor.name&&(e=[e]);e.forEach((e=>new e(this)))};void 0!==this.props.traits&&e(this.props.traits)}initializeStream(){this.checkForTraits(),this.onChannelInitialized(),this.checkForPersistentDataMode(),this.onRegistered(),this.props.isRegistered=!0}static checkForPersistentDataMode(e=this.props,t=this.channelActions){const n=b(t),r=void 0!==i("data",e);return!0===n&&!0===r&&(e.sendCachedPayload=!0,t=(()=>{const{name:t}=e,n=`${t}_EVENT`;return{[n]:n}})(),void 0!==this.channelActions&&(this.channelActions=t)),{props:e,actionsObj:t}}setTrace(e){}createChannelActionsObj(e,t=[]){const r=I(n(String),te,m),o=t.concat(this.addRegisteredActions(e)),i=k(r,o),s=d(ne((e=>re(e,e)),i));this.channelActions=s}createChannelActionMethods(){const e=I(n(String),te,m),t=(e,t)=>{window.setTimeout((()=>{"function"!=typeof this[e]&&console.warn(`"${this.props.name}", REQUIRES THE FOLLOWING METHOD ${e} FOR ACTION, ${t[0]}`)}),100)},r=I(n(String),F("onViewStreamInfo"),(e=>{const n=oe(ie(1),e);return t(n,e),n}));this.channelActionMethods=a(k((t=>[e(t),r(t)]),this.addRegisteredActions()))}addRegisteredActions(){let e=[];return s(["props","data"],this)&&(e=[`${this.props.name}_EVENT`]),e}onReceivedObservable(e){this.onIncomingObservable(e)}getActionMethodForObservable(e){e.unpacked=!0;const t=this.onViewStreamInfo.bind(this),n=s(["data","action"],e),r=i(n,this.channelActionMethods);let o=t;if(void 0!==r&&"onViewStreamInfo"!==r){!0===("function"==typeof this[r])&&(o=this[r].bind(this))}return o}onIncomingObservable(e){const t=j(e.name,this.props.name),{action:n,payload:r,srcElement:o}=e.data,s=t=>({clone:()=>{return t=e.data,d([t,{action:i("action",t)},i("payload",t),i("srcElement",t)]);var t},action:n,payload:r,srcElement:o,event:t});return!0===t?(e=>e.observable.pipe(dr(s)).subscribe(this.getActionMethodForObservable(e)))(e):void 0}onViewStreamInfo(e){}sendChannelPayload(e,t,n={},r={},o=this.observer$){const i=new nt(this.props.name,e,t,n,r);o.next(i)}getChannel(e,t){return I((e=>Ze().includes(e)),(e=>{const n=this.streamsController.getStream(e).observer;return void 0!==t?n.pipe(fr(t)):n}),(e=>console.warn(`channel name ${e} is not within ${Ze}`)))(e)}static checkForNotTrackFlag(e={}){!0===e.doNotTrack&&Je.doNotTrackChannel(e.channelName)}}class Br{constructor(){this.checkIfObjIsNotEmptyOrNil=Br.checkIfObjIsNotEmptyOrNil.bind(this)}static checkIfObjIsNotEmptyOrNil(t){const n=e(y(b),m,S),o=e(y(v),m,S);return r([n,o])(t)}static checkIfParamValueMatchesRegex(t,r){const s=L(j("routeName")),a=e(s,o),c=e(W((e=>f(new RegExp(e),t))),a)(r);return n(String,c)&&(r=se(t,i(c,r),r)),r}static formatStrAsWindowLocation(e){return{hash:e,search:e,pathname:e}}static getLocationStrByType(e,t=!1,n=window.location){return i({slash:"pathname",query:"search",hash:"hash"}[!0===t?"hash":e],n).replace(/^(\/)?(#)?(\/)?(.*)$/,"$4")}static createRouteArrayFromParams(e,t,r="slash",o){const s=[],a=t=>{const r={},c=t.routeName;let l=void 0!==e[c]?e[c]:i(c,o);const d=typeof t[l];"string"===d?l=t[l]:"undefined"===d&&(t=this.checkIfParamValueMatchesRegex(l,t)),r[c]=l,this.checkIfObjIsNotEmptyOrNil(r)&&s.push(r);const u=n(Object,t),h=Ne(l,t),E=Ne("routePath",t);if(!0===(h&&u)){const e=t[l];Ne("routePath",e)&&a(e.routePath)}else!0===E&&void 0!==l&&a(t.routePath)};return a(t),s}static createSlashString(t){const n=L(v),r=ae(y(v,T),ce("/")),o=le(/^(\^*)(.*|^\$)(\$)$/,"$2");return e(o,r,n,$,k(S))(t)}static createQueryString(t){const n=L(v),r=this.checkIfObjIsNotEmptyOrNil,o=e(ce("="),$,c),i=I(r,o,F(void 0)),s=k(i),a=ae(y(b),A("?"));return e(a,ce("&"),n,s)(t)}static checkPayloadForRegexOverrides(t,n,r="Value"){const s=e((e=>i(`${e}${r}`,n)),m,o);return k((t=>{const n=s(t);return void 0!==n?se(e(m,o)(t),n,t):t}),t)}static checkForRouteValWithMultipleVals(e){const t=e=>{const t=(t,n)=>(t[n]=(e=>{const t=e.match(/^[^|]*/);return t?"^$"===t[0]?"":t[0]:e})(e[n]),t);return"object"==typeof e&&(e=Object.keys(e).reduce(t,{})),e};return!0===Array.isArray(e)?e.map(t):e}static checkForRouteValsPartMatch(e,t={}){const n=(e,t)=>t.split("|").some((t=>((e,t)=>{const n=e.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,"[\\w\\d_-]*");return new RegExp(`^${n}$`).test(t)})(t,e)))?e:t;return e.map((e=>{const r={...e};return Object.keys(r).forEach((e=>{Object.prototype.hasOwnProperty.call(r,e)&&t[e]&&(r[e]=n(t[e],r[e]))})),r}))}static convertParamsToRoute(e,t=Je.config.channels.ROUTE,n,r){const o=void 0!==n?n:t.type,i=t.isHash,s=t.routes.routePath,a=void 0!==r?r:this.getLocationStrByType(o,i),c=this.convertRouteToParams(a,t,o).routeData;let l=this.createRouteArrayFromParams(e,s,o,c);return l=Br.checkPayloadForRegexOverrides(l,e),l=Br.checkForRouteValWithMultipleVals(l),"query"===o?this.createQueryString(l):this.createSlashString(l)}static findIndexOfMatchedStringOrRegex(t,n){const r=le(/^$/,"^$"),o=Q(ee(t,"str"),e(f(T,t),i("re")));return e(de(j(!0)),k(o),k((e=>{return{str:e,re:(t=e,new RegExp(t))};var t})),k(r))(n)}static checkIfValueShouldMapToParam(t,r,o){const s=e(k(ue),k(_(n(String))),c)(t),a=Br.findIndexOfMatchedStringOrRegex(r,s);let l=r;if(a>=0){const r=s[a],o=he(t),c=e(m,p([]),i(r))(o);!0===/^([-$\w]*)$/.test(c)&&!0===n(String,c)&&(l=c)}return l}static createArrFromSlashStr(e){return e.replace(/^([/])?(.*)$/,"$2").split("/")}static convertSlashRouteStrToParamsObj(e,t,n){const r=t,o=this.createArrFromSlashStr(t),i=[],a=[];let c=e;Ee(((e,t)=>{const r=this.checkIfValueShouldMapToParam(c,t,n);c=this.checkIfParamValueMatchesRegex(t,c);const o=Q(b,v);void 0!==c&&(e=>e!==ue(i))(c.routeName)&&!1===o(r)&&(i.push(c.routeName),a.push(r));const l=s([t,"routePath"],c),d=s(["routePath"],c);void 0!==l?c=l:void 0!==d&&(c=d)}),0,o);const l=pe(i,a),d=this.getLastArrVal(i);return{paths:i,pathInnermost:d,routeData:l,routeValue:r}}static getLastArrVal(e){return void 0!==ue(t=e)?ue(t):"";var t}static createDefaultParamFromEmptyStr(e,t){const n={};return n[e.routeName]=this.checkIfValueShouldMapToParam(e,t),n}static convertQueryStrToParams(t,n,r){const i=n,s=n.replace(/^([?])?(.*)$/,"$2"),c=e(k(B("=")),B("&"))(s);let l=a(c),d=k(m,c);!0===b(n)&&(l=this.createDefaultParamFromEmptyStr(t,n,r),d=o(l));return{paths:d,pathInnermost:this.getLastArrVal(d),routeData:l,routeValue:i}}static convertRouteToParams(e,t,n){if(void 0===t)return{};const r=void 0!==n?n:t.type,o=p({},i("regexTokens",t)),s=t.routes.routePath;return"query"===r?this.convertQueryStrToParams(s,e):(e=e.replace(/\/$|$/,"/"),this.convertSlashRouteStrToParamsObj(s,e,o))}}class Kr{constructor(){this.createPopStateStream=Kr.createPopStateStream.bind(this)}static createPopStateStream(e){we((function(e){window.onpopstate=e}),(function(){window.onpopstate=function(){}})).subscribe(e)}static getLastArrVal(e){return void 0!==ue(t=e)?ue(t):"";var t}static compareRouteKeywords(t={},n){const r=(e,t)=>void 0!==t?R(t,e):e;let s=r(t,n);return{pickValues:r,compare:(t={},n)=>{const a=r(t,n),c=t=>e(o,_(ee(!0,t))),l=e(k((e=>{const t=i(e,s),n=i(e,a),r=j(t,n),o=void 0!==t,c=void 0!==n,l=!r,d=!1===o&&!0===c,u=!0===o&&!1===c,h={};return h[e]={same:r,changed:l,added:d,removed:u,previousExists:o,nextExists:c},h})),g,ne(o))([s,a]),d=ne(c("changed"),l),u=ne(c("added"),l),h=ne(c("removed"),l);return s=a,{pathsAdded:u,pathsRemoved:h,pathsChanged:d}},getComparer:()=>s}}static getRouteArrData(e,t){const n=_(u(T,e),t);return{paths:n,pathInnermost:Kr.getLastArrVal(n)}}static flattenConfigObject(e){const t=e=>ne((([e,n])=>"[object Object]"===Object.prototype.toString.call(n)?k((([t,n])=>[`${e}.${t}`,n]),t(n)):[[e,n]]),c(e));return S(a(t(e)))}static addRouteDatasets(t){const{type:r,isHash:a}=t,d=e=>{const n="query"===r?"":!0===a?"#":"/",o=Br.convertParamsToRoute(e,t);return n+o.replace(/^(.*\/)([\w-]*\/?)(.*)$/gm,"$1$2")},h=/^([A-Za-z0-9_-])+$/m,E=(e=[],t,r={})=>{let{routeName:a}=t;return c(t).reduce(((t,c)=>{const[u,p]=c,N=n(Object,p),m=e=>f(h,e)?(e=>String(e).replace(/([-_])/g," ").toUpperCase())(e):u;if("routeName"===u||"404"===u)return t;a=a||i("routeName",p);let _=l(r);if(_[a]=String(u).replace(/([^A-Za-z0-9-_])/g,""),!0===N){if(1===o(_).length){const e=s(["routePath","routeName"],p);if(e){const n=l(_);n[e]="",n.navLevel=o(r).length,n.title=m(u),n.href=d(n),t.push(n)}}_=E(e,p,_)}else _.title=m(u),_.href=d(_);return _.navLevel=o(r).length,t.push(_),t}),[])},p=E([],t.routes),N=$(p);return{routeDatasetsArr:N,routeNamesArr:(t=>{const n=L(u(T,["title","href","navLevel"]));return e(g,n,$,k(o))(t)})(N)}}static conformRouteObject(t={},r=!1){const o=s(["channels","ROUTE"],t);let{add404s:i}=void 0!==o?o:t;i=i||r;const l=e=>{const t=e[1],r=n(Array,t);return""===t?e[1]="^$":r&&(e[1]=t.join("|")),e},d=e(a,k((t=>{const[r,o]=t,s=i?{404:".+"}:{},u=n(Object,o),h=n(Array,o),E="routePath"===r;return!0===u&&!1===h&&(t[1]=d(t[1]),E&&(t[1]=e(me(s),a,k(l),c)(t[1]))),t})),c);if(void 0!==o){t.channels.ROUTE=d(t.channels.ROUTE);const e=Kr.addRouteDatasets(t.channels.ROUTE);return t.channels.ROUTE=V(t.channels.ROUTE,e),t}return d(t)}static getLocationData(){return h(["href","origin","protocol","host","hostname","port","pathname","search","hash"],window.location)}}class qr extends Yr{constructor(e="CHANNEL_ROUTE",t={}){t.sendCachedPayload=!0,super("CHANNEL_ROUTE",t),this.createChannelActionsObj(),this.routeConfigJson=this.getRouteConfig(),this.bindStaticMethods(),this.navToStream$=new He(1),this.observer$=this.navToStream$.pipe(dr((e=>this.onMapNext(e)))),this.compareRouteKeywords=Kr.compareRouteKeywords()}checkConfigForHash(){!0===("hash"===Je.config.channels.ROUTE.type)&&(Je.config.channels.ROUTE.type="slash",Je.config.channels.ROUTE.isHash=!0)}onRegistered(){this.checkConfigForHash(),this.initStream()}createChannelActionsObj(){const e=this.addRegisteredActions(),t=d(ne((e=>re(e,e)),e));this.channelActions=t}addRegisteredActions(){return["CHANNEL_ROUTE_DEEPLINK_EVENT","CHANNEL_ROUTE_CHANGE_EVENT","CHANNEL_ROUTE_CONFIG_UPDATED_EVENT",["CHANNEL_ROUTE_UPDATE_CONFIG_EVENT","updateRouteConfig"]]}updateRouteConfig(e){const t=R(["isHash","isHidden","routes","type"],e.payload);Je.config.channels.ROUTE=V(Je.config.channels.ROUTE,t),Je.conformRouteConfig();const n=this.getRouteConfig();this.routeConfigJson=n,this.bindStaticMethodsWithConfigData(),this.sendChannelPayload("CHANNEL_ROUTE_CONFIG_UPDATED_EVENT",n,{},{},this.navToStream$)}getRouteConfig(){const e=Je.config,t=s(["channels","ROUTE"],e);"query"===t.type&&(t.isHash=!1);const n=Kr.flattenConfigObject(t.routes);return t.paramsArr=n,t}initStream(){this.firstLoadStream$=new He(1),this.onIncomingDomEvent(void 0,this.routeConfigJson,"CHANNEL_ROUTE_DEEPLINK_EVENT"),Kr.createPopStateStream(this.onIncomingDomEvent.bind(this)),this.observer$=Ve(this.firstLoadStream$,this.navToStream$)}onMapNext(e,t=!1){return e.action="CHANNEL_ROUTE_CHANGE_EVENT",e}static removeSSID(e){const t=_e(["routeData"]);return fe(t,x(["vsid"]))(e)}static onIncomingDomEvent(e,t=this.routeConfigJson,r){const o=void 0!==r?r:this.channelActions.CHANNEL_ROUTE_CHANGE_EVENT,a=s(["state","routeCount"],e),c=!0===n(Number,a);let l=this.getDataFromString(t,c);!0===c&&(l.routeCount=a),"CHANNEL_ROUTE_DEEPLINK_EVENT"===r&&(l.linksData=i("routeDatasetsArr",t));const d=this.compareRouteKeywords.compare(l.routeData,l.paths);l=V(l,d),this.sendChannelPayload(o,l,void 0,e,this.navToStream$)}static checkForRouteParamsOverrides(e){return e}static checkForEventMethods(t){const n=e(_(f(/^(event)([A-Z].*)([A-Z].*)$/gm)),o,i("payload"))(t);if(n.length>=1){const e=i("event",t);if(void 0!==e){const t=le(/^(event)([A-Z])(.*)([A-Z].*)$/gm,((e,t,n,r,o)=>String(n).toLowerCase()+r+o)),r=n=>{const r=t(n);void 0!==e[r]&&e[r]()};n.forEach(r)}}return t}static checkForEndRoute(t,r=this.routeConfigJson,a){if(!0!==e(j("true"),s(["payload","endRoute"]))(t))return t;const l=void 0!==a?a:!0===Je.debug,{payload:d}=t;let u=0;const h=(t=[],r)=>{const s=r[1],{routePath:a}=s,E=i("routeName",a),p=(t=>{const n=i("routeName",t);if(n){const r=e(o,x(["routeName"]))(t),i=d[n];return W((e=>new RegExp(`^${e}$`).test(i)),r)}})(a),N=n(Object,s),m=n(Array,s);if(u+=1,!0===N&&!1===m){const n=a[p];n?e(Te,Ee(h,t),c)({nextRoutePath:n}):1===u?l&&console.warn(`Spyne Warning: use of end route method should add start route value of "${E}".`):t.push(E)}return t},{routes:E}=r,p=e(Te,Ee(h,[]),c)({routes:E});if(1===p.length){const e=p[0];t.payload[e]=""}return t}onViewStreamInfo(e){const t=this.channelActions.CHANNEL_ROUTE_CHANGE_EVENT;qr.checkForEventMethods(e),e=this.checkForEndRoute(e);let n=this.getDataFromParams(e);const r=i("srcElement",e),o=i("event",e),s=!n.isHidden,a=this.compareRouteKeywords.compare(n.routeData,n.paths);n=V(n,a),this.sendRouteStream(n,s),n=qr.removeSSID(n),this.sendChannelPayload(t,n,r,o,this.navToStream$)}static checkAndConvertStrWithRegexTokens(e,t){return o(t)}sendRouteStream(e,t=!0){!0===t&&this.setWindowLocation(e)}static getRouteState(){return"CHANNEL_ROUTE_CHANGE_EVENT"}static getIsDeepLinkBool(e){return!1===e&&0===this._routeCount}static getRouteCount(e=!1){return void 0===this._routeCount?(this._routeCount=0,this._routeCount):(!1===e&&(this._routeCount+=1),this._routeCount)}static getExtraPayloadParams(e=this.routeConfigJson,t=!1){return{routeCount:this.getRouteCount(t),isDeepLink:this.getIsDeepLinkBool(t),isHash:e.isHash,isHistory:t,isHidden:e.isHidden,routeType:e.type}}static getDataFromParams(e,t=this.routeConfigJson){let n=i("payload",e);const r=this.getRouteStrFromParams(n,t),o=(e,n)=>p(n,i(e,t)),s=o("type","slash"),a=o("isHash",!1),c=Br.formatStrAsWindowLocation(r),l=this.getDataFromLocationStr(s,a,c),{pathInnermost:d,paths:u}=l;n=V(l.routeData,n);const{routeCount:h,isDeepLink:E,isHash:N,isHistory:m,isHidden:_,routeType:f}=this.getExtraPayloadParams(t);return{isDeepLink:E,routeCount:h,pathInnermost:d,paths:u,routeData:n,routeValue:r,isHash:N,isHidden:_,isHistory:m,routeType:f}}static getDataFromString(e=this.routeConfigJson,t=!1){const n=e.type,r=!0===e.isHash,o=Br.getLocationStrByType(n,r),{paths:i,pathInnermost:s,routeData:a,routeValue:c}=qr.getParamsFromRouteStr(o,e,n),{routeCount:l,isDeepLink:d,isHash:u,routeType:h,isHidden:E}=this.getExtraPayloadParams(e,t);return{isDeepLink:d,routeCount:l,pathInnermost:s,paths:i,routeData:a,routeValue:c,isHash:u,isHidden:E,isHistory:t,routeType:h}}static getDataFromLocationStr(e="slash",t=this.routeConfigJson.isHash,n=window.location){const r=void 0!==this.routeConfigJson?this.routeConfigJson.type:e,o=Br.getLocationStrByType(r,t,n),{paths:i,pathInnermost:s,routeData:a,routeValue:c}=this.getParamsFromRouteStr(o,this.routeConfigJson,r);return{paths:i,pathInnermost:s,routeData:a,routeValue:c,action:this.getRouteState()}}static getLocationData(){return h(["href","origin","protocol","host","hostname","port","pathname","search","hash"],window.location)}static getRouteStrFromParams(e,t,n){const r=void 0!==n?n:t.type;return Br.convertParamsToRoute(e,t,r)}static getParamsFromRouteStr(e,t,n){const r=void 0!==n?n:t.type;return Br.convertRouteToParams(e,t,r)}checkEmptyRouteStr(e,t=!1){const n=b(e);return!0===(!0===n&&!1===t)||!0===(!0===n&&!0===t)?"/":!0===(!1===n&&!0===t)?A("#",e):e}static removeLastSlash(e){return e.replace(/^(.*)(\/)$/,"$1")}setWindowLocation(t){let{isHash:n,routeValue:r,routeType:o}=t;r=this.checkEmptyRouteStr(r,n);const{routeCount:i}=t;if(!0===n||"query"===o){r=qr.removeLastSlash(window.location.pathname)+r,window.history.pushState({routeCount:i},"",r)}else{const t=ae(e(y(j("/")),m),A("/",T));window.history.pushState({routeCount:i},"",t(r))}}getWindowLocation(){return window.location.pathname}bindStaticMethods(){this.checkForEndRoute=qr.checkForEndRoute.bind(this),this.getIsDeepLinkBool=qr.getIsDeepLinkBool.bind(this),this.getDataFromLocationStr=qr.getDataFromLocationStr.bind(this),this.onIncomingDomEvent=qr.onIncomingDomEvent.bind(this),this.getDataFromString=qr.getDataFromString.bind(this),this.getParamsFromRouteStr=qr.getParamsFromRouteStr.bind(this),this.getLocationData=qr.getLocationData.bind(this),this.getRouteState=qr.getRouteState.bind(this),this.getDataFromParams=qr.getDataFromParams.bind(this),this.getRouteCount=qr.getRouteCount.bind(this),this.getExtraPayloadParams=qr.getExtraPayloadParams.bind(this),this.bindStaticMethodsWithConfigData()}bindStaticMethodsWithConfigData(){const e=Ae(3,qr.getRouteStrFromParams);this.getRouteStrFromParams=e(T,this.routeConfigJson,this.routeConfigJson.type)}}class Xr extends Yr{constructor(e="CHANNEL_UI",t={}){t.sendCachedPayload=!1,super(e,t),this.keyEventsLoaded=!1,this.keyCodeArr=[]}addRegisteredActions(){return["CHANNEL_UI_DOMCONTENTLOADED_EVENT","CHANNEL_UI_ABORT_EVENT","CHANNEL_UI_ACTIVATE_EVENT","CHANNEL_UI_ADDTRACK_EVENT","CHANNEL_UI_AFTERPRINT_EVENT","CHANNEL_UI_AFTERSCRIPTEXECUTE_EVENT","CHANNEL_UI_ANIMATIONCANCEL_EVENT","CHANNEL_UI_ANIMATIONEND_EVENT","CHANNEL_UI_ANIMATIONITERATION_EVENT","CHANNEL_UI_ANIMATIONSTART_EVENT","CHANNEL_UI_APPINSTALLED_EVENT","CHANNEL_UI_AUDIOEND_EVENT","CHANNEL_UI_AUDIOSTART_EVENT","CHANNEL_UI_AUXCLICK_EVENT","CHANNEL_UI_BEFOREINPUT_EVENT","CHANNEL_UI_BEFOREPRINT_EVENT","CHANNEL_UI_BEFOREUNLOAD_EVENT","CHANNEL_UI_BEGINEVENT_EVENT","CHANNEL_UI_BLOCKED_EVENT","CHANNEL_UI_BLUR_EVENT","CHANNEL_UI_BOUNDARY_EVENT","CHANNEL_UI_BUFFEREDAMOUNTLOW_EVENT","CHANNEL_UI_CANCEL_EVENT","CHANNEL_UI_CANPLAY_EVENT","CHANNEL_UI_CANPLAYTHROUGH_EVENT","CHANNEL_UI_CHANGE_EVENT","CHANNEL_UI_CLICK_EVENT","CHANNEL_UI_CLOSE_EVENT","CHANNEL_UI_CLOSING_EVENT","CHANNEL_UI_COMPLETE_EVENT","CHANNEL_UI_COMPOSITIONEND_EVENT","CHANNEL_UI_COMPOSITIONSTART_EVENT","CHANNEL_UI_COMPOSITIONUPDATE_EVENT","CHANNEL_UI_CONNECT_EVENT","CHANNEL_UI_CONNECTIONSTATECHANGE_EVENT","CHANNEL_UI_CONTENTDELETE_EVENT","CHANNEL_UI_CONTEXTMENU_EVENT","CHANNEL_UI_COPY_EVENT","CHANNEL_UI_CUECHANGE_EVENT","CHANNEL_UI_CUT_EVENT","CHANNEL_UI_DATACHANNEL_EVENT","CHANNEL_UI_DBLCLICK_EVENT","CHANNEL_UI_DEVICECHANGE_EVENT","CHANNEL_UI_DEVICEMOTION_EVENT","CHANNEL_UI_DEVICEORIENTATION_EVENT","CHANNEL_UI_DRAG_EVENT","CHANNEL_UI_DRAGEND_EVENT","CHANNEL_UI_DRAGENTER_EVENT","CHANNEL_UI_DRAGLEAVE_EVENT","CHANNEL_UI_DRAGOVER_EVENT","CHANNEL_UI_DRAGSTART_EVENT","CHANNEL_UI_DROP_EVENT","CHANNEL_UI_DURATIONCHANGE_EVENT","CHANNEL_UI_EMPTIED_EVENT","CHANNEL_UI_END_EVENT","CHANNEL_UI_ENDEVENT_EVENT","CHANNEL_UI_ENDED_EVENT","CHANNEL_UI_ENTERPICTUREINPICTURE_EVENT","CHANNEL_UI_ERROR_EVENT","CHANNEL_UI_FOCUS_EVENT","CHANNEL_UI_FOCUSIN_EVENT","CHANNEL_UI_FOCUSOUT_EVENT","CHANNEL_UI_FORMDATA_EVENT","CHANNEL_UI_FULLSCREENCHANGE_EVENT","CHANNEL_UI_FULLSCREENERROR_EVENT","CHANNEL_UI_GAMEPADCONNECTED_EVENT","CHANNEL_UI_GAMEPADDISCONNECTED_EVENT","CHANNEL_UI_GATHERINGSTATECHANGE_EVENT","CHANNEL_UI_GESTURECHANGE_EVENT","CHANNEL_UI_GESTUREEND_EVENT","CHANNEL_UI_GESTURESTART_EVENT","CHANNEL_UI_GOTPOINTERCAPTURE_EVENT","CHANNEL_UI_HASHCHANGE_EVENT","CHANNEL_UI_ICECANDIDATE_EVENT","CHANNEL_UI_ICECANDIDATEERROR_EVENT","CHANNEL_UI_ICECONNECTIONSTATECHANGE_EVENT","CHANNEL_UI_ICEGATHERINGSTATECHANGE_EVENT","CHANNEL_UI_INPUT_EVENT","CHANNEL_UI_INPUTSOURCESCHANGE_EVENT","CHANNEL_UI_INSTALL_EVENT","CHANNEL_UI_INVALID_EVENT","CHANNEL_UI_KEYDOWN_EVENT","CHANNEL_UI_KEYUP_EVENT","CHANNEL_UI_LANGUAGECHANGE_EVENT","CHANNEL_UI_LEAVEPICTUREINPICTURE_EVENT","CHANNEL_UI_LOAD_EVENT","CHANNEL_UI_LOADEDDATA_EVENT","CHANNEL_UI_LOADEDMETADATA_EVENT","CHANNEL_UI_LOADEND_EVENT","CHANNEL_UI_LOADSTART_EVENT","CHANNEL_UI_LOSTPOINTERCAPTURE_EVENT","CHANNEL_UI_MARK_EVENT","CHANNEL_UI_MERCHANTVALIDATION_EVENT","CHANNEL_UI_MESSAGE_EVENT","CHANNEL_UI_MESSAGEERROR_EVENT","CHANNEL_UI_MOUSEDOWN_EVENT","CHANNEL_UI_MOUSEENTER_EVENT","CHANNEL_UI_MOUSELEAVE_EVENT","CHANNEL_UI_MOUSEMOVE_EVENT","CHANNEL_UI_MOUSEOUT_EVENT","CHANNEL_UI_MOUSEOVER_EVENT","CHANNEL_UI_MOUSEUP_EVENT","CHANNEL_UI_MUTE_EVENT","CHANNEL_UI_NEGOTIATIONNEEDED_EVENT","CHANNEL_UI_NOMATCH_EVENT","CHANNEL_UI_NOTIFICATIONCLICK_EVENT","CHANNEL_UI_OFFLINE_EVENT","CHANNEL_UI_ONLINE_EVENT","CHANNEL_UI_OPEN_EVENT","CHANNEL_UI_ORIENTATIONCHANGE_EVENT","CHANNEL_UI_PAGEHIDE_EVENT","CHANNEL_UI_PAGESHOW_EVENT","CHANNEL_UI_PASTE_EVENT","CHANNEL_UI_PAUSE_EVENT","CHANNEL_UI_PAYERDETAILCHANGE_EVENT","CHANNEL_UI_PAYMENTMETHODCHANGE_EVENT","CHANNEL_UI_PLAY_EVENT","CHANNEL_UI_PLAYING_EVENT","CHANNEL_UI_POINTERCANCEL_EVENT","CHANNEL_UI_POINTERDOWN_EVENT","CHANNEL_UI_POINTERENTER_EVENT","CHANNEL_UI_POINTERLEAVE_EVENT","CHANNEL_UI_POINTERLOCKCHANGE_EVENT","CHANNEL_UI_POINTERLOCKERROR_EVENT","CHANNEL_UI_POINTERMOVE_EVENT","CHANNEL_UI_POINTEROUT_EVENT","CHANNEL_UI_POINTEROVER_EVENT","CHANNEL_UI_POINTERUP_EVENT","CHANNEL_UI_POPSTATE_EVENT","CHANNEL_UI_PROGRESS_EVENT","CHANNEL_UI_PUSH_EVENT","CHANNEL_UI_PUSHSUBSCRIPTIONCHANGE_EVENT","CHANNEL_UI_RATECHANGE_EVENT","CHANNEL_UI_READYSTATECHANGE_EVENT","CHANNEL_UI_REJECTIONHANDLED_EVENT","CHANNEL_UI_REMOVETRACK_EVENT","CHANNEL_UI_REMOVESTREAM_EVENT","CHANNEL_UI_REPEATEVENT_EVENT","CHANNEL_UI_RESET_EVENT","CHANNEL_UI_RESIZE_EVENT","CHANNEL_UI_RESOURCETIMINGBUFFERFULL_EVENT","CHANNEL_UI_RESULT_EVENT","CHANNEL_UI_RESUME_EVENT","CHANNEL_UI_SCROLL_EVENT","CHANNEL_UI_SEARCH_EVENT","CHANNEL_UI_SEEKED_EVENT","CHANNEL_UI_SEEKING_EVENT","CHANNEL_UI_SELECT_EVENT","CHANNEL_UI_SELECTEDCANDIDATEPAIRCHANGE_EVENT","CHANNEL_UI_SELECTEND_EVENT","CHANNEL_UI_SELECTIONCHANGE_EVENT","CHANNEL_UI_SELECTSTART_EVENT","CHANNEL_UI_SHIPPINGADDRESSCHANGE_EVENT","CHANNEL_UI_SHIPPINGOPTIONCHANGE_EVENT","CHANNEL_UI_SIGNALINGSTATECHANGE_EVENT","CHANNEL_UI_SLOTCHANGE_EVENT","CHANNEL_UI_SOUNDEND_EVENT","CHANNEL_UI_SOUNDSTART_EVENT","CHANNEL_UI_SPEECHEND_EVENT","CHANNEL_UI_SPEECHSTART_EVENT","CHANNEL_UI_SQUEEZE_EVENT","CHANNEL_UI_SQUEEZEEND_EVENT","CHANNEL_UI_SQUEEZESTART_EVENT","CHANNEL_UI_STALLED_EVENT","CHANNEL_UI_START_EVENT","CHANNEL_UI_STATECHANGE_EVENT","CHANNEL_UI_STORAGE_EVENT","CHANNEL_UI_SUBMIT_EVENT","CHANNEL_UI_SUCCESS_EVENT","CHANNEL_UI_SUSPEND_EVENT","CHANNEL_UI_TIMEOUT_EVENT","CHANNEL_UI_TIMEUPDATE_EVENT","CHANNEL_UI_TOGGLE_EVENT","CHANNEL_UI_TONECHANGE_EVENT","CHANNEL_UI_TOUCHCANCEL_EVENT","CHANNEL_UI_TOUCHEND_EVENT","CHANNEL_UI_TOUCHMOVE_EVENT","CHANNEL_UI_TOUCHSTART_EVENT","CHANNEL_UI_TRACK_EVENT","CHANNEL_UI_TRANSITIONCANCEL_EVENT","CHANNEL_UI_TRANSITIONEND_EVENT","CHANNEL_UI_TRANSITIONRUN_EVENT","CHANNEL_UI_TRANSITIONSTART_EVENT","CHANNEL_UI_UNHANDLEDREJECTION_EVENT","CHANNEL_UI_UNLOAD_EVENT","CHANNEL_UI_UNMUTE_EVENT","CHANNEL_UI_UPGRADENEEDED_EVENT","CHANNEL_UI_VERSIONCHANGE_EVENT","CHANNEL_UI_VISIBILITYCHANGE_EVENT","CHANNEL_UI_VOICESCHANGED_EVENT","CHANNEL_UI_VOLUMECHANGE_EVENT","CHANNEL_UI_VRDISPLAYACTIVATE_EVENT","CHANNEL_UI_VRDISPLAYBLUR_EVENT","CHANNEL_UI_VRDISPLAYCONNECT_EVENT","CHANNEL_UI_VRDISPLAYDEACTIVATE_EVENT","CHANNEL_UI_VRDISPLAYDISCONNECT_EVENT","CHANNEL_UI_VRDISPLAYFOCUS_EVENT","CHANNEL_UI_VRDISPLAYPOINTERRESTRICTED_EVENT","CHANNEL_UI_VRDISPLAYPOINTERUNRESTRICTED_EVENT","CHANNEL_UI_VRDISPLAYPRESENTCHANGE_EVENT","CHANNEL_UI_WAITING_EVENT","CHANNEL_UI_WEBGLCONTEXTCREATIONERROR_EVENT","CHANNEL_UI_WEBGLCONTEXTLOST_EVENT","CHANNEL_UI_WEBGLCONTEXTRESTORED_EVENT","CHANNEL_UI_WEBKITMOUSEFORCECHANGED_EVENT","CHANNEL_UI_WEBKITMOUSEFORCEDOWN_EVENT","CHANNEL_UI_WEBKITMOUSEFORCEUP_EVENT","CHANNEL_UI_WEBKITMOUSEFORCEWILLBEGIN_EVENT","CHANNEL_UI_WHEEL_EVENT"]}loadKeyStream(){const e=Ie.fromEvent(document,"keyup");this.keyPresses$=e.groupBy((e=>e.keyCode)).mergeAll().filter((e=>this.keyCodeArr.indexOf(e.keyCode)>=0)).repeat().subscribe(this.onKeyPressed.bind(this))}addKeyEvent(e){!1===this.keyEventsLoaded&&this.loadKeyStream(),this.keyEventsLoaded=!0,this.registerKey(e)}registerKey(e){this.keyCodeArr.push(e)}onKeyPressed(e){}static removeSSID(e){const t=_e(["payload"]);return fe(t,x(["vsid"]))(e)}onIncomingObservable(e){const t=j(e.name,this.props.name);e.data=Xr.removeSSID(e.data);const{payload:n,srcElement:r}=e.data,o=e=>({payload:n,srcElement:r,event:e});return!0===t?(e=>e.observable.pipe(dr(o)).subscribe(this.onUIEvent.bind(this)))(e):void 0}getActionState(t){const n=s(["event","type"]),r=s(["event","typeOverRide"]),o=e(Ce,Q(r,n))(t),i="CHANNEL_UI";return void 0!==o?`${i}_${o}_EVENT`:i}static checkForEventMethods(t){const n=e(_(f(/^(event)([A-Z].*)([A-Z].*)$/gm)),o,i("payload"))(t);if(n.length>=1){const e=i("event",t);if(void 0!==e){const t=le(/^(event)([A-Z])(.*)([A-Z].*)$/gm,((e,t,n,r,o)=>String(n).toLowerCase()+r+o)),r=n=>{const r=t(n);void 0!==e[r]&&"function"==typeof e[r]&&e[r]()};n.forEach(r)}}return t}onUIEvent(e){Xr.checkForEventMethods(e),e.action=this.getActionState(e);const t=e.action,{payload:n,srcElement:r}=e,o=e.event;this.sendChannelPayload(t,n,r,o)}}class Qr{constructor(){this.createDomObservableFromEvent=Qr.createDomObservableFromEvent.bind(this)}static createDomObservableFromEvent(e,t,n=!0,r=window){return t=void 0===t?e=>e:t,we((t=>r.addEventListener(e,t,{passive:n})),(()=>{r[e]=e=>e})).pipe(dr(t))}static createMediaQuery(e){const t=window.matchMedia(e);return this.checkIfValidMediaQuery(t,e),!1!==t&&t}static checkIfValidMediaQuery(e,t){const n=e=>e.replace(/\s+/gm,""),r=void 0!==e.matches&&n(e.media).indexOf(n(t))>=0;return!1===r&&(t=>{console.warn(`Spyne Info: the following query string, "${t}", has been optimized to "${e.media}" by the browser and may not be a valid Media Query item!`)})(t),r}static createMediaQueryHandler(e,t){const n=(e=>t=>(t.mediaQueryName=e,t))(t),r=(o=e,{addHandler:e=>{o.addListener(e)},removeHandler:e=>{o.onchange=()=>{}}});var o;return new we(r.addHandler,r.removeHandler).pipe(dr(n))}static createMergedObsFromObj(e){const t=e.mediaQueries||e.mediaQueries,n=[];return O(((e,t,r)=>{const o=Qr.createMediaQuery(e);return!1!==o&&n.push(Qr.createMediaQueryHandler(o,t)),n}),t),n}}class Jr extends Yr{constructor(e="CHANNEL_WINDOW"){super(e),this.bindStaticMethods(),this.currentScrollY=0}initializeStream(){this.domChannelConfig=Je.config.channels.WINDOW;const e=this.getActiveObservables(),t=Ve(...e);this.dom$=t,t.subscribe((e=>{const{action:t,payload:n,srcElement:r,event:o}=e;this.sendChannelPayload(t,n,r,o)}))}static getMouseWheelMapFn(e){const t=this.channelActions.CHANNEL_WINDOW_WHEEL_EVENT,n=e.deltaY<=0?"up":"down",{deltaX:r,deltaY:o,deltaZ:i}=e;return{action:t,payload:{scrollDir:n,deltaX:r,deltaY:o,deltaZ:i},srcElement:e.srcElement,event:e}}static createCurriedGenericEvent(e){const t=`CHANNEL_WINDOW_${e.toUpperCase()}_EVENT`;return z(Jr.mapGenericEvent)(t)}static mapGenericEvent(e,t){return{action:e,payload:t,srcElement:t.srcElement,event:t}}static getResizeMapFn(e){return{action:this.channelActions.CHANNEL_WINDOW_RESIZE_EVENT,payload:R(["innerWidth","innerHeight","outerWidth","outerHeight"],window),srcElement:e.srcElement,event:e}}static getOrientationMapFn(e){const t=this.channelActions.CHANNEL_WINDOW_ORIENTATION_EVENT,n=window.matchMedia("(orientation: portrait)").matches,r=R(["innerWidth","innerHeight","outerWidth","outerHeight"],window);r.orientation=!0===n?"portrait":"landscape";return{action:t,payload:r,srcElement:e.srcElement,event:e}}getMediaQueryMapFn(e){return{action:this.channelActions.CHANNEL_WINDOW_MEDIA_QUERY_EVENT,payload:R(["matches","media","mediaQueryName"],e),srcElement:e.srcElement,event:e}}createMouseWheelObservable(e){const t=e.debounceMSTimeForScroll;return Qr.createDomObservableFromEvent("wheel",Jr.getMouseWheelMapFn.bind(this)).pipe(_r(t))}static getScrollData(){let e=0;return t=>{const n=e-t;return e=t,{scrollY:t,scrollDistance:n,scrollDir:n>=0?"up":"down"}}}static getScrollY(e){return void 0!==e.pageYOffset?e.pageYOffset:e.scrollTop}static getScrollMapFn(e,t,n,r,o){const i=r(Jr.getScrollY(o)),{scrollDistance:s}=i;return{action:n,payload:i,srcElement:e.srcElement,scrollDistance:s,event:e}}createScrollObservable(e,t=window,n=!0){const r=e.debounceMSTimeForScroll,o=t,i=t===window,s=void 0!==e.scrollElForVals?e.scrollElForVals:t,a=i?"CHANNEL_WINDOW_SCROLL_EVENT":"CHANNEL_WINDOW_ELEMENT_SCROLL_EVENT",c=Jr.getScrollData(),l=ge(Jr.getScrollMapFn,[a,c,s,n,o]).bind(this);return Qr.createDomObservableFromEvent("scroll",l,n,o).pipe(_r(r),(d=e=>0===e.scrollDistance,fn((function(e,t){var n=!1,r=0;e.subscribe(nr(t,(function(e){return(n||(n=!d(e,r++)))&&t.next(e)})))}))),dr((e=>{const t=Jr.getScrollY(o);return e.payload.scrollDistanceAbs=Math.abs(this.currentScrollY-t),this.currentScrollY=t,e})));var d}createOrientationObservable(e){return Qr.createDomObservableFromEvent("orientationchange",Jr.getOrientationMapFn.bind(this))}createResizeObservable(e){const t=e.debounceMSTimeForResize;return Qr.createDomObservableFromEvent("resize",Jr.getResizeMapFn.bind(this)).pipe(_r(t))}getEventsFromConfig(e=this.domChannelConfig){const t=e.events;return k((e=>{const t=Jr.createCurriedGenericEvent(e);return Qr.createDomObservableFromEvent(e,t)}),t)}getActiveObservables(e=this.domChannelConfig){let t=[];e.listenForMediaQueries=st(e.mediaQueries)||st(e.mediaQueries);const n={listenForResize:this.createResizeObservable.bind(this),listenForOrientation:this.createOrientationObservable.bind(this),listenForScroll:this.createScrollObservable.bind(this),listenForWheel:this.createMouseWheelObservable.bind(this)};O(((n,r,o)=>{e[r]&&t.push(n(e))}),n),this.checkForMediaQueries(e.listenForMediaQueries);const r=this.getEventsFromConfig(e);return t=t.concat(r),t}checkForMediaQueries(e){const t=e=>{const{action:t,payload:n,srcElement:r,event:o}=e;this.sendChannelPayload(t,n,r,o,this.observer$)};!0===e&&this.getMediaQueryObservable(this.domChannelConfig).subscribe(t)}getMediaQueryObservable(e){const t=this.createMergedObsFromObj(e);return Z(Ve,t).pipe(dr(this.getMediaQueryMapFn.bind(this)))}addRegisteredActions(){return["CHANNEL_WINDOW_ABORT_EVENT","CHANNEL_WINDOW_AFTERPRINT_EVENT","CHANNEL_WINDOW_ANIMATIONEND_EVENT","CHANNEL_WINDOW_ANIMATIONITERATION_EVENT","CHANNEL_WINDOW_ANIMATIONSTART_EVENT","CHANNEL_WINDOW_APPINSTALLED_EVENT","CHANNEL_WINDOW_BEFOREPRINT_EVENT","CHANNEL_WINDOW_BEFOREUNLOAD_EVENT","CHANNEL_WINDOW_BEGINEVENT_EVENT","CHANNEL_WINDOW_BLUR_EVENT","CHANNEL_WINDOW_CACHED_EVENT","CHANNEL_WINDOW_CHANGE_EVENT","CHANNEL_WINDOW_CLICK_EVENT","CHANNEL_WINDOW_CLOSE_EVENT","CHANNEL_WINDOW_COMPOSITIONEND_EVENT","CHANNEL_WINDOW_COMPOSITIONSTART_EVENT","CHANNEL_WINDOW_COMPOSITIONUPDATE_EVENT","CHANNEL_WINDOW_COPY_EVENT","CHANNEL_WINDOW_CUT_EVENT","CHANNEL_WINDOW_DBLCLICK_EVENT","CHANNEL_WINDOW_DEVICECHANGE_EVENT","CHANNEL_WINDOW_DEVICELIGHT_EVENT","CHANNEL_WINDOW_DEVICEMOTION_EVENT","CHANNEL_WINDOW_DEVICEORIENTATION_EVENT","CHANNEL_WINDOW_DEVICEPROXIMITY_EVENT","CHANNEL_WINDOW_DOMATTRIBUTENAMECHANGED_EVENT","CHANNEL_WINDOW_DOMATTRMODIFIED_EVENT","CHANNEL_WINDOW_DOMCHARACTERDATAMODIFIED_EVENT","CHANNEL_WINDOW_DOMCONTENTLOADED_EVENT","CHANNEL_WINDOW_DOMCONTENTLOADED_EVENT","CHANNEL_WINDOW_DOMELEMENTNAMECHANGED_EVENT","CHANNEL_WINDOW_DRAGEND_EVENT","CHANNEL_WINDOW_DRAGENTER_EVENT","CHANNEL_WINDOW_DRAGLEAVE_EVENT","CHANNEL_WINDOW_DRAGOVER_EVENT","CHANNEL_WINDOW_DRAGSTART_EVENT","CHANNEL_WINDOW_DRAG_EVENT","CHANNEL_WINDOW_DROP_EVENT","CHANNEL_WINDOW_ELEMENT_SCROLL_EVENT","CHANNEL_WINDOW_ERROR_EVENT","CHANNEL_WINDOW_FOCUSIN_EVENT","CHANNEL_WINDOW_FOCUS_EVENT","CHANNEL_WINDOW_FULLSCREENCHANGE_EVENT","CHANNEL_WINDOW_FULLSCREENERROR_EVENT","CHANNEL_WINDOW_HASHCHANGE_EVENT","CHANNEL_WINDOW_INPUT_EVENT","CHANNEL_WINDOW_INVALID_EVENT","CHANNEL_WINDOW_KEYDOWN_EVENT","CHANNEL_WINDOW_KEYPRESS_EVENT","CHANNEL_WINDOW_KEYUP_EVENT","CHANNEL_WINDOW_LOAD_EVENT","CHANNEL_WINDOW_MEDIA_QUERY_EVENT","CHANNEL_WINDOW_MESSAGE_EVENT","CHANNEL_WINDOW_MOUSEDOWN_EVENT","CHANNEL_WINDOW_MOUSEENTER_EVENT","CHANNEL_WINDOW_MOUSELEAVE_EVENT","CHANNEL_WINDOW_MOUSEMOVE_EVENT","CHANNEL_WINDOW_MOUSEOUT_EVENT","CHANNEL_WINDOW_MOUSEOVER_EVENT","CHANNEL_WINDOW_MOUSEUP_EVENT","CHANNEL_WINDOW_MOUSEWHEEL_EVENT","CHANNEL_WINDOW_OFFLINE_EVENT","CHANNEL_WINDOW_ONLINE_EVENT","CHANNEL_WINDOW_OPEN_EVENT","CHANNEL_WINDOW_ORIENTATION_EVENT","CHANNEL_WINDOW_PAGEHIDE_EVENT","CHANNEL_WINDOW_PAGESHOW_EVENT","CHANNEL_WINDOW_PASTE_EVENT","CHANNEL_WINDOW_POPSTATE_EVENT","CHANNEL_WINDOW_POPSTATE_EVENT","CHANNEL_WINDOW_PROGRESSEVENTS_EVENT","CHANNEL_WINDOW_RESET_EVENT","CHANNEL_WINDOW_RESIZE_EVENT","CHANNEL_WINDOW_SCROLL_ELEMENT_ADDED_EVENT","CHANNEL_WINDOW_SCROLL_EVENT","CHANNEL_WINDOW_SCROLL_LOCK_EVENT",["CHANNEL_WINDOW_SCROLL_LOCK_EVENT","onScrollLockEvent"],["CHANNEL_WINDOW_SET_ELEMENT_TO_SCROLL_EVENT","onSetElementToScroll"],"CHANNEL_WINDOW_STORAGE_EVENT","CHANNEL_WINDOW_SUBMIT_EVENT","CHANNEL_WINDOW_TRANSITIONCANCEL_EVENT","CHANNEL_WINDOW_TRANSITIONEND_EVENT","CHANNEL_WINDOW_TRANSITIONRUN_EVENT","CHANNEL_WINDOW_TRANSITIONSTART_EVENT","CHANNEL_WINDOW_UNLOAD_EVENT","CHANNEL_WINDOW_WHEEL_EVENT"]}onScrollLockEvent(e){}onSetElementToScroll(e){let{config:t,el:n,scrollElement:r}=e.payload;t=t||{},t=ke(this.domChannelConfig,t),r=r||n;this.sendChannelPayload("CHANNEL_WINDOW_SCROLL_ELEMENT_ADDED_EVENT",{el:n},n),this.createScrollObservable(t,r).subscribe((e=>{const{action:t,payload:n,srcElement:r,event:o}=e;this.sendChannelPayload(t,n,r,o)}))}bindStaticMethods(){this.createMediaQueryHandler=Qr.createMediaQueryHandler.bind(this),this.createMergedObsFromObj=Qr.createMergedObsFromObj.bind(this)}}class Zr extends Yr{constructor(e={}){super("CHANNEL_LIFECYCLE",e)}addRegisteredActions(){return["CHANNEL_LIFECYCLE_RENDERED_EVENT","CHANNEL_LIFECYCLE_DISPOSED_EVENT"]}onViewStreamInfo(e){const{action:t,srcElement:n}=e,r=n;r.action=t,this.onSendEvent(t,r)}onSendEvent(e,t={}){const n=this.channelActions[e],r={};window.setTimeout((()=>this.sendChannelPayload(n,t,r,undefined)),0)}}class eo extends Yr{constructor(e,t={}){t.isProxy=!0,super(e,t),this.props=t,this.subject$=new Le,this.replaySub$=new He(1),this.observer$=Ve(this.subject$,this.replaySub$);!0===Je.debug&&this.checkIfChannelIsStillProxy(e)}getMergedSubject(e=!1){return!0===e?this.replaySub$:this.subject$}checkIfChannelIsStillProxy(e){const t=e;ot((()=>{!0!==u(t,Je.listRegisteredChannels())&&console.warn(`Spyne Warning: The channel, ${t} does not appear to be registered!`)}),1e3)}get replaySubject(){return this.replaySub$}get subject(){return this.subject$}}const to=new Map;class no{constructor(){this.addMixins(),to.set("DISPATCHER",new Le),this.listRegisteredChannels=no.listRegisteredChannels.bind(this),this.getChannelsList=no.getChannelsList.bind(this)}get map(){return to}static getChannelsList(){return Array.from(to,((e,t)=>({key:e[0],val:e[1].constructor.name})))}static listRegisteredChannels(e=!1){const t=this.getChannelsList(),n=L(ee("ChannelProxy","val")),r=_(ee("ChannelProxy","val")),o=(!0===e?r:n)(t);return ye(["key"],o)}listProxyChannels(){return this.listRegisteredChannels(!0)}checkForMissingChannels(){const t=this.getChannelsList(),n=_(ee("ChannelProxy","val"))(t);if(n.length>=1){const t=`Spyne Warning: The following ${1===n.length?"Channel has":"Channels have"} not been initialized: ${e(ce(", "),k(i("key")))(n)}`;console.warn(t)}}init(){this.createMainStreams()}createMainStreams(){this.routeStream=new qr,to.set("CHANNEL_ROUTE",this.routeStream),this.uiStream=new Xr,to.set("CHANNEL_UI",this.uiStream),this.domStream=new Jr,to.set("CHANNEL_WINDOW",this.domStream),this.viewStreamLifecycle=new Zr,to.set("CHANNEL_LIFECYCLE",this.viewStreamLifecycle),this.routeStream.initializeStream(),this.domStream.initializeStream()}addKeyEvent(e){to.get("UI").addKeyEvent(e)}registerStream(t){const n=t.channelName;if(to.has(n)){if(e(be(["props","isRegistered"],!0))(to.get(n)))return void console.warn(`Spyne Warning: The Channel, ${n}, has already been registered!`)}to.set(n,t),t.initializeStream()}getChannelActions(e){return to.get(e).addRegisteredActions()}getProxySubject(e,t=!1){const n=!0===t?"replaySubject":"subject";return to.get(e)[n]}testStream(e){return void 0!==to.get(e)}getStream(e){return!1===this.testStream(e)&&to.set(e,new eo(e)),to.get(e)}addMixins(){}}class ro{constructor(e,t="",n=!0){return this.parentContext=e,this.omittedMethods=["autoBinder","initAutoBinder","getEnhancerMethods","checkForMalformedMethods","caller","arguments","bindParentViewStream"],this.prefix=t,!0===n&&this.autoBinder(),this.allMethodsList}initAutoBinder(){this.autoBinder()}getEnhancerMethods(){return function(t,n=[]){const r=A(["length","name","prototype","constructor"],n),o=e(C(r),g),i=o(Object.getOwnPropertyNames(t.constructor.prototype)),s=o(Object.getOwnPropertyNames(t.constructor));return{methods:i,staticMethods:s,allMethods:A(i,s)}}(this,this.omittedMethods)}checkForMalformedMethods(e){if(""===this.prefix)return void console.warn(`SPYNE WARNING: The following SpyneTrait ${this.constructor.name} needs a prefix`);const t=L((e=>0===e.indexOf(this.prefix)),e);if(t.length>=1){const e=`Spyne Warning: The following method(s) in ${this.constructor.name} require the prefix, "${this.prefix}": [${t.join(", ")}];`;console.warn(e)}}bindParentViewStream(e,t){this.checkForMalformedMethods(e.allMethods);const n={},r=(e,r=!1)=>{const o=!0===r?this.constructor:this;"function"===typeof o[e]&&(n[e]=t[e]=o[e].bind(t))},o=Ae(2,r)(T,!0);return k(o,e.staticMethods),k(r,e.methods),n}autoBinder(){const e=this.getEnhancerMethods();return this.allMethodsList=this.bindParentViewStream(e,this.parentContext),this.allMethodsList}}class oo{constructor(e,t,n,r){this._mapFn=oo.setMapFn(e),this._url=oo.setUrl(e),this._responseType=oo.setResponseType(e),this._serverOptions=oo.setServerOptions(e),this._subscriber=void 0!==t?t:e=>console.log("FETCH RETURNED ",e),this.debug=void 0!==e.debug&&e.debug,this.channelName=r;const o={mapFn:this.mapFn,url:this.url,serverOptions:this.serverOptions,responseType:this.responseType,debug:this.debug};!0!==n&&oo.startWindowFetch(o,this._subscriber,this.channelName)}static startWindowFetch(e,t,n){const{mapFn:r,url:o,serverOptions:i,responseType:s,debug:a}=e,c=!0===a?e=>console.log("DEBUG FETCH :",e,{url:o,serverOptions:i,responseType:s,channelName:n}):()=>{},l=Pe(window.fetch(o,i)).pipe(br(c),Ar((e=>Pe(e[s]()))),dr((e=>{const t={channelName:n,url:o,responseType:s,serverOptions:i};return n=>e(n,t)})(r)),gr());l.connect(),l.subscribe(t)}static setMapFn(t){return e(p((e=>e)),i("mapFn"))(t)}static setUrl(e){const t=i("url",e);return void 0===t&&console.warn("SPYNE WARNING: URL is undefined for data channel"),t}static setResponseType(e){return p("json",i("responseType",e))}get mapFn(){return this._mapFn}get url(){return this._url}get serverOptions(){return this._serverOptions}get responseType(){return this._responseType}static stringifyBodyIfItExists(t){return ae(Se(Object,"body"),e(fe(_e("body"),JSON.stringify)))(t)}static updateMethodWhenBodyExists(e){const t=Ne("body"),n=ee("GET","method"),o=r([t,n]);return ae(o,se("method","POST"))(e)}static setServerOptions(e){const t=R(["method","headers","body","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive"],e);let n=me(oo.baseOptions(),t);return n=oo.updateMethodWhenBodyExists(n),n=oo.stringifyBodyIfItExists(n),n}static baseOptions(){return{method:"GET",headers:new Headers({Accept:"application/json, text/plain, */*"}),mode:"cors",credentials:"same-origin",cache:"default",redirect:"follow",referrer:"client",referrerPolicy:"no-referrer-when-downgrade",integrity:"",keepalive:!1}}}class io extends Yr{constructor(e,t={}){io.validateMapMethod(t,e),void 0!==t.map&&(t.mapFn=t.map),t.extendedActionsArr=[`${e}_DATA_EVENT`,[`${e}_UPDATE_DATA_EVENT`,"onFetchUpdate"]],t.sendCachedPayload=!0,super(e,t)}static validateMapMethod(t,n,o=!1){const i=Q(v,(e=>"function"!=typeof e)),s=K(i),a=r([s,e=>e.length>=1]);return!e(a,S,R(["map","mapFn"]))(t)||(!1===o&&console.warn(`Spyne Warning: The map method for ChannelFetch, ${n}, appears to be invalid`),!1)}onRegistered(){this.startFetch()}addRegisteredActions(t){const n=e(p([]),s(["props","extendedActionsArr"]));return["CHANNEL_DATA_EVENT",["CHANNEL_UPDATE_DATA_EVENT","onFetchUpdate"]].concat(n(this))}startFetch(e={},t=this.onFetchReturned.bind(this)){const n=this.consolidateAllFetchProps(e);return new oo(n,t,!1,this.props.name)}onFetchUpdate(e){const t=this.getPropsForFetch(e);this.startFetch(t)}onFetchReturned(e){return this.createChannelPayloadItem(e)}createChannelPayloadItem(e,t=`${this.props.name}_DATA_EVENT`){const{name:n,sendCachedPayload:r,url:o}=this.props,i={name:n,sendCachedPayload:r,url:o};this.sendChannelPayload(t,e,i)}getPropsForFetch(e){const t=s(["viewStreamInfo","payload"],e);return R(["mapFn","url","header","body","mode","method","responseType","debug"],t)}consolidateAllFetchProps(t,n=this.props){const r=R(["mapFn","url","header","body","mode","method","responseType","debug"],n),o=L(v);return e(o,((e,t)=>me(e,t)))(r,t)}get observer(){return this.observer$}}class so{constructor(e={}){let{name:t,config:n,parentEl:r}=e;this.props=e,void 0===n&&(n=l(e)),this.name=t||"empty",this.props.name=t,n=so.mergeDefaultConfig(n,this.defaultConfig()),this.props.parentEl=r||so.createParentEl(),so.getSpyneApp(t,n),void 0!==this.props.traits&&this.addTraits(this.props.traits),this.onBeforeRegistered(),this.onRegistered(),this.onRender()}static mergeDefaultConfig(e={},t=this.defaultConfig()){return Object.assign(t,e)}static getSpyneApp(e,t){!1===Je.initialized?console.warn(`Spyne Warning: Unable to install plugin, ${e}! SpyneApp has not been initialized!`):Je.addPluginConfig(e,t)}static updateSpyneConfig(e,t,r){return!0===ve(n(Object),["config","plugins",t])(e)?(!0===e.config.debug&&console.warn(`Spyne Warning: The plugin, ${t}, already exists`),!1):(e.config.plugins[t]=r,e.config.plugins[t])}static createParentEl(e){return e||document.getElementById("spyne-plugins")||(()=>{const e=new pn({id:"spyne-plugins"});document.body.appendChild(e.render());const t=document.getElementById("spyne-plugins");return t.style.cssText="position:absolute; top:0;left:0;width:100%;height:100%;min-height:100vh;z-index:1000000; pointer-events:none",t})()}addTraits(e){"Array"!==e.constructor.name&&(e=[e]);e.forEach((e=>new e(this)))}onBeforeRegistered(){this.props.pluginName=this.props.name,this.props.config=Je.getPluginConfigByPluginName(this.props.pluginName)}defaultConfig(){return{}}onRegistered(){}onRender(){}}const ao=new no,co="0.20.0";let lo=new class{constructor(){this.version=co}get channels(){return ao}init(e={},t=!1){
|
|
3
|
+
const{entries:at,setPrototypeOf:ct,isFrozen:lt,getPrototypeOf:ut,getOwnPropertyDescriptor:dt}=Object;let{freeze:ht,seal:Et,create:pt}=Object,{apply:Nt,construct:_t}="undefined"!=typeof Reflect&&Reflect;ht||(ht=function(e){return e}),Et||(Et=function(e){return e}),Nt||(Nt=function(e,t,n){return e.apply(t,n)}),_t||(_t=function(e,t){return new e(...t)});const mt=Dt(Array.prototype.forEach),ft=Dt(Array.prototype.pop),Tt=Dt(Array.prototype.push),At=Dt(String.prototype.toLowerCase),Ct=Dt(String.prototype.toString),gt=Dt(String.prototype.match),yt=Dt(String.prototype.replace),bt=Dt(String.prototype.indexOf),St=Dt(String.prototype.trim),vt=Dt(Object.prototype.hasOwnProperty),It=Dt(RegExp.prototype.test),Lt=(Ot=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return _t(Ot,t)});var Ot;function Dt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Nt(e,t,r)}}function Rt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:At;ct&&ct(e,null);let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){const e=n(o);e!==o&&(lt(t)||(t[r]=e),o=e)}e[o]=!0}return e}function Ht(e){for(let t=0;t<e.length;t++){vt(e,t)||(e[t]=null)}return e}function wt(e){const t=pt(null);for(const[n,r]of at(e)){vt(e,n)&&(Array.isArray(r)?t[n]=Ht(r):r&&"object"==typeof r&&r.constructor===Object?t[n]=wt(r):t[n]=r)}return t}function Vt(e,t){for(;null!==e;){const n=dt(e,t);if(n){if(n.get)return Dt(n.get);if("function"==typeof n.value)return Dt(n.value)}e=ut(e)}return function(){return null}}const Pt=ht(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ut=ht(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Mt=ht(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Wt=ht(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),xt=ht(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ft=ht(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),$t=ht(["#text"]),kt=ht(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Gt=ht(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),jt=ht(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),zt=ht(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Yt=Et(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Bt=Et(/<%[\w\W]*|[\w\W]*%>/gm),Kt=Et(/\$\{[\w\W]*}/gm),qt=Et(/^data-[\-\w.\u00B7-\uFFFF]+$/),Xt=Et(/^aria-[\-\w]+$/),Qt=Et(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Jt=Et(/^(?:\w+script|data):/i),Zt=Et(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),en=Et(/^html$/i),tn=Et(/^[a-z][.\w]*(-[.\w]+)+$/i);var nn=Object.freeze({__proto__:null,ARIA_ATTR:Xt,ATTR_WHITESPACE:Zt,CUSTOM_ELEMENT:tn,DATA_ATTR:qt,DOCTYPE_NAME:en,ERB_EXPR:Bt,IS_ALLOWED_URI:Qt,IS_SCRIPT_OR_DATA:Jt,MUSTACHE_EXPR:Yt,TMPLIT_EXPR:Kt});const rn=1,on=3,sn=7,an=8,cn=9,ln=function(){return"undefined"==typeof window?null:window};var un=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ln();const n=t=>e(t);if(n.version="3.2.3",n.removed=[],!t||!t.document||t.document.nodeType!==cn)return n.isSupported=!1,n;let{document:r}=t;const o=r,i=o.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:c,Element:l,NodeFilter:u,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:E,trustedTypes:p}=t,N=l.prototype,_=Vt(N,"cloneNode"),m=Vt(N,"remove"),f=Vt(N,"nextSibling"),T=Vt(N,"childNodes"),A=Vt(N,"parentNode");if("function"==typeof a){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let C,g="";const{implementation:y,createNodeIterator:b,createDocumentFragment:S,getElementsByTagName:v}=r,{importNode:I}=o;let L={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof at&&"function"==typeof A&&y&&void 0!==y.createHTMLDocument;const{MUSTACHE_EXPR:O,ERB_EXPR:D,TMPLIT_EXPR:R,DATA_ATTR:H,ARIA_ATTR:w,IS_SCRIPT_OR_DATA:V,ATTR_WHITESPACE:P,CUSTOM_ELEMENT:U}=nn;let{IS_ALLOWED_URI:M}=nn,W=null;const x=Rt({},[...Pt,...Ut,...Mt,...xt,...$t]);let F=null;const $=Rt({},[...kt,...Gt,...jt,...zt]);let k=Object.seal(pt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),G=null,j=null,z=!0,Y=!0,B=!1,K=!0,q=!1,X=!0,Q=!1,J=!1,Z=!1,ee=!1,te=!1,ne=!1,re=!0,oe=!1,ie=!0,se=!1,ae={},ce=null;const le=Rt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ue=null;const de=Rt({},["audio","video","img","source","image","track"]);let he=null;const Ee=Rt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pe="http://www.w3.org/1998/Math/MathML",Ne="http://www.w3.org/2000/svg",_e="http://www.w3.org/1999/xhtml";let me=_e,fe=!1,Te=null;const Ae=Rt({},[pe,Ne,_e],Ct);let Ce=Rt({},["mi","mo","mn","ms","mtext"]),ge=Rt({},["annotation-xml"]);const ye=Rt({},["title","style","font","a","script"]);let be=null;const Se=["application/xhtml+xml","text/html"];let ve=null,Ie=null;const Le=r.createElement("form"),Oe=function(e){return e instanceof RegExp||e instanceof Function},De=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Ie||Ie!==e){if(e&&"object"==typeof e||(e={}),e=wt(e),be=-1===Se.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,ve="application/xhtml+xml"===be?Ct:At,W=vt(e,"ALLOWED_TAGS")?Rt({},e.ALLOWED_TAGS,ve):x,F=vt(e,"ALLOWED_ATTR")?Rt({},e.ALLOWED_ATTR,ve):$,Te=vt(e,"ALLOWED_NAMESPACES")?Rt({},e.ALLOWED_NAMESPACES,Ct):Ae,he=vt(e,"ADD_URI_SAFE_ATTR")?Rt(wt(Ee),e.ADD_URI_SAFE_ATTR,ve):Ee,ue=vt(e,"ADD_DATA_URI_TAGS")?Rt(wt(de),e.ADD_DATA_URI_TAGS,ve):de,ce=vt(e,"FORBID_CONTENTS")?Rt({},e.FORBID_CONTENTS,ve):le,G=vt(e,"FORBID_TAGS")?Rt({},e.FORBID_TAGS,ve):{},j=vt(e,"FORBID_ATTR")?Rt({},e.FORBID_ATTR,ve):{},ae=!!vt(e,"USE_PROFILES")&&e.USE_PROFILES,z=!1!==e.ALLOW_ARIA_ATTR,Y=!1!==e.ALLOW_DATA_ATTR,B=e.ALLOW_UNKNOWN_PROTOCOLS||!1,K=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,q=e.SAFE_FOR_TEMPLATES||!1,X=!1!==e.SAFE_FOR_XML,Q=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,ne=e.RETURN_TRUSTED_TYPE||!1,Z=e.FORCE_BODY||!1,re=!1!==e.SANITIZE_DOM,oe=e.SANITIZE_NAMED_PROPS||!1,ie=!1!==e.KEEP_CONTENT,se=e.IN_PLACE||!1,M=e.ALLOWED_URI_REGEXP||Qt,me=e.NAMESPACE||_e,Ce=e.MATHML_TEXT_INTEGRATION_POINTS||Ce,ge=e.HTML_INTEGRATION_POINTS||ge,k=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Oe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(k.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Oe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(k.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(k.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),q&&(Y=!1),te&&(ee=!0),ae&&(W=Rt({},$t),F=[],!0===ae.html&&(Rt(W,Pt),Rt(F,kt)),!0===ae.svg&&(Rt(W,Ut),Rt(F,Gt),Rt(F,zt)),!0===ae.svgFilters&&(Rt(W,Mt),Rt(F,Gt),Rt(F,zt)),!0===ae.mathMl&&(Rt(W,xt),Rt(F,jt),Rt(F,zt))),e.ADD_TAGS&&(W===x&&(W=wt(W)),Rt(W,e.ADD_TAGS,ve)),e.ADD_ATTR&&(F===$&&(F=wt(F)),Rt(F,e.ADD_ATTR,ve)),e.ADD_URI_SAFE_ATTR&&Rt(he,e.ADD_URI_SAFE_ATTR,ve),e.FORBID_CONTENTS&&(ce===le&&(ce=wt(ce)),Rt(ce,e.FORBID_CONTENTS,ve)),ie&&(W["#text"]=!0),Q&&Rt(W,["html","head","body"]),W.table&&(Rt(W,["tbody"]),delete G.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Lt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Lt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=e.TRUSTED_TYPES_POLICY,g=C.createHTML("")}else void 0===C&&(C=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(p,i)),null!==C&&"string"==typeof g&&(g=C.createHTML(""));ht&&ht(e),Ie=e}},Re=Rt({},[...Ut,...Mt,...Wt]),He=Rt({},[...xt,...Ft]),we=function(e){Tt(n.removed,{element:e});try{A(e).removeChild(e)}catch(t){m(e)}},Ve=function(e,t){try{Tt(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Tt(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ee||te)try{we(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Pe=function(e){let t=null,n=null;if(Z)e="<remove></remove>"+e;else{const t=gt(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===be&&me===_e&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=C?C.createHTML(e):e;if(me===_e)try{t=(new E).parseFromString(o,be)}catch(e){}if(!t||!t.documentElement){t=y.createDocument(me,"template",null);try{t.documentElement.innerHTML=fe?g:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),me===_e?v.call(t,Q?"html":"body")[0]:Q?t.documentElement:i},Ue=function(e){return b.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Me=function(e){return e instanceof h&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},We=function(e){return"function"==typeof c&&e instanceof c};function xe(e,t,r){mt(e,(e=>{e.call(n,t,r,Ie)}))}const Fe=function(e){let t=null;if(xe(L.beforeSanitizeElements,e,null),Me(e))return we(e),!0;const r=ve(e.nodeName);if(xe(L.uponSanitizeElement,e,{tagName:r,allowedTags:W}),e.hasChildNodes()&&!We(e.firstElementChild)&&It(/<[/\w]/g,e.innerHTML)&&It(/<[/\w]/g,e.textContent))return we(e),!0;if(e.nodeType===sn)return we(e),!0;if(X&&e.nodeType===an&&It(/<[/\w]/g,e.data))return we(e),!0;if(!W[r]||G[r]){if(!G[r]&&ke(r)){if(k.tagNameCheck instanceof RegExp&&It(k.tagNameCheck,r))return!1;if(k.tagNameCheck instanceof Function&&k.tagNameCheck(r))return!1}if(ie&&!ce[r]){const t=A(e)||e.parentNode,n=T(e)||e.childNodes;if(n&&t){for(let r=n.length-1;r>=0;--r){const o=_(n[r],!0);o.__removalCount=(e.__removalCount||0)+1,t.insertBefore(o,f(e))}}}return we(e),!0}return e instanceof l&&!function(e){let t=A(e);t&&t.tagName||(t={namespaceURI:me,tagName:"template"});const n=At(e.tagName),r=At(t.tagName);return!!Te[e.namespaceURI]&&(e.namespaceURI===Ne?t.namespaceURI===_e?"svg"===n:t.namespaceURI===pe?"svg"===n&&("annotation-xml"===r||Ce[r]):Boolean(Re[n]):e.namespaceURI===pe?t.namespaceURI===_e?"math"===n:t.namespaceURI===Ne?"math"===n&&ge[r]:Boolean(He[n]):e.namespaceURI===_e?!(t.namespaceURI===Ne&&!ge[r])&&!(t.namespaceURI===pe&&!Ce[r])&&!He[n]&&(ye[n]||!Re[n]):!("application/xhtml+xml"!==be||!Te[e.namespaceURI]))}(e)?(we(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!It(/<\/no(script|embed|frames)/i,e.innerHTML)?(q&&e.nodeType===on&&(t=e.textContent,mt([O,D,R],(e=>{t=yt(t,e," ")})),e.textContent!==t&&(Tt(n.removed,{element:e.cloneNode()}),e.textContent=t)),xe(L.afterSanitizeElements,e,null),!1):(we(e),!0)},$e=function(e,t,n){if(re&&("id"===t||"name"===t)&&(n in r||n in Le))return!1;if(Y&&!j[t]&&It(H,t));else if(z&&It(w,t));else if(!F[t]||j[t]){if(!(ke(e)&&(k.tagNameCheck instanceof RegExp&&It(k.tagNameCheck,e)||k.tagNameCheck instanceof Function&&k.tagNameCheck(e))&&(k.attributeNameCheck instanceof RegExp&&It(k.attributeNameCheck,t)||k.attributeNameCheck instanceof Function&&k.attributeNameCheck(t))||"is"===t&&k.allowCustomizedBuiltInElements&&(k.tagNameCheck instanceof RegExp&&It(k.tagNameCheck,n)||k.tagNameCheck instanceof Function&&k.tagNameCheck(n))))return!1}else if(he[t]);else if(It(M,yt(n,P,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==bt(n,"data:")||!ue[e]){if(B&&!It(V,yt(n,P,"")));else if(n)return!1}else;return!0},ke=function(e){return"annotation-xml"!==e&>(e,U)},Ge=function(e){xe(L.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Me(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:F,forceKeepAttr:void 0};let o=t.length;for(;o--;){const i=t[o],{name:s,namespaceURI:a,value:c}=i,l=ve(s);let u="value"===s?c:St(c);if(r.attrName=l,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,xe(L.uponSanitizeAttribute,e,r),u=r.attrValue,!oe||"id"!==l&&"name"!==l||(Ve(s,e),u="user-content-"+u),X&&It(/((--!?|])>)|<\/(style|title)/i,u)){Ve(s,e);continue}if(r.forceKeepAttr)continue;if(Ve(s,e),!r.keepAttr)continue;if(!K&&It(/\/>/i,u)){Ve(s,e);continue}q&&mt([O,D,R],(e=>{u=yt(u,e," ")}));const d=ve(e.nodeName);if($e(d,l,u)){if(C&&"object"==typeof p&&"function"==typeof p.getAttributeType)if(a);else switch(p.getAttributeType(d,l)){case"TrustedHTML":u=C.createHTML(u);break;case"TrustedScriptURL":u=C.createScriptURL(u)}try{a?e.setAttributeNS(a,s,u):e.setAttribute(s,u),Me(e)?we(e):ft(n.removed)}catch(e){}}}xe(L.afterSanitizeAttributes,e,null)},je=function e(t){let n=null;const r=Ue(t);for(xe(L.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)xe(L.uponSanitizeShadowNode,n,null),Fe(n),Ge(n),n.content instanceof s&&e(n.content);xe(L.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,a=null,l=null;if(fe=!e,fe&&(e="\x3c!--\x3e"),"string"!=typeof e&&!We(e)){if("function"!=typeof e.toString)throw Lt("toString is not a function");if("string"!=typeof(e=e.toString()))throw Lt("dirty is not a string, aborting")}if(!n.isSupported)return e;if(J||De(t),n.removed=[],"string"==typeof e&&(se=!1),se){if(e.nodeName){const t=ve(e.nodeName);if(!W[t]||G[t])throw Lt("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof c)r=Pe("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),i.nodeType===rn&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!ee&&!q&&!Q&&-1===e.indexOf("<"))return C&&ne?C.createHTML(e):e;if(r=Pe(e),!r)return ee?null:ne?g:""}r&&Z&&we(r.firstChild);const u=Ue(se?e:r);for(;a=u.nextNode();)Fe(a),Ge(a),a.content instanceof s&&je(a.content);if(se)return e;if(ee){if(te)for(l=S.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(F.shadowroot||F.shadowrootmode)&&(l=I.call(o,l,!0)),l}let d=Q?r.outerHTML:r.innerHTML;return Q&&W["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&It(en,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),q&&mt([O,D,R],(e=>{d=yt(d,e," ")})),C&&ne?C.createHTML(d):d},n.setConfig=function(){De(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),J=!0},n.clearConfig=function(){Ie=null,J=!1},n.isValidAttribute=function(e,t,n){Ie||De({});const r=ve(e),o=ve(t);return $e(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&Tt(L[e],t)},n.removeHook=function(e){return ft(L[e])},n.removeHooks=function(e){L[e]=[]},n.removeAllHooks=function(){L={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();let dn,hn=!1;class En{constructor(e,t={}){this.template=this.formatTemplate(e),this.isProxyData=!0===t.__cms__isProxy;(()=>{!0===n(Array,t)&&(t={spyneData:t},this.template=this.template.replace("{{/}}","{{/spyneData}}"),this.template=this.template.replace("{{#}}","{{#spyneData}}"))})(),this.templateData=t;const r=En.getStringArray(this.template);let o=this.template.match(En.findTmplLoopsRE());o=null===o?[]:o;const i=En.parseTmplLoopsRE(),s=this.parseTheTmplLoop.bind(this),a=d(T,o),c=I(a,((e,t)=>e.replace(i,s)),this.addParams.bind(this));this.finalArr=r.map(c)}static isPrimitiveTag(e){return/({{\.\*?}})/.test(e)}static getNestedDataReducer(e={},t=""){return/(\.)/gm.test(String(t))?String(t).split(".").reduce(((e,t)=>e[t]?e[t]:"string"==typeof e?e:""),e):e[t]??""}static getStringArray(e){const t=e.split(En.findTmplLoopsRE()),n=/^([\\n\s\W]+)$/;return L((e=>e.match(n)),t)}static findTmplLoopsRE(){return/({{#[\w.]+}}[\w\n\s\W]+?{{\/[\w.]+}})/gm}static parseTmplLoopsRE(){return/({{#([\w.]+)}})([\w\n\s\W]+?)({{\/\2}})/gm}static swapParamsForTagsRE(){return/({{)(.*?)(}})/gm}removeThis(){void 0!==this&&(this.finalArr=void 0,this.templateData=void 0,this.template=void 0)}renderDocFrag(){let e=En.replaceImgPath(this.finalArr.join(""));e=(e=>{if(!hn)throw new Error("sanitizeHTML is not configured. Call sanitizeHTMLConfigure() with appropriate config.");return dn(e)})(e);const t=/^([^>]*?)(<){1}(\b)(thead|col|colgroup|tbody|td|tfoot|tr|th)(\b)([^\0]*)$/.test(e)?e:document.createRange().createContextualFragment(e);return window.setTimeout(this.removeThis,2),t}renderToString(){let e=this.finalArr.join("");return e=En.replaceImgPath(e),window.setTimeout(this.removeThis,2),e}getTemplateString(){return this.finalArr.join("")}formatTemplate(e){return!0===["SCRIPT","TEMPLATE"].includes(i("nodeName",e))?e.innerHTML:e}getDataValFromPathStr(e,t){const n=String(e).split(".");return s(n,t)||""}addParams(e){return e.replace(En.swapParamsForTagsRE(),((e,t,n,r)=>En.getNestedDataReducer(this.templateData,n)))}static replaceImgPath(e){const{IMG_PATH:t}=Je;return void 0!==t?(e=e.replaceAll(/src\s*=\s*(['"])imgs\//g,`src=$1${t}`)).replaceAll(/url\(\s*(['"]?)imgs\//g,`url($1${t}`):e}parseTheTmplLoop(e,t,n,r){const o=/(\.)/gm,i=r;let s=En.getNestedDataReducer(this.templateData,n);const a=(e,t,n)=>{if(En.isPrimitiveTag(t))return c(e,t);return l((()=>{const t=e,r=n,o=n+1;if(this.isProxyData){return{spyneLoopKey:t,__cms__dataId:s.__cms__dataId,origKey:s[`__cms__keyFor_${e}`],loopIndex:r,loopNum:o,d:e}}return{spyneLoopKey:t,loopIndex:r,loopNum:o}})(),t,n)},c=(e,t,n,r)=>t.replace(En.swapParamsForTagsRE(),e),l=(e,t,n)=>t.replace(En.swapParamsForTagsRE(),((t,r,i)=>{const s={loopIndex:n,loopNum:n+1};if(!1===o.test(i)&&void 0!==e[i])return void 0!==s[i]?s[i]:e[i];const a=this.getDataValFromPathStr(i,e);return void 0!==s[i]?s[i]:a}));return!0===v(s)||b(s)?"":(void 0===s.length&&(s=[s]),s.map(((e,t)=>"string"==typeof e?a(e,i,t):l(e,i,t))).join(""))}}class pn{constructor(e={}){var t,n;e.tagName=(t="div",n=e.tagName,p(t)(n)),e.attributes=void 0!==e.attributes?e.attributes:this.getDomAttributes(e),e.attrs=this.updateAttrs(e.attributes),e.fragment=document.createDocumentFragment(),this.props=e,this.addMixins()}setProp(e,t){this.props[e]=t}getProp(e){return this.props[e]}get el(){return this.props.el}setElAttrs(e,t){return this.getProp("attrs").forEach(((t,n)=>{const r=(t,n)=>{e.dataset[n]=t};"dataset"===n?H(r,t):e.setAttribute(n,t)})),e}updateAttrs(e,t){const n=void 0!==t?t:new Map;return O(((e,t)=>n.set(t,e)),e),n}addTemplate(e){const t=this.getProp("template");return void 0!==t?(t=>{let r=this.getProp("data");r=n(Object,r)?r:{};const o=new En(t,r).renderDocFrag();return n(String,o)?e.innerHTML=o:e.appendChild(o),e})(t):e}createElement(e="div"){return document.createElement(e)}addContent(e){const t=this.getProp("data");if(!0===n(String,t)){const n=document.createTextNode(t);e.appendChild(n)}return e}execute(){const e=D(this.createElement.bind(this),this.setElAttrs.bind(this),this.addTemplate.bind(this),this.addContent.bind(this))(this.getProp("tagName"));this.props.el=e}render(){return this.execute(),this.props.template=void 0,this.props.data=void 0,this.props.attributes=void 0,this.getProp("el")}renderToHTMLString(){return this.execute(),this.props.template=void 0,this.props.data=void 0,this.props.attributes=void 0,this.getProp("el").outerHTML}returnIfDefined(e,t){if(void 0!==t){const n=void 0===t;e[t]=!1===n?t:ke(e[t],t)}}updateprops(e){return this.returnIfDefined(this.props,e),this}updatepropsAndRun(e){return this.updateprops(e),this.execute(),this.getProp("fragment")}unmount(){void 0!==this.props&&(this.getProp("el").remove(),this.props=void 0,this.gc())}updateTag(e="div"){this.updateprops(e)}updateAttributes(e={}){this.updateprops(e)}updateTemplate(e){this.updateprops(e)}updateData(e={}){this.updateprops(e)}addTagAndRender(e="div"){this.updatepropsAndRun(e)}addAttrsibutesAndRender(e={}){this.updatepropsAndRun(e)}addTemplateAndRender(e){this.updatepropsAndRun(e)}addDataAndRender(e={}){this.updatepropsAndRun(e)}addMixins(){const e=rt();this.gc=e.gc.bind(this)}getDomAttributes(e){return R(this.attributesArray,e)}get attributesArray(){return["accept","accept-charset","accesskey","action","align","allow","alt","async","autocapitalize","autocomplete","autofocus","autoplay","bgcolor","border","buffered","challenge","charset","checked","cite","class","code","codebase","color","cols","colspan","content","contenteditable","contextmenu","controls","coords","crossorigin","csp","dataset","datetime","decoding","default","defer","dir","dirname","disabled","download","draggable","dropzone","enctype","for","form","formaction","headers","height","hidden","high","href","hreflang","http-equiv","icon","id","importance","integrity","ismap","itemprop","keytype","kind","label","lang","language","lazyload","list","loop","low","manifest","max","maxlength","minlength","media","method","min","multiple","muted","name","novalidate","open","optimum","pattern","ping","placeholder","poster","preload","radiogroup","readonly","referrerpolicy","rel","required","reversed","rows","rowspan","sandbox","scope","scoped","selected","shape","size","sizes","slot","span","spellcheck","src","srcdoc","srclang","srcset","start","step","style","summary","tabindex","target","title","translate","type","usemap","value","width","wrap"]}}const Nn=(e=!1,t=1,n="ease",r=!1)=>`${!0===r?"opacity:0;":""}transition: opacity ${t}s ${n}; opacity: ${!0===e?1:0};`;function _n(e){return"function"==typeof e}function mn(e){return _n(null==e?void 0:e.lift)}function fn(e){return function(t){if(mn(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}var Tn=function(e,t){return Tn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Tn(e,t)};function An(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Tn(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function Cn(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}function gn(e,t){var n,r,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function yn(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function bn(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function Sn(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function vn(e){return this instanceof vn?(this.v=e,this):new vn(e)}function In(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=n.apply(e,t||[]),i=[];return r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r;function s(e){o[e]&&(r[e]=function(t){return new Promise((function(n,r){i.push([e,t,n,r])>1||a(e,t)}))})}function a(e,t){try{(n=o[e](t)).value instanceof vn?Promise.resolve(n.value.v).then(c,l):u(i[0][2],n)}catch(e){u(i[0][3],e)}var n}function c(e){a("next",e)}function l(e){a("throw",e)}function u(e,t){e(t),i.shift(),i.length&&a(i[0][0],i[0][1])}}function Ln(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=yn(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,o){(function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)})(r,o,(t=e[n](t)).done,t.value)}))}}}"function"==typeof SuppressedError&&SuppressedError;function On(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Dn=On((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function Rn(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Hn=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,n,r,o;if(!this.closed){this.closed=!0;var i=this._parentage;if(i)if(this._parentage=null,Array.isArray(i))try{for(var s=yn(i),a=s.next();!a.done;a=s.next()){a.value.remove(this)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else i.remove(this);var c=this.initialTeardown;if(_n(c))try{c()}catch(e){o=e instanceof Dn?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=yn(l),d=u.next();!d.done;d=u.next()){var h=d.value;try{Pn(h)}catch(e){o=null!=o?o:[],e instanceof Dn?o=Sn(Sn([],bn(o)),bn(e.errors)):o.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(o)throw new Dn(o)}},e.prototype.add=function(t){var n;if(t&&t!==this)if(this.closed)Pn(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Rn(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&Rn(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),wn=Hn.EMPTY;function Vn(e){return e instanceof Hn||e&&"closed"in e&&_n(e.remove)&&_n(e.add)&&_n(e.unsubscribe)}function Pn(e){_n(e)?e():e.unsubscribe()}var Un={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Mn={setTimeout:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=Mn.delegate;return(null==o?void 0:o.setTimeout)?o.setTimeout.apply(o,Sn([e,t],bn(n))):setTimeout.apply(void 0,Sn([e,t],bn(n)))},clearTimeout:function(e){var t=Mn.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function Wn(e){Mn.setTimeout((function(){throw e}))}function xn(){}var Fn=null;function $n(e){if(Un.useDeprecatedSynchronousErrorHandling){var t=!Fn;if(t&&(Fn={errorThrown:!1,error:null}),e(),t){var n=Fn,r=n.errorThrown,o=n.error;if(Fn=null,r)throw o}}else e()}var kn=function(e){function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Vn(t)&&t.add(n)):n.destination=Kn,n}return An(t,e),t.create=function(e,t,n){return new Yn(e,t,n)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Hn),Gn=Function.prototype.bind;function jn(e,t){return Gn.call(e,t)}var zn=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){Bn(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Bn(e)}else Bn(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Bn(e)}},e}(),Yn=function(e){function t(t,n,r){var o,i,s=e.call(this)||this;_n(t)||!t?o={next:null!=t?t:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:s&&Un.useDeprecatedNextContext?((i=Object.create(t)).unsubscribe=function(){return s.unsubscribe()},o={next:t.next&&jn(t.next,i),error:t.error&&jn(t.error,i),complete:t.complete&&jn(t.complete,i)}):o=t;return s.destination=new zn(o),s}return An(t,e),t}(kn);function Bn(e){Wn(e)}var Kn={closed:!0,next:xn,error:function(e){throw e},complete:xn},qn="function"==typeof Symbol&&Symbol.observable||"@@observable";function Xn(e){return e}var Qn=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r,o=this,i=(r=e)&&r instanceof kn||function(e){return e&&_n(e.next)&&_n(e.error)&&_n(e.complete)}(r)&&Vn(r)?e:new Yn(e,t,n);return $n((function(){var e=o,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?o._subscribe(i):o._trySubscribe(i))})),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=Jn(t))((function(t,r){var o=new Yn({next:function(t){try{e(t)}catch(e){r(e),o.unsubscribe()}},error:r,complete:t});n.subscribe(o)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[qn]=function(){return this},e.prototype.pipe=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return(0===(e=t).length?Xn:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)})(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Jn(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}();function Jn(e){var t;return null!==(t=null!=e?e:Un.Promise)&&void 0!==t?t:Promise}var Zn="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function er(e){if(e instanceof Qn)return e;if(null!=e){if(function(e){return _n(e[qn])}(e))return s=e,new Qn((function(e){var t=s[qn]();if(_n(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if((i=e)&&"number"==typeof i.length&&"function"!=typeof i)return o=e,new Qn((function(e){for(var t=0;t<o.length&&!e.closed;t++)e.next(o[t]);e.complete()}));if(_n(null==(r=e)?void 0:r.then))return n=e,new Qn((function(e){n.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,Wn)}));if(function(e){return Symbol.asyncIterator&&_n(null==e?void 0:e[Symbol.asyncIterator])}(e))return tr(e);if(function(e){return _n(null==e?void 0:e[Zn])}(e))return t=e,new Qn((function(e){var n,r;try{for(var o=yn(t),i=o.next();!i.done;i=o.next()){var s=i.value;if(e.next(s),e.closed)return}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}e.complete()}));if(function(e){return _n(null==e?void 0:e.getReader)}(e))return tr(function(e){return In(this,arguments,(function(){var t,n,r;return gn(this,(function(o){switch(o.label){case 0:t=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,vn(t.read())];case 3:return n=o.sent(),r=n.value,n.done?[4,vn(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,vn(r)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}(e))}var t,n,r,o,i,s;throw function(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}(e)}function tr(e){return new Qn((function(t){(function(e,t){var n,r,o,i;return Cn(this,void 0,void 0,(function(){var s,a;return gn(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=Ln(e),c.label=1;case 1:return[4,n.next()];case 2:if((r=c.sent()).done)return[3,4];if(s=r.value,t.next(s),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),o={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(i=n.return)?[4,i.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function nr(e,t,n,r,o){return new rr(e,t,n,r,o)}var rr=function(e){function t(t,n,r,o,i,s){var a=e.call(this,t)||this;return a.onFinalize=i,a.shouldUnsubscribe=s,a._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=o?function(e){try{o(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return An(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(kn),or=function(e){function t(t,n){return e.call(this)||this}return An(t,e),t.prototype.schedule=function(e,t){return this},t}(Hn),ir={setInterval:function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var o=ir.delegate;return(null==o?void 0:o.setInterval)?o.setInterval.apply(o,Sn([e,t],bn(n))):setInterval.apply(void 0,Sn([e,t],bn(n)))},clearInterval:function(e){var t=ir.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},sr=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return An(t,e),t.prototype.schedule=function(e,t){var n;if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,o=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(o,r,t)),this.pending=!0,this.delay=t,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(o,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),ir.setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return t;null!=t&&ir.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(e,t);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var n,r=!1;try{this.work(e)}catch(e){r=!0,n=e||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Rn(r,this),null!=t&&(this.id=this.recycleAsyncId(n,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(or),ar={now:function(){return(ar.delegate||Date).now()},delegate:void 0},cr=function(){function e(t,n){void 0===n&&(n=e.now),this.schedulerActionCtor=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(n,t)},e.now=ar.now,e}(),lr=new(function(e){function t(t,n){void 0===n&&(n=cr.now);var r=e.call(this,t,n)||this;return r.actions=[],r._active=!1,r}return An(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var n;this._active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(cr))(sr);function ur(e,t){return fn((function(n,r){var o=0;n.subscribe(nr(r,(function(n){r.next(e.call(t,n,o++))})))}))}function dr(e,t,n){return void 0===n&&(n=1/0),_n(t)?dr((function(n,r){return ur((function(e,o){return t(n,e,r,o)}))(er(e(n,r)))}),n):("number"==typeof t&&(n=t),fn((function(t,r){return function(e,t,n,r,o,i,s,a){var c=[],l=0,u=0,d=!1,h=function(){!d||c.length||l||t.complete()},E=function(e){return l<r?p(e):c.push(e)},p=function(e){i&&t.next(e),l++;var a=!1;er(n(e,u++)).subscribe(nr(t,(function(e){null==o||o(e),i?E(e):t.next(e)}),(function(){a=!0}),void 0,(function(){if(a)try{l--;for(var e=function(){var e=c.shift();s?function(e,t,n,r,o){void 0===r&&(r=0),void 0===o&&(o=!1);var i=t.schedule((function(){n(),o?e.add(this.schedule(null,r)):this.unsubscribe()}),r);e.add(i)}(t,s,(function(){return p(e)})):p(e)};c.length&&l<r;)e();h()}catch(e){t.error(e)}})))};return e.subscribe(nr(t,E,(function(){d=!0,h()}))),function(){null==a||a()}}(t,r,e,n)})))}var hr=On((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),Er=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return An(t,e),t.prototype.lift=function(e){var t=new pr(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new hr},t.prototype.next=function(e){var t=this;$n((function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var o=yn(t.currentObservers),i=o.next();!i.done;i=o.next()){i.value.next(e)}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}}))},t.prototype.error=function(e){var t=this;$n((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}}))},t.prototype.complete=function(){var e=this;$n((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,o=n.isStopped,i=n.observers;return r||o?wn:(this.currentObservers=null,i.push(e),new Hn((function(){t.currentObservers=null,Rn(i,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,o=t.isStopped;n?e.error(r):o&&e.complete()},t.prototype.asObservable=function(){var e=new Qn;return e.source=this,e},t.create=function(e,t){return new pr(e,t)},t}(Qn),pr=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return An(t,e),t.prototype.next=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===n||n.call(t,e)},t.prototype.error=function(e){var t,n;null===(n=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===n||n.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,n;return null!==(n=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==n?n:wn},t}(Er);var Nr={connector:function(){return new Er}};function _r(e,t){void 0===t&&(t=Nr);var n=t.connector;return fn((function(t,r){var o,i=n();er(e((o=i,new Qn((function(e){return o.subscribe(e)}))))).subscribe(r),r.add(t.subscribe(i))}))}function mr(e,t){return void 0===t&&(t=lr),fn((function(n,r){var o=null,i=null,s=null,a=function(){if(o){o.unsubscribe(),o=null;var e=i;i=null,r.next(e)}};function c(){var n=s+e,i=t.now();if(i<n)return o=this.schedule(void 0,n-i),void r.add(o);a()}n.subscribe(nr(r,(function(n){i=n,s=t.now(),o||(o=t.schedule(c,e),r.add(o))}),(function(){a(),r.complete()}),void 0,(function(){i=o=null})))}))}function fr(e,t){return fn((function(n,r){var o=0;n.subscribe(nr(r,(function(n){return e.call(t,n,o++)&&r.next(n)})))}))}function Tr(e){return fn((function(t,n){try{t.subscribe(n)}finally{n.add(e)}}))}var Ar=dr;var Cr=function(e){function t(t,n){var r=e.call(this)||this;return r.source=t,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,mn(t)&&(r.lift=t.lift),r}return An(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,null==e||e.unsubscribe()},t.prototype.connect=function(){var e=this,t=this._connection;if(!t){t=this._connection=new Hn;var n=this.getSubject();t.add(this.source.subscribe(nr(n,void 0,(function(){e._teardown(),n.complete()}),(function(t){e._teardown(),n.error(t)}),(function(){return e._teardown()})))),t.closed&&(this._connection=null,t=Hn.EMPTY)}return t},t.prototype.refCount=function(){return fn((function(e,t){var n=null;e._refCount++;var r=nr(t,void 0,void 0,void 0,(function(){if(!e||e._refCount<=0||0<--e._refCount)n=null;else{var r=e._connection,o=n;n=null,!r||o&&r!==o||r.unsubscribe(),t.unsubscribe()}}));e.subscribe(r),r.closed||(n=e.connect())}))(this)},t}(Qn);function gr(e){return e?function(t){return _r(e)(t)}:function(e){return function(e,t){var n=_n(e)?e:function(){return e};return _n(t)?_r(t,{connector:n}):function(e){return new Cr(e,n)}}(new Er)(e)}}function yr(e,t){return void 0===t&&(t=!1),fn((function(n,r){var o=0;n.subscribe(nr(r,(function(n){var i=e(n,o++);(i||t)&&r.next(n),!i&&r.complete()})))}))}function br(e,t,n){var r=_n(e)||t||n?{next:e,error:t,complete:n}:e;return r?fn((function(e,t){var n;null===(n=r.subscribe)||void 0===n||n.call(r);var o=!0;e.subscribe(nr(t,(function(e){var n;null===(n=r.next)||void 0===n||n.call(r,e),t.next(e)}),(function(){var e;o=!1,null===(e=r.complete)||void 0===e||e.call(r),t.complete()}),(function(e){var n;o=!1,null===(n=r.error)||void 0===n||n.call(r,e),t.error(e)}),(function(){var e,t;o&&(null===(e=r.unsubscribe)||void 0===e||e.call(r)),null===(t=r.finalize)||void 0===t||t.call(r)})))})):Xn}class Sr{constructor(e){this.props.observableStreams=Sr.createDirectionalObservables()}static createDirectionalFiltersObject(){const e="internal",t="parent",n="child";return{P:[t],C:[n],PCI:[t,e,n],CI:[n,e],PI:[t,e],PC:[t,n]}}static addDefaultDir(e){return w(V)({$dir:["internal"]},l(e))}static addDownInternalDir(e,t=["internal","down"]){return w(V)(l(e),{$dir:t})}static addChildAndInternalDir(e,t=["child","down"]){return w(V)(l(e),{$dir:t})}static mapToDefaultDir(e){return this.addDefaultDir(e)}static createDirectionalObservables(e=new Le,t,n){void 0!==t&&void 0!==n&&(e.viewName=t,e.vsid=n);const r=e=>P((t=>t.includes(e)),"$dir"),o=r("parent"),i=r("child"),s=r("internal"),a=e=>V({from$:e}),c=a("child"),l=a("internal"),u=a("parent"),d=e.pipe(fr((e=>void 0!==e&&void 0!==e.action))),h=e.pipe(fr(s),ur(l)),E=e.pipe(fr(o),ur(c)),p=e.pipe(fr(i),ur(u)),N={parent:E,internal:h,child:p};return{raw$:d,toInternal$:h,toParent$:E,toChild$:p,completeAll:()=>{U((e=>{e.complete(),e.isStopped=!0}),[d,h,E,p])},completeStream:(e=[])=>{const t=e=>{if(void 0!==N[e]){(t=N[e]).complete(),t.isStopped=!0}var t};void 0!==e&&e.length>=1&&e.forEach(t)}}}}class vr{constructor(e,t={},n="",r="theName"){this.addMixins(),this._state="INIT",this.vsid=n,this.vsName=r,this.defaults={debug:!1,extendedHashMethods:{}},this.options=ke(this.defaults,t);this.addActionListeners().forEach((e=>{const[t,n]=e;this.options.extendedHashMethods[t]=e=>this[n](e)})),this.options.hashMethods=this.setHashMethods(this.options.extendedHashMethods),this.sink$=e,this.sink$.subscribe(this.onObsSinkSubscribe.bind(this)),this.$dirs=Sr.createDirectionalFiltersObject(),this.addDefaultDir=Sr.addDefaultDir,this.sourceStreams=Sr.createDirectionalObservables(new Le,this.vsName,this.vsid),this._source$=this.sourceStreams.toInternal$}addActionListeners(){return[]}setHashMethods(e={}){return ke({VS_DETRITUS_COLLECT:e=>this.onGarbageCollect(e),READY_FOR_VS_DETRITUS_COLLECT:e=>this.onReadyForGC(e),EXTIRPATE:e=>this.onDispose(e),VS_SPAWN:e=>this.onRender(e),VS_SPAWN_AND_ATTACH_TO_PARENT:e=>this.onRenderAndAttachToParent(e),VS_SPAWN_AND_ATTACH_TO_DOM:e=>this.onRenderAndAttachToDom(e),ATTACH_CHILD_TO_SELF:e=>this.onAttachChildToSelf(e)},e)}createDomItem(){this.props=void 0!==this.props?this.props:{};const e=m((e=>void 0!==e),R(["id","className"],this.props)),{tagName:t,data:n,template:r}=this.props;return new pn(t,e,n,r)}onDisposeCompleted(e){}animateInTween(e,t){!function(e,t){const n=1*window.getComputedStyle(e).opacity,r=Nn(!0,t,"ease",1===n);e.style.cssText+=r}(e,t)}animateOutTween(e,t,n){!function(e,t,n){const r=Nn(!1,t,"ease");e.style.cssText+=r,e.addEventListener("transitionend",n,!1)}(e,t,n)}setAnimateIn(e){if(!0===e.animateIn){const t=void 0!==e.el?e.el:this.domItem.el;this.animateInTween(t,e.animateInTime)}}disposeMethod(e){const t=void 0!==e.el.el?e.el.el:e.el,n={action:"READY_FOR_VS_DETRITUS_COLLECT",$dir:this.$dirs.PI,el:t},r=Oe(((e,n)=>{this.animateOutTween(t,e.animateOutTime,n)})),o=e=>{this._source$.next(n)},i=!0===e.animateOut?e=>(r(e).subscribe(o),{action:"EXTIRPATING",$dir:this.$dirs.CI}):()=>({action:"EXTIRPATE_AND_READY_FOR_VS_DETRITUS_COLLECT",$dir:this.$dirs.CI});return i(e)}onDispose(e){return this.disposeMethod(e)}removeStream(){void 0!==this.sourceStreams&&this.sourceStreams.completeStream(["internal","child"])}onReadyForGC(e){this.removeStream()}onGarbageCollect(e){void 0!==this.domItem&&this.domItem.unmount(),void 0!==this.sourceStreams&&this.sourceStreams.completeStream(["parent"])}getSourceStream(){return this._source$}combineDomItems(e){const t=v(e.query)?e.node:e.query,n=(e,t)=>e.insertBefore(t,e.firstChild);({appendChild:(e,t)=>e.appendChild(t),after:(e,t)=>e.after(t)}[e.attachType]||n)(t,this.domItem.render()),this.setAnimateIn(e)}onAttachChildToSelf(e){const t=e.childRenderData;return this.combineDomItems(t),{action:"CHILD_ATTACHED",$dir:this.$dirs.PI}}onRenderAndAttachToParent(e){return this.onRender(e),this.combineDomItems(e),{action:"VS_SPAWNED_AND_ATTACHED_TO_PARENT",el:this.domItem.el,$dir:this.$dirs.PI}}renderDomItem(e){const[t,n,r,o]=e;return this.domItem=new pn({tagName:t,attributes:n,data:r,template:o}),this.domItem}onRender(e){return{action:"VS_SPAWNED",el:(e=>this.renderDomItem(e))(M(["tagName","domAttributes","data","template"],e)),$dir:this.$dirs.I}}extendedMethods(e){}onRenderAndAttachToDom(e){return e.attachData.el=(e=>this.renderDomItem(e))(M(["tagName","domAttributes","data","template"],e)),this.combineDomItems(e.attachData),{action:"VS_SPAWNED_AND_ATTACHED_TO_DOM",el:e.attachData.el.el,$dir:this.$dirs.CI}}onObsSinkSubscribe(e){const t=e.action,n=p((e=>this.extendedMethods(e))),r=n(this.options.hashMethods[t])(e);void 0!==r&&(e=>{this._source$.next(e)})(Object.freeze(r))}addMixins(){}}function Ir(){setTimeout((()=>{U((e=>{}),this)}),1)}class Lr{constructor(e,t,n,r="subscribe",o=!1){const i={name:e,observable:t,data:n,action:r};this.sendToDirectorStream(i)}sendToDirectorStream(e){const t=Je.channelsMap.getStream("DISPATCHER"),n=tt(e);t.next(n),e=void 0}static deepClone(t){const r=n(Array),o=n(Object);var i;return!1===r(i=t)&&!0===o(i)?e(a,c,l)(t):l(t)}static getMouseEventKeys(){return["altKey","bubbles","cancelBubble","cancelable","clientX","clientY","composed","ctrlKey","currentTarget","defaultPrevented","detail","eventPhase","fromElement","isTrusted","layerX","layerY","metaKey","movementX","movementY","offsetX","offsetY","pageX","pageY","path","relatedTarget","returnValue","screenX","screenY","shiftKey","sourceCapabilities","srcElement","target","timeStamp","toElement","type","view","which","x","y"]}addMixins(){this.gc=Ir}}const Or=!0===Je.debug;class Dr{constructor(e,t){this.addMixins(),this.props=e,this.broadcastFn=t,this.broadcaster(this.broadcastFn)}addDblClickEvt(e){return De(e,"dblclick").pipe(ur((e=>{const t=l(e);return t.typeOverRide="dblclick",t})))}broadcast(e){if(e.length<=0&&!0===Or)return void console.warn(`Spyne Warning: The nested array in ${this.props.name}.broadcastEvents appears to be empty --\x3e vsid:${this.props.vsid}!`);const t={UI:this.sendUIPayload,ROUTE:this.sendRoutePayload},[n,r,o]=e;let i,s=this.props.el.querySelectorAll(n);if(s.length<=0){const e=this.props.el,t=t=>{t===e&&(s=[t])};(()=>{const r=(null!==e.parentElement?e.parentElement:document).querySelectorAll(n);r.forEach=Array.prototype.forEach,r.forEach(t)})()}const a=void 0!==o,c=e=>{const n="dblClick"!==r?De(e,r,{preventDefault:()=>!0}):this.addDblClickEvt(e);i=e.dataset.channel;const o={};o.payload=(e=>{const t={};for(const n in e)t[n]=e[n];return t})(e.dataset),o.payload=W(["channel"],o.payload),o.channel=i,o.srcElement={},o.srcElement.id=this.props.id,o.srcElement.vsid=this.props.vsid,o.srcElement.isLocalEvent=a,o.srcElement.srcEvent=r,o.srcElement.el=e;(void 0!==i?t[i]:t.UI)(n,o)};!0===(void 0===s||s.length<=0)&&!0===Or?console.warn(`Spyne Warning: The item ${n}, does not appear to exist in ${this.props.name} --\x3e vsid:${this.props.vsid}!`):(s.forEach=Array.prototype.forEach,s.forEach(c))}broadcaster(e){e().forEach((e=>this.broadcast(e)))}addMixins(){const e={testFunc:function(e){console.log("stream mixin is ",e)},sendRoutePayload:function(e,t){return new Lr("CHANNEL_ROUTE",e,t,"subscribe")},sendUIPayload:function(e,t){return new Lr("CHANNEL_UI",e,t,"subscribe")}};this.sendUIPayload=e.sendUIPayload,this.sendRoutePayload=e.sendRoutePayload}}const Rr=e(t,n(Array)),Hr=e(t,b),wr=r([n(String),Hr]),Vr=r([n(Array),Hr]),Pr=e(r([Rr,n(Object)])),Ur=e(r([Hr,Rr,n(Object)]));class Mr{constructor(t,o={},s,a){Pr(t)&&(t=i("selector",o=t),a=a||i("testMode",o));const c=[s,i("debugLabel",o)];s=e(x(n(String)))(c);let l=W(["debugLabel","label","selector","props","testMode","propFilters"],o);void 0!==o.props?l=u([o.props,l]):void 0!==o.propFilters&&(l=u([o.propFilters,l])),o.propFilters=l;const{propFilters:d}=o,h=wr(t)?Mr.filterSelector([t],s):void 0,E=Vr(t)?Mr.filterSelector(t,s):void 0,p=Ur(d)?Mr.filterData(d,s):void 0;let N=L(v,[h,E,p]);const _=b(N);return _&&(N=[F(!1)],!0===Je.debug&&!0!==a&&console.warn(`Spyne Warning: The Channel Filter, with selector: ${t}, and propFilters:${d} appears to be empty!`)),!0===a?{selector:t,propFilters:d,debugLabel:s,filters:o,testMode:a,filtersAreEmpty:_}:r(N)}static filterData(t,r){const o=r;return(()=>{if(b(t))return F(!1);t=k(((e,t,r)=>{var o;return!0===n(String,e)?(o=e,e=>e===o):e}),t);const r=Y(t);return e(r,(e=>{if(void 0===o)return e;const n={};return H(((t,r)=>{n[r]=t(i(r,e))}),t),console.log(`%c CHANNEL PAYLOAD FILTER DEBUGGER ["${o}"] - values: `,"color:orange;",{propsBooleans:n,comparedObj:e}),e}),p({}),(e=>{const{payload:t,srcElement:n,event:r}=e||{};return Object.assign({},e,n,r,t)}))})()}static checkPayloadSelector(t,n,r){const{payload:o,srcElement:s,event:a}=r||{},c=[s,o,i("srcElement",a),r].reduce(((e,t)=>{const n=i("el",t);return Mr.elIsDomElement(n)&&void 0===e&&(e=n),e}),void 0),l=e=>e.isEqualNode(c),u=e=>{const t=$(document.querySelectorAll(e));return k(l,t)};if(void 0!==n){const r=e($,k(u))(t),o=t;console.log(`%c CHANNEL PAYLOAD FILTER DEBUGGER ["${n}"] - selectors: `,"color:orange;",{el:c,selectorsArr:o,nodeArrResultsDebugger:r})}if("object"!=typeof c)return!1;const d=e($,k(u))(t);return!0!==b(d)&&G(j(!0),d)}static elIsDomElement(t){return n(String,t)&&(t=document.querySelector(t)),e(E(0),p(-1),i("nodeType"))(t)}static filterSelector(e,t){const n=L(b,e);return z(Mr.checkPayloadSelector)(n,t)}}function Wr(){return!0===Je.debug}function xr(e,t,n=!1){const r=$r(e,t,n);return 1===r.length?_(r):r}function Fr(t,n,r){const o=document.querySelector(t),s=e(E(0),p(-1),i("nodeType"));if(null===o||!1!==s(o)){if(void 0!==n&&String(n).trim().length>0){function a(e){try{return document.querySelectorAll(e).length>0}catch(e){return!1}}const c=a(n);!0===r&&!0===Wr()&&!1===c&&console.warn(`Spyne Warning: the selector, ${n} does not exist in this el, ${t}`)}}else console.warn(`Spyne Warning: the el object is not a valid single element, ${o}`)}function $r(e,t,n=!1){let r=!1;const o=(n=>{let o=[];try{o=document.querySelectorAll(n)}catch(e){o=[]}try{r=document.querySelector(t)===document.querySelector(e),!0===r&&(o=[document.querySelector(t)])}catch(e){}return o})(void 0!==t?`${e} ${t}`:e);if(!0===n){Fr(!0===r?"body":e,t,n)}return o}function kr(e,t,n){return $r(t,n).forEach((t=>{t.style.cssText=e})),this}function Gr(t,n){function r(e){return Gr(t,e)}return Fr(t="string"==typeof t?t:function(e){let t=`${Math.random().toString(36).replace(/\d/gm,"").substring(1,8)}`;return void 0===e.dataset.vsid?e.dataset.vsid=t:t=e.dataset.vsid,`[data-vsid='${t}']`}(t),n,!1),r.map=e=>Array.from($r(t,n)).map(e),r.forEach=e=>Array.from($r(t,n)).map(e),r.getNodeListArray=()=>$r(t,n),r.addClass=e=>($r(t,n).forEach((t=>t.classList.add(e))),this),r.removeClass=e=>($r(t,n).forEach((t=>{t.classList.remove(e)})),this),r.setClass=r=>($r(t,n).forEach((t=>{const n=e(L(b),B(" "))(t.className),o=r.split(" ");n.forEach((e=>t.classList.remove(e))),o.forEach((e=>t.classList.add(e)))})),this),r.unmount=()=>{},r.toggleClass=(e,r)=>($r(t,n).forEach((t=>{(r=void 0!==r?r:!t.classList.contains(e))?t.classList.add(e):t.classList.remove(e)})),this),r.toggle=(e,t)=>(r.toggleClass(e,t),this),r.appendChild=e=>(0!==r.el.length?r.el.appendChild(e):console.warn(`Spyne Warning: The selector, ${n} does not appear to be valid!`),r.el),r.addAnimClass=e=>{requestAnimationFrame((()=>{$r(t,n).forEach((t=>{try{t.classList.add(e)}catch(e){}}))}))},r.setActiveItem=(r,o)=>{const s=$r(t,n),a="string"==typeof o?xr(t,o):o,c=e=>e.isEqualNode(a)?e.classList.add(r):e.classList.remove(r);var l;return!0===(l=a,e(E(0),p(-1),i("nodeType"))(l))?s.forEach(c):!0===Wr()&&console.warn(`Spyne Warning: The selector, ${o}, does not appear to be a valid item in setActiveItem: ${r}`),this},Object.defineProperty(r,"el",{get:()=>xr(t,n,!0)}),Object.defineProperty(r,"els",{get:()=>$r(t,n)}),Object.defineProperty(r,"len",{get:()=>$r(t,n,!1).length}),Object.defineProperty(r,"exists",{get:()=>$r(t,n,!1).length>=1}),Object.defineProperty(r,"exist",{get:()=>$r(t,n,!1).length>=1}),Object.defineProperty(r,"nodeList",{get:()=>$r(t,n)}),Object.defineProperty(r,"arr",{get:()=>{const e=xr(t,n,!0);return void 0===e?[]:void 0===e.length?[e]:Array.from(e)}}),Object.defineProperty(r,"inline",{set:e=>kr(e,t,n),get:()=>r}),Object.defineProperty(r,"inlineCss",{set:e=>kr(e,t,n),get:()=>r}),r}class jr{constructor(e={}){this.vsnum=Math.random(),this.addMixins(),this._postRenderCalled=!1,this.defaults=()=>{const t=this.createId(),n=e.id?e.id:t;return{vsid:t,id:n,tagName:"div",el:void 0,data:void 0,animateIn:!1,animateInTime:.5,animateOut:!1,animateOutTime:.5,sendLifecyleEvents:!1,hashId:`#${n}`,id$:`#${n}`,viewClass:vr,extendedSourcesHashMethods:{},debug:!1,template:void 0,node:document.createDocumentFragment(),name:it(this)}},this._state={},this.$dirs=Sr.createDirectionalFiltersObject(),this.addDefaultDirection=Sr.addDefaultDir,this.addDownInternalDir=Sr.addDownInternalDir,this.props=ke(this.defaults(),e),this.sendLifecycleMethod=!0===this.props.sendLifecyleEvents?this.sendLifecycleMethodActive.bind(this):this.sendLifecycleMethodInactive.bind(this);const t=this.attributesArray;this.props.domAttributes=R(t,this.props),void 0!==this.props.traits&&this.addTraits(this.props.traits),this.loadAllMethods(),this.props.action="LOADED",this.sink$=new Le;const n=this.props.viewClass;this.view=new n(this.sink$,{},this.props.vsid,this.props.id),this.sourceStreams=this.view.sourceStreams,this._rawSource$=this.view.getSourceStream(),this._rawSource$.viewName=this.props.name,this.sendEventsDownStream=this.sendEventsDownStreamFn,this.initViewStream(),this.isDevMode=jr.isDevMode(),this.props.addedChannels=[],this.checkIfElementAlreadyExists()}get source$(){return this._source$}get attributesArray(){return["accesskey","class","contenteditable","dir","draggable","hidden","id","lang","spellcheck","style","tabindex","title","translate","aria-autocomplete","aria-checked","aria-disabled","aria-expanded","aria-haspopup","aria-hidden","aria-invalid","aria-label","aria-level","aria-multiline","aria-multiselectable","aria-orientation","aria-pressed","aria-readonly","aria-required","aria-selected","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","aria-atomic","aria-busy","aria-live","aria-relevant","aria-dropeffect","aria-grabbed","aria-activedescendant","aria-controls","aria-describedby","aria-flowto","aria-labelledby","aria-owns","aria-posinset","aria-setsize","accept","autocomplete","autofocus","checked","dirname","disabled","form","formaction","formenctype","formmethod","formnovalidate","formtarget","list","max","maxlength","min","minlength","multiple","name","pattern","placeholder","readonly","required","size","step","value","alt","srcset","sizes","usemap","ismap","href","target","download","ping","rel","hreflang","as","media","accept-charset","action","enctype","novalidate","content","charset","http-equiv","async","defer","integrity","nomodule","nonce","referrerpolicy","autocapitalize","autoplay","buffered","challenge","cite","code","codebase","color","cols","colspan","contextmenu","controls","coords","crossorigin","csp","dataset","datetime","decoding","default","for","headers","high","icon","importance","itemprop","keytype","kind","label","language","lazyload","loop","low","manifest","method","muted","open","optimum","poster","preload","radiogroup","reversed","role","rows","rowspan","sandbox","scope","scoped","selected","shape","slot","span","srcdoc","src","type","srclang","start","summary","wrap","width","height"]}static isDevMode(){return Je.debug}static checkIfActionsAreRegistered(e=[],t){if(t.length>0){const n=t=>{const n=new RegExp(t);if(J(f(n),r)<0){const n=1===e.length?"from added channel":"from added channels";console.warn(`Spyne Warning: The action, ${t}, in ${this.props.name}, does not match any of the registered actions ${n}, ${e.join(", ")}`)}},r=(e=>{const t=e.map((e=>Je.getChannelActions(e)));return $(t)})(e);t.forEach(n)}}static isValidNestedArr(t){const r=j(!0),o=K(r),i=n(String),s=e(o,k(i),q(0,2),p([]));return e(o,k(s),p([]))(t)}static elIsDomElement(t){return n(String,t)&&(t=document.querySelector(t)),e(E(0),p(-1),i("nodeType"))(t)}updatePropsToMatchEl(){const t=e(X,Q(i("tagName"),F("")));this.props.tagName=t(this.props.el)}checkIfElementAlreadyExists(){const t=e(E(0),p(-1),i("nodeType"));P(r([e=>document.body.contains(e),t]),"el")(this.props)?(this.updatePropsToMatchEl(),this.postRender()):null===this.props.el&&console.error(`Spyne Error: The defined element for this ViewStream instance, ${this.constructor.name}, appears to not exist.`)}loadAllMethods(){const e=z(this.onChannelMethodCall.bind(this));this.addActionListeners().forEach((t=>{let[r,o,i]=t;n(String,i)&&(i=new Mr({selector:i})),this.props.extendedSourcesHashMethods[r]=e(o,i)})),this.props.hashSourceMethods=this.setSourceHashMethods(this.props.extendedSourcesHashMethods)}addActionListeners(){return[]}onChannelMethodCall(e,t,n){const r=t=>{void 0===this[e]?console.warn(`Spyne Warning: The method, ${e} does not appear to exist in ${this.constructor.name}!`):this[e](t)};if(void 0!==n.$dir&&n.$dir.includes("child")&&!0!==this.deleted){const e=ke({},n);e.$dir=this.$dirs.C,this.sourceStreams.raw$.next(e)}!0===p(F(!0),t)(n)&&r(n=W(["$dir"],n))}setSourceHashMethods(e={}){const t={EXTIRPATING:e=>this.checkParentDispose(e),EXTIRPATE:e=>this.disposeViewStream(e),VS_SPAWNED:e=>this.onVSRendered(e),VS_SPAWNED_AND_ATTACHED_TO_DOM:e=>this.onVSRendered(e),VS_SPAWNED_AND_ATTACHED_TO_PARENT:e=>this.onVSRendered(e),READY_FOR_VS_DETRITUS_COLLECT:e=>this.onReadyToGC(e),VS_NULLITY:()=>({})};return ke.all([{},t,e])}initViewStream(){this._source$=this._rawSource$.pipe(ur((e=>this.onMapViewSource(e))),yr(this.notGCSTATE)),this.initAutoMergeSourceStreams(),this.updateSourceSubscription(this._source$,!0)}notGCSTATE(e){return!e.action.includes("READY_FOR_VS_DETRITUS_COLLECT")}eqGCSTATE(e){return!e.action.includes("READY_FOR_VS_DETRITUS_COLLECT")}notCOMPLETED(e){return!e.action.includes("COMPLETED")}notGCCOMPLETE(e){return!e.action.includes("GC_COMPLETE")}testVal(e){console.log("TESTING VALL IS ",e)}addParentStream(e,t){this.parent$=e.pipe(fr((e=>void 0!==e&&void 0!==e.action)),ur((e=>{const t=ke({},e);return"EXTIRPATE_AND_READY_FOR_VS_DETRITUS_COLLECT"===t.action&&(this.disposeViewStream(t),t.action="READY_FOR_VS_DETRITUS_COLLECT"),t}))),this.updateSourceSubscription(this.parent$,!1,"PARENT"),this.renderAndAttachToParent(t)}addChildStream(e){const t=e.pipe(fr((e=>void 0!==e&&void 0!==e.action)),br((e=>this.tracer("addChildStraem do ",e))),ur((e=>e)),Tr((e=>this.onChildCompleted(t.source))));this.updateSourceSubscription(t,!0,"CHILD")}onChildDisposed(e){}onChildCompleted(e){const t=(e=>{const t=e=>{for(;void 0!==e.destination;)e=t(e.destination);return e};return R(["id","vsid"],t(e))})(e);return this.tracer("onChildCompleted ",this.vsnum,e),this.onChildDisposed(t,e),t}initAutoMergeSourceStreams(){const e={next:this.onSubscribeToSourcesNext.bind(this),error:this.onSubscribeToSourcesError.bind(this),complete:this.onSubscribeToSourcesComplete.bind(this)},t=()=>{this.props.el$=void 0,this.uberSource$.complete(),this.autoSubscriber$.complete(),this.sink$.complete(),this.props=void 0,this.deleted=!0,this.tracer("completeAll",this.deleted,this.props)},n=()=>{r-=1,0===r&&t()};let r=0;this.uberSource$=new Le;this.autoMergeSubject$=this.uberSource$.pipe(dr((e=>{const t=e.observable.pipe(fr((e=>void 0!==e&&void 0!==e.action)),ur((e=>{const t=ke({},e);return t.action=e.action,this.tracer("autoMergeSubject$",t),t})));return!1===e.autoClosesBool?t:(r+=1,t.pipe(Tr(n)))}))),this.autoSubscriber$=this.autoMergeSubject$.pipe(fr((e=>void 0!==e&&void 0!==e.action))).subscribe(e)}updateSourceSubscription(e,t=!1,n){const r={observable:e,autoClosesBool:t,rel:n};this.tracer("updateSourceSubscription ",this.vsnum,r),this.uberSource$.next(r)}onSubscribeToSourcesNext(t={}){const n=p((e=>this.sendExtendedStreams(e))),r=(i=this.props.hashSourceMethods,s=t.action,void 0!==i[s]?s:e(_,m(e(f(T,s),(e=>new RegExp(e)))))(o(i)));var i,s;n(this.props.hashSourceMethods[r])(t),this.tracer("onSubscribeToSourcesNext",{payload:t})}onSubscribeToSourcesError(e=""){console.log("ALL ERROR ",this.constructor.name,e)}onSubscribeToSourcesComplete(){this.tracer("onSubscribeToSourcesComplete","VS_DETRITUS_COLLECT"),this.openSpigot("VS_DETRITUS_COLLECT")}sendExtendedStreams(e){this.tracer("sendExtendedStreams",e),this.openSpigot(e.action,e)}renderAndAttachToParent(e){this.openSpigot("VS_SPAWN_AND_ATTACH_TO_PARENT",e)}renderView(){this.openSpigot("VS_SPAWN")}renderViewAndAttachToDom(e,t,n){const r={node:e,type:t,attachType:n};this.openSpigot("VS_SPAWN_AND_ATTACH_TO_DOM",{attachData:r})}checkParentDispose(e){"parent"===e.from$&&this.disposeViewStream(e)}onBeforeDispose(){}setTimeout(e,t=0,n=!1){window.setTimeout(((...t)=>{if(void 0!==this&&void 0!==this.props){const r=!0===n?e.bind(this):e;Z(r,t)}}),t)}disposeViewStream(e){this.onBeforeDispose(),this.openSpigot("EXTIRPATE")}onChildDispose(e){}onParentDisposing(e){this.openSpigot("EXTIRPATE")}onReadyToGC(e){const t=void 0!==e.from$&&"internal"===e.from$;this.tracer("onReadyToGC",t,e)}openSpigot(e,t={}){if(void 0!==this.props){this.props.action=e;const n=V(this.props,t);this.sink$.next(Object.freeze(n))}}setAttachData(e,t){return{node:this.props.el,type:"ViewStreamObservable",attachType:e,query:(()=>{const e=this.props.el.querySelector(t);return!0===jr.isDevMode()&&n(String,t)&&v(e)&&console.warn(`Spyne Warning: The appendView query in ${this.props.name}, '${t}', appears to not exist!`),e})()}}getParentEls(e,t){const n=e=>e.parentElement;let r=0,o=e;for(;r<t;)o=n(o),r++;return o}setAttachParentData(e,t,n){t=""!==t?t:void 0;const r=this.getParentEls(this.props.el,n);return{node:r,type:"ViewStreamObservable",attachType:e,query:r.querySelector(t)}}onMapViewSource(e={}){return this.props=V(this.props,e),e}exchangeViewsWithChild(e,t){this.addChildStream(e.sourceStreams.toParent$),e.addParentStream(this.sourceStreams.toChild$,t)}appendToDom(e){void 0!==this.props.el&&console.warn(`Spyne Warning: The ViewStream, ${this.props.name}, has an element, ${this.props.el}, that is already rendered and does not need to be appendedToDom. This may create unsusual side effects!`),this.renderViewAndAttachToDom(e,"dom","appendChild")}appendToDomAfter(e){void 0!==this.props.el&&console.warn(`Spyne Warning: The ViewStream, ${this.props.name}, has an element, ${this.props.el}, that is already rendered and does not need to be appendedToDomAfter. This may create unsusual side effects!`),this.renderViewAndAttachToDom(e,"dom","after")}prependToDom(e){void 0!==this.props.el&&console.warn(`Spyne Warning: The ViewStream, ${this.props.name}, has an element, ${this.props.el}, that is already rendered and does not need to be prependedToDom. This may create unsusual side effects!`),this.renderViewAndAttachToDom(e,"dom","prependChild")}appendView(e,t){this.exchangeViewsWithChild(e,this.setAttachData("appendChild",t))}appendViewAfter(e,t){this.exchangeViewsWithChild(e,this.setAttachData("after",t))}appendViewToParentEl(e,t,n=1){this.exchangeViewsWithChild(e,this.setAttachParentData("appendChild",t,n))}prependViewToParentEl(e,t,n=1){this.exchangeViewsWithChild(e,this.setAttachParentData("prependChild",t,n))}prependView(e,t){this.exchangeViewsWithChild(e,this.setAttachData("prependChild",t))}appendToNull(){const e=document.getElementById("spyne-null-views");this.renderViewAndAttachToDom(e,"dom","appendChild")}onVSRendered(e){"internal"===e.from$&&this.postRender()}postRender(){if(!0===this._postRenderedCalled)return;this.beforeAfterRender(),this.afterRender(),this.onRendered();if(requestAnimationFrame((()=>this.onAnimFrameAfterRendered())),!0===this.isDevMode){const e=this.broadcastEvents();!1===jr.isValidNestedArr(e)&&console.warn(`Spyne Warning: The array returned from broadcastEvents in ${this.props.name}, '${JSON.stringify(e)}', does not appear to be properly formatted!`)}this.initializeChannels(),this.viewsStreamBroadcaster=new Dr(this.props,this.broadcastEvents.bind(this)),this.afterBroadcastEvents(),this._postRenderedCalled=!0}addTraits(e){"Array"!==e.constructor.name&&(e=[e]);e.forEach((e=>{new e(this)}))}afterBroadcastEvents(){if(!0===this.isDevMode){const t=e=>e[0],r=this.addActionListeners(),o=r.map(t);if(!1===jr.isValidNestedArr(r))console.warn(`Spyne Warning: The array returned from addActionsListeners in ${this.props.name}, '${JSON.stringify(r)}', does not appear to be properly formatted!`);else{e(U((e=>{const t=p("",e[1]);!1===n(Function,this[t])&&console.warn(`Spyne Warning: The method in addActionListeners nested Array, '${JSON.stringify(e)}', in ${this.props.name}, does not appear to exist!`)})),p([]))(r)}const i=()=>{void 0!==s(["props","addedChannels"],this)&&jr.checkIfActionsAreRegistered.bind(this)(this.props.addedChannels,o)};this.setTimeout(i,500)}}setDataVSID(){this.props.el.dataset.vsid=this.props.vsid}beforeAfterRender(){this.setDataVSID(),this.props.el$=Gr(this.props.el)}downStream(){}onRendered(){}onAnimFrameAfterRendered(){}afterRender(){}broadcastEvents(){return[]}getChannel(e){return I((e=>Ze().includes(e)),(e=>Je.channelsMap.getStream(e).observer.pipe(yr((e=>!0!==this.deleted)))),(e=>console.warn(`channel name ${e} is not within ${Ze}`)))(e)}initializeChannels(){const e=e=>{const[t,n=!1]=Array.isArray(e)?e:[e];this?.addChannel(t,n)};Array.isArray(this?.props?.channels)&&this?.props?.channels?.forEach(e)}addChannel(e,t=!1,n=!1,r=!1){const o=!0===n?this.$dirs.CI:this.$dirs.I;if(!0===this?.props?.addedChannels?.includes(e))return;const i=s(["srcElement","isLocalEvent"]),a=s(["srcElement","vsid"]),c=[ur((e=>{const t=e;return t.$dir=o,t})),fr((e=>{const t=a(e);return!0!==i(e)||t===this.props.vsid}))];var l;!0===t&&c.unshift((l=1,fr((function(e,t){return l<=t}))));const u=this.getChannel(e).pipe(...c);this.updateSourceSubscription(u,!1),this.props.addedChannels.push(e)}checkIfChannelExists(e){const t=Je.channelsMap.testStream(e);return!0!==t&&console.warn(`SPYNE WARNING: The ChannelPayload from ${this.props.name}, has been sent to a channel, ${e}, that has not been registered!`),t}sendInfoToChannel(t,n={},r){const o=n,s=p("VIEWSTREAM_EVENT"),a=e(s,i(t)),c={payload:o,action:r=r||a({CHANNEL_ROUTE:"CHANNEL_ROUTE_CHANGE_EVENT"})};try{if(c.srcElement=e(R(["id","vsid","class","tagName"]),i("props"))(this),!0===this.checkIfChannelExists(t)){!1===/CHANNEL_LIFECYCLE/.test(r)&&Object.defineProperties(c,{payload:{get:()=>tt(n)}});const e=Re(c);return new Lr(t,e,c)}}catch(e){console.warn("SPYNE WARNING ",e)}}tracer(...e){this.sendLifecycleMethod(...e)}sendLifecycleMethodInactive(){}sendLifecycleMethodActive(e,t){const n="VS_DETRITUS_COLLECT"===t;!0===Y({from$:j("internal"),action:j("VS_SPAWNED_AND_ATTACHED_TO_PARENT")},t)?this.sendInfoToChannel("CHANNEL_LIFECYCLE",{action:"CHANNEL_LIFECYCLE_RENDERED_EVENT"},"CHANNEL_LIFECYCLE_RENDERED_EVENT"):!0===n&&this.sendInfoToChannel("CHANNEL_LIFECYCLE",{action:"CHANNEL_LIFECYCLE_DISPOSED_EVENT"},"CHANNEL_LIFECYCLE_DISPOSED_EVENT")}createActionFilter(e,t){return new Mr(e,t)}isLocalEvent(e){const t=s(["srcElement","el"],e),n=s(["props","el"],this);return jr.elIsDomElement(n)&&jr.elIsDomElement(t)&&n.contains(t)}addMixins(){const e=rt();this.createId=e.createId}}class zr{constructor(e){const t=String(e.props.name),n=`${t}_ROUTE_UPDATER`;return z(zr.createTemporaryViewStreamObj)({id:n,name:t})}static createTemporaryViewStreamObj(e,t){const{name:n,id:r}=e,o=t,i=new jr({id:r,name:n,data:t});i.onRendered=()=>{i.sendInfoToChannel("CHANNEL_ROUTE",o)},i.afterBroadcastEvents=()=>{i.disposeViewStream()},i.appendToNull()}}class Yr{constructor(e,t={}){this.addRegisteredActions.bind(this),this.createChannelActionsObj(e,t.extendedActionsArr),t.name=e,t.defaultActions=void 0!==t.data?[`${t.name}_EVENT`]:[],this.props=t,this.props.isRegistered=!1,this.props.isProxy=void 0!==this.props.isProxy&&this.props.isProxy;const n=void 0!==this.props.data;this.props.sendCachedPayload=void 0===this.props.sendCachedPayload?n:this.props.sendCachedPayload,this.sendPayloadToRouteChannel=new zr(this),this.createChannelActionMethods(),this.streamsController=Je.channelsMap;const r=this.getMainObserver();this.checkForPersistentDataMode=Yr.checkForPersistentDataMode.bind(this),this.observer$=this.props.observer=r;const o=this.streamsController.getStream("DISPATCHER"),i=ee(t.name,"name");o.pipe(fr(i)).subscribe((e=>this.onReceivedObservable(e)))}getMainObserver(){void 0===this.streamsController&&console.warn(`Spyne Warning: The following channel, ${this.props.name}, appears to be registered before Spyne has been initialized.`);return!0===this.streamsController.testStream(this.props.name)?this.streamsController.getProxySubject(this.props.name,this.props.sendCachedPayload):!0===this.props.sendCachedPayload?new He(1):new Le}onChannelInitialized(){}onRegistered(e=this.props){if(void 0!==e.data){const t=Object.keys(this.channelActions)[0];this.sendChannelPayload(t,e.data)}}get isProxy(){return this.props.isProxy}get channelName(){return this.props.name}get observer(){return this.observer$}checkForTraits(){const e=e=>{"Array"!==e.constructor.name&&(e=[e]);e.forEach((e=>new e(this)))};void 0!==this.props.traits&&e(this.props.traits)}initializeStream(){this.checkForTraits(),this.onChannelInitialized(),this.checkForPersistentDataMode(),this.onRegistered(),this.props.isRegistered=!0}static checkForPersistentDataMode(e=this.props,t=this.channelActions){const n=b(t),r=void 0!==i("data",e);return!0===n&&!0===r&&(e.sendCachedPayload=!0,t=(()=>{const{name:t}=e,n=`${t}_EVENT`;return{[n]:n}})(),void 0!==this.channelActions&&(this.channelActions=t)),{props:e,actionsObj:t}}setTrace(e){}createChannelActionsObj(e,t=[]){const r=I(n(String),te,_),o=t.concat(this.addRegisteredActions(e)),i=k(r,o),s=u(ne((e=>re(e,e)),i));this.channelActions=s}createChannelActionMethods(){const e=I(n(String),te,_),t=(e,t)=>{window.setTimeout((()=>{"function"!=typeof this[e]&&console.warn(`"${this.props.name}", REQUIRES THE FOLLOWING METHOD ${e} FOR ACTION, ${t[0]}`)}),100)},r=I(n(String),F("onViewStreamInfo"),(e=>{const n=oe(ie(1),e);return t(n,e),n}));this.channelActionMethods=a(k((t=>[e(t),r(t)]),this.addRegisteredActions()))}addRegisteredActions(){let e=[];return s(["props","data"],this)&&(e=[`${this.props.name}_EVENT`]),e}onReceivedObservable(e){this.onIncomingObservable(e)}getActionMethodForObservable(e){e.unpacked=!0;const t=this.onViewStreamInfo.bind(this),n=s(["data","action"],e),r=i(n,this.channelActionMethods);let o=t;if(void 0!==r&&"onViewStreamInfo"!==r){!0===("function"==typeof this[r])&&(o=this[r].bind(this))}return o}onIncomingObservable(e){const t=j(e.name,this.props.name),{action:n,payload:r,srcElement:o}=e.data,s=t=>({clone:()=>{return t=e.data,u([t,{action:i("action",t)},i("payload",t),i("srcElement",t)]);var t},action:n,payload:r,srcElement:o,event:t});return!0===t?(e=>e.observable.pipe(ur(s)).subscribe(this.getActionMethodForObservable(e)))(e):void 0}onViewStreamInfo(e){}sendChannelPayload(e,t,n={},r={},o=this.observer$){const i=new nt(this.props.name,e,t,n,r);o.next(i)}getChannel(e,t){return I((e=>Ze().includes(e)),(e=>{const n=this.streamsController.getStream(e).observer;return void 0!==t?n.pipe(fr(t)):n}),(e=>console.warn(`channel name ${e} is not within ${Ze}`)))(e)}static checkForNotTrackFlag(e={}){!0===e.doNotTrack&&Je.doNotTrackChannel(e.channelName)}}class Br{constructor(){this.checkIfObjIsNotEmptyOrNil=Br.checkIfObjIsNotEmptyOrNil.bind(this)}static checkIfObjIsNotEmptyOrNil(t){const n=e(y(b),_,S),o=e(y(v),_,S);return r([n,o])(t)}static checkIfParamValueMatchesRegex(t,r){const s=L(j("routeName")),a=e(s,o),c=e(x((e=>f(new RegExp(e),t))),a)(r);return n(String,c)&&(r=se(t,i(c,r),r)),r}static formatStrAsWindowLocation(e){return{hash:e,search:e,pathname:e}}static getLocationStrByType(e,t=!1,n=window.location){return i({slash:"pathname",query:"search",hash:"hash"}[!0===t?"hash":e],n).replace(/^(\/)?(#)?(\/)?(.*)$/,"$4")}static createRouteArrayFromParams(e,t,r="slash",o){const s=[],a=t=>{const r={},c=t.routeName;let l=void 0!==e[c]?e[c]:i(c,o);const u=typeof t[l];"string"===u?l=t[l]:"undefined"===u&&(t=this.checkIfParamValueMatchesRegex(l,t)),r[c]=l,this.checkIfObjIsNotEmptyOrNil(r)&&s.push(r);const d=n(Object,t),h=Ne(l,t),E=Ne("routePath",t);if(!0===(h&&d)){const e=t[l];Ne("routePath",e)&&a(e.routePath)}else!0===E&&void 0!==l&&a(t.routePath)};return a(t),s}static createSlashString(t){const n=L(v),r=ae(y(v,T),ce("/")),o=le(/^(\^*)(.*|^\$)(\$)$/,"$2");return e(o,r,n,$,k(S))(t)}static createQueryString(t){const n=L(v),r=this.checkIfObjIsNotEmptyOrNil,o=e(ce("="),$,c),i=I(r,o,F(void 0)),s=k(i),a=ae(y(b),A("?"));return e(a,ce("&"),n,s)(t)}static checkPayloadForRegexOverrides(t,n,r="Value"){const s=e((e=>i(`${e}${r}`,n)),_,o);return k((t=>{const n=s(t);return void 0!==n?se(e(_,o)(t),n,t):t}),t)}static checkForRouteValWithMultipleVals(e){const t=e=>{const t=(t,n)=>(t[n]=(e=>{const t=e.match(/^[^|]*/);return t?"^$"===t[0]?"":t[0]:e})(e[n]),t);return"object"==typeof e&&(e=Object.keys(e).reduce(t,{})),e};return!0===Array.isArray(e)?e.map(t):e}static checkForRouteValsPartMatch(e,t={}){const n=(e,t)=>t.split("|").some((t=>((e,t)=>{const n=e.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,"[\\w\\d_-]*");return new RegExp(`^${n}$`).test(t)})(t,e)))?e:t;return e.map((e=>{const r={...e};return Object.keys(r).forEach((e=>{Object.prototype.hasOwnProperty.call(r,e)&&t[e]&&(r[e]=n(t[e],r[e]))})),r}))}static convertParamsToRoute(e,t=Je.config.channels.ROUTE,n,r){const o=void 0!==n?n:t.type,i=t.isHash,s=t.routes.routePath,a=void 0!==r?r:this.getLocationStrByType(o,i),c=this.convertRouteToParams(a,t,o).routeData;let l=this.createRouteArrayFromParams(e,s,o,c);return l=Br.checkPayloadForRegexOverrides(l,e),l=Br.checkForRouteValWithMultipleVals(l),"query"===o?this.createQueryString(l):this.createSlashString(l)}static findIndexOfMatchedStringOrRegex(t,n){const r=le(/^$/,"^$"),o=Q(ee(t,"str"),e(f(T,t),i("re")));return e(ue(j(!0)),k(o),k((e=>{return{str:e,re:(t=e,new RegExp(t))};var t})),k(r))(n)}static checkIfValueShouldMapToParam(t,r,o){const s=e(k(de),k(m(n(String))),c)(t),a=Br.findIndexOfMatchedStringOrRegex(r,s);let l=r;if(a>=0){const r=s[a],o=he(t),c=e(_,p([]),i(r))(o);!0===/^([-$\w]*)$/.test(c)&&!0===n(String,c)&&(l=c)}return l}static createArrFromSlashStr(e){return e.replace(/^([/])?(.*)$/,"$2").split("/")}static convertSlashRouteStrToParamsObj(e,t,n){const r=t,o=this.createArrFromSlashStr(t),i=[],a=[];let c=e;Ee(((e,t)=>{const r=this.checkIfValueShouldMapToParam(c,t,n);c=this.checkIfParamValueMatchesRegex(t,c);const o=Q(b,v);void 0!==c&&(e=>e!==de(i))(c.routeName)&&!1===o(r)&&(i.push(c.routeName),a.push(r));const l=s([t,"routePath"],c),u=s(["routePath"],c);void 0!==l?c=l:void 0!==u&&(c=u)}),0,o);const l=pe(i,a),u=this.getLastArrVal(i);return{paths:i,pathInnermost:u,routeData:l,routeValue:r}}static getLastArrVal(e){return void 0!==de(t=e)?de(t):"";var t}static createDefaultParamFromEmptyStr(e,t){const n={};return n[e.routeName]=this.checkIfValueShouldMapToParam(e,t),n}static convertQueryStrToParams(t,n,r){const i=n,s=n.replace(/^([?])?(.*)$/,"$2"),c=e(k(B("=")),B("&"))(s);let l=a(c),u=k(_,c);!0===b(n)&&(l=this.createDefaultParamFromEmptyStr(t,n,r),u=o(l));return{paths:u,pathInnermost:this.getLastArrVal(u),routeData:l,routeValue:i}}static convertRouteToParams(e,t,n){if(void 0===t)return{};const r=void 0!==n?n:t.type,o=p({},i("regexTokens",t)),s=t.routes.routePath;return"query"===r?this.convertQueryStrToParams(s,e):(e=e.replace(/\/$|$/,"/"),this.convertSlashRouteStrToParamsObj(s,e,o))}}class Kr{constructor(){this.createPopStateStream=Kr.createPopStateStream.bind(this)}static createPopStateStream(e){we((function(e){window.onpopstate=e}),(function(){window.onpopstate=function(){}})).subscribe(e)}static getLastArrVal(e){return void 0!==de(t=e)?de(t):"";var t}static compareRouteKeywords(t={},n){const r=(e,t)=>void 0!==t?R(t,e):e;let s=r(t,n);return{pickValues:r,compare:(t={},n)=>{const a=r(t,n),c=t=>e(o,m(ee(!0,t))),l=e(k((e=>{const t=i(e,s),n=i(e,a),r=j(t,n),o=void 0!==t,c=void 0!==n,l=!r,u=!1===o&&!0===c,d=!0===o&&!1===c,h={};return h[e]={same:r,changed:l,added:u,removed:d,previousExists:o,nextExists:c},h})),g,ne(o))([s,a]),u=ne(c("changed"),l),d=ne(c("added"),l),h=ne(c("removed"),l);return s=a,{pathsAdded:d,pathsRemoved:h,pathsChanged:u}},getComparer:()=>s}}static getRouteArrData(e,t){const n=m(d(T,e),t);return{paths:n,pathInnermost:Kr.getLastArrVal(n)}}static flattenConfigObject(e){const t=e=>ne((([e,n])=>"[object Object]"===Object.prototype.toString.call(n)?k((([t,n])=>[`${e}.${t}`,n]),t(n)):[[e,n]]),c(e));return S(a(t(e)))}static addRouteDatasets(t){const{type:r,isHash:a}=t,u=e=>{const n="query"===r?"":!0===a?"#":"/",o=Br.convertParamsToRoute(e,t);return n+o.replace(/^(.*\/)([\w-]*\/?)(.*)$/gm,"$1$2")},h=/^([A-Za-z0-9_-])+$/m,E=(e=[],t,r={})=>{let{routeName:a}=t;return c(t).reduce(((t,c)=>{const[d,p]=c,N=n(Object,p),_=e=>f(h,e)?(e=>String(e).replace(/([-_])/g," ").toUpperCase())(e):d;if("routeName"===d||"404"===d)return t;a=a||i("routeName",p);let m=l(r);if(m[a]=String(d).replace(/([^A-Za-z0-9-_])/g,""),!0===N){if(1===o(m).length){const e=s(["routePath","routeName"],p);if(e){const n=l(m);n[e]="",n.navLevel=o(r).length,n.title=_(d),n.href=u(n),t.push(n)}}m=E(e,p,m)}else m.title=_(d),m.href=u(m);return m.navLevel=o(r).length,t.push(m),t}),[])},p=E([],t.routes),N=$(p);return{routeDatasetsArr:N,routeNamesArr:(t=>{const n=L(d(T,["title","href","navLevel"]));return e(g,n,$,k(o))(t)})(N)}}static conformRouteObject(t={},r=!1){const o=s(["channels","ROUTE"],t);let{add404s:i}=void 0!==o?o:t;i=i||r;const l=e=>{const t=e[1],r=n(Array,t);return""===t?e[1]="^$":r&&(e[1]=t.join("|")),e},u=e(a,k((t=>{const[r,o]=t,s=i?{404:".+"}:{},d=n(Object,o),h=n(Array,o),E="routePath"===r;return!0===d&&!1===h&&(t[1]=u(t[1]),E&&(t[1]=e(_e(s),a,k(l),c)(t[1]))),t})),c);if(void 0!==o){t.channels.ROUTE=u(t.channels.ROUTE);const e=Kr.addRouteDatasets(t.channels.ROUTE);return t.channels.ROUTE=V(t.channels.ROUTE,e),t}return u(t)}static getLocationData(){return h(["href","origin","protocol","host","hostname","port","pathname","search","hash"],window.location)}}class qr extends Yr{constructor(e="CHANNEL_ROUTE",t={}){t.sendCachedPayload=!0,super("CHANNEL_ROUTE",t),this.createChannelActionsObj(),this.routeConfigJson=this.getRouteConfig(),this.bindStaticMethods(),this.navToStream$=new He(1),this.observer$=this.navToStream$.pipe(ur((e=>this.onMapNext(e)))),this.compareRouteKeywords=Kr.compareRouteKeywords()}checkConfigForHash(){!0===("hash"===Je.config.channels.ROUTE.type)&&(Je.config.channels.ROUTE.type="slash",Je.config.channels.ROUTE.isHash=!0)}onRegistered(){this.checkConfigForHash(),this.initStream()}createChannelActionsObj(){const e=this.addRegisteredActions(),t=u(ne((e=>re(e,e)),e));this.channelActions=t}addRegisteredActions(){return["CHANNEL_ROUTE_DEEPLINK_EVENT","CHANNEL_ROUTE_CHANGE_EVENT","CHANNEL_ROUTE_CONFIG_UPDATED_EVENT",["CHANNEL_ROUTE_UPDATE_CONFIG_EVENT","updateRouteConfig"]]}updateRouteConfig(e){const t=R(["isHash","isHidden","routes","type"],e.payload);Je.config.channels.ROUTE=V(Je.config.channels.ROUTE,t),Je.conformRouteConfig();const n=this.getRouteConfig();this.routeConfigJson=n,this.bindStaticMethodsWithConfigData(),this.sendChannelPayload("CHANNEL_ROUTE_CONFIG_UPDATED_EVENT",n,{},{},this.navToStream$)}getRouteConfig(){const e=Je.config,t=s(["channels","ROUTE"],e);"query"===t.type&&(t.isHash=!1);const n=Kr.flattenConfigObject(t.routes);return t.paramsArr=n,t}initStream(){this.firstLoadStream$=new He(1),this.onIncomingDomEvent(void 0,this.routeConfigJson,"CHANNEL_ROUTE_DEEPLINK_EVENT"),Kr.createPopStateStream(this.onIncomingDomEvent.bind(this)),this.observer$=Ve(this.firstLoadStream$,this.navToStream$)}onMapNext(e,t=!1){return e.action="CHANNEL_ROUTE_CHANGE_EVENT",e}static removeSSID(e){const t=me(["routeData"]);return fe(t,W(["vsid"]))(e)}static onIncomingDomEvent(e,t=this.routeConfigJson,r){const o=void 0!==r?r:this.channelActions.CHANNEL_ROUTE_CHANGE_EVENT,a=s(["state","routeCount"],e),c=!0===n(Number,a);let l=this.getDataFromString(t,c);!0===c&&(l.routeCount=a),"CHANNEL_ROUTE_DEEPLINK_EVENT"===r&&(l.linksData=i("routeDatasetsArr",t));const u=this.compareRouteKeywords.compare(l.routeData,l.paths);l=V(l,u),this.sendChannelPayload(o,l,void 0,e,this.navToStream$)}static checkForRouteParamsOverrides(e){return e}static checkForEventMethods(t){const n=e(m(f(/^(event)([A-Z].*)([A-Z].*)$/gm)),o,i("payload"))(t);if(n.length>=1){const e=i("event",t);if(void 0!==e){const t=le(/^(event)([A-Z])(.*)([A-Z].*)$/gm,((e,t,n,r,o)=>String(n).toLowerCase()+r+o)),r=n=>{const r=t(n);void 0!==e[r]&&e[r]()};n.forEach(r)}}return t}static checkForEndRoute(t,r=this.routeConfigJson,a){if(!0!==e(j("true"),s(["payload","endRoute"]))(t))return t;const l=void 0!==a?a:!0===Je.debug,{payload:u}=t;let d=0;const h=(t=[],r)=>{const s=r[1],{routePath:a}=s,E=i("routeName",a),p=(t=>{const n=i("routeName",t);if(n){const r=e(o,W(["routeName"]))(t),i=u[n];return x((e=>new RegExp(`^${e}$`).test(i)),r)}})(a),N=n(Object,s),_=n(Array,s);if(d+=1,!0===N&&!1===_){const n=a[p];n?e(Te,Ee(h,t),c)({nextRoutePath:n}):1===d?l&&console.warn(`Spyne Warning: use of end route method should add start route value of "${E}".`):t.push(E)}return t},{routes:E}=r,p=e(Te,Ee(h,[]),c)({routes:E});if(1===p.length){const e=p[0];t.payload[e]=""}return t}onViewStreamInfo(e){const t=this.channelActions.CHANNEL_ROUTE_CHANGE_EVENT;qr.checkForEventMethods(e),e=this.checkForEndRoute(e);let n=this.getDataFromParams(e);const r=i("srcElement",e),o=i("event",e),s=!n.isHidden,a=this.compareRouteKeywords.compare(n.routeData,n.paths);n=V(n,a),this.sendRouteStream(n,s),n=qr.removeSSID(n),this.sendChannelPayload(t,n,r,o,this.navToStream$)}static checkAndConvertStrWithRegexTokens(e,t){return o(t)}sendRouteStream(e,t=!0){!0===t&&this.setWindowLocation(e)}static getRouteState(){return"CHANNEL_ROUTE_CHANGE_EVENT"}static getIsDeepLinkBool(e){return!1===e&&0===this._routeCount}static getRouteCount(e=!1){return void 0===this._routeCount?(this._routeCount=0,this._routeCount):(!1===e&&(this._routeCount+=1),this._routeCount)}static getExtraPayloadParams(e=this.routeConfigJson,t=!1){return{routeCount:this.getRouteCount(t),isDeepLink:this.getIsDeepLinkBool(t),isHash:e.isHash,isHistory:t,isHidden:e.isHidden,routeType:e.type}}static getDataFromParams(e,t=this.routeConfigJson){let n=i("payload",e);const r=this.getRouteStrFromParams(n,t),o=(e,n)=>p(n,i(e,t)),s=o("type","slash"),a=o("isHash",!1),c=Br.formatStrAsWindowLocation(r),l=this.getDataFromLocationStr(s,a,c),{pathInnermost:u,paths:d}=l;n=V(l.routeData,n);const{routeCount:h,isDeepLink:E,isHash:N,isHistory:_,isHidden:m,routeType:f}=this.getExtraPayloadParams(t);return{isDeepLink:E,routeCount:h,pathInnermost:u,paths:d,routeData:n,routeValue:r,isHash:N,isHidden:m,isHistory:_,routeType:f}}static getDataFromString(e=this.routeConfigJson,t=!1){const n=e.type,r=!0===e.isHash,o=Br.getLocationStrByType(n,r),{paths:i,pathInnermost:s,routeData:a,routeValue:c}=qr.getParamsFromRouteStr(o,e,n),{routeCount:l,isDeepLink:u,isHash:d,routeType:h,isHidden:E}=this.getExtraPayloadParams(e,t);return{isDeepLink:u,routeCount:l,pathInnermost:s,paths:i,routeData:a,routeValue:c,isHash:d,isHidden:E,isHistory:t,routeType:h}}static getDataFromLocationStr(e="slash",t=this.routeConfigJson.isHash,n=window.location){const r=void 0!==this.routeConfigJson?this.routeConfigJson.type:e,o=Br.getLocationStrByType(r,t,n),{paths:i,pathInnermost:s,routeData:a,routeValue:c}=this.getParamsFromRouteStr(o,this.routeConfigJson,r);return{paths:i,pathInnermost:s,routeData:a,routeValue:c,action:this.getRouteState()}}static getLocationData(){return h(["href","origin","protocol","host","hostname","port","pathname","search","hash"],window.location)}static getRouteStrFromParams(e,t,n){const r=void 0!==n?n:t.type;return Br.convertParamsToRoute(e,t,r)}static getParamsFromRouteStr(e,t,n){const r=void 0!==n?n:t.type;return Br.convertRouteToParams(e,t,r)}checkEmptyRouteStr(e,t=!1){const n=b(e);return!0===(!0===n&&!1===t)||!0===(!0===n&&!0===t)?"/":!0===(!1===n&&!0===t)?A("#",e):e}static removeLastSlash(e){return e.replace(/^(.*)(\/)$/,"$1")}setWindowLocation(t){let{isHash:n,routeValue:r,routeType:o}=t;r=this.checkEmptyRouteStr(r,n);const{routeCount:i}=t;if(!0===n||"query"===o){r=qr.removeLastSlash(window.location.pathname)+r,window.history.pushState({routeCount:i},"",r)}else{const t=ae(e(y(j("/")),_),A("/",T));window.history.pushState({routeCount:i},"",t(r))}}getWindowLocation(){return window.location.pathname}bindStaticMethods(){this.checkForEndRoute=qr.checkForEndRoute.bind(this),this.getIsDeepLinkBool=qr.getIsDeepLinkBool.bind(this),this.getDataFromLocationStr=qr.getDataFromLocationStr.bind(this),this.onIncomingDomEvent=qr.onIncomingDomEvent.bind(this),this.getDataFromString=qr.getDataFromString.bind(this),this.getParamsFromRouteStr=qr.getParamsFromRouteStr.bind(this),this.getLocationData=qr.getLocationData.bind(this),this.getRouteState=qr.getRouteState.bind(this),this.getDataFromParams=qr.getDataFromParams.bind(this),this.getRouteCount=qr.getRouteCount.bind(this),this.getExtraPayloadParams=qr.getExtraPayloadParams.bind(this),this.bindStaticMethodsWithConfigData()}bindStaticMethodsWithConfigData(){const e=Ae(3,qr.getRouteStrFromParams);this.getRouteStrFromParams=e(T,this.routeConfigJson,this.routeConfigJson.type)}}class Xr extends Yr{constructor(e="CHANNEL_UI",t={}){t.sendCachedPayload=!1,super(e,t),this.keyEventsLoaded=!1,this.keyCodeArr=[]}addRegisteredActions(){return["CHANNEL_UI_DOMCONTENTLOADED_EVENT","CHANNEL_UI_ABORT_EVENT","CHANNEL_UI_ACTIVATE_EVENT","CHANNEL_UI_ADDTRACK_EVENT","CHANNEL_UI_AFTERPRINT_EVENT","CHANNEL_UI_AFTERSCRIPTEXECUTE_EVENT","CHANNEL_UI_ANIMATIONCANCEL_EVENT","CHANNEL_UI_ANIMATIONEND_EVENT","CHANNEL_UI_ANIMATIONITERATION_EVENT","CHANNEL_UI_ANIMATIONSTART_EVENT","CHANNEL_UI_APPINSTALLED_EVENT","CHANNEL_UI_AUDIOEND_EVENT","CHANNEL_UI_AUDIOSTART_EVENT","CHANNEL_UI_AUXCLICK_EVENT","CHANNEL_UI_BEFOREINPUT_EVENT","CHANNEL_UI_BEFOREPRINT_EVENT","CHANNEL_UI_BEFOREUNLOAD_EVENT","CHANNEL_UI_BEGINEVENT_EVENT","CHANNEL_UI_BLOCKED_EVENT","CHANNEL_UI_BLUR_EVENT","CHANNEL_UI_BOUNDARY_EVENT","CHANNEL_UI_BUFFEREDAMOUNTLOW_EVENT","CHANNEL_UI_CANCEL_EVENT","CHANNEL_UI_CANPLAY_EVENT","CHANNEL_UI_CANPLAYTHROUGH_EVENT","CHANNEL_UI_CHANGE_EVENT","CHANNEL_UI_CLICK_EVENT","CHANNEL_UI_CLOSE_EVENT","CHANNEL_UI_CLOSING_EVENT","CHANNEL_UI_COMPLETE_EVENT","CHANNEL_UI_COMPOSITIONEND_EVENT","CHANNEL_UI_COMPOSITIONSTART_EVENT","CHANNEL_UI_COMPOSITIONUPDATE_EVENT","CHANNEL_UI_CONNECT_EVENT","CHANNEL_UI_CONNECTIONSTATECHANGE_EVENT","CHANNEL_UI_CONTENTDELETE_EVENT","CHANNEL_UI_CONTEXTMENU_EVENT","CHANNEL_UI_COPY_EVENT","CHANNEL_UI_CUECHANGE_EVENT","CHANNEL_UI_CUT_EVENT","CHANNEL_UI_DATACHANNEL_EVENT","CHANNEL_UI_DBLCLICK_EVENT","CHANNEL_UI_DEVICECHANGE_EVENT","CHANNEL_UI_DEVICEMOTION_EVENT","CHANNEL_UI_DEVICEORIENTATION_EVENT","CHANNEL_UI_DRAG_EVENT","CHANNEL_UI_DRAGEND_EVENT","CHANNEL_UI_DRAGENTER_EVENT","CHANNEL_UI_DRAGLEAVE_EVENT","CHANNEL_UI_DRAGOVER_EVENT","CHANNEL_UI_DRAGSTART_EVENT","CHANNEL_UI_DROP_EVENT","CHANNEL_UI_DURATIONCHANGE_EVENT","CHANNEL_UI_EMPTIED_EVENT","CHANNEL_UI_END_EVENT","CHANNEL_UI_ENDEVENT_EVENT","CHANNEL_UI_ENDED_EVENT","CHANNEL_UI_ENTERPICTUREINPICTURE_EVENT","CHANNEL_UI_ERROR_EVENT","CHANNEL_UI_FOCUS_EVENT","CHANNEL_UI_FOCUSIN_EVENT","CHANNEL_UI_FOCUSOUT_EVENT","CHANNEL_UI_FORMDATA_EVENT","CHANNEL_UI_FULLSCREENCHANGE_EVENT","CHANNEL_UI_FULLSCREENERROR_EVENT","CHANNEL_UI_GAMEPADCONNECTED_EVENT","CHANNEL_UI_GAMEPADDISCONNECTED_EVENT","CHANNEL_UI_GATHERINGSTATECHANGE_EVENT","CHANNEL_UI_GESTURECHANGE_EVENT","CHANNEL_UI_GESTUREEND_EVENT","CHANNEL_UI_GESTURESTART_EVENT","CHANNEL_UI_GOTPOINTERCAPTURE_EVENT","CHANNEL_UI_HASHCHANGE_EVENT","CHANNEL_UI_ICECANDIDATE_EVENT","CHANNEL_UI_ICECANDIDATEERROR_EVENT","CHANNEL_UI_ICECONNECTIONSTATECHANGE_EVENT","CHANNEL_UI_ICEGATHERINGSTATECHANGE_EVENT","CHANNEL_UI_INPUT_EVENT","CHANNEL_UI_INPUTSOURCESCHANGE_EVENT","CHANNEL_UI_INSTALL_EVENT","CHANNEL_UI_INVALID_EVENT","CHANNEL_UI_KEYDOWN_EVENT","CHANNEL_UI_KEYUP_EVENT","CHANNEL_UI_LANGUAGECHANGE_EVENT","CHANNEL_UI_LEAVEPICTUREINPICTURE_EVENT","CHANNEL_UI_LOAD_EVENT","CHANNEL_UI_LOADEDDATA_EVENT","CHANNEL_UI_LOADEDMETADATA_EVENT","CHANNEL_UI_LOADEND_EVENT","CHANNEL_UI_LOADSTART_EVENT","CHANNEL_UI_LOSTPOINTERCAPTURE_EVENT","CHANNEL_UI_MARK_EVENT","CHANNEL_UI_MERCHANTVALIDATION_EVENT","CHANNEL_UI_MESSAGE_EVENT","CHANNEL_UI_MESSAGEERROR_EVENT","CHANNEL_UI_MOUSEDOWN_EVENT","CHANNEL_UI_MOUSEENTER_EVENT","CHANNEL_UI_MOUSELEAVE_EVENT","CHANNEL_UI_MOUSEMOVE_EVENT","CHANNEL_UI_MOUSEOUT_EVENT","CHANNEL_UI_MOUSEOVER_EVENT","CHANNEL_UI_MOUSEUP_EVENT","CHANNEL_UI_MUTE_EVENT","CHANNEL_UI_NEGOTIATIONNEEDED_EVENT","CHANNEL_UI_NOMATCH_EVENT","CHANNEL_UI_NOTIFICATIONCLICK_EVENT","CHANNEL_UI_OFFLINE_EVENT","CHANNEL_UI_ONLINE_EVENT","CHANNEL_UI_OPEN_EVENT","CHANNEL_UI_ORIENTATIONCHANGE_EVENT","CHANNEL_UI_PAGEHIDE_EVENT","CHANNEL_UI_PAGESHOW_EVENT","CHANNEL_UI_PASTE_EVENT","CHANNEL_UI_PAUSE_EVENT","CHANNEL_UI_PAYERDETAILCHANGE_EVENT","CHANNEL_UI_PAYMENTMETHODCHANGE_EVENT","CHANNEL_UI_PLAY_EVENT","CHANNEL_UI_PLAYING_EVENT","CHANNEL_UI_POINTERCANCEL_EVENT","CHANNEL_UI_POINTERDOWN_EVENT","CHANNEL_UI_POINTERENTER_EVENT","CHANNEL_UI_POINTERLEAVE_EVENT","CHANNEL_UI_POINTERLOCKCHANGE_EVENT","CHANNEL_UI_POINTERLOCKERROR_EVENT","CHANNEL_UI_POINTERMOVE_EVENT","CHANNEL_UI_POINTEROUT_EVENT","CHANNEL_UI_POINTEROVER_EVENT","CHANNEL_UI_POINTERUP_EVENT","CHANNEL_UI_POPSTATE_EVENT","CHANNEL_UI_PROGRESS_EVENT","CHANNEL_UI_PUSH_EVENT","CHANNEL_UI_PUSHSUBSCRIPTIONCHANGE_EVENT","CHANNEL_UI_RATECHANGE_EVENT","CHANNEL_UI_READYSTATECHANGE_EVENT","CHANNEL_UI_REJECTIONHANDLED_EVENT","CHANNEL_UI_REMOVETRACK_EVENT","CHANNEL_UI_REMOVESTREAM_EVENT","CHANNEL_UI_REPEATEVENT_EVENT","CHANNEL_UI_RESET_EVENT","CHANNEL_UI_RESIZE_EVENT","CHANNEL_UI_RESOURCETIMINGBUFFERFULL_EVENT","CHANNEL_UI_RESULT_EVENT","CHANNEL_UI_RESUME_EVENT","CHANNEL_UI_SCROLL_EVENT","CHANNEL_UI_SEARCH_EVENT","CHANNEL_UI_SEEKED_EVENT","CHANNEL_UI_SEEKING_EVENT","CHANNEL_UI_SELECT_EVENT","CHANNEL_UI_SELECTEDCANDIDATEPAIRCHANGE_EVENT","CHANNEL_UI_SELECTEND_EVENT","CHANNEL_UI_SELECTIONCHANGE_EVENT","CHANNEL_UI_SELECTSTART_EVENT","CHANNEL_UI_SHIPPINGADDRESSCHANGE_EVENT","CHANNEL_UI_SHIPPINGOPTIONCHANGE_EVENT","CHANNEL_UI_SIGNALINGSTATECHANGE_EVENT","CHANNEL_UI_SLOTCHANGE_EVENT","CHANNEL_UI_SOUNDEND_EVENT","CHANNEL_UI_SOUNDSTART_EVENT","CHANNEL_UI_SPEECHEND_EVENT","CHANNEL_UI_SPEECHSTART_EVENT","CHANNEL_UI_SQUEEZE_EVENT","CHANNEL_UI_SQUEEZEEND_EVENT","CHANNEL_UI_SQUEEZESTART_EVENT","CHANNEL_UI_STALLED_EVENT","CHANNEL_UI_START_EVENT","CHANNEL_UI_STATECHANGE_EVENT","CHANNEL_UI_STORAGE_EVENT","CHANNEL_UI_SUBMIT_EVENT","CHANNEL_UI_SUCCESS_EVENT","CHANNEL_UI_SUSPEND_EVENT","CHANNEL_UI_TIMEOUT_EVENT","CHANNEL_UI_TIMEUPDATE_EVENT","CHANNEL_UI_TOGGLE_EVENT","CHANNEL_UI_TONECHANGE_EVENT","CHANNEL_UI_TOUCHCANCEL_EVENT","CHANNEL_UI_TOUCHEND_EVENT","CHANNEL_UI_TOUCHMOVE_EVENT","CHANNEL_UI_TOUCHSTART_EVENT","CHANNEL_UI_TRACK_EVENT","CHANNEL_UI_TRANSITIONCANCEL_EVENT","CHANNEL_UI_TRANSITIONEND_EVENT","CHANNEL_UI_TRANSITIONRUN_EVENT","CHANNEL_UI_TRANSITIONSTART_EVENT","CHANNEL_UI_UNHANDLEDREJECTION_EVENT","CHANNEL_UI_UNLOAD_EVENT","CHANNEL_UI_UNMUTE_EVENT","CHANNEL_UI_UPGRADENEEDED_EVENT","CHANNEL_UI_VERSIONCHANGE_EVENT","CHANNEL_UI_VISIBILITYCHANGE_EVENT","CHANNEL_UI_VOICESCHANGED_EVENT","CHANNEL_UI_VOLUMECHANGE_EVENT","CHANNEL_UI_VRDISPLAYACTIVATE_EVENT","CHANNEL_UI_VRDISPLAYBLUR_EVENT","CHANNEL_UI_VRDISPLAYCONNECT_EVENT","CHANNEL_UI_VRDISPLAYDEACTIVATE_EVENT","CHANNEL_UI_VRDISPLAYDISCONNECT_EVENT","CHANNEL_UI_VRDISPLAYFOCUS_EVENT","CHANNEL_UI_VRDISPLAYPOINTERRESTRICTED_EVENT","CHANNEL_UI_VRDISPLAYPOINTERUNRESTRICTED_EVENT","CHANNEL_UI_VRDISPLAYPRESENTCHANGE_EVENT","CHANNEL_UI_WAITING_EVENT","CHANNEL_UI_WEBGLCONTEXTCREATIONERROR_EVENT","CHANNEL_UI_WEBGLCONTEXTLOST_EVENT","CHANNEL_UI_WEBGLCONTEXTRESTORED_EVENT","CHANNEL_UI_WEBKITMOUSEFORCECHANGED_EVENT","CHANNEL_UI_WEBKITMOUSEFORCEDOWN_EVENT","CHANNEL_UI_WEBKITMOUSEFORCEUP_EVENT","CHANNEL_UI_WEBKITMOUSEFORCEWILLBEGIN_EVENT","CHANNEL_UI_WHEEL_EVENT"]}loadKeyStream(){const e=Ie.fromEvent(document,"keyup");this.keyPresses$=e.groupBy((e=>e.keyCode)).mergeAll().filter((e=>this.keyCodeArr.indexOf(e.keyCode)>=0)).repeat().subscribe(this.onKeyPressed.bind(this))}addKeyEvent(e){!1===this.keyEventsLoaded&&this.loadKeyStream(),this.keyEventsLoaded=!0,this.registerKey(e)}registerKey(e){this.keyCodeArr.push(e)}onKeyPressed(e){}static removeSSID(e){const t=me(["payload"]);return fe(t,W(["vsid"]))(e)}onIncomingObservable(e){const t=j(e.name,this.props.name);e.data=Xr.removeSSID(e.data);const{payload:n,srcElement:r}=e.data,o=e=>({payload:n,srcElement:r,event:e});return!0===t?(e=>e.observable.pipe(ur(o)).subscribe(this.onUIEvent.bind(this)))(e):void 0}getActionState(t){const n=s(["event","type"]),r=s(["event","typeOverRide"]),o=e(Ce,Q(r,n))(t),i="CHANNEL_UI";return void 0!==o?`${i}_${o}_EVENT`:i}static checkForEventMethods(t){const n=e(m(f(/^(event)([A-Z].*)([A-Z].*)$/gm)),o,i("payload"))(t);if(n.length>=1){const e=i("event",t);if(void 0!==e){const t=le(/^(event)([A-Z])(.*)([A-Z].*)$/gm,((e,t,n,r,o)=>String(n).toLowerCase()+r+o)),r=n=>{const r=t(n);void 0!==e[r]&&"function"==typeof e[r]&&e[r]()};n.forEach(r)}}return t}onUIEvent(e){Xr.checkForEventMethods(e),e.action=this.getActionState(e);const t=e.action,{payload:n,srcElement:r}=e,o=e.event;this.sendChannelPayload(t,n,r,o)}}class Qr{constructor(){this.createDomObservableFromEvent=Qr.createDomObservableFromEvent.bind(this)}static createDomObservableFromEvent(e,t,n=!0,r=window){return t=void 0===t?e=>e:t,we((t=>r.addEventListener(e,t,{passive:n})),(()=>{r[e]=e=>e})).pipe(ur(t))}static createMediaQuery(e){const t=window.matchMedia(e);return this.checkIfValidMediaQuery(t,e),!1!==t&&t}static checkIfValidMediaQuery(e,t){const n=e=>e.replace(/\s+/gm,""),r=void 0!==e.matches&&n(e.media).indexOf(n(t))>=0;return!1===r&&(t=>{console.warn(`Spyne Info: the following query string, "${t}", has been optimized to "${e.media}" by the browser and may not be a valid Media Query item!`)})(t),r}static createMediaQueryHandler(e,t){const n=(e=>t=>(t.mediaQueryName=e,t))(t),r=(o=e,{addHandler:e=>{o.addListener(e)},removeHandler:e=>{o.onchange=()=>{}}});var o;return new we(r.addHandler,r.removeHandler).pipe(ur(n))}static createMergedObsFromObj(e){const t=e.mediaQueries||e.mediaQueries,n=[];return O(((e,t,r)=>{const o=Qr.createMediaQuery(e);return!1!==o&&n.push(Qr.createMediaQueryHandler(o,t)),n}),t),n}}class Jr extends Yr{constructor(e="CHANNEL_WINDOW"){super(e),this.bindStaticMethods(),this.currentScrollY=0}initializeStream(){this.domChannelConfig=Je.config.channels.WINDOW;const e=this.getActiveObservables(),t=Ve(...e);this.dom$=t,t.subscribe((e=>{const{action:t,payload:n,srcElement:r,event:o}=e;this.sendChannelPayload(t,n,r,o)}))}static getMouseWheelMapFn(e){const t=this.channelActions.CHANNEL_WINDOW_WHEEL_EVENT,n=e.deltaY<=0?"up":"down",{deltaX:r,deltaY:o,deltaZ:i}=e;return{action:t,payload:{scrollDir:n,deltaX:r,deltaY:o,deltaZ:i},srcElement:e.srcElement,event:e}}static createCurriedGenericEvent(e){const t=`CHANNEL_WINDOW_${e.toUpperCase()}_EVENT`;return z(Jr.mapGenericEvent)(t)}static mapGenericEvent(e,t){return{action:e,payload:t,srcElement:t.srcElement,event:t}}static getResizeMapFn(e){return{action:this.channelActions.CHANNEL_WINDOW_RESIZE_EVENT,payload:R(["innerWidth","innerHeight","outerWidth","outerHeight"],window),srcElement:e.srcElement,event:e}}static getOrientationMapFn(e){const t=this.channelActions.CHANNEL_WINDOW_ORIENTATION_EVENT,n=window.matchMedia("(orientation: portrait)").matches,r=R(["innerWidth","innerHeight","outerWidth","outerHeight"],window);r.orientation=!0===n?"portrait":"landscape";return{action:t,payload:r,srcElement:e.srcElement,event:e}}getMediaQueryMapFn(e){return{action:this.channelActions.CHANNEL_WINDOW_MEDIA_QUERY_EVENT,payload:R(["matches","media","mediaQueryName"],e),srcElement:e.srcElement,event:e}}createMouseWheelObservable(e){const t=e.debounceMSTimeForScroll;return Qr.createDomObservableFromEvent("wheel",Jr.getMouseWheelMapFn.bind(this)).pipe(mr(t))}static getScrollData(){let e=0;return t=>{const n=e-t;return e=t,{scrollY:t,scrollDistance:n,scrollDir:n>=0?"up":"down"}}}static getScrollY(e){return void 0!==e.pageYOffset?e.pageYOffset:e.scrollTop}static getScrollMapFn(e,t,n,r,o){const i=r(Jr.getScrollY(o)),{scrollDistance:s}=i;return{action:n,payload:i,srcElement:e.srcElement,scrollDistance:s,event:e}}createScrollObservable(e,t=window,n=!0){const r=e.debounceMSTimeForScroll,o=t,i=t===window,s=void 0!==e.scrollElForVals?e.scrollElForVals:t,a=i?"CHANNEL_WINDOW_SCROLL_EVENT":"CHANNEL_WINDOW_ELEMENT_SCROLL_EVENT",c=Jr.getScrollData(),l=ge(Jr.getScrollMapFn,[a,c,s,n,o]).bind(this);return Qr.createDomObservableFromEvent("scroll",l,n,o).pipe(mr(r),(u=e=>0===e.scrollDistance,fn((function(e,t){var n=!1,r=0;e.subscribe(nr(t,(function(e){return(n||(n=!u(e,r++)))&&t.next(e)})))}))),ur((e=>{const t=Jr.getScrollY(o);return e.payload.scrollDistanceAbs=Math.abs(this.currentScrollY-t),this.currentScrollY=t,e})));var u}createOrientationObservable(e){return Qr.createDomObservableFromEvent("orientationchange",Jr.getOrientationMapFn.bind(this))}createResizeObservable(e){const t=e.debounceMSTimeForResize;return Qr.createDomObservableFromEvent("resize",Jr.getResizeMapFn.bind(this)).pipe(mr(t))}getEventsFromConfig(e=this.domChannelConfig){const t=e.events;return k((e=>{const t=Jr.createCurriedGenericEvent(e);return Qr.createDomObservableFromEvent(e,t)}),t)}getActiveObservables(e=this.domChannelConfig){let t=[];e.listenForMediaQueries=st(e.mediaQueries)||st(e.mediaQueries);const n={listenForResize:this.createResizeObservable.bind(this),listenForOrientation:this.createOrientationObservable.bind(this),listenForScroll:this.createScrollObservable.bind(this),listenForWheel:this.createMouseWheelObservable.bind(this)};O(((n,r,o)=>{e[r]&&t.push(n(e))}),n),this.checkForMediaQueries(e.listenForMediaQueries);const r=this.getEventsFromConfig(e);return t=t.concat(r),t}checkForMediaQueries(e){const t=e=>{const{action:t,payload:n,srcElement:r,event:o}=e;this.sendChannelPayload(t,n,r,o,this.observer$)};!0===e&&this.getMediaQueryObservable(this.domChannelConfig).subscribe(t)}getMediaQueryObservable(e){const t=this.createMergedObsFromObj(e);return Z(Ve,t).pipe(ur(this.getMediaQueryMapFn.bind(this)))}addRegisteredActions(){return["CHANNEL_WINDOW_ABORT_EVENT","CHANNEL_WINDOW_AFTERPRINT_EVENT","CHANNEL_WINDOW_ANIMATIONEND_EVENT","CHANNEL_WINDOW_ANIMATIONITERATION_EVENT","CHANNEL_WINDOW_ANIMATIONSTART_EVENT","CHANNEL_WINDOW_APPINSTALLED_EVENT","CHANNEL_WINDOW_BEFOREPRINT_EVENT","CHANNEL_WINDOW_BEFOREUNLOAD_EVENT","CHANNEL_WINDOW_BEGINEVENT_EVENT","CHANNEL_WINDOW_BLUR_EVENT","CHANNEL_WINDOW_CACHED_EVENT","CHANNEL_WINDOW_CHANGE_EVENT","CHANNEL_WINDOW_CLICK_EVENT","CHANNEL_WINDOW_CLOSE_EVENT","CHANNEL_WINDOW_COMPOSITIONEND_EVENT","CHANNEL_WINDOW_COMPOSITIONSTART_EVENT","CHANNEL_WINDOW_COMPOSITIONUPDATE_EVENT","CHANNEL_WINDOW_COPY_EVENT","CHANNEL_WINDOW_CUT_EVENT","CHANNEL_WINDOW_DBLCLICK_EVENT","CHANNEL_WINDOW_DEVICECHANGE_EVENT","CHANNEL_WINDOW_DEVICELIGHT_EVENT","CHANNEL_WINDOW_DEVICEMOTION_EVENT","CHANNEL_WINDOW_DEVICEORIENTATION_EVENT","CHANNEL_WINDOW_DEVICEPROXIMITY_EVENT","CHANNEL_WINDOW_DOMATTRIBUTENAMECHANGED_EVENT","CHANNEL_WINDOW_DOMATTRMODIFIED_EVENT","CHANNEL_WINDOW_DOMCHARACTERDATAMODIFIED_EVENT","CHANNEL_WINDOW_DOMCONTENTLOADED_EVENT","CHANNEL_WINDOW_DOMCONTENTLOADED_EVENT","CHANNEL_WINDOW_DOMELEMENTNAMECHANGED_EVENT","CHANNEL_WINDOW_DRAGEND_EVENT","CHANNEL_WINDOW_DRAGENTER_EVENT","CHANNEL_WINDOW_DRAGLEAVE_EVENT","CHANNEL_WINDOW_DRAGOVER_EVENT","CHANNEL_WINDOW_DRAGSTART_EVENT","CHANNEL_WINDOW_DRAG_EVENT","CHANNEL_WINDOW_DROP_EVENT","CHANNEL_WINDOW_ELEMENT_SCROLL_EVENT","CHANNEL_WINDOW_ERROR_EVENT","CHANNEL_WINDOW_FOCUSIN_EVENT","CHANNEL_WINDOW_FOCUS_EVENT","CHANNEL_WINDOW_FULLSCREENCHANGE_EVENT","CHANNEL_WINDOW_FULLSCREENERROR_EVENT","CHANNEL_WINDOW_HASHCHANGE_EVENT","CHANNEL_WINDOW_INPUT_EVENT","CHANNEL_WINDOW_INVALID_EVENT","CHANNEL_WINDOW_KEYDOWN_EVENT","CHANNEL_WINDOW_KEYPRESS_EVENT","CHANNEL_WINDOW_KEYUP_EVENT","CHANNEL_WINDOW_LOAD_EVENT","CHANNEL_WINDOW_MEDIA_QUERY_EVENT","CHANNEL_WINDOW_MESSAGE_EVENT","CHANNEL_WINDOW_MOUSEDOWN_EVENT","CHANNEL_WINDOW_MOUSEENTER_EVENT","CHANNEL_WINDOW_MOUSELEAVE_EVENT","CHANNEL_WINDOW_MOUSEMOVE_EVENT","CHANNEL_WINDOW_MOUSEOUT_EVENT","CHANNEL_WINDOW_MOUSEOVER_EVENT","CHANNEL_WINDOW_MOUSEUP_EVENT","CHANNEL_WINDOW_MOUSEWHEEL_EVENT","CHANNEL_WINDOW_OFFLINE_EVENT","CHANNEL_WINDOW_ONLINE_EVENT","CHANNEL_WINDOW_OPEN_EVENT","CHANNEL_WINDOW_ORIENTATION_EVENT","CHANNEL_WINDOW_PAGEHIDE_EVENT","CHANNEL_WINDOW_PAGESHOW_EVENT","CHANNEL_WINDOW_PASTE_EVENT","CHANNEL_WINDOW_POPSTATE_EVENT","CHANNEL_WINDOW_POPSTATE_EVENT","CHANNEL_WINDOW_PROGRESSEVENTS_EVENT","CHANNEL_WINDOW_RESET_EVENT","CHANNEL_WINDOW_RESIZE_EVENT","CHANNEL_WINDOW_SCROLL_ELEMENT_ADDED_EVENT","CHANNEL_WINDOW_SCROLL_EVENT","CHANNEL_WINDOW_SCROLL_LOCK_EVENT",["CHANNEL_WINDOW_SCROLL_LOCK_EVENT","onScrollLockEvent"],["CHANNEL_WINDOW_SET_ELEMENT_TO_SCROLL_EVENT","onSetElementToScroll"],"CHANNEL_WINDOW_STORAGE_EVENT","CHANNEL_WINDOW_SUBMIT_EVENT","CHANNEL_WINDOW_TRANSITIONCANCEL_EVENT","CHANNEL_WINDOW_TRANSITIONEND_EVENT","CHANNEL_WINDOW_TRANSITIONRUN_EVENT","CHANNEL_WINDOW_TRANSITIONSTART_EVENT","CHANNEL_WINDOW_UNLOAD_EVENT","CHANNEL_WINDOW_WHEEL_EVENT"]}onScrollLockEvent(e){}onSetElementToScroll(e){let{config:t,el:n,scrollElement:r}=e.payload;t=t||{},t=ke(this.domChannelConfig,t),r=r||n;this.sendChannelPayload("CHANNEL_WINDOW_SCROLL_ELEMENT_ADDED_EVENT",{el:n},n),this.createScrollObservable(t,r).subscribe((e=>{const{action:t,payload:n,srcElement:r,event:o}=e;this.sendChannelPayload(t,n,r,o)}))}bindStaticMethods(){this.createMediaQueryHandler=Qr.createMediaQueryHandler.bind(this),this.createMergedObsFromObj=Qr.createMergedObsFromObj.bind(this)}}class Zr extends Yr{constructor(e={}){super("CHANNEL_LIFECYCLE",e)}addRegisteredActions(){return["CHANNEL_LIFECYCLE_RENDERED_EVENT","CHANNEL_LIFECYCLE_DISPOSED_EVENT"]}onViewStreamInfo(e){const{action:t,srcElement:n}=e,r=n;r.action=t,this.onSendEvent(t,r)}onSendEvent(e,t={}){const n=this.channelActions[e],r={};window.setTimeout((()=>this.sendChannelPayload(n,t,r,undefined)),0)}}class eo extends Yr{constructor(e,t={}){t.isProxy=!0,super(e,t),this.props=t,this.subject$=new Le,this.replaySub$=new He(1),this.observer$=Ve(this.subject$,this.replaySub$);!0===Je.debug&&this.checkIfChannelIsStillProxy(e)}getMergedSubject(e=!1){return!0===e?this.replaySub$:this.subject$}checkIfChannelIsStillProxy(e){const t=e;ot((()=>{!0!==d(t,Je.listRegisteredChannels())&&console.warn(`Spyne Warning: The channel, ${t} does not appear to be registered!`)}),1e3)}get replaySubject(){return this.replaySub$}get subject(){return this.subject$}}const to=new Map;class no{constructor(){this.addMixins(),to.set("DISPATCHER",new Le),this.listRegisteredChannels=no.listRegisteredChannels.bind(this),this.getChannelsList=no.getChannelsList.bind(this)}get map(){return to}static getChannelsList(){return Array.from(to,((e,t)=>({key:e[0],val:e[1].constructor.name})))}static listRegisteredChannels(e=!1){const t=this.getChannelsList(),n=L(ee("ChannelProxy","val")),r=m(ee("ChannelProxy","val")),o=(!0===e?r:n)(t);return ye(["key"],o)}listProxyChannels(){return this.listRegisteredChannels(!0)}checkForMissingChannels(){const t=this.getChannelsList(),n=m(ee("ChannelProxy","val"))(t);if(n.length>=1){const t=`Spyne Warning: The following ${1===n.length?"Channel has":"Channels have"} not been initialized: ${e(ce(", "),k(i("key")))(n)}`;console.warn(t)}}init(){this.createMainStreams()}createMainStreams(){this.routeStream=new qr,to.set("CHANNEL_ROUTE",this.routeStream),this.uiStream=new Xr,to.set("CHANNEL_UI",this.uiStream),this.domStream=new Jr,to.set("CHANNEL_WINDOW",this.domStream),this.viewStreamLifecycle=new Zr,to.set("CHANNEL_LIFECYCLE",this.viewStreamLifecycle),this.routeStream.initializeStream(),this.domStream.initializeStream()}addKeyEvent(e){to.get("UI").addKeyEvent(e)}registerStream(t){const n=t.channelName;if(to.has(n)){if(e(be(["props","isRegistered"],!0))(to.get(n)))return void console.warn(`Spyne Warning: The Channel, ${n}, has already been registered!`)}to.set(n,t),t.initializeStream()}getChannelActions(e){return to.get(e).addRegisteredActions()}getProxySubject(e,t=!1){const n=!0===t?"replaySubject":"subject";return to.get(e)[n]}testStream(e){return void 0!==to.get(e)}getStream(e){return!1===this.testStream(e)&&to.set(e,new eo(e)),to.get(e)}addMixins(){}}class ro{constructor(e,t="",n=!0){return this.parentContext=e,this.omittedMethods=["autoBinder","initAutoBinder","getEnhancerMethods","checkForMalformedMethods","caller","arguments","bindParentViewStream"],this.prefix=t,!0===n&&this.autoBinder(),this.allMethodsList}initAutoBinder(){this.autoBinder()}getEnhancerMethods(){return function(t,n=[]){const r=A(["length","name","prototype","constructor"],n),o=e(C(r),g),i=o(Object.getOwnPropertyNames(t.constructor.prototype)),s=o(Object.getOwnPropertyNames(t.constructor));return{methods:i,staticMethods:s,allMethods:A(i,s)}}(this,this.omittedMethods)}checkForMalformedMethods(e){if(""===this.prefix)return void console.warn(`SPYNE WARNING: The following SpyneTrait ${this.constructor.name} needs a prefix`);const t=L((e=>0===e.indexOf(this.prefix)),e);if(t.length>=1){const e=`Spyne Warning: The following method(s) in ${this.constructor.name} require the prefix, "${this.prefix}": [${t.join(", ")}];`;console.warn(e)}}bindParentViewStream(e,t){this.checkForMalformedMethods(e.allMethods);const n={},r=(e,r=!1)=>{const o=!0===r?this.constructor:this;"function"===typeof o[e]&&(n[e]=t[e]=o[e].bind(t))},o=Ae(2,r)(T,!0);return k(o,e.staticMethods),k(r,e.methods),n}autoBinder(){const e=this.getEnhancerMethods();return this.allMethodsList=this.bindParentViewStream(e,this.parentContext),this.allMethodsList}}class oo{constructor(e,t,n,r){this._mapFn=oo.setMapFn(e),this._url=oo.setUrl(e),this._responseType=oo.setResponseType(e),this._serverOptions=oo.setServerOptions(e),this._subscriber=void 0!==t?t:e=>console.log("FETCH RETURNED ",e),this.debug=void 0!==e.debug&&e.debug,this.channelName=r;const o={mapFn:this.mapFn,url:this.url,serverOptions:this.serverOptions,responseType:this.responseType,debug:this.debug};!0!==n&&oo.startWindowFetch(o,this._subscriber,this.channelName)}static startWindowFetch(e,t,n){const{mapFn:r,url:o,serverOptions:i,responseType:s,debug:a}=e,c=!0===a?e=>console.log("DEBUG FETCH :",e,{url:o,serverOptions:i,responseType:s,channelName:n}):()=>{},l=Pe(window.fetch(o,i)).pipe(br(c),Ar((e=>Pe(e[s]()))),ur((e=>{const t={channelName:n,url:o,responseType:s,serverOptions:i};return n=>e(n,t)})(r)),gr());l.connect(),l.subscribe(t)}static setMapFn(t){return e(p((e=>e)),i("mapFn"))(t)}static setUrl(e){const t=i("url",e);return void 0===t&&console.warn("SPYNE WARNING: URL is undefined for data channel"),t}static setResponseType(e){return p("json",i("responseType",e))}get mapFn(){return this._mapFn}get url(){return this._url}get serverOptions(){return this._serverOptions}get responseType(){return this._responseType}static stringifyBodyIfItExists(t){return ae(Se(Object,"body"),e(fe(me("body"),JSON.stringify)))(t)}static updateMethodWhenBodyExists(e){const t=Ne("body"),n=ee("GET","method"),o=r([t,n]);return ae(o,se("method","POST"))(e)}static setServerOptions(e){const t=R(["method","headers","body","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive"],e);let n=_e(oo.baseOptions(),t);return n=oo.updateMethodWhenBodyExists(n),n=oo.stringifyBodyIfItExists(n),n}static baseOptions(){return{method:"GET",headers:new Headers({Accept:"application/json, text/plain, */*"}),mode:"cors",credentials:"same-origin",cache:"default",redirect:"follow",referrer:"client",referrerPolicy:"no-referrer-when-downgrade",integrity:"",keepalive:!1}}}class io extends Yr{constructor(e,t={}){io.validateMapMethod(t,e),void 0!==t.map&&(t.mapFn=t.map),t.extendedActionsArr=[`${e}_DATA_EVENT`,[`${e}_UPDATE_DATA_EVENT`,"onFetchUpdate"]],t.sendCachedPayload=!0,super(e,t)}static validateMapMethod(t,n,o=!1){const i=Q(v,(e=>"function"!=typeof e)),s=K(i),a=r([s,e=>e.length>=1]);return!e(a,S,R(["map","mapFn"]))(t)||(!1===o&&console.warn(`Spyne Warning: The map method for ChannelFetch, ${n}, appears to be invalid`),!1)}onRegistered(){this.startFetch()}addRegisteredActions(t){const n=e(p([]),s(["props","extendedActionsArr"]));return["CHANNEL_DATA_EVENT",["CHANNEL_UPDATE_DATA_EVENT","onFetchUpdate"]].concat(n(this))}startFetch(e={},t=this.onFetchReturned.bind(this)){const n=this.consolidateAllFetchProps(e);return new oo(n,t,!1,this.props.name)}onFetchUpdate(e){const t=this.getPropsForFetch(e);this.startFetch(t)}onFetchReturned(e){return this.createChannelPayloadItem(e)}createChannelPayloadItem(e,t=`${this.props.name}_DATA_EVENT`){const{name:n,sendCachedPayload:r,url:o}=this.props,i={name:n,sendCachedPayload:r,url:o};this.sendChannelPayload(t,e,i)}getPropsForFetch(e){const t=s(["viewStreamInfo","payload"],e);return R(["mapFn","url","header","body","mode","method","responseType","debug"],t)}consolidateAllFetchProps(t,n=this.props){const r=R(["mapFn","url","header","body","mode","method","responseType","debug"],n),o=L(v);return e(o,((e,t)=>_e(e,t)))(r,t)}get observer(){return this.observer$}}class so{constructor(e={}){let{name:t,config:n,parentEl:r}=e;this.props=e,void 0===n&&(n=l(e)),this.name=t||"empty",this.props.name=t,n=so.mergeDefaultConfig(n,this.defaultConfig()),this.props.parentEl=r||so.createParentEl(),so.getSpyneApp(t,n),void 0!==this.props.traits&&this.addTraits(this.props.traits),this.onBeforeRegistered(),this.onRegistered(),this.onRender()}static mergeDefaultConfig(e={},t=this.defaultConfig()){return Object.assign(t,e)}static getSpyneApp(e,t){!1===Je.initialized?console.warn(`Spyne Warning: Unable to install plugin, ${e}! SpyneApp has not been initialized!`):Je.addPluginConfig(e,t)}static updateSpyneConfig(e,t,r){return!0===ve(n(Object),["config","plugins",t])(e)?(!0===e.config.debug&&console.warn(`Spyne Warning: The plugin, ${t}, already exists`),!1):(e.config.plugins[t]=r,e.config.plugins[t])}static createParentEl(e){return e||document.getElementById("spyne-plugins")||(()=>{const e=new pn({id:"spyne-plugins"});document.body.appendChild(e.render());const t=document.getElementById("spyne-plugins");return t.style.cssText="position:absolute; top:0;left:0;width:100%;height:100%;min-height:100vh;z-index:1000000; pointer-events:none",t})()}addTraits(e){"Array"!==e.constructor.name&&(e=[e]);e.forEach((e=>new e(this)))}onBeforeRegistered(){this.props.pluginName=this.props.name,this.props.config=Je.getPluginConfigByPluginName(this.props.pluginName)}defaultConfig(){return{}}onRegistered(){}onRender(){}}const ao=new no,co="0.20.1";let lo=new class{constructor(){this.version=co}get channels(){return ao}init(e={},t=!1){
|
|
4
4
|
/*!
|
|
5
|
-
* Spyne 0.20.
|
|
5
|
+
* Spyne 0.20.1
|
|
6
6
|
* https://spynejs.org
|
|
7
7
|
*
|
|
8
8
|
* @license Copyright 2017-2021, Frank Batista, Relevant Context, LLC. All rights reserved.
|
|
@@ -11,5 +11,5 @@ const{entries:at,setPrototypeOf:ct,isFrozen:lt,getPrototypeOf:dt,getOwnPropertyD
|
|
|
11
11
|
* @author: Frank Batista,
|
|
12
12
|
* @email: frbatista.nyc@gmail.com
|
|
13
13
|
*/
|
|
14
|
-
if(!0===Je.initialized)return t?"The Spyne Application has already been initialized!":void console.warn("The Spyne Application has already been initialized!");let n={scrollLock:!1,scrollLockX:31,scrollLockY:0,debug:!1,strict:!1,baseHref:void 0,IMG_PATH:"undefined"!=typeof IMG_PATH?IMG_PATH:void 0,pluginMethods:{},plugins:{},tmp:{},channels:{WINDOW:{mediaQueries:{},events:[],listenForResize:!0,listenForOrientation:!0,listenForScroll:!1,listenForMouseWheel:!1,listenForWheel:!1,debounceMSTimeForResize:200,debounceMSTimeForScroll:150},ROUTE:{type:"slash",isHash:!1,isHidden:!1,add404s:!1,routes:{routePath:{routeName:"change"}}}}};if(void 0!==e){const t=Kr;e=Je.initialize(n,e,ao,t)}this.pluginsFn=Je.getPluginsMethodObj(e.pluginMethods),this.getChannelActions=e=>ao.getChannelActions(e),this.registerChannel=e=>ao.registerStream(e),this.registerDataChannel=e=>ao.registerStream(e),this.listChannels=()=>Array.from(ao.map.keys());let r=new jr({id:"spyne-null-views"});r.appendToDom(document.body),r.props.el.style.cssText="display:none; opacity:0; pointer-events:none;",ao.init(),!0===Je.config.debug&&(window.Spyne={version:co}),(e=>{if(hn)console.warn("sanitizeHTML is already configured. Reconfiguration is not allowed.");else{if(e.strict)if(window.trustedTypes){const e=window.trustedTypes.createPolicy("default",{createHTML:e=>
|
|
14
|
+
if(!0===Je.initialized)return t?"The Spyne Application has already been initialized!":void console.warn("The Spyne Application has already been initialized!");let n={scrollLock:!1,scrollLockX:31,scrollLockY:0,debug:!1,strict:!1,baseHref:void 0,IMG_PATH:"undefined"!=typeof IMG_PATH?IMG_PATH:void 0,pluginMethods:{},plugins:{},tmp:{},channels:{WINDOW:{mediaQueries:{},events:[],listenForResize:!0,listenForOrientation:!0,listenForScroll:!1,listenForMouseWheel:!1,listenForWheel:!1,debounceMSTimeForResize:200,debounceMSTimeForScroll:150},ROUTE:{type:"slash",isHash:!1,isHidden:!1,add404s:!1,routes:{routePath:{routeName:"change"}}}}};if(void 0!==e){const t=Kr;e=Je.initialize(n,e,ao,t)}this.pluginsFn=Je.getPluginsMethodObj(e.pluginMethods),this.getChannelActions=e=>ao.getChannelActions(e),this.registerChannel=e=>ao.registerStream(e),this.registerDataChannel=e=>ao.registerStream(e),this.listChannels=()=>Array.from(ao.map.keys());let r=new jr({id:"spyne-null-views"});r.appendToDom(document.body),r.props.el.style.cssText="display:none; opacity:0; pointer-events:none;",ao.init(),!0===Je.config.debug&&(window.Spyne={version:co}),(e=>{if(hn)console.warn("sanitizeHTML is already configured. Reconfiguration is not allowed.");else{if(e.strict)if(window.trustedTypes){const e=window.trustedTypes.createPolicy("default",{createHTML:e=>un.sanitize(e,{RETURN_TRUSTED_TYPE:!1})});dn=t=>e.createHTML(t)}else dn=e=>un.sanitize(e);else dn=e=>e;hn=!0}})(Je.config)}static listChannels(){return Array.from(ao.map.keys())}static getChannelActions(e){return ao.getChannelActions(e)}static registerChannel(e){if(!1!==Je.initialized)return ao.registerStream(e);console.warn("Spyne has not been initialized")}};export{Yr as Channel,io as ChannelFetch,oo as ChannelFetchUtil,nt as ChannelPayload,Mr as ChannelPayloadFilter,no as ChannelsMap,pn as DomElement,En as DomElementTemplate,lo as SpyneApp,Je as SpyneAppProperties,so as SpynePlugin,ro as SpyneTrait,jr as ViewStream,Dr as ViewStreamBroadcaster,vr as ViewStreamElement,Lr as ViewStreamPayload,Gr as ViewStreamSelector,ke as deepMerge,tt as safeClone};
|
|
15
15
|
//# sourceMappingURL=spyne.esm.js.map
|