-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfcf.min.js
1 lines (1 loc) · 70.8 KB
/
fcf.min.js
1
(function(){var _Mathmin=Math.min,_Mathfloor=Math.floor,_StringfromCharCode=String.fromCharCode;function _autoParse(t){if("string"==typeof t&&t.length){let e=0;for(;e<t.length&&32>=t.charCodeAt(e);++e);let r=t.length-1;for(;0<=r&&32>=t.charCodeAt(r);--r);if(0<=r&&(!isNaN(t)||1<=r-e&&"\""==t[e]&&"\""==t[r]||"{"==t[e]&&"}"==t[r]||"["==t[e]&&"]"==t[r]||3==r-e&&"t"==t[e]&&"r"==t[e+1]&&"u"==t[e+2]&&"e"==t[e+3]||4==r-e&&"f"==t[e]&&"a"==t[e+1]&&"l"==t[e+2]&&"s"==t[e+3]&&"e"==t[e+4]||3==r-e&&"n"==t[e]&&"u"==t[e+1]&&"l"==t[e+2]&&"l"==t[e+3]))try{let e=JSON.parse(t);return e}catch(r){return t}else return t}else return t}function _rtrimPos(e,t){if(!e.length)return 0;Array.isArray(t)||(t=[t]);let r=e.length-1;for(;0<=r;--r){let n=!1;for(let a=0;a<t.length;++a)if(!t[a]){let t=e.charCodeAt(r);if(0<=t&&32>=t){n=!0;break}}else if(e.charAt(r)==t[a]){n=!0;break}if(!n)break}return r+1}function _ltrimPos(e,t){let r=0;for(Array.isArray(t)||(t=[t]);r<e.length;++r){let n=!1;for(let a=0;a<t.length;++a)if(!t[a]){let t=e.charCodeAt(r);if(0<=t&&32>=t){n=!0;break}}else if(e.charAt(r)===t[a]){n=!0;break}if(!n)break}return r}function _equalObject(e,t,r){if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!=t.length)return!1;for(let n=0;n<e.length;++n)if(!fcf.equal(e[n],t[n],r))return!1}else{if(e instanceof Date||t instanceof Date)return!!(e instanceof Date&&t instanceof Date)&&(!!(isNaN(e.getTime())&&isNaN(t.getTime()))||e.getTime()==t.getTime());if("object"==typeof e&&null!==e){if("object"!=typeof t||null==t)return!1;if(Array.isArray(t))return!1;if(r&&e.constructor!=t.constructor)return!1;let n;if(n=fcf.each(e,(e,n)=>!!(void 0===n||fcf.has(t,e))&&!!_equalObject(n,fcf.get(t,e),r)&&void 0).result(),void 0!==n)return n;if(n=fcf.each(t,(t,r)=>{if(void 0!==r&&!fcf.has(e,t))return!1}).result(),void 0!==n)return!1}else{if("number"==typeof e&&isNaN(e)&&"number"==typeof t&&isNaN(t))return!0;if(r){if(e!==t)return!1;}else if(e!=t)return!1}}return!0}function _compareObject(e,t,r){if(Array.isArray(e)){if(!Array.isArray(t))return 1;if(e.length!=t.length)return e.length<t.length?-1:1;for(let n,a=0;a<e.length;++a)if(n=fcf.compare(e[a],t[a],r),n)return n;return 0}if("object"==typeof e&&null!==e&&!(e instanceof Date)){if("object"!=typeof t||null==t)return 1;if(Array.isArray(t))return-1;if(r){if(e.constructor>t.constructor)return 1;if(e.constructor<t.constructor)return-1}let n;return(n=fcf.each(e,(e,n)=>{if(void 0!==n&&!fcf.has(t,e))return 1;let a=fcf.compare(n,fcf.get(t,e),r);if(a)return a}).result(),n)?n:(n=fcf.each(t,(t,r)=>{if(void 0!==r&&!fcf.has(e,t))return-1}).result(),n?-1:0)}else{if(!r){if(void 0===e||null===e||0===e||!1===e){if(void 0===t||null===t||0===t||!1===t)return 0;if("string"==typeof t){let e=fcf.trim(t);if(""==e||"0"==e)return 0}}if(void 0===t||null===t||0===t||!1===t){if(void 0===e||null===e||0===e||!1===e)return 0;if("string"==typeof e){let t=fcf.trim(e);if(""==t||"0"==t)return 0}}}let n=e instanceof Date?"date":typeof e,a=t instanceof Date?"date":typeof t;r||"number"!=typeof e&&"number"!=typeof t||("number"!=typeof e&&(e=parseFloat(e),n="number"),isNaN(e)&&(n="nan"),"number"!=typeof t&&(t=parseFloat(e),a="number"),isNaN(t)&&(a="nan"));let s=_compareWeights[n],o=_compareWeights[a];return"nan"==n&&"nan"==a?0:r||e!=t?s==o?e instanceof Date&&(e=e.getTime(),t=t.getTime(),isNaN(e)&&isNaN(t))?0:e==t?0:e<t?-1:1:s>o?1:-1:0}}function _loadModule(e,t,r){let n=_getModulePath(e),a=_modules[n]?_modules[n].state:void 0;return _modules[n]&&(_modules[n].quiet&=!!t),"ready"==a||"loaded"==a||"ok"==a?fcf.actions().then(()=>(_modules[n].quiet=1,_modules[n].result)):"error"==a?fcf.actions().then((t,r)=>{_modules[n].quiet||fcf.log.err("FCF",`Failed load module ${e}.\n`,_modules[n].error),_modules[n].quiet=1,r.error(_modules[n].error)}):(!r||_isServer)&&("wait"==a||"processing"==a)?fcf.actions().then((t,r)=>{_modules[n].actions.then(()=>{r.complete(_modules[n].result)}).catch(t=>{_modules[n].quiet||fcf.log.err("FCF",`Failed load module ${e}.\n`,t),r.error(t)})}):(!_isServer&&r&&++_globalSyncModuleLoad,_modules[n]={state:"wait",result:void 0,error:void 0,actions:fcf.actions(),act:void 0,dependencies:[],lazy:[],quiet:t?1:0},fcf.actions().then((t,a)=>{_modules[n].actions.then((t,r)=>{_modules[n].act=r;let{module:a,subpath:s}=fcf.getPathInfo(e);if(_isServer){let e;try{e=require(n)}catch(t){return _modules[n].state="error",_modules[n].error=t,_modules[n].act.error(t),void _callOnModuleLoad()}let t,r=fcf.getConfiguration().sources[a];r&&(t=fcf.resolve(r,["serverFiles",s,"result"])||fcf.resolve(r,["files",s,"result"]),t&&(_modules[n].result=fcf.resolve(global,t))),t||(_modules[n].result=e),"wait"==_modules[n].state&&(_modules[n].state="ok",_modules[n].act.complete(),_callOnModuleLoad())}else{let e=fcf.getConfiguration().sources[a],t=fcf.resolve(e,["webFiles",s,"loadState"])||fcf.resolve(e,["files",s,"loadState"]),r=fcf.resolve(e,["webFiles",s,"result"])||fcf.resolve(e,["files",s,"result"]),o=!t||!fcf.tokenize(t,{},{quiet:!0});(o?fcf.load(n,{async:0==_globalSyncModuleLoad}):fcf.actions()).then(t=>{if(o){const e=_modules[n].state;if("ready"==e||"loaded"==e||"ok"==e||"error"==e)return;let r=document.createElement("script");r.textContent=t+`\n//# sourceURL=${n}`,document.head.appendChild(r)}e&&r&&(_modules[n].result=fcf.resolve(window,r)),"wait"==_modules[n].state&&(_modules[n].state="ok",_modules[n].act.complete(),_callOnModuleLoad())}).catch(()=>{let e=new Error("Failed to receive module file '"+n+"'");_modules[n].state="error",_modules[n].error=e,_modules[n].act.error(e),_callOnModuleLoad()})}}).then(()=>{a.complete(_modules[n].result)}).finally(()=>{!_isServer&&r&&_globalSyncModuleLoad&&--_globalSyncModuleLoad}).catch(t=>{_modules[n].quiet||fcf.log.err("FCF",`Failed load module ${e}.\n`,t),_modules[n].quiet=1,a.error(t)})}))}function _getModulePath(e){e=fcf.resolvePath(e);const t=-1==e.indexOf("/")&&-1==e.indexOf("\\")&&-1==e.indexOf(":")&&-1==e.indexOf(".");t&&!_isServer&&":"!=e[e.length-1]&&(e+=":");let{module:r,subpath:n}=fcf.getPathInfo(e);if(r===void 0)return fcf.getPath(e);let a=fcf.getConfiguration();_isServer||n||(n=a.sources[r]&&a.sources[r].webMain?a.sources[r].webMain:"index.js");let s=fcf.isServer()?"serverFiles":"webFiles",o=fcf.isServer()?"serverFilePath":"webFilePath",i=fcf.resolve(a,["sources",r,s,n,"filePath"])||fcf.resolve(a,["sources",r,"files",n,"filePath"])||fcf.resolve(a,["sources",r,o,"js"])||fcf.resolve(a,["sources",r,"filePath","js"])||fcf.resolve(a,["sources",r,o,"*"])||fcf.resolve(a,["sources",r,"filePath","*"]);return i?(n=fcf.tokenize(i,{path:n,directory:fcf.getDirectory(n),shortName:fcf.getShortFileName(n),name:fcf.getFileName(n),extension:fcf.getExtension(n)},{quiet:!0}),fcf.getPath(r+":"+n)):_isServer&&t?e:fcf.getPath(r+":"+n)}function _waitLazyModule(e,t){let r;if("ok"==_modules[e].state)return t&&t.complete(),fcf.actions();let n=_getDepsModule(e);t||(r=fcf.actions(),r.then((e,r)=>{t=r}));let a,s=!0;for(let r in n){if(!_modules[r]){s=!1;continue}"error"==_modules[r].state?a=_modules[r].error:"loaded"!=_modules[r].state&&"ok"!=_modules[r].state&&(s=!1)}return a?t.error(a):s?t.complete():_attachOnModuleLoad(()=>{_waitLazyModule(e,t)}),r}function _attachOnModuleLoad(e){_moduleCallbacks.push(e)}function _callOnModuleLoad(){let e=_moduleCallbacks;_moduleCallbacks=[];for(let t=0;t<e.length;++t)e[t]()}function _getDepsModule(e,t,r){if(t||(t=e),r||(r={}),_modules[e]){for(let n,a=0;a<_modules[e].dependencies.length;++a)n=_getModulePath(_modules[e].dependencies[a]),n in r||t==n||(r[n]=1,_getDepsModule(n,t,r));for(let n,a=0;a<_modules[e].lazy.length;++a)n=_getModulePath(_modules[e].lazy[a]),n in r||t==n||(r[n]=1,_getDepsModule(n,t,r))}return r}function _parseStack(e){let t,r={stack:[],preStart:-1},n=" at ",a=e.length-1;for(;0<=a;--a){if(a==e.length-1&&""==e[a])continue;let s={};if(t||(t=-1===e[a].indexOf(n)?"firefox":"chrome"),"chrome"==t){let t,r=e[a].indexOf("("),o=e[a].indexOf(n);if(t=-1==r?e[a].substr(o+n.length,e[a].length-o-n.length).split(":"):e[a].substr(r+1,e[a].length-r-2).split(":"),3>t.length||-1==o)break;s.function=-1==r?void 0:e[a].substring(o+n.length,r-1),s.line=t[t.length-2],s.column=t[t.length-1],t.pop(),t.pop(),s.file=t.join(":")}else{let t=e[a].indexOf("@");if(posInfoArr=e[a].substr(t+1,e[a].length-t-1).split(":"),3>posInfoArr.length||-1==t)break;"<"==e[a][t-1]&&(t-=1),"/"==e[a][t-1]&&(t-=1);let r=e[a].substr(0,t).split("/");r=r[r.length-1].split("*"),s.function=r[r.length-1],s.line=posInfoArr[posInfoArr.length-2],s.column=posInfoArr[posInfoArr.length-1],posInfoArr.pop(),posInfoArr.pop(),s.file=posInfoArr.join(":")}r.stack.unshift(s)}return r.preStart=a,r}function _objectToString(e,t,r){const n=2,a="d031d461ddb4a4241b0428a137da400b";if(t||(t=0),r||(r=""),"object"!=typeof e||null===e||e instanceof Date)return JSON.stringify(e);if(Array.isArray(e)){if(e[a])return`[Recursive Object: ${e[a]}]`;e[a]=r;let s="[";for(let a=0;a<e.length;++a)a&&(s+=","),s+="\n",s+=fcf.pad("",t+n," "),s+=_objectToString(e[a],t+n,`${r}[${a}]`);return e.length&&(s+="\n",s+=fcf.pad("",t," ")),s+="]",delete e[a],s}else{if(e[a])return`[Recursive link: ${e[a]}]`;e[a]=r;let s=!0,o="{";return fcf.each(e,(e,i)=>{e==a||(!s&&(o+=","),o+="\n",o+=fcf.pad("",t+n," "),o+=JSON.stringify(e),o+=" : ",o+=_objectToString(i,t+n,`${r}[${JSON.stringify(e)}]`),s=!1)}),s||(o+="\n",o+=fcf.pad("",t," ")),o+="}",delete e[a],o}}var fcf="undefined"!=typeof global&&global.fcf?global.fcf:"undefined"!=typeof window&&window.fcf?window.fcf:{};fcf.NDetails=fcf.NDetails||{},fcf.namespaces=fcf.namespaces||{},"undefined"!=typeof module&&(module.exports=fcf),"undefined"!=typeof global&&(global.fcf=fcf),"undefined"!=typeof window&&(window.fcf=fcf),fcf.isServer=()=>_isServer;const _isServer="object"==typeof module&&"undefined"!=typeof module.filename;let libResolver,libPath,libFS,libUtil,libState,libLogger;_isServer&&(libResolver=require("./NDetails/resolver.js"),libPath=require("path"),libFS=require("fs"),libUtil=require("util"),libInlineInterpreter=require("./NDetails/inlineExecution.js"),libLoad=require("./NDetails/load.js"),libState=require("./NDetails/state.js"),libLogger=require("./NDetails/logger.js")),fcf.str=(e,t)=>"string"==typeof e?e:void 0===e?"":null===e?"":"number"==typeof e&&isNaN(e)?"":"object"==typeof e?e instanceof fcf.Exception?fcf.errorToString(e,t):e instanceof Error?fcf.errorToString(e,t):e.sqlMessage&&e.sqlState&&e.code?e.sqlMessage:JSON.stringify(e,void 0,2):e.toString(),fcf.escapeQuotes=(e,t)=>{let r="";if(Array.isArray(t))for(let n,a=0;a<e.length;++a)n=e[a],"\\"===n?r+="\\\\":-1==t.indexOf(n)?r+=n:(r+="\\",r+=n);else for(let n,a=0;a<e.length;++a)n=e[a],"\\"===n?r+="\\\\":t&&n===t?(r+="\\",r+=t):t||"\""!==n?t||"'"!==n?r+=n:r+="\\'":r+="\\\"";return r},fcf.unescape=e=>{if("object"==typeof e&&null!==e){if(e=fcf.clone(e),Array.isArray(e))for(let t=0;t<e.length;++t)e[t]=fcf.unescape(e[t]);else for(let t in e)e[t]=fcf.unescape(e[t]);return e}if("string"==typeof e){let t="",r=0;for(let n,a=0;a<e.length;++a)n=e[a],"\\"==n?(++r,0==r%2&&(t+=n)):(r=0,t+=n);return t}},fcf.replaceAll=(e,t,r)=>(e=fcf.str(e),-1==e.indexOf(t)?e:e.split(t).join(r)),fcf.decodeHtml=e=>{e=fcf.str(e);e=fcf.str(e);let t="";for(let r,n=0;n<e.length;++n)if(r=e[n],"&"==r){if("#"==e[n+1]){let r="",a=n+2;for(;a<e.length;++a){let t=e[a],n=e.charCodeAt(a);if(n>=48&&n<=57)r+=t;else{";"!=t&&--a;break}}if(r.length){t+=_StringfromCharCode(parseInt(r)),n=a;continue}}else{let r=n+1,a="";for(;r<e.length;++r){let t=e[r];if("&"==t){--r;break}if(a+=t,a in _decodeHtml_map)break;if(a.length==_decodeHtml_mapMaxLength)break}n=r,a in _decodeHtml_map?(";"==e[n+1]&&++n,t+=_decodeHtml_map[a]):(t+="&",t+=a);continue}t+=r}else t+=r;return t};const _decodeHtml_map={quot:"\"",amp:"&",apos:"'",lt:"<",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",bull:"\u2022",infin:"\u221E",permil:"\u2030",sdot:"\u22C5",dagger:"\u2020",mdash:"\u2014",perp:"\u22A5",par:"\u2225",euro:"\u20AC",trade:"\u2122",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9"},_decodeHtml_mapMaxLength=7;fcf.encodeHtml=e=>{let t="";e=fcf.str(e);for(let r,n=0;n<e.length;++n)switch(r=e[n],r){case"<":t+="<";break;case">":t+=">";break;case"\"":t+=""";break;case"'":t+="'";break;case"&":t+="&";break;default:t+=r;}return t},fcf.stripTags=e=>fcf.str(e).replace(_regStripTags,"");const _regStripTags=/(<[^>]*>)/g;fcf.ltrim=(e,t)=>{e=fcf.str(e);let r=_ltrimPos(e,t);return 0==r?e:e.substr(r)},fcf.rtrim=(e,t)=>{e=fcf.str(e);let r=_rtrimPos(e,t);return r==e.length?e:e.substr(0,r)},fcf.trim=(e,t)=>{e=fcf.str(e);let r=_ltrimPos(e,t),n=_rtrimPos(e,t);return 0!=r||n!=e.length?e.substr(r,n-r):e},fcf.pad=(e,t,r,n)=>{if(isNaN(t))return e;let a=t-e.length;if(0>=a)return e;r||(r=" "),"string"!=typeof n&&(n="l");let s="r"==n[0]?a:"c"==n[0]?_Mathfloor(a/2):0,o="r"==n[0]?0:"c"==n[0]?_Mathfloor(a/2)+a%2:a,l="";for(let a=0;a<s;++a)l+=r[a%r.length];l+=e;for(let a=0;a<o;++a)l+=r[a%r.length];return l},fcf.id=(e,t)=>{e=e||32,t=!(t!==void 0)||t;let r="";for(let n=0;n<e;++n)r+=n||!t?_Mathfloor(16*Math.random()).toString(16):"abcdef"[_Mathfloor(6*Math.random())];return r},fcf.uuid=()=>{let e="";for(let t=0;36>t;++t)e+=8==t||13==t||18==t||23==t?"-":14==t?"4":19==t?(8|3&(0|16*Math.random())).toString(16):(0|16*Math.random()).toString(16);return e},fcf.decodeBase64=function(e){let t,r,n,a,s,o,l,c="",g=0;for(e=fcf.str(e).replace(/[^A-Za-z0-9\+\/\=]/g,"");g<e.length;)a=_keyBase64.indexOf(e.charAt(g++)),s=_keyBase64.indexOf(e.charAt(g++)),o=_keyBase64.indexOf(e.charAt(g++)),l=_keyBase64.indexOf(e.charAt(g++)),t=a<<2|s>>4,r=(15&s)<<4|o>>2,n=(3&o)<<6|l,c+=_StringfromCharCode(t),64!=o&&(c+=_StringfromCharCode(r)),64!=l&&(c+=_StringfromCharCode(n));return c=function t(e){let r="",n=0,a=0,s=0,o=0;for(;n<e.length;)a=e.charCodeAt(n),128>a?(r+=_StringfromCharCode(a),n++):191<a&&224>a?(o=e.charCodeAt(n+1),r+=_StringfromCharCode((31&a)<<6|63&o),n+=2):(o=e.charCodeAt(n+1),c3=e.charCodeAt(n+2),r+=_StringfromCharCode((15&a)<<12|(63&o)<<6|63&c3),n+=3);return r}(c),c},fcf.encodeBase64=function(e){function t(e){e=e.replace(/\r\n/g,"\n");let t="";for(let r,a=0;a<e.length;a++)r=e.charCodeAt(a),128>r?t+=_StringfromCharCode(r):127<r&&2048>r?(t+=_StringfromCharCode(192|r>>6),t+=_StringfromCharCode(128|63&r)):(t+=_StringfromCharCode(224|r>>12),t+=_StringfromCharCode(128|63&r>>6),t+=_StringfromCharCode(128|63&r));return t}let r,n,a,s,o,l,c,g="",u=0;for(e=t(fcf.str(e));u<e.length;)r=e.charCodeAt(u++),n=e.charCodeAt(u++),a=e.charCodeAt(u++),s=r>>2,o=(3&r)<<4|n>>4,l=(15&n)<<2|a>>6,c=63&a,isNaN(n)?l=c=64:isNaN(a)&&(c=64),g=g+_keyBase64.charAt(s)+_keyBase64.charAt(o)+_keyBase64.charAt(l)+_keyBase64.charAt(c);return g};const _keyBase64="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";fcf.isObject=e=>"object"==typeof e&&null!==e,fcf.isIterable=e=>"object"==typeof e&&null!==e&&"function"==typeof e[Symbol.iterator],fcf.isNumbered=e=>{if("object"!=typeof e||null===e)return!1;if("function"!=typeof e[Symbol.iterator]||"number"!=typeof e.length)return!1;if(0<e.length)return 0 in e;for(let t of e)return!1;return!0},Object.defineProperty(fcf,"UNDEFINED",{value:0,writable:!1}),Object.defineProperty(fcf,"NULL",{value:1,writable:!1}),Object.defineProperty(fcf,"NAN",{value:2,writable:!1}),Object.defineProperty(fcf,"BOOLEAN",{value:3,writable:!1}),Object.defineProperty(fcf,"NUMBER",{value:4,writable:!1}),Object.defineProperty(fcf,"STRING",{value:5,writable:!1}),Object.defineProperty(fcf,"DATE",{value:6,writable:!1}),Object.defineProperty(fcf,"OBJECT",{value:7,writable:!1}),Object.defineProperty(fcf,"ARRAY",{value:8,writable:!1}),Object.defineProperty(fcf,"ITERABLE",{value:9,writable:!1}),Object.defineProperty(fcf,"NUMBERED",{value:10,writable:!1}),fcf.isNature=(e,t,r)=>{let n=Array.isArray(t)?t.length:1;for(let a,s=0;s<n;++s)switch(a=Array.isArray(t)?t[s]:t,"string"==typeof a&&(a="numbered"==a?fcf.NUMBERED:"iterable"==a?fcf.ITERABLE:"array"==a?fcf.ARRAY:"object"==a?fcf.OBJECT:"date"==a?fcf.DATE:"string"==a?fcf.STRING:"number"==a?fcf.NUMBER:"boolean"==a?fcf.BOOLEAN:"nan"==a?fcf.NAN:"null"==a?fcf.NULL:fcf.UNDEFINED),a){case fcf.NUMBERED:if(fcf.isNumbered(e))return!0;break;case fcf.ITERABLE:if(fcf.isIterable(e))return!0;break;case fcf.ARRAY:if(Array.isArray(e))return!0;break;case fcf.OBJECT:if("object"==typeof e&&null!==e&&!(e instanceof Date))return!0;break;case fcf.DATE:if(e instanceof Date)return!0;if(r&&"string"==typeof e&&!isNaN(new Date(e).getTime()))return!0;break;case fcf.STRING:if("string"==typeof e)return!0;break;case fcf.NUMBER:if("number"==typeof e&&!isNaN(e))return!0;if(r&&!isNaN(e)&&!isNaN(parseFloat(e)))return!0;break;case fcf.BOOLEAN:if("boolean"==typeof e)return!0;break;case fcf.NAN:if("number"==typeof e&&isNaN(e))return!0;break;case fcf.NULL:if(null===e)return!0;break;case fcf.UNDEFINED:if(void 0===e)return!0;}return!1},fcf.empty=e=>{if(e===void 0||null===e)return!0;if("number"==typeof e)return isNaN(e);if("string"==typeof e)return""==e;if(e instanceof Error)return!1;if(e instanceof Date)return isNaN(e.getTime());if(fcf.isIterable(e)){for(let t of e)return!1;return!0}if("object"==typeof e){for(var t in e)return!1;return!0}return!1},fcf.has=(e,t)=>"object"==typeof e&&null!==e&&(fcf.isIterable(e)&&"function"==typeof e.has?e.has(t):fcf.isNumbered(e)?(t=parseInt(t),0<=t&&t<e.length):t in e),fcf.get=(e,t)=>"object"!=typeof e||null===e?void 0:e instanceof Set?e.has(t)?t:void 0:e instanceof Map?e.get(t):e[t],fcf.equal=(e,t,r)=>!!_equalObject(e,t,r)&&("object"!=typeof e||_equalObject(t,e,r)),fcf.compare=(e,t,r)=>{let n=_compareObject(e,t,r);return n?n:(n=_compareObject(t,e,r),0==n?0:0>n?1:-1)};const _compareWeights={undefined:0,null:1,nan:2,boolean:3,number:4,string:5,date:6,object:7,array:8};fcf.count=(e,t)=>{if(!!t){let r=0;return fcf.each(e,(e,n)=>{t(e,n)&&++r}),r}if("object"==typeof e&&null!==e){if(fcf.isNumbered(e))return e.length;if(e instanceof Map||e instanceof Set)return e.size;else{let t=0;for(let r in e)++t;return t}}else return"string"==typeof e?e.length:0},fcf.each=(e,t)=>{let r,n;if(fcf.isNumbered(e)&&e&&"object"==typeof e&&"function"!=typeof e.forEach){for(let a=0;a<e.length;++a)if(n=t(a,e[a]),n instanceof Promise||n instanceof fcf.Actions){function s(){c.then(()=>{if(o<e.length)return t(o,e[o])}).then(t=>{++o,void 0===t&&o<e.length?s():l.complete(t)}).catch(t=>{l.error(t)})}let o=a+1,i=n;n=r?r:fcf.actions();let l,c=fcf.actions();n.then((e,t)=>{l=t}),i.then(e=>{void 0===e?s():l.complete(e)}).catch(t=>{l.error(t)});break}else if(void 0!==n)break;}else if("object"==typeof e&&null!==e){let a=!1,s=[],o=0;if("function"==typeof e.forEach){let r=!1;e.forEach((e,o)=>{if(!r)if(a)s.push([o,e]);else if(n=t(o,e),n instanceof Promise||n instanceof fcf.Actions)a=!0;else if(void 0!==n)return r=!0,!0})}else for(let r in e)if(a)s.push([r,e[r]]);else if(n=t(r,e[r]),n instanceof Promise||n instanceof fcf.Actions)a=!0;else if(void 0!==n)break;if(a){function e(){l.then(()=>{if(o<s.length)return t(s[o][0],s[o][1])}).then(t=>{++o,void 0===t&&o<s.length?e():i.complete(t)}).catch(t=>{i.error(t)})}let a=n;n=r?r:fcf.actions();let i,l=fcf.actions();n.then((e,t)=>{i=t}),a.then(t=>{void 0===t?e():i.complete(t)}).catch(t=>{i.error(t)})}}return(n instanceof fcf.Actions?n:fcf.actions().result(n)).options({quiet:!0}).exception()},fcf.append=(...e)=>{let t="boolean"==typeof e[0]?1:0,r="boolean"==typeof e[0]&&e[0];if(Array.isArray(e[t])){for(let n=t+1;n<e.length;++n)if(r){if(Array.isArray(e[n]))for(let r,a=0;a<e[n].length;++a)r=null===e[n][a]?null:e[n][a]instanceof Date?new Date(e[n][a]):Array.isArray(e[n][a])?fcf.append(!0,[],e[n][a]):"object"==typeof e[n][a]?fcf.append(!0,new e[n][a].__proto__.constructor,e[n][a]):e[n][a],e[t].push(r);else fcf.each(e[n],(r,n)=>{let a=null===n?null:n instanceof Date?new Date(n):Array.isArray(n)?fcf.append(!0,[],n):"object"==typeof n?fcf.append(!0,new n.__proto__.constructor,n):n;e[t].push(a)});}else if(Array.isArray(e[n]))for(let r=0;r<e[n].length;++r)e[t].push(e[n][r]);else fcf.each(e[n],(r,n)=>{e[t].push(n)});}else if(e[t]instanceof Set){for(let r=t+1;r<e.length;++r)if("object"==typeof e[r]&&null!==e[r])if(e[r]instanceof Set)for(let n of e[r])e[t].add(n);else fcf.each(e[r],(r,n)=>{e[t].add(n)});}else if(e[t]instanceof Map){for(let n=t+1;n<e.length;++n)if("object"==typeof e[n]&&null!==e[n])if(r){if(e[n]instanceof Map)for(let r of e[n])e[t].set(r[0],cloneValue(r[1]));else fcf.each(e[n],(r,n)=>{e[t].set(r,cloneValue(n))});}else if(e[n]instanceof Map)for(let r of e[n])e[t].set(r[0],r[1]);else fcf.each(e[n],(r,n)=>{e[t].set(r,n)});}else if("object"==typeof e[t]&&null!==e[t])for(let n=t+1;n<e.length;++n)if("object"==typeof e[n]&&null!==e[n])if(r){if(!Array.isArray(e[n])&&!(e[n]instanceof Map)&&!(e[n]instanceof Set))for(let r of Object.getOwnPropertyNames(e[n]))e[t][r]=cloneValue(e[n][r]);else fcf.each(e[n],(r,n)=>{e[t][r]=cloneValue(n)});}else if(!Array.isArray(e[n])&&!(e[n]instanceof Map)&&!(e[n]instanceof Set))for(let r of Object.getOwnPropertyNames(e[n]))e[t][r]=e[n][r];else fcf.each(e[n],(r,n)=>{e[t][r]=n});return e[t]};const cloneValue=e=>{if(null===e)return null;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return fcf.append(!0,[],e);if("object"==typeof e){let t;try{t=new e.__proto__.constructor}catch(r){t={}}return fcf.append(!0,t,e)}return e};fcf.clone=e=>{if(null===e)return null;if(Array.isArray(e))return fcf.append(!0,[],e);if(e instanceof Date)return new Date(e);if("object"==typeof e){let t;try{t=new e.__proto__.constructor}catch(r){t={}}return fcf.append(!0,t,e)}return e},fcf.parseObjectAddress=(e,t)=>{if(Array.isArray(e)){let r=[];for(let n of e)t?r.push("object"==typeof n?n:{part:n,array:!1}):r.push("object"==typeof n?n.part:n);return r}let r=0,n=!1,a=[],s="",o=0;for(;o<e.length;)switch(r){case-1:for(;o<e.length;){if(32>=e.charCodeAt(o)){++o;break}if("."==e[o]){r=0,++o;break}else if("["==e[o]){for(++o;o<e.length;){if(32>=e.charCodeAt(o)){++o;continue}if("["==e[o]&&!n){n=!0,++o;continue}else if("\""==e[o]){++o,r=2;break}else if("'"==e[o]){++o,r=3;break}else{r=1;break}}break}else{r=0;break}}break;case 0:for(let i=!0;!0;){if("."==e[o]){let e=s.length-1;for(;0<=e&&32>=s.charCodeAt(e);)--e;e!=s.length-1&&(s=s.substring(0,e+1)),t?a.push({part:s,array:n}):a.push(s),n=!1,s="",r=-1;break}else if("["==e[o]){let e=s.length-1;for(;0<=e&&32>=s.charCodeAt(e);)--e;e!=s.length-1&&(s=s.substring(0,e+1)),(s.length||a.length)&&(t?a.push({part:s,array:n}):a.push(s)),n=!1,s="",r=-1;break}else if(o+1>=e.length){s+=e[o];let r=s.length-1;for(;0<=r&&32>=s.charCodeAt(r);)--r;r!=s.length-1&&(s=s.substring(0,r+1)),t?a.push({part:s,array:n}):a.push(s),n=!1,s="",++o;break}i?32<e.charCodeAt(o)&&(s+=e[o],i=!1):s+=e[o],++o}break;case 1:for(;!0;){if("]"==e[o]){let i=s.length-1;for(;0<=i&&32>=s.charCodeAt(i);)--i;if(i!=s.length-1&&(s=s.substring(0,i+1)),t?a.push({part:s,array:n}):a.push(s),s="",r=-1,n)for(++o;!(o>=e.length);){if("]"==e[o]){++o;break}++o}else++o;n=!1;break}else if(o+1>=e.length){s+=e[o];let r=s.length-1;for(;0<=r&&32>=s.charCodeAt(r);)--r;r!=s.length-1&&(s=s.substring(0,r+1)),t?a.push({part:s,array:n}):a.push(s),n=!1,s="",++o;break}s+=e[o],++o}break;case 2:case 3:{let i=0,l=2==r?"\"":"'";for(;!0;){if(e[o]==l&&!(i%2)){for(t?a.push({part:s,array:n}):a.push(s),s="",r=-1;o<e.length;){if("]"==e[o]){++o;break}++o}if(n)for(;o<e.length;){if("]"==e[o]){++o;break}++o}n=!1;break}if(o+1>=e.length){s+=e[o],t?a.push({part:s,array:n}):a.push(s),n=!1,s="",r=-1,++o;break}"\\"==e[o]?(i%2&&(s+=e[o]),++i):(s+=e[o],i=0),++o}}}return a.length||(t?a.push({part:"",array:!1}):a.push("")),a},fcf.normalizeObjectAddress=e=>{for(var t=fcf.parseObjectAddress(e,!0),r="",n=0;n<t.length;++n){let e,a;"object"==typeof t[n]?(e=t[n].part,a=t[n].array):(e=t[n],a=!1),e=fcf.escapeQuotes(e,"\""),r+=a?"[[\""+e+"\"]]":"[\""+e+"\"]"}return r},fcf.resolve=(e,t,r)=>{if("object"==typeof e){let n=fcf.parseObjectAddress(t);for(let a=0;a<n.length;++a)if(e=e[n[a]],void 0===e){if(void 0!==r&&!r&&a!=n.length-1)throw new fcf.Exception("ACCESS_FAILED_FIELD_TOKENIZE",{command:t});return}return e}},fcf.resolveEx=(e,t,r)=>{let n={key:void 0,object:void 0};if("object"!=typeof e)return n;let a=fcf.parseObjectAddress(t,!0),s=e;for(var o=0;o<a.length-1;++o){let e=a[o].part;if(void 0===s[e]||null===s[e])if(r)s[e]=a[o].array?[]:{};else return n;s=s[e]}return n.key=a[a.length-1].part,n.object=s,n},fcf.prepare=(e,t)=>{if(t="string"==typeof t?fcf.parseObjectAddress(t,!0):!!Array.isArray(t)&&t,!t)return e;for(let r of t)"object"==typeof r?(r.part in e||(e[r.part]=r.array?[]:{}),e=e[r.part]):(r in e||(e[r]={}),e=e[r]);return e},fcf.getDirectory=e=>{let t=e.length-1;for(;0<=t;--t){let r=e[t];if("\\"==r||"/"==r)break}return-1==t?"":e.substring(0,t)},fcf.getExtension=e=>{if("string"!=typeof e)return"";e=e.split("?")[0].split("#")[0];var t=e.split(".");return 1<t.length?t[t.length-1]:""},fcf.getShortFileName=e=>{if(!e)return"";for(var t,r=-1,n=0;n<e.length;++n)t=e.charAt(n),(":"==t||"/"==t||"\\"==t)&&(r=n);let a=e.substr(-1==r?0:r+1).split(".");return 1<a.length&&a.pop(),a.join(".")},fcf.getFileName=e=>{if(e=fcf.rtrim(e,"/"),!e)return"";for(var t,r=0,n=0;n<e.length;++n)t=e.charAt(n),(":"==t||"/"==t||"\\"==t)&&(r=n);return r&&(r+=1),e.substr(r)},fcf.resolvePath=function(e,t){if("@"!=e[0])return e;let r;r=_Mathmin(-1==(r=e.indexOf("+"))?1/0:r,-1==(r=e.indexOf("?"))?1/0:r,-1==(r=e.indexOf("#"))?1/0:r,-1==(r=e.indexOf("/"))?1/0:r,-1==(r=e.indexOf("\\"))?1/0:r,-1==(r=e.indexOf(".wrapper.js"))?1/0:r,-1==(r=e.indexOf(".wrapper.min.js"))?1/0:r);let n=r==1/0?e.substring(1):e.substring(1,r),a=r==1/0?"":e.substring(r);if("object"==typeof t&&n in t)e=t[n]+a;else if(n in fcf.getConfiguration().aliases)e=fcf.getConfiguration().aliases[n]+a;else throw new fcf.Exception("RESOLVE_PATH_ERROR",{path:e});return e},fcf.normalizePath=(e,t)=>{let r,n=0;if(t=void 0===t?_isServer:t,"/"==e[0])n=1;else if(-1!=(r=e.indexOf(":")))if((t||"*"===t)&&"\\"==e[r+1]&&1==r)n=r+2;else if((!t||"*"===t)&&(0==e.indexOf("http://")||0==e.indexOf("https://")))t=!1,n=e.indexOf("/",e.indexOf("://")+3),-1==n?n=e.length:n+=1;else{let t=e.substring(0,r);-1==t.indexOf("/")&&-1==t.indexOf("\\")&&(n=r+1)}let a=e.substring(0,n),s=e.substring(n),o="";t||-1==(r=s.indexOf("?"))&&-1==(r=s.indexOf("#"))||(o=s.substring(r),s=s.substring(0,r)),s=fcf.replaceAll(s,"\\","/");let i=s.split("/"),l=[];for(let r of i)if("."==r||""==r)continue;else".."==r?l.pop():l.push(r);return a+l.join("/")+o},fcf.normalizeSubpath=e=>{let t=fcf.replaceAll(e,"\\","/"),r=t.split("/"),n=[];for(let t of r)if("."==t||""==t)continue;else".."==t?n.pop():n.push(t);return n.join("/")},fcf.getPathInfo=(e,t,r)=>{t=void 0===t?fcf.isServer():t;let n=fcf.resolvePath(e);if(n=fcf.normalizePath(n,t),-1==n.indexOf("/")&&-1==n.indexOf("\\")&&-1==n.indexOf(":"))return{module:"",subpath:n};let a=fcf.isServer()?fcf.normalizePath(process.cwd()):void 0;if((!t||"*"===t)&&(-1!=n.indexOf("http://")||-1!=n.indexOf("https://")))if(!_isServer){let e=window.location.href.indexOf("://");if(-1!=e&&-1!=(e=window.location.href.indexOf("/",e+3))&&-1!=n.indexOf(window.location.href.substring(0,e)))n=n.substring(e);else return{}}else return{};let s=n.indexOf(":");1==s&&(s=-1);let o=-1==s?"":n.substring(0,s);if((-1!=o.indexOf("/")||-1!=o.indexOf("\\"))&&(o=void 0,s=-1),-1!=s)return{module:o,subpath:n.substring(s+1)};let i=fcf.getPath(n);if(!t||"*"===t){let e=fcf.getConfiguration().sources;for(let t in e)if(e[t].webPackagePath&&0==(s=i.indexOf(e[t].webPackagePath)))return{module:t,subpath:i.substring(e[t].webPackagePath.length+1)}}let l;if(_isServer){let e="win32"==process.platform?";":":";l=[];for(let t of require.main.paths)fcf.append(l,t.split(e).filter(e=>""!=e&&"."!=e));fcf.append(l,process.env.NODE_PATH.split(e).filter(e=>""!=e&&"."!=e))}else l=[fcf.getConfiguration().webModuleDirectory];for(let n of l)if((n=fcf.normalizePath(n),!(_isServer&&(t||"*"===t)&&a==n))&&0==(s=i.indexOf(n)))if(o=i.substring(n.length+1).split("/")[0].split("\\")[0],_isServer&&(t||"*"===t)&&(a==n+"/"+o||a==n+"\\"+o))o=void 0,s=-1;else if(!o)o=void 0,s=-1;else return{module:o,subpath:i.substring(n.length+1+o.length+1)};if(_isServer&&(t||"*"===t)&&0==n.indexOf(a))return{module:"",subpath:n.substr(process.cwd().length+1)};if(!t||"*"===t||"/"!=n[0]&&1!=n.indexOf(":\\"))return{module:"",subpath:fcf.ltrim(n,"/")};if(!r)throw new fcf.Exception("GET_PATH_INFO_ERROR",{path:e});return{}},fcf.getPath=(e,t,r)=>{if("object"!=typeof t&&(r=t,t=void 0),r=void 0===r?_isServer:r,e=fcf.str(e),e=fcf.resolvePath(e,t),e=fcf.normalizePath(e,r),r){let t=e.indexOf(":\\");if("/"==e[0]||-1!=t&&2>t)return fcf.normalizePath(e)}else if(-1!=e.indexOf("://"))return e;let n=e.indexOf(":"),a=-1==n?"":e.substring(0,n),s=-1==n?e:e.substring(n+1);(-1!=a.indexOf("/")||-1!=a.indexOf("\\"))&&(n=-1,s=e,a="");const o=fcf.getConfiguration();if(""==a)e=r?fcf.normalizePath(libPath.join(process.cwd(),s)):"/"+fcf.ltrim(s,["/","\\",":"]);else if(r){let t=libResolver.resolveModule(a);e=fcf.normalizePath(libPath.join(t,s))}else{let t="",r=o.sources[a];"string"==typeof r&&(r={webPackagePath:r}),t+=r&&r.webPackagePath?r.webPackagePath:o.webModuleDirectory+"/"+a,t&&s&&"/"!=s[0]&&"\\"!=s[0]&&(t+="/"),e=t+s}return e},fcf.styleToString=(e,t)=>{let r="";if("object"==typeof e&&null!==e){let t=!0;for(let n in e)t?t=!1:r+="; ",r+=fcf.styleToString(n,e[n])}else{if(t===void 0||null===t||""===t)return r;-1==["left","top","bottom","right","width","min-width","max-width","height","min-height","max-height"].indexOf(e)||isNaN(t)||(t+="px"),r=e+": "+t}return r},fcf.load=(e,t)=>{"object"==typeof e&&(t=e,e=t.url||t.path),e=fcf.resolvePath(e),t="object"==typeof t?t:{},!0!==t.external&&_isServer&&("auto"!==t.external||0!=e.indexOf("http://")||0!=e.indexOf("https://"))||(e=new fcf.RouteInfo(e).url);let r=_isServer&&"auto"===t.external?-1==e.indexOf("http://")&&-1==e.indexOf("https://"):!(_isServer&&t.external)&&_isServer;t=t||{};let n=t.format;if(!_isServer&&(-1==e.indexOf("://")||0==e.indexOf(window.location.href))){let t=fcf.getExtension(new fcf.RouteInfo(e).uri).toLowerCase();if("js"==t||"css"==t){let t=fcf.getPathInfo(e,r).module;t&&fcf.getConfiguration().sources[t]&&fcf.getConfiguration().sources[t].version&&(e=fcf.buildUrl(e,{version:fcf.getConfiguration().sources[t].version}))}}return fcf.actions().then((n,a)=>{if(!_isServer){let r=fcf.getPath(e),n=(t.method||"GET").toUpperCase();"GET"==n&&(r=fcf.buildUrl(r,t.data));var s=new XMLHttpRequest;s.onreadystatechange=()=>{if(4==s.readyState)if(200==s.status)a.complete(s.responseText);else{let e=s.responseText;try{e=JSON.parse(e)}catch(t){}e="object"==typeof e&&e._templateMessage?new fcf.Exception(e):new fcf.Exception("HTTP_REQUEST_ERROR",{code:s.status}),a.error(e)}},s.open(n,r,!(t.async!==void 0)||t.async);let o=new fcf.RouteInfo(r).server,i="@"==r[0]||"/"==r[0]||o&&o==window.location.hostname;if(i){let e=fcf.append({},fcf.getContext());delete e.route,delete e.args,delete e.safeEnv,s.setRequestHeader("fcf-context",fcf.encodeBase64(JSON.stringify(e)))}if("object"==typeof t.header)for(let e in t.header)s.setRequestHeader(e,t.header[e]);if("GET"!==n){let e=!1;if("object"==typeof t.header)for(let r in t.header)if("content-type"==r.toLowerCase()){e=!0;break}t.body instanceof FormData?(!e&&s.setRequestHeader("Content-Type","multipart/form-data"),s.send(t.body)):"string"==typeof t.body?(!e&&s.setRequestHeader("Content-Type","text/plain"),s.send(t.body)):void 0!==t.body&&null!==t.body?(!e&&s.setRequestHeader("Content-Type","application/json"),s.send(JSON.stringify(t.body))):s.send(null)}else s.send(null)}else if(!r){let r=fcf.clone(t);r.header=r.header||{};let n=new fcf.RouteInfo(e).server,s="@"==e[0]||"/"==e[0]||n&&n==fcf.getConfiguration().host;if(s){let e=fcf.append({},fcf.getContext());delete e.route,delete e.args,delete e.safeEnv,r.header["fcf-context"]=fcf.encodeBase64(JSON.stringify(e))}libLoad(e,r).then(e=>{a.complete(e)}).catch(e=>{a.error(e)})}else if(void 0===t.async||!!t.async)libFS.readFile(fcf.getPath(e),"utf8",(e,t)=>{e&&a.error(e),a.complete(t)});else try{a.complete(libFS.readFileSync(fcf.getPath(e),"utf8"))}catch(t){a.error(t)}}).then(e=>("auto"===t.format?e=_autoParse(e):"json"===t.format&&(e=JSON.parse(e)),e)).catch(t=>new fcf.Exception("REQUEST_ERROR",{url:e},t))},fcf.getParamCount=e=>{if("length"in e)return e.length;let t=e.toString(),r=t.indexOf("("),n=r,a=t.indexOf(")");if(-1==r||-1==a||r>=a)return 0;let s=0;for(;r=t.indexOf(",",r+1),!(-1==r||r>=a);)s?++s:s=2;if(0==s)for(r=n+1;r<a;){let e=t.charCodeAt(r);if(32<e)return 1;++r}return s},fcf.actions=(e,t)=>new fcf.Actions(e,t),fcf.Actions=class e{constructor(e,t){"object"==typeof e&&(t=e,e=void 0),this._flags=(t&&!!t.deferred?ACTIONS_FLAGS_DEFERRED:0)|(t&&!!t.noexcept?ACTIONS_FLAGS_NOEXCEPT:0)|(t&&!!t.quiet?ACTIONS_FLAGS_QUIET:0),this._stack=[],t&&t.context&&fcf.setContext(t.context),this._state=fcf.getState(),this._errorcbs=[],t&&t.errorResult&&(this._errorResult=t.errorResult),"function"==typeof e&&this.then(e,void 0,!0)}then(e,t,r){if("undefined"!=typeof Promise&&e instanceof Promise){let t=this;e.catch(r=>{t.error(r)}),this.then(()=>e)}else e instanceof fcf.Actions?this.then(()=>e):e&&(this._stack.push({cb:e,args:void 0,autoComplete:fcf.getParamCount(e)<(r?1:2),skipResult:r}),this._execute());return t&&this.catch(t),this}each(e,t){return"function"==typeof e?this.then(r=>{e=e();let n=[];fcf.each(e,(e,t)=>{n.unshift([e,t])});for(let e of n)this._stack.unshift({cb:t,args:e,autoComplete:4>fcf.getParamCount(t)});return this._execute(),r}):("object"==typeof e&&null!==e&&fcf.each(e,(e,r)=>{this._stack.push({cb:t,args:[e,r],autoComplete:4>fcf.getParamCount(t)})}),this._execute()),this}asyncEach(e,t){let r=this;return this.then((n,a)=>{e="function"==typeof e?e():e;let s=4>fcf.getParamCount(t),o=fcf.count(e),i=0,l=!1;if(0==o)return void a.complete();let c=!1;fcf.each(e,(e,n)=>{if(c)return!1;let g={_complete:!1,complete:function(e){_isServer&&fcf.setState(r._state),this._complete||l||r._error||(++i,r._result=e,i==o&&(this._complete=!0,a.complete(e)))},error:function(e){return _isServer&&fcf.setState(r._state),r._flags&ACTIONS_FLAGS_NOEXCEPT?void this.complete():void(this._complete||l||r._error||(r._result=void 0,this._complete=!0,l=!0,a.error(e)))}},u=[e,n,r._result];s||u.push(g);let d,p=!1;try{let e=t.toString().substr(0,5);d="async"==e&&32>=t.toString().charCodeAt(5)?t.apply(r,u).catch(t=>{p=!0,c=!0,g.error(t)}):t.apply(r,u)}catch(t){return c=!0,void g.error(t)}p||(s&&("undefined"!=typeof Promise&&d instanceof Promise||d instanceof fcf.Actions)?d.then(e=>{g.complete(e)}).catch(e=>{g.error(e)}):s&&g.complete(d))})}),this}catch(t){if(!this._stack)return;this._flags|=ACTIONS_FLAGS_CATCH;let r;if(t){if(this._error)try{let r=t.call(this,this._error);r instanceof Error&&(this._error=r)}catch(t){this._error=t,r=t}this._errorcbs.push(t)}if(r)throw r;return this}finally(e){if(e)if(this._stack.push({cb:e,args:void 0,finally:!0,autoComplete:2>fcf.getParamCount(e)}),this._error)try{e.call(this,void 0,{complete:()=>{},error:()=>{}})}catch(t){this._error=t}else this._execute();return this}startup(){return this._flags&=~ACTIONS_FLAGS_DEFERRED,this._execute(),this}error(e){return arguments.length?(this._error?this._error=e:(this._error=e,this._callErrors()),this):this._error}result(e){return arguments.length?(this._result=e,this):this._error?this._errorResult:this._result}exception(){if(this._error)throw this.options({quiet:!0}),this._error;return this}options(e){return arguments.length?("noexcept"in e&&(e.noexcept?this._flags|=ACTIONS_FLAGS_NOEXCEPT:this._flags&=~ACTIONS_FLAGS_NOEXCEPT),"quiet"in e&&(e.quiet?this._flags|=ACTIONS_FLAGS_QUIET:this._flags&=~ACTIONS_FLAGS_QUIET),"deferred"in e&&(e.deferred?this._flags|=ACTIONS_FLAGS_DEFERRED:this._flags&=~ACTIONS_FLAGS_DEFERRED),"errorResult"in e&&(this._errorResult=e.errorResult),this):{noexcept:!!(this._flags&ACTIONS_FLAGS_NOEXCEPT),quiet:!!(this._flags&ACTIONS_FLAGS_QUIET),deferred:!!(this._flags&ACTIONS_FLAGS_DEFERRED),errorResult:this._errorResult}}promise(){return new Promise((e,t)=>{this.then(t=>{e(t)}).catch(e=>{t(e)})})}_callErrors(){let t;for(let r=0;r<this._errorcbs.length;++r)try{let t=this._errorcbs[r].call(this,this._error);t instanceof Error&&(this._error=t)}catch(r){this._error=r,t=r}for(let e=0;e<this._stack.length;++e)if(this._stack[e].finally)try{this._stack[e].cb.call(this,void 0,{complete:()=>{},error:()=>{}})}catch(t){this._error=t}if(this._flags&ACTIONS_FLAGS_QUIET||this._flags&ACTIONS_FLAGS_CATCH||setTimeout(()=>{this._flags&ACTIONS_FLAGS_CATCH||this._flags&ACTIONS_FLAGS_QUIET||fcf.log.err("FCF","Unhandled error in fcf.Actions (to handle catch method or \"quiet\" flag). Error: ",this._error)},0),t)throw t}_execute(){let e=this;if(this._flags&ACTIONS_FLAGS_RUN||!this._stack||0==this._stack.length||this._error)return void(_isServer&&!(this._flags&ACTIONS_FLAGS_RUN)&&fcf.setState(e._state));if(_isServer&&fcf.setState(e._state),this._flags&ACTIONS_FLAGS_DEFERRED)return;this._flags|=ACTIONS_FLAGS_RUN;let t=this._stack.shift(),r={_end:!1,complete:function(r){_isServer&&fcf.setState(e._state),this._end||e._error||(this._end=!0,e._flags&=~ACTIONS_FLAGS_RUN,"undefined"!=typeof Promise&&r instanceof Promise||r instanceof fcf.Actions?r.then(r=>{t.finally||(e._result=r),e._execute()}).catch(e=>{this._end=!1,this.error(e)}):(!t.finally&&(e._result=r),e._execute()))},error:function(t){return _isServer&&fcf.setState(e._state),e._flags&ACTIONS_FLAGS_NOEXCEPT?void this.complete():void(this._end||e._error||(this._end=!0,e._flags&=~ACTIONS_FLAGS_RUN,e._result=void 0,e._error=t?t:new Error("Unknown error"),e._callErrors()))}},n=[];t.args&&(n.push(t.args[0]),n.push(t.args[1])),t.skipResult||n.push(this._result),t.autoComplete||n.push(r);let a,s=!1;try{let e=t.cb.toString().substr(0,5);a="async"==e&&32>=t.cb.toString().charCodeAt(5)?t.cb.apply(this,n).catch(t=>{s=!0,r.error(t)}):t.cb.apply(this,n)}catch(t){return void r.error(t)}s||("undefined"!=typeof Promise&&a instanceof Promise||a instanceof fcf.Actions?t.autoComplete?a.then(e=>{r.complete(e)}).catch(e=>{r.error(e)}):a.catch(e=>{r.error(e)}):t.autoComplete&&r.complete(a))}};const ACTIONS_FLAGS_DEFERRED=1,ACTIONS_FLAGS_NOEXCEPT=2,ACTIONS_FLAGS_RUN=4,ACTIONS_FLAGS_QUIET=8,ACTIONS_FLAGS_CATCH=16;fcf.module=e=>{let t=_getModulePath(e.name),r=!1;if(!_modules[t])_modules[t]={state:"wait",result:void 0,error:void 0,actions:fcf.actions(),act:void 0,dependencies:[],lazy:[],quiet:e.quiet?1:0},r=!0;else if("wait"!=_modules[t].state)return _modules[t].dependencies=Array.isArray(e.dependencies)?e.dependencies:[],void(_modules[t].lazy=Array.isArray(e.lazy)?e.lazy:[]);_modules[t].dependencies=Array.isArray(e.dependencies)?e.dependencies:[],_modules[t].lazy=Array.isArray(e.lazy)?e.lazy:[];let n=_modules[t];n.state="processing",fcf.each(e.dependencies,(t,r)=>{e.dependencies[t]="/"==r[0]?"a_value":fcf.ltrim(r,[":","/"])}),fcf.each(e.lazy,(t,r)=>{e.lazy[t]="/"==r[0]?"a_value":fcf.ltrim(r,[":","/"])});let a=r?_modules[t].actions:fcf.actions();return a.asyncEach(e.dependencies,(e,r)=>_loadModule(r,_modules[t].quiet)).then(()=>{let r=[];if(fcf.each(e.dependencies,(e,t)=>{r.push(_modules[_getModulePath(t)].result)}),n.result=e.module.apply(void 0,r),_isServer){let e=fcf.isServer()&&"win32"==process.platform?fcf.replaceAll(fcf.replaceAll(t,"/","\\"),":/",":\\"):t;require.cache[e].exports=n.result}return n.state="ready",n.act&&n.act.complete(),fcf.actions().asyncEach(e.lazy,(e,r)=>_loadModule(r,_modules[t].quiet)).then(()=>(n.state="loaded",_callOnModuleLoad(),_waitLazyModule(t))).then(()=>{n.state="ok"}).catch(r=>{_modules[t].quiet=1})}).then(()=>n.result).catch(e=>{if(n.state="error",n.error=e,n.act&&n.act.error(e),_callOnModuleLoad(),_isServer)throw e})},fcf.require=function(e){let t=!1,r=!0,n=[];for(let a of arguments)"object"!=typeof a||null===a||Array.isArray(a)?"string"==typeof a?n.push(a):Array.isArray(a)&&(n=n.concat(a)):(t=!!("quiet"in a)&&a.quiet,r=!1!==a.async);return fcf.actions({errorResult:[]}).asyncEach(n,(e,n)=>_loadModule(n,t,!r)).asyncEach(n,(e,t)=>_waitLazyModule(_getModulePath(t))).then(()=>{let e=[];return fcf.each(n,(t,r)=>{e.push(_modules[_getModulePath(r)].result)}),e})};let _globalSyncModuleLoad=0,_modules={},_moduleCallbacks=[];fcf.stackToString=e=>{e=fcf.parseStack(e);let t="";for(let r=0;r<e.length;++r)r&&(t+="\n"),t+=fcf.str(e[r].function)+" ("+e[r].file+":"+fcf.str(e[r].line)+":"+fcf.str(e[r].column)+")";return t},fcf.errorToString=(e,t)=>e instanceof fcf.Exception?e.toString(t,t):t?e.toString()+"\nStack"+fcf.replaceAll("\n"+fcf.stackToString(e),"\n","\n "):e.toString(),fcf.parseStack=function(e){if(e instanceof Error)e=e.stack;else{if(e instanceof fcf.Exception)return e.stackArr;if(Array.isArray(e))return e}return"string"==typeof e?_parseStack(e.split("\n")).stack:[]},fcf.parseError=function(e){if(e instanceof fcf.Exception)return{message:e.toString(),fullMessage:e.toString(!1,!0),stack:fcf.stackToString(e.stackArr),stackArr:e.stackArr};if(!(e instanceof Error))return{message:"",fullMessage:"",stack:"",stackArr:[]};let t=e.stack.split("\n"),r=_parseStack(t),n="";for(let a=0;a<=r.preStart;++a)n+=t[a],n+="\n";return n||(n=e.message),{message:e.message,fullMessage:n,stackArr:r.stack,stack:fcf.stackToString(r.stack)}},fcf.parseDate=(e,t,r,n,a)=>{t||(t="Y*m*d*H*i*s*v");let s=n instanceof Date?n:"string"==typeof n?fcf.parseDate(n,t,!1,new Date(1970,0,1,0,0,0,0)):new Date(1970,0,1,0,0,0,0);(!s||isNaN(s.getTime()))&&(s=new Date);let o=!1,i=!1,l=0,g=0,u=0;for(;l<t.length&&g<e.length;++l){let r=t[l];if("\\"==r)++u;else if("Y"==r&&0==u%2){let t=parseInt(e.substr(g,4));if(isNaN(t))return new Date("");s.setYear(t),g+=4}else if("m"==r&&0==u%2){let t=parseInt(e.substr(g,2));if(isNaN(t)||12<t||1>t)return new Date("");s.setMonth(t-1),g+=2}else if("d"==r&&0==u%2){let t=parseInt(e.substr(g,2));if(isNaN(t)||31<t||1>t)return new Date("");s.setDate(t),g+=2}else if("H"==r&&0==u%2){let t=parseInt(e.substr(g,2));if(isNaN(t)||23<t||0>t)return new Date("");s.setHours(t),g+=2}else if("h"==r&&0==u%2){let t=parseInt(e.substr(g,2));if(isNaN(t)||12<t||1>t)return new Date("");(0==t||12<t)&&(t=12),s.setHours(t),g+=2}else if("i"==r&&0==u%2){let t=parseInt(e.substr(g,2));if(isNaN(t)||59<t||0>t)return new Date("");s.setMinutes(t),g+=2}else if("s"==r&&0==u%2){let t=parseInt(e.substr(g,2));if(isNaN(t)||59<t||0>t)return new Date("");s.setSeconds(t),g+=2}else if(("a"==r||"A"==r)&&0==u%2){let t=e.substr(g,2).toLowerCase();"pm"==t?o=!0:i=!0,g+=2}else if("v"==r&&0==u%2){let t=parseInt(e.substr(g,3));if(isNaN(t))return new Date("");s.setMilliseconds(t),g+=3}else if("*"==r&&0==u%2)g+=1;else{if(e[g]!=t[l])break;g+=1}"\\"!=r&&(u=0)}return r&&l!=t.length?new Date(""):l?(i&&12==s.getHours()&&s.setHours(0),o&&12>s.getHours()&&s.setHours(s.getHours()+12),!1===a&&(s=new Date(s.getTime()-6e4*new Date().getTimezoneOffset())),"number"==typeof a&&(s=new Date(s.getTime()-6e4*a)),s):new Date("")},fcf.formatDate=(e,t,r)=>{let n="",a=0;if(t||(t="Y-m-d H:i:s.v"),e=new Date(e),!(e instanceof Date)||isNaN(e.getTime()))return"";"number"==typeof r&&(e=new Date(e.getTime()+6e4*r)),!1===r&&(e=new Date(e.getTime()+6e4*new Date().getTimezoneOffset()));for(let s=0;s<t.length;++s)if(0!=s&&"\\"==t[s-1]?++a:a=0,1==a%2){n+=t[s];continue}else if("\\"==t[s])continue;else if("Y"==t[s])n+=(e.getYear()+1900).toString().padStart(4,"0");else if("m"==t[s])n+=(e.getMonth()+1).toString().padStart(2,"0");else if("d"==t[s])n+=e.getDate().toString().padStart(2,"0");else if("H"==t[s])n+=e.getHours().toString().padStart(2,"0");else if("h"==t[s]){let t=e.getHours();n+=(0==t?12:12>=t?t:t-12).toString().padStart(2,"0")}else n+="i"==t[s]?e.getMinutes().toString().padStart(2,"0"):"s"==t[s]?e.getSeconds().toString().padStart(2,"0"):"v"==t[s]?e.getMilliseconds().toString().padStart(3,"0"):"a"==t[s]?12>e.getHours()?"am":"pm":"A"==t[s]?12>e.getHours()?"AM":"PM":t[s];return n},fcf.buildUrl=(e,t,r)=>{var n=e instanceof fcf.RouteInfo?e:new fcf.RouteInfo(e);e=`${n.protocol?n.protocol+"://":""}${n.server?n.server:""}${n.port?":"+n.port:""}${n.uri}`,t=fcf.append({},n.urlArgs,t);var a=!0;for(var s in t)e+=a?-1==e.indexOf("?")?"?":"&":"&",e+=s,null!==t[s]&&void 0!==t[s]&&(e+="=",e+="object"==typeof t[s]?encodeURIComponent(JSON.stringify(t[s])):encodeURIComponent(fcf.str(t[s]))),a=!1;return fcf.empty(r)?!fcf.empty(n.anchor)&&(e+="#"+n.anchor):e+="#"+r,e},fcf.RouteInfo=function(e,t,r){if(this.url="",this.referer="",this.uri="",this.urlArgs={},this.urlArgsRaw={},this.urlArgsStr="",this.postArgs={},this.postArgsRaw={},this.args={},this.argsRaw={},this.subUri="",this.anchor="",this.server="",this.port=void 0,this.protocol="","string"==typeof e&&(e={url:e}),e instanceof fcf.RouteInfo)fcf.append(!0,this,e),this.url=fcf.buildUrl(this.referer,this.urlArgs,this.anchor);else if(e&&"object"==typeof e&&"string"==typeof e.url){let n,a,s=e.url,o=-1;{let e=s.indexOf("://");-1==e?e=0:e+=3;let r=s.substring(0,e),n=s.substring(e),a=n.indexOf("?");-1==a&&(a=1/0);let o=n.indexOf("#");-1==o&&(o=1/0),a=_Mathmin(a,o);let i=n.substring(a===1/0?n.length:a);n=n.substring(0,a===1/0?n.length:a);let l=n.split("/"),c=[];for(let e=0;e<l.length;++e)if(""==l[e]){if(!r.length&&0==e)c.push(l[e]);else continue;}else if("."==l[e])continue;else if(".."!=l[e])c.push(l[e]);else if(1==c.length&&(r.length||"server"===t))continue;else c.pop();s=r+c.join("/")+i}if(n=fcf.rtrim(s.split("?")[0].split("#")[0],["/"]),"/"===n[0]){if("server"==t){s="http:/"+s;let e=n.indexOf("/",1);this.uri=-1==e?"/":n.substring(e),n="http:/"+n,o=4}else this.uri=n;}else if(o=n.indexOf("://"),-1!=o){let e=n.indexOf("/",o+3);this.uri=-1==e?"/":n.substr(e)}else if("root"==t)this.uri="/"+n;else if("server"==t){s="http://"+s;let e=n.indexOf("/");this.uri=-1==e?"/":n.substring(e),n="http://"+n,o=4}else this.uri=n;this.protocol=-1===o?"":n.substring(0,o);{if(-1!=o){let e=n.indexOf("/",o+3);-1==e&&(e=n.length),this.server=n.substring(o+3,e)}let e=this.server.split(":");this.server=e[0],this.port=parseInt(e[1])||void 0}this.referer=fcf.rtrim(-1==o?this.uri:this.protocol+"://"+this.server+(this.port?":"+this.port:"")+this.uri,["/"]);{let e=s.indexOf("?");if(-1!=e){let t=-1;t=s.indexOf("#"),-1==t&&(t=s.length),a=s.substring(e+1,t),queryArgsArr=a.split("&");for(let e of queryArgsArr){let t=e.split("=");this.urlArgs[decodeURIComponent(t[0])]=void 0===t[1]?void 0:decodeURIComponent(t[1])}}}{let e=s.indexOf("?");if(-1!=e){let t=-1;t=s.indexOf("#"),-1==t&&(t=s.length),this.urlArgsStr=s.substring(e+1,t),queryArgsArr=this.urlArgsStr.split("&");for(let e of queryArgsArr){let t=e.split("=");this.urlArgsRaw[decodeURIComponent(t[0])]=void 0===t[1]?void 0:decodeURIComponent(t[1])}}}for(let e in this.urlArgsRaw)this.urlArgs[e]=_autoParse(this.urlArgsRaw[e]);{let e=s.indexOf("#");-1!=e&&(this.anchor=s.substr(e+1))}for(let t in this.url=this.referer+(a?"?"+a:"")+(this.anchor?"#"+this.anchor:""),r&&"object"==typeof r&&fcf.append(!0,this.postArgsRaw,r),e.postArgsRaw&&"object"==typeof e.postArgsRaw&&fcf.append(!0,this.postArgsRaw,e.postArgsRaw),this.postArgsRaw)this.postArgs[t]=_autoParse(this.postArgsRaw[t]);"object"==typeof e.postArgs&&fcf.append(this.postArgs,fcf.clone(e.postArgs)),this.args=fcf.clone(fcf.append({},this.urlArgs,this.postArgs)),this.argsRaw=fcf.clone(fcf.append({},this.urlArgsRaw,this.postArgsRaw)),e.subUri&&(this.subUri=e.subUri)}},fcf.inlineExecution=(a_code,a_environment)=>{if(_isServer)return libInlineInterpreter.execute(a_code,a_environment);else{let funcCode=`((___fcf_environment, ___fcf_arg_environment)=>{ with(___fcf_environment) { with(___fcf_arg_environment) { return (${a_code}); } } })`,func=_inlineFunctions.get(_inlineFunctions);return func||(func=eval(funcCode),_inlineFunctions.set(funcCode,func)),func(fcf.getConfiguration()._tokenizeEnvironment||{},"object"==typeof a_environment?a_environment:{})}};const _inlineFunctions=new Map;fcf.tokenize=(e,r,n)=>{"object"==typeof r&&r||(r={});const a=typeof e;if("string"==a){let t=!!n&&n.quiet,a=n?n.result:"string";return _tokenize(e,r,"{{","}}",t,a)}if("object"==a)for(let a in e){const s=typeof e[a];("object"==s||"string"==s)&&(e[a]=fcf.tokenize(e[a],r,n))}return e},fcf.pattern=(e,r,n)=>{"object"==typeof r&&r||(r={});const a=typeof e;if("string"==a){let t=!!n&&n.quiet,a=n?n.result:"string";return _tokenize(e,r,"{","}",t,a)}if("object"==a)for(let a in e){const s=typeof e[a];("object"==s||"string"==s)&&(e[a]=fcf.pattern(e[a],r,n))}return e};const _tokenize=(t,n,a,s,o,i)=>{let l,c="",g=0,u=!1,d=0;for(;d=t.indexOf(a,d),-1!=d;)if(u=!0,l=t[d-1],"@"==l||"!"==l){let e=d+a.length;if(d=t.indexOf(s+l,e),-1==d){c+=t.substring(g,e-1-a.length),g=e,g-=a.length+1;break}if(1==a.length&&t[e]==a&&t[d-1]==s){d+=s.length+1;continue}c+=t.substring(g,e-1-a.length),g=e;let u;try{if("@"==l){let e=fcf.trim(t.substring(g,d));if(-1!=e.search(/^[a-zA-Z_. ][a-zA-Z0-9_. ]*$/)&&"true"!==e&&"false"!==e&&"undefined"!==e&&"NaN"!==e&&"null"!==e){let t=fcf.resolveEx(n,e);if((void 0===t.object||!(t.key in t.object))&&(t=fcf.resolveEx(fcf.getConfiguration()._tokenizeEnvironment,e),void 0===t.object))throw new fcf.Exception("ACCESS_FAILED_FIELD_TOKENIZE",{command:e});u=t.object[t.key]}else u=fcf.inlineExecution(e,n)}else u=fcf.t(t.substring(g,d)),-1!==u.indexOf(a)&&(u=_tokenize(u,n,a,s,o,i))}catch(r){if(!o)throw r;d+=a.length+1,c+=t.substring(g-a.length-1,d),g=d;break}if(0==c.length&&d+a.length+1==t.length&&"auto"==i)return u;c+=u,d+=a.length+1,g=d}else{d+=a.length;continue}return u?(c+=t.substring(g),c):t};fcf.t=(e,t)=>(_translateInit||fcf.appendTranslate(),t=t||(fcf.getContext()?fcf.getContext().language:fcf.getConfiguration().defaultLanguage),_translations[t]&&e in _translations[t]?_translations[t][e]:e),fcf.translate=(e,r)=>{const n=typeof e;if("string"==n)return _translate(e,r);if("object"==n)for(let n in e){const a=typeof e[n];("object"==a||"string"==a)&&(e[n]=fcf.translate(e[n],r))}return a_code};const _translate=(e,t)=>{let r,n="",a=0,s=0,o=!1;for(;s=e.indexOf("{",s),-1!=s;)if(o=!0,"!"==e[s-1]){let r="{"==e[s+1];if(n+=e.substring(a,s-1),a=s+(r?2:1),s=e.indexOf(r?"}}!":"}!",a),-1==s){a-=r?3:2;break}n+=fcf.t(e.substring(a,s),t),s+=r?3:2,a=s}else{s+=1;continue}return o?(n+=e.substring(a),n):e};fcf.appendTranslate=(e,t)=>{let r={},n={};fcf.actions().then(()=>{e&&(e=Array.isArray(e)?e:[e],fcf.getConfiguration().append({translations:e}));for(let e of fcf.getConfiguration().translations){let a;if("string"==typeof e)if(a=fcf.getPath(e),!t&&a in _translationsFiles)e=_translationsFiles[a];else{let t;e=fcf.load(a,{format:"json",async:!1}).exception().result()}e=Array.isArray(e)?e:[e];for(let t of e)r[t.language]=fcf.append({},r[t.language],t.translations);a&&(n[a]=e)}}).then(()=>{_translations=r,_translationsFiles=n}).finally(()=>{_translateInit=!0}).catch(t=>{throw t})},fcf.getTranslations=()=>_translationsFiles;let _translateInit=!1,_translations={},_translationsFiles={};fcf.EventChannel=class e{constructor(){this._callbacks={},this._counters={},this._led={}}on(e,t,r){this._on(e,t,r,!1)}once(e,t,r){this._on(e,t,r,!0)}onmet(e,t,r){if(e in this._counters){"function"==typeof t&&(r=t,t=void 0);let n={name:e},a=this._led[e];return fcf.actions().then(()=>r(a,n)).then(()=>a)}this._on(e,t,r,!0)}detach(e,t){if("function"==typeof e&&(t=e,e=void 0),!t||!t.___fcffuncids)return;let r;for(let n in e?(r={},this._callbacks[e]&&(r[e]=this._callbacks[e])):r=this._callbacks,r){let e=r[n];for(let r in t.___fcffuncids){let a=t.___fcffuncids[r].level;if(a in e.levels&&(e.levels[a][r]&&delete t.___fcffuncids[r],delete e.levels[a][r],fcf.empty(e.levels[a]))){delete e.levels[a];let t=e.order.indexOf(a);-1!=t&&e.order.splice(t,1),e.order.length||delete this._callbacks[n]}}}}send(e,t,r){r===void 0&&(r=t,t={}),e in this._counters?++this._counters[e]:this._counters[e]=1,this._led[e]=r;let n={name:e};if(!(e in this._callbacks))return fcf.actions().result(t.exresult?{event:r,header:n}:r);let a,s,o=this._callbacks[e],i=[],l=[];for(let c of o.order){let e=o.levels[c];for(let t in e)if(!a){e[t].once&&l.push({level:c,id:t});try{a=e[t].cb(r,n)}catch(t){s=t;break}a instanceof Promise||a instanceof fcf.Actions||(a=void 0)}else i.push([c,t,e[t].cb,e[t].once]);if(s)break}if(a)return fcf.actions().then(()=>a).each(i,(e,t,a,s)=>{t[3]&&l.push({level:t[0],id:t[1]});let o;try{o=t[2](r,n)}catch(t){return void s.error(t)}o instanceof Promise||o instanceof fcf.Actions?o.then(()=>{s.complete()}).catch(t=>{s.error(t)}):s.complete()}).finally(()=>{for(let t of l)if(delete o.levels[t.level][t.id],fcf.empty(o.levels[t.level])){delete o.levels[t.level];let r=o.order.indexOf(t.level);-1!=r&&o.order.splice(r,1),o.order.length||delete this._callbacks[e]}}).then(()=>t.exresult?{event:r,header:n}:r);for(let n of l)if(delete o.levels[n.level][n.id],fcf.empty(o.levels[n.level])){delete o.levels[n.level];let t=o.order.indexOf(n.level);-1!=t&&o.order.splice(t,1),o.order.length||delete this._callbacks[e]}return s?fcf.actions().error(s):fcf.actions().result(t.exresult?{event:r,header:n}:r)}count(e){return e in this._counters?this._counters[e]?this._counters[e]:1:0}_on(e,t,r,n){"function"==typeof t&&(r=t,t=void 0);let a=t&&t.level?parseFloat(t.level):0,s=fcf.id();"___fcffuncids"in r||Object.defineProperty(r,"___fcffuncids",{value:{},writable:!1,enumerable:!1}),r.___fcffuncids[s]={level:a},e in this._callbacks||(this._callbacks[e]={order:[],levels:{}});let o=this._callbacks[e];a in o.levels||(o.levels[a]={},o.order.push(a),o.order.sort((e,t)=>e<t?-1:e>t?1:0)),o.levels[a][s]={cb:r,once:n}}},fcf.Exception=class e extends Error{constructor(e,t,r){super(e);let n,a,s,o=1;if(t instanceof Error&&(r=t,t={}),Array.isArray(t))for(var l=0;l<t.length;++l)this[l+1]=t[l];else if(t instanceof Error)r=t,t=void 0;else if("object"==typeof t)for(let e in t)this[e]=t[e];if("string"==typeof e)a=_exceptions[e],a?n=e:(n="ERROR",a=_exceptions[n],this.error=e);else if(e instanceof Error)n="ERROR",s=e.stack||e.stacktrace,o=0,a=_exceptions[n],this.error=fcf.parseError(e).fullMessage;else if("object"==typeof e)if(a=_exceptions[e.name],!a){if(e._templateMessage){for(let t in e)this[t]=e[t];n=e.name?e.name:"ERROR",a=e._templateMessage}if(e.message&&(e.stack||e.stacktrace))n="ERROR",s=e.stack||e.stacktrace,o=0,a=_exceptions[n],this.error=e.message;else{for(let t in e)this[t]=e[t];n=e.name?e.name:"ERROR",a=_exceptions.ERROR,this.error=e.error?e.error:e.message?e.message:"Unknown error"}}else{for(let t in e)this[t]=e[t];n=e.name}if(this.name=n,this._templateMessage=a,this.exception=r,!Array.isArray(this.stackArr)){if(s||(s="object"==typeof console&&"function"===console.trace?console.trace():new Error().stack),void 0===s)try{throw new Error}catch(t){s=t.stack}this.stackArr=fcf.parseStack(s,o)}this.message=this.toString()}toString(e,t,r){let n="";if(n=fcf.t(this._templateMessage,r),n=fcf.tokenize(n,this,{quiet:!0}),e&&(n+="\nStack: "+fcf.replaceAll("\n"+fcf.stackToString(this),"\n","\n ")),t){let t=this,a=" ";for(;t.exception;){t=t.exception;let s="\nSub Error: ";s+=t.toString(!1,!1,r),e&&(s+="\nStack: "+fcf.replaceAll("\n"+fcf.stackToString(t),"\n","\n ")),n+=fcf.replaceAll(s,"\n","\n"+a),a+=" "}}return n}},fcf.addException=function(e,t){_exceptions[e]=t};let _exceptions={};fcf.addException("INVALID_COMMAND_TOKENIZE_INTERPETER","Invalid command during interpreter tokenization in command \"@{{command}}@\""),fcf.addException("ACCESS_FAILED_FIELD_TOKENIZE","Accessing a field on an invalid element in a command \"@{{command}}@\" "),fcf.addException("ERROR","@{{error}}@"),fcf.addException("RESOLVE_PATH_ERROR","Failed resolve path '@{{path}}@'"),fcf.addException("GET_PATH_INFO_ERROR","It was not possible to determine the package for the path '@{{path}}@'"),fcf.addException("GET_PATH_ERROR_INVALID_MODULE_NAME","Failed resolve path '@{{path}}@'. Invalid module name"),fcf.addException("REQUEST_ERROR","Request failed @{{url}}@"),fcf.addException("HTTP_REQUEST_ERROR","HTTP request failed @{{code}}@"),fcf.addException("LOAD_MODULE","Failed to load JS module @{{module}}@"),fcf.addException("LOAD_UNITEST_MODULE","Failed to load fcf-framework-unitest module. Install the missing module to perform testing: $ npm install fcf-framework-unitest"),fcf.Context=class e{constructor(e,t){this.language=fcf.getConfiguration?fcf.getConfiguration().defaultLanguage:"en",this.debug=!1,this.session={user:{groups:{},roles:{},user:""}};let r,n=e&&e.headers&&"string"==typeof e.headers.cookie?e.headers.cookie:_isServer?void 0:decodeURIComponent(document.cookie);if(n){let e=n.split(";").map(e=>{e=fcf.trim(e);let t=e.indexOf("=");return[e.substring(0,t),e.substring(t+1)]}).find(e=>"fcf-context"==e[0]);e&&(r=e[1])}if(!r&&e&&e.headers&&typeof e.headers["fcf-context"]&&(r=e.headers["fcf-context"]),!r&&e&&"string"==typeof e.context&&(r=e.context),r)try{let e=JSON.parse(fcf.decodeBase64(r));e.session&&"object"==typeof e.session||(e.session={}),e.session.user={groups:{},roles:{},user:""},"function"==typeof t&&t(e),fcf.append(this,e)}catch(t){console.log("Failed to read context from request")}else if(e&&e.context&&"object"==typeof e.context){let r=fcf.clone(e.context);r.session&&"object"==typeof r.session||(r.session={}),r.session.user={groups:{},roles:{},user:""},"function"==typeof t&&t(r),fcf.append(this,r)}if(e&&e.route&&"string"==typeof e.route.path){let t={};"object"==typeof e.body&&(t=e.body),this.route=new fcf.RouteInfo(e.originalUrl,"relative",t)}else this.route=new fcf.RouteInfo(e&&"string"==typeof e.url?e.url:_isServer?void 0:window.location.href,"relative",e&&e.postArgs)}},fcf.getContext=()=>{if(_isServer){let e=libState.getState();return e.context||(e.context=new fcf.Context,fcf.getConfiguration().warnEmptyContext&&fcf.log.wrn("FCF","In system using empty context !!!",fcf.stackToString(new Error().stack)),fcf.setContext(e.context)),e.context}return _state.context},fcf.setContext=e=>{if(_isServer){let t=libState.getState();return libState.setState({context:e,state:t.state})}_state.context=e},fcf.getState=()=>_isServer?libState.getState():_state,fcf.setState=e=>_isServer?libState.setState({context:e&&e.context,state:e&&e.state||{}}):void(_state={context:e&&e.context,state:e&&e.state||{}}),fcf.saveContext=e=>{let t=fcf.append({},fcf.getContext());if(delete t.route,delete t.args,_isServer)e&&("function"==typeof e.setCookie?e.setCookie("fcf-context",fcf.encodeBase64(JSON.stringify(t)),{maxAge:fcf.getConfiguration().sessionLifetime,path:"/",sameSite:"Lax"}):"function"==typeof e.cookie&&e.cookie("fcf-context",fcf.encodeBase64(JSON.stringify(t)),{maxAge:fcf.getConfiguration().sessionLifetime,path:"/",sameSite:"Lax"}));else{let e=new Date;e.setTime(e.getTime()+31536000000);var r="expires="+e.toUTCString();document.cookie="fcf-context="+fcf.encodeBase64(JSON.stringify(t))+"; path=/ ; SameSite=Lax;"+r}};let _state={context:new fcf.Context,state:{}};class EventEmitter{constructor(){this._eventEmitterEvents={}}on(e,t){e in this._eventEmitterEvents||(this._eventEmitterEvents[e]={}),"object"!=typeof t._eventEmitterEvents&&Object.defineProperty(t,"_eventEmitterEvents",{value:{},writable:!1,enumerable:!1}),t._eventEmitterEvents[e]||(t._eventEmitterEvents[e]={});let r=fcf.id();t._eventEmitterEvents[e][r]=1,this._eventEmitterEvents[e][r]=t}detach(e,t){"function"==typeof e&&(t=e,e=void 0);let r={};if(e?r[e]=1:r=t._eventEmitterEvents,r&&t._eventEmitterEvents)for(let e in r)if(this._eventEmitterEvents[e]&&t._eventEmitterEvents[e])for(let r in t._eventEmitterEvents[e])delete this._eventEmitterEvents[e][r]}emit(e,t){return e in this._eventEmitterEvents?fcf.actions().each(this._eventEmitterEvents[e],(e,r)=>r(t)):fcf.actions()}}fcf.EventEmitter=EventEmitter;class Logger extends fcf.EventEmitter{constructor(e){super(),e=e||{},this._configuration=new fcf.Configuration,this._configuration.append({logLevel:Logger.LOG,logFile:void 0,logLifeTime:10,logHandlers:["fcf.Logger.timeHandler","fcf.Logger.spaceServerHandler","fcf.Logger.pidHandler","fcf.Logger.spaceHandler","fcf.Logger.levelHandler","fcf.Logger.spaceHandler","fcf.Logger.modHandler","fcf.Logger.colonHandler","fcf.Logger.messageHandler","fcf.Logger.consoleHandler","fcf.Logger.fileHandler"]}),this._configuration.append(e)}getConfiguration(){return this._configuration}tst(e,t){return this._log(Logger.TST,arguments)}crh(e,t){return this._log(Logger.CRH,arguments)}err(e,t){return this._log(Logger.ERR,arguments)}wrn(e,t){return this._log(Logger.WRN,arguments)}log(e,t){return this._log(Logger.LOG,arguments)}inf(e,t){return this._log(Logger.INF,arguments)}dbg(e,t){return this._log(Logger.DBG,arguments)}trc(){return this._log(Logger.TRC,arguments)}_log(e,t){let r=this._configuration.logLevel;if(r=isNaN(r)?"tst"==r||"test"==r?Logger.TST:"crh"==r||"crash"==r?Logger.CRH:"err"==r||"error"==r?Logger.ERR:"wrn"==r||"warning"==r?Logger.WRN:"inf"==r||"info"==r?Logger.INF:"dbg"==r||"debug"==r?Logger.DBG:"trc"==r||"trace"==r?Logger.TRC:Logger.LOG:parseFloat(r),e>r)return fcf.actions();let n={level:e,module:t[0],output:"",message:"",args:fcf.append([],t).slice(1),logger:this,break:!1};return fcf.actions().then(()=>this.emit("message_before",n)).each(this._configuration.logHandlers,(e,t)=>{if(!n.break){let e="string"==typeof t?fcf.resolve(_isServer?global:window,t):"function"==typeof t&&t;return"function"==typeof e?e(n):void 0}}).then(()=>this.emit("message_after",n))}}fcf.Logger=Logger,Logger.TST=0,Logger.CRH=10,Logger.ERR=20,Logger.WRN=30,Logger.INF=40,Logger.LOG=50,Logger.DBG=60,Logger.TRC=70;class LoggerOffset{constructor(e,t){this.offset=isNaN(e)?0:parseInt(e),this.prefix=t}}Logger.Offset=LoggerOffset,Logger.offset=(e,t)=>new LoggerOffset(e,t),fcf.Logger.spaceHandler=e=>{e.output+=" "},fcf.Logger.spaceServerHandler=e=>{_isServer&&(e.output+=" ")},fcf.Logger.timeHandler=e=>{e.output+=fcf.formatDate(new Date,"Y-m-d H:i:s.v")},fcf.Logger.pidHandler=e=>{_isServer&&(e.output+="[PID:"+process.pid+"]")},fcf.Logger.levelHandler=e=>{let t=e.level<=Logger.TST?"TST":e.level<=Logger.CRH?"CRH":e.level<=Logger.ERR?"ERR":e.level<=Logger.WRN?"WRN":e.level<=Logger.INF?"INF":e.level<=Logger.LOG?"LOG":e.level<=Logger.DBG?"DBG":"TRC";e.output+="["+t+"]"},fcf.Logger.modHandler=e=>{e.output+="[MOD:"+e.module+"]"},fcf.Logger.colonHandler=e=>{e.output+=": "},fcf.Logger.messageHandler=e=>{function t(e){r&&"string"==typeof e&&(e=fcf.replaceAll(e,"\n","\n"+r+n)),a.push(e)}let r="",n="",a=[];for(var s=0;s<e.args.length;++s)if(e.args[s]instanceof fcf.Logger.Offset)n=e.args[s].prefix||n,r+=fcf.pad("",e.args[s].offset," ","c");else if(!("object"==typeof e.args[s]))t(e.args[s]);else if(e.args[s]instanceof fcf.Exception)t(e.args[s].toString(!0,!0,!0));else if(e.args[s]instanceof Error){const r=fcf.parseError(e.args[s]);t(r.fullMessage),t("\nStack:"),t(fcf.replaceAll("\n"+r.stack,"\n","\n "))}else t(_objectToString(e.args[s]));e.message=a.join(" "),e.output+=e.message},fcf.Logger.consoleHandler=e=>{_selfLoggerCall||(_selfLoggerCall=!0,console.log.call(console,e.output),_selfLoggerCall=!1)};let _selfLoggerCall=!1;fcf.Logger.fileHandler=e=>_isServer?libLogger.fileHandler(e):void 0,fcf.test=function(e,t,r,n){let a=arguments,s=!1;return fcf.actions().catch(e=>{if(!s)return new fcf.Exception("LOAD_UNITEST_MODULE",e)}).catch(e=>{fcf.log.err("unitest",e)}).then(()=>_isServer||"___fcf_unitest"in fcf.getContext().route.args?fcf.require("fcf-framework-unitest",{quiet:!0}):void 0).then(e=>{if(!fcf.NUnitest||!fcf.NUnitest.unitest){if(!e)return;throw new fcf.Exception("LOAD_MODULE",{module:"fcf-framework-unitest"})}s=!0,fcf.NUnitest.unitest.add.apply(fcf.NUnitest.unitest,a)})},fcf.Configuration=class e extends EventEmitter{constructor(e){if(super(),this._config=[[],[],[]],this._config[0].push({merge:{merge:"fcf.append"}}),e&&e.enableDefaultParams){const e="@{{directory}}@/@{{shortName}}@@{{!fcf.getContext().debug && name.indexOf(\".min.\") == -1 ? \".min\" : \"\"}}@.@{{extension}}@";if(this._config[0].push({warnEmptyContext:!1,defaultLanguage:"en",moduleDirectories:_isServer?[libPath.join(require("path").dirname(require.main.filename),"node_modules")]:[],webModuleDirectory:"/node_modules",aliases:{},translations:[],sessionLifetime:31536000,tokenize:{objects:{},functions:[]},merge:{moduleDirectories:"fcf.append",sources:"fcf.NDetails.mergeSourcesConfig",aliases:"fcf.append",translations:"fcf.append",tokenize:"fcf.NDetails.mergeTokenizeConfig",packages:"fcf.NDetails.mergePackagesConfig"},sources:{"fcf-framework-core":{webMain:"fcf.js",webFilePath:{js:"@{{directory}}@/@{{shortName}}@@{{!fcf.getContext().debug && name.indexOf(\".min.\") == -1 ? \".min\" : \"\"}}@.@{{extension}}@"}},"fcf-framework-unitest":{webMain:"unitest.js",webFilePath:{js:"@{{directory}}@/@{{shortName}}@@{{!fcf.getContext().debug && name.indexOf(\".min.\") == -1 ? \".min\" : \"\"}}@.@{{extension}}@"}}},packages:{}}),_isServer){let e=require("./serverConfig.js");this._config[0].push(e)}}e&&"object"==typeof e.configuration&&this._config[2].push(e.configuration),e&&e.isDefault&&(_configuration=this),this._apply(),e&&e.configuration instanceof fcf.Configuration&&e.configuration.on("update_after",e=>{this._apply(e.object)})}appendPackage(e){"object"!=typeof e||(this._config[1].push(e),this._apply(e),e instanceof fcf.Configuration&&e.on("update_after",e=>{this._apply(e.object)}))}append(e){"object"!=typeof e||(e instanceof fcf.Configuration||this._config[2][this._config[2].length-1]instanceof fcf.Configuration||"object"!=typeof this._config[2][this._config[2].length-1]?this._config[2].push(e):this._applyConfig(e,this._config[2][this._config[2].length-1]),this._apply(e),e instanceof fcf.Configuration&&e.on("update_after",e=>{this._apply(e.object)}))}_apply(e){for(let t in e&&this.emit("update_before",{object:e,configuration:this}),this)"_"!=t[0]&&"merge"!=t&&delete this[t];for(let t of this._config)for(let e of t)this._applyConfig(e);_isServer&&libResolver.appendModuleDirectory(this.moduleDirectories),this._build(),e&&this.emit("update_after",{object:e,configuration:this})}_applyConfig(e,t){function r(e,t,n,a,s,o,i){if(e.items[t]||o){let o=!!e.items[t]&&e.items[t].func;if(o=o&&fcf.resolve("object"==typeof global?global:window,o),o?t in a?n[t]=o(fcf.clone(a[t]),fcf.clone(s[t])):i&&(n[t]=fcf.clone(s[t])):i&&(n[t]=fcf.clone(s[t])),e.items[t]){let o=e.items[t];for(let i in o.items)s[t]&&i in s[t]&&(t in a?r(e.items[t],i,n[t],a[t],s[t],!1,void 0!==o.items[i].func):n[t][i]=fcf.clone(s[t][i]))}}else i&&(n[t]=fcf.clone(s[t]))}if(e&&"object"==typeof e){t||(t=this),this.merge=fcf.append({},this.merge,e.merge);let n={};for(let e in this.merge){let t,r=this.merge[e];"object"==typeof r&&(t=r.file,r=r.function);let a=!!("string"==typeof r&&r)&&r;t&&"function"!=typeof fcf.resolve(_isServer?global:window,a)&&fcf.require(t,{async:!1}),"function"!=typeof fcf.resolve(_isServer?global:window,a)&&(fcf.log.wrn("FCF",`Could not find merge function ${a} for config parameter "${e}"`),a=!1);let s=fcf.parseObjectAddress(e),o={items:n};for(let e of s)e in o.items||(o.items[e]={items:{},func:void 0}),o=o.items[e];o.func=a}let a={};for(let s in e)"_"!=s[0]&&(r({items:n},s,a,t,e,!0,!0),t[s]=a[s])}}_build(){this._tokenizeFunctions={functions:{},items:{}};let e={},t=[],r=this.tokenize&&this.tokenize.functions?this.tokenize.functions:[],n=this.tokenize&&this.tokenize.objects?this.tokenize.objects:{};for(let e of r){let n="string"==typeof e.object?e.object:Array.isArray(e.object)&&"string"==typeof e.object[0]?e.object[0]:"",a="string"==typeof e.object?e.object:Array.isArray(e.object)&&"string"==typeof e.object[1]?e.object[1]:"",r=fcf.parseObjectAddress(n),s=fcf.parseObjectAddress(a),o=r.pop();if(-1!=e.allow.indexOf("*")||-1!=e.allow.indexOf("constructor"))if(""!=o&&"*"!=o)s.pop(),t.push({object:[r.length?fcf.normalizeObjectAddress(r):"",s.length?fcf.normalizeObjectAddress(s):""],allow:[o]});else if("*"==o&&e.class){let r=fcf.parseObjectAddress(e.class);o=r.pop(),t.push({object:r.length?fcf.normalizeObjectAddress(r):"",allow:[o]})}}let a=[r,t];for(let t of a)for(let n of t){let t=this._tokenizeFunctions;n=fcf.clone(n);let a="string"==typeof n.object?n.object:Array.isArray(n.object)&&"string"==typeof n.object[0]?n.object[0]:"",s="string"==typeof n.object?n.object:Array.isArray(n.object)&&"string"==typeof n.object[1]?n.object[1]:"";n.object=[a,s];let r=fcf.parseObjectAddress(a),o=fcf.parseObjectAddress(s);for(;r.length&&"*"==r[r.length-1];)r.pop();for(;o.length&&"*"==o[o.length-1];)o.pop();if(r.length&&o.length&&(1!=r.length||""!=r[0])&&(1!=o.length||""!=o[0])){let t=fcf.normalizeObjectAddress(r),n=fcf.normalizeObjectAddress(o);e[t]={variable:n,access:!1}}if(n.object[0])for(let e of fcf.parseObjectAddress(n.object[0]))t.items[e]||(t.items[e]={functions:{},items:{}}),t=t.items[e];let i=Array.isArray(n.allow)?n.allow:["*"];for(let e of i)Array.isArray(t.functions[e])||(t.functions[e]=[]),t.functions[e].push(n)}this._tokenizeEnvironment={},this._tokenizeEnvironmentInfo={parts:{}};for(let t=0;2>t;++t){let r=t?n:e,a=!!t;for(let e in r){let t=fcf.parseObjectAddress(e),n=fcf.clone(t),s=n.pop(),o=fcf.prepare(this._tokenizeEnvironment,n),i="string"==typeof r[e]?{variable:r[e]}:"object"==typeof r[e]?r[e]:{};"string"!=typeof i.variable&&(i.variable=e);let l=fcf.resolve("undefined"==typeof global?window:global,i.variable);try{if(a||!(s in o)||"function"==typeof o[s]){let e=Object.getOwnPropertyDescriptor(o,s);(!e||e.writable)&&(o[s]=l)}}catch(t){}let c=this._tokenizeEnvironmentInfo;for(let e of t)c.parts[e]||(c.parts[e]={parts:{}}),c=c.parts[e];(a||!("access"in c))&&(c.access=!("access"in i)||i.access)}}fcf.appendTranslate()}},fcf.getConfiguration=()=>_configuration;let _configuration;fcf.NDetails.mergeTokenizeConfig=(e,t)=>(e.objects=fcf.append({},e.objects,t.objects),e.functions=fcf.append([],e.functions,t.functions),e),fcf.NDetails.mergeSourcesConfig=(e,t)=>{e=e||{},t=t||{};let r=fcf.clone(e);for(let n in t)r[n]=fcf.append({},e[n],t[n]),r[n].files=fcf.append(!0,{},e[n]&&e[n].files,t[n]&&t[n].files),r[n].webFiles=fcf.append(!0,{},e[n]&&e[n].webFiles,t[n]&&t[n].webFiles),r[n].serverFiles=fcf.append(!0,{},e[n]&&e[n].serverFiles,t[n]&&t[n].serverFiles);return r},fcf.NDetails.mergePackagesConfig=(e,t)=>{let r=fcf.clone(e);for(let n in t)r[n]?fcf.append(r[n],fcf.clone(t[n])):r[n]=fcf.clone(t[n]);return r},new fcf.Configuration({enableDefaultParams:!0,isDefault:!0}),fcf.getEventChannel=()=>_eventChannel,_eventChannel=new fcf.EventChannel,fcf.log=new Logger(fcf.getConfiguration()),_isServer&&libResolver.appendModuleDirectory(_configuration.moduleDirectories),!_isServer&&"___fcf_unitest"in fcf.getContext().route.args&&fcf.require("fcf-framework-unitest").then(()=>{if(!fcf.NUnitest||!fcf.NUnitest.unitest)throw new fcf.Exception("LOAD_MODULE",{module:"fcf-framework-unitest"});fcf.getEventChannel().onmet("page_ready",()=>fcf.actions().then(()=>fcf.NUnitest.unitest.runAutoTests()).catch(t=>{fcf.log.err("UniTest",t)}))}),_isServer||document.addEventListener("DOMContentLoaded",()=>{fcf.getEventChannel().send("page_ready",{})}),_modules[_getModulePath("fcf-framework-core:fcf.js")]={state:"ok",result:fcf}})();